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