using Content.Shared.Damage; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Prototypes; namespace Content.Shared.Blocking.Components; /// /// This component goes on an item that you want to use to block /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true)] public sealed partial class BlockingComponent : Component { /// /// The ID for the fixture that's dynamically created when blocking /// public const string BlockFixtureId = "blocking-active"; /// /// The entity that's blocking /// [DataField, AutoNetworkedField] public EntityUid? User; /// /// Is it currently raised and using its ? /// [DataField, AutoNetworkedField] public bool IsRaised; /// /// The shape of the blocking fixture that will be dynamically spawned /// [DataField] public IPhysShape Shape = new PhysShapeCircle(0.5f); /// /// The damage modifer to use while passively blocking /// [DataField(required: true)] public DamageModifierSet PassiveBlockModifier = default!; /// /// Optional damage modifier to use while actively blocking. /// If this is null, shield will use the PassiveBlockModifier instead. /// [DataField] public DamageModifierSet? ActiveBlockModifier; [DataField] public EntProtoId BlockingToggleAction = "ActionToggleBlock"; [DataField, AutoNetworkedField] public EntityUid? BlockingToggleActionEntity; /// /// The sound to be played when you get hit while actively blocking /// [DataField] public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg") { Params = AudioParams.Default.WithVariation(0.25f) }; /// /// Fraction of original damage shield will take instead of user /// when not blocking /// [DataField] public float PassiveBlockFraction = 0.5f; /// /// Fraction of original damage shield will take instead of user /// when blocking /// [DataField] public float ActiveBlockFraction = 1.0f; }