Skip to content

Commit

Permalink
Mirror: make romerol work on the dead (#248)
Browse files Browse the repository at this point in the history
## Mirror of PR #26222: [make romerol work on the
dead](space-wizards/space-station-14#26222) from
<img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `87386ca0baa9fc3006b726d26723b345b737943d`

PR opened by <img
src="https://avatars.githubusercontent.com/u/45323883?v=4"
width="16"/><a href="https://github.com/Dutch-VanDerLinde">
Dutch-VanDerLinde</a> at 2024-03-18 03:07:02 UTC

---

PR changed 2 files with 10 additions and 3 deletions.

The PR had the following labels:
- Status: Needs Review


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> ## About the PR
> title
> 
> ## Why / Balance
> for zombie nukies it's bad because you have to have someone whose in
crit in order to efficiently infect them
> 
> ## Technical details
> adds a new check if the entity is dead upon ``PendingZombie`` map
init, if it is then zombify
> 
> ## Media
> <!-- 
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
> 
> If you're unsure whether your PR will require media, ask a maintainer.
> 
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
> 
> - [X] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
> 
> ## Breaking changes
> <!--
> List any breaking changes, including namespace, public
class/method/field changes, prototype renames; and provide instructions
for fixing them. This will be pasted in #codebase-changes.
> -->
> 
> **Changelog**
> 
> 🆑
> - tweak: Romerol now properly works on the dead.


</details>

Co-authored-by: SimpleStation14 <Unknown>
  • Loading branch information
SimpleStation14 authored May 9, 2024
1 parent 29125fe commit 391fb33
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 @@ -460,6 +460,7 @@
physicalDesc: reagent-physical-desc-necrotic
flavor: bitter
color: "#7e916e"
worksOnTheDead: true
metabolisms:
Medicine:
effects:
Expand Down

0 comments on commit 391fb33

Please sign in to comment.