* im good at atomizing. welcome to half-finished chem guides. * wagh * e * save work * aa * woweee UI * finishing the last of it * don't actually update the engine :( --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
33 lines
914 B
C#
33 lines
914 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 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;
|
|
}
|
|
|
|
public override string GuidebookExplanation(IPrototypeManager prototype)
|
|
{
|
|
return Loc.GetString("reagent-effect-condition-guidebook-mob-state-condition", ("state", mobstate));
|
|
}
|
|
}
|
|
}
|
|
|