CleverRaven/Cataclysm-DDA

Take zombification and rotting into account with mon_null in monster upgrades

Open

#64,222 opened on Mar 13, 2023

View on GitHub
 (0 comments) (4 reactions) (0 assignees)C++ (3,991 forks)batch import
(P4 - Low)<Suggestion / Discussion>Help WantedMonsters[C++]

Repository metrics

Stars
 (9,264 stars)
PR merge metrics
 (Avg merge 6d 5h) (292 merged PRs in 30d)

Description

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

Discovered in #64142. When you have an early game monster like this and want it to die at some point to zombify, their fresh(!) corpses will be spawned in newly explored locations.

Have e.g the following for feral humans:

"upgrades": { "half_life": 90, "into": "mon_null" }

Indicating that the monster should pretty much die out within a year or two. Then use the debug menu to set the time to 5 years from now. Teleport into any city that has not been explored yet and you will see fresh corpses.

Solution you would like.

  1. When spawning mon_null (aka a corpse), check the age of the monster.
  2. If the previous monster could zombify, check if it has zombified by then and if yes, spawn the zombie and upgrade it, too.
  3. If it does not zombify, check if the corpse has rotted away by then and if so, let it rot.
  4. If it did neither rot nor zombify yet, apply the age to the resulting corpse. So you could spawn "corpse of a feral human (old)" on newly explored locations.

Describe alternatives you have considered.

There are a few edge cases that need to be considered. For example very cold locations like ice labs where corpses would not or only slowly rot. An additional parameter like "no_rot_check" might work for this.

Additional context

No response

Contributor guide