mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* documentation pass on content.server -> E! * APi pass on content.server for the E folder. * documentation pass on content.shared for e. * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * fixing documentation according to review part 1. * typo * Very minor fixes * And a short explanation about EUI --------- Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
31 lines
1.2 KiB
C#
31 lines
1.2 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>
|
|
{
|
|
/// <summary>
|
|
/// The mobstate necessary to fulfill this condition.
|
|
/// </summary>
|
|
[DataField]
|
|
public MobState Mobstate = MobState.Alive;
|
|
|
|
public override string EntityConditionGuidebookText(IPrototypeManager prototype) =>
|
|
Loc.GetString("entity-condition-guidebook-mob-state-condition", ("state", Mobstate));
|
|
}
|