]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Require traitors to maroon their objective no matter what (#35825)
authorJackson Langley <tripwiregamer@gmail.com>
Sun, 20 Apr 2025 21:34:19 +0000 (16:34 -0500)
committerGitHub <noreply@github.com>
Sun, 20 Apr 2025 21:34:19 +0000 (17:34 -0400)
* 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>
Content.Server/Objectives/Components/KillPersonConditionComponent.cs
Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
Resources/Locale/en-US/objectives/conditions/kill-person.ftl
Resources/Prototypes/Objectives/paradoxClone.yml
Resources/Prototypes/Objectives/traitor.yml

index 7bbc42ac9820f63a8d8335fa587b94d35d643916..534e8094b61830a8413b199c649c915236e403ee 100644 (file)
@@ -10,8 +10,14 @@ namespace Content.Server.Objectives.Components;
 public sealed partial class KillPersonConditionComponent : Component
 {
     /// <summary>
-    /// Whether the target must be truly dead, ignores missing evac.
+    /// Whether the target must be dead
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
     public bool RequireDead = false;
+
+    /// <summary>
+    /// Whether the target must not be on evac
+    /// </summary>
+    [DataField, ViewVariables(VVAccess.ReadWrite)]
+    public bool RequireMaroon = false;
 }
index 45ad68e28b6c13a033a59b51a6461914d0625efa..c378841278ae0db5688d565f5c816a6eded117b4 100644 (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;
-
-        // if the target has to be dead dead then don't check evac stuff
-        if (requireDead)
-            return 0f;
+        var targetDead = _mind.IsCharacterDeadIc(mind);
+        var targetMarooned = !_emergencyShuttle.IsTargetEscaping(target) &&
+                              _emergencyShuttle.ShuttlesLeft;
+        if (!_config.GetCVar(CCVars.EmergencyShuttleEnabled) && requireMaroon)
+        {
+            requireDead = true;
+            requireMaroon = false;
+        }
 
-        // if evac is disabled then they really do have to be dead
-        if (!_config.GetCVar(CCVars.EmergencyShuttleEnabled))
+        if (requireDead && !targetDead)
             return 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 (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;
 
-        // 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
     }
 }
index c48e2122ff4f83cff7d4e56c81b3da63bf99c67d..48606b92c2f7ccbe68144e3f139539afebac74e0 100644 (file)
@@ -1 +1,3 @@
 objective-condition-kill-person-title = Kill or maroon {$targetName}, {CAPITALIZE($job)}
+objective-condition-kill-maroon-title = Kill and maroon {$targetName}, {CAPITALIZE($job)}
+objective-condition-maroon-person-title = Maroon {$targetName}, {CAPITALIZE($job)}
index 40a1021676904f554adf95a4cb6fe4e53ef18d13..34b41050c791ba3b8f4237e96e5255d022a28906 100644 (file)
@@ -34,7 +34,7 @@
   components:
   - type: PickSpecificPerson
   - type: KillPersonCondition
-    requireDead: true # don't count missing evac as killing
+    requireDead: true
   - type: TargetObjective
     title: objective-condition-kill-head-title # kill <name>, <job>
 
index de222df6cc5e73be47f32199c28533c765079522..1da9953b609a197de7732f29b242a776c9a97e18 100644 (file)
     difficulty: 1.75
     unique: false
   - type: TargetObjective
-    title: objective-condition-kill-person-title
+    title: objective-condition-maroon-person-title
   - type: PickRandomPerson
 
 - type: entity
   parent: [BaseTraitorObjective, BaseKillObjective]
   id: KillRandomHeadObjective
-  description: We need this head gone and you probably know why. Good luck, agent.
+  description: We need this head gone and you probably know why. Make sure they don't make it to centcomm, even if they're dead. Good luck, agent.
   components:
   - type: Objective
     # technically its still possible for KillRandomPersonObjective to roll a head but this is guaranteed, so higher difficulty
     # killing 1 head is enough
     unique: true
   - type: TargetObjective
-    title: objective-condition-kill-head-title
+    title: objective-condition-kill-maroon-title
   - type: PickRandomHead
   - type: KillPersonCondition
     # don't count missing evac as killing as heads are higher profile, so you really need to do the dirty work
     # if ce flies a shittle to centcom you better find a way onto it
     requireDead: true
+    requireMaroon: true
 
 # social