# SPDX-FileCopyrightText: 2020 Peter Wedder <burneddi@gmail.com>
# SPDX-FileCopyrightText: 2020 V�ctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 Ygg01 <daniel.fath7@gmail.com>
# SPDX-FileCopyrightText: 2020 chairbender <kwhipke1@gmail.com>
# SPDX-FileCopyrightText: 2021 Galactic Chimp <GalacticChimpanzee@gmail.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Paul Ritter <ritter.paul1@googlemail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Francesco <frafonia@gmail.com>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Nairod <110078045+Nairodian@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 mirrorcult <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2023 Cody ~ Aexxie <125095677+Aexxie@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Colin-Tel <113523727+Colin-Tel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Maxim T <93572548+FoxHorn@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CaasGit <87243814+CaasGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hrosts <35345601+Hrosts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 I.K <45953835+notquitehadouken@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ian <ignaz.k@live.de>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Joel Zimmerman <JoelZimmerman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Justin Pfeifler <jrpl101998@gmail.com>
# SPDX-FileCopyrightText: 2024 Kara <lunarautomaton6@gmail.com>
# SPDX-FileCopyrightText: 2024 Ko4ergaPunk <62609550+Ko4ergaPunk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kukutis96513 <146854220+Kukutis96513@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Lye <128915833+Lyroth001@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MerrytheManokit <167581110+MerrytheManokit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MureixloI <132683811+MureixloI@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 NakataRin <45946146+NakataRin@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 OrangeMoronage9622 <whyteterry0092@gmail.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Preston Smith <92108534+thetolbean@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Repo <47093363+Titian3@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Stalen <33173619+stalengd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TakoDragon <69509841+BackeTako@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TsjipTsjip <19798667+TsjipTsjip@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ubaser <134914314+UbaserB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Unkn0wn_Gh0st <shadowstalkermll@gmail.com>
# SPDX-FileCopyrightText: 2024 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2024 Vigers Ray <60344369+VigersRay@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 dffdff2423 <dffdff2423@gmail.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 foboscheshir <156405958+foboscheshir@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 shamp <140359015+shampunj@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 strO0pwafel <153459934+strO0pwafel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stroopwafel <j.o.luijkx@student.tudelft.nl>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 to4no_fix <156101927+chavonadelal@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 voidnull000 <18663194+voidnull000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 BramvanZijp <56019239+BramvanZijp@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX-7 <92227810+SX-7@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 SX_7 <sn1.test.preria.2002@gmail.com>
# SPDX-FileCopyrightText: 2025 Theodore Lukin <66275205+pheenty@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  name: lantern
  parent: BaseItem
  id: BaseLamp
  abstract: true
  components:
  - type: HandheldLight
    addPrefix: true
    blinkingBehaviourId: blinking
    radiatingBehaviourId: radiating
  - type: LightBehaviour
    behaviours:
      - !type:FadeBehaviour
        id: radiating
        maxDuration: 2.0
        startValue: 3.0
        endValue: 2.0
        isLooped: true
        reverseWhenFinished: true
      - !type:PulseBehaviour
        id: blinking
        interpolate: Nearest
        maxDuration: 1.0
        startValue: 0.1
        endValue: 2.0
        isLooped: true
  - type: PowerCellSlot
    cellSlotId: cell_slot
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellSmall
  - type: ContainerContainer
    containers:
      cell_slot: !type:ContainerSlot
  - type: Sprite
    sprite: Objects/Misc/Lights/lights.rsi
  - type: Item
    sprite: Objects/Misc/Lights/lights.rsi
    size: Normal
    heldPrefix: off
  - type: PointLight
    enabled: false
    radius: 3
    energy: 2
    netsync: false
  - type: ToggleableVisuals
    spriteLayer: light
  - type: ItemTogglePointLight
  - type: Appearance
  - type: Physics
    canCollide: false
  - type: StealTarget
    stealGroup: LAMP

- 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
        map: [ "base" ]
      - state: lamp-on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Item
    sprite: Objects/Misc/Lights/lamp.rsi
  - type: HolidayVisuals
    holidays:
      festive:
      - FestiveSeason
  - type: GenericVisualizer
    visuals:
      enum.HolidayVisuals.Holiday:
        base:
          festive: { state: christmaslamp }
        light:
          festive: { state: christmaslamp-on }

- 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: 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
        map: [ "base" ]
      - state: lampgreen-on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Item
    sprite: Objects/Misc/Lights/lampgreen.rsi
  - type: HolidayVisuals
    holidays:
      festive:
      - FestiveSeason
  - type: GenericVisualizer
    visuals:
      enum.HolidayVisuals.Holiday:
        base:
          festive:
            sprite: Objects/Misc/Lights/lamp.rsi
            state: christmaslamp
        light:
          festive:
            sprite: Objects/Misc/Lights/lamp.rsi
            state: christmaslamp-on

- type: entity
  name: interrogator lamp
  id: LampInterrogator
  parent: [ BaseLamp, BaseSecurityContraband ]
  description: Ultra-bright lamp for the bad cop.
  components:
  - type: Sprite
    sprite: Objects/Misc/Lights/lampint.rsi
    layers:
      - state: lamp-int
        map: [ "enum.FlashVisualLayers.BaseLayer" ]
      - state: lamp-int-on
        shader: unshaded
        visible: false
        map: [ "light" ]
      - state: flashing
        map: [ "enum.FlashVisualLayers.LightLayer" ]
        visible: false
  - type: Item
    sprite: Objects/Misc/Lights/lampint.rsi
  - type: StaticPrice
    price: 2500
  - type: PointLight
    netsync: false
    enabled: false
    radius: 2
    energy: 0.5
    color: "#FFFFEE"
  - type: Flash
    flashOnMelee: false
    flashOnUse: false
  - type: UseDelay
    delay: 1
  - type: LimitedCharges
    maxCharges: 3
  - type: AutoRecharge
    rechargeDuration: 30
  - type: MeleeWeapon
    wideAnimationRotation: 180
    damage:
      types:
        Blunt: 0 # melee weapon to allow flashing individual targets
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellHigh
  - type: GenericVisualizer
    visuals:
      enum.FlashVisuals.Burnt:
        enum.FlashVisualLayers.BaseLayer:
          True: {state: burnt}
      enum.FlashVisuals.Flashing:
        enum.FlashVisualLayers.LightLayer:
          True: {visible: true}
          False: {visible: false}

- type: entity
  name: floodlight
  id: Floodlight
  parent: BaseLamp
  description: A pole with powerful mounted lights on it.
  components:
  - type: Item
    size: Normal
  - type: Sprite
    sprite: Objects/Misc/Lights/lights.rsi
    layers:
      - state: floodlight
        map: [ "base" ]
      - state: floodlight-on
        shader: unshaded
        visible: false
        map: [ "light" ]
  - type: Physics
    canCollide: true
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.2, -0.5, 0.2, 0.5"
        density: 50
        mask:
        - HighImpassable
  - type: PointLight
    enabled: false
    radius: 8
    energy: 5
  - type: ItemSlots
    slots:
      cell_slot:
        name: power-cell-slot-component-slot-name-default
        startingItem: PowerCellMedium
  - type: Anchorable
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 10
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: GlassBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          FloodlightBroken:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: PhysicalComposition
    materialComposition:
      Glass: 500
      Steel: 200
- type: entity
  name: broken floodlight
  id: FloodlightBroken
  parent: BaseItem
  description: A pole with powerful mounted lights on it. It's broken.
  components:
  - type: Item
    size: Normal
    sprite: Objects/Misc/Lights/lights.rsi
    heldPrefix: floodlight-broken
  - type: Sprite
    sprite: Objects/Misc/Lights/lights.rsi
    state: floodlight-broken
  - type: Anchorable
  - type: Damageable
    damageContainer: StructuralInorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 40
      behaviors:
        - !type:DoActsBehavior
          acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 20
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalGlassBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Physics
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.2, -0.5, 0.2, 0.5"
        density: 50
        mask:
        - HighImpassable
  - type: PhysicalComposition
    materialComposition:
      Glass: 500
      Steel: 200
