]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Zombies won't attack Initial Infected (#38128)
authorSyaoranFox <99053675+SyaoranFox@users.noreply.github.com>
Sat, 14 Jun 2025 00:56:57 +0000 (10:56 +1000)
committerGitHub <noreply@github.com>
Sat, 14 Jun 2025 00:56:57 +0000 (17:56 -0700)
* Added Zombie faction roles everywhere that makes sense for initial infected to be associated with Zombies.

* Adding faction component to round start zombie. (not hopeful)

* Removed stupid attempts and added zombie faction component to the zombie system when the player is given the ability to force themself to zombify.

* Changed use of "zombie" for ProtoId<NpcFactionPrototype>

* Update Content.Server/Zombies/ZombieSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Server/Zombies/ZombieSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Removed faction component from ZombieOutbreak event. Shouldn't cause problems with the event as II gets component with their ability to self zombify.

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Server/Zombies/ZombieSystem.cs

index d263df9ce5a2a1dfcb823599c2292b75b2f953a1..55d226ca5e97968b1fe323cc04bc2bd77a8b5ef7 100644 (file)
@@ -1,9 +1,11 @@
 using System.Linq;
+using Content.Shared.NPC.Prototypes;
 using Content.Server.Actions;
 using Content.Server.Body.Systems;
 using Content.Server.Chat;
 using Content.Server.Chat.Systems;
 using Content.Server.Emoting.Systems;
+using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Speech.EntitySystems;
 using Content.Server.Roles;
 using Content.Shared.Anomaly.Components;
@@ -43,6 +45,8 @@ namespace Content.Server.Zombies
         [Dependency] private readonly SharedPopupSystem _popup = default!;
         [Dependency] private readonly SharedRoleSystem _role = default!;
 
+        public readonly ProtoId<NpcFactionPrototype> Faction = "Zombie";
+
         public const SlotFlags ProtectiveSlots =
             SlotFlags.FEET |
             SlotFlags.HEAD |
@@ -88,6 +92,7 @@ namespace Content.Server.Zombies
         private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args)
         {
             _actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype);
+            _faction.AddFaction(uid, Faction);
 
             if (HasComp<ZombieComponent>(uid) || HasComp<ZombieImmuneComponent>(uid))
                 return;