]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
[HOTFIX] Fix maroon objective, change the text (#36990)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Mon, 28 Apr 2025 09:31:42 +0000 (11:31 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Apr 2025 09:31:42 +0000 (11:31 +0200)
* test

* text

* capital C

* guh

Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Resources/Locale/en-US/objectives/conditions/kill-person.ftl
Resources/Prototypes/Objectives/traitor.yml

index c378841278ae0db5688d565f5c816a6eded117b4..012fb80f76923e07017b22782c3e4a01b7bb72cb 100644 (file)
@@ -39,8 +39,7 @@ public sealed class KillPersonConditionSystem : EntitySystem
             return 1f;
 
         var targetDead = _mind.IsCharacterDeadIc(mind);
-        var targetMarooned = !_emergencyShuttle.IsTargetEscaping(target) &&
-                              _emergencyShuttle.ShuttlesLeft;
+        var targetOnShuttle = _emergencyShuttle.IsTargetEscaping(mind.OwnedEntity.Value);
         if (!_config.GetCVar(CCVars.EmergencyShuttleEnabled) && requireMaroon)
         {
             requireDead = true;
@@ -50,8 +49,17 @@ public sealed class KillPersonConditionSystem : EntitySystem
         if (requireDead && !targetDead)
             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;
+        // Always failed if the target needs to be marooned and the shuttle hasn't even arrived yet
+        if (requireMaroon && !_emergencyShuttle.EmergencyShuttleArrived)
+            return 0f;
+
+        // If the shuttle hasn't left, give 50% progress if the target isn't on the shuttle as a "almost there!"
+        if (requireMaroon && !_emergencyShuttle.ShuttlesLeft)
+            return targetOnShuttle ? 0f : 0.5f;
+
+        // If the shuttle has already left, and the target isn't on it, 100%
+        if (requireMaroon && _emergencyShuttle.ShuttlesLeft)
+            return targetOnShuttle ? 0f : 1f;
 
         return 1f; // Good job you did it woohoo
     }
index 8e3e01bfb64bd0801af0aac531d83b4c827436f1..c9c764a014e25a3e5b36af1794e85dc866497c56 100644 (file)
@@ -648,18 +648,11 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
         if (!EmergencyShuttleArrived)
             return false;
 
-        // check each emergency shuttle
+        // check if target is on an emergency shuttle
         var xform = Transform(target);
-        foreach (var stationData in EntityQuery<StationEmergencyShuttleComponent>())
-        {
-            if (stationData.EmergencyShuttle == null)
-                continue;
 
-            if (IsOnGrid(xform, stationData.EmergencyShuttle.Value))
-            {
-                return true;
-            }
-        }
+        if (HasComp<EmergencyShuttleComponent>(xform.GridUid))
+            return true;
 
         return false;
     }
index 48606b92c2f7ccbe68144e3f139539afebac74e0..aad31d26f9e1328969440900d8045b9e41e61038 100644 (file)
@@ -1,3 +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)}
+objective-condition-maroon-person-title = Prevent {$targetName}, {CAPITALIZE($job)} from reaching CentComm.
index 0f53488e69e97d512dba119c7e0313287e985ca4..4b6d9e0e66b5bd1262ff647001ba6d6837cb5116 100644 (file)
@@ -83,7 +83,7 @@
 - type: entity
   parent: [BaseTraitorObjective, BaseKillObjective]
   id: KillRandomPersonObjective
-  description: Do it however you like, just make sure they don't make it to centcomm.
+  description: Do it however you like, just make sure they don't get off the station.
   components:
   - type: Objective
     difficulty: 1.75
   - type: TargetObjective
     title: objective-condition-maroon-person-title
   - type: PickRandomPerson
+  - type: KillPersonCondition
+    requireMaroon: true
 
 - type: entity
   parent: [BaseTraitorObjective, BaseKillObjective]
   id: KillRandomHeadObjective
-  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.
+  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