From b9a0894d7c9f41084baece2269d92034cec913f2 Mon Sep 17 00:00:00 2001 From: Kara Date: Sun, 10 Jul 2022 18:48:41 -0700 Subject: [PATCH] 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 --- .../UI/Tabs/AdminbusTab/AdminbusTab.xaml | 1 - .../Tabs/AdminbusTab/StationEventsWindow.xaml | 13 - .../AdminbusTab/StationEventsWindow.xaml.cs | 86 ---- Content.Client/Entry/EntryPoint.cs | 4 +- Content.Client/IoC/ClientContentIoC.cs | 2 - .../RadiationPulseComponent.cs | 4 +- .../RadiationPulseOverlay.cs | 7 +- .../Managers/IStationEventManager.cs | 13 - .../Managers/StationEventManager.cs | 41 -- .../Tests/GameRules/StartEndGameRulesTest.cs | 54 +++ .../StationEvents/StationEventsSystemTest.cs | 49 --- .../EntitySystems/AtmosphereSystem.API.cs | 3 + .../GameTicking/GameTicker.GameRule.cs | 67 +++- .../GameTicking/GameTicker.RoundFlow.cs | 3 +- .../StationEventRuleConfiguration.cs | 76 ++++ .../GameTicking/Rules/DeathMatchRuleSystem.cs | 8 +- .../GameTicking/Rules/GameRuleSystem.cs | 47 ++- .../Rules/InactivityTimeRestartRuleSystem.cs | 8 +- .../Rules/MaxTimeRestartRuleSystem.cs | 9 +- .../GameTicking/Rules/NukeopsRuleSystem.cs | 15 +- .../GameTicking/Rules/PiratesRuleSystem.cs | 10 +- .../GameTicking/Rules/SandboxRuleSystem.cs | 4 +- .../GameTicking/Rules/SecretRuleSystem.cs | 4 +- .../GameTicking/Rules/SuspicionRuleSystem.cs | 12 +- .../Rules/TraitorDeathMatchRuleSystem.cs | 10 +- .../GameTicking/Rules/TraitorRuleSystem.cs | 10 +- .../GameTicking/Rules/ZombieRuleSystem.cs | 14 +- .../EntitySystems/ConditionalSpawnerSystem.cs | 2 +- .../BasicStationEventSchedulerSystem.cs | 247 ++++++++++++ .../StationEvents/Events/BreakerFlip.cs | 34 +- .../StationEvents/Events/BureaucraticError.cs | 47 +-- .../StationEvents/Events/DiseaseOutbreak.cs | 47 +-- .../StationEvents/Events/FalseAlarm.cs | 32 +- .../StationEvents/Events/GasLeak.cs | 92 ++--- .../StationEvents/Events/KudzuGrowth.cs | 39 +- .../StationEvents/Events/MeteorSwarm.cs | 62 ++- .../StationEvents/Events/MouseMigration.cs | 42 +- .../StationEvents/Events/PowerGridCheck.cs | 56 ++- .../StationEvents/Events/RandomSentience.cs | 33 +- .../StationEvents/Events/StationEvent.cs | 259 ------------ .../Events/StationEventSystem.cs | 184 +++++++++ .../StationEvents/Events/VentClog.cs | 45 +-- .../StationEvents/Events/VentCritters.cs | 43 +- .../StationEvents/Events/ZombieOutbreak.cs | 53 +-- .../StationEvents/StationEventCommand.cs | 171 -------- .../StationEvents/StationEventSystem.cs | 371 ------------------ .../StationEvents/MsgRequestStationEvents.cs | 18 - .../StationEvents/MsgStationEvents.cs | 34 -- .../adminbus-tab/station-events-window.ftl | 2 - .../station-events/events/meteor-swarm.ftl | 2 +- .../station-events/station-event-command.ftl | 19 - .../station-events/station-event-system.ftl | 7 +- Resources/Prototypes/GameRules/events.yml | 149 +++++++ .../roundstart.yml} | 7 + Resources/Prototypes/game_presets.yml | 6 + 55 files changed, 1095 insertions(+), 1582 deletions(-) delete mode 100644 Content.Client/Administration/UI/Tabs/AdminbusTab/StationEventsWindow.xaml delete mode 100644 Content.Client/Administration/UI/Tabs/AdminbusTab/StationEventsWindow.xaml.cs rename Content.Client/{StationEvents => Radiation}/RadiationPulseComponent.cs (92%) rename Content.Client/{StationEvents => Radiation}/RadiationPulseOverlay.cs (97%) delete mode 100644 Content.Client/StationEvents/Managers/IStationEventManager.cs delete mode 100644 Content.Client/StationEvents/Managers/StationEventManager.cs create mode 100644 Content.IntegrationTests/Tests/GameRules/StartEndGameRulesTest.cs delete mode 100644 Content.IntegrationTests/Tests/StationEvents/StationEventsSystemTest.cs create mode 100644 Content.Server/GameTicking/Rules/Configurations/StationEventRuleConfiguration.cs create mode 100644 Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs delete mode 100644 Content.Server/StationEvents/Events/StationEvent.cs create mode 100644 Content.Server/StationEvents/Events/StationEventSystem.cs delete mode 100644 Content.Server/StationEvents/StationEventCommand.cs delete mode 100644 Content.Server/StationEvents/StationEventSystem.cs delete mode 100644 Content.Shared/StationEvents/MsgRequestStationEvents.cs delete mode 100644 Content.Shared/StationEvents/MsgStationEvents.cs delete mode 100644 Resources/Locale/en-US/administration/ui/tabs/adminbus-tab/station-events-window.ftl delete mode 100644 Resources/Locale/en-US/station-events/station-event-command.ftl create mode 100644 Resources/Prototypes/GameRules/events.yml rename Resources/Prototypes/{game_rules.yml => GameRules/roundstart.yml} (88%) diff --git a/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml b/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml index 9e6ef34cad..8dda6b4e3c 100644 --- a/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml +++ b/Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xaml @@ -12,6 +12,5 @@