Make Disarm opt-in (#7811)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
parent: SimpleSpaceMobBase
|
||||
description: They mostly come at night. Mostly.
|
||||
components:
|
||||
- type: CombatMode
|
||||
canDisarm: true
|
||||
- type: UtilityAI
|
||||
behaviorSets:
|
||||
- Idle
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
abstract: true
|
||||
id: PlayerSiliconBase #for player controlled silicons
|
||||
components:
|
||||
- type: CombatMode
|
||||
canDisarm: true
|
||||
- type: Reactive
|
||||
groups:
|
||||
Acidic: [Touch]
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
parent: MobSlimePersonBase
|
||||
id: MobSlimePerson
|
||||
components:
|
||||
- type: CombatMode
|
||||
canDisarm: true
|
||||
- type: InteractionPopup
|
||||
successChance: 1
|
||||
interactSuccessString: hugging-success-generic
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
parent: MobVoxBase
|
||||
id: MobVox
|
||||
components:
|
||||
- type: CombatMode
|
||||
canDisarm: true
|
||||
- type: InteractionPopup
|
||||
successChance: 1
|
||||
interactSuccessString: hugging-success-generic
|
||||
|
||||
Reference in New Issue
Block a user