# SPDX-FileCopyrightText: 2023 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Morb <14136326+Morb0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 OttoMaticode <124523848+OttoMaticode@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 brainfood1183 <113240905+brainfood1183@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 crazybrain23 <44417085+crazybrain23@users.noreply.github.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 Aviu00 <93730715+Aviu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Jophire <36978900+Jophire@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 LittleNyanCat <littlenyancat204@gmail.com>
# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 NULL882 <gost6865@yandex.ru>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ScyronX <166930367+ScyronX@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Tayrtahn <tayrtahn@gmail.com>
# SPDX-FileCopyrightText: 2024 Token <esil.bektay@yandex.com>
# SPDX-FileCopyrightText: 2024 coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deepdarkdepths <155149356+deepdarkdepths@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.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-FileCopyrightText: 2025 Steve <marlumpy@gmail.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <linebarrelerenthusiast@gmail.com>
# SPDX-FileCopyrightText: 2025 marc-pelletier <113944176+marc-pelletier@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseMech
  save: false
  abstract: true
  components:
  - type: MobMover
  - type: Mech
    pilotBlacklist: # Goobstation Change
      components:
      - Zombie
      - ZombieBlob
  - type: MechAir
  - type: AirFilter
    # everything except oxygen and nitrogen
    gases:
    - CarbonDioxide
    - Plasma
    - Tritium
    - WaterVapor
    - Ammonia
    - NitrousOxide
    - Frezon
    #- Helium3 TODO: fusion
    # <Goobstation> - healium not included for ADVANCED mech trolling
    - BZ
    - Nitrium
    # </Goobstation>
    # remove everything except oxygen to maintain oxygen ratio
    overflowGases:
    - Nitrogen
    - CarbonDioxide
    - Plasma
    - Tritium
    - WaterVapor
    - Ammonia
    - NitrousOxide
    - Frezon
    #- Helium3 TODO: fusion
    # <Goobstation>
    - BZ
    - Healium
    - Nitrium
    - Pluoxium
    # </Goobstation>
  - type: AirIntake
  # for intake and filter to work
  - type: AtmosDevice
    requireAnchored: false
    joinSystem: true
  - type: DoAfter
  - type: Repairable
    fuelCost: 25
    doAfterDelay: 10
  - type: UserInterface
    interfaces:
      enum.MechUiKey.Key:
        type: MechBoundUserInterface
  - type: MeleeWeapon
    canWideSwing: false
    hidden: true
    attackRate: 0.75
    damage:
      types:
        Blunt: 25 #thwack
        Structural: 20
    soundHit:
      collection: MetalThud
  - type: Puller
    needsHands: false
  - type: InputMover
  - type: InteractionOutline
  - type: MovementSpeedModifier
    baseWalkSpeed: 1
    baseSprintSpeed: 1 #Goobedit
  - type: Tag
    tags:
    - DoorBumpOpener
    - FootstepSound
  - type: Pullable
  - type: Physics
    bodyType: KinematicController
  - type: Clickable
  - type: WiresPanel
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.45
        density: 1000
        mask:
        - MobMask
        layer:
        - MobLayer
  - type: Appearance
  - type: ContainerContainer
    containers:
      mech-pilot-slot: !type:ContainerSlot
      mech-equipment-container: !type:Container
      mech-battery-slot: !type:ContainerSlot
      paper_label: !type:ContainerSlot # Goobstation
  - type: Damageable
    damageContainer: Silicon # Goobstation
    damageModifierSet: LightArmor # Goobstation
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/Mecha/mechmove03.ogg
  - type: GuideHelp
    guides:
    - Robotics
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 1000 # Goobstation
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:ChangeConstructionNodeBehavior
        node: start
      - !type:DoActsBehavior
        acts: ["Destruction"]
  # Goobstation Change Start
  - type: UnpoweredFlashlight # Goobstation mech lights for all mechs its unpowered to match hardsuits
  - type: PointLight
    enabled: false
    softness: 5
    autoRot: true
    mask: /Textures/Effects/LightMasks/cone.png
    radius: 7
    energy: 3
    netsync: false
  - type: GenericVisualizer
    visuals:
      enum.PaperLabelVisuals.HasLabel:
        enum.PaperLabelVisuals.Layer:
          True: { visible: true }
          False: { visible: false }
      enum.PaperLabelVisuals.LabelType:
        enum.PaperLabelVisuals.Layer:
          Paper: { state: paper }
          Bounty: { state: bounty }
          CaptainsPaper: { state: captains_paper }
          Invoice: { state: invoice }
  - type: PaperLabel
    labelSlot:
      insertVerbText: Attach Label
      ejectVerbText: Remove Label
      whitelist:
        components:
        - Paper
      blacklist:
        tags:
        - Book
  - type: StaticPrice
    price: 450
  - type: DragDropTargetable
  # Goobstation Change End

- type: entity
  id: MechRipley
  parent: [ BaseMech, IndustrialMech, BaseCargoContraband ] # Goobstation
  name: Ripley APLU
  description: Versatile and lightly armored, the Ripley is useful for almost any heavy work scenario. The "APLU" stands for Autonomous Power Loading Unit.
  components:
  - type: Sprite
    drawdepth: Mobs
    noRot: true
    sprite: Objects/Specific/Mech/mecha.rsi
    layers:
    - map: [ "enum.MechVisualLayers.Base" ]
      state: ripley
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/Mecha/sound_mecha_powerloader_step.ogg
  - type: Mech
    baseState: ripley
    openState: ripley-open
    brokenState: ripley-broken
    mechToPilotDamageMultiplier: 0.75
    pilotWhitelist:
      components:
        - HumanoidAppearance
  - type: MeleeWeapon
    hidden: true
    attackRate: 1
    damage:
      types:
        Blunt: 25 # Goobstation - Make ripley punch hard
        Structural: 30 # Goobstation - Make ripley punch hard
  - type: MovementSpeedModifier
    baseWalkSpeed: 2.25
    baseSprintSpeed: 2.25 #Goobedit

- type: entity
  id: MechRipleyBattery
  parent: MechRipley
  suffix: Battery
  components:
  - type: ContainerFill
    containers:
      mech-battery-slot:
      - PowerCellHigh

- type: entity
  parent: [ BaseMech, SpecialMech, BaseCivilianContraband ] # Goobstation
  id: MechHonker
  name: H.O.N.K.
  description: "Produced by \"Tyranny of Honk, INC\", this exosuit is designed as heavy clown-support. Used to spread the fun and joy of life. HONK!"
  components:
  - type: Sprite
    drawdepth: Mobs
    noRot: true
    sprite: Objects/Specific/Mech/mecha.rsi
    layers:
    - map: [ "enum.MechVisualLayers.Base" ]
      state: honker
  - type: FootstepModifier
    footstepSoundCollection:
      collection: FootstepClown
      params:
        variation: 0.17
  - type: MovementSpeedModifier
    baseWalkSpeed: 2
    baseSprintSpeed: 2.5 #Goobedit
  - type: Mech
    baseState: honker
    openState: honker-open
    brokenState: honker-broken
    mechToPilotDamageMultiplier: 0.5
    airtight: true # Goobstation - Space Honk is real.
    pilotWhitelist:
      components:
      - HumanoidAppearance

- type: entity
  parent: MechHonker
  id: MechHonkerBattery
  suffix: Battery
  components:
  - type: ContainerFill
    containers:
      mech-battery-slot:
      - PowerCellHigh

- type: entity
  parent: [ BaseMech, SmallMech ] # Goobstation
  id: MechHamtr
  name: HAMTR
  description: "An experimental mech which uses a brain–computer interface to connect directly to a hamsters brain."
  components:
  - type: Sprite
    drawdepth: Mobs
    noRot: true
    sprite: Objects/Specific/Mech/mecha.rsi
    layers:
    - map: [ "enum.MechVisualLayers.Base" ]
      state: hamtr
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/Mecha/sound_mecha_powerloader_step.ogg
  - type: Mech
    baseState: hamtr
    openState: hamtr-open
    brokenState: hamtr-broken
    mechToPilotDamageMultiplier: 0.2
    maxEquipmentAmount: 2
    airtight: true
    pilotWhitelist:
      tags:
      - Hamster
  - type: MeleeWeapon
    hidden: true
    attackRate: 0.8
    damage:
      types:
        Blunt: 10 #thwack
        Structural: 2
  - type: MovementSpeedModifier
    baseWalkSpeed: 2.4
    baseSprintSpeed: 2.4 #Goobedit

- type: entity
  parent: MechHamtr
  id: MechHamtrBattery
  suffix: Battery
  components:
  - type: ContainerFill
    containers:
      mech-battery-slot:
      - PowerCellHigh

# Vim!!!!!!!

- type: entity
  parent: BaseMech
  id: MechVim
  name: Vim
  description: A miniature exosuit from Nanotrasen, developed to let the irreplaceable station pets live a little longer.
  components:
  - type: Sprite
    drawdepth: Mobs
    noRot: true
    sprite: Objects/Specific/Mech/mecha.rsi
    layers:
    - map: [ "enum.MechVisualLayers.Base" ]
      state: vim
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeCircle
          radius: 0.15
        density: 80
        mask:
        - MobMask
        layer:
        - MobLayer
  - type: FootstepModifier
    footstepSoundCollection:
      path: /Audio/Mecha/mechmove03.ogg
      params:
        volume: -10
  - type: Mech
    baseState: vim
    openState: vim-open
    brokenState: vim-broken
    maxEquipmentAmount: 0
    # keep mouse safe
    mechToPilotDamageMultiplier: 0.1
    airtight: true
    pilotWhitelist:
      tags:
      - VimPilot
  - type: MeleeWeapon
    hidden: true
    attackRate: 0.8
    damage:
      types:
        Blunt: 10 #thwack
        Structural: 2
  - type: MovementSpeedModifier
    baseWalkSpeed: 2.25
    baseSprintSpeed: 2.25 #Goobedit
  - type: Access
    tags:
    - Maintenance
  # TOOD: buzz / chime actions
  # TODO: builtin flashlight

- type: entity
  parent: MechVim
  id: MechVimBattery
  suffix: Battery
  components:
  - type: ContainerFill
    containers:
      mech-battery-slot:
      - PowerCellHigh
