Require traitors to maroon their objective no matter what (#35825)

* jesus

* okay.

* OOPS

* ok

* ok

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* ok

* Update Resources/Prototypes/Objectives/paradoxClone.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Resources/Prototypes/Objectives/base_objectives.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* m

* ok

* ok

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Jackson Langley
2025-04-20 16:34:19 -05:00
committed by GitHub
parent 1ba2dfa10e
commit 256b6b88fb
5 changed files with 28 additions and 25 deletions

View File

@@ -29,36 +29,30 @@ public sealed class KillPersonConditionSystem : EntitySystem
if (!_target.GetTarget(uid, out var target))
return;
args.Progress = GetProgress(target.Value, comp.RequireDead);
args.Progress = GetProgress(target.Value, comp.RequireDead, comp.RequireMaroon);
}
private float GetProgress(EntityUid target, bool requireDead)
private float GetProgress(EntityUid target, bool requireDead, bool requireMaroon)
{
// deleted or gibbed or something, counts as dead
if (!TryComp<MindComponent>(target, out var mind) || mind.OwnedEntity == null)
return 1f;
// dead is success
if (_mind.IsCharacterDeadIc(mind))
return 1f;
var targetDead = _mind.IsCharacterDeadIc(mind);
var targetMarooned = !_emergencyShuttle.IsTargetEscaping(target) &&
_emergencyShuttle.ShuttlesLeft;
if (!_config.GetCVar(CCVars.EmergencyShuttleEnabled) && requireMaroon)
{
requireDead = true;
requireMaroon = false;
}
// if the target has to be dead dead then don't check evac stuff
if (requireDead)
if (requireDead && !targetDead)
return 0f;
// if evac is disabled then they really do have to be dead
if (!_config.GetCVar(CCVars.EmergencyShuttleEnabled))
return 0f;
if (requireMaroon) // if evac is still here and target hasn't boarded, show 50% to give you an indicator that you are doing good
return targetMarooned ? 1f : _emergencyShuttle.EmergencyShuttleArrived ? 0.5f : 0f;
// target is escaping so you fail
if (_emergencyShuttle.IsTargetEscaping(mind.OwnedEntity.Value))
return 0f;
// evac has left without the target, greentext since the target is afk in space with a full oxygen tank and coordinates off.
if (_emergencyShuttle.ShuttlesLeft)
return 1f;
// if evac is still here and target hasn't boarded, show 50% to give you an indicator that you are doing good
return _emergencyShuttle.EmergencyShuttleArrived ? 0.5f : 0f;
return 1f; // Good job you did it woohoo
}
}