Make Disarm opt-in (#7811)

This commit is contained in:
Júlio César Ueti
2022-04-30 18:29:13 -03:00
committed by GitHub
parent 6bf2f659a6
commit 2881cd4020
10 changed files with 23 additions and 1 deletions

View File

@@ -30,6 +30,9 @@ namespace Content.Shared.CombatMode
[DataField("disarmActionId", customTypeSerializer:typeof(PrototypeIdSerializer<EntityTargetActionPrototype>))]
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;

View File

@@ -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);
}

View File

@@ -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

View File

@@ -5,6 +5,8 @@
parent: SimpleSpaceMobBase
description: They mostly come at night. Mostly.
components:
- type: CombatMode
canDisarm: true
- type: UtilityAI
behaviorSets:
- Idle

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -3,6 +3,8 @@
abstract: true
id: PlayerSiliconBase #for player controlled silicons
components:
- type: CombatMode
canDisarm: true
- type: Reactive
groups:
Acidic: [Touch]

View File

@@ -3,6 +3,8 @@
parent: MobSlimePersonBase
id: MobSlimePerson
components:
- type: CombatMode
canDisarm: true
- type: InteractionPopup
successChance: 1
interactSuccessString: hugging-success-generic

View File

@@ -4,6 +4,8 @@
parent: MobVoxBase
id: MobVox
components:
- type: CombatMode
canDisarm: true
- type: InteractionPopup
successChance: 1
interactSuccessString: hugging-success-generic