# Event Tables

- type: entityTable
  id: MeteorSwarmDustEventsTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: SpaceDustMinor
    - id: SpaceDustMajor

- type: entityTable
  id: MeteorSwarmSmallChanceEventsTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: MeteorSwarmSmall
      prob: 0.15

- type: entityTable
  id: MeteorSwarmMildTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - !type:NestedSelector
        tableId: MeteorSwarmDustEventsTable
    - !type:NestedSelector
        tableId: MeteorSwarmSmallChanceEventsTable

- type: entityTable
  id: BasicMeteorSwarmEventsTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - !type:NestedSelector
        tableId: MeteorSwarmDustEventsTable
    - id: MeteorSwarmSmall
    - id: MeteorSwarmMedium
    - id: MeteorSwarmLarge
    - id: UristSwarm
    - id: ClownSwarm
    - id: CowSwarm
    - id: PotatoSwarm
    - id: FunSwarm
    - id: ImmovableRodSpawn

- type: weightedRandomEntity
  id: MeteorSpawnAsteroidWallTable
  weights:
    AsteroidRock: 10
    AsteroidRockCoal: 5
    AsteroidRockQuartz: 5
    AsteroidRockTin: 5
    AsteroidRockSilver: 2
    AsteroidRockGold: 2
    AsteroidRockPlasma: 2
    AsteroidRockDiamond: 2
    AsteroidRockUranium: 0.5

# Event Schedulers

- type: entity
  parent: BaseGameRule
  id: MeteorSwarmScheduler
  components:
  - type: GameRule
  - type: BasicStationEventScheduler
    minimumTimeUntilFirstEvent: 600 # 10 min
    minMaxEventTiming:
      min: 750 # 12.5 min
      max: 930 # 17.5 min
    scheduledGameRules: !type:NestedSelector
      tableId: BasicMeteorSwarmEventsTable

- type: entity
  parent: BaseGameRule
  id: MeteorSwarmMildScheduler
  components:
  - type: GameRule
  - type: BasicStationEventScheduler
    minimumTimeUntilFirstEvent: 600 # 10 min
    minMaxEventTiming:
      min: 750 # 12.5 min
      max: 930 # 17.5 min
    scheduledGameRules: !type:NestedSelector
      tableId: MeteorSwarmMildTable

- type: entity
  parent: BaseGameRule
  id: KesslerSyndromeScheduler
  components:
  - type: GameRule
  - type: RampingStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: BasicMeteorSwarmEventsTable

# Game Rules

- type: entity
  parent: BaseGameRule
  id: MeteorSwarm
  abstract: true
  components:
  - type: GameRule
  - type: StationEvent
    reoccurrenceDelay: 1
    earliestStart: 12
    minimumPlayers: 25
  - type: MeteorSwarm

- type: entity
  parent: MeteorSwarm
  id: SpaceDustMinor
  components:
  - type: StationEvent
    weight: 44
    earliestStart: 2
    minimumPlayers: 0
  - type: MeteorSwarm
    announcement: null
    announcementSound: null
    nonDirectional: true
    meteors:
      MeteorSpaceDust: 1
    waves:
      min: 2
      max: 3
    meteorsPerWave:
      min: 3
      max: 5

- type: entity
  parent: MeteorSwarm
  id: SpaceDustMajor
  components:
  - type: StationEvent
    weight: 22
    minimumPlayers: 0
  - type: MeteorSwarm
    announcement: station-event-space-dust-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    nonDirectional: true
    meteors:
      MeteorSpaceDust: 1
    waves:
      min: 2
      max: 3
    meteorsPerWave:
      min: 8
      max: 12

- type: entity
  parent: MeteorSwarm
  id: MeteorSwarmSmall
  components:
  - type: StationEvent
    weight: 18
    minimumPlayers: 15
  - type: MeteorSwarm
    meteors:
      MeteorSmall: 7
      MeteorMedium: 3

- type: entity
  parent: MeteorSwarm
  id: MeteorSwarmMedium
  components:
  - type: StationEvent
    weight: 10
  - type: MeteorSwarm
    meteors:
      MeteorSmall: 3
      MeteorMedium: 6
      MeteorLarge: 1

- type: entity
  parent: MeteorSwarm
  id: MeteorSwarmLarge
  components:
  - type: StationEvent
    weight: 5
  - type: MeteorSwarm
    meteors:
      MeteorSmall: 2
      MeteorMedium: 4
      MeteorLarge: 4

- type: entity
  parent: MeteorSwarm
  id: UristSwarm
  components:
  - type: StationEvent
    weight: 0.05
  - type: MeteorSwarm
    announcement: station-event-meteor-urist-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    meteors:
      MeteorUrist: 1
    waves:
      min: 3
      max: 3
    meteorsPerWave:
      min: 10
      max: 10

- type: entity
  id: ImmovableRodSpawn
  parent: BaseGameRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-immovable-rod-start-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    weight: 3.5
    reoccurrenceDelay: 1
    duration: 1
    earliestStart: 30
    minimumPlayers: 25
  - type: ImmovableRodRule
    rodPrototypes:
    - id: ImmovableRodKeepTilesStill
      prob: 0.94
      orGroup: rodProto
    - id: ImmovableRodMop
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodShark
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodClown
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodBanana
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodHammer
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodThrongler
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodGibstick
      prob: 0.0075
      orGroup: rodProto
    - id: ImmovableRodWeh
      prob: 0.0075
      orGroup: rodProto

- type: entity
  parent: MeteorSwarm
  id: CowSwarm
  components:
  - type: StationEvent
    weight: 0.05
  - type: MeteorSwarm
    announcement: station-event-meteor-cow-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    meteors:
      MeteorCow: 1
    waves:
      min: 3
      max: 3
    meteorsPerWave:
      min: 10
      max: 10

- type: entity
  parent: MeteorSwarm
  id: ClownSwarm
  components:
  - type: StationEvent
    weight: 0.05
  - type: MeteorSwarm
    announcement: station-event-meteor-clown-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    meteors:
      MeteorClown: 1
    waves:
      min: 3
      max: 3
    meteorsPerWave:
      min: 10
      max: 10

- type: entity
  parent: MeteorSwarm
  id: PotatoSwarm
  components:
  - type: StationEvent
    weight: 0.05
  - type: MeteorSwarm
    announcement: station-event-meteor-potato-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    meteors:
      MeteorPotato: 1
    waves:
      min: 3
      max: 3
    meteorsPerWave:
      min: 10
      max: 10

- type: entity
  parent: MeteorSwarm
  id: FunSwarm
  components:
  - type: StationEvent
    weight: 0.03
  - type: MeteorSwarm
    announcement: station-event-fun-swarm-start-announcement
    announcementSound: /Audio/Announcements/attention.ogg
    meteors:
      MeteorClown: 1
      MeteorCow: 1
      MeteorPotato: 1
      MeteorUrist: 1
    waves:
      min: 3
      max: 3
    meteorsPerWave:
      min: 8
      max: 12
