CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.29k stars 4.13k forks source link

Add per-body part healing rate enchantment processing #76063

Open Standing-Storm opened 3 weeks ago

Standing-Storm commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Related to #76039: A Vitakinetic power that increases healing on one (maybe two at high level) body parts in exchange for reducing healing of the other body parts is an excellent rework of the Damage Balancing power, but it's currently impossible. The bandaging system can increase healing for specific body parts but it cannot reduce it.

Solution you would like.

Change the REGEN_HP enchant so that if applied as part of an effect applied to a specific body part, it only affects that body part, rather than the entire body.

Describe alternatives you have considered.

No response

Additional context

This could also be used for magical curses (like the Call of Cthulhu "Wither Limb" spell), or for creatures with attacks so horrific they leave unhealing wounds behind.

RenechCDDA commented 3 weeks ago

I don't think this is terribly feasible, we'd need some way to dynamically create new enchantments and link them to a specific limb depending on the dynamically loaded limbs (because a mod could add new limbs!).

RedMisao commented 3 weeks ago

I think Standing-Storm refers to the enchantment coming from body-part-specific effect to be restricted to such body parts, not adding limb-specific versions of it.

Regarding the issue itself: This may not be limited to REGEN_HP, but work for things like the ARMOR_X, ATTACK_SPEED and MAX_HP among others, so you can have different arms with different stats or whatever. If this is expanded to more enchantments, it would either:

  1. Require a scope addition to the enchantment syntax which connects it to the limb list, or
  2. A field at the effect level that restricts any enchants under it to the limb it affects.
Standing-Storm commented 3 weeks ago

That’s what I meant, yes. My original suggestion was to have separate enchants per limb but I changed to the current suggestion for two reasons. The first is as Renech says, soon enough there would need to be an arbitrarily large number of such enchants to handle all possible limbs (REGEN_HP_CEPHALOPOD_ARM_1, REGEN_HP_CEPHALOPOD_ARM_2…)

The second is that the healing_rate property in base_mods for effects already works the way I’m suggesting, only affecting the appropriate limb if applied to a specific limb instead of the entire body. The problem is that it can’t scale using math, so I would have to create dozens of such effects in a switch statement to properly scale everything the way MoM usually does.

Which I might still do. I can always obsolete them if this is implemented. Edit: actually I don’t even have to do that I don’t think, since Intensity can be set through math. I can have the intensity scale. But while that works for this specific instance, it wouldn’t work for any of the other use cases RedMisao mentioned.