Epinephrine can now stabilize animals in critical condition (#13277)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user