- type: entity
  abstract: true
  parent: [SolutionWelder, BaseItem]
  id: BaseLighter
  name: basic 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: Appearance
  - type: Item
    size: Tiny
  - type: UseDelay
  - type: RefillableSolution
    solution: Welder
  - 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
  abstract: true
  parent: [SolutionWelder, SolutionToolVeryTiny]
  id: SolutionLighter
  components:
  - type: Solution
    solution:
      reagents:
      - ReagentId: WeldingFuel
        Quantity: 7.5

- type: entity
  name: basic lighter
  parent: [SolutionLighter, BaseLighter]
  id: Lighter
  description: "A simple plastic cigarette lighter."
  components:
  - 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: 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
    sprite: Objects/Tools/Lighters/lighters.rsi

- type: entity
  name: cheap lighter
  parent: BaseLighter
  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: Welder
    fuelConsumption: 0.02
    fuelLitCost: 0.2

- type: entity
  name: flippo lighter
  parent: BaseBrandedLighter
  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: Item
    sprite: Objects/Tools/Lighters/lighters.rsi
    heldPrefix: zippo
  - 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: zippo-inhand-left-flame
        shader: unshaded
      right:
      - state: zippo-inhand-right-flame
        shader: unshaded
  - type: PointLight
    radius: 1.2 #slightly stronger than the other lighters

- 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: [SolutionToolWelderMini, BaseLighter]
  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: 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: entity
  parent: [BaseBrandedLighter, BaseSyndicateContraband]
  id: SyndicateFlippo
  name: Blood-red flippo
  description: "A 'Valid' choice in lighters. Contains no copper."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/syndielighter.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/syndielighter.rsi
  - type: Welder
    fuelConsumption: 0.005
    fuelLitCost: 0.01
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 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.4
    fuelLitCost: 0.2
    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: entity
  parent: [BaseBrandedLighter, BaseSyndicateContraband]
  id: CybersunFlippo
  name: CyberSun Flippo
  description: "A Sleek black and magenta flippo lighter, bearing the logo and iconography of CyberSun Industries."
  components:
  - type: Sprite
    sprite: Objects/Tools/Lighters/cybersun.rsi
  - type: Item
    sprite: Objects/Tools/Lighters/cybersun.rsi
  - type: Welder #
    fuelConsumption: 0.005
    fuelLitCost: 0.01
    tankSafe: true
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: magenta

- type: entity
  parent: [BaseBrandedLighter, BaseSyndicateContraband]
  id: InterdyneFlippo
  name: Interdyne Flippo
  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.005
    fuelLitCost: 0.01
    tankSafe: true
  - type: ItemToggleMeleeWeapon
    activatedDamage:
        types:
          Radiation: 1
  - type: PointLight
    enabled: false
    netsync: false
    radius: 2
    color: cyan

- type: entity
  parent: [BaseBrandedLighter]
  id: NanotrasenFlippo
  name: Nanotrasen Flippo
  description: "A navy blue luxury flippo, generally handed out to loyal heads of staff instead of a payraise. Fueled with liquid plasma"
  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: Solution
    solution:
      reagents:
      - ReagentId: Plasma
        Quantity: 15

- type: entity
  parent: [SolutionGinormous, 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: Solution
    solution:
      reagents:
      - ReagentId: Plasma
        Quantity: 480
  - 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: Spider-Clan lighter
  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, BaseSyndicateContraband]
  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: SolutionManager
    solutions:
    - SolutionFoodDonkpocketWarm
  - 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: 2
    color: orange
