Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make romerol work on the dead #26222

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading