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

fix: add limits and side effects to ABSORBS_SPLITS behavior #4249

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

This finally implements some sanity-checking of shoggoth item absorption and splitting behavior so they won't be as much of a menace to society.

Describe the solution

C++ changes:

  1. In monmove.cpp, changed monster::move so ABSORBS_SPLITS behavior gets a bit of sanity-checking. It now only does the split if it lacks a new status effect that's doled out to both monsters on a successful split, effectively implementing a cooldown on absorbing items. Splitting now also takes a bit out of both monsters, meaning some potential future items absorbed go into recovering from this loss of HP (until regen kicks back in, see below). They'll still absorb items to stockpile HP up to a point however, if they're still recovering from splitting they'll stop absorbing items once they're at 3 times max HP.

JSON changes:

  1. Defined the effect JSON for the new effect.
  2. Set shoggoths to have a regen modifier where the new effect disables regen entirely.

Describe alternatives you've considered

Ideally I'd like to have the absorption behavior only check for and remove items that have low acid resistance or aren't flammable (the latter is a bit more usable without material sanity-checking than the former since we haven't had acid item damage in years and the values are all over the place), but this requires using something with more finesse than i_clear and I could fucking could NOT figure out how to get erase or use_amount how to work right. I'm not used to this item identity stuff...

Testing

  1. Checked affected JSON for syntax and lint errors.
  2. Compiled and load-tested.
  3. Let a shoggoth eat deer corpses until it split, confirmed the copy has less than full HP.
  4. Confirmed that the new shoggoth has 300/400 HP, and that neither is regenerating.
  5. Let the original shoggoth absorb a third deer, confirmed it now stays at over 800 HP but hasn't split due to the cooldown.
  6. Placed more items under the shoggoth to feed it until it was over 1200 HP, observed it no longer wants to delete items.
  7. Confirmed the other shoggoth is happy to eat items because HP isn't at 1200 yet.
  8. Checked affected C++ for astyle.

He monch:
image

He do not monch because too full and can't split yet:
image

Additional context

DDA did this via special attack stuff if I recall, I was actually gonna do that too (without really bothering to look at how they did it and port it over) but item identity stuff tripped me up too much.

Checklist

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Feb 22, 2024
@scarf005 scarf005 merged commit e6c0196 into cataclysmbnteam:main Mar 1, 2024
13 checks passed
@chaosvolt chaosvolt deleted the shoggoths-go-nyoom branch March 1, 2024 07:50
@Zireael07

This comment was marked as off-topic.

@scarf005
Copy link
Member

scarf005 commented Mar 1, 2024

@Zireael07 please make DDA discussion on https://github.com/CleverRaven/Cataclysm-DDA/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants