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

@@ -1,2 +0,0 @@
station-events-window-not-loaded-text = Not loaded
station-events-window-random-text = Random

View File

@@ -1,2 +1,2 @@
station-event-meteor-swarm-start-announcement = Meteors are on a collision course with the station. Brace for impact.
station-event-meteor-swarm-ebd-announcement = The meteor swarm has passed. Please return to your stations.
station-event-meteor-swarm-end-announcement = The meteor swarm has passed. Please return to your stations.

View File

@@ -1,19 +0,0 @@
### Localization for events console commands
## 'events' command
cmd-events-desc = Provides admin control to station events
cmd-events-help = events <running/list/pause/resume/stop/run <eventName/random>>
running: return the current running event
list: return all event names that can be run
pause: stop all random events from running and any one currently running
resume: allow random events to run again
run <eventName/random>: start a particular event now; <eventName> is case-insensitive and not localized
cmd-events-arg-subcommand = <subcommand>
cmd-events-arg-run-eventName = <eventName>
cmd-events-none-running = No station event running
cmd-events-list-random = Random
cmd-events-paused = Station events paused
cmd-events-already-paused = Station events are already paused
cmd-events-resumed = Station events resumed
cmd-events-already-running = Station events are already running

View File

@@ -1,7 +1,4 @@
## StationEventSystem
## BasicStationEventSchedulerSystem
station-event-system-run-event = Running event {$eventName}
station-event-system-run-event-no-event-name = No event named: {$eventName}
station-event-system-run-event = Running event {$eventName}
station-event-system-run-random-event-no-valid-events = No valid events available
station-event-system-stop-event-no-running-event = No event running currently
station-event-system-stop-event = Stopped event {$eventName}

View File

@@ -0,0 +1,149 @@
- type: gameRule
id: BreakerFlip
config:
!type:StationEventRuleConfiguration
id: BreakerFlip
weight: 10
endAfter: 1
maxOccurrences: 5
minimumPlayers: 15
- type: gameRule
id: BureaucraticError
config:
!type:StationEventRuleConfiguration
id: BureaucraticError
startAnnouncement: station-event-bureaucratic-error-announcement
minimumPlayers: 25
weight: 5
maxOccurrences: 2
endAfter: 1
- type: gameRule
id: DiseaseOutbreak
config:
!type:StationEventRuleConfiguration
id: DiseaseOutbreak
weight: 10
endAfter: 1
- type: gameRule
id: FalseAlarm
config:
!type:StationEventRuleConfiguration
id: FalseAlarm
weight: 15
endAfter: 1
maxOccurrences: 5
- type: gameRule
id: GasLeak
config:
!type:StationEventRuleConfiguration
id: GasLeak
startAnnouncement: station-event-gas-leak-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
endAnnouncement: station-event-gas-leak-end-announcement
earliestStart: 10
minimumPlayers: 5
weight: 5
maxOccurrences: 1
startAfter: 20
- type: gameRule
id: KudzuGrowth
config:
!type:StationEventRuleConfiguration
id: KudzuGrowth
earliestStart: 15
minimumPlayers: 15
weight: 5
maxOccurrences: 2
startAfter: 50
endAfter: 240
- type: gameRule
id: MeteorSwarm
config:
!type:StationEventRuleConfiguration
id: MeteorSwarm
earliestStart: 30
weight: 5
maxOccurrences: 2
minimumPlayers: 20
startAnnouncement: station-event-meteor-swarm-start-announcement
endAnnouncement: station-event-meteor-swarm-end-announcement
startAudio:
path: /Audio/Announcements/meteors.ogg
startAfter: 30
- type: gameRule
id: MouseMigration
config:
!type:StationEventRuleConfiguration
id: MouseMigration
earliestStart: 30
minimumPlayers: 35
weightLow: 5
maxOccurrences: 1
endAfter: 50
- type: gameRule
id: PowerGridCheck
config:
!type:StationEventRuleConfiguration
id: PowerGridCheck
weight: 10
maxOccurrences: 3
startAnnouncement: station-event-power-grid-check-start-announcement
endAnnouncement: station-event-power-grid-check-end-announcement
startAudio:
path: /Audio/Announcements/power_off.ogg
startAfter: 12
- type: gameRule
id: RandomSentience
config:
!type:StationEventRuleConfiguration
id: RandomSentience
weight: 10
endAfter: 1
startAudio:
path: /Audio/Announcements/attention.ogg
- type: gameRule
id: VentClog
config:
!type:StationEventRuleConfiguration
id: VentClog
startAnnouncement: station-event-vent-clog-start-announcement
startAudio:
path: /Audio/Announcements/attention.ogg
earliestStart: 15
minimumPlayers: 15
weight: 5
maxOccurrences: 2
startAfter: 50
endAfter: 60
- type: gameRule
id: VentCritters
config:
!type:StationEventRuleConfiguration
id: VentCritters
earliestStart: 15
minimumPlayers: 15
weight: 5
maxOccurrences: 2
endAfter: 60
- type: gameRule
id: ZombieOutbreak
config:
!type:StationEventRuleConfiguration
id: ZombieOutbreak
earliestStart: 50
weight: 2.5
endAfter: 1
maxOccurrences: 1

View File

@@ -65,3 +65,10 @@
config:
!type:GenericGameRuleConfiguration
id: Zombie
# event schedulers
- type: gameRule
id: BasicStationEventScheduler
config:
!type:GenericGameRuleConfiguration
id: BasicStationEventScheduler

View File

@@ -6,6 +6,8 @@
name: extended-title
showInVote: false #2boring2vote
description: extended-description
rules:
- BasicStationEventScheduler
- type: gamePreset
id: Secret
@@ -38,6 +40,7 @@
showInVote: false
rules:
- Traitor
- BasicStationEventScheduler
- type: gamePreset
id: Suspicion
@@ -79,6 +82,7 @@
showInVote: false
rules:
- Nukeops
- BasicStationEventScheduler
- type: gamePreset
id: Zombie
@@ -93,6 +97,7 @@
showInVote: false
rules:
- Zombie
- BasicStationEventScheduler
- type: gamePreset
id: Pirates
@@ -103,3 +108,4 @@
showInVote: false
rules:
- Pirates
- BasicStationEventScheduler