# SPDX-FileCopyrightText: 2025 Arraydeess <arraygitbash@gmail.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: base balloon
  parent: BaseStructureDynamic
  id: BaseBalloon       # Base balloon
  abstract: true # Make sure it doesn't appear
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Fun/balloons.rsi
    state: icon
    drawdepth: Overdoors # just so it renders above spesos
    noRot: True
  - type: Item
    size: Huge
  - type: Damageable
    damageContainer: RubberBalloon # default damage container
  - type: Physics # has dynamic physics
    bodyType: Dynamic
  - type: Penetratable # projectile Able to pierce balloons
    penetrateDamage: 1
    damagePenalty: 0.5
  - type: NpcFactionMember
    factions:
      - Balloon
  - type: InteractionOutline
  - type: Fixtures # give it locker collision
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.25,-0.48,0.25,0.48"
        density: 75
        mask:
          - TabletopMachineMask
        layer:
          - TabletopMachineLayer    # No collision but still able to be shot

# Red Balloon
- type: entity
  name: red balloon
  parent: BaseBalloon
  description: The weakest balloon.
  id: RedBalloon
  components:
  - type: Sprite
    state: red
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
        spawn:
          SpaceCash:
            min: 10
            max: 20
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Blue Balloon
- type: entity
  name: blue balloon
  parent: BaseBalloon
  description: A pretty chill balloon.
  id: BlueBalloon
  components:
  - type: Sprite
    state: blue
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 5
            max: 10
          RedBalloon:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Green Balloon
- type: entity
  name: green balloon
  parent: BaseBalloon
  description: The most strategically minded balloon of the bunch. Capable of planning advanced waves, if only it had a track to follow.
  id: GreenBalloon
  components:
  - type: Sprite
    state: green
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 5
            max: 10
          BlueBalloon:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Yellow Balloon
- type: entity
  name: yellow balloon
  parent: BaseBalloon
  description: The greediest balloon, always flaunting its wealth to the other balloons.
  id: YellowBalloon
  components:
  - type: Sprite
    state: yellow
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 5
            max: 10
          GreenBalloon:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Pink Balloon
- type: entity
  name: pink balloon
  parent: BaseBalloon
  description: The most annoying and insufferable balloon.
  id: PinkBalloon
  components:
  - type: Sprite
    state: pink
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 5
            max: 10
          YellowBalloon:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Black Balloon
- type: entity
  name: black balloon
  parent: BaseBalloon
  description: The edgiest balloon, never grew out of its emo phase. Immune to heat and shock damage!
  id: BlackBalloon
  components:
  - type: Sprite
    state: black
  - type: Damageable
    damageContainer: BlackBalloon
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          PinkBalloon:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
# White Balloon
- type: entity
  name: white balloon
  parent: BaseBalloon
  description: The most emotionless balloon. Isn't even given a proper name, only a purpose. Immune to cold damage!
  id: WhiteBalloon
  components:
  - type: Sprite
    state: white
  - type: Damageable
    damageContainer: WhiteBalloon
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          PinkBalloon:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# Zebra Balloon
- type: entity
  name: zebra balloon
  parent: BaseBalloon
  description: Belongs in a zoo. Immune to all burn damage!
  id: ZebraBalloon
  components:
  - type: Sprite
    state: zebra
  - type: Damageable
    damageContainer: ZebraBalloon
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          WhiteBalloon:
            min: 1
            max: 1
          BlackBalloon:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# steel balloon
- type: entity
  name: steel balloon
  parent: BaseBalloon
  description: The most armored balloon. So feared that even animals don't attack it. Immune to brute damage!
  id: SteelBalloon
  components:
  - type: Sprite
    state: steel
  - type: Damageable        # only damagable via heat
    damageContainer: SteelBalloon
  - type: Penetratable # projectile Able to pierce balloons
    penetrateDamage: 1000
    damagePenalty: 1000
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          BlackBalloon:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# rainbow balloon
- type: entity
  name: rainbow balloon
  parent: BaseBalloon
  description: The most evil balloon of them all. Don't let the pretty colors fool you.
  id: RainbowBalloon
  components:
  - type: Sprite
    state: rainbow
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1           # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          ZebraBalloon:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
        # Bloons 2
- type: entity
  name: carp balloon
  parent: BaseBalloon
  description: Is it a combination of balloon and carp DNA? Or a balloon in a carp suit? Nobody knows.
  id: CeramicBalloon
  components:
  - type: Sprite
    state: carp
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10        # balloon health
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
          params:
            variation: 0.125
            volume: -4
      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
         spawn:
          SpaceCash:
            min: 1
            max: 3
          RainbowBalloon:
            min: 2
            max: 2
      - !type:DoActsBehavior
        acts: [ "Destruction" ]

# This fucking kills server performance
#- type: entity
#  name: dragon zepplin
#  parent: BaseBalloon
#  description: Tier 1 Moab Class Balloon. Summons four carp balloons on death.
#  id: MoabBalloon
#  components:
#  - type: Sprite
#    sprite: _Goobstation/Objects/Fun/moabs.rsi # Had to change RSI due to different pixel dimensions
#    state: dragon
#    noRot: false
#  - type: Transform
#  - type: Rotatable
#  - type: Destructible
#    thresholds:
#    - trigger:
#        !type:DamageTrigger
#        damage: 50     # balloon health, Nerfed asf
#      behaviors:
#      - !type:PlaySoundBehavior
#        sound:
#          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
#          params:
#            variation: 0.125
#            volume: -4
#      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
#         spawn:
#          SpaceCash:
#            min: 1
#            max: 3
#          CeramicBalloon:
#            min: 4
#            max: 4
#      - !type:DoActsBehavior
#        acts: [ "Destruction" ]
#
#- type: entity
#  name: B.R.B.
#  parent: BaseBalloon
#  description: Tier 2 Moab Class Balloon. Stands for Blood Red Balloon.
#  id: BfbBalloon
#  components:
#  - type: Sprite
#    sprite: _Goobstation/Objects/Fun/moabs.rsi # Had to change RSI due to different pixel dimensions
#    state: brb
#    noRot: false
#  - type: Destructible
#    thresholds:
#    - trigger:
#        !type:DamageTrigger
#        damage: 75       # balloon health
#      behaviors:
#      - !type:PlaySoundBehavior
#        sound:
#          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
#          params:
#            variation: 0.125
#            volume: -4
#      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
#         spawn:
#          SpaceCash:
#            min: 1
#            max: 3
#          MoabBalloon:
#            min: 4
#            max: 4
#      - !type:DoActsBehavior
#        acts: [ "Destruction" ]
#
#- type: entity
#  name: Z.O.M.B.
#  parent: BaseBalloon
#  description: Tier 3 Moab Class Balloon. Stands for Zoh Oh Mbee Balloon. The Acronym department was underfunded.
#  id: ZomgBalloon
#  components:
#  - type: Sprite
#    sprite: _Goobstation/Objects/Fun/moabs.rsi # Had to change RSI due to different pixel dimensions
#    state: zomb
#    noRot: false
#  - type: Destructible
#    thresholds:
#    - trigger:
#        !type:DamageTrigger
#        damage: 100       # balloon health
#      behaviors:
#      - !type:PlaySoundBehavior
#        sound:
#          path: /Audio/_Goobstation/BalloonEffect/balloon_pop.ogg
#          params:
#            variation: 0.125
#            volume: -4
#      - !type:SpawnEntitiesBehavior # Balloon Loot and spawn
#         spawn:
#          SpaceCash:
#            min: 1
#            max: 3
#          BfbBalloon:
#            min: 4
#            max: 4
#      - !type:DoActsBehavior
#        acts: [ "Destruction" ]
#
