- type: entity
  name: basic lighter
  parent: BaseItem
  id: Lighter
  description: "A simple plastic cigarette lighter."
  components:
  - type: IgnitionSource
    ignited: false
  - type: ItemToggle
    predictable: false
    soundActivate:
      collection: lighterOnSounds
    soundDeactivate:
      collection: lighterOffSounds
  - type: ItemToggleMeleeWeapon
    activatedDamage:
        types:
            Heat: 1
  - type: ItemToggleSize
    activatedSize: Small
  - type: ItemToggleHot
  - type: Sprite
    sprite: Objects/Tools/Lighters/lighters.rsi
    layers:
    - state: icon_map
    - state: cheap_icon_base
      map: [ "skin" ]
    - state: basic_icon_top
    - state: lighter_flame
      visible: false
      shader: unshaded
      map: [ "flame" ]
  - type: Appearance
  - type: RandomSprite
    available:
      - skin:
          basic_icon_base-1: ""
          basic_icon_base-2: ""
          basic_icon_base-3: ""
          basic_icon_base-4: ""
          basic_icon_base-5: ""
          basic_icon_base-6: ""
          basic_icon_base-7: ""
          basic_icon_base-8: ""
          basic_icon_base-9: ""
          basic_icon_base-10: ""
          basic_icon_base-11: ""
  - type: GenericVisualizer
    visuals:
      enum.ToggleableVisuals.Enabled:
        flame:
          True: { visible: true }
          False: { visible: false }
  - type: ToggleableVisuals
    spriteLayer: lighter_flame
    inhandVisuals:
      left:
      - state: inhand-left-flame
        shader: unshaded
      right:
      - state: inhand-right-flame
        shader: unshaded
  - type: Item
    size: Tiny
    sprite: Objects/Tools/Lighters/lighters.rsi
  - type: UseDelay
  - type: RefillableSolution
    solution: Welder
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 8
        maxVol: 8 #uses less fuel than a welder, so this isnt as bad as it looks
  - type: MeleeWeapon
    wideAnimationRotation: 180
    damage:
      types:
        Blunt: 0
  - type: Welder
    fuelConsumption: 0.01
    fuelLitCost: 0.1
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.1 #smallest possible
    color: orange
  - type: ItemTogglePointLight
  - type: PhysicalComposition

- type: entity
  name: cheap lighter
  parent: Lighter
  id: CheapLighter
  description: "A dangerously inexpensive plastic lighter, don't burn your thumb!"
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/lighters.rsi
    layers:
    - state: icon_map
    - state: cheap_icon_base
      map: [ "skin" ]
    - state: cheap_icon_top
    - state: lighter_flame
      visible: false
      shader: unshaded
      map: [ "flame" ]
  - type: RandomSprite
    available:
      - skin:
          cheap_icon_base: Rainbow
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 4
        maxVol: 4 #uses less fuel than a welder, so this isnt as bad as it looks

- type: entity
  name: flippo lighter
  parent: BaseItem
  id: FlippoLighter
  description: "A rugged metal lighter, lasts quite a while."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/lighters.rsi
    layers:
    - state: zippo_icon_base
      map: ["base"]
    - state: zippo_top
      map: ["top"]
      visible: false
    - state: zippo_open
      map: ["open"]
      visible: false
    - state: lighter_flame
      map: ["flame"]
      visible: false
      shader: unshaded
  - type: ItemToggle
    predictable: false
    soundActivate:
      path: /Audio/Items/Lighters/zippo_open.ogg
      params:
        volume: -5
    soundDeactivate:
      path: /Audio/Items/Lighters/zippo_close.ogg
      params:
        volume: -5
  - type: ItemToggleMeleeWeapon
    activatedDamage:
        types:
            Heat: 1
  - type: ItemToggleSize
    activatedSize: Small
  - type: ItemToggleHot
  - type: Item
    size: Tiny
    sprite: Objects/Tools/Lighters/lighters.rsi
    heldPrefix: zippo
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ToggleableVisuals.Enabled:
        flame:
          True: { visible: true }
          False: { visible: false }
        open:
          True: { visible: true }
          False: { visible: false }
        top:
          True: { visible: true }
          False: { visible: false }
        base:
          True: { visible: false }
          False: { visible: true }
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 12
        maxVol: 12 #uses less fuel than a welder, so this isnt as bad as it looks
  - type: Welder
    fuelConsumption: 0.01
    fuelLitCost: 0.1
    tankSafe: true
  - type: ToggleableVisuals
    spriteLayer: lighter_flame
    inhandVisuals:
      left:
      - state: zippo-inhand-left-flame
        shader: unshaded
      right:
      - state: zippo-inhand-right-flame
        shader: unshaded
  - type: MeleeWeapon
    wideAnimationRotation: 180
    damage:
      types:
        Blunt: 1 # does a little bit of damage on hit when off
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.2 #slightly stronger than the other lighters
    color: orange
  - type: ItemTogglePointLight
  - type: UseDelay
  - type: IgnitionSource
    ignited: false
  - type: Engraveable # Impstation

- type: entity
  name: flippo engraved lighter
  parent: FlippoLighter
  id: FlippoEngravedLighter
  description: "A rugged golden lighter, lasts quite a while. Engravings serve no tactical advantage whatsoever."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/lighters.rsi
    layers:
    - state: zippo_engraved_icon_base
      map: ["base"]
    - state: zippo_top
      map: ["top"]
      visible: false
    - state: zippo_engraved_open
      map: ["open"]
      visible: false
    - state: lighter_flame
      map: ["flame"]
      visible: false
      shader: unshaded
  - type: StealTarget
    stealGroup: FlippoEngravedLighter

- type: entity
  abstract: true
  parent: BaseItem
  id: BaseBrandedLighter
  components:
  - type: ItemToggle
    predictable: false
    soundActivate:
      path: /Audio/Items/Lighters/zippo_open.ogg
      params:
        volume: -5
    soundDeactivate:
      path: /Audio/Items/Lighters/zippo_close.ogg
      params:
        volume: -5
  - type: ItemToggleMeleeWeapon
    activatedDamage:
        types:
            Heat: 1
  - type: ItemToggleSize
    activatedSize: Small
  - type: ItemToggleHot
  - type: Item
    size: Tiny
  - type: Appearance
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 12
        maxVol: 12
  - type: Sprite
    layers:
    - state: icon
      map: [ "base" ]
    - state: top
      map: [ "top" ]
      visible: false
    - state: open
      map: [ "open" ]
      visible: false
    - state: flame
      map: [ "flame" ]
      visible: false
      shader: unshaded
  - type: GenericVisualizer
    visuals:
      enum.ToggleableVisuals.Enabled:
        flame:
          True: { visible: true }
          False: { visible: false }
        open:
          True: { visible: true }
          False: { visible: false }
        top:
          True: { visible: true }
          False: { visible: false }
        base:
          True: { visible: false }
          False: { visible: true }
  - type: ToggleableVisuals
    spriteLayer: lighter_flame
    inhandVisuals:
      left:
      - state: inhand-left-lit
        shader: unshaded
      right:
      - state: inhand-right-lit
        shader: unshaded
  - type: ItemTogglePointLight
  - type: UseDelay
  - type: IgnitionSource
    ignited: false
  - type: Engraveable # starcup

- type: entity
  parent: BaseBrandedLighter # starcup: removed contraband label
  id: SyndicateFlippo
  name: Syndicate flippo # starcup: Blood-red > Syndicate
  description: Represent your employers at SyndComm as easily as a flick of the wrist! # starcup: rewritten for tone
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/syndielighter.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/syndielighter.rsi
  - type: Welder
    fuelConsumption: 0.01 # starcup: from 0.005
    fuelLitCost: 0.1 # starcup: from 0.01
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.2 # starcup: from 2
    color: green

- type: entity
  parent: Lighter
  id: DiscountDanLighter
  name: Discount Dan's lighter
  description: "The worst lighter ever produced, lighterburn is inevitable, do not refuel while lit."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/lighters.rsi
    layers:
    - state: icon_map
    - state: discount_icon_base
      map: [ "skin" ]
    - state: basic_icon_top
    - state: lighter_flame
      visible: false
      shader: unshaded
      map: [ "flame" ]
  - type: Welder # the single worst lighter invented by mankind
    fuelConsumption: 0.2
    fuelLitCost: 0.1
    tankSafe: false
  - type: Item
    sprite: Objects/Tools/Lighters/lighters.rsi
  - type: ToggleableVisuals
    spriteLayer: lighter_flame
    inhandVisuals:
      left:
      - state: inhand-left-flame
        shader: unshaded
      right:
      - state: inhand-right-flame
        shader: unshaded
  - type: RandomSprite
    available:
      - skin:
          discount_icon_base: ""
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.5
    color: yellow
  - type: ComponentToggler
    components:
    - type: DamageOnHolding
      damage:
        types:
          Heat: 2
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 3
        maxVol: 3

- type: entity
  parent: BaseBrandedLighter # starcup: removed contraband label
  id: CybersunFlippo
  name: Cybersun flippo # starcup: capitalization corrections
  description: "A Sleek black and magenta flippo lighter, bearing the logo and iconography of Cybersun Industries." # starcup: capitalization correction
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/cybersun.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/cybersun.rsi
  - type: Welder
    fuelConsumption: 0.01 # starcup: from 0.005
    fuelLitCost: 0.1 # starcup: from 0.01
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.2 # starcup: from 2
    color: magenta

- type: entity
  parent: BaseBrandedLighter # starcup: removed contraband label
  id: InterdyneFlippo
  name: Interdyne flippo # starcup: capitalization corrections
  description: "A deep blue flippo lighter, decorated with the logo of Interdyne Pharmaceuticals' 'Gene Clean' clinics. Become the master of your own cigarette."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/interdyne.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/interdyne.rsi
  - type: Welder
    fuelConsumption: 0.01 # starcup: from 0.005
    fuelLitCost: 0.1 # starcup: from 0.01
    tankSafe: true
  # begin starcup: remove radiation damage
  # - type: ItemToggleMeleeWeapon
  #   activatedDamage:
  #       types:
  #         Radiation: 1
  # end starcup
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.2 # starcup: from 2
    color: cyan

- type: entity
  parent: [BaseBrandedLighter, BaseTraitorContraband ] # starcup: added contraband label
  id: NanotrasenFlippo
  name: NanoTrasen flippo # starcup: capitalization corrections
  description: A navy blue luxury lighter. Fueled by liquid plasma, to show just how much of it NanoTrasen has to go around. # starcup: rewritten for setting lore
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/nanotrasen.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/nanotrasen.rsi
  - type: Welder
    fuelConsumption: 0.005
    fuelLitCost: 1
    fuelReagent: Plasma
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: blue
  - type: RefillableSolution
    solution: Welder
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: Plasma
          Quantity: 10
        maxVol: 10

- type: entity
  parent: [BaseBrandedLighter, BaseCentcommContraband]
  id: CentCommFlippo
  name: Gilded CentComm Flippo
  description: "An Ornate, jade embossed and gilded flippo frame containing a bluespace powered jet. The latch is secured by a miniature access reader that only responds to CentComm officials. The nicest lighter known to man."
  suffix: DO NOT MAP
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/centcomm.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/centcomm.rsi
  - type: ItemToggleRequiresLock
    requireLocked: false
  - type: Welder #
    fuelConsumption: 0.0
    fuelLitCost: 10
    fuelReagent: Plasma
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 4 #Excessively powerful
    color: Gold
  - type: RefillableSolution
    solution: Welder
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: Plasma
          Quantity: 999
        maxVol: 999
  - type: Tool
    useSound:
      collection: Welder
    qualities: Welding
  - type: SolutionRegeneration
    solution: Welder
    generated:
      reagents:
      - ReagentId: Plasma
        Quantity: 0.1
  - type: Lock
  - type: AccessReader
    access: [["CentralCommand"]]

- type: entity
  parent: [BaseBrandedLighter, BaseMajorContraband]
  id: SpiderclanFlippo
  name: Renegade lighter # starcup: renamed for setting lore
  description: "A high tech jet lighter, engineered to function even in deep space. Runs on a tiny microfusion cell."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/spiderclan.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/spiderclan.rsi
  - type: Welder
    fuelConsumption: 0
    fuelLitCost: 0
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: green

- type: entity
  parent: [BaseBrandedLighter, BaseTraitorContraband] # starcup: syndicate contraband to traitor
  id: WaffleCoFlippo
  name: Waffle Co. flippo
  description: "A robust mass produced lighter. The Waffle Co. logo turns the spark wheel when pushed up, minimising risk of lighter burns for even the most inept user."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/waffleco.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/waffleco.rsi
  - type: Welder
    fuelConsumption: 0.005
    fuelLitCost: 0.05
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: brown

- type: entity
  parent: [BaseBrandedLighter]
  id: HonkCoFlippo
  name: Honk Co. flippo
  description: "A slippery gag lighter produced by Honk Co. hidden inside of a real banana peel."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/honkco.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/honkco.rsi
  - type: ComponentToggler # This is super cursed and ends up deleting the fixtures when toggled off
    components:
    - type: Slippery
    - type: StepTrigger
      intersectRatio: 0.2
    - type: CollisionWake
      enabled: false
    - type: Physics
      bodyType: Dynamic
    - type: Fixtures
      fixtures:
        slips:
          shape:
            !type:PhysShapeAabb
            bounds: "-0.4,-0.3,0.4,0.3"
          layer:
          - SlipLayer
          hard: false
        fix1:
          shape:
            !type:PhysShapeAabb
            bounds: "-0.4,-0.3,0.4,0.3"
          density: 10
          mask:
          - ItemMask
  - type: Welder #
    fuelConsumption: 0.1
    fuelLitCost: 1
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: yellow

- type: entity
  parent: [BaseBrandedLighter]
  id: DonkcoLighter
  name: Donk Co. flippo
  description: "The flippo of choice for the seasoned traitor. A Breaded novelty lighter made by Donk Co. Somehow edible while lit."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/donkco.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/donkco.rsi
  - type: Welder
    fuelConsumption: 0.02
    fuelLitCost: 0.1
    tankSafe: true
  - type: Tag
    tags:
    - DonkPocket
    - Meat
  - type: SolutionContainerManager
    solutions:
      Welder:
        reagents:
        - ReagentId: WeldingFuel
          Quantity: 12
        maxVol: 12
      food:
        maxVol: 10 # starcup: from 20
        reagents:
        - ReagentId: Nutriment
          Quantity: 10
        #- ReagentId: Omnizine # starcup: remove omnizine
        #  Quantity: 10
  - type: FlavorProfile
    flavors:
    - bread
    - meaty
    - cheap
  - type: ComponentToggler
    components:
    - type: Edible # This shouldn't be component toggler, but doesn't work when it's not
  - type: PointLight
    enabled: false
    netsync: false
    radius: 1.2 # starcup: from 2
    color: orange
