Files
crystall-punk-14/Content.Shared/CombatMode/CombatModeComponent.cs

53 lines
2.0 KiB
C#
Raw Permalink Normal View History

using Content.Shared.MouseRotator;
using Content.Shared.Movement.Components;
2022-07-29 14:13:12 +12:00
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
2021-06-09 22:19:39 +02:00
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>
2023-09-03 06:16:34 +10:00
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
[Access(typeof(SharedCombatModeSystem))]
public sealed partial class CombatModeComponent : Component
{
#region Disarm
2020-03-25 11:16:57 +01:00
/// <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
2022-04-30 18:29:13 -03:00
[DataField("combatToggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string CombatToggleAction = "ActionCombatModeToggle";
[DataField, AutoNetworkedField]
public EntityUid? CombatToggleActionEntity;
2023-09-03 06:16:34 +10:00
[ViewVariables(VVAccess.ReadWrite), DataField("isInCombatMode"), AutoNetworkedField]
public bool IsInCombatMode;
2020-03-25 11:16:57 +01:00
/// <summary>
/// Will add <see cref="MouseRotatorComponent"/> and <see cref="NoRotateOnMoveComponent"/>
/// to entities with this flag enabled that enter combat mode, and vice versa for removal.
/// </summary>
[DataField, AutoNetworkedField]
public bool ToggleMouseRotator = true;
}
}