From 99cdff2b87fe2bba272a15930d90c6e305930ab1 Mon Sep 17 00:00:00 2001 From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Sun, 19 Nov 2023 22:28:05 +0000 Subject: [PATCH] Tiny mobs can no longer pass on the zombie disease (#21676) 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 | 10 ++++++++++ Content.Server/Zombies/ZombieImmuneComponent.cs | 3 +++ Content.Server/Zombies/ZombieSystem.cs | 2 +- Resources/Prototypes/Entities/Mobs/NPCs/animals.yml | 3 +++ Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Content.Server/Zombies/NonSpreaderZombieComponent.cs diff --git a/Content.Server/Zombies/NonSpreaderZombieComponent.cs b/Content.Server/Zombies/NonSpreaderZombieComponent.cs new file mode 100644 index 0000000000..5e1d0d3db4 --- /dev/null +++ b/Content.Server/Zombies/NonSpreaderZombieComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Server.Zombies; + +/// +/// Zombified entities with this component cannot infect other entities by attacking. +/// +[RegisterComponent] +public sealed partial class NonSpreaderZombieComponent: Component +{ + +} diff --git a/Content.Server/Zombies/ZombieImmuneComponent.cs b/Content.Server/Zombies/ZombieImmuneComponent.cs index 5f8ea625d8..76a8ab9e67 100644 --- a/Content.Server/Zombies/ZombieImmuneComponent.cs +++ b/Content.Server/Zombies/ZombieImmuneComponent.cs @@ -1,5 +1,8 @@ namespace Content.Server.Zombies; +/// +/// Entities with this component cannot be zombified. +/// [RegisterComponent] public sealed partial class ZombieImmuneComponent : Component { diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 3f971b970f..59edad6b4a 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -219,7 +219,7 @@ namespace Content.Server.Zombies } else { - if (!HasComp(entity) && _random.Prob(GetZombieInfectionChance(entity, component))) + if (!HasComp(entity) && !HasComp(args.User) && _random.Prob(GetZombieInfectionChance(entity, component))) { EnsureComp(entity); EnsureComp(entity); diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 5e24f0d30f..56c17dc078 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -313,6 +313,7 @@ damage: 10 behaviors: - !type:GibBehavior { } + - type: NonSpreaderZombie - type: entity name: glockroach @@ -1272,6 +1273,7 @@ - type: Puller needsHands: true - type: BadFood + - type: NonSpreaderZombie - type: entity parent: MobMouse @@ -2690,6 +2692,7 @@ BaseResistTime: 3 - type: MobPrice price: 60 + - type: NonSpreaderZombie - type: entity name: pig diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml b/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml index c1ac66705a..5f87c4c6a9 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/spacetick.yml @@ -84,6 +84,7 @@ accent: genericAggressive - type: Speech speechVerb: SmallMob + - type: NonSpreaderZombie - type: entity id: MobTickSalvage