]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix initial infected icons and add a briefing to the character menu (#29259)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Fri, 21 Jun 2024 05:42:17 +0000 (07:42 +0200)
committerGitHub <noreply@github.com>
Fri, 21 Jun 2024 05:42:17 +0000 (15:42 +1000)
Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Resources/Locale/en-US/administration/antag.ftl
Resources/Prototypes/GameRules/events.yml
Resources/Prototypes/GameRules/roundstart.yml

index 4103b8a8aa76716de1df895cedf74c7ff7ce452b..28918e960e5a128ecc57b06daa31a921accc62f7 100644 (file)
@@ -21,6 +21,9 @@ public sealed partial class AdminVerbSystem
     [ValidatePrototypeId<EntityPrototype>]
     private const string DefaultTraitorRule = "Traitor";
 
+    [ValidatePrototypeId<EntityPrototype>]
+    private const string DefaultInitialInfectedRule = "Zombie";
+
     [ValidatePrototypeId<EntityPrototype>]
     private const string DefaultNukeOpRule = "LoneOpsSpawn";
 
@@ -63,6 +66,20 @@ public sealed partial class AdminVerbSystem
         };
         args.Verbs.Add(traitor);
 
+        Verb initialInfected = new()
+        {
+            Text = Loc.GetString("admin-verb-text-make-initial-infected"),
+            Category = VerbCategory.Antag,
+            Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "InitialInfected"),
+            Act = () =>
+            {
+                _antag.ForceMakeAntag<ZombieRuleComponent>(targetPlayer, DefaultInitialInfectedRule);
+            },
+            Impact = LogImpact.High,
+            Message = Loc.GetString("admin-verb-make-initial-infected"),
+        };
+        args.Verbs.Add(initialInfected);
+
         Verb zombie = new()
         {
             Text = Loc.GetString("admin-verb-text-make-zombie"),
index 95d1f791ef2943d031853a089932913e684d4f01..e91931300e2397f6d1e69b358ba61d6368a88fc4 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Antag;
 using Content.Server.Chat.Systems;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Popups;
+using Content.Server.Roles;
 using Content.Server.RoundEnd;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
@@ -35,9 +36,27 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
     {
         base.Initialize();
 
+        SubscribeLocalEvent<InitialInfectedRoleComponent, GetBriefingEvent>(OnGetBriefing);
+        SubscribeLocalEvent<ZombieRoleComponent, GetBriefingEvent>(OnGetBriefing);
         SubscribeLocalEvent<IncurableZombieComponent, ZombifySelfActionEvent>(OnZombifySelf);
     }
 
+    private void OnGetBriefing(EntityUid uid, InitialInfectedRoleComponent component, ref GetBriefingEvent args)
+    {
+        if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
+            return;
+        if (HasComp<ZombieRoleComponent>(uid)) // don't show both briefings
+            return;
+        args.Append(Loc.GetString("zombie-patientzero-role-greeting"));
+    }
+
+    private void OnGetBriefing(EntityUid uid, ZombieRoleComponent component, ref GetBriefingEvent args)
+    {
+        if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
+            return;
+        args.Append(Loc.GetString("zombie-infection-greeting"));
+    }
+
     protected override void AppendRoundEndText(EntityUid uid, ZombieRuleComponent component, GameRuleComponent gameRule,
         ref RoundEndTextAppendEvent args)
     {
index 535659f27e5349c3be534d8c7dd25e059b3d565c..587c038557c920736b5ca75ef80c32d2da7934ea 100644 (file)
@@ -1,5 +1,6 @@
 verb-categories-antag = Antag ctrl
 admin-verb-make-traitor = Make the target into a traitor.
+admin-verb-make-initial-infected = Make the target into an Initial Infected.
 admin-verb-make-zombie = Zombifies the target immediately.
 admin-verb-make-nuclear-operative = Make target into a lone Nuclear Operative.
 admin-verb-make-pirate = Make the target into a pirate. Note this doesn't configure the game rule.
@@ -7,8 +8,9 @@ admin-verb-make-head-rev = Make the target into a Head Revolutionary.
 admin-verb-make-thief = Make the target into a thief.
 
 admin-verb-text-make-traitor = Make Traitor
+admin-verb-text-make-initial-infected = Make Initial Infected
 admin-verb-text-make-zombie = Make Zombie
 admin-verb-text-make-nuclear-operative = Make Nuclear Operative
 admin-verb-text-make-pirate = Make Pirate
 admin-verb-text-make-head-rev = Make Head Rev
-admin-verb-text-make-thief = Make Thief
\ No newline at end of file
+admin-verb-text-make-thief = Make Thief
index f8f2ef49e705b81a372e09a65067b1e26c53124a..3e63ad0283a3bfc535f5d7e741228b7ee41037b5 100644 (file)
     duration: 60
     maxDuration: 120
   - type: PowerGridCheckRule
-  
+
 - type: entity
   parent: BaseGameRule
   id: SolarFlare
         maxInitialInfectedGrace: 450
       - type: ZombifyOnDeath
       - type: IncurableZombie
+      - type: InitialInfected
       mindComponents:
       - type: InitialInfectedRole
         prototype: InitialInfected
index 923a01146062e4128325df922ec5b5b6eae3840a..a7b749a35f9fd67e12c0579707f6edd7b437298c 100644 (file)
       - type: PendingZombie
       - type: ZombifyOnDeath
       - type: IncurableZombie
+      - type: InitialInfected
       mindComponents:
       - type: InitialInfectedRole
         prototype: InitialInfected