forked from impstation/imp-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor event schedulers to use explicit game rules (space-wizards#2…
…9320) * works, still has testing values, im sure I did stupid shit. * shitvent crapfactor * snap extra word out of existence * shit I died of old * remove useless inaccurate design comments * Oopsie, handle requirement params in RandomRuleSystem too * I'm a slash slinging hasher * Address reviews, add admin alerts I forgor * EntityMan saves the day * address reviews 1 * eh, I actually don't care about the cargo gifts thing. * started * Do reviews * you actually meant 1.2 lmao * dependency inheritance is a fickle bitch * I have no idea. * Threads are for sheets not computers. * fix traitor rule test * fix round type tattling * break things * It worky * Toolshed makes we want to drink depresso. * Finished? * remove debug values * timings * use defaults * alphabetize * bobby drop tables * Float required fr fr * continue * more continence * uno mas * obsolution * cleanup and documentations * Yell at self * use the right value defaults * housekeeping
- Loading branch information
1 parent
b39eb5b
commit b4f0659
Showing
21 changed files
with
600 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 27 additions & 6 deletions
33
Content.Server/StationEvents/Components/BasicStationEventSchedulerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
namespace Content.Server.StationEvents.Components; | ||
using Content.Shared.Destructible.Thresholds; | ||
using Content.Shared.EntityTable.EntitySelectors; | ||
|
||
|
||
namespace Content.Server.StationEvents.Components; | ||
|
||
[RegisterComponent, Access(typeof(BasicStationEventSchedulerSystem))] | ||
public sealed partial class BasicStationEventSchedulerComponent : Component | ||
{ | ||
public const float MinimumTimeUntilFirstEvent = 300; | ||
/// <summary> | ||
/// How long the the scheduler waits to begin starting rules. | ||
/// </summary> | ||
[DataField] | ||
public float MinimumTimeUntilFirstEvent = 200; | ||
|
||
/// <summary> | ||
/// The minimum and maximum time between rule starts in seconds. | ||
/// </summary> | ||
[DataField] | ||
public MinMax MinMaxEventTiming = new(3 * 60, 10 * 60); | ||
|
||
/// <summary> | ||
/// How long until the next check for an event runs, is initially set based on MinimumTimeUntilFirstEvent & MinMaxEventTiming. | ||
/// </summary> | ||
[DataField] | ||
public float TimeUntilNextEvent; | ||
|
||
/// <summary> | ||
/// How long until the next check for an event runs | ||
/// The gamerules that the scheduler can choose from | ||
/// </summary> | ||
/// Default value is how long until first event is allowed | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float TimeUntilNextEvent = MinimumTimeUntilFirstEvent; | ||
/// Reminder that though we could do all selection via the EntityTableSelector, we also need to consider various <see cref="StationEventComponent"/> restrictions. | ||
/// As such, we want to pass a list of acceptable game rules, which are then parsed for restrictions by the <see cref="EventManagerSystem"/>. | ||
[DataField(required: true)] | ||
public EntityTableSelector ScheduledGameRules = default!; | ||
} |
24 changes: 0 additions & 24 deletions
24
Content.Server/StationEvents/Components/MeteorSchedulerComponent.cs
This file was deleted.
Oops, something went wrong.
34 changes: 29 additions & 5 deletions
34
Content.Server/StationEvents/Components/RampingStationEventSchedulerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,41 @@ | ||
namespace Content.Server.StationEvents.Components; | ||
using Content.Shared.EntityTable.EntitySelectors; | ||
|
||
namespace Content.Server.StationEvents.Components; | ||
|
||
[RegisterComponent, Access(typeof(RampingStationEventSchedulerSystem))] | ||
public sealed partial class RampingStationEventSchedulerComponent : Component | ||
{ | ||
[DataField("endTime"), ViewVariables(VVAccess.ReadWrite)] | ||
/// <summary> | ||
/// Average ending chaos modifier for the ramping event scheduler. Higher means faster. | ||
/// Max chaos chosen for a round will deviate from this | ||
/// </summary> | ||
[DataField] | ||
public float AverageChaos = 6f; | ||
|
||
/// <summary> | ||
/// Average time (in minutes) for when the ramping event scheduler should stop increasing the chaos modifier. | ||
/// Close to how long you expect a round to last, so you'll probably have to tweak this on downstreams. | ||
/// </summary> | ||
[DataField] | ||
public float AverageEndTime = 40f; | ||
|
||
[DataField] | ||
public float EndTime; | ||
|
||
[DataField("maxChaos"), ViewVariables(VVAccess.ReadWrite)] | ||
[DataField] | ||
public float MaxChaos; | ||
|
||
[DataField("startingChaos"), ViewVariables(VVAccess.ReadWrite)] | ||
[DataField] | ||
public float StartingChaos; | ||
|
||
[DataField("timeUntilNextEvent"), ViewVariables(VVAccess.ReadWrite)] | ||
[DataField] | ||
public float TimeUntilNextEvent; | ||
|
||
/// <summary> | ||
/// The gamerules that the scheduler can choose from | ||
/// </summary> | ||
/// Reminder that though we could do all selection via the EntityTableSelector, we also need to consider various <see cref="StationEventComponent"/> restrictions. | ||
/// As such, we want to pass a list of acceptable game rules, which are then parsed for restrictions by the <see cref="EventManagerSystem"/>. | ||
[DataField(required: true)] | ||
public EntityTableSelector ScheduledGameRules = default!; | ||
} |
Oops, something went wrong.