Resource-ification project for Life, Feedback, etc.
Expands the resource system and streamlines some edge cases into the main resource paradigm.
Resource definitions are rather finicky, and the Feedback change deprecates the psionic_feedback actor parameter, so this will break saves.
Changelog
- Life and Feedback are now actual resources, as opposed to pseudo-resources. Among other effects, this means that they easily appear in talent descriptions, along with new talent descriptors
sustain_life,drain_life, anddrain_feedback. - Resource system expansions:
- New
no_resetflag for a resource definition. Resources flagged as such don't reset to full on level up or actor birth (as part ofActor:resetToFull()). - All resources automatically generate an
Actor:regenFoo(fake, force)function. By default, this increases the resource (or decreases for decrementing resources) based on theregen_propsupplied in the definition.fake=trueprevents the actual regeneration,force=trueprevents the result from being bounded by the resource limits (i.e.force=falsereturns the actual delta,force=truereturns the ideal delta). - All resources automatically generate a
foo_ratingparameter (subject to overwrite inparams). They also automatically anActor:levelupIncFoofunction. This is part of levelup and is expected to interpret thefoo_ratingparameter. The default function increasesmax_foobyfoo_rating, but can be over/superloaded. - The individual
levelupIncFoofunctions are moved collectively toActor:resolveResourceRatings(), called during levelup. - New
function_overridestable can be passed as part ofdefineResource. This is a fancy way of overloading functions in this framework rather than overloading them elsewhere (e.g. when defining Life, passing{regenFunction = function(self, fake, force) ... end}rather than defining elsewhere_M:regenLife) TheregenResourcesFastframework is deprecated, due to the loss of the assumption that resource regeneration is a simple process. Tinkering with returning it to life.- UI Changes
- On the life bar and character sheets, the life regen and psi regen displayed now appropriately account for
T_SOLIPSISM; if life regen is being reduced to regenerate psi instead, the displayed life regen will be appropriately smaller. Thus, the delta on a given turn (outside of combat, obviously) now matches the numbers displayed. - In character sheets, Feedback now is its proper yellow color instead of the odd light-green-blue. This makes it consistent across the resource bars, character sheets, and talent descriptions.
- AI Changes
- New
no_wantflag for a resource definition. Resources flagged as such don't generatewantentries inimproved_tacticalAI. This is done to prevent double-checking shenanigans for Life, in particular. - The AI will probably continue to not amazingly handle the resource changes, because the
regen_propcan now easily lie (e.g.feedback_regenisn't used to handle feedback degeneration). - Various tweaks here and there to support Feedback no longer being a pseudo-resource.
Update 12/21/2020
- Major changes to how Life is interpreted. The life gained from Constitution is now computed in
Actor:getMaxLifewhich means themax_lifeparameter now lies a lot. As such, you should always use the getter. - Similar changes to Mana, Stamina, and Psi to reflect their attribute dependence.
- Multipliers to max life from sustains (Last Stand, Icy Skin, Chant of Fortress) are moved into
Actor:getMaxLifeto alleviate snapshotting bugs. For cleanliness, multipliers to resources from temporary effects weren't changed. - Debating the introduction of a
foo_mult_addproperty to make this a bit more general, but I've added about a dozen new parameters with this MR alone. -
Actor.die_atis now respected byActor:getMinLife. This means thatActor:getMinLifeshould be used in place of accessing the rawActor.die_atfor life calculations. - Sweeping changes to a million talents, effects, UI, and AI to make them properly use getters and setters instead of accessing raw parameters.
- The Air meter now shows your real degeneration if you're standing on a tile you can't breathe on.
- Consistency pass on "execution" mechanics like Blade Shear and Coup de Grace to make them respect the changes to
Actor:getMinLife. They're all worded the same, they should all operate the same with regards to enemies at negative life. Previously, they had inconsistent behavior about executing these enemies.