]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Initial Infected can see each other (#25934)
authorKillerqu00 <47712032+Killerqu00@users.noreply.github.com>
Mon, 18 Mar 2024 21:57:36 +0000 (22:57 +0100)
committerGitHub <noreply@github.com>
Mon, 18 Mar 2024 21:57:36 +0000 (15:57 -0600)
initial infected icon

Content.Client/Antag/AntagStatusIconSystem.cs
Content.Client/Zombies/ZombieSystem.cs
Content.Shared/Zombies/InitialInfectedComponent.cs [new file with mode: 0644]
Resources/Prototypes/StatusIcon/antag.yml
Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png [new file with mode: 0644]
Resources/Textures/Interface/Misc/job_icons.rsi/meta.json

index 5d87837893c4c509262382ff3b076504b988ccc1..804ae21ad4a4cce9a7dca4649b827110f6c247b1 100644 (file)
@@ -22,6 +22,7 @@ public sealed class AntagStatusIconSystem : SharedStatusIconSystem
         SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
         SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
         SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
+        SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
     }
 
     /// <summary>
index bd89e978c70fa3cc03fa8b6d3bacfddac08b16dc..7c1fb38e7441a820b7fcf35c0356fb02531aa0fa 100644 (file)
@@ -15,6 +15,7 @@ public sealed class ZombieSystem : EntitySystem
 
         SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
         SubscribeLocalEvent<ZombieComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
+        SubscribeLocalEvent<InitialInfectedComponent, CanDisplayStatusIconsEvent>(OnCanDisplayStatusIcons);
     }
 
     private void OnStartup(EntityUid uid, ZombieComponent component, ComponentStartup args)
@@ -36,7 +37,18 @@ public sealed class ZombieSystem : EntitySystem
     /// </summary>
     private void OnCanDisplayStatusIcons(EntityUid uid, ZombieComponent component, ref CanDisplayStatusIconsEvent args)
     {
-        if (HasComp<ZombieComponent>(args.User) || HasComp<ShowZombieIconsComponent>(args.User))
+        if (HasComp<ZombieComponent>(args.User) || HasComp<InitialInfectedComponent>(args.User) || HasComp<ShowZombieIconsComponent>(args.User))
+            return;
+
+        if (component.IconVisibleToGhost && HasComp<GhostComponent>(args.User))
+            return;
+
+        args.Cancelled = true;
+    }
+
+    private void OnCanDisplayStatusIcons(EntityUid uid, InitialInfectedComponent component, CanDisplayStatusIconsEvent args)
+    {
+        if (HasComp<InitialInfectedComponent>(args.User) && !HasComp<ZombieComponent>(args.User))
             return;
 
         if (component.IconVisibleToGhost && HasComp<GhostComponent>(args.User))
diff --git a/Content.Shared/Zombies/InitialInfectedComponent.cs b/Content.Shared/Zombies/InitialInfectedComponent.cs
new file mode 100644 (file)
index 0000000..3200dd7
--- /dev/null
@@ -0,0 +1,16 @@
+using Content.Shared.Antag;
+using Content.Shared.StatusIcon;
+using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Zombies;
+
+[RegisterComponent, NetworkedComponent]
+public sealed partial class InitialInfectedComponent : Component, IAntagStatusIconComponent
+{
+    [DataField("initialInfectedStatusIcon")]
+    public ProtoId<StatusIconPrototype> StatusIcon { get; set; } = "InitialInfectedFaction";
+
+    [DataField]
+    public bool IconVisibleToGhost { get; set; } = true;
+}
index 757ec0354b07495a433fe96edfbec626ac0e9fdd..87576f93b77e52dd5e9b20ae8901e214f1934c05 100644 (file)
@@ -5,6 +5,13 @@
     sprite: /Textures/Interface/Misc/job_icons.rsi
     state: Zombie
 
+- type: statusIcon
+  id: InitialInfectedFaction
+  priority: 11
+  icon:
+    sprite: /Textures/Interface/Misc/job_icons.rsi
+    state: InitialInfected
+
 - type: statusIcon
   id: RevolutionaryFaction
   priority: 11
diff --git a/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png b/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png
new file mode 100644 (file)
index 0000000..3684fc4
Binary files /dev/null and b/Resources/Textures/Interface/Misc/job_icons.rsi/InitialInfected.png differ
index c8ec131c288e7250420c242b01967729cad37992..745cc43b844167d60c817982a79e145396b567f5 100644 (file)
         },
         {
             "name": "Visitor"
+        },
+        {
+            "name": "InitialInfected"
         }
     ]
 }