Blocking and Shields (#8584)
* Blocking * Fixes Bodytype bug * Blocking Damage Modifier * Storing bodytype * Consolidates Stop Blocking code * Consolidates more methods * Some cleanup, hitbox fix * Shield Textures * Passive blocking modifier check * Localization, popups, and more cleanup * Small cleanup * Relay event * Fixes a shutdown bug, adds specific containers and sets * Popups and sounds * Fixes typo * Removes whitespace, adds comment * Some requested changes * Remove Shared * Audio fix * More changes * More requested changes * Properly remove on shutdown * Adds riot shields to seclathes * SecTech Riot shield * Constant variable * Relay transfer to user blocking system * More destruction behavior * Adds a shape field * Riot shield cleanup * More requested changes. * Prevents blocking attempt where a user cannot be anchored * Listen for anchor change * Unused using cleanup * More shields. * Buckler * Construction * Linter fix
This commit is contained in:
64
Content.Shared/Blocking/Components/BlockingComponent.cs
Normal file
64
Content.Shared/Blocking/Components/BlockingComponent.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Physics.Collision.Shapes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Blocking;
|
||||
|
||||
/// <summary>
|
||||
/// This component goes on an item that you want to use to block
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class BlockingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity that's blocking
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public EntityUid? User;
|
||||
|
||||
/// <summary>
|
||||
/// Is it currently blocking?
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public bool IsBlocking;
|
||||
|
||||
/// <summary>
|
||||
/// The ID for the fixture that's dynamically created when blocking
|
||||
/// </summary>
|
||||
public const string BlockFixtureID = "blocking-active";
|
||||
|
||||
/// <summary>
|
||||
/// The shape of the blocking fixture that will be dynamically spawned
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("shape")]
|
||||
public IPhysShape Shape = new PhysShapeCircle {Radius = 0.5F};
|
||||
|
||||
/// <summary>
|
||||
/// The damage modifer to use while passively blocking
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("passiveBlockModifier")]
|
||||
public string PassiveBlockDamageModifer = "Metallic";
|
||||
|
||||
/// <summary>
|
||||
/// The damage modifier to use while actively blocking.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("activeBlockModifier")]
|
||||
public string ActiveBlockDamageModifier = "Metallic";
|
||||
|
||||
[DataField("blockingToggleActionId", customTypeSerializer:typeof(PrototypeIdSerializer<InstantActionPrototype>))]
|
||||
public string BlockingToggleActionId = "ToggleBlock";
|
||||
|
||||
[DataField("blockingToggleAction")]
|
||||
public InstantAction? BlockingToggleAction;
|
||||
|
||||
/// <summary>
|
||||
/// The sound to be played when you get hit while actively blocking
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("blockSound")]
|
||||
public SoundSpecifier BlockSound = new SoundPathSpecifier("/Audio/Weapons/block_metal1.ogg");
|
||||
}
|
||||
Reference in New Issue
Block a user