# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 fishbait <gnesse@gmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ilya246 <ilyukarno@gmail.com>
# SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Shuttle Game Rule Tables -- If you dont add your rules to these they wont be used by the games schedulers.

- type: entityTable
  id: UnknownShuttlesFriendlyTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: UnknownShuttleCargoLost
    - id: UnknownShuttleTravelingCuisine
    - id: UnknownShuttleDisasterEvacPod
    - id: UnknownShuttleHonki
    - id: UnknownShuttleNTQuark
    - id: UnknownShuttleCruiser
    - id: UnknownShuttleCryptid
    - id: UnknownShuttleEternal
    - id: UnknownShuttleFlatline
    - id: UnknownShuttleGym
    - id: UnknownShuttleNTIncorporation
    - id: UnknownShuttleJoe
    - id: UnknownShuttleLambordeere
    - id: UnknownShuttleMeatZone
    - id: UnknownShuttleMicroshuttle
    - id: UnknownShuttleSpacebus

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

- type: entityTable
  id: UnknownShuttlesHostileTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: LoneOpsSpawn
    #- id: UnknownShuttleManOWar # Goob - Nuke the man-o-war
    - id: UnknownShuttleInstigator

# Shuttle Game Rules

- type: entity
  abstract: true
  parent: BaseGameRule
  id: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming
    startAudio:
      path: /Audio/Announcements/attention.ogg
    weight: 4 #Common, but not every round
    reoccurrenceDelay: 30
    earliestStart: 20 # Goobstation
    duration: 1
    maxOccurrences: 1
    chaos: # Goobstation
      Friend: -20
      Power: -10 # can be salvaged for power
    eventType: FriendlySpawn # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: -140
  - type: RuleGrids
  - type: LoadMapRule

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleCargoLost
  components:
  - type: StationEvent
    maxOccurrences: 2
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/lost_cargo.yml

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleTravelingCuisine
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming
    maxOccurrences: 2
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/traveling_china_cuisine.yml

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleDisasterEvacPod
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming
    maxOccurrences: 3
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/disaster_evacpod.yml

# The power of 3 clowns proved too strong for the players and may need to be 1984'ed. Replace this with a more engaging clown shuttle.
- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleHonki
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 2
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/honki.yml

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleSyndieEvacPod
  components:
  - type: StationEvent
    startAnnouncement: null # It should be silent.
    weight: 5 # lower because weird freelance roles
    maxOccurrences: 2
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/syndie_evacpod.yml

- type: entity
  id: UnknownShuttleNTQuark
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: null # It should be silent.
    weight: .5 # Hopefully this is uncommon enough, it needs to be uncommon enough that people wont waste time metaknowledging it.
    earliestStart: 45 # late to hopefully have enough ghosts to fill all roles quickly.
    minimumPlayers: 25
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/quark.yml

- type: entity
  id: UnknownShuttleCruiser
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 2 # Its just a big ship, so it needs to be rarer to be interesting.
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/cruiser.yml

- type: entity
  id: UnknownShuttleCryptid
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/cryptid.yml

- type: entity
  id: UnknownShuttleEternal
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/eternal.yml

- type: entity
  id: UnknownShuttleFlatline
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/flatline.yml

- type: entity
  id: UnknownShuttleGym
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 5 # Its just a big ship, so it needs to be rarer to be interesting.
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/gym.yml

- type: entity
  id: UnknownShuttleNTIncorporation
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 2 # Its just a big ship, so it needs to be rarer to be interesting.
    earliestStart: 45 # late to hopefully have enough ghosts to fill all roles quickly. (5-6)
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/incorporation.yml

- type: entity
  id: UnknownShuttleInstigator
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: null #dont nark on antags
    weight: 1 #  lower because antags.
    earliestStart: 50 # late to hopefully have enough ghosts to fill all roles quickly (3) and because antags
    chaos: # Goobstation
      # holy mini-nukies
      Hostile: 80
      Death: 100
      Medical: 100
    eventType: HostilesSpawn # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: 900
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/instigator.yml

- type: entity
  id: UnknownShuttleJoe
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/joe.yml

- type: entity
  id: UnknownShuttleLambordeere
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/lambordeere.yml

- type: entity
  id: UnknownShuttleManOWar
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #Leaving this one because theyre like primitives and its funnier
    weight: 1 # lower because antags
    earliestStart: 50 # late to hopefully have enough ghosts to fill all roles quickly. (4) & antags
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/manowar.yml

- type: entity
  id: UnknownShuttleMeatZone
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/meatzone.yml

- type: entity
  id: UnknownShuttleMicroshuttle
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 11 # this is higher because its just a little generic personal shuttle
    maxOccurrences: 4
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/microshuttle.yml

- type: entity
  id: UnknownShuttleSpacebus
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    gridPath: /Maps/Shuttles/ShuttleEvent/spacebus.yml

