Glowsticks, flares and lighting behaviours (#1886)

* Assets

* LightingBehaviours, flares, and such.

* More changes

* More changes, more flare work.

* More work on flares + light behaviours

* another refactor

* missed

* Light behaviours refactor, added sfx, improved graphics, improved lighting effects for glowstick and flare.

* remove unneeded value

* nullables

* remove old code

* nullable

* one last push

* net id

* more work

* more colors for glowsticks

* Adjust flare so it fades in

* fix name

* sprite fix
This commit is contained in:
nuke
2020-09-03 16:02:40 -04:00
committed by GitHub
parent 7991a97ec2
commit c3630b7301
30 changed files with 1682 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,77 @@
- type: entity
name: emergency flare # todo: we need some sort of IgnitionSourceComponent we can add to this, so when it's lit it will cause fires when touching fuel
parent: BaseItem
id: FlareBase
description: A flare that produces a very bright light for a short while. Point the flame away from yourself.
components:
- type: ExpendableLight
spentName: spent flare
spentDesc: It looks like this flare has burnt out. What a bummer.
glowDuration: 400
fadeOutDuration: 4
iconStateOn: flare_unlit
iconStateSpent: flare_spent
turnOnBehaviourID: turn_on
fadeOutBehaviourID: fade_out
litSound: /Audio/Items/Flare/flare_on.ogg
loopedSound: /Audio/Items/Flare/flare_burn.ogg
- type: Sprite
sprite: Objects/Misc/flare.rsi
layers:
- state: flare_base
- state: flare_burn
color: "#FFFFFF"
visible: false
shader: unshaded
- state: flare_unlit
color: "#FF0000"
- type: Icon
sprite: Objects/Misc/flare.rsi
state: flare_spent
- type: Item
sprite: Objects/Misc/flare.rsi
color: "#FF0000"
HeldPrefix: off
- type: LoopingSound
- type: Appearance
visuals:
- type: ExpendableLightVisualizer
- type: PointLight
enabled: false
color: "#FF8080"
radius: 1.0
energy: 9.0
- type: LightBehaviour
behaviours:
- !type:RandomizeBehaviour # immediately make it bright and flickery
id: turn_on
interpolate: Nearest
minDuration: 0.02
maxDuration: 0.06
startValue: 6.0
endValue: 9.0
property: Energy
isLooped: true
- !type:FadeBehaviour # have the radius start small and get larger as it starts to burn
id: turn_on
interpolate: Linear
maxDuration: 8.0
startValue: 1.0
endValue: 6.0
property: Radius
- !type:RandomizeBehaviour # weaker flicker as it fades out
id: fade_out
interpolate: Nearest
minDuration: 0.02
maxDuration: 0.06
startValue: 4.0
endValue: 8.0
property: Energy
isLooped: true
- !type:FadeBehaviour # fade out radius as it burns out
id: fade_out
interpolate: Linear
maxDuration: 4.0
startValue: 6.0
endValue: 1.0
property: Radius

View File

@@ -0,0 +1,417 @@
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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: Icon
sprite: Objects/Misc/glowstick.rsi
state: glowstick_unlit
- 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,126 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Sprites created by https://github.com/nuke-makes-games",
"states":
[
{
"name": "off-inhand-left",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "off-inhand-right",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "on-inhand-left",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "on-inhand-right",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "flare_burn",
"select": [],
"flags": {},
"directions": 1,
"delays": [
[
0.05,
0.05,
0.05,
0.05
]
]
},
{
"name": "flare_spent",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "flare_base",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "flare_unlit",
"directions": 1,
"delays": [
[
1.0
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,121 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Sprites created by https://github.com/nuke-makes-games",
"states":
[
{
"name": "off-inhand-left",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "off-inhand-right",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "on-inhand-left",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "on-inhand-right",
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
},
{
"name": "glowstick_base",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "glowstick_lit",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "glowstick_glow",
"directions": 1,
"delays": [
[
1.0
]
]
},
{
"name": "glowstick_unlit",
"directions": 1,
"delays": [
[
1.0
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB