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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -227,9 +227,9 @@
|
|||||||
effects:
|
effects:
|
||||||
- !type:HealthChange
|
- !type:HealthChange
|
||||||
conditions:
|
conditions:
|
||||||
- !type:TotalDamage
|
|
||||||
# they gotta be in crit first
|
# they gotta be in crit first
|
||||||
min: 100
|
- !type:MobStateCondition
|
||||||
|
mobstate: Critical
|
||||||
- !type:ReagentThreshold
|
- !type:ReagentThreshold
|
||||||
min: 0
|
min: 0
|
||||||
max: 20
|
max: 20
|
||||||
|
|||||||
Reference in New Issue
Block a user