vgstation-coders / vgstation13

Butts
GNU General Public License v3.0
260 stars 541 forks source link

Attempts to fix set_species causing full heals #36706

Open boy2mantwicethefam opened 1 week ago

boy2mantwicethefam commented 1 week ago

DO NOT MERGE YET.

Added new code that transfers damage from before the mob had its limbs reset to after. The damage style is randomized, meaning that at most you can redistribute the damage and maybe gib a limb or two in the process at extreme values.

Should work for Staff of Change, species-changing diseases, the Dissolve genetic power, species changes caused by the cursed dice, ghoulification, cursed mirrors, Nosferatu vampire transformations, the Synthskeleton chemical, and the "Randomized" chemical.

Also fixed a bug where mindless mobs couldn't be transformed from cyborgs, AIs and MoMMIs.

Fixed the limb damage code so that damage overflow to other limbs now works better.

Fixed take_overall_damage dealing far more damage than intended when transferring damage values; it not only had a damage multiplier code of its own that stacked with the limb damage's damage multiplier (meaning that dionae could take as much as 6x damage from burn) but it didn't consider the damage overflow of the limb that it targeted, increasing the amount of damage dealt. Now it will prevent the limb from dealing overflowing damage while it focuses on dishing out the damage itself.

Internal wounds will no longer be considered for the purposes of total damage. In gameplay terms this means that internal wounds don't cause a sudden 15 damage dealt whenever they happen anymore.

And yes, Nosferatu can probably be added back with this change.

I'll probably revisit the overengineered code from before but I've spent nearly the entire day on constantly testing this PR and it sucked!

To-do: Feedback that Staff of Changing a dead mob doesn't work (it doesn't work, but it has no message to indicate that it doesn't)

:cl:

SonixApache commented 1 week ago

why randomize the damage though

boy2mantwicethefam commented 1 week ago

It's the most straightforward way, but I'll probably work on the PR more to re-implement the overengineered method of limb-to-limb damage.