mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
25 lines
753 B
C#
25 lines
753 B
C#
using Content.Server.Objectives.Components;
|
|
using Content.Shared.Objectives.Components;
|
|
using Content.Shared.Mind;
|
|
|
|
namespace Content.Server.Objectives.Systems;
|
|
|
|
/// <summary>
|
|
/// Handles progress for the survive objective condition.
|
|
/// </summary>
|
|
public sealed partial class SurviveConditionSystem : EntitySystem
|
|
{
|
|
[Dependency] private SharedMindSystem _mind = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SurviveConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
|
|
}
|
|
|
|
private void OnGetProgress(EntityUid uid, SurviveConditionComponent comp, ref ObjectiveGetProgressEvent args)
|
|
{
|
|
args.Progress = _mind.IsCharacterDeadIc(args.Mind) ? 0f : 1f;
|
|
}
|
|
}
|