- 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
      params:
        volume: -0.125
        variation: 0.125
  - type: IgnitionSource
    ignited: false
    temperature: 400.0
  - type: PointLight
    enabled: false
    radius: 1.1
    color: darkorange
  - type: Appearance
  - type: BurnStateVisuals
    unlitIcon: match_unlit
    litIcon: match_lit
    burntIcon: match_burnt

- 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:
  - 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: EntityTableContainerFill
    containers:
      storagebase:
        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 # starcup: removed contraband label
  id: GorlexMatchbox
  name: Gorlex match box
  description: "A pneumatic match box styled after the Gorlex Marauders' equipment. Contains 6 matches." # starcup: corrected number
  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: EntityTableContainerFill
    containers:
      storagebase:
        id: GorlexMatchstick
        amount: 6 # starcup: from 24
  - type: Matchbox

- type: entity
  name: match stick
  parent: Matchstick # starcup: removed contraband label
  id: GorlexMatchstick
  description: A military grade match stick, used for lighting fine smokables and high-yield explosives alike. # starcup: rewritten for tone
  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: 1.1 # starcup: from 3
    color: green
  - type: Matchstick
    duration: 10 # starcup: from 30
