- type: entity
  abstract: true
  parent: BaseObjective
  id: BaseTraitorObjective
  components:
  - type: Objective
    issuer: TheSyndicate
  - type: RoleRequirement
    roles:
    - TraitorRole

- type: entity
  abstract: true
  parent: [BaseTraitorObjective, BaseSocialObjective]
  id: BaseTraitorSocialObjective
  components:
  - type: Objective
    icon:
      sprite: Objects/Misc/folders.rsi
      state: folder-colormap
  - type: MultipleTraitorsRequirement

- type: entity
  abstract: true
  parent: [BaseTraitorObjective, BaseStealObjective]
  id: BaseTraitorStealObjective
  components:
  - type: StealCondition
    verifyMapExistence: false
  - type: Objective
    difficulty: 2.75
  - type: ObjectiveLimit
    limit: 2 # there is usually only 1 of each steal objective, have 2 max for drama

# state

- type: entity
  parent: [BaseTraitorObjective, BaseLivingObjective]
  id: EscapeShuttleObjective
  name: Escape to CentComm alive and unrestrained via the escape shuttle.
  description: One of our undercover agents will debrief you when you arrive. Don't show up in cuffs.
  components:
  - type: Objective
    difficulty: 1.3
    icon:
      sprite: Structures/Furniture/chairs.rsi
      state: shuttle
  - type: EscapeShuttleCondition

- type: entity
  parent: BaseTraitorObjective
  id: DieObjective
  name: Die a glorious death
  description: Die.
  components:
  - type: Objective
    difficulty: 0.5
    icon:
      sprite: Mobs/Ghosts/ghost_human.rsi
      state: icon
  - type: ObjectiveBlacklistRequirement
    blacklist:
      components:
      - EscapeShuttleCondition
      - StealCondition
  - type: DieCondition
  - type: ObjectiveLimit
    limit: 1

#- type: entity
#  parent: [BaseTraitorObjective, BaseLivingObjective]
#  id: HijackShuttleObjective
#  name: Hijack emergency shuttle
#  description: Leave on the shuttle free and clear of the loyal Nanotrasen crew on board. Use ANY methods available to you. Syndicate agents, Nanotrasen enemies, and handcuffed hostages may remain alive on the shuttle. Ignore assistance from anyone other than a support agent.
#  components:
#    - type: Objective
#      difficulty: 5 # insane, default config max difficulty
#      icon:
#        sprite: Objects/Tools/emag.rsi
#        state: icon
#    - type: HijackShuttleCondition

# kill

- type: entity
  parent: [BaseTraitorObjective, BaseKillRandomObjective]
  id: KillRandomPersonObjective
  description: Do it however you like, just make sure they don't get off the station.
  components:
  - type: Objective
    difficulty: 1.75
    unique: false
  - type: TargetObjective
    title: objective-condition-maroon-person-title
  - type: KillPersonCondition
    requireMaroon: true

- type: entity
  parent: [BaseTraitorObjective, BaseKillRandomObjective]
  id: KillRandomHeadObjective
  description: We need this head gone and you probably know why. Make sure they don't make it to CentComm, even if they're dead. Good luck, agent.
  components:
  - type: Objective
    # technically its still possible for KillRandomPersonObjective to roll a head but this is guaranteed, so higher difficulty
    difficulty: 3.0
    # killing 1 head is enough
    unique: true
  - type: TargetObjective
    title: objective-condition-kill-maroon-title
  - type: PickRandomPerson
    conditions:
    - !type:BodyWhitelistCondition
      whitelist:
        components:
        - CommandStaff
  - type: KillPersonCondition
    # don't count missing evac as killing as heads are higher profile, so you really need to do the dirty work
    # if ce flies a shittle to centcom you better find a way onto it
    requireDead: true
    requireMaroon: true

- type: entity
  parent: [BaseTraitorObjective, BaseKillRandomObjective]
  id: KillStationAiObjective
  description: Nanotrasen proudly boasts about their state of the art artificial intelligence. Remind them it's just another toy that can be broken.
  components:
  - type: Objective
    difficulty: 3.0
    # there's probably only one AI
    unique: true
    icon:
      sprite: Mobs/Silicon/station_ai.rsi
      state: ai_dead # TODO: Change this to broken when we have a better objectives UI, broken sprite is currently too big!
  - type: TargetObjective
    title: objective-condition-kill-station-ai
  - type: PickRandomPerson
    pool: !type:AliveAiPool
  - type: KillPersonCondition
    requireDead: true

# social

- type: entity
  parent: [BaseTraitorSocialObjective, BaseKeepAliveObjective]
  id: RandomTraitorAliveObjective
  description: Identify yourself at your own risk. We just need them alive.
  components:
  - type: Objective
    difficulty: 1.75
  - type: TargetObjective
    title: objective-condition-other-traitor-alive-title
  - type: PickRandomPerson
    conditions:
    - !type:RoleCondition
      whitelist:
        components:
        - TraitorRole
    # Can't have multiple objectives to help/save the same person
    - !type:ObjectiveTargetCondition
      inverted: true
      whitelist:
        components:
        - HelpProgressCondition
        - KeepAliveCondition

- type: entity
  parent: [BaseTraitorSocialObjective, BaseHelpProgressObjective]
  id: RandomTraitorProgressObjective
  description: Identify yourself at your own risk. We just need them to succeed.
  components:
  - type: Objective
    difficulty: 2.5
  - type: TargetObjective
    title: objective-condition-other-traitor-progress-title
  - type: PickRandomPerson
    conditions:
    - !type:RoleCondition
      whitelist:
        components:
        - TraitorRole
    # Can't help anyone who is tasked with helping:
    # 1. thats boring
    # 2. no cyclic progress dependencies!!!
    - !type:ObjectiveCondition
      inverted: true
      whitelist:
        components:
        - HelpProgressCondition
    # Can't have multiple objectives to help/save the same person
    - !type:ObjectiveTargetCondition
      inverted: true
      whitelist:
        components:
        - HelpProgressCondition
        - KeepAliveCondition

# steal

## cmo

- type: entity
  abstract: true
  parent: BaseTraitorStealObjective
  id: BaseCMOStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ ChiefMedicalOfficer ]
  - type: StealCondition
    owner: job-name-cmo

- type: entity
  parent: BaseCMOStealObjective
  id: CMOHyposprayStealObjective
  components:
  - type: StealCondition
    stealGroup: Hypospray

- type: entity
  parent: BaseCMOStealObjective
  id: CMOCrewMonitorStealObjective
  components:
  - type: StealCondition
    stealGroup: HandheldCrewMonitor

## rd

- type: entity
  abstract: true
  parent: BaseTraitorStealObjective
  id: BaseRDStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ ResearchDirector ]
  - type: StealCondition
    owner: job-name-rd

- type: entity
  parent: BaseRDStealObjective
  id: RDHardsuitStealObjective
  components:
  - type: StealCondition
    stealGroup: ClothingOuterHardsuitRd
  - type: Objective
    # This item must be worn or stored in a slowing duffelbag, very hard to hide.
    difficulty: 3

- type: entity
  parent: BaseRDStealObjective
  id: HandTeleporterStealObjective
  components:
  - type: StealCondition
    stealGroup: HandTeleporter

## hos

- type: entity
  parent: BaseTraitorStealObjective
  id: EnergyMagnumStealObjective
  components:
  - type: Objective
    # HoS will have this on them a lot of the time so..
    difficulty: 3
  - type: NotJobRequirement
    jobs: [ HeadOfSecurity ]
  - type: StealCondition
    stealGroup: WeaponEnergyMagnum
    owner: job-name-hos

## ce

- type: entity
  parent: BaseTraitorStealObjective
  id: MagbootsStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ ChiefEngineer ]
  - type: StealCondition
    stealGroup: ClothingShoesBootsMagAdv
    owner: job-name-ce

## qm

- type: entity
  parent: BaseTraitorStealObjective
  id: ClipboardStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ Quartermaster ]
  - type: StealCondition
    stealGroup: BoxFolderQmClipboard
    owner: job-name-qm

- type: entity
  parent: BaseTraitorStealObjective
  id: KnuckleDustersStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ Quartermaster ]
  - type: StealCondition
    stealGroup: ClothingHandsKnuckleDustersQM
    owner: job-name-qm

## hop

- type: entity
  parent: BaseTraitorStealObjective
  id: CorgiMeatStealObjective
  components:
  - type: NotJobRequirement
    jobs: [ HeadOfPersonnel ]
  - type: ObjectiveLimit
    limit: 3 # ian only has 2 slices, 3 obj for drama
  - type: StealCondition
    stealGroup: FoodMeatCorgi
    owner: objective-condition-steal-Ian

## cap

- type: entity
  abstract: true
  parent: BaseTraitorStealObjective
  id: BaseCaptainObjective
  components:
  - type: Objective
    # sorry ce but your jordans are not as high security as the caps gear
    difficulty: 3.5
  - type: NotJobRequirement
    jobs: [ Captain ]

- type: entity
  parent: BaseCaptainObjective
  id: CaptainIDStealObjective
  components:
  - type: StealCondition
    stealGroup: CaptainIDCard

- type: entity
  parent: BaseCaptainObjective
  id: CaptainJetpackStealObjective
  components:
  - type: StealCondition
    stealGroup: JetpackCaptainFilled

- type: entity
  parent: BaseCaptainObjective
  id: CaptainGunStealObjective
  components:
  - type: StealCondition
    stealGroup: WeaponAntiqueLaser
    owner: job-name-captain

- type: entity
  parent: BaseCaptainObjective
  id: NukeDiskStealObjective
  components:
  - type: Objective
    # high difficulty since the hardest item both to steal, and to not get caught down the road,
    # since anyone with a pinpointer can track you down and kill you
    # it's close to being a stealth loneop
    difficulty: 4
  - type: NotCommandRequirement
  - type: StealCondition
    stealGroup: NukeDisk
    owner: objective-condition-steal-station

# sabotage
- type: entity
  parent: BaseTraitorObjective
  id: SupercritAnomaliesObjective
  description: Nanotrasen is very interested in anomalies with potentially catastrophic consequences. Introduce them to the fire they're playing with.
  components:
  - type: Objective
    difficulty: 2
    icon:
      sprite: Structures/Specific/anomaly.rsi
      state: anom1
  - type: SupercriticalAnomaliesCondition
  - type: NumberObjective
    min: 3
    max: 4
    title: objective-condition-supercrit-anomalies-title
  - type: ObjectiveLimit
    limit: 1

# other
- type: entity
  parent: BaseTraitorObjective
  id: HijackTradeStationObjective
  name: Hijack the Automated Trade Station.
  description: Your uplink has been authorized one hijack beacon. Deploy it on the Automated Trade Station and defend it whilst it hijacks the trade station.
  components:
  - type: Objective
    difficulty: 3
    icon:
      sprite: Objects/Tools/hijack_beacon.rsi
      state: extraction_point
  - type: HijackTradeStationCondition
  - type: ObjectiveLimit
    # There is only one trade station so there should never be more than one of these objectives.
    limit: 1

- type: entity
  parent: [BaseTraitorObjective, BaseCounterObjective]
  id: MailFraudObjective
  description: We're interested in Nanotrasen's correspondence. Letter opener not provided.
  components:
  - type: Objective
    difficulty: 0.5
    icon:
      sprite: Objects/Specific/Cargo/mail_bag.rsi
      state: icon
  - type: MailFraudCondition
  - type: NumberObjective
    min: 8
    max: 12
    title: objective-condition-mail-fraud-title
  - type: ObjectiveLimit
    limit: 1
