using Content.Shared.Alert; using Content.Shared.Chemistry.Reagent; using Robust.Shared.Timing; namespace Content.Server.Chemistry.ReagentEffects; public sealed class AdjustAlert : ReagentEffect { [DataField("alertType", required: true)] public AlertType Type; [DataField("clear")] public bool Clear; [DataField("cooldown")] public bool Cooldown; [DataField("time")] public float Time; public override void Effect(ReagentEffectArgs args) { var alertSys = EntitySystem.Get(); if (args.EntityManager.HasComponent(args.SolutionEntity)) { if (Clear) { alertSys.ClearAlert(args.SolutionEntity, Type); } else { (TimeSpan, TimeSpan)? cooldown = null; if (Cooldown) { var timing = IoCManager.Resolve(); cooldown = (timing.CurTime, timing.CurTime + TimeSpan.FromSeconds(Time)); } alertSys.ShowAlert(args.SolutionEntity, Type, cooldown: cooldown); } } } }