-
Notifications
You must be signed in to change notification settings - Fork 405
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
Ports EE Narcolepsy #2197
base: master
Are you sure you want to change the base?
Ports EE Narcolepsy #2197
Conversation
Does this include your sentence being cutoff when you fall asleep? I see a lot of narcoleptic players sad to not have that. |
@@ -20,5 +20,21 @@ public sealed partial class NarcolepsyComponent : Component | |||
[DataField("durationOfIncident", required: true)] | |||
public Vector2 DurationOfIncident { get; private set; } | |||
|
|||
[DataField] // # DeltaV begin Narcolepsy port from EE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autopausedfield + timeoffsetserializer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this requires i turn a float into a timespan and i am lamenting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh it's a fucking float-
why...
this should be stored as a timespan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it compares against a billion floats, and also compares against frameTime which is a float i cant turn into a TimeSpan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it'd be better to get it as a TimeSpan.FromSeconds() inside of PrepareNextIncident() and just refactor everything else to use timespans (or get it from seconds for the ResetNarcolepsy method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plssss one of my main chars has narcolepsy and she is so, so much more playable on EE servers bc of this feature. i wholeheartedly support this PR and if there's some way i can actually help make it real pls let me know !! |
Worth refactoring NextIncidentTime to float? Would be upstream chance |
public sealed class SleepStateChangedEvent : EntityEventArgs | ||
{ | ||
public bool FellAsleep = false; | ||
|
||
/// <summary> | ||
/// The amount of time this entity slept for. Null if <see cref="FellAsleep"/> is true. | ||
/// </summary> | ||
public TimeSpan? TimeSlept; | ||
|
||
public SleepStateChangedEvent(bool fellAsleep) | ||
{ | ||
FellAsleep = fellAsleep; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont do this, add , TimeSpan? TimeSlept = null
and instead of setting .TimeSlept = ... pass it as extra param
then add deltav comment on the line
public record struct SleepStateChangedEvent(bool FellAsleep); | ||
public sealed class SleepStateChangedEvent : EntityEventArgs | ||
{ | ||
public bool FellAsleep; | ||
|
||
/// <summary> | ||
/// The amount of time this entity slept for. Null if <see cref="FellAsleep"/> is true. | ||
/// </summary> | ||
public TimeSpan? TimeSlept; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="SleepStateChangedEvent"/> class. | ||
/// </summary> | ||
/// <param name="fellAsleep">True if the entity fell asleep, false if it woke up.</param> | ||
/// <param name="timeSlept">The duration of sleep, or null if the entity just fell asleep.</param> | ||
public SleepStateChangedEvent(bool fellAsleep, TimeSpan? timeSlept = null) // DeltaV | ||
{ | ||
FellAsleep = fellAsleep; | ||
TimeSlept = timeSlept; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previous review still stands, keep this a struct and just add a field to the list
maybe updated, im trying to figure out why i can still run around and emote while sleeping |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Sleep walking trait when? |
About the PR
Ports EE's Simple-Station/Einstein-Engines#967
Why / Balance
Falling asleep randomly isnt always fun.
Technical details
Ports C#. EE has a different sleep system so this took a lil bit of work.
Media
Requirements
Breaking changes
Changelog
🆑