]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix hijack objective (#21241)
authorMorb <14136326+Morb0@users.noreply.github.com>
Sat, 28 Oct 2023 02:33:18 +0000 (05:33 +0300)
committerGitHub <noreply@github.com>
Sat, 28 Oct 2023 02:33:18 +0000 (22:33 -0400)
* Fix hijack

* Max difficulty

Content.Server/Objectives/Components/HijackShuttleComponent.cs [deleted file]
Content.Server/Objectives/Components/HijackShuttleConditionComponent.cs [new file with mode: 0644]
Content.Server/Objectives/Systems/HijackShuttleConditionSystem.cs
Resources/Locale/en-US/objectives/conditions/hijack-shuttle-condition.ftl [deleted file]
Resources/Prototypes/Objectives/traitor.yml

diff --git a/Content.Server/Objectives/Components/HijackShuttleComponent.cs b/Content.Server/Objectives/Components/HijackShuttleComponent.cs
deleted file mode 100644 (file)
index 010f6f1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-using Content.Server.Objectives.Systems;
-
-namespace Content.Server.Objectives.Components;
-
-[RegisterComponent, Access(typeof(HijackShuttleConditionSystem))]
-public sealed partial class HijackShuttleComponent : Component
-{
-}
diff --git a/Content.Server/Objectives/Components/HijackShuttleConditionComponent.cs b/Content.Server/Objectives/Components/HijackShuttleConditionComponent.cs
new file mode 100644 (file)
index 0000000..2f07086
--- /dev/null
@@ -0,0 +1,11 @@
+using Content.Server.Objectives.Systems;
+
+namespace Content.Server.Objectives.Components;
+
+/// <summary>
+/// Objective condition that requires the player to leave station of escape shuttle with only antags on board or handcuffed humanoids
+/// </summary>
+[RegisterComponent, Access(typeof(HijackShuttleConditionSystem))]
+public sealed partial class HijackShuttleConditionComponent : Component
+{
+}
index 5ea560297c50cc43993937e9a592750eb4075170..9e0d2c3d5b513b173f091d8753fe9947de142488 100644 (file)
@@ -23,17 +23,17 @@ public sealed class HijackShuttleConditionSystem : EntitySystem
     {
         base.Initialize();
 
-        SubscribeLocalEvent<HijackShuttleComponent, ObjectiveGetProgressEvent>(OnGetProgress);
+        SubscribeLocalEvent<HijackShuttleConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
     }
 
-    private void OnGetProgress(EntityUid uid, HijackShuttleComponent comp, ref ObjectiveGetProgressEvent args)
+    private void OnGetProgress(EntityUid uid, HijackShuttleConditionComponent comp, ref ObjectiveGetProgressEvent args)
     {
         args.Progress = GetProgress(args.MindId, args.Mind);
     }
 
     private float GetProgress(EntityUid mindId, MindComponent mind)
     {
-        // not escaping alive if you're deleted/dead
+        // Not escaping alive if you're deleted/dead
         if (mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind))
             return 0f;
 
diff --git a/Resources/Locale/en-US/objectives/conditions/hijack-shuttle-condition.ftl b/Resources/Locale/en-US/objectives/conditions/hijack-shuttle-condition.ftl
deleted file mode 100644 (file)
index 5a0c1fd..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-objective-condition-hijack-shuttle-title = Hijack emergency shuttle
-objective-condition-hijack-shuttle-description = Leave on the shuttle free and clear of the loyal Nanotrasen crew on board. Use ANY methods available to you. Syndicate agents, Nanotrasen enemies, and handcuffed hostages may remain alive on the shuttle. Ignore assistance from anyone other than a support agent.
index f0e8daad3d1cbabdb39afc035cc82c1db7c3774f..dd188765b990b1d7d950282017e5e52d2bde8549 100644 (file)
       - StealCondition
   - type: DieCondition
 
+- type: entity
+  noSpawn: true
+  parent: [BaseTraitorObjective, BaseLivingObjective]
+  id: HijackShuttleObjective
+  name: Hijack emergency shuttle
+  description: Leave on the shuttle free and clear of the loyal Nanotrasen crew on board. Use ANY methods available to you. Syndicate agents, Nanotrasen enemies, and handcuffed hostages may remain alive on the shuttle. Ignore assistance from anyone other than a support agent.
+  components:
+    - type: Objective
+      difficulty: 5 # insane, default config max difficulty
+      icon:
+        sprite: Objects/Tools/emag.rsi
+        state: icon
+    - type: HijackShuttleCondition
+
 # kill
 
 - type: entity