RedMisao / Cataclysm-DDA-Touhou-Expansion

A CDDA expansion mod for Touhou Professions that various things from Touhou Project lore and fluff
6 stars 2 forks source link

Soul damage reduction - "wounds are closing up!" messages #17

Closed RedMisao closed 1 month ago

RedMisao commented 8 months ago

Soul dmg is supposed to do no dmg, reduced, normal or bonus dmg, mostly defined by the target's species. For example, it deals bonus dmg against ghosts and phantoms (SOULDMG_EXTRA) or reduced dmg to nether and zombie enemies (SOUL_XDIMEN)

The trick for doing this is to add an ondamage_eocs that runs two EOCs and checks either flag. Then, the _total_damage context (?) value is set into a custom var which I can used with math, and then force the target to cast a spell, dealing themselves the equivalent dmg as pure. While this is not a solution I like, it works good enough

Regardless of above, using this system creates another problem: how to handle damage reduction. Because the ondamage_eocs is running after damage has been done, I'm using another trick to emulate soul dmg on things that should resist it, to instead heal them. This has to be changed as:

  1. It prints the message "X wounds are closing up!" and that breaks immersion
  2. If the damage is high enough to just kill the target, it cannot heal itself, so you have boundary cases where a target that could resist a certain amount of soul dmg to instead be killed by it
  3. This is just trying to patch the main issue here: using spells instead of doing it directly

To solve this, what should be done is (in order of priority):

  1. Check any soul dmg before it is applied with flags on the target, then calculate the bonus/reduction accordingly, then apply it
  2. Replace spells by something more direct (maybe setting the target's hp with npc_hp?)
  3. Remove the "X wounds are closing up!" message
RedMisao commented 1 month ago

Partially fixed now (0.9.6.18).

Soul dmg is directly applied to the target's HP, so there's no "X wounds are closing up!" anymore. Soul dmg "reduction" is still applied after dmg is done, so it's not reduction per se.