- type: entity
  name: green glowstick
  parent: BaseItem
  id: GlowstickBase
  description: Useful for raves and emergencies.
  components:
    - type: ExpendableLight
      spentName: spent green glowstick
      spentDesc: It looks like this glowstick has stopped glowing. How tragic.
      glowDuration: 900 # time in seconds
      fadeOutDuration: 300
      iconStateOn: glowstick_lit
      iconStateSpent: glowstick_unlit
      turnOnBehaviourID: turn_on
      fadeOutBehaviourID: fade_out
      litSound: /Audio/Items/Handcuffs/rope_breakout.ogg
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_glow
          color: "#00FF00"
          visible: false
          shader: unshaded
        - state: glowstick_unlit
          color: "#00FF00"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      color: "#00FF00"
      HeldPrefix: off
    - type: Appearance
      visuals:
        - type: ExpendableLightVisualizer
    - type: PointLight
      enabled: false
      color: "#00FF00"
      radius: 5
      energy: 0
    - type: LightBehaviour
      behaviours:
        - !type:FadeBehaviour # slowly fade in once activated
          id: turn_on
          interpolate: Linear
          maxDuration: 10.0
          startValue: 0.0
          endValue: 3.0
          property: Energy
        - !type:FadeBehaviour # fade out energy as it burns out
          id: fade_out
          interpolate: Linear
          maxDuration: 10 # 300.0
          startValue: 3.0
          endValue: 0.2
          property: Energy
        - !type:FadeBehaviour # fade out radius as it burns out
          id: fade_out
          interpolate: Linear
          maxDuration: 10 # 300.0
          startValue: 5.0
          endValue: 1.5
          property: Radius

- type: entity
  name: red glowstick
  parent: GlowstickBase
  id: GlowstickRed
  components:
    - type: ExpendableLight
      spentName: spent red glowstick
      spentDesc: It looks like this glowstick has stopped glowing. How tragic.
      glowDuration: 900
      fadeOutDuration: 300
      iconStateOn: glowstick_lit
      iconStateSpent: glowstick_unlit
      turnOnBehaviourID: turn_on
      fadeOutBehaviourID: fade_out
      litSound: /Audio/Items/Handcuffs/rope_breakout.ogg
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_glow
          color: "#FF0000"
          visible: false
          shader: unshaded
        - state: glowstick_unlit
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      color: "#FF0000"
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF0000"
      radius: 5
      energy: 0

- type: entity
  name: purple glowstick
  parent: GlowstickBase
  id: GlowstickPurple
  components:
    - type: ExpendableLight
      spentName: spent purple glowstick
      spentDesc: It looks like this glowstick has stopped glowing. How tragic.
      glowDuration: 900
      fadeOutDuration: 300
      iconStateOn: glowstick_lit
      iconStateSpent: glowstick_unlit
      turnOnBehaviourID: turn_on
      fadeOutBehaviourID: fade_out
      litSound: /Audio/Items/Handcuffs/rope_breakout.ogg
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_glow
          color: "#FF00FF"
          visible: false
          shader: unshaded
        - state: glowstick_unlit
          color: "#FF00FF"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      color: "#FF00FF"
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF00FF"
      radius: 5
      energy: 0

- type: entity
  name: yellow glowstick
  parent: GlowstickBase
  id: GlowstickYellow
  components:
    - type: ExpendableLight
      spentName: spent yellow glowstick
      spentDesc: It looks like this glowstick has stopped glowing. How tragic.
      glowDuration: 900
      fadeOutDuration: 300
      iconStateOn: glowstick_lit
      iconStateSpent: glowstick_unlit
      turnOnBehaviourID: turn_on
      fadeOutBehaviourID: fade_out
      litSound: /Audio/Items/Handcuffs/rope_breakout.ogg
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_glow
          color: "#FFFF00"
          visible: false
          shader: unshaded
        - state: glowstick_unlit
          color: "#FFFF00"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      color: "#FFFF00"
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FFFF00"
      radius: 5
      energy: 0

- type: entity
  name: blue glowstick
  parent: GlowstickBase
  id: GlowstickBlue
  components:
    - type: ExpendableLight
      spentName: spent blue glowstick
      spentDesc: It looks like this glowstick has stopped glowing. How tragic.
      glowDuration: 900
      fadeOutDuration: 300
      iconStateOn: glowstick_lit
      iconStateSpent: glowstick_unlit
      turnOnBehaviourID: turn_on
      fadeOutBehaviourID: fade_out
      litSound: /Audio/Items/Handcuffs/rope_breakout.ogg
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_glow
          color: "#0000FF"
          visible: false
          shader: unshaded
        - state: glowstick_unlit
          color: "#0000FF"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      color: "#0000FF"
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#0000FF"
      radius: 5
      energy: 0

# ----------------------------------------------------------------------------
# THE FOLLOWING ARE ALL DUMMY ENTITIES USED TO TEST THE LIGHT BEHAVIOUR SYSTEM
# ----------------------------------------------------------------------------
- type: entity
  name: light pulse test
  parent: BaseItem
  id: LightBehaviourTest1
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: true
      color: "#FF0000"
      radius: 5
    - type: LightBehaviour
      behaviours:
        - !type:PulseBehaviour
          interpolate: Cubic
          maxDuration: 10.0
          minValue: 1.0
          maxValue: 7.0
          isLooped: true
          property: Energy
          enabled: true

- type: entity
  name: color cycle test
  parent: BaseItem
  id: LightBehaviourTest2
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: true
      color: "#FF0000"
      radius: 5
    - type: LightBehaviour
      behaviours:
        - !type:ColorCycleBehaviour
          interpolate: Nearest
          maxDuration: 0.8
          isLooped: true
          enabled: true
          colors:
            - red
            - blue
            - green

- type: entity
  name: multi-behaviour light test
  parent: BaseItem
  id: LightBehaviourTest3
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF0000"
      radius: 5
    - type: LightBehaviour
      behaviours:
        - !type:PulseBehaviour
          interpolate: Nearest
          minDuration: 0.2
          maxDuration: 1.0
          maxValue: 0.2
          property: Enabled
          isLooped: true
          enabled: true
        - !type:ColorCycleBehaviour
          interpolate: Cubic
          maxDuration: 0.8
          isLooped: true
          enabled: true
          colors:
            - red
            - blue
            - green

- type: entity
  name: light fade in test
  parent: BaseItem
  id: LightBehaviourTest4
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF0000"
      radius: 5
    - type: LightBehaviour
      behaviours:
        - !type:FadeBehaviour
          interpolate: Cubic
          maxDuration: 5.0
          minValue: 0.0
          maxValue: 10.0
          isLooped: true
          property: Energy
          enabled: true

- type: entity
  name: light pulse radius test
  parent: BaseItem
  id: LightBehaviourTest5
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF0000"
      radius: 5
    - type: LightBehaviour
      behaviours:
        - !type:PulseBehaviour
          interpolate: Cubic
          minDuration: 1.0
          maxDuration: 5.0
          minValue: 2.0
          maxValue: 10.0
          isLooped: true
          property: Radius
          enabled: true

- type: entity
  name: light randomize radius test
  parent: BaseItem
  id: LightBehaviourTest6
  components:
    - type: Sprite
      sprite: Objects/Misc/glowstick.rsi
      layers:
        - state: glowstick_base
        - state: glowstick_unlit
          shader: unshaded
          color: "#FF0000"
    - type: Item
      sprite: Objects/Misc/glowstick.rsi
      HeldPrefix: off
    - type: PointLight
      enabled: false
      color: "#FF0000"
      radius: 5
      energy: 10
    - type: LightBehaviour
      behaviours:
        - !type:RandomizeBehaviour
          interpolate: Nearest
          maxDuration: 0.5
          minValue: 10.0
          maxValue: 25.0
          isLooped: true
          property: Radius
          enabled: true
