# tables
# localized events spawn from a single event, otherwise they spawn across the station. pests should be widespread while dangerous ones should be localized

- type: entityTable
  id: CalmCritterEventsTable
  table: !type:AllSelector
    children:
    - id: SnailMigration
    - id: SnailMigrationLowPop
    - id: CockroachMigration
    - id: MouseMigration
    - id: MothroachMigration
    - id: FliesMigration
    - id: BeetleMigration
    - !type:GroupSelector
      children:
      - id: MouseMigrationLocalized
      - id: CockroachMigrationLocalized
      - id: SnailMigrationLocalized
      - id: BatMigrationLocalized
      - id: RaccoonMigrationLocalized
      - id: SnakeMigrationLocalized
      - id: DionaNymphMigrationLocalized
      - id: DragonflyMigrationLocalized
      - id: LizardMigrationLocalized
      - id: SandwaspMigrationLocalized

- type: entityTable
  id: HostileCritterEventsTable
  table: !type:AllSelector
    children:
    - id: SlimesSpawnHorde
    - id: SnakeSpawnHorde
    - id: SpiderSpawnHorde
    #- id: SpiderClownSpawnHorde # Ugh it's so silly
    - id: XenoSpawnHorde
    - id: MosquitoSpawnHorde
    - id: WaspSpawnHorde
    - id: LeechSpawnHorde
    - id: CarpSpawnHorde
    - id: AberrantFleshSpawnHorde
    - id: TomatoKillerSpawnHorde
    - id: HivelordSpawnHorde
    - id: SpaceTickSpawnHorde
    # low pop variants
    - id: SlimesSpawnHordeLowPop
    - id: SnakeSpawnHordeLowPop
    - id: SpiderSpawnHordeLowPop
    - id: XenoSpawnHordeLowPop
    - id: MosquitoSpawnHordeLowPop
    - id: WaspSpawnHordeLowPop
    - id: LeechSpawnHordeLowPop
    - id: CarpSpawnHordeLowPop
    - id: AberrantFleshSpawnHordeLowPop
    - id: TomatoKillerSpawnHordeLowPop
    - id: SpaceTickSpawnHordeLowPop

# pests (widespread)

- type: entity
  id: FliesMigration
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    earliestStart: 15
    minimumPlayers: 5 # starcup: 15 -> 5
    weight: 6
    duration: 50
  - type: VentCrittersRule
    entries:
    - id: MobFlySwarm
      prob: 0.02

- type: entity
  id: BeetleMigration
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    earliestStart: 15
    minimumPlayers: 5 # starcup: 15 -> 5
    weight: 6
    duration: 50
  - type: VentCrittersRule
    entries:
    - id: MobBeetleStag
    - id: MobBeetleRhino
    - id: MobBeetleJune
    - id: MobLadybug

- type: entity
  id: MothroachMigration # starcup: renamed from MothroachSpawn
  parent: BaseGameRule
  components:
  - type: StationEvent
    earliestStart: 15
    minimumPlayers: 5 # starcup: 15 -> 5
    weight: 4
    duration: 50
  - type: VentCrittersRule
    entries:
    - id: MobMothroach
      prob: 0.02
    - id: MobMoproach
      prob: 0.002 # starcup: 0.0005

# pests (localized)

- type: entity
  id: MouseMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobMouse
        - id: MobMouse1
        - id: MobMouse2
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_harmless_critter.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5
    breakChance: 0.5
    replacement: GasVentPumpDen

- type: entity
  id: CockroachMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    weight: 6
    duration: 5
    maxDuration: 17
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobCockroach
          weight: 0.9
        - id: MobCockroachHL
          weight: 0.9
        - id: MobMothroach
          weight: 0.1
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_bugs.ogg

- type: entity
  id: SnailMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    weight: 6
    duration: 5
    maxDuration: 16
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 2, 3
        children:
        - id: MobSnail
          weight: 0.9
        - id: MobSnailSpeed
          weight: 0.05
        - id: MobSnailMoth
          weight: 0.05
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_bugs.ogg

- type: entity
  id: BatMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobBat
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_harmless_critter.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5
    breakChance: 0.5
    replacement: GasVentPumpDen

- type: entity
  id: RaccoonMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobRaccoon
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_harmless_critter.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: SnakeMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobSnake
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_harmless_critter.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: DionaNymphMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 5
    maxDuration: 16
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 6
        children:
        - id: MobDionaNymphAccent
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_bugs.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: DragonflyMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 5
    maxDuration: 16
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 6
        children:
        - id: MobDragonfly
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_bugs.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: LizardMigrationLocalized
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 15
    weight: 6
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 2, 3
        children:
        - id: MobSlug
        - id: MobLizard
          weight: 0.1
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_harmless_critter.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: SandwaspMigrationLocalized
  parent: WaspSpawnHorde
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-announcement-deltav
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 1, 3
        children:
        - id: MobGiantSandwasp
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_mosquitoes.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5
    breakChance: 1.0
    replacement: GasVentPumpHiveSandwasp

# hostiles (localized)

- type: entity
  id: XenoSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 45
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobXeno
        - id: MobXenoDrone
        - id: MobXenoRunner
        - id: MobXenoSpitter
        - id: MobXenoRouny
          weight: 0.05
        - id: MobXenoRavager
          weight: 0.1
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_xeno.ogg
    endSound:
      collection: MetalBreak
    breakChance: 1.0
    replacement: GasVentPumpInfested

- type: entity
  id: MosquitoSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 6, 10
        children:
        - id: MobGiantMosquito
        - id: MobMosquitoSwarm
          weight: 0.3
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_mosquitoes.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5
    breakChance: 0.5
    replacement: GasVentPumpBroken

- type: entity
  id: WaspSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 5, 9
        children:
        - id: MobGiantWasp
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_mosquitoes.ogg
    endSound:
      collection: MetalBreak
      params:
        volume: -5
    breakChance: 1.0
    replacement: GasVentPumpHiveWasp

- type: entity
  id: LeechSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 5, 9
        children:
        - id: MobCharonicLeech
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_leeches.ogg
    endSound:
      collection: MetalBreak
    breakChance: 1.0
    replacement: GasVentPumpBroken

- type: entity
  id: CarpSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobCarp
        - id: MobCarpSplitfin
        - id: MobCarpVampire
        - id: MobCarpQueen
        - !type:GroupSelector
          weight: 0.5
          rolls: 1
          children:
          - id: MobShark
          - id: MobSharkBlue
          - id: MobSharkBrown
          - id: MobSharkGreen
          - id: MobSharkFat
          - id: MobSharkShelled
          - id: MobSharkShelledBlue
          - id: MobSharkShelledBrown
          - id: MobSharkShelledGreen
          - id: MobSharkVampire
        - id: MobPike
          weight: 0.1
    passiveSound:
      path: /Audio/_DEN/VentCritters/vent_carp.ogg
    endSound:
      collection: MetalBreak
    breakChance: 1.0
    replacement: GasVentPumpBroken

- type: entity
  id: AberrantFleshSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobFleshJared
        - id: MobFleshGolem
        - id: MobFleshClamp
        - id: MobFleshLover
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_flesh.ogg
    endSound:
      collection: MetalBreak
    breakChance: 1.0
    replacement: GasVentPumpPulsating

- type: entity
  id: TomatoKillerSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 4, 8
        children:
        - id: MobTomatoKiller

- type: entity
  id: HivelordSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 1
        children:
        - id: MobHivelord
        - id: MobHivelordColony
    endSound:
      collection: MetalScrape
      params:
        volume: -5

- type: entity
  id: SpaceTickSpawnHorde
  parent: BaseStationEventShortDelay
  components:
  - type: StationEvent
    startAnnouncement: station-event-vent-creatures-start-horde-announcement
    startAudio:
      path: /Audio/Announcements/attention.ogg
    earliestStart: 20
    minimumPlayers: 15
    weight: 5
    duration: 15
    maxDuration: 30
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 5
        children:
        - id: MobTick
    passiveSound:
      path: /Audio/_starcup/VentCritters/vent_bugs.ogg
    endSound:
      collection: MetalScrape
      params:
        volume: -5

# hostile (localized, low pop variants)

- type: entity
  id: SlimesSpawnHordeLowPop
  parent: SlimesSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - id: PuddleSlime
      - !type:GroupSelector
        rolls: 1, 2
        children:
        - id: MobAdultSlimesBlueAngry
        - id: MobAdultSlimesGreenAngry
        - id: MobAdultSlimesYellowAngry

- type: entity
  id: SnakeSpawnHordeLowPop
  parent: SnakeSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 1, 2
        children:
        - id: MobPurpleSnake
        - id: MobSmallPurpleSnake
        - id: MobCobraSpace

- type: entity
  id: SpiderSpawnHordeLowPop
  parent: SpiderSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - id: SpiderWeb
      - !type:GroupSelector
        rolls: 1, 2
        children:
        - id: MobGiantSpiderAngry

- type: entity
  id: XenoSpawnHordeLowPop
  parent: XenoSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 1, 2
        children:
        - id: MobXeno
        - id: MobXenoDrone
        - id: MobXenoRunner
        - id: MobXenoSpitter
        - id: MobXenoRouny
          weight: 0.05
        - id: MobXenoRavager
          weight: 0.1

- type: entity
  id: MosquitoSpawnHordeLowPop
  parent: MosquitoSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 5
        children:
        - id: MobGiantMosquito
        - id: MobMosquitoSwarm
          weight: 0.3

- type: entity
  id: WaspSpawnHordeLowPop
  parent: WaspSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 5
        children:
        - id: MobGiantWasp

- type: entity
  id: LeechSpawnHordeLowPop
  parent: LeechSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 3, 5
        children:
        - id: MobCharonicLeech

- type: entity
  id: CarpSpawnHordeLowPop
  parent: CarpSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 2, 3
        children:
        - id: MobCarp
        - id: MobCarpSplitfin
        - id: MobCarpVampire
        - id: MobCarpQueen
        - !type:GroupSelector
          weight: 0.5
          rolls: 1
          children:
          - id: MobShark
          - id: MobSharkBlue
          - id: MobSharkBrown
          - id: MobSharkGreen
          - id: MobSharkFat
          - id: MobSharkShelled
          - id: MobSharkShelledBlue
          - id: MobSharkShelledBrown
          - id: MobSharkShelledGreen
          - id: MobSharkVampire
        - id: MobPike
          weight: 0.1

- type: entity
  id: AberrantFleshSpawnHordeLowPop
  parent: AberrantFleshSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 2, 3
        children:
        - id: MobFleshJared
        - id: MobFleshGolem
        - id: MobFleshClamp
        - id: MobFleshLover

- type: entity
  id: TomatoKillerSpawnHordeLowPop
  parent: LeechSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 2, 3
        children:
        - id: MobTomatoKiller

- type: entity
  id: SpaceTickSpawnHordeLowPop
  parent: SpaceTickSpawnHorde
  components:
  - type: StationEvent
    minimumPlayers: 7
  - type: VentHordeRule
    table: !type:AllSelector
      children:
      - !type:GroupSelector
        rolls: 1, 2
        children:
        - id: MobTick
