Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(balance): allow pulping zombify_into corpses #4228

Merged
merged 3 commits into from
Feb 18, 2024

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Feb 14, 2024

Purpose of change

This change aims to make it so you can pulp dead feral humans to keep them from reviving like you would with regular zombies, instead of the only option being to butcher them (or wait for them to revive, kill their zombie form, them pulp that).

WIP because I'm out and about on laptop currently, will test then mark as ready when I get home.

Describe the solution

  1. In activity_handlers.cpp, set it so activity_handlers::pulp_do_turn treats coprses with zombify_into as valid to pulp.
  2. In cata_tiles.cpp, set cata_tiles::draw_zombie_revival_indicators to also check for unpulped monsters with zombify_into set for the sake of displaying the "stuff that should be pulped" indicator. Nested in a check for is_corpse to avoid potential access violation shenanigans I encountered during initial testing.
  3. In handle_action.cpp, also set it so smash considers corpses that have zombify_into valid to pulp.
  4. In item.cpp, changed item::color_in_inventory so that corpses with zombify_into show as yellow, just as ones with REVIVES do, and set it so the corpse being pulped reliably invalidates this.
  5. Also in item.cpp, changed item::process_corpse so the part that handles zombify_into also checks that the corpse isn't pulped before changing monster type.
  6. In map.cpp, set it so map::smash_items can correctly spot corpses with zombify_into for smashing.

Describe alternatives you've considered

screm

Testing

Started with a benchmark test in my playthrough build by debug-killing a bunch of feral humans, changing time forward 5 days, then waiting 5 minutes. As expected, they soon all converted into un-revived zombie corpses and started to get back up.

  1. Compiled and load-tested.
  2. Spawned in some feral humans and debug-killed them.
  3. Observed that the bodies now show as yellow.
  4. Pulped half of the bodies, they can now be pulped, stop showing as yellow afterward and can only be pulped once.
  5. Advanced time forward 5 days.
  6. Waited five minutes, only the intact feral human corpses converted into zombies and reanimated.
  7. Also spawned in some regular zombies and repeated above tests, to confirm that they still displayed, pulped, and reanimated as normal.
  8. Tested a save with Dinomod, spawned in a pair of T. Rexes and confirmed they show as pulpable when slain, and pulping them works.
  9. Checked affected files for astyle.
Screenshots:

1

2

1

2

Additional context

I'm 90% certain DDA does this too but dunno what PR it is nor if there's any difference in how they do it.

Checklist

@github-actions github-actions bot added the src changes related to source code. label Feb 14, 2024
@chaosvolt chaosvolt changed the title feat(interface): allow pulping zombify_into corpses feat(balance): allow pulping zombify_into corpses Feb 14, 2024
@DrPariah
Copy link
Contributor

DrPariah commented Feb 14, 2024 via email

@chaosvolt
Copy link
Member Author

It should catch anything that uses zombify_into at all, yeah. About to test now that I'm back home.

@chaosvolt chaosvolt marked this pull request as ready for review February 15, 2024 02:54
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before pulping after pulping
image image

@scarf005 scarf005 merged commit e7ae894 into cataclysmbnteam:main Feb 18, 2024
14 of 18 checks passed
@chaosvolt chaosvolt deleted the hulk-smash-puny-feral branch February 18, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants