- type: entity
  id: NFAdventure
  parent: BaseGameRule
  categories: [ HideSpawnMenu ]
  components:
  - type: NFAdventureRule

- type: entity
  id: BluespaceEventScheduler
  parent: BaseGameRule
  components:
  - type: BasicStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: MajorBluespaceEventsTable
    minimumTimeUntilFirstEvent: 2700 # 45 minutes
    minMaxEventTiming:
      min: 2700 # 45 minutes between events
      max: 4500 # 75 minutes between events

- type: entityTable
  id: MajorBluespaceEventsTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: BluespaceCacheError
    - id: BluespaceCave
    - id: BluespaceVaultError
    - id: BluespaceVaultSmallError
    - id: BluespaceSyndicateFTLInterception
    - id: BluespaceWizardFederationScout
    - id: BluespaceBloodMoon

- type: entity
  id: BluespaceDungeonEventScheduler
  parent: BaseGameRule
  components:
  - type: BasicStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: DungeonBluespaceEventsTable
    minimumTimeUntilFirstEvent: 600 # 10 minutes
    minMaxEventTiming:
      min: 2100 # 35 minutes between events
      max: 2400 # 40 minutes between events

- type: entityTable
  id: DungeonBluespaceEventsTable
  table: !type:AllSelector # we need to pass a list of rules, since rules have further restrictions to consider via StationEventComp
    children:
    - id: BluespaceDungeonBasalt
    - id: BluespaceDungeonChromite
    - id: BluespaceDungeonSnow
    - id: BluespaceDungeonCave
    - id: BluespaceDungeonCaveZombie

- type: entity
  id: BluespaceSalvageEventScheduler
  parent: BaseGameRule
  components:
  - type: BasicStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: SalvageBluespaceEventsTable
    minimumTimeUntilFirstEvent: 420 # 7 minutes
    minMaxEventTiming:
      min: 2100 # 35 minutes between events
      max: 2400 # 40 minutes between events

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

- type: entity
  id: SmugglingEventScheduler
  parent: BaseGameRule
  components:
  - type: BasicStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: MajorSmugglingEventsTable
    minimumTimeUntilFirstEvent: 1800 # 30 minutes
    minMaxEventTiming:
      min: 28800 # 8 hours between events
      max: 43200 # 12 hours between events

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

- type: entity
  parent: BaseGameRule
  id: NFPirate
  components:
  - type: NFPirateRule
  - type: AntagObjectives
    objectives:
    - NFPiratePlunderObjective
    - NFPirateBountyObjective
  - type: AntagSelection
    agentName: nf-pirate-round-end-agent-name
    definitions:
    # Pirate Captain role
    - prefRoles: [ NFPirateCaptain ]
      max: 999
      playerRatio: -1
      lateJoinAdditional: false
      allowNonHumans: true
      multiAntagSetting: All
      components: &pirateComponents
      - type: MailDisabled
      - type: NpcFactionMember
        factions:
        - NFPirate
      whitelist:
        components:
        - AutoPirateCaptain
      mindRoles:
      - MindRoleNFPirateCaptain
      briefing: &pirateBriefing
        sound: "/Audio/_NF/Misc/pirate_greeting.ogg"
    # Pirate First Mate role
    - prefRoles: [ NFPirateFirstMate ]
      max: 999
      playerRatio: -1
      lateJoinAdditional: false
      allowNonHumans: true
      multiAntagSetting: All
      components: *pirateComponents
      mindRoles:
      - MindRoleNFPirateFirstMate
      whitelist:
        components:
        - AutoPirateFirstMate
      briefing: *pirateBriefing
    # Pirate role
    - prefRoles: [ NFPirate ]
      max: 999
      playerRatio: -1
      lateJoinAdditional: false
      allowNonHumans: true
      multiAntagSetting: All
      components: *pirateComponents
      mindRoles:
      - MindRoleNFPirate
      # no whitelist, catchall
      briefing: *pirateBriefing

# Concrete ignored upstream definitions
- type: entity
  id: NFSandbox
  parent: Sandbox

- type: entity
  id: NFMaxTimeRestart
  parent: BaseGameRule
  components:
  - type: MaxTimeRestartRule
    roundMaxTime: 300
    roundEndDelay: 10

# variation passes
- type: entity
  id: NFRoundstartVariation
  parent: BaseGameRule
  components:
  - type: RoundstartStationVariationRule
    rules:
    - id: NFBasicPoweredLightVariationPass
    - id: NFBasicTrashVariationPass
    - id: NFBasicPuddleMessVariationPass
    - id: NFBasicBindToStationVariationPass
    # - id: NFBasicDeadDropHintVariationPass # ccvar for it found at smuggling.min_hints/smuggling.max_hints

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

- type: entity
  id: NFBasicStationEventScheduler
  parent: BaseGameRule
  components:
  - type: BasicStationEventScheduler
    scheduledGameRules: !type:NestedSelector
      tableId: NFGameRulesTable
