[Magiclysm] Attunements - Rock Blast spell #44682
Merged
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.
Summary
SUMMARY: Mods "[Magiclysm] Attunements - Rock Blast spell"
Purpose of change
Adds a new spell effect called directed_push in order ot be used by several attunement spells introduces the rock blast attunement spell.
Describe the solution
new spell effect: directed push
first, use a schwartzian transform (thanks kevin) to organize the area by distance from the caster. then, depending on if the spell's damage is negative or positive, multiply by 1 or -1 to make sure the range based for loop iterates over the multimap in the right order. then we have a couple static funcitons i pulled out of area_expander in order to easily share the code for moving fields, items, and monsters.
Describe alternatives you've considered
try to reuse area_expander somehow. now that i know about this transform it's likely way over-engineered anyway.
Testing
Spawn in a couple monsters/items in an area and use the two debug spells to make sure the push is working properly. rock blast will very likely do too much damage to most monsters in order to get the pushback effect, but there should be a number of them that work.
Additional context
I'm considering adding some kind of "resistance" to the pushback based on something, but i'm not sure what at this time.
requires #44481