# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fenn <162015305+TooSillyFennec@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2024 Rouge2t7 <81053047+Sarahon@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 fishbait <gnesse@gmail.com>
# SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@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 Marcus F <199992874+thebiggestbruh@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2025 SX-7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
# SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter <solsticeofthewinter@gmail.com>
# SPDX-FileCopyrightText: 2025 Ted Lukin <66275205+pheenty@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gus <august.eymann@gmail.com>
# SPDX-FileCopyrightText: 2025 loltart <159829224+loltart@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 loltart <lo1tartyt@gmail.com>
# SPDX-FileCopyrightText: 2025 pheenty <fedorlukin2006@gmail.com>
# SPDX-FileCopyrightText: 2025 thebiggestbruh <199992874+thebiggestbruh@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

# SubGamemodes

- type: entity
  parent: BaseGameRule
  id: TraitorSubGamemodesRule
  components:
  - type: SubGamemodes
    rules:
    - id: SubgamemodeTraitor
      prob: 0.5

# GameModes

- type: entity
  parent: BaseGameRule
  id: Changeling
  components:
  - type: ChangelingRule
  - type: GameRule
    minPlayers: 15
  - type: AntagRandomObjectives
    sets:
    - groups: ChangelingObjectiveGroups
    maxDifficulty: 5
  - type: AntagObjectives
    objectives:
    - ChangelingSurviveObjective
    - ChangelingStealDNAObjective
    - ChangelingAbsorbObjective
    - EscapeIdentityObjective
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    agentName: changeling-roundend-name
    definitions:
    - prefRoles: [ Changeling ]
      max: 4
      playerRatio: 12
      chaosScore: 200
      jobBlacklist: [ Chaplain ] # GOOBSTATION
      blacklist:
        components:
        - CommandStaff
      lateJoinAdditional: true
      mindRoles:
      - MindRoleChangeling
  - type: Tag
    tags:
      - RoundstartAntag

- type: entity
  parent: BaseTraitorRule
  id: CorporateAgent
  components:
  - type: TraitorRule
    objectiveIssuers: CorporateFlavor
  - type: AntagRandomObjectives
    sets:
    - groups: CorporateObjectiveGroups
    maxDifficulty: 8 # Very rare antag so they should get a lot of objectives
  - type: GameRule
    minPlayers: 30
    delay:
      min: 465
      max: 665 # Delay is so the heads help their department get set up.
  - type: AntagSelection
    definitions:
    - prefRoles: [ Traitor ]
      max: 2
      playerRatio: 25
      chaosScore: 300
      jobBlacklist: [ NanotrasenRepresentative ]
      whitelist:
        components:
        - CommandStaff
      blacklist:
        components:
        - Condemned # Stops the NTR from rolling it
      lateJoinAdditional: true
      mindRoles:
      - MindRoleTraitor

- type: entity
  parent: BaseTraitorRule
  id: CalmTraitor # For Dual Antag Gamemodes
  components:
  - type: GameRule
    minPlayers: 30
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    definitions:
    - prefRoles: [ Traitor ]
      max: 3
      playerRatio: 15
      blacklist:
        components:
        - CommandStaff
        - AntagImmune
        - Changeling
      lateJoinAdditional: true
      mindRoles:
      - MindRoleTraitor
  - type: Tag
    tags:
      - CalmAntag

- type: entity
  parent: Changeling
  id: CalmLing # For Dual Antag Gamemodes
  components:
  - type: GameRule
    minPlayers: 30
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    agentName: changeling-roundend-name
    definitions:
    - prefRoles: [ Changeling ]
      max: 2
      playerRatio: 15
      blacklist:
        components:
        - CommandStaff
      lateJoinAdditional: true
      mindRoles:
      - MindRoleTraitor
  - type: Tag
    tags:
      - CalmAntag

- type: entity
  parent: BaseNukeopsRule
  id: Calmops # For Dual Antag Gamemodes
  components:
  - type: GameRule
    minPlayers: 30
  - type: LoadMapRule
    mapPath: /Maps/_Goobstation/Nonstations/nukieplanet.yml
  - type: AntagSelection
    selectionTime: PrePlayerSpawn
    definitions:
    - prefRoles: [ NukeopsCommander ]
      fallbackRoles: [ Nukeops, NukeopsMedic ]
      spawnerPrototype: SpawnPointNukeopsCommander
      playerRatio: 15
      startingGear: SyndicateCommanderGearFull
      unequipOldGear: true
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesSyndicateElite
        nameFormat: name-format-nukie-commander
      - type: NpcFactionMember
        factions:
        - Syndicate
      mindRoles:
      - MindRoleNukeopsCommander
    - prefRoles: [ NukeopsMedic ]
      fallbackRoles: [ Nukeops, NukeopsCommander ]
      spawnerPrototype: SpawnPointNukeopsMedic
      playerRatio: 15
      startingGear: SyndicateOperativeMedicFull
      unequipOldGear: true
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesSyndicateElite
        nameFormat: name-format-nukie-agent
      - type: NpcFactionMember
        factions:
        - Syndicate
      - type: SurgerySpeedModifier # shitmed
        speedModifier: 2
      mindRoles:
      - MindRoleNukeopsMedic
    - prefRoles: [ Nukeops ]
      fallbackRoles: [ NukeopsCommander, NukeopsMedic ]
      spawnerPrototype: SpawnPointNukeopsOperative
      max: 10
      playerRatio: 20
      startingGear: SyndicateOperativeGearFull
      unequipOldGear: true
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesSyndicateElite
        nameFormat: name-format-nukie-operator
      - type: NpcFactionMember
        factions:
        - Syndicate
      mindRoles:
      - MindRoleNukeops
  - type: Tag
    tags:
      - CalmAntag

- type: entity
  id: CalmRevs # For Dual Antag Gamemodes
  parent: BaseGameRule
  components:
  - type: GameRule
    minPlayers: 30
  - type: RevolutionaryRule
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    definitions:
    - prefRoles: [ HeadRev ]
      max: 1
      playerRatio: 20
      blacklist:
        components:
        - CommandStaff
      briefing:
        text: head-rev-role-greeting
        color: CornflowerBlue
        sound: "/Audio/Ambience/Antag/headrev_start.ogg"
      startingGear: HeadRevGear
      components:
      - type: Revolutionary
      - type: HeadRevolutionary
      mindRoles:
      - MindRoleHeadRevolutionary
  - type: Tag
    tags:
      - CalmAntag
# Blob
- type: entity
  id: BlobRule
  parent: BaseGameRule
  categories: [ HideSpawnMenu ]
  components:
  - type: BlobRule
  - type: GameRule
    chaosScore: 1000

- type: entity
  id: BlobGameMode
  parent: BaseGameRule
  categories: [ HideSpawnMenu ]
  components:
  - type: BlobRule
  - type: GameRule
    minPlayers: 20
    chaosScore: 1000
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    definitions:
    - prefRoles: [ Blob ]
      allowNonHumans: true
      jobBlacklist: [ Chaplain ] # Goobstation
      blacklist:
        components:
        - CommandStaff
        - AntagImmune
      briefing:
        text: blob-carrier-role-greeting
        color: Plum
        sound: /Audio/Announcements/bloblarm.ogg
      mindRoles:
      - MindRoleBlob

- type: entity
  id: BlobSpawn
  parent: BaseGameRule
  categories: [ HideSpawnMenu ]
  components:
  - type: StationEvent
    weight: 1
    duration: 1
    earliestStart: 50
    minimumPlayers: 20
    maxOccurrences: 2
    chaos:
      Hostile: 200
      Death: 300
      Medical: 200
    eventType: HostilesSpawn
  - type: GameRule
    chaosScore: 1000
  - type: BlobSpawnRule
    carrierBlobProtos:
    - SpawnPointGhostBlobRat
    playersPerCarrierBlob: 30
    maxCarrierBlob: 1

- type: entity
  parent: BaseNukeopsRule
  id: Honkops
  components:
  - type: RandomMetadata # this generates the random operation name cuz it's cool.
    nameSegments:
    - OperationPrefixHonkops
    - OperationSuffixHonkops
    nameFormat: name-format-standard
  - type: NukeopsRule
    localePrefix: "honkops-"
  - type: LoadMapRule
    mapPath: /Maps/_Goobstation/Nonstations/nukieplanet-honkops.yml
  - type: AntagSelection
    selectionTime: PrePlayerSpawn
    definitions:
    - prefRoles: [ NukeopsCommander ]
      fallbackRoles: [ Nukeops, NukeopsMedic ]
      spawnerPrototype: SpawnPointNukeopsCommander
      startingGear: SyndicateCommanderGearFullHonkops
      roleLoadout:
      - RoleSurvivalNukieHonkops
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesHonkopsPrefix
        - NamesHonkopsElite
        nameFormat: name-format-standard
      - type: NpcFactionMember
        factions:
        - Syndicate
      mindRoles:
      - MindRoleNukeopsCommander
    - prefRoles: [ NukeopsMedic ]
      fallbackRoles: [ Nukeops, NukeopsCommander ]
      spawnerPrototype: SpawnPointNukeopsMedic
      startingGear: SyndicateOperativeMedicFullHonkops
      roleLoadout:
      - RoleSurvivalNukieHonkops
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesHonkopsPrefix
        - NamesHonkopsElite
        nameFormat: name-format-standard
      - type: NpcFactionMember
        factions:
        - Syndicate
      - type: SurgerySpeedModifier # shitmed
        speedModifier: 2
      mindRoles:
      - MindRoleNukeopsMedic
    - prefRoles: [ Nukeops ]
      fallbackRoles: [ NukeopsCommander, NukeopsMedic ]
      spawnerPrototype: SpawnPointNukeopsOperative
      max: 10 # Goobstation / 古布空间站 - 没有限制的核特工
      playerRatio: 16 # Goobstation
      startingGear: SyndicateOperativeGearFullHonkops
      roleLoadout:
      - RoleSurvivalNukieHonkops
      components:
      - type: NukeOperative
      - type: RandomMetadata
        nameSegments:
        - NamesHonkopsPrefix
        - NamesHonkopsElite
        nameFormat: name-format-standard
      - type: NpcFactionMember
        factions:
        - Syndicate
      mindRoles:
      - MindRoleNukeops

- type: entity
  parent: BaseGameRule
  id: Devil
  components:
  - type: DevilRule
  - type: GameRule
    minPlayers: 15
  - type: AntagObjectives
    objectives:
    - DevilContractObjective
    - DevilWeightObjective
  - type: AntagSelection
    selectionTime: IntraPlayerSpawn
    agentName: devil-roundend-name
    definitions:
    - prefRoles: [ Devil ]
      max: 1
      playerRatio: 40 # from 20 --> 40 , makes it less likely to spawn (Fuck devils)
      chaosScore: 150
      jobBlacklist: [ Chaplain, Mime, ChiefEngineer, ResearchDirector, Quartermaster ] #chaplain is obvious, mime can't write.
      mindRoles:
      - DevilMindRole
      startingGear: DevilStartingGear
  - type: Tag
    tags:
    - RoundstartAntag

- type: entity
  parent: Thief
  id: OopsAllThieves
  components:
  - type: GameRule
    minPlayers: 30
    chaosScore: 1200
  - type: AntagSelection
    agentName: thief-round-end-agent-name
    definitions:
    - prefRoles: [ Thief ]
      max: 10
      playerRatio: 7
      lateJoinAdditional: true
      allowNonHumans: true
      multiAntagSetting: NotExclusive
      startingGear: ThiefGear
      components:
      - type: Pacified
      - type: Thieving
        stripTimeReduction: 2
        stealthy: true
      mindRoles:
      - MindRoleThief
      briefing:
        sound: "/Audio/Misc/thief_greeting.ogg"
