fix: add limits and side effects to ABSORBS_SPLITS
behavior
#4249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
monster::move
soABSORBS_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:
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 geterase
oruse_amount
how to work right. I'm not used to this item identity stuff...Testing
He monch:
He do not monch because too full and can't split yet:
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