# 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: UnknownShuttleFrontierProspector  #Goobstation - Salvage shuttle event
    - id: UnknownShuttleNTQuark
    - id: UnknownShuttleCruiser
    - id: UnknownShuttleCryptid
    - id: UnknownShuttleEternal
    - id: UnknownShuttleFlatline
    - id: UnknownShuttleGym
    - id: UnknownShuttleNTIncorporation
    - id: UnknownShuttleJoe
    - id: UnknownShuttleLambordeere
    - id: UnknownShuttleMeatZone
    - id: UnknownShuttleMicroshuttle
    - id: UnknownShuttleSpacebus
    - id: UnknownShuttleAlienTourist # Goobstation

- 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 # should be the same as [copies] in shuttle_incoming_event.yml
    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 # should be the same as [copies] in shuttle_incoming_event.yml
  - type: LoadMapRule
    preloadedGrid: ShuttleCargoLost

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleTravelingCuisine
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming
    maxOccurrences: 2 # should be the same as [copies] in shuttle_incoming_event.yml
  - type: LoadMapRule
    preloadedGrid: TravelingCuisine

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleDisasterEvacPod
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming
    maxOccurrences: 3 # should be the same as [copies] in shuttle_incoming_event.yml
  - type: LoadMapRule
    preloadedGrid: DisasterEvacPod

# 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
    chaos: # Goobstation
      Friend: -10
      Mess: 20
    eventType: Chaotic # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: -80
  - type: LoadMapRule
    preloadedGrid: Honki

- type: entity
  parent: BaseUnknownShuttleRule
  id: UnknownShuttleSyndieEvacPod
  components:
  - type: StationEvent
    startAnnouncement: null # It should be silent.
    weight: 4 # lower because weird freelance roles
    maxOccurrences: 2 # should be the same as [copies] in shuttle_incoming_event.yml
  - type: LoadMapRule
    preloadedGrid: SyndieEvacPod

- 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
    preloadedGrid: NTQuark

- 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.
    chaos: # Goobstation
      Friend: -60
    eventType: FriendlySpawn # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: -150
  - type: LoadMapRule
    preloadedGrid: Cruiser

- type: entity
  id: UnknownShuttleCryptid
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Cryptid

- type: entity
  id: UnknownShuttleEternal
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Eternal

- type: entity
  id: UnknownShuttleFlatline
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    chaos: # Goobstation
      Friend: -20
      Medical: -20
    eventType: FriendlySpawn # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: -140
  - type: LoadMapRule
    preloadedGrid: Flatline

- type: entity
  id: UnknownShuttleGym
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 3 # Its just a big ship, so it needs to be rarer to be interesting.
  - type: LoadMapRule
    preloadedGrid: Gym

- 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)
    chaos: # Goobstation
      Friend: -50
    eventType: FriendlySpawn # Goobstation
  # Goobstation
  - type: GameRule
    chaosScore: -150
  - type: LoadMapRule
    preloadedGrid: NTIncorporation

- 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
    preloadedGrid: Instigator

- type: entity
  id: UnknownShuttleJoe
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Joe

- type: entity
  id: UnknownShuttleLambordeere
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Lambordeere

# Goob - Nuke the man-o-war
#- 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
#    chaos: # Goobstation
#      # it's 4 free agent barely-equipped dudes
#      Hostile: 60
#      Medical: 20
#      Death: 20
#  - type: LoadMapRule
#    preloadedGrid: ManOWar

- type: entity
  id: UnknownShuttleMeatZone
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Meatzone

- type: entity
  id: UnknownShuttleMicroshuttle
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
    weight: 4
    maxOccurrences: 4
  - type: LoadMapRule
    preloadedGrid: Microshuttle

- type: entity
  id: UnknownShuttleSpacebus
  parent: BaseUnknownShuttleRule
  components:
  - type: StationEvent
    startAnnouncement: station-event-unknown-shuttle-incoming #!!
  - type: LoadMapRule
    preloadedGrid: Spacebus
