Files
tbd-station-14/Content.Server/Chemistry/ReagentEffectConditions/MobStateCondition.cs
2023-12-29 08:47:43 -04:00

31 lines
908 B
C#

using Content.Shared.Chemistry.Reagent;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.ReagentEffectConditions
{
public sealed partial class MobStateCondition : ReagentEffectCondition
{
[DataField]
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;
}
public override string GuidebookExplanation(IPrototypeManager prototype)
{
return Loc.GetString("reagent-effect-condition-guidebook-mob-state-condition", ("state", Mobstate));
}
}
}