]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Tiny mobs can no longer pass on the zombie disease (#21676)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Sun, 19 Nov 2023 22:28:05 +0000 (22:28 +0000)
committerGitHub <noreply@github.com>
Sun, 19 Nov 2023 22:28:05 +0000 (14:28 -0800)
This reverts f391ff28 and implements an alternate messure where mice and other small animals can no longer infect people as zombies.

This is done through a component which if present cancels the check that would cause zombie components to be added on people that get infected due to a bite.

This still allows other special stuff that happens in that function that may affect already infected individuals.
This is a compromise between what's discussed in discord which would much rather see mice and other animals just die from the infection and people on github which would see no change happen.

Since bats can't go under doors it may not be necessary to make them non spreaders.
If someone disagrees please tell me to just add it back.

Content.Server/Zombies/NonSpreaderZombieComponent.cs [new file with mode: 0644]
Content.Server/Zombies/ZombieImmuneComponent.cs
Content.Server/Zombies/ZombieSystem.cs
Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml

diff --git a/Content.Server/Zombies/NonSpreaderZombieComponent.cs b/Content.Server/Zombies/NonSpreaderZombieComponent.cs
new file mode 100644 (file)
index 0000000..5e1d0d3
--- /dev/null
@@ -0,0 +1,10 @@
+namespace Content.Server.Zombies;
+
+/// <summary>
+/// Zombified entities with this component cannot infect other entities by attacking.
+/// </summary>
+[RegisterComponent]
+public sealed partial class NonSpreaderZombieComponent: Component
+{
+
+}
index 5f8ea625d855428e4f265a25c75ffd2e7a46daf5..76a8ab9e675f46534239a4a1166c93d360dffbe0 100644 (file)
@@ -1,5 +1,8 @@
 namespace Content.Server.Zombies;
 
+/// <summary>
+/// Entities with this component cannot be zombified.
+/// </summary>
 [RegisterComponent]
 public sealed partial class ZombieImmuneComponent : Component
 {
index 3f971b970f164098f93c3e3685ab3482a2dde1e8..59edad6b4a0de31eb373e92d5a6ac3d2c768c98d 100644 (file)
@@ -219,7 +219,7 @@ namespace Content.Server.Zombies
                 }
                 else
                 {
-                    if (!HasComp<ZombieImmuneComponent>(entity) && _random.Prob(GetZombieInfectionChance(entity, component)))
+                    if (!HasComp<ZombieImmuneComponent>(entity) && !HasComp<NonSpreaderZombieComponent>(args.User) && _random.Prob(GetZombieInfectionChance(entity, component)))
                     {
                         EnsureComp<PendingZombieComponent>(entity);
                         EnsureComp<ZombifyOnDeathComponent>(entity);
index 5e24f0d30fd57b45c4decf59b54e6cc2636e0a90..56c17dc07844386623bb1cc5946ec853d9007dd8 100644 (file)
         damage: 10
       behaviors:
       - !type:GibBehavior { }
+  - type: NonSpreaderZombie
 
 - type: entity
   name: glockroach
   - type: Puller
     needsHands: true
   - type: BadFood
+  - type: NonSpreaderZombie
 
 - type: entity
   parent: MobMouse
     BaseResistTime: 3
   - type: MobPrice
     price: 60
+  - type: NonSpreaderZombie
 
 - type: entity
   name: pig
index c1ac66705a3db0101c3464bca337a48339c79947..5f87c4c6a9b15f1890c66882798dce578694df71 100644 (file)
@@ -84,6 +84,7 @@
     accent: genericAggressive
   - type: Speech
     speechVerb: SmallMob
+  - type: NonSpreaderZombie
 
 - type: entity
   id: MobTickSalvage