Deactivate pet robots in pet menu instead of query #1931
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: Features "Pet monsters with revert_to_itype now have deactivate option in pet menu, instead of prompting the player beforehand"
Purpose of change
A followup to #217 I'd been meaning to do for a while, per Coolthulhu's request. If you have a pet that can also be deactivated, it is kinda annoying as fuck to have the "turn the monster back into an item?" prompt show up every time you bump into it, making the pet menu more annoying to use and thus making robotic pets like the planned hauler bot unfeasible.
On top of the above, this also adds some sanity-checking to prevent the player from deleting stuff like bags (and stored contents), saddles, what-have-you from a pet when it returns to item form. This is a current flaw I discovered with the existing
disable_robot
function, that would obviously be a big blocker to adding robot friends that can carry crap for you.Describe the solution
game::disable_robot
, set it so the opening "wanna take down your X?" prompt is ignored if the creature counts as a pet. This lets the existing prompt and associated stuff used for manhacks/turrets still work unchanged for friendly non-pet bots.game::disable_robot
, just in case the player somehow ends up with a pet that carries ammo. It also unloads bags, stored items, ropes, armor, and saddles automatically.Describe alternatives you've considered
Fixing spawns of mechs so that we have support for deployable mechs in vanilla that behave sanely, thus allowing mechs to be deactivatable in the pet menu. Could be done in a follow-up maybe, as part of my general plans to improve mechs.
Testing
Additional context
Things of note: