using Robust.Shared.Audio; using Robust.Shared.GameStates; namespace Content.Shared.Weapons.Reflect; /// /// Entities with this component have a chance to reflect projectiles and hitscan shots /// Uses ItemToggleComponent to control reflection. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class ReflectComponent : Component { /// /// What we reflect. /// [ViewVariables(VVAccess.ReadWrite), DataField("reflects")] public ReflectType Reflects = ReflectType.Energy | ReflectType.NonEnergy; /// /// Probability for a projectile to be reflected. /// [DataField("reflectProb"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public float ReflectProb = 0.25f; [DataField("spread"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public Angle Spread = Angle.FromDegrees(45); [DataField("soundOnReflect")] public SoundSpecifier? SoundOnReflect = new SoundPathSpecifier("/Audio/Weapons/Guns/Hits/laser_sear_wall.ogg"); } [Flags] public enum ReflectType : byte { None = 0, NonEnergy = 1 << 0, Energy = 1 << 1, }