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;
/// <summary>
/// Entities with this component cannot be zombified.
/// </summary>
[RegisterComponent]
public sealed partial class ZombieImmuneComponent : Component
{

View 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);

View File

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

View File

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