Event refactor (#9589)
* Station event refactor * Remove clientside `IStationEventManager` we can just use prototypes * Basic API idea * Cruft * first attempt at epicness * okay yeah this shit is really clean * sort out minor stuff * Convert `BreakerFlip` * `BureaucraticError` + general cleanup * `DiseaseOutbreak` * `FalseAlarm` * `GasLeak` * `KudzuGrowth` * `MeteorSwarm` * `MouseMigration` * misc errors * `PowerGridCheck` * `RandomSentience` * `VentClog` * `VentCritters` * `ZombieOutbreak` * Rewrite basic event scheduler * Minor fixes and logging * ooooops * errors + fix * linter * completions, `RuleStarted` property, update loop fixes * Tweaks * Fix #9462 * Basic scheduler update fix, and fixes #8174 * Add test * UI cleanup * really this was just for testing
This commit is contained in:
@@ -97,7 +97,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
|
||||
private void OnRoundStartAttempt(RoundStartAttemptEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
var minPlayers = _cfg.GetCVar(CCVars.SuspicionMinPlayers);
|
||||
@@ -119,7 +119,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
|
||||
private void OnPlayersAssigned(RulePlayerJobsAssignedEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
var minTraitors = _cfg.GetCVar(CCVars.SuspicionMinTraitors);
|
||||
@@ -203,7 +203,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
}
|
||||
}
|
||||
|
||||
public override void Started(GameRuleConfiguration _)
|
||||
public override void Started()
|
||||
{
|
||||
_playerManager.PlayerStatusChanged += PlayerManagerOnPlayerStatusChanged;
|
||||
|
||||
@@ -269,7 +269,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
Timer.SpawnRepeating(DeadCheckDelay, CheckWinConditions, _checkTimerCancel.Token);
|
||||
}
|
||||
|
||||
public override void Ended(GameRuleConfiguration _)
|
||||
public override void Ended()
|
||||
{
|
||||
_doorSystem.AccessType = SharedDoorSystem.AccessTypes.Id;
|
||||
EndTime = null;
|
||||
@@ -288,7 +288,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
|
||||
private void CheckWinConditions()
|
||||
{
|
||||
if (!Enabled || !_cfg.GetCVar(CCVars.GameLobbyEnableWin))
|
||||
if (!RuleAdded || !_cfg.GetCVar(CCVars.GameLobbyEnableWin))
|
||||
return;
|
||||
|
||||
var traitorsAlive = 0;
|
||||
@@ -457,7 +457,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem
|
||||
|
||||
private void OnLateJoinRefresh(RefreshLateJoinAllowedEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
ev.Disallow();
|
||||
|
||||
Reference in New Issue
Block a user