From 87386ca0baa9fc3006b726d26723b345b737943d Mon Sep 17 00:00:00 2001 From: "Mr. 27" <45323883+Dutch-VanDerLinde@users.noreply.github.com> Date: Mon, 18 Mar 2024 02:25:36 -0400 Subject: [PATCH] make romerol work on the dead (#26222) * a * review * g --- Content.Server/Zombies/ZombieSystem.cs | 12 +++++++++--- Resources/Prototypes/Reagents/toxins.yml | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index e515c377be8a..bef57eceb391 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -55,7 +55,7 @@ public override void Initialize() SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnEmote, before: - new []{typeof(VocalSystem), typeof(BodyEmotesSystem)}); + new[] { typeof(VocalSystem), typeof(BodyEmotesSystem) }); SubscribeLocalEvent(OnMeleeHit); SubscribeLocalEvent(OnMobState); @@ -70,6 +70,12 @@ public override void Initialize() private void OnPendingMapInit(EntityUid uid, PendingZombieComponent component, MapInitEvent args) { + if (_mobState.IsDead(uid)) + { + ZombifyEntity(uid); + return; + } + component.NextTick = _timing.CurTime + TimeSpan.FromSeconds(1f); } @@ -196,7 +202,7 @@ private float GetZombieInfectionChance(EntityUid uid, ZombieComponent component) var min = component.MinZombieInfectionChance; //gets a value between the max and min based on how many items the entity is wearing - var chance = (max-min) * ((total - items)/total) + min; + var chance = (max - min) * ((total - items) / total) + min; return chance; } @@ -261,7 +267,7 @@ public bool UnZombify(EntityUid source, EntityUid target, ZombieComponent? zombi _humanoidAppearance.SetBaseLayerColor(target, layer, info.Color); _humanoidAppearance.SetBaseLayerId(target, layer, info.Id); } - if(TryComp(target, out var appcomp)) + if (TryComp(target, out var appcomp)) { appcomp.EyeColor = zombiecomp.BeforeZombifiedEyeColor; } diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml index 18d479327408..02e0b995193c 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -455,6 +455,7 @@ physicalDesc: reagent-physical-desc-necrotic flavor: bitter color: "#7e916e" + worksOnTheDead: true metabolisms: Medicine: effects: