using Content.Shared.Damage; using Content.Shared.InteractionVerbs; using Robust.Shared.Serialization; namespace Content.Server.InteractionVerbs.Actions; [Serializable] public sealed partial class ModifyHealthAction : InteractionAction { [DataField(required: true)] public DamageSpecifier Damage = default!; [DataField] public bool IgnoreResistance = false; public override bool IsAllowed(InteractionArgs args, InteractionVerbPrototype proto, VerbDependencies deps) { return deps.EntMan.HasComponent(args.Target); } public override bool CanPerform(InteractionArgs args, InteractionVerbPrototype proto, bool beforeDelay, VerbDependencies deps) { // TODO: check if container supports this kind of damage? return true; } public override bool Perform(InteractionArgs args, InteractionVerbPrototype proto, VerbDependencies deps) { return deps.EntMan.System() .TryChangeDamage(args.Target, Damage, IgnoreResistance, origin: args.User) is not null; } }