using Content.Shared.Alert; using Content.Shared.Damage; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared._EE.Shadowling.Components; /// /// Component that indicates a user should take damage or heal damage based on the light detection system /// [RegisterComponent, NetworkedComponent] [AutoGenerateComponentState] public sealed partial class LightDetectionDamageModifierComponent : Component { /// /// Max Detection Value /// [DataField, AutoNetworkedField] public float DetectionValueMax = 5f; /// /// If this reaches 0, the entity will start taking damage. /// If it is max, the entity will heal damage (if specified) /// [DataField, AutoNetworkedField] public float DetectionValue; /// /// Indicates whether the user should take damage on light /// [DataField] public bool TakeDamageOnLight = true; /// /// Indicates whether the user should heal if not on light /// [DataField] public bool HealOnShadows = true; [DataField] public TimeSpan NextUpdate = TimeSpan.Zero; /// /// How often to decrease the DetectionValue. /// /// Example: /// If a shadowling is standing on light, and this is 1f, and DetectionTimerDecreaseFactor is 1f then /// it will take 5 seconds (considering DetectionValue is 5f) for the entity to start taking damage. /// [DataField] public TimeSpan UpdateInterval = TimeSpan.FromSeconds(0.5f); [DataField] public float DetectionValueFactor = 0.5f; /// /// How often the entity will take damage /// [DataField] public TimeSpan DamageInterval = TimeSpan.FromSeconds(5f); [DataField] public TimeSpan NextUpdateDamage = TimeSpan.Zero; /// /// How often the entity will heal damage /// [DataField] public TimeSpan HealInterval = TimeSpan.FromSeconds(3f); [DataField] public TimeSpan NextUpdateHeal = TimeSpan.Zero; /// /// For shadowlings (Light Resistance) /// [DataField] public float ResistanceModifier = 1; /// /// How much damage to deal to the entity. /// Shadowlings will have Light Resistance, so this will get affected by that. /// [DataField] public DamageSpecifier DamageToDeal = new() { DamageDict = new() { ["Heat"] = 15, } }; [DataField] public DamageSpecifier DamageToHeal = new() { DamageDict = new() { ["Blunt"] = -15, ["Slash"] = -15, ["Piercing"] = -15, ["Heat"] = -15, ["Cold"] = -15, ["Shock"] = -15, ["Asphyxiation"] = -15, ["Bloodloss"] = -15, ["Poison"] = -15, } }; [DataField] public ProtoId AlertProto = "ShadowlingLight"; [DataField] public bool ShowAlert = true; }