Skip to content

Commit

Permalink
make romerol work on the dead (#26222)
Browse files Browse the repository at this point in the history
* a

* review

* g
  • Loading branch information
Dutch-VanDerLinde authored Mar 18, 2024
1 parent 6c23989 commit 87386ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Content.Server/Zombies/ZombieSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override void Initialize()

SubscribeLocalEvent<ZombieComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<ZombieComponent, EmoteEvent>(OnEmote, before:
new []{typeof(VocalSystem), typeof(BodyEmotesSystem)});
new[] { typeof(VocalSystem), typeof(BodyEmotesSystem) });

SubscribeLocalEvent<ZombieComponent, MeleeHitEvent>(OnMeleeHit);
SubscribeLocalEvent<ZombieComponent, MobStateChangedEvent>(OnMobState);
Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<HumanoidAppearanceComponent>(target, out var appcomp))
if (TryComp<HumanoidAppearanceComponent>(target, out var appcomp))
{
appcomp.EyeColor = zombiecomp.BeforeZombifiedEyeColor;
}
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Reagents/toxins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@
physicalDesc: reagent-physical-desc-necrotic
flavor: bitter
color: "#7e916e"
worksOnTheDead: true
metabolisms:
Medicine:
effects:
Expand Down

0 comments on commit 87386ca

Please sign in to comment.