feat: allow remote deployment of place_monster
items, throwable manhacks
#4174
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 is a thing that @Lorith had requested support for way back in 2018 (CleverRaven/Cataclysm-DDA#26418). The issue got closed for "DDA doesn't care about fixing janky behavior if only mods will benefit from it" reasons, but it's not that hard to envision a perfectly vanilla use case for this.
Describe the solution
C++ changes:
place_monster_iuse::use
so thatplace_monster
items withplace_randomly
set to true will use the item's position instead of the players. This allows for monster-spawning items that activate when thrown, instant monster spawns using drop_action, etc without them instead automatically spawning next to the player. Failure to place also unsets the item as active to prevent !!FUN!! involving explosively infinite spawns of a manhack that tried and failed to spawn after being thrown (asACT_ON_RANGED_HIT
sets the item in question to count as active). Lastly, thanks to Shard/Lorith deployment by being thrown doesn't consume additional moves.JSON changes:
ACT_ON_RANGED_HIT
flags, allowing you to yeet them for remote deployment (useful for tossing from behind cover as a distraction, for example).Describe alternatives you've considered
Not adding throwable manhacks and only adding the code support.
Testing
Additional context
I'd like to also allow it to support having
ALLOWS_REMOTE_USE
too, but right now that causes an error if activated from within inventory. If we can figure out how to fix that then we can allow for not requiring you to pick up the heavier bots when deploying them.Checklist