48 lines
1.8 KiB
C#
48 lines
1.8 KiB
C#
using Content.Shared.Actions.ActionTypes;
|
|
using Content.Shared.Targeting;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.CombatMode
|
|
{
|
|
/// <summary>
|
|
/// Stores whether an entity is in "combat mode"
|
|
/// This is used to differentiate between regular item interactions or
|
|
/// using *everything* as a weapon.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
|
[Access(typeof(SharedCombatModeSystem))]
|
|
public sealed partial class CombatModeComponent : Component
|
|
{
|
|
#region Disarm
|
|
|
|
/// <summary>
|
|
/// Whether we are able to disarm. This requires our active hand to be free.
|
|
/// False if it's toggled off for whatever reason, null if it's not possible.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("canDisarm")]
|
|
public bool? CanDisarm;
|
|
|
|
[DataField("disarmSuccessSound")]
|
|
public SoundSpecifier DisarmSuccessSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
|
|
|
|
[DataField("disarmFailChance")]
|
|
public float BaseDisarmFailChance = 0.75f;
|
|
|
|
#endregion
|
|
|
|
[DataField("combatToggleActionId", customTypeSerializer: typeof(PrototypeIdSerializer<InstantActionPrototype>))]
|
|
public string CombatToggleActionId = "CombatModeToggle";
|
|
|
|
[DataField("combatToggleAction")]
|
|
public InstantAction? CombatToggleAction;
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("isInCombatMode"), AutoNetworkedField]
|
|
public bool IsInCombatMode;
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("activeZone"), AutoNetworkedField]
|
|
public TargetingZone ActiveZone;
|
|
}
|
|
}
|