# SPDX-FileCopyrightText: 2021 Alexander Evgrashin <evgrashin.adl@gmail.com>
# SPDX-FileCopyrightText: 2022 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Fishfish458 <47410468+Fishfish458@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Moony <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2022 Profane McBane <profanedbane+github@gmail.com>
# SPDX-FileCopyrightText: 2022 T-Stalker <43253663+DogZeroX@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 fishfish458 <fishfish458>
# SPDX-FileCopyrightText: 2022 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 moonheart08 <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Colin-Tel <113523727+Colin-Tel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Crotalus <Crotalus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Gansu <68031780+GansuLalan@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 aa5g21 <aa5g21@soton.ac.uk>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 lapatison <100279397+lapatison@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
# SPDX-FileCopyrightText: 2025 blobadoodle <me@bloba.dev>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: [BaseStructure, StructureWheeled, BaseMajorContraband]
  id: NuclearBomb
  name: nuclear fission explosive
  description: You probably shouldn't stick around to see if this is armed.
  components:
  - type: Transform
    anchored: true
  - type: Sprite
    sprite: Objects/Devices/nuke.rsi
    noRot: true
    layers:
    - state: nuclearbomb_base
      map: ["enum.NukeVisualLayers.Base"]
    - state: nuclearbomb_deployed_unlit
      map: ["enum.NukeVisualLayers.Unlit"]
      shader: unshaded
      visible: false
    - state: nuclearbomb_gay
      map: ["pride"]
      visible: false
    - state: nukefestive
      map: ["christmas"]
      visible: false
  - type: Appearance
  - type: HolidayVisuals
    holidays:
      festive:
      - FestiveSeason
      pride:
      - PrideMonth
  - type: GenericVisualizer
    visuals:
      enum.HolidayVisuals.Holiday:
        christmas:
          festive: { visible: true }
        pride:
          pride: { visible: true }
      enum.NukeVisuals.Deployed:
        enum.NukeVisualLayers.Base:
          False: { state: nuclearbomb_base }
          True:  { state: nuclearbomb_deployed }
        enum.NukeVisualLayers.Unlit:
          True:  { visible: true }
          False: { visible: false }
      enum.NukeVisuals.State:
        enum.NukeVisualLayers.Unlit:
          Idle:        { state: nuclearbomb_deployed_unlit }
          Armed:       { state: nuclearbomb_timing }
          YoureFucked: { state: nuclearbomb_exploding }
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.45
        density: 255 # Has "bluespace technology" to make it lighter, whatever that means. Don't mind the fact that this is lighter then a high capacity fuel tank.
        mask:
        - MachineMask
        layer:
        - HalfWallLayer
  - type: PointLight
    enabled: false
    radius: 4
    energy: 2.0
    color: "#FF4020"
    mask: /Textures/Effects/LightMasks/double_cone.png
  - type: RotatingLight
    speed: 120
  - type: NavMapBeacon
    color: "#ff0000"
    text: nuclear fission explosive
    enabled: false
  - type: NukeLabel
  - type: Nuke
    explosionType: Default
    maxIntensity: 100
    intensitySlope: 5
    totalIntensity: 5000000
    diskSlot:
      name: nuke-slot-component-slot-name-disk
      insertSound:
        path: /Audio/Machines/terminal_insert_disc.ogg
      ejectSound:
        path: /Audio/Machines/terminal_insert_disc.ogg
      whitelist:
        components:
        - NukeDisk
    alertLevelOnActivate: delta
    alertLevelOnDeactivate: green
    alertLevelOnOverride: omicron # Goobstation
  - type: InteractionOutline
  - type: ActivatableUI
    key: enum.NukeUiKey.Key
  - type: UserInterface
    interfaces:
      enum.NukeUiKey.Key:
        type: NukeBoundUserInterface
  - type: StaticPrice
    price: 50000 # YOU STOLE A NUCLEAR FISSION EXPLOSIVE?!
  - type: CargoSellBlacklist
  - type: ArrivalsBlacklist
  - type: ItemSlots
  - type: ContainerContainer
    containers:
      Nuke: !type:ContainerSlot
  - type: StealTarget
    stealGroup: NuclearBomb
  - type: WarpPoint
    follow: true
    location: nuclear bomb
  - type: FTLSmashImmune
  - type: SupermatterImmune # Goobstation

- type: entity
  parent: NuclearBomb
  id: NuclearBombUnanchored
  suffix: unanchored
  components:
  - type: Transform
    anchored: false
  - type: Physics
    bodyType: Dynamic

- type: entity
  parent: StorageTank
  id: NuclearBombKeg
  name: nuclear fission explosive
  suffix: keg
  description: You probably shouldn't stick around to see if this is armed. It has a tap on the side.
  components:
  - type: Transform
    anchored: false
  - type: NukeLabel
  - type: Sprite
    sprite: Objects/Devices/nuke.rsi
    layers:
    - state: nuclearbomb_base
    - state: nukefestive
      map: ["christmas"]
      visible: false
    - state: nuclearbomb_gay
      map: [ "pride" ]
      visible: false
  - type: Appearance
  - type: HolidayVisuals
    holidays:
      festive:
      - FestiveSeason
      pride:
      - PrideMonth
  - type: GenericVisualizer
    visuals:
      enum.HolidayVisuals.Holiday:
        christmas:
          festive: { visible: true }
        pride:
          pride: { visible: true }
  - type: Physics
    bodyType: Dynamic
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.45
        density: 255
        mask:
        - MachineMask
        layer:
        - WallLayer
  - type: SolutionContainerManager
    solutions:
      tank:
        reagents:
        - ReagentId: NuclearCola
          Quantity: 3000
  - type: ReagentTank
    transferAmount: 100
  - type: StaticPrice
    price: 5000 # That's a pretty fancy keg you got there.