using System.Text.Json.Serialization; using Content.Shared.Chemistry.Reagent; using Content.Shared.Damage; using Content.Shared.FixedPoint; using JetBrains.Annotations; namespace Content.Server.Chemistry.ReagentEffects { /// /// Default metabolism for medicine reagents. /// [UsedImplicitly] public sealed class HealthChange : ReagentEffect { /// /// Damage to apply every metabolism cycle. Damage Ignores resistances. /// [JsonPropertyName("damage")] [DataField("damage", required: true)] public DamageSpecifier Damage = default!; /// /// Should this effect scale the damage by the amount of chemical in the solution? /// Useful for touch reactions, like styptic powder or acid. /// [JsonPropertyName("scaleByQuantity")] [DataField("scaleByQuantity")] public bool ScaleByQuantity = false; [DataField("ignoreResistances")] [JsonPropertyName("ignoreResistances")] public bool IgnoreResistances = true; public override void Effect(ReagentEffectArgs args) { var scale = ScaleByQuantity ? args.Quantity : FixedPoint2.New(1); EntitySystem.Get().TryChangeDamage(args.SolutionEntity, Damage * scale, IgnoreResistances); } } }