using Content.Shared.Actions.ActionTypes; using Robust.Shared.Audio; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Blocking; /// /// This component goes on an item that you want to use to block /// [RegisterComponent] public sealed class BlockingComponent : Component { /// /// The entity that's blocking /// [ViewVariables] public EntityUid? User; /// /// Is it currently blocking? /// [ViewVariables] public bool IsBlocking; /// /// The ID for the fixture that's dynamically created when blocking /// public const string BlockFixtureID = "blocking-active"; /// /// The shape of the blocking fixture that will be dynamically spawned /// [ViewVariables(VVAccess.ReadWrite)] [DataField("shape")] public IPhysShape Shape = new PhysShapeCircle(0.5f); /// /// The damage modifer to use while passively blocking /// [ViewVariables(VVAccess.ReadWrite)] [DataField("passiveBlockModifier")] public string PassiveBlockDamageModifer = "Metallic"; /// /// The damage modifier to use while actively blocking. /// [ViewVariables(VVAccess.ReadWrite)] [DataField("activeBlockModifier")] public string ActiveBlockDamageModifier = "Metallic"; [DataField("blockingToggleActionId", customTypeSerializer:typeof(PrototypeIdSerializer))] public string BlockingToggleActionId = "ToggleBlock"; [DataField("blockingToggleAction")] public InstantAction? BlockingToggleAction; /// /// The sound to be played when you get hit while actively blocking /// [DataField("blockSound")] public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg"); /// /// Fraction of original damage shield will take instead of user /// when not blocking /// [DataField("passiveBlockFraction"), ViewVariables(VVAccess.ReadWrite)] public float PassiveBlockFraction = 0.5f; /// /// Fraction of original damage shield will take instead of user /// when blocking /// [DataField("activeBlockFraction"), ViewVariables(VVAccess.ReadWrite)] public float ActiveBlockFraction = 1.0f; }