feat(UI): move remaining deactivate and manhack functions to pet menus, sanity-check docile behavior, rework pheromone function into generic monster culling #4247
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 finishes up some cleanup of the pet and friend menus, to allow taking down friendly monsters and the special manhack behavior to not be separate queries entirely. Along the way this turned into some cleanup and sanity-checking of paybot behavior as well as the rarely-used docile/passive state.
Also comes with being able to cull livestock like you can zombie zlaves, reworking that option to be more broadly usable.
Describe the solution
C++ changes:
Character::attitude_to
so characters treat passive creatures as friends, since this state can only be entered by friendly monsters.game::disable_robot
from game.cpp and game.h as it's now redundant, along with the call to it ingame::examine
.mattack::check_money_left
to fix it checking the wrong effects. Now pay-bots correctly clear the pet effect and revert to normal when time runs out, instead of checking for an effect that's set to be permanent.monexamine::pet_menu
for changing orders and deactivating monsters. The former is a new option, also added tomonexamine::pet_menu
, that toggles adding/removing the docile effect to the monster if they have theCAN_BE_ORDERED
monster flag. This effectively JSONizes the effect manhacks had allowing you to toggle their aggression.monexamine::kill_zslave
to be reflavored as a generic slaughter mechanic. Can now be used on pets in the wildlife category as well as zombie zlaves, requires a source of butchering quality (1 or higher, so negative quality like with sharp rocks won't suffice), and no longer involves ripping a pheromone ball out with your bare hands. Option now replaces attack when available, and moved it to the bottom to be consistentmonster::plan
, with it forcing them to clear their target and no longer returning. Also moved it to just above friendly monster following behavior, after all target math is finished, so that a monster that was set to passive mid-fight will switch focus to following the player.monster::attitude_to
so passive monsters still regard themselves as friendly towards the player instead of neutral.JSON changes:
CAN_BE_ORDERED
flag to the drone template all hacks inherit from.Doc changes:
Describe alternatives you've considered
C
menu.Testing
Additional context
DDA implemented culling livestock a while back but dunno what PR that was, I just kinda implemented an adaptation of the existing monster-execution function while I was already in this.
I want to rework the busted variant into a hacked/jailbroken variant that lacks pay-bot functions entirely, with the idea being crafting an inactive grocery bot will be easier than building a jailbroken one, with converting an inactive regular grocery bot to a hacked one as an alternative recipe. Those will still retain the standard skill roll to deploy as friendly, and count as pets if done so, while a failed roll will have it uselessly faff about and require deactivation to try again due to its payment programming being disabled.
Idea being that, since spawning as friendly has no actual impact on paybot functions currently, the regular version will be relatively easy to get back in working order but will always spawn as neutral (thus requiring payment to be useful), while the hacked version will be a more complex craft that lets you skip the cash card stuff if successfully deployed. I figured however that can wait for a later PR.
Checklist