- type: entity
  name: lantern
  parent: BaseItem
  id: BaseLamp
  abstract: true
  components:
  - type: HandheldLight
    addPrefix: true
    toggleAction:
      name: action-name-toggle-light
      description: action-description-toggle-light
      icon: Objects/Tools/flashlight.rsi/flashlight.png
      iconOn: Objects/Tools/flashlight.rsi/flashlight-on.png
      event: !type:ToggleActionEvent
  - type: PowerCellSlot
  - type: Sprite
    sprite: Objects/Misc/Lights/lights.rsi
    netsync: false
  - type: Item
    sprite: Objects/Misc/Lights/lights.rsi

- type: entity
  name: lamp
  id: Lamp
  parent: BaseLamp
  description: A light emitting device.
  components:
  - type: Sprite
    sprite: Objects/Misc/Lights/lamp.rsi
    layers:
      - state: lamp
      - state: lamp-on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Item
    sprite: Objects/Misc/Lights/lamp.rsi
  - type: PointLight
    enabled: false
    radius: 3
    energy: 2
  - type: Appearance
    visuals:
      - type: FlashLightVisualizer

- type: entity
  name: banana lamp
  id: LampBanana
  parent: BaseLamp
  description: A light emitting device, shaped like a banana.
  components:
  - type: Sprite
    layers:
      - state: bananalamp
      - state: bananalamp_on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: PointLight
    enabled: false
    radius: 3
    energy: 2
  - type: Appearance
    visuals:
      - type: FlashLightVisualizer

- type: entity
  name: desk lamp
  id: LampGold
  parent: BaseLamp
  description: A light emitting device that would look great on a desk.
  components:
  - type: Sprite
    sprite: Objects/Misc/Lights/lampgreen.rsi
    layers:
      - state: lampgreen
      - state: lampgreen-on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Item
    sprite: Objects/Misc/Lights/lampgreen.rsi
  - type: PointLight
    enabled: false
    radius: 3
    energy: 2
  - type: Appearance
    visuals:
      - type: FlashLightVisualizer

- type: entity
  name: floodlight
  id: Floodlight
  parent: BaseLamp
  description: A pole with powerful mounted lights on it.
  components:
  - type: Sprite
    layers:
      - state: floodlight
      - state: floodlight_on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Physics
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.2, -0.5, 0.2, 0.5"
      mass: 20
      mask:
      - Impassable
      layer:
      - Opaque
      - Impassable
  - type: PointLight
    enabled: false
    radius: 8
    energy: 5
  - type: Anchorable
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/glass_break1.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          FloodlightBroken:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Appearance
    visuals:
      - type: FlashLightVisualizer

- type: entity
  name: broken floodlight
  id: FloodlightBroken
  parent: BaseItem
  description: A pole with powerful mounted lights on it. It's broken.
  components:
  - type: Sprite
    sprite: Objects/Misc/Lights/lights.rsi
    state: floodlight_broken
  - type: Anchorable
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/metalbreak.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Physics
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb {}
      layer:
      - Opaque
      - Impassable
      - MobImpassable
      - VaultImpassable
      - SmallImpassable
