Fixes Torch (#3270)

* Updates RSI

* Done

* Finish

* SoulSloth you give me conniptions

* Nvm it was Nuke who made this, sorry soulsloth.

* E

* I am retar
This commit is contained in:
Swept
2021-02-27 09:23:14 +00:00
committed by GitHub
parent 9b94d5c195
commit 1056b9005f
22 changed files with 219 additions and 166 deletions

View File

@@ -1,4 +1,4 @@

using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Items.Clothing;
using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.Components.Sound;
@@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (Owner.TryGetComponent<ItemComponent>(out var item)) if (Owner.TryGetComponent<ItemComponent>(out var item))
{ {
item.EquippedPrefix = "off"; item.EquippedPrefix = "unlit";
} }
CurrentState = ExpendableLightState.BrandNew; CurrentState = ExpendableLightState.BrandNew;
@@ -59,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Interactable
{ {
if (Owner.TryGetComponent<ItemComponent>(out var item)) if (Owner.TryGetComponent<ItemComponent>(out var item))
{ {
item.EquippedPrefix = "on"; item.EquippedPrefix = "lit";
} }
CurrentState = ExpendableLightState.Lit; CurrentState = ExpendableLightState.Lit;
@@ -113,9 +113,13 @@ namespace Content.Server.GameObjects.Components.Interactable
EntitySystem.Get<AudioSystem>().PlayFromEntity(LitSound, Owner); EntitySystem.Get<AudioSystem>().PlayFromEntity(LitSound, Owner);
} }
sprite.LayerSetVisible(1, true); if (IconStateLit != string.Empty)
{
sprite.LayerSetState(2, IconStateLit); sprite.LayerSetState(2, IconStateLit);
sprite.LayerSetShader(2, "unshaded"); sprite.LayerSetShader(2, "shaded");
}
sprite.LayerSetVisible(1, true);
break; break;
case ExpendableLightState.Fading: case ExpendableLightState.Fading:
@@ -134,9 +138,9 @@ namespace Content.Server.GameObjects.Components.Interactable
loopSound.StopAllSounds(); loopSound.StopAllSounds();
} }
sprite.LayerSetState(0, IconStateSpent);
sprite.LayerSetShader(0, "shaded");
sprite.LayerSetVisible(1, false); sprite.LayerSetVisible(1, false);
sprite.LayerSetState(2, IconStateSpent);
sprite.LayerSetShader(2, "shaded");
break; break;
} }
} }
@@ -178,7 +182,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (Owner.TryGetComponent<ItemComponent>(out var item)) if (Owner.TryGetComponent<ItemComponent>(out var item))
{ {
item.EquippedPrefix = "off"; item.EquippedPrefix = "unlit";
} }
break; break;

View File

@@ -74,32 +74,6 @@
visuals: visuals:
- type: FlashLightVisualizer - type: FlashLightVisualizer
- type: entity
name: torch
id: Torch
parent: BaseLamp
description: A torch fashioned from some leaves and a log.
components:
- type: Sprite
sprite: Objects/Misc/torch.rsi
layers:
- state: torch
- state: torch_on
shader: unshaded
visible: false
- type: Item
sprite: Objects/Misc/torch.rsi
HeldPrefix: off
- type: PointLight
enabled: false
radius: 1
energy: 4
color: "#FFC458"
- type: LoopingSound
- type: Appearance
visuals:
- type: LanternVisualizer
- type: entity - type: entity
name: floodlight name: floodlight
id: Floodlight id: Floodlight

View File

@@ -0,0 +1,77 @@
- type: entity
name: torch # 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: Torch
description: A torch fashioned from some wood.
components:
- type: ExpendableLight
spentName: burnt torch
spentDesc: It looks like this torch has burnt out. What a bummer.
glowDuration: 100
fadeOutDuration: 4
iconStateSpent: torch_spent
turnOnBehaviourID: turn_on
fadeOutBehaviourID: fade_out
# Sounds legit nuff
litSound: /Audio/Items/Flare/flare_on.ogg
loopedSound: /Audio/Items/Flare/flare_burn.ogg
- type: Sprite
sprite: Objects/Misc/torch.rsi
layers:
- state: torch_unlit
- state: lit_overlay
color: "#FFFFFF"
visible: false
shader: unshaded
- type: Icon
sprite: Objects/Misc/torch.rsi
state: icon
- type: Item
sprite: Objects/Misc/torch.rsi
HeldPrefix: unlit
- type: LoopingSound
- type: Construction
graph: lightTorch
node: torch
- type: Appearance
visuals:
- type: ExpendableLightVisualizer
- type: PointLight
enabled: false
color: "#E25822"
radius: 1.0
energy: 5.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

@@ -7,7 +7,7 @@
- type: ExpendableLight - type: ExpendableLight
spentName: spent flare spentName: spent flare
spentDesc: It looks like this flare has burnt out. What a bummer. spentDesc: It looks like this flare has burnt out. What a bummer.
glowDuration: 400 glowDuration: 150
fadeOutDuration: 4 fadeOutDuration: 4
iconStateOn: flare_unlit iconStateOn: flare_unlit
iconStateSpent: flare_spent iconStateSpent: flare_spent
@@ -31,7 +31,7 @@
- type: Item - type: Item
sprite: Objects/Misc/flare.rsi sprite: Objects/Misc/flare.rsi
color: "#FF0000" color: "#FF0000"
HeldPrefix: off HeldPrefix: unlit
- type: LoopingSound - type: LoopingSound
- type: Appearance - type: Appearance
visuals: visuals:

View File

@@ -0,0 +1,13 @@
- type: constructionGraph
id: lightTorch
start: start
graph:
- node: start
edges:
- to: torch
steps:
- material: Wood
amount: 2
doAfter: 2
- node: torch
entity: Torch

View File

@@ -0,0 +1,10 @@
- type: construction
name: torch
id: LightTorch
graph: lightTorch
startNode: start
targetNode: torch
category: Tools
description: A torch fashioned from some wood.
icon: Objects/Misc/torch.rsi/icon.png
objectType: Item

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -31,19 +31,19 @@
] ]
}, },
{ {
"name": "on-inhand-left", "name": "lit-inhand-left",
"directions": 4 "directions": 4
}, },
{ {
"name": "on-inhand-right", "name": "lit-inhand-right",
"directions": 4 "directions": 4
}, },
{ {
"name": "off-inhand-left", "name": "unlit-inhand-left",
"directions": 4 "directions": 4
}, },
{ {
"name": "off-inhand-right", "name": "unlit-inhand-right",
"directions": 4 "directions": 4
} }
] ]

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

View File

@@ -1,51 +1,39 @@
{ {
"version": 1, "version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/0f6496a55ceefa0f1bf1668fcef49b5182471695",
"size": { "size": {
"x": 32, "x": 32,
"y": 32 "y": 32
}, },
"license": "CC-BY-SA-3.0", "states": [
"copyright": "",
"states":
[
{ {
"name": "off-inhand-left", "name": "icon"
"directions": 4, },
{
"name": "lit_overlay",
"delays": [ "delays": [
[ [
1.0 0.1,
], 0.1,
[ 0.1,
1.0 0.1,
], 0.1,
[ 0.1
1.0
],
[
1.0
] ]
] ]
}, },
{ {
"name": "off-inhand-right", "name": "torch_unlit"
"directions": 4,
"delays": [
[
1.0
],
[
1.0
],
[
1.0
],
[
1.0
]
]
}, },
{ {
"name": "on-inhand-left", "name": "torch_nocloth"
},
{
"name": "torch_spent"
},
{
"name": "lit-inhand-left",
"directions": 4, "directions": 4,
"delays": [ "delays": [
[ [
@@ -75,7 +63,7 @@
] ]
}, },
{ {
"name": "on-inhand-right", "name": "lit-inhand-right",
"directions": 4, "directions": 4,
"delays": [ "delays": [
[ [
@@ -105,25 +93,12 @@
] ]
}, },
{ {
"name": "torch", "name": "unlit-inhand-left",
"directions": 4
}, },
{ {
"name": "torch_empty", "name": "unlit-inhand-right",
"directions": 4
},
{
"name": "torch_on",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
} }
] ]
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 199 B

View File

Before

Width:  |  Height:  |  Size: 296 B

After

Width:  |  Height:  |  Size: 296 B

View File

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 376 B

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B