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.
This commit is contained in:
nikthechampiongr 2023-11-19 22:28:05 +00:00 committed by Debug
parent 65496caa8c
commit 01452cb2d3
5 changed files with 18 additions and 1 deletions

View File

@ -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
{
}

View File

@ -1,5 +1,8 @@
namespace Content.Server.Zombies; namespace Content.Server.Zombies;
/// <summary>
/// Entities with this component cannot be zombified.
/// </summary>
[RegisterComponent] [RegisterComponent]
public sealed partial class ZombieImmuneComponent : Component public sealed partial class ZombieImmuneComponent : Component
{ {

View File

@ -219,7 +219,7 @@ namespace Content.Server.Zombies
} }
else 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<PendingZombieComponent>(entity);
EnsureComp<ZombifyOnDeathComponent>(entity); EnsureComp<ZombifyOnDeathComponent>(entity);

View File

@ -324,6 +324,7 @@
damage: 10 damage: 10
behaviors: behaviors:
- !type:GibBehavior { } - !type:GibBehavior { }
- type: NonSpreaderZombie
- type: entity - type: entity
name: glockroach name: glockroach
@ -1288,6 +1289,7 @@
needsHands: true needsHands: true
- type: FelinidFood # Nyanotrasen - Felinid, ability to eat mice, see Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs - type: FelinidFood # Nyanotrasen - Felinid, ability to eat mice, see Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs
- type: BadFood - type: BadFood
- type: NonSpreaderZombie
- type: entity - type: entity
parent: MobMouse parent: MobMouse
@ -2708,6 +2710,7 @@
BaseResistTime: 3 BaseResistTime: 3
- type: MobPrice - type: MobPrice
price: 60 price: 60
- type: NonSpreaderZombie
- type: entity - type: entity
name: pig name: pig

View File

@ -84,6 +84,7 @@
accent: genericAggressive accent: genericAggressive
- type: Speech - type: Speech
speechVerb: SmallMob speechVerb: SmallMob
- type: NonSpreaderZombie
- type: entity - type: entity
id: MobTickSalvage id: MobTickSalvage