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:
Kara
2022-07-10 18:48:41 -07:00
committed by GitHub
parent f28cdaaa7c
commit b9a0894d7c
55 changed files with 1095 additions and 1582 deletions

View File

@@ -65,7 +65,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
private void OnRoundEndText(RoundEndTextAppendEvent ev)
{
if (!Enabled)
if (!RuleAdded)
return;
//this is just the general condition thing used for determining the win/lose text
@@ -113,7 +113,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
private void OnJobAssigned(RulePlayerJobsAssignedEvent ev)
{
if (!Enabled)
if (!RuleAdded)
return;
_initialInfectedNames = new();
@@ -127,14 +127,14 @@ public sealed class ZombieRuleSystem : GameRuleSystem
/// </remarks>
private void OnMobStateChanged(MobStateChangedEvent ev)
{
if (!Enabled)
if (!RuleAdded)
return;
CheckRoundEnd(ev.Entity);
}
private void OnEntityZombified(EntityZombifiedEvent ev)
{
if (!Enabled)
if (!RuleAdded)
return;
CheckRoundEnd(ev.Target);
}
@@ -158,7 +158,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
private void OnStartAttempt(RoundStartAttemptEvent ev)
{
if (!Enabled)
if (!RuleAdded)
return;
var minPlayers = _cfg.GetCVar(CCVars.ZombieMinPlayers);
@@ -177,13 +177,13 @@ public sealed class ZombieRuleSystem : GameRuleSystem
}
}
public override void Started(GameRuleConfiguration configuration)
public override void Started()
{
//this technically will run twice with zombies on roundstart, but it doesn't matter because it fails instantly
InfectInitialPlayers();
}
public override void Ended(GameRuleConfiguration configuration) { }
public override void Ended() { }
private void OnZombifySelf(EntityUid uid, ZombifyOnDeathComponent component, ZombifySelfActionEvent args)
{