[possessors-1.6.6] Infinite or negative max life

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
minmay
Wyrmic
Posts: 286
Joined: Fri Sep 07, 2012 1:34 am
Contact:

[possessors-1.6.6] Infinite or negative max life

#1 Post by minmay »

How to get arbitrarily high max life
Assume Form -> do a weapon swap that would reduce your max life below 1 -> max life gets clamped at 1 -> toggle Assume Form back off

Your normal form now has permanently more max life. This can be done with any body, but of course it's better the lower the body's natural max life is; with one of those mouse bodies with a natural max life of 1, all you need is a weapon with +1 Con on it and you can give yourself +3 max life as many times as you like.

How to get negative max life in a body
Activate Chant of Fortitude in your normal form -> Assume Form to a body with less max life than Chant of Fortitude grants -> deactivate Chant of Fortitude

You now have negative max life, and your current life won't be clamped to it until you rest. So you can activate Force Shield, or just have the Ghoul talent, and take 0 damage from most things (you can still be damaged by things like Rune of Reflection that call takeHit() directly instead of going through a damage projector).

However any change to your Constitution stat will cause your max life to be reset to 1, so this strategy can be foiled by an enemy with Rotting Disease or Atrophy, or swapping your weapons. Which leads to...

How to get arbitrarily high max life, but at an exponential rate this time
Activate Chant of Fortitude in your normal form -> Assume Form to a body with less max life than Chant of Fortitude grants -> deactivate Chant of Fortitude -> swap weapons to or from a weapon with Con on it -> max life gets clamped at 1 -> toggle Assume Form back off -> repeat

Chant of Fortitude increases your max life by a percentage of your max life, so doing this a few times successively lets you quickly reach very high max life. I stopped at 653 billion but you can go even higher and break your savefile if you want.

How do you even fix this horror
The max_life field is used directly everywhere so there's not like, one function you can just change to fix all of this; indeed, it's impossible to even fix Chant of Fortitude (and Icy Skin) snapshotting on its own without either doing a major code refactoring, or using a metatable to change the way indexing/assigning max_life works...

But I think that you can fix the arbitrarily high max life, by changing Actor:onStatChange()'s STAT_CON code to account for Assume Form when clamping max_life, by changing Assume Form's life_offset to account for the max life gained from the clamping. Right now the clamping would actually result in non-Possessors getting free extra max life too (just not an unlimited amount), but I don't think there's currently any non-Possessor way to get your max life that low in the first place.

The negative max life is tougher to fix, I can't think of a way to fix it at all other than doing the aforementioned refactoring, in fact. The closest thing I can think of is adding onTemporaryValueChange logic for max_life that prevents this sort of thing, but then you have the problem of dealing with max_life changes that don't use the temporary value system... honestly, adding Actor:getMaxLife() and refactoring everything to use it instead of directly indexing actor.max_life is starting to sound downright appealing by comparison.

Post Reply