From 52a01fff328ff99ca218e81dad615ceb4a7148dc Mon Sep 17 00:00:00 2001 From: SoulSloth <67545203+SoulSloth@users.noreply.github.com> Date: Sun, 9 Aug 2020 15:57:42 -0400 Subject: [PATCH] Add a lantern and a radiating light component (#1571) * added a lantern * Add A Lantern with radiating light * Update meta.json Added copyright information for lantern.rsi --- .../Components/RadiatingLightComponent.cs | 46 ++++++++ .../Entities/Objects/Tools/lantern.yml | 27 +++++ .../Objects/Tools/lantern.rsi/lantern-on.png | Bin 0 -> 1014 bytes .../Objects/Tools/lantern.rsi/lantern.png | Bin 0 -> 793 bytes .../Objects/Tools/lantern.rsi/meta.json | 101 ++++++++++++++++++ .../Tools/lantern.rsi/off-inhand-left.png | Bin 0 -> 362 bytes .../Tools/lantern.rsi/off-inhand-right.png | Bin 0 -> 353 bytes .../Tools/lantern.rsi/on-inhand-left.png | Bin 0 -> 362 bytes .../Tools/lantern.rsi/on-inhand-right.png | Bin 0 -> 353 bytes 9 files changed, 174 insertions(+) create mode 100644 Content.Client/GameObjects/Components/RadiatingLightComponent.cs create mode 100644 Resources/Prototypes/Entities/Objects/Tools/lantern.yml create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/lantern.png create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/meta.json create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png create mode 100644 Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png diff --git a/Content.Client/GameObjects/Components/RadiatingLightComponent.cs b/Content.Client/GameObjects/Components/RadiatingLightComponent.cs new file mode 100644 index 0000000000..76b57f2fb4 --- /dev/null +++ b/Content.Client/GameObjects/Components/RadiatingLightComponent.cs @@ -0,0 +1,46 @@ +using System; +using Robust.Client.Animations; +using Robust.Client.GameObjects; +using Robust.Client.GameObjects.Components.Animations; +using Robust.Shared.Animations; +using Robust.Shared.GameObjects; +using Robust.Shared.Maths; + +namespace Content.Client.GameObjects.Components +{ + [RegisterComponent] + public class RadiatingLightComponent : Component + { + public override string Name => "RadiatingLight"; + + protected override void Startup() + { + base.Startup(); + + var animation = new Animation + { + Length = TimeSpan.FromSeconds(4), + AnimationTracks = + { + new AnimationTrackComponentProperty + { + ComponentType = typeof(PointLightComponent), + InterpolationMode = AnimationInterpolationMode.Linear, + Property = nameof(PointLightComponent.Radius), + KeyFrames = + { + new AnimationTrackProperty.KeyFrame(3.0f, 0), + new AnimationTrackProperty.KeyFrame(2.0f, 1), + new AnimationTrackProperty.KeyFrame(3.0f, 2) + } + } + } + }; + + var playerComponent = Owner.EnsureComponent(); + playerComponent.Play(animation, "emergency"); + + playerComponent.AnimationCompleted += s => playerComponent.Play(animation, s); + } + } +} diff --git a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml new file mode 100644 index 0000000000..e1346cac53 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml @@ -0,0 +1,27 @@ +- type: entity + name: lantern + parent: BaseItem + id: lantern + description: The holy light guides the way + components: + - type: HandheldLight + - type: Sprite + sprite: Objects/Tools/lantern.rsi + layers: + - state: lantern + - state: lantern-on + shader: unshaded + visible: false + - type: Icon + sprite: Objects/Tools/lantern.rsi + state: lantern + - type: Item + sprite: Objects/Tools/lantern.rsi + HeldPrefix: off + - type: PointLight + enabled: false + radius: 3 + energy: 2.5 + color: "#FFC458" + - type: RadiatingLight + - type: LoopingSound diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png b/Resources/Textures/Objects/Tools/lantern.rsi/lantern-on.png new file mode 100644 index 0000000000000000000000000000000000000000..7573695619f2c7beb154e61e7a2550cb86036f04 GIT binary patch literal 1014 zcmVPuN6vuyE)m{BDpN_GOO+dClF;Zl4fSka0V3k!Cxk}c_CDNs7MLD`ltp+_sTS4suitz1>h*(f_JwwP=Z5{y4&UBfw;#`!G3T-e zx1)&Bc+Bd`%7?i!h9@tMm(pAsV0U}VZmnNsUX&P9k)%1s7*<#NWO+fBW;{B4*;rRB z3jm;$;@Y)M5CYGWIKtsS8Iar2uxfw`{N7AqWG;<1xy0Dar~g7`sS=Rv59n zz127;mI5d$NU}L+<1_mG4&7czuN#2SDCLmNGm-%<2C0lx1c#p3&~22hJhr362$Nj9!@5i%u=st?2WOA4KFvs=(qhjdcCnN4UlFjKw^zW%91QMNLgZy z1xV`kuL_`9B++~_)x;CSz5Bzvl`i*$?2w&T2-%_1<=(yf!@KdsFdSt7^Ln4YG(ep= zhD9dNio$Yq67zPbd3NkF8XWCCJ(@Eb9PK?jc6mG09G%3pTpwUo?=xTe3^h;yX?$J* zF7X5&K5}{T)FsU_9v{M4JmGYdGaQwSCmAeWK=HW9pIMQC1bdoxRawY6~0>`l{dUu`UEvB}rE~RaMdH+#<^hvQ@?}r{mgOQ&#}MbzSb< zIRewfaV!ke;3l498X(F-i=`!SJm{R-rB;0Qb-V*FiAaoQz4)>VF6;c+I<)^>(ypSMhaB+E|#nTp8 z34_aNO#h%wo@EFrF_fa^Sxja(BvKElEs&@Nmy?{A=WlRbXY;)%1g`7Q^cp}}o2Pvb ztVGGH^LNJR@spFM&t9B>!P93iPDYQPoV+@JXRJj1$+r^NZ#6d0QIc}Yvx$=QoB5px z9CSKgy+0aSf1Cf;1*TE7d0ym#pUz4ax%g&&Cjzi3zoXeQ=h4t&w#)%WpUZNd=e1ed zr{MiG!uNfm@hR|p^z&KC;mhZvXnczA`@EkC-T@%!70t$E+${~I3x XdhSI9Y-ez300000NkvXXu0mjfRCj&= literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/meta.json b/Resources/Textures/Objects/Tools/lantern.rsi/meta.json new file mode 100644 index 0000000000..2205be15d5 --- /dev/null +++ b/Resources/Textures/Objects/Tools/lantern.rsi/meta.json @@ -0,0 +1,101 @@ +{ + "version": 1, + "license": "CC BY-SA 3.0", + "copyright": "Taken from https://github.com/tgstation/tgstation at commit 9bebd81ae0b0a7f952b59886a765c681205de31f", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "lantern", + "directions": 1, + "delays": [ + [ + 1.0 + ] + ] + }, + { + "name": "lantern-on", + "directions": 1, + "delays": [ + [ + 1.0 + ] + ] + }, + { + "name": "off-inhand-left", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "off-inhand-right", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "on-inhand-left", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + }, + { + "name": "on-inhand-right", + "directions": 4, + "delays": [ + [ + 1 + ], + [ + 1 + ], + [ + 1 + ], + [ + 1 + ] + ] + } + ] +} diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..d38b5e8c641bed3d62cca1d8171c59a33a7ed3de GIT binary patch literal 362 zcmV-w0hRuVP)nEJa!haAZ+{ zy!+My>HjJh$*d(myLlr400000002OO`x_Vf>)Y#j`02O58UBBmYiXV%w5}8+scC1D zj?p=n7c@hi*b-o87t4t#q*SJS%Fb!wI*HLXj|noL>vu-hnvpwLf3th)Nl*=-cc z!e@B}%qQT#$?^?&d2-snc3N+}q(gMhdh4at;q*%7kYxgvi_Yw(o7QQ$=uENz00000 z00000U@f&55PMckhroO{SXTfB)$A*MrM zIsrM?*tyO&{{}p-l-vs#pF07*qo IM6N<$g8lEF{{R30 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png b/Resources/Textures/Objects/Tools/lantern.rsi/off-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..de8ce0ad507a0f180306f1d7c907c14fabfc95d6 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEVASw*aSW-L^Y)fu-XQ~#V;|SE zYAOfsRrt!HBYDeE{KW<44ecwPt7mWcF83zY@s#MH1H2O^+)-5dx7_B-XaCnvzW?m=Wsk_J4U?vbzdc;4>Ro!q zW>U!qyWcNv-^o$eiWj;1df)9F^;6v|;vLUt+d- zJCoK`aoH}l%Dv?Wt}nm%C-u5j0LSUpFMpF&etw?6wqZ|)$?SLeQ&$Ubepy!#$_;S~ z1H%RTg=uVhFTchgzAbH|dgV+*^}D2%?a_O`FM78@8^p~E@XUF2uX?&M^LMN5g{*(f xd*3sxe6zP*<7oAq>QL5}S&|Zu)-W-AxuvgoBY*3>f?|J=(Vnh;F6*2UngBhyp6CDo literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..d38b5e8c641bed3d62cca1d8171c59a33a7ed3de GIT binary patch literal 362 zcmV-w0hRuVP)nEJa!haAZ+{ zy!+My>HjJh$*d(myLlr400000002OO`x_Vf>)Y#j`02O58UBBmYiXV%w5}8+scC1D zj?p=n7c@hi*b-o87t4t#q*SJS%Fb!wI*HLXj|noL>vu-hnvpwLf3th)Nl*=-cc z!e@B}%qQT#$?^?&d2-snc3N+}q(gMhdh4at;q*%7kYxgvi_Yw(o7QQ$=uENz00000 z00000U@f&55PMckhroO{SXTfB)$A*MrM zIsrM?*tyO&{{}p-l-vs#pF07*qo IM6N<$g8lEF{{R30 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png b/Resources/Textures/Objects/Tools/lantern.rsi/on-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..de8ce0ad507a0f180306f1d7c907c14fabfc95d6 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEVASw*aSW-L^Y)fu-XQ~#V;|SE zYAOfsRrt!HBYDeE{KW<44ecwPt7mWcF83zY@s#MH1H2O^+)-5dx7_B-XaCnvzW?m=Wsk_J4U?vbzdc;4>Ro!q zW>U!qyWcNv-^o$eiWj;1df)9F^;6v|;vLUt+d- zJCoK`aoH}l%Dv?Wt}nm%C-u5j0LSUpFMpF&etw?6wqZ|)$?SLeQ&$Ubepy!#$_;S~ z1H%RTg=uVhFTchgzAbH|dgV+*^}D2%?a_O`FM78@8^p~E@XUF2uX?&M^LMN5g{*(f xd*3sxe6zP*<7oAq>QL5}S&|Zu)-W-AxuvgoBY*3>f?|J=(Vnh;F6*2UngBhyp6CDo literal 0 HcmV?d00001