diff --git a/Content.Shared/CombatMode/SharedCombatModeComponent.cs b/Content.Shared/CombatMode/SharedCombatModeComponent.cs index 3fcf93a6c9..f8d1a54f17 100644 --- a/Content.Shared/CombatMode/SharedCombatModeComponent.cs +++ b/Content.Shared/CombatMode/SharedCombatModeComponent.cs @@ -30,6 +30,9 @@ namespace Content.Shared.CombatMode [DataField("disarmActionId", customTypeSerializer:typeof(PrototypeIdSerializer))] public readonly string DisarmActionId = "Disarm"; + [DataField("canDisarm")] + public bool CanDisarm; + [DataField("disarmAction")] // must be a data-field to properly save cooldown when saving game state. public EntityTargetAction? DisarmAction; diff --git a/Content.Shared/CombatMode/SharedCombatModeSystem.cs b/Content.Shared/CombatMode/SharedCombatModeSystem.cs index af4b1d91b6..731c7c9a10 100644 --- a/Content.Shared/CombatMode/SharedCombatModeSystem.cs +++ b/Content.Shared/CombatMode/SharedCombatModeSystem.cs @@ -33,12 +33,13 @@ namespace Content.Shared.CombatMode _actionsSystem.AddAction(uid, component.CombatToggleAction, null); if (component.DisarmAction == null + && component.CanDisarm && _protoMan.TryIndex(component.DisarmActionId, out EntityTargetActionPrototype? disarmProto)) { component.DisarmAction = new(disarmProto); } - if (component.DisarmAction != null) + if (component.DisarmAction != null && component.CanDisarm) _actionsSystem.AddAction(uid, component.DisarmAction, null); } diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index ae2ca9e609..6e394db345 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -580,6 +580,8 @@ id: MobKangarooBoxer description: A large marsupial herbivore. It has powerful hind legs and... boxing gloves? components: + - type: CombatMode + canDisarm: true - type: Sprite drawdepth: Mobs layers: @@ -612,6 +614,8 @@ parent: SimpleMobBase description: New church of neo-darwinists actually believe that EVERY animal evolved from a monkey. Tastes like pork, and killing them is both fun and relaxing. components: + - type: CombatMode + canDisarm: true - type: NameIdentifier group: Monkey - type: SentienceTarget diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml index 5b69653895..064b85f9d8 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml @@ -5,6 +5,8 @@ parent: SimpleSpaceMobBase description: They mostly come at night. Mostly. components: + - type: CombatMode + canDisarm: true - type: UtilityAI behaviorSets: - Idle diff --git a/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml b/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml index 72a71f21a5..da76761181 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dwarf.yml @@ -5,6 +5,8 @@ id: MobDwarf description: A miserable pile of secrets. components: + - type: CombatMode + canDisarm: true - type: InteractionPopup successChance: 1 interactSuccessString: hugging-success-generic diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index 7ea0a96436..f9a883dfcd 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -5,6 +5,8 @@ id: MobHuman description: A miserable pile of secrets. components: + - type: CombatMode + canDisarm: true - type: InteractionPopup successChance: 1 interactSuccessString: hugging-success-generic diff --git a/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml b/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml index 91bc86d9c9..8e78195d7b 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/reptilian.yml @@ -5,6 +5,8 @@ id: MobReptilian description: A miserable pile of scales. components: + - type: CombatMode + canDisarm: true - type: InteractionPopup successChance: 1 interactSuccessString: hugging-success-generic diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 104f7345c3..2b134e8b36 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -3,6 +3,8 @@ abstract: true id: PlayerSiliconBase #for player controlled silicons components: + - type: CombatMode + canDisarm: true - type: Reactive groups: Acidic: [Touch] diff --git a/Resources/Prototypes/Entities/Mobs/Player/slime.yml b/Resources/Prototypes/Entities/Mobs/Player/slime.yml index 0679b21832..f72f9b7b37 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/slime.yml @@ -3,6 +3,8 @@ parent: MobSlimePersonBase id: MobSlimePerson components: + - type: CombatMode + canDisarm: true - type: InteractionPopup successChance: 1 interactSuccessString: hugging-success-generic diff --git a/Resources/Prototypes/Entities/Mobs/Player/vox.yml b/Resources/Prototypes/Entities/Mobs/Player/vox.yml index 7b5dba8a19..44b96ecaba 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/vox.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/vox.yml @@ -4,6 +4,8 @@ parent: MobVoxBase id: MobVox components: + - type: CombatMode + canDisarm: true - type: InteractionPopup successChance: 1 interactSuccessString: hugging-success-generic