Merge remote-tracking branch 'upstream/stable' into ed-08-07-2025-upstream
# Conflicts: # Content.Server/Audio/ContentAudioSystem.cs # Content.Server/Medical/HealthAnalyzerSystem.cs # Content.Server/Shuttles/Systems/ShuttleSystem.cs # Resources/Locale/en-US/navmap-beacons/station-beacons.ftl
This commit is contained in:
@@ -19,6 +19,7 @@ using Content.Shared.Sound;
|
||||
using Content.Shared.Sound.Components;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Content.Shared.Stunnable;
|
||||
using Content.Shared.Traits.Assorted;
|
||||
using Content.Shared.Verbs;
|
||||
@@ -37,10 +38,12 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedEmitSoundSystem _emitSound = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffectOld = default!;
|
||||
[Dependency] private readonly SharedStatusEffectsSystem _statusEffectNew = default!;
|
||||
|
||||
public static readonly EntProtoId SleepActionId = "ActionSleep";
|
||||
public static readonly EntProtoId WakeActionId = "ActionWake";
|
||||
public static readonly EntProtoId StatusEffectForcedSleeping = "StatusEffectForcedSleeping";
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -65,7 +68,7 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
SubscribeLocalEvent<SleepingComponent, GetVerbsEvent<AlternativeVerb>>(AddWakeVerb);
|
||||
SubscribeLocalEvent<SleepingComponent, InteractHandEvent>(OnInteractHand);
|
||||
|
||||
SubscribeLocalEvent<ForcedSleepingComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<ForcedSleepingStatusEffectComponent, StatusEffectAppliedEvent>(OnStatusEffectApplied);
|
||||
SubscribeLocalEvent<SleepingComponent, UnbuckleAttemptEvent>(OnUnbuckleAttempt);
|
||||
SubscribeLocalEvent<SleepingComponent, EmoteAttemptEvent>(OnEmoteAttempt);
|
||||
|
||||
@@ -104,8 +107,8 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
if (args.FellAsleep)
|
||||
{
|
||||
// Expiring status effects would remove the components needed for sleeping
|
||||
_statusEffectsSystem.TryRemoveStatusEffect(ent.Owner, "Stun");
|
||||
_statusEffectsSystem.TryRemoveStatusEffect(ent.Owner, "KnockedDown");
|
||||
_statusEffectOld.TryRemoveStatusEffect(ent.Owner, "Stun");
|
||||
_statusEffectOld.TryRemoveStatusEffect(ent.Owner, "KnockedDown");
|
||||
|
||||
EnsureComp<StunnedComponent>(ent);
|
||||
EnsureComp<KnockedDownComponent>(ent);
|
||||
@@ -251,9 +254,9 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
_emitSound.SetEnabled((ent, spam), args.NewMobState == MobState.Alive);
|
||||
}
|
||||
|
||||
private void OnInit(Entity<ForcedSleepingComponent> ent, ref ComponentInit args)
|
||||
private void OnStatusEffectApplied(Entity<ForcedSleepingStatusEffectComponent> ent, ref StatusEffectAppliedEvent args)
|
||||
{
|
||||
TrySleeping(ent.Owner);
|
||||
TrySleeping(args.Target);
|
||||
}
|
||||
|
||||
private void Wake(Entity<SleepingComponent> ent)
|
||||
@@ -310,7 +313,7 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
if (!Resolve(ent, ref ent.Comp, false))
|
||||
return false;
|
||||
|
||||
if (!force && HasComp<ForcedSleepingComponent>(ent))
|
||||
if (!force && _statusEffectNew.HasEffectComp<ForcedSleepingStatusEffectComponent>(ent))
|
||||
{
|
||||
if (user != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user