Bug Negative Elemental Resistance doesn't increase damage

Crowther

Active member
elemental_resistance reports negative numbers if your cold resistance is negative, but KoL limits it to 0.
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
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:
Code:
value = levels * 10.0;
which should probably be
Code:
value = max(levels * 10.0, 0);
 

heeheehee

Developer
Staff member
The only thing negative resistance seems to affect is the PvP mini. I've seen a value of -2 before.
 

Crowther

Active member
How does cold resistance go negative?
Yeah, it was kind of unexpected for me. I just wanted a control case for testing low damage elemental resistance so I did "maximize -cold res". I never expected it to go negative.
 

heeheehee

Developer
Staff member
Oh, I guess it affects Haunted Kitchen --- you can totally open a negative number of drawers. I can't think of anything else off the top of my head, though. Point is still that it doesn't affect damage received in combat, or at least didn't back when I tested it last summer (with that one dread curse -- vulnerability?).
 

lostcalpolydude

Developer
Staff member
It actually adds 3 damage per level, which is unlikely to be noticed most of the time in combat. It's more noticeable with salad forks and frosty mugs. I think it's a KoL bug, but I also don't expect it to get fixed any time soon.
 
Top