# SPDX-FileCopyrightText: 2018 Pieter-Jan Briers <pieterjan.briers@gmail.com>
# SPDX-FileCopyrightText: 2019 Acruid <shatter66@gmail.com>
# SPDX-FileCopyrightText: 2019 L.E.D <10257081+unusualcrow@users.noreply.github.com>
# SPDX-FileCopyrightText: 2019 Swept <49448379+SweptWasTaken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 AJCM-git <60196617+AJCM-git@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Exp <theexp111@gmail.com>
# SPDX-FileCopyrightText: 2020 Hugo Laloge <hugo.laloge@gmail.com>
# SPDX-FileCopyrightText: 2020 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2020 Peter Wedder <burneddi@gmail.com>
# SPDX-FileCopyrightText: 2020 Reno DuBois <renodubois@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 V�ctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 juliangiebel <juliangiebel@live.de>
# SPDX-FileCopyrightText: 2020 py01 <60152240+collinlunn@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 py01 <pyronetics01@gmail.com>
# SPDX-FileCopyrightText: 2020 zumorica <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 20kdc <asdd2808@gmail.com>
# SPDX-FileCopyrightText: 2021 Alex Evgrashin <aevgrashin@yandex.ru>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Nikita Brancatisano <33670112+thevinter@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Ygg01 <y.laughing.man.y@gmail.com>
# SPDX-FileCopyrightText: 2022 ElectroJr <leonsfriedrich@gmail.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Moony <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Ripmorld <60119809+UKNOWH@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 corentt <36075110+corentt@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 moonheart08 <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Doru991 <75124791+Doru991@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Sailor <109166122+Equivocateur@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 chromiumboy <50505512+chromiumboy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2023 h3half <hheim8@gmail.com>
# SPDX-FileCopyrightText: 2023 keronshb <54602815+keronshb@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 kxv <136233650+kxvvv@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Debug <49997488+DebugOk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 a_person <40855173+a-person5660@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Entvari <195642967+Entvari@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Ilya246 <ilyukarno@gmail.com>
# SPDX-FileCopyrightText: 2025 Kirus59 <145689588+Kirus59@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX-7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 Samuka-C <47865393+Samuka-C@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 fishbait <gnesse@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BasePowerCell
  abstract: true
  parent: BaseItem
  components:
  - type: Item
    storedRotation: -90
  - type: Battery
    pricePerJoule: 0.15
  - type: PowerCell
  - type: Explosive
    explosionType: Default
    maxIntensity: 200
    intensitySlope: 1.5
  - type: Sprite
    sprite: Objects/Power/power_cells.rsi
  - type: SolutionContainerManager
    solutions:
      battery:
        maxVol: 5
  - type: InjectableSolution
    solution: battery
  - type: DrawableSolution
    solution: battery
  - type: Extractable
    juiceSolution:
      reagents:
        - ReagentId: Zinc
          Quantity: 5
  - type: Tag
    tags:
      - PowerCell
      - DroneUsable # Goobstation
  - type: Appearance
  - type: PowerCellVisuals
  - type: Riggable
  - type: StealTarget #Goobstation - IPC steal
    stealGroup: Battery
  - type: BatteryDrinkerSource # Goobstation - Energycrit
    maxAmount: 360

- type: entity
  name: potato battery
  description: Someone's stuck two nails and some wire in a large potato. Somehow it provides a little charge.
  id: PowerCellPotato
  parent: BasePowerCell
  components:
  - type: Sprite
    layers:
    - state: potato
  - type: Battery
    maxCharge: 70
    startingCharge: 70
  - type: Tag
    tags:
      - PotatoBattery
      - DroneUsable # Goobstation
  - type: Construction
    graph: PowerCellPotato
    node: potatobattery
  - type: PowerSupplier # goob start - potato power!
    supplyRate: 30
    supplyRampRate: 500
    supplyRampTolerance: 500
    voltage: Apc
    enabled: true
  - type: NodeContainer
    examinable: true
    nodes:
      output:
        !type:CableDeviceNode
        nodeGroupID: Apc
  - type: PowerMonitoringDevice
    group: Generator
    loadNode: output
    sprite: Structures/Power/power.rsi
    state: generator
  - type: Anchorable # goob end
  - type: HitscanBatteryAmmoProvider # goob edit - svalinn buff fix
    proto: MediumOverchargedLaser # hot potato
    fireCost: 70

- type: entity
  name: small-capacity power cell
  description: A rechargeable power cell. This is the cheapest kind you can find.
  id: PowerCellSmall
  suffix: Full
  parent: BasePowerCell
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: small
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 360
    startingCharge: 360
  - type: Tag
    tags:
      - PowerCellSmall
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Plastic: 12
      Steel: 12
    chemicalComposition:
      Zinc: 5
  - type: HitscanBatteryAmmoProvider # goob edit - svalinn buff fix
    proto: RedLightLaser
    fireCost: 45 # 8 shots

- type: entity
  id: PowerCellSmallPrinted
  suffix: Empty
  parent: PowerCellSmall
  components:
  - type: Sprite
    layers:
      - map: [ "enum.PowerCellVisualLayers.Base" ]
        state: small
      - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
        state: o2
        shader: unshaded
        visible: false
  - type: Battery
    maxCharge: 360
    startingCharge: 0

- type: entity
  parent: PowerCellSmall
  id: PowerCellSmallNuclear
  name: small-capacity nuclear power cell
  description: A self rechargeable power cell, designed for fast recharge rate at the expense of capacity.
  components:
  - type: BatterySelfRecharger
    autoRecharge: true
    autoRechargeRate: 36 # 10 seconds to recharge
    autoRechargePause: true
    autoRechargePauseTime: 30

- type: entity
  name: medium-capacity power cell
  description: A rechargeable power cell. This is the popular and reliable version.
  id: PowerCellMedium
  suffix: Full
  parent: BasePowerCell
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: medium
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 720
    startingCharge: 720
  - type: HitscanBatteryAmmoProvider # goob edit - battery hitscan buff
    proto: MediumRedLaser
    fireCost: 90 # 8 shots
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Plastic: 50
      Steel: 50
      Glass: 75
      Gold: 2
    chemicalComposition:
      Zinc: 10

- type: entity
  id: PowerCellMediumPrinted
  suffix: Empty
  parent: PowerCellMedium
  components:
  - type: Sprite
    layers:
      - map: [ "enum.PowerCellVisualLayers.Base" ]
        state: medium
      - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
        state: o2
        shader: unshaded
        visible: false
  - type: Battery
    maxCharge: 720
    startingCharge: 0

- type: entity
  name: high-capacity power cell
  description: A rechargeable standardized power cell. This premium brand stores up to 50% more energy than the competition.
  id: PowerCellHigh
  suffix: Full
  parent: BasePowerCell
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: high
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 1080
    startingCharge: 1080
  - type: HitscanBatteryAmmoProvider # goob edit - battery hitscan buff
    proto: RedLaser
    fireCost: 135 # 8 shots
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Plastic: 37
      Steel: 50
      Glass: 100
      Gold: 5
    chemicalComposition:
      Zinc: 15

- type: entity
  id: PowerCellHighPrinted
  suffix: Empty
  parent: PowerCellHigh
  components:
  - type: Sprite
    layers:
      - map: [ "enum.PowerCellVisualLayers.Base" ]
        state: high
      - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
        state: o2
        shader: unshaded
        visible: false
  - type: Battery
    maxCharge: 1080
    startingCharge: 0

- type: entity
  name: hyper-capacity power cell
  description: A rechargeable standardized power cell. This iteration pushes the upper limits of portable power storage, boasting 66% more capacity than its predecessor.
  id: PowerCellHyper
  suffix: Full
  parent: BasePowerCell
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: hyper
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 1800
    startingCharge: 1800
  - type: HitscanBatteryAmmoProvider # goob edit - battery hitscan buff
    proto: HeavyRedLaser
    fireCost: 225 # 8 shots

- type: entity
  id: PowerCellHyperPrinted
  suffix: Empty
  parent: PowerCellHyper
  components:
  - type: Sprite
    layers:
      - map: [ "enum.PowerCellVisualLayers.Base" ]
        state: hyper
      - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
        state: o2
        shader: unshaded
        visible: false
  - type: Battery
    maxCharge: 1800
    startingCharge: 0

- type: entity
  parent: BasePowerCell
  id: PowerCellMicroreactor
  name: microreactor power cell
  description: A rechargeable standardized microreactor cell. Has lower capacity but slowly recharges by itself.
  suffix: Full
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: microreactor
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 720
    startingCharge: 720
  - type: BatterySelfRecharger
    autoRecharge: true
    autoRechargeRate: 12 # takes 1 minute to charge itself back to full
    # Goobstation
    canEmp: true
  - type: HitscanBatteryAmmoProvider # goob edit - battery hitscan buff
    proto: MediumRedLaser
    fireCost: 90 # 8 shots
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Steel: 100
      Glass: 75
      Uranium: 25
      Gold: 12
    chemicalComposition:
      Zinc: 20

- type: entity
  parent: PowerCellMicroreactor
  id: PowerCellMicroreactorPrinted
  suffix: Empty
  components:
  - type: Sprite
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: microreactor
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
      visible: false
  - type: Battery
    startingCharge: 0

- type: entity
  name: antique power cell prototype
  description: A small cell that self recharges. Used in old laser arms research.
  id: PowerCellAntiqueProto
  parent: BasePowerCell
  components:
    - type: Sprite
      layers:
      - map: [ "enum.PowerCellVisualLayers.Base" ]
        state: antique
      - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
        state: o2
        shader: unshaded
    - type: Battery
      maxCharge: 1200
      startingCharge: 1200
    - type: BatterySelfRecharger
      autoRecharge: true
      autoRechargeRate: 40
    - type: HitscanBatteryAmmoProvider # goob edit - svalinn buff fix
      proto: RedLaser
      fireCost: 75 # 16 shots

# Power cage (big heavy power cell for big devices)

- type: entity
  id: BasePowerCage
  abstract: true
  parent: BasePowerCell
  components:
  - type: Item
    size: Ginormous
  - type: MultiHandedItem
  - type: SolutionContainerManager
    solutions:
      battery:
        maxVol: 15
  - type: Extractable
    juiceSolution:
      reagents:
        - ReagentId: Zinc
          Quantity: 15
  - type: Tag
    tags:
      - PowerCage
  - type: ClothingSpeedModifier
    walkModifier: 0.8
    sprintModifier: 0.8
  - type: HeldSpeedModifier

- type: entity
  id: PowerCageSmall
  parent: BasePowerCage
  name: small-capacity power cage
  description: A rechargeable power cage for big devices. This is the cheapest kind you can find.
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: small
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 1400
    startingCharge: 1400

- type: entity
  id: PowerCageMedium
  parent: BasePowerCage
  name: medium-capacity power cage
  description: A rechargeable power cage for big devices. The gold standard of capacity and cost.
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: medium
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 2700
    startingCharge: 2700

- type: entity
  id: PowerCageHigh
  parent: BasePowerCage
  name: high-capacity power cage
  description: A rechargeable power cage for big devices. Increased capacity for increased power levels.
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: high
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
  - type: Battery
    maxCharge: 6200
    startingCharge: 6200

- type: entity
  id: PowerCageSmallEmpty
  parent: PowerCageSmall
  suffix: Empty
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: small
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
      visible: false
  - type: Battery
    maxCharge: 1400
    startingCharge: 0

- type: entity
  id: PowerCageMediumEmpty
  parent: PowerCageMedium
  suffix: Empty
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: small
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
      visible: false
  - type: Battery
    startingCharge: 0

- type: entity
  id: PowerCageHighEmpty
  parent: PowerCageHigh
  suffix: Empty
  components:
  - type: Sprite
    sprite: Objects/Power/power_cages.rsi
    layers:
    - map: [ "enum.PowerCellVisualLayers.Base" ]
      state: small
    - map: [ "enum.PowerCellVisualLayers.Unshaded" ]
      state: o2
      shader: unshaded
      visible: false
  - type: Battery
    startingCharge: 0
