using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Weapons.Reflect; /// /// Entities with this component have a chance to reflect projectiles and hitscan shots /// [RegisterComponent, NetworkedComponent] public sealed class ReflectComponent : Component { /// /// Can only reflect when enabled /// [DataField("enabled"), ViewVariables(VVAccess.ReadWrite)] public bool Enabled = true; /// /// Probability for a projectile to be reflected. /// [DataField("reflectProb"), ViewVariables(VVAccess.ReadWrite)] public float ReflectProb; [DataField("spread"), ViewVariables(VVAccess.ReadWrite)] public Angle Spread = Angle.FromDegrees(5); [DataField("soundOnReflect")] public SoundSpecifier? SoundOnReflect = new SoundPathSpecifier("/Audio/Weapons/Guns/Hits/laser_sear_wall.ogg"); } [Serializable, NetSerializable] public sealed class ReflectComponentState : ComponentState { public bool Enabled; public float ReflectProb; public Angle Spread; public ReflectComponentState(bool enabled, float reflectProb, Angle spread) { Enabled = enabled; ReflectProb = reflectProb; Spread = spread; } }