Allow NPCs to toggle on power armor (and other things) during combat #52259
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
Features "Allow NPCs to toggle on power armor (and other tagged items) during combat"
Purpose of change
Currently, if NPCs are given items such as power armor, they require the player character to activate them for them, and will not deactivate them until batteries are drained or the PC deactivates it for them. This adds extra micromanagement for NPC squads. This change will allow NPCs to toggle power armor themselves when in combat, and toggle them off when outside of combat. Mods can also make use of the new
COMBAT_TOGGLEABLE
tag to make NPCs aware that they can toggle them.Describe the solution
COMBAT_TOGGLEABLE
. This allows any item with a "transform" action to be tagged, so NPCs can be aware of them.method_of_attack
, this checks for all items the NPC is wearing that contains the tagCOMBAT_TOGGLEABLE
. This then checks to see if the item can be transformed, and if the item uses UPS, then whether or not the user has sufficient UPS charge. If all checks pass, then it activates the item. This follows the same entry point where defensive CBMs are activated, in anticipation of combat.COMBAT_TOGGLEABLE
. This point is at the same place where combat CBMs are disabled.With regards to JSON, this only adds the tag to power armor. Other items I originally planned, such as the combat chainsaw, use their own special iuse functions. However, mods can start making use of the tag.
Describe alternatives you've considered
Testing
Additional context