Bug - Fixed -buddy-bjorn and -crownofthrones maximizer keywords failing when bjorn or crown isn't equipped

The issue is more or less in the title here. the `-buddy-bjorn` keyword should prevent the bjornified familiar from being changed by the maximizer. If you run the maximizer while the bjorn is equipped, it functions as intended. If you run the maximizer without the bjorn equipped, however, it will either bjornify a different familiar or refuse to equip the bjorn entirely. I'm not sure what differences in circumstances lead to one situation or the other.


To replicate, use a maximizer string along the lines of `familiar weight, -buddy-bjorn, +420 bonus buddy bjorn` in several cases: first, with the bjorn equipped, and a weight familiar bjornified; second, with the bjorn equipped, and a non-weight familiar bjornified; third, with the bjorn unequipped, and a weight familiar bjornified; finally, with the bjorn unequipped, and a non-weight familiar bjornified.
 

VladYvhuce

Member
I don't know much about maximizer strings. So, from a layman's view, it looks like you're giving conflicting commands.
 
The item "buddy bjorn" is an item equipped in the back slot. the slot "buddy-bjorn" is a slot in which bjornified familiars are equipped. The behavior described is an attempt to ask the maximizer to equip the item "buddy bjorn" without altering what is currently in the "buddy-bjorn" slot.

Hope that helps!
 
Apart from trying to save on clicks, why not just equip the buddy bjorn manually?
The situation is basically this:
We have decided what the best familiar for the Bjorn is (this is a complicated problem to solve because it has to do with the frequency and mall price of specific drops). We do not know if that Bjorn with best familiar is the best in slot. You cannot currently craft a maximizer string that will let you apply a specific bonus to the Bjorn while also locking the specific familiar in it.
 

heeheehee

Developer
Staff member
Do you have both bjorn and crown?

What's the rationale for applying a specific bonus to Crown of Thrones / Bjorn? Combat drops?
 
Mostly combat drops, yeah. Often we will do a -equip for the crown/bjorn we don't want, because it's also hard to tell it not to equip both of them.
 

heeheehee

Developer
Staff member
I'm super confused by bjorn / crown handling in that their occupants don't seem to actually be handled as equipment, other than for the purposes of maximizer speculation.

I'll ask again: do you have both bjorn and crown?

Java:
// If you have a familiar carrier, we'll need to check 1 or 2 Familiars best carried
// unless you specified not to change them

if ( ( ( id == ItemPool.HATSEAT && this.slots[ EquipmentManager.CROWNOFTHRONES ] >= 0 ) ||
       ( id == ItemPool.BUDDY_BJORN && this.slots[ EquipmentManager.BUDDYBJORN ] >= 0 ) ) &&
     !KoLCharacter.isSneakyPete() && !KoLCharacter.inAxecore() && !KoLCharacter.isJarlsberg() )
{
        this.carriedFamiliarsNeeded++;
}

Now that I'm looking at the code, it'll consider swapping familiars unless you specify -crownofthrones, -buddy-bjorn for each of the corresponding IotMs that you currently have.
 

heeheehee

Developer
Staff member
Now, this isn't the full story, since I can still reproduce the "want to unequip back" side of things. But it may explain the incorrect bjornifying behavior.
 

heeheehee

Developer
Staff member
Okay. So, it looks like the only way to equip buddy bjorn is via the bjornify command.

A silly maximizer expression:

+100 bonus buddy bjorn, -tie

yields:

bjornify (none) (+100)

along with some other super-tiebreakers as recommended actions (item droppers, meat droppers, rollover effects).

Adding on -buddy-bjorn forbids that action, therefore causing it to instead... unequip the item, as it's decided not to equip any back item and instead rely on bjornify to do so. Hm.
 

heeheehee

Developer
Staff member
It looks like the core issue is that we're only setting useBjornFamiliar / useCrownFamiliar if the corresponding equipment is currently being worn. This is almost identically the bug as reported. Thanks!

https://github.com/kolmafia/kolmafia/pull/5 even though I could commit this directly, as part of getting us in the habit of code review for non-urgent changes.
 

heeheehee

Developer
Staff member
We could also easily fix the logic to never `bjornify (none)`, although that's not in the pull request currently.
 
This should be fixed in r20939. Let me know if it isn't.
I didn't test it that night! But I have now.

It does appear to still be broken, but in a different way!

When I give mafia the maximizer string
Code:
Familiar Weight,  -buddy-bjorn, -crown-of-thrones, 100 bonus pantogram pants, 145.5 bonus Buddy Bjorn, 180 bonus Mr. Screege's spectacles, 250 bonus Mr. Cheeng's spectacles, 353.5 bonus bag of many confections, 400 bonus lucky gold ring
, I get

Code:
<html><font color=gray>keep hat: crumpled felt fedora</font></html>
equip weapon Fourth of May Cosplay Saber (+10)
equip off-hand Fourth of May Cosplay Saber (+10)
unequip back (Buddy Bjorn, -146)
<html><font color=gray>keep shirt: Stephen's lab coat</font></html>
<html><font color=gray>keep pants: pantogram pants</font></html>
<html><font color=gray>keep acc1: lucky gold ring</font></html>
equip acc2 Mr. Cheeng's spectacles (+250)
equip acc3 Mr. Screege's spectacles (+180)
<html><font color=gray>keep familiar: amulet coin</font></html>

A few things are wrong here, of course. It wants to dual-wield cosplay sabers, but that seems to be related to the fact that my code is using custom outfits.

It knows that unequipping the bjorn loses me points, but it unequips it nevertheless. Very weird!
 
Top