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

Add Chronic Pain to People Upon Death #2677

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
9 changes: 9 additions & 0 deletions Content.Server/_DV/Pain/PainSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Content.Shared._DV.Pain;
using Content.Shared.Humanoid;
using Content.Shared.Mobs;
using Content.Shared.Popups;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
Expand All @@ -17,6 +19,7 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PainComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<HumanoidAppearanceComponent, MobStateChangedEvent>(HandlePainDeath);
}

private void OnMapInit(Entity<PainComponent> ent, ref MapInitEvent args)
Expand Down Expand Up @@ -87,4 +90,10 @@ public override void Update(float frameTime)
component.NextUpdateTime = curTime + TimeSpan.FromSeconds(1);
}
}

private void HandlePainDeath(Entity<HumanoidAppearanceComponent> ent, ref MobStateChangedEvent args)
{
if (args.NewMobState == MobState.Dead)
EnsureComp<PainComponent>(args.Target);
}
}
Loading