# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Ygg01 <y.laughing.man.y@gmail.com>
# SPDX-FileCopyrightText: 2022 Fishfish458 <47410468+Fishfish458@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2022 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2022 OctoRocket <88291550+OctoRocket@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 fishfish458 <fishfish458>
# SPDX-FileCopyrightText: 2022 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 metalgearsloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2023 Bixkitts <72874643+Bixkitts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 lapatison <100279397+lapatison@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Helm4142 <158806576+Helm4142@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Helm4142 <Helm4142@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: SmallboxItem
  parent: BaseStorageItem
  abstract: true
  components:
  - type: Storage
    grid:
    - 0,0,6,1
  - type: Item
    size: Small

- type: entity
  name: match stick
  parent: BaseItem
  id: Matchstick
  description: A simple match stick, used for lighting fine smokables.
  components:
  - type: Tag
    tags:
    - Matchstick
    - Trash
  - type: SpaceGarbage
  - type: Sprite
    sprite: Objects/Tools/matches.rsi
    layers:
      - state: match_unlit
  - type: Item
    sprite: Objects/Tools/matches.rsi
    heldPrefix: unlit
    size: Tiny
  - type: Matchstick
    duration: 10
    igniteSound:
      path: /Audio/Items/match_strike.ogg
  - type: PointLight
    enabled: false
    radius: 1.1
    color: darkorange
  - type: Appearance
  - type: BurnStateVisuals
    unlitIcon: match_unlit
    litIcon: match_lit
    burntIcon: match_burnt
  - type: Cautery # Shitmed
    speed: 0.2
  - type: SurgeryTool # Shitmed
    startSound:
      path: /Audio/Weapons/Guns/Hits/energy_meat1.ogg
    endSound:
      path: /Audio/Weapons/Guns/Hits/energy_meat1.ogg
  - type: Tool #Goob
    qualities:
    - Ignition

- type: entity
  parent: Matchstick
  id: MatchstickSpent
  suffix: spent
  components:
  - type: Sprite
    layers:
      - state: match_burnt
  - type: Matchstick
    state: Burnt

- type: entity
  name: match box
  parent: [ SmallboxItem, BaseBagOpenClose ]
  id: Matchbox
  description: A small box of Almost But Not Quite Plasma Premium Matches.
  components:
  # Goobstation edit start
  - type: EmitSoundOnPickup
    sound:
      path: /Audio/_Goobstation/Items/handling/matchbox_pickup.ogg
  - type: EmitSoundOnDrop
    sound:
      path: /Audio/Items/matchbox_drop.ogg
  - type: EmitSoundOnCollide
    sound:
      path: /Audio/_Goobstation/Items/handling/matchbox_drop.ogg
  - type: EmitSoundOnUse
    sound:
      path: /Audio/_Goobstation/Items/handling/matchbox_use.ogg
  # Goobstation edit end
  - type: EmitSoundOnLand
    sound:
      path: /Audio/Items/matchbox_drop.ogg
  - type: Matchbox
  - type: Sprite
    sprite: Objects/Tools/matches.rsi
    layers:
    - state: matchbox
    - state: matchbox-open
      map: ["openLayer"]
    - state: matchbox1
      map: ["matchbox1"]
      visible: false
    - state: matchbox2
      map: ["matchbox2"]
      visible: false
    - state: matchbox3
      map: ["matchbox3"]
      visible: false
  - type: Item
    sprite: Objects/Tools/matches.rsi
    heldPrefix: matchbox
    size: Small
  - type: Storage
    grid:
    - 0,0,2,1
  - type: StorageFill
    contents:
      - id: Matchstick
        amount: 6
  - type: ItemCounter
    count:
      tags: [Matchstick]
    composite: true
    layerStates:
    - matchbox1
    - matchbox2
    - matchbox3
  - type: Appearance
  - type: Tag
    tags:
    - Trash
  - type: SpaceGarbage

- type: entity
  parent: [Matchbox, BaseSyndicateContraband]
  id: GorlexMatchbox
  name: Gorlex match box
  description: "A pneumatic match box styled after the Gorlex Marauders' equipment. Contains 24 matches."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/gorlex.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/gorlex.rsi
  - type: Storage
    grid:
    - 0,0,11,1
  - type: StorageFill
    contents:
      - id: GorlexMatchstick
        amount: 24
  - type: Matchbox

- type: entity
  name: match stick
  parent: [Matchstick, BaseSyndicateContraband]
  id: GorlexMatchstick
  description: A military grade match stick, used for lighting fine smokables and noncombatants alike.
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/gorlexmatch.rsi
    layers:
      - state: match_unlit
  - type: Item
    sprite: Objects/Tools/Lighters/gorlexmatch.rsi
    heldPrefix: unlit
    size: Tiny
  - type: PointLight
    enabled: false
    radius: 3
    color: green
  - type: Matchstick
    duration: 30
  - type: ScannableForPoints # goob edit
    points: 1
