Crowther
Active member
elemental_resistance reports negative numbers if your cold resistance is negative, but KoL limits it to 0.
In the above example, elemental_resistance should have return 0, not -120. I checked many positive values and the ice baby test showed KoLmafia correctly predicted cold resistance.
EDIT:
KoLCharacter.java:elementalResistanceByLevel contains:
which should probably be
Code:
> ash numeric_modifier("cold resistance")
Returned: -12.0
> ash elemental_resistance($element[cold])
Returned: -120.0
> ash import crspade;use(1, ifind())
Using 1 ice baby...
You acquire an item: ice pick
You lose 718 hit points
Finished using 1 ice baby.
Returned: true
> ash print(my_maxhp() * .05)
717.3000000000001
Returned: void
EDIT:
KoLCharacter.java:elementalResistanceByLevel contains:
Code:
value = levels * 10.0;
Code:
value = max(levels * 10.0, 0);