2021-11-20 16:47:53 -07:00
|
|
|
|
using Content.Shared.Chemistry.Reagent;
|
|
|
|
|
|
using Content.Shared.Damage;
|
|
|
|
|
|
using Content.Shared.FixedPoint;
|
|
|
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.ReagentEffectConditions
|
|
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TotalDamage : ReagentEffectCondition
|
2021-11-20 16:47:53 -07:00
|
|
|
|
{
|
|
|
|
|
|
[DataField("max")]
|
|
|
|
|
|
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
|
|
|
|
|
|
|
|
|
|
|
[DataField("min")]
|
|
|
|
|
|
public FixedPoint2 Min = FixedPoint2.Zero;
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Condition(ReagentEffectArgs args)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out DamageableComponent damage))
|
|
|
|
|
|
{
|
|
|
|
|
|
var total = damage.TotalDamage;
|
|
|
|
|
|
if (total > Min && total < Max)
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|