# SPDX-FileCopyrightText: 2022 Chris V <HoofedEar@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Moony <moonheart08@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2022 router <konstttantin@gmail.com>
# SPDX-FileCopyrightText: 2023 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 Agoichi <92464780+Agoichi@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <60073468+Psychpsyo@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 Arraydeess <arraygitbash@gmail.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-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseItem
  id: SpaceCash
  name: spesos
  description: You gotta have money.
  components:
  - type: Cash
  - type: Item
    shape:
    - 0,0,1,0
    storedOffset: 0,-2
  - type: Material
  - type: PhysicalComposition
    materialComposition:
      Credit: 1
  - type: StaticPrice
    price: 0
  - type: Stack
    stackType: Credit
    count: 1
    baseLayer: base
    layerStates:
    - cash
    - cash_10
    - cash_100
    - cash_500
    - cash_1000
    - cash_5000
    - cash_10000
    - cash_25000
    - cash_50000
    - cash_100000
    - cash_1000000
    layerFunction: Threshold
  - type: StackLayerThreshold
    thresholds: [10, 100, 500, 1000, 5000, 10000, 25000, 50000, 100000, 1000000]
  - type: Sprite
    sprite: Objects/Economy/cash.rsi
    state: cash
    layers:
    - state: cash
      map: ["base"]
  - type: Physics
    bodyType: Dynamic
  - type: Fixtures
    fixtures:
      fix1:
        density: 30
        shape:
          !type:PhysShapeAabb
          bounds: "-0.35,-0.2,0.25,0.1"
        mask:
        - ItemMask
  - type: Appearance
  # <Goobstation>
  - type: Flammable # it's about sending a message
    fireSpread: true
    alwaysCombustible: true
    firestackFade: 0 # keeps burning since high hp
    damage:
      types:
        Heat: 0.5 # burns long
  - type: FireVisuals
    sprite: Effects/fire.rsi
    normalState: fire
  - type: Damageable
    damageModifierSet: Wood
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 30
      behaviors:
      # doesn't spawn anything for probably obvious reasons
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Food
    solution: food
    delay: 1
    forceFeedDelay: 1
  - type: FlavorProfile
    flavors:
    - paper
  - type: BadFood
  - type: SolutionContainerManager
    solutions:
      food:
        maxVol: 1
        reagents:
        - ReagentId: Fiber
          Quantity: 1
  - type: Tag       # Goob Balloon Edit
    tags:           # Just so it can be picked up by ore bag
    - Ore
    - Paper         # Moth food
  # </Goobstation>

- type: material
  id: Credit
  name: speso
  unit: materials-unit-bill
  stackEntity: SpaceCash
  icon: { sprite: /Textures/Objects/Economy/cash.rsi, state: cash }
  price: 1

- type: stack
  id: Credit
  name: stack-credit
  icon: { sprite: /Textures/Objects/Economy/cash.rsi, state: cash }
  spawn: SpaceCash

- type: entity
  parent: SpaceCash
  id: SpaceCash10
  suffix: 10
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_10
  - type: Stack
    count: 10

- type: entity
  parent: SpaceCash
  id: SpaceCash100
  suffix: 100
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_100
  - type: Stack
    count: 100

- type: entity
  parent: SpaceCash
  id: SpaceCash500
  suffix: 500
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_500
  - type: Stack
    count: 500

- type: entity
  parent: SpaceCash
  id: SpaceCash1000
  suffix: 1000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_1000
  - type: Stack
    count: 1000

- type: entity
  parent: SpaceCash
  id: SpaceCash2500
  suffix: 2500
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_1000
  - type: Stack
    count: 2500

- type: entity
  parent: SpaceCash
  id: SpaceCash5000
  suffix: 5000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_5000
  - type: Stack
    count: 5000

- type: entity
  parent: SpaceCash
  id: SpaceCash10000
  suffix: 10000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_10000
  - type: Stack
    count: 10000

- type: entity
  parent: SpaceCash
  id: SpaceCash20000
  suffix: 20000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_10000
  - type: Stack
    count: 20000

- type: entity
  parent: SpaceCash
  id: SpaceCash30000
  suffix: 30000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_25000
  - type: Stack
    count: 30000

- type: entity
  parent: SpaceCash
  id: SpaceCash1000000
  suffix: 1000000
  components:
  - type: Icon
    sprite: Objects/Economy/cash.rsi
    state: cash_1000000
  - type: Stack
    count: 1000000
