Epinephrine can now stabilize animals in critical condition (#13277)

This commit is contained in:
nikthechampiongr
2023-01-17 03:47:41 +02:00
committed by GitHub
parent 2cfa230ced
commit 529c011501
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
namespace Content.Server.Chemistry.ReagentEffectConditions
{
public sealed class MobStateCondition : ReagentEffectCondition
{
[DataField("mobstate")]
public MobState mobstate = MobState.Alive;
public override bool Condition(ReagentEffectArgs args)
{
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out MobStateComponent? mobState))
{
if (mobState.CurrentState == mobstate)
return true;
}
return false;
}
}
}