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 GitHub
parent f3df6b85af
commit 99cdff2b87
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

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

View File

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