Added Pain Numbness Trait (#34538)

* added pain-numbness component and system

* added numb as a trait that pulls the pain numbness component

* removed new event as mob threshold event as already being fired

* checked for MobThresholdsComponent first before running VerifyThresholds

* refacted force say to using LocalizedDatasetPrototype and added numb messages

* added severity check alert

* added comment for BeforeForceSayEvent

* removed space formatting

* changed Cancelled to CancelUpdate, fixed spacing and added two more damage-force-say-numb

* changed prefix damage-force-say-numb to 5 (whoops)
This commit is contained in:
Coolsurf6
2025-01-27 20:34:20 +10:00
committed by GitHub
parent 1b9d84a16e
commit 012c835559
14 changed files with 174 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.Actions;
using Content.Shared.Buckle.Components;
using Content.Shared.Damage;
using Content.Shared.Damage.Events;
using Content.Shared.Damage.ForceSay;
using Content.Shared.Emoting;
using Content.Shared.Examine;
@@ -18,6 +19,7 @@ using Content.Shared.Sound.Components;
using Content.Shared.Speech;
using Content.Shared.StatusEffect;
using Content.Shared.Stunnable;
using Content.Shared.Traits.Assorted;
using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
@@ -63,6 +65,8 @@ public sealed partial class SleepingSystem : EntitySystem
SubscribeLocalEvent<ForcedSleepingComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<SleepingComponent, UnbuckleAttemptEvent>(OnUnbuckleAttempt);
SubscribeLocalEvent<SleepingComponent, EmoteAttemptEvent>(OnEmoteAttempt);
SubscribeLocalEvent<SleepingComponent, BeforeForceSayEvent>(OnChangeForceSay, after: new []{typeof(PainNumbnessSystem)});
}
private void OnUnbuckleAttempt(Entity<SleepingComponent> ent, ref UnbuckleAttemptEvent args)
@@ -317,6 +321,11 @@ public sealed partial class SleepingSystem : EntitySystem
{
args.Cancel();
}
private void OnChangeForceSay(Entity<SleepingComponent> ent, ref BeforeForceSayEvent args)
{
args.Prefix = ent.Comp.ForceSaySleepDataset;
}
}