Bug - Fixed Base max HP incorrect in Grey You

Irrat

Member
In Grey You health is retrieved mainly from absorbs and equipment. However the absorbs for health isn't shown, so mafia must derive the max health using the current max health, then subtracting health modifiers. Which it doesn't do.

Here is where it finds our base health.
Here is where the base health is set.
Here is where health is calculated for Grey You.

I have a shirt that grants +400 HP, my base health is 100. Mafia records my base HP as 500.
That would be fine, except in the link you can see mafia uses the base health, then adds modifier of 400 for maximizer. So when maximizer runs, it thinks my base health is 500, and the shirt is making it 900.

As a quick example, if I run maximizer and tell it to give me a max of 500 health along other modifiers. If I have no health effecting equipment on, maximizer will correctly give me the desired outfit giving me 500 health.

However, if I'm already wearing an outfit giving me 500 health, maximizer will determine that I do not need to wear any health boosting equipment as it sees 900 health, and will unequip the items that were boosting my health to 500, and report a success with my health at 100.

This is likely an issue with MP as well.
 

Veracity

Developer
Staff member
Looking at my charsheet, it shows base muscle, mysticality, and moxie - but no base HP or MP.
Therefore, when the CharSheet calls setHP or setMP, it defaults to maximumHP and maximumMP for base.

The charpane does not show your base HP, either; it shows current/max.
api.php has "hp":"519","mp":"550" and "maxhp":636,"maxmp":693

So, none of the three places actually shows us "base HP".

So, everywhere in KoLmafia, "baseMaxHP" is the same as "Buffed HP Maximum".

Everywhere except in Grey You and Robocore, Modifiers derives the (speculated) Maximum HP from your Muscle.
Robocore starts with 30 (Wiki says it depends on class, but did not give any data, so I used what I saw as an AT).
Grey You should start with Maximum HP and subtract KoLCharacter.currentModifiers.get(Modifiers.HP) to get the HP base and then add in the speculation.

So, yes - I think your analysis is correct.
 

Veracity

Developer
Staff member
Although, we have a test in ModifiersTest which is not showing an error.

Because it is not actually testing "speculation". I.e., you have a +HP item equipped and propose adding another item.
I guess the first step would be to write such a test.
 
Top