From 1056b9005fafa12ba04c68ce4674ec7e2786100b Mon Sep 17 00:00:00 2001 From: Swept Date: Sat, 27 Feb 2021 09:23:14 +0000 Subject: [PATCH] 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 --- .../Interactable/ExpendableLightComponent.cs | 20 +- .../Entities/Objects/Misc/fluff_lights.yml | 26 -- .../Entities/Objects/Misc/torch.yml | 77 ++++++ .../Entities/Objects/Tools/flare.yml | 4 +- .../Recipes/Construction/Graphs/torch.yml | 13 + .../Prototypes/Recipes/Construction/tools.yml | 10 + ...on-inhand-left.png => lit-inhand-left.png} | Bin ...-inhand-right.png => lit-inhand-right.png} | Bin .../Textures/Objects/Misc/flare.rsi/meta.json | 8 +- ...-inhand-left.png => unlit-inhand-left.png} | Bin ...nhand-right.png => unlit-inhand-right.png} | Bin .../Textures/Objects/Misc/torch.rsi/icon.png | Bin 0 -> 385 bytes ...on-inhand-left.png => lit-inhand-left.png} | Bin ...-inhand-right.png => lit-inhand-right.png} | Bin .../Objects/Misc/torch.rsi/lit_overlay.png | Bin 0 -> 888 bytes .../Textures/Objects/Misc/torch.rsi/meta.json | 227 ++++++++---------- .../Objects/Misc/torch.rsi/torch_nocloth.png | Bin 0 -> 210 bytes .../Objects/Misc/torch.rsi/torch_on.png | Bin 1046 -> 0 bytes .../{torch_empty.png => torch_spent.png} | Bin .../torch.rsi/{torch.png => torch_unlit.png} | Bin ...-inhand-left.png => unlit-inhand-left.png} | Bin ...nhand-right.png => unlit-inhand-right.png} | Bin 22 files changed, 219 insertions(+), 166 deletions(-) create mode 100644 Resources/Prototypes/Entities/Objects/Misc/torch.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/torch.yml create mode 100644 Resources/Prototypes/Recipes/Construction/tools.yml rename Resources/Textures/Objects/Misc/flare.rsi/{on-inhand-left.png => lit-inhand-left.png} (100%) rename Resources/Textures/Objects/Misc/flare.rsi/{on-inhand-right.png => lit-inhand-right.png} (100%) rename Resources/Textures/Objects/Misc/flare.rsi/{off-inhand-left.png => unlit-inhand-left.png} (100%) rename Resources/Textures/Objects/Misc/flare.rsi/{off-inhand-right.png => unlit-inhand-right.png} (100%) create mode 100644 Resources/Textures/Objects/Misc/torch.rsi/icon.png rename Resources/Textures/Objects/Misc/torch.rsi/{on-inhand-left.png => lit-inhand-left.png} (100%) rename Resources/Textures/Objects/Misc/torch.rsi/{on-inhand-right.png => lit-inhand-right.png} (100%) create mode 100644 Resources/Textures/Objects/Misc/torch.rsi/lit_overlay.png create mode 100644 Resources/Textures/Objects/Misc/torch.rsi/torch_nocloth.png delete mode 100644 Resources/Textures/Objects/Misc/torch.rsi/torch_on.png rename Resources/Textures/Objects/Misc/torch.rsi/{torch_empty.png => torch_spent.png} (100%) rename Resources/Textures/Objects/Misc/torch.rsi/{torch.png => torch_unlit.png} (100%) rename Resources/Textures/Objects/Misc/torch.rsi/{off-inhand-left.png => unlit-inhand-left.png} (100%) rename Resources/Textures/Objects/Misc/torch.rsi/{off-inhand-right.png => unlit-inhand-right.png} (100%) 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 0000000000000000000000000000000000000000..58e66527022884fe36af91da8a152556d2bd5f18 GIT binary patch literal 385 zcmV-{0e=38P)E>d3bGsoe!8e)I*eKlzz2RxOMo%^(-#m2kpakZ04S*6gdB(SL5`psfF(j6 zNnvo}`|&3gjA03p<^bjZ0~vw;JJaOB79*Djqymzo0G1#@;L^EI46Xv445D9tGBT2w z`Y8e+-*=k`{s+;>=FlYsVBqHaA5`%S$qoSdI$DB};ml8Vh6_(VP#o@Lg#fjDPqG83 z?R%0Pz(8f+ljHze_?{#OFwnsFL_2_1z9-rN3^ejRQ4XM`?}>5%0}XvoG(a!&aRIti f$HNOSFfafB@E-kD(@^>S00000NkvXXu0mjf)n%1; literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..87063ea99c9dd5cb49db3436439461eabea23985 GIT binary patch literal 888 zcmV-;1Bd*HP)8nu5XY&afI3)P0wnG1A&-!)L(nJ4&@P$MrE8WxLWg9{l)XzHpl{$ODEb5qia0|6 zF9{Gp1qq!>)08S5d3UmLKR}BO>wjOQDEep=19`1BZu%BYXlfznjjdnfFu-IyzC(!fCaT| zi}lgj@biOtes|z(D4QbKU)7`hPkIrv;$VOa2s6GuCr|)Z8{&WkH3Fals>gY2K>2IM z7J`_*Hw|VTfkjblOedi}E8z>6eF)i$dL%9>hQn|3_C#cw>0@#VXHMPflV^ zap`vjG*usE;gIZNoXx7Q8j zcJwYm5qL#Wwi0Oml18K_G=#JVa;ObL0T4|<*cL8X1wp$Y+vpJWpRxsH2yGX#kPTf0 z$fCc|pvqW*kp|goZaez?cNg`v9P1MH4WT+M)7PaOwx?4PCcbMnAhRP@0aAw~xO?>d zvtgk&Rv*0=1P!Wfr?Su0+x8S=4%XTMoAz(NL%K6yna?Pgi@TeRFPipzENPo@N0q4_ z&(_WexX&-{Zm5Rf{`dNuAAHxD9O@I}>wrEM^Z^ZM&vyO!3GLabfd0ejBHEuxRS3@i zlX71Smg3~Y4Lmso>W%NVn$1bC%^NA5B^t}6}0&TU*qie^#NJt zm3$08t)iMHK0M=J*2e8`XK?8*BTvW|+mn0?w!QZ(V_=?I>pzJ(<6-qAnF9{Y_l4gw zME#tX!ESKj#CI3VhH3lMPcibCe6hXQAeH)0;{cb0gakvu83()iJtvO>9m(M7>gTe~ HDWM4fwa-rs literal 0 HcmV?d00001 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 bd3f5581d62e46b0f2a510641b3cbf9abb715e09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1046 zcmV+x1nK*UP)3t!Cn#&p6rr&ZZ`W~_U+r5N#gwB5lGVao7tJ!eW5c-B#PFclfTjz=L&N37e>pv z5Z4yKhQ=z6whr{)6h&b!78@AZQyO$~7As%@?2C+jv~>X7Ur&^`@=z;ML+uQp3Ib%l zngn3b$&aZ5;09a!%#r{QagNNhZJ=HV-{P|cp~`tG*?hP#?eJ}PHs592m5O2jl)h^K zmTH|p+bwNyw?-`g%j7%To#LYmxAnw4i{h_1&P0S2ha zA}G~|AY@6rtdV~K`qqcLYzcgPYa2{jfmxQ#Y$q-sT~!C1K6vyYq%Z6zffzp4K@1}E z-*@Btch`#dFYbAt!?Ax5aq>Z__(5lYE<^hQeg61cJzTq~d}VKcFQr2H6k_A+=)ZYz ztI)61nHR#R$o^FP=%=7>mm~A)W;#~pSMgmzrE>8V_8QpH$D{l|{HO}3i#~-`iQgyy zI_l3hGxcGdt54sD@*7uxWPe(IZ~!FxarliYK(aqQKPUi_{doM~3Xtr_;m-|# zWIrxHr~)MWdHIU#SFi9zB9TZWS|CC57q_VY3FTGt9>^FQm==IF0B&12XBIf^f@Iaf z>OV&pf-PWi*-({$=zMR3Dq#kC_{Y?C)cJ2NtZlg};%;9I*0f9rAKKF~$AXXw6|Mz+&KQ;lP2Q-xBJePoN4@gk=X}0yh<$SY7J`eb}t1cpNUbg=BG