From 22a75ae66872dd732e9941a33f88895ddb84f8a2 Mon Sep 17 00:00:00 2001
From: Lyndomen <49795619+Lyndomen@users.noreply.github.com>
Date: Tue, 7 Jan 2025 14:25:15 -0500
Subject: [PATCH] narcolepsy updates
---
Content.Server/Traits/Assorted/NarcolepsySystem.cs | 10 +++++-----
Content.Shared/Bed/Sleep/SleepingComponent.cs | 8 +++++---
.../{DeltaV => _DV}/Datasets/narcolepsywakeup.yml | 2 +-
.../{DeltaV => _DV}/Datasets/narcolepsywarning.yml | 2 +-
4 files changed, 12 insertions(+), 10 deletions(-)
rename Resources/Prototypes/{DeltaV => _DV}/Datasets/narcolepsywakeup.yml (72%)
rename Resources/Prototypes/{DeltaV => _DV}/Datasets/narcolepsywarning.yml (72%)
diff --git a/Content.Server/Traits/Assorted/NarcolepsySystem.cs b/Content.Server/Traits/Assorted/NarcolepsySystem.cs
index 4221ddab590..6a4ba682e72 100644
--- a/Content.Server/Traits/Assorted/NarcolepsySystem.cs
+++ b/Content.Server/Traits/Assorted/NarcolepsySystem.cs
@@ -18,7 +18,7 @@ public sealed class NarcolepsySystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popups = default!; // DeltaV Narcolepsy port from EE
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
[Dependency] private readonly IRobustRandom _random = default!;
- [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!; // DeltaV
///
public override void Initialize()
@@ -32,7 +32,7 @@ private void SetupNarcolepsy(EntityUid uid, NarcolepsyComponent component, Compo
PrepareNextIncident((uid, component));
}
- private void OnSleepChanged(Entity ent, ref SleepStateChangedEvent args)
+ private void OnSleepChanged(Entity ent, ref SleepStateChangedEvent args) // DeltaV
{
// When falling asleep while an incident is nigh, force it to happen immediately.
if (args.FellAsleep)
@@ -47,7 +47,7 @@ private void OnSleepChanged(Entity ent, ref SleepStateChang
}
}
- public void AdjustNarcolepsyTimer(EntityUid uid, float setTime, NarcolepsyComponent? narcolepsy = null)
+ public void AdjustNarcolepsyTimer(EntityUid uid, float setTime, NarcolepsyComponent? narcolepsy = null) // DeltaV changed int to float
{
if (!Resolve(uid, ref narcolepsy, false) || narcolepsy.NextIncidentTime > setTime)
return;
@@ -55,7 +55,7 @@ public void AdjustNarcolepsyTimer(EntityUid uid, float setTime, NarcolepsyCompon
narcolepsy.NextIncidentTime = setTime;
}
- public override void Update(float frameTime)
+ public override void Update(float frameTime) // Begin DeltaV
{
base.Update(frameTime);
@@ -120,6 +120,6 @@ private void DoWakeupPopup(EntityUid ent)
private void DoWarningPopup(EntityUid ent)
{
_popups.PopupEntity(GetRandomWarning(),ent,ent);
- }
+ } // End DeltaV
}
diff --git a/Content.Shared/Bed/Sleep/SleepingComponent.cs b/Content.Shared/Bed/Sleep/SleepingComponent.cs
index 6a03139e285..0f937c8cf10 100644
--- a/Content.Shared/Bed/Sleep/SleepingComponent.cs
+++ b/Content.Shared/Bed/Sleep/SleepingComponent.cs
@@ -35,9 +35,11 @@ public sealed partial class SleepingComponent : Component
/// // DeltaV begin port Narcolepsy from EE
/// The moment this entity went to sleep. Initialized on MapInit.
///
- [DataField("SleepingSince", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] // # DeltaV begin Narcolepsy port from EE
- [AutoPausedField]
- public TimeSpan SleepingSince; // DeltaV end port Narcolepsy from EE
+ ///
+ /// DeltaV: The moment this entity went to sleep. Initialized on MapInit.
+ ///
+ [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
+ public TimeSpan SleepingSince;
///
/// Sound to play when another player attempts to wake this entity.
diff --git a/Resources/Prototypes/DeltaV/Datasets/narcolepsywakeup.yml b/Resources/Prototypes/_DV/Datasets/narcolepsywakeup.yml
similarity index 72%
rename from Resources/Prototypes/DeltaV/Datasets/narcolepsywakeup.yml
rename to Resources/Prototypes/_DV/Datasets/narcolepsywakeup.yml
index 6eed846faf6..5a4ed44c200 100644
--- a/Resources/Prototypes/DeltaV/Datasets/narcolepsywakeup.yml
+++ b/Resources/Prototypes/_DV/Datasets/narcolepsywakeup.yml
@@ -1,5 +1,5 @@
- type: localizedDataset
- id: NarcolepsyWakeupDataset
+ id: NarcolepsyWakeup
values:
prefix: narcolepsy-wakeup-
count: 3
diff --git a/Resources/Prototypes/DeltaV/Datasets/narcolepsywarning.yml b/Resources/Prototypes/_DV/Datasets/narcolepsywarning.yml
similarity index 72%
rename from Resources/Prototypes/DeltaV/Datasets/narcolepsywarning.yml
rename to Resources/Prototypes/_DV/Datasets/narcolepsywarning.yml
index 4f76e07e0f8..c8e84cb6516 100644
--- a/Resources/Prototypes/DeltaV/Datasets/narcolepsywarning.yml
+++ b/Resources/Prototypes/_DV/Datasets/narcolepsywarning.yml
@@ -1,5 +1,5 @@
- type: localizedDataset
- id: NarcolepsyWarningDataset
+ id: NarcolepsyWarning
values:
prefix: narcolepsy-warning-
count: 5