diff --git a/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs index fd06ac4001..fc7c4d340d 100644 --- a/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/ExpendableLightComponent.cs @@ -1,4 +1,4 @@ - + using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Sound; @@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Interactable if (Owner.TryGetComponent(out var item)) { - item.EquippedPrefix = "off"; + item.EquippedPrefix = "unlit"; } CurrentState = ExpendableLightState.BrandNew; @@ -59,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Interactable { if (Owner.TryGetComponent(out var item)) { - item.EquippedPrefix = "on"; + item.EquippedPrefix = "lit"; } CurrentState = ExpendableLightState.Lit; @@ -113,9 +113,13 @@ namespace Content.Server.GameObjects.Components.Interactable EntitySystem.Get().PlayFromEntity(LitSound, Owner); } + if (IconStateLit != string.Empty) + { + sprite.LayerSetState(2, IconStateLit); + sprite.LayerSetShader(2, "shaded"); + } + sprite.LayerSetVisible(1, true); - sprite.LayerSetState(2, IconStateLit); - sprite.LayerSetShader(2, "unshaded"); break; case ExpendableLightState.Fading: @@ -134,9 +138,9 @@ namespace Content.Server.GameObjects.Components.Interactable loopSound.StopAllSounds(); } + sprite.LayerSetState(0, IconStateSpent); + sprite.LayerSetShader(0, "shaded"); sprite.LayerSetVisible(1, false); - sprite.LayerSetState(2, IconStateSpent); - sprite.LayerSetShader(2, "shaded"); break; } } @@ -178,7 +182,7 @@ namespace Content.Server.GameObjects.Components.Interactable if (Owner.TryGetComponent(out var item)) { - item.EquippedPrefix = "off"; + item.EquippedPrefix = "unlit"; } break; diff --git a/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml b/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml index 41ea24127c..e0f334301b 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml @@ -74,32 +74,6 @@ visuals: - 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 name: floodlight id: Floodlight diff --git a/Resources/Prototypes/Entities/Objects/Misc/torch.yml b/Resources/Prototypes/Entities/Objects/Misc/torch.yml new file mode 100644 index 0000000000..e2ca2f54ec --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Misc/torch.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Objects/Tools/flare.yml b/Resources/Prototypes/Entities/Objects/Tools/flare.yml index acd6603054..88f24071e3 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/flare.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/flare.yml @@ -7,7 +7,7 @@ - type: ExpendableLight spentName: spent flare spentDesc: It looks like this flare has burnt out. What a bummer. - glowDuration: 400 + glowDuration: 150 fadeOutDuration: 4 iconStateOn: flare_unlit iconStateSpent: flare_spent @@ -31,7 +31,7 @@ - type: Item sprite: Objects/Misc/flare.rsi color: "#FF0000" - HeldPrefix: off + HeldPrefix: unlit - type: LoopingSound - type: Appearance visuals: diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/torch.yml b/Resources/Prototypes/Recipes/Construction/Graphs/torch.yml new file mode 100644 index 0000000000..cadb800cde --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/torch.yml @@ -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 diff --git a/Resources/Prototypes/Recipes/Construction/tools.yml b/Resources/Prototypes/Recipes/Construction/tools.yml new file mode 100644 index 0000000000..4a7b0fcd2b --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/tools.yml @@ -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 diff --git a/Resources/Textures/Objects/Misc/flare.rsi/on-inhand-left.png b/Resources/Textures/Objects/Misc/flare.rsi/lit-inhand-left.png similarity index 100% rename from Resources/Textures/Objects/Misc/flare.rsi/on-inhand-left.png rename to Resources/Textures/Objects/Misc/flare.rsi/lit-inhand-left.png diff --git a/Resources/Textures/Objects/Misc/flare.rsi/on-inhand-right.png b/Resources/Textures/Objects/Misc/flare.rsi/lit-inhand-right.png similarity index 100% rename from Resources/Textures/Objects/Misc/flare.rsi/on-inhand-right.png rename to Resources/Textures/Objects/Misc/flare.rsi/lit-inhand-right.png diff --git a/Resources/Textures/Objects/Misc/flare.rsi/meta.json b/Resources/Textures/Objects/Misc/flare.rsi/meta.json index cc48e04a1a..8df37b582f 100644 --- a/Resources/Textures/Objects/Misc/flare.rsi/meta.json +++ b/Resources/Textures/Objects/Misc/flare.rsi/meta.json @@ -31,19 +31,19 @@ ] }, { - "name": "on-inhand-left", + "name": "lit-inhand-left", "directions": 4 }, { - "name": "on-inhand-right", + "name": "lit-inhand-right", "directions": 4 }, { - "name": "off-inhand-left", + "name": "unlit-inhand-left", "directions": 4 }, { - "name": "off-inhand-right", + "name": "unlit-inhand-right", "directions": 4 } ] diff --git a/Resources/Textures/Objects/Misc/flare.rsi/off-inhand-left.png b/Resources/Textures/Objects/Misc/flare.rsi/unlit-inhand-left.png similarity index 100% rename from Resources/Textures/Objects/Misc/flare.rsi/off-inhand-left.png rename to Resources/Textures/Objects/Misc/flare.rsi/unlit-inhand-left.png diff --git a/Resources/Textures/Objects/Misc/flare.rsi/off-inhand-right.png b/Resources/Textures/Objects/Misc/flare.rsi/unlit-inhand-right.png similarity index 100% rename from Resources/Textures/Objects/Misc/flare.rsi/off-inhand-right.png rename to Resources/Textures/Objects/Misc/flare.rsi/unlit-inhand-right.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/icon.png b/Resources/Textures/Objects/Misc/torch.rsi/icon.png new file mode 100644 index 0000000000..58e6652702 Binary files /dev/null and b/Resources/Textures/Objects/Misc/torch.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Misc/torch.rsi/on-inhand-left.png b/Resources/Textures/Objects/Misc/torch.rsi/lit-inhand-left.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/on-inhand-left.png rename to Resources/Textures/Objects/Misc/torch.rsi/lit-inhand-left.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/on-inhand-right.png b/Resources/Textures/Objects/Misc/torch.rsi/lit-inhand-right.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/on-inhand-right.png rename to Resources/Textures/Objects/Misc/torch.rsi/lit-inhand-right.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/lit_overlay.png b/Resources/Textures/Objects/Misc/torch.rsi/lit_overlay.png new file mode 100644 index 0000000000..87063ea99c Binary files /dev/null and b/Resources/Textures/Objects/Misc/torch.rsi/lit_overlay.png differ diff --git a/Resources/Textures/Objects/Misc/torch.rsi/meta.json b/Resources/Textures/Objects/Misc/torch.rsi/meta.json index 72ebd77c8a..693c9f26ff 100644 --- a/Resources/Textures/Objects/Misc/torch.rsi/meta.json +++ b/Resources/Textures/Objects/Misc/torch.rsi/meta.json @@ -1,129 +1,104 @@ { - "version": 1, - "size": { - "x": 32, - "y": 32 + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/0f6496a55ceefa0f1bf1668fcef49b5182471695", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" }, - "license": "CC-BY-SA-3.0", - "copyright": "", - "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": [ - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ] - ] - }, - { - "name": "on-inhand-right", - "directions": 4, - "delays": [ - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ], - [ - 0.1, - 0.1, - 0.1, - 0.1 - ] - ] - }, - { - "name": "torch", - - }, - { - "name": "torch_empty", - - }, - { - "name": "torch_on", - "delays": [ - [ - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1 - ] - ] - } - ] + { + "name": "lit_overlay", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, + { + "name": "torch_unlit" + }, + { + "name": "torch_nocloth" + }, + { + "name": "torch_spent" + }, + { + "name": "lit-inhand-left", + "directions": 4, + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, + { + "name": "lit-inhand-right", + "directions": 4, + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, + { + "name": "unlit-inhand-left", + "directions": 4 + }, + { + "name": "unlit-inhand-right", + "directions": 4 + } + ] } diff --git a/Resources/Textures/Objects/Misc/torch.rsi/torch_nocloth.png b/Resources/Textures/Objects/Misc/torch.rsi/torch_nocloth.png new file mode 100644 index 0000000000..100f484c52 Binary files /dev/null and b/Resources/Textures/Objects/Misc/torch.rsi/torch_nocloth.png differ diff --git a/Resources/Textures/Objects/Misc/torch.rsi/torch_on.png b/Resources/Textures/Objects/Misc/torch.rsi/torch_on.png deleted file mode 100644 index bd3f5581d6..0000000000 Binary files a/Resources/Textures/Objects/Misc/torch.rsi/torch_on.png and /dev/null differ diff --git a/Resources/Textures/Objects/Misc/torch.rsi/torch_empty.png b/Resources/Textures/Objects/Misc/torch.rsi/torch_spent.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/torch_empty.png rename to Resources/Textures/Objects/Misc/torch.rsi/torch_spent.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/torch.png b/Resources/Textures/Objects/Misc/torch.rsi/torch_unlit.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/torch.png rename to Resources/Textures/Objects/Misc/torch.rsi/torch_unlit.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/off-inhand-left.png b/Resources/Textures/Objects/Misc/torch.rsi/unlit-inhand-left.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/off-inhand-left.png rename to Resources/Textures/Objects/Misc/torch.rsi/unlit-inhand-left.png diff --git a/Resources/Textures/Objects/Misc/torch.rsi/off-inhand-right.png b/Resources/Textures/Objects/Misc/torch.rsi/unlit-inhand-right.png similarity index 100% rename from Resources/Textures/Objects/Misc/torch.rsi/off-inhand-right.png rename to Resources/Textures/Objects/Misc/torch.rsi/unlit-inhand-right.png