Files
tbd-station-14/Content.Shared/EntityConditions/Conditions/Body/MobStateEntityConditionSystem.cs
Princess Cheeseballs d4a32ce502 Mild Entity Effect/Condition Cleanup (#41059)
* Commit

* ploop

* borger

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-10-23 23:35:59 +00:00

29 lines
1.1 KiB
C#

using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityConditions.Conditions.Body;
/// <summary>
/// Returns true if this entity's current mob state matches the condition's specified mob state.
/// </summary>
/// <inheritdoc cref="EntityConditionSystem{T, TCondition}"/>
public sealed partial class MobStateEntityConditionSystem : EntityConditionSystem<MobStateComponent, MobStateCondition>
{
protected override void Condition(Entity<MobStateComponent> entity, ref EntityConditionEvent<MobStateCondition> args)
{
if (entity.Comp.CurrentState == args.Condition.Mobstate)
args.Result = true;
}
}
/// <inheritdoc cref="EntityCondition"/>
public sealed partial class MobStateCondition : EntityConditionBase<MobStateCondition>
{
[DataField]
public MobState Mobstate = MobState.Alive;
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
Loc.GetString("entity-condition-guidebook-mob-state-condition", ("state", Mobstate));
}