From e85d3c72207f8fc504ebb08a85278f9db0e9fc4e Mon Sep 17 00:00:00 2001 From: cornerloan Date: Sun, 23 Mar 2025 00:21:35 -0700 Subject: [PATCH 1/9] Added two relics Changed NoteHit in namespace to EnemyNoteHit, since that was what I implied it to be, and it wasn't being used anyway. Added two relics: Chips: deals damage when you hit enemy notes Paper Cut: deals daamge each loop --- Classes/Relics/Assets/Relic_Chips.png | Bin 0 -> 1000 bytes Classes/Relics/Assets/Relic_Chips.png.import | 34 ++++++++++++++++++ Classes/Relics/Assets/Relic_PaperCut.png | Bin 0 -> 1126 bytes .../Relics/Assets/Relic_PaperCut.png.import | 34 ++++++++++++++++++ Globals/FunkEngineNameSpace.cs | 2 +- Globals/Scribe.cs | 34 ++++++++++++++++++ Globals/Translations/translations.csv | 4 +++ .../BattleDirector/scripts/BattleDirector.cs | 10 ++++++ 8 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 Classes/Relics/Assets/Relic_Chips.png create mode 100644 Classes/Relics/Assets/Relic_Chips.png.import create mode 100644 Classes/Relics/Assets/Relic_PaperCut.png create mode 100644 Classes/Relics/Assets/Relic_PaperCut.png.import diff --git a/Classes/Relics/Assets/Relic_Chips.png b/Classes/Relics/Assets/Relic_Chips.png new file mode 100644 index 0000000000000000000000000000000000000000..74bdf235ca1f614e2d568afa7a199d39995296a9 GIT binary patch literal 1000 zcmV>P)EX>4Tx04R}tkv&MmKpe$iQ?()$2MdZQWT;Md@e9XN#UfZJZG~1HOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|E;uQ=NQwVT3N2zhIPS;0dyl(!fKV?p)$E7@s%9Cf zcudUZR>Z(7{1`wNrZFNhQ%|H9GVmN<_we!cF2b|C&;2=imAuISpGX{Kx?vHo6VGf~ zI_G`j5GzRv@j3ChK^G)`9%C|}6B ztZ?4qtd^^+c~AbrU|w5JbDice;#foiNr;e9#Rkf-5TR8g#YBqsV;=q?$DbsZOs)+u za?GOw6_Voz|AXJ%nuW;;Hz^ncI$v!2V-yJN0*#t&e;?a+;{@ zj1?(+&EwtO?Y;ebrrF;Q-4Sxp!APwI00006VoOIv0J8wI0JA$(Ys3Hm010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=>r!B3OhMk;x_;Q02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00F>BL_t(o!|jwYXcSQphX4QV?cNn?WnnOZ6c&QDjR>oR z_Zs0W1W7*sK|1c+xJ_D61crW zVxhQSH!#fn^Up9qMMXtL#lJ#fZC7c!|4-Mg?F^KrjiO$^PH7tCK}atN+%Z{pccd`q z-ViupynnT80Y#F`Q<`81rx3^QF&G?`G3Nn{6cBkoz8eR)bNY}ZpBP1BW^L_D=?Z|S zB%6?OlGDcfPGN1=^!vxTvGK96whM9-fCKQE(gkK&Cs;cV;2g*pz-r|E*b zcJ+FX%<}SAMA0(<`$}{A{l_NDzA;H2f}CW#{n`Kv3Sp_RwiBGYS}MSJzXjmF@_aEk zcSvcvCpdSqu=d_im%%`zM5s^7g2>|r|W|U>e7{@b`ZfS1LlpZ0aYXVvV z+DeiG0A3h!;dhQo#w_Z`I-i>mF3P#XL0SPYq3!K0k~i3Dg}>%knCit=R8&;__k0JP WF}Fi4%B6Gw0000EX>4Tx04R}tkv&MmKpe$iQ?()$2MdZQWT;Md@e9XN#UfZJZG~1HOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|E;uQ=NQwVT3N2zhIPS;0dyl(!fKV?p)$E7@s%9Cf zcudUZR>Z(7{1`wNrZFNhQ%|H9GVmN<_we!cF2b|C&;2=imAuISpGX{Kx?vHo6VGf~ zI_G`j5GzRv@j3ChK^G)`9%C|}6B ztZ?4qtd^^+c~AbrU|w5JbDice;#foiNr;e9#Rkf-5TR8g#YBqsV;=q?$DbsZOs)+u za?GOw6_Voz|AXJ%nuW;;Hz^ncI$v!2V-yJN0*#t&e;?a+;{@ zj1?(+&EwtO?Y;ebrrF;Q-4Sxp!APwI00006VoOIv0J8wI0JA$(Ys3Hm010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=>r!B3K8PrE8zeD02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00KTqL_t(o!|jz%NEBfh#-I0_rQO0^5dz&)e_RQ=MI_@% zLFU^WEu5n}PKKMB16jd~wnn)USn!7eP$SZWDRl zTXuCd?U`#RJ6t-JBDVnKKz=l;d3BuUCJb{@DlIaf?@-mtA~FSFU}Z})a)Kc7*B#J8 zAw%GSh+H!D^>t1Vw8+H7+@>G%{Xvq`l1OBCQhc+&;qO!`%`j%xjE}$g7e}yd2Sj8J zBF8kJZ)0Cywf_UDl*{h!1|@CP`w&Y@x!ns;EY1sXf#gG-oLq>keb3I$qaxC;s*kl& sc|+hxRp22N8I3&eOS}_eV)g{T0DOZPds#=Qng9R*07*qoM6N<$f~*?$Gynhq literal 0 HcmV?d00001 diff --git a/Classes/Relics/Assets/Relic_PaperCut.png.import b/Classes/Relics/Assets/Relic_PaperCut.png.import new file mode 100644 index 00000000..f91aa7f4 --- /dev/null +++ b/Classes/Relics/Assets/Relic_PaperCut.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmd8hjrxxk4ic" +path="res://.godot/imported/Relic_PaperCut.png-c918160bd88b568b8e8ae4c716d26ae4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Classes/Relics/Assets/Relic_PaperCut.png" +dest_files=["res://.godot/imported/Relic_PaperCut.png-c918160bd88b568b8e8ae4c716d26ae4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index 5ac7013c..e0db9e2c 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -57,7 +57,7 @@ public struct BattleConfig public enum BattleEffectTrigger { NotePlaced, - NoteHit, + EnemyNoteHit, SelfNoteHit, OnPickup, OnLoop, diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index ca108708..ddce0208 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -170,6 +170,40 @@ public partial class Scribe : Node ), } ), + new RelicTemplate( + 4, + "Chips", + "Hitting an enemy note deals a bit of damage.", + GD.Load("res://Classes/Relics/Assets/Relic_Chips.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.EnemyNoteHit, + 1, + (director, self, val) => + { + director.Enemy.TakeDamage(val); + } + ), + } + ), + new RelicTemplate( + 5, + "Paper Cut", + "Deals damage each loop.", + GD.Load("res://Classes/Relics/Assets/Relic_PaperCut.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.OnLoop, + 5, + (director, self, val) => + { + director.Enemy.TakeDamage(val); + } + ), + } + ), }; public static readonly SongTemplate[] SongDictionary = new[] diff --git a/Globals/Translations/translations.csv b/Globals/Translations/translations.csv index 36684621..cbdfe8bf 100644 --- a/Globals/Translations/translations.csv +++ b/Globals/Translations/translations.csv @@ -50,6 +50,10 @@ RELIC_AUROBOROS_NAME,Auroboros,无尾蛇 RELIC_AUROBOROS_TOOLTIP,"Bigger number, better person. Increases combo multiplier every riff.","进一步增加综合倍数,每次现场提升" RELIC_COLORBOROS_NAME,Colorboros,彩蛇轮回 RELIC_COLORBOROS_TOOLTIP,"Taste the rainbow. Charges the freestyle bar every riff.","品尝临岛,每次现场充值自由格条" +RELIC_CHIPS_NAME,"Chips",薯片 +RELIC_CHIPS_TOOLTIP,"Hitting an enemy note deals a bit of damage.","击中敌方音符会造成少量伤害" +RELIC_PAPERCUT_NAME,Paper Cut,纸割伤 +RELIC_PAPERCUT_TOOLTIP,"Deals damage each loop.","每轮造成伤害" INVENTORY_TAB_NOTES,Notes,乐谱 INVENTORY_TAB_RELICS,Relics,遗物 OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置 diff --git a/scenes/BattleDirector/scripts/BattleDirector.cs b/scenes/BattleDirector/scripts/BattleDirector.cs index 76ab5963..c375a5ea 100644 --- a/scenes/BattleDirector/scripts/BattleDirector.cs +++ b/scenes/BattleDirector/scripts/BattleDirector.cs @@ -171,6 +171,10 @@ private void OnTimedInput(Note note, ArrowType arrowType, int beat, double beatD Timing timed = CheckTiming(beatDif); note.OnHit(this, timed); + + if (note.Name == "EnemyBase" && timed != Timing.Miss) //TODO: notes have owner field, find a way to determine if the owner is an enemy + EnemyNoteHit?.Invoke(this); + if (timed == Timing.Miss) { NotePlacementBar.MissNote(); @@ -252,6 +256,9 @@ private void ShowRewardSelection(int amount) private delegate void ChartLoopHandler(BattleDirector BD); private event ChartLoopHandler ChartLooped; + private delegate void EnemyNoteHitHandler(BattleDirector BD); + private event EnemyNoteHitHandler EnemyNoteHit; + private void AddEvent(IBattleEvent bEvent) { switch (bEvent.GetTrigger()) //TODO: Look into a way to get eventhandler from string @@ -262,6 +269,9 @@ private void AddEvent(IBattleEvent bEvent) case BattleEffectTrigger.OnLoop: ChartLooped += bEvent.OnTrigger; break; + case BattleEffectTrigger.EnemyNoteHit: + EnemyNoteHit += bEvent.OnTrigger; + break; } } From 5fbe08d53b215e4cff3e12e62024ba2beac712b6 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Wed, 26 Mar 2025 15:09:51 -0700 Subject: [PATCH 2/9] Added block mechanic New note type: shield, gives the player one charge of block - Block now appears above the health bar when any puppet has charge(s). - Block fully negates one source of damage and removes a charge. New relic: Chips, deals one point of damage whenever the player hits any note (should be balanced later) --- Classes/Notes/Assets/Note_PlayerBlock.png | Bin 0 -> 4344 bytes .../Notes/Assets/Note_PlayerBlock.png.import | 34 ++++++++++++++++++ Classes/Relics/Assets/Relic_Chips.png | Bin 1000 -> 2246 bytes Classes/Relics/Assets/Relic_Chips.png.import | 2 +- Globals/Scribe.cs | 14 ++++++++ Globals/Translations/translations.csv | 2 ++ SharedAssets/Shield.png | Bin 0 -> 677 bytes SharedAssets/Shield.png.import | 34 ++++++++++++++++++ scenes/Puppets/Enemies/BossBlood/Boss1.tscn | 19 ++++++++-- scenes/Puppets/Enemies/EnemyPuppet.tscn | 15 +++++++- .../Puppets/Enemies/Parasifly/Parasifly.tscn | 19 ++++++++-- scenes/Puppets/Enemies/TheGWS/GWS.tscn | 19 ++++++++-- scenes/Puppets/PlayerPuppet.tscn | 19 ++++++++-- scenes/Puppets/scripts/PuppetTemplate.cs | 34 ++++++++++++++++++ 14 files changed, 201 insertions(+), 10 deletions(-) create mode 100644 Classes/Notes/Assets/Note_PlayerBlock.png create mode 100644 Classes/Notes/Assets/Note_PlayerBlock.png.import create mode 100644 SharedAssets/Shield.png create mode 100644 SharedAssets/Shield.png.import diff --git a/Classes/Notes/Assets/Note_PlayerBlock.png b/Classes/Notes/Assets/Note_PlayerBlock.png new file mode 100644 index 0000000000000000000000000000000000000000..4e2cf3b960086b579f9c19d3aee4c714fc8fa96c GIT binary patch literal 4344 zcmeHKeNYo;8V{!uOe?na+iKk|?Ny+gY?56_wh0Upl$-_wWH4Gi+3da>R-xwsZx>FJ4dc3-oVv+H{tWHGdIj! z|09`Xcc1rpe(&@Ao{xEVyFF*wG}U~SLZO&u&9>yhD z_yazU_W(pH^8*Bgc}}4SU)z-{?7o1+4ctq75Er*Cu%Q3`o_CvG`u1Rf=gdLR@18>+ z-*)T3gTB7x%7qtq?cIOv(jVjAJl?u6qn7@-N8i)4^48*KH+A+T;YgD@;UBB7Zcb>e zsaU(m{b&KP_4z2)3C3>L*iJhuUSoqKRzqs^rrAc_XhyUx3 zllIj+kE~VTcGD6*`Se$Xy_eIAE>|BpYfv4Z zqTDq5xAE%MbJSVYmd@$h&UYTUgFfH!tC?$B9(MMowN`ZdZ&X&b*XcgHyFKPDZeEXN z?WHeQU1&@mh+__HSmJu~(4`l-FW!0YZ(rQ%U-yc;>_)#hZSj=7F=;i1i&8V%fgJk$ zwA9+)@@&EWnK#9o)~)lO+t_vPZtv6GdzydH_V~QNd}Auv=6tdAwNT)fN@Xewv#xYxWzbi;o=0{-o@B^P=ED zV&J2$x2kHG81h*4g7k-r1`gG)e(g|T@0OCoeHVV8ezB@i-M-=KgT9l(nH`>f@)wOPBXnuN}q=W0KyX#6rB?>(~oXIv^>=Qx=1V#dg# z>1ircn1TQTkZ2?fd z3a}iNXIVN30iVohktF#kjV2TdsY80TFW}Z_jYgve*J*S*3~FFvnOCC2m{&}YA)*)- zATj~oFY!JvB4g4nU#Vn9QMir_`6u{owqba$ILHFzLldU`8m$`F2!dv`g(zhOA;_RZ z-)SK_U`K26faog?Fd!=kyi&qw2$mVP_m>7dk#JZ>13W;0sv_J~J7&veR-1j;LZ-mY z3;u`|Bzuge#B(ELjqy!hiG(xS5okV)J4Smb_J}gnve_t$k13Vivs%okyg$YI7@nmf zw<$)QJ_WdNOv@2CMsO|`a~Vh@W^@@`I*z0DS{FSE%IXy*+RFeL3WBS7h@&-fgqC0c z#t}e|5js7Cxj2Tybfnf`;8KkQO}a)wtPJq5DrwJXuVg3|LZ#q12U2JTV~7;!4Q?bc z0}lPdNh2`ez~~~$s5dM_E%gNi8m5yMXgARKz3#{!GT~H)-D*a4YJ5au_s|jt4PX!O zUe*^9N0uDC0P-bT=2M$W=y4s9LXxCWPo|EtF8~1%)}oB6#nt+hh`F2?3WfuzrR7S6 z01-KihRO^8TJi-PKA*>o%1$A&ya@L%i-@8y@uo`({3`J|w{1+dlh{C851MQ+R zIJ)2@)C`ZpLB8an^F4kB^YA_H0HG%~85h43bWPATE(XS>JW*W}bd8IFaVbw!*Z++! z)yT^f@WK;N2)-&IZ*>0|zGlU`mM^m?PRZYw9K|hAGS#2GT2v_13Gy!{d^9}>g-Xe4 z%To4Cnm_BA)W7ezvIC0dNm))Q(-gjZOzaxBM}6mI!9jSelU literal 0 HcmV?d00001 diff --git a/Classes/Notes/Assets/Note_PlayerBlock.png.import b/Classes/Notes/Assets/Note_PlayerBlock.png.import new file mode 100644 index 00000000..74152ff5 --- /dev/null +++ b/Classes/Notes/Assets/Note_PlayerBlock.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhfeoc3nd6t4a" +path="res://.godot/imported/Note_PlayerBlock.png-9b2b822fe3c56ce932bb38c394998018.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Classes/Notes/Assets/Note_PlayerBlock.png" +dest_files=["res://.godot/imported/Note_PlayerBlock.png-9b2b822fe3c56ce932bb38c394998018.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Classes/Relics/Assets/Relic_Chips.png b/Classes/Relics/Assets/Relic_Chips.png index 74bdf235ca1f614e2d568afa7a199d39995296a9..60e766e07fc43ef8eb5ebcaea45a721aa5748472 100644 GIT binary patch delta 2235 zcmV;s2t@bj2gVVQBYyw{XF*Lt006O%3;baP0004lX+uL$Nkc;*aB^>EX>4Tx04R}t zkv&MmKpe$iQ>7vm2RmpH%ut=|q9Tr^ibb$c+6t{Ym|Xe=O&XFE7e~Rh;NZt%)xpJC zR|i)?5c~jf7n~Gbq{ROvg%&X$9QWhhy~o`mEM7-bHzq_qjjEfKo6S;1h{sOgAjz4dU5NOXs{#9AafjAwDOb zH0XlFk6f2se&bwnSm2or`)7q9O!+q?T>LFunV*rw*7r<+pQD8{|sDd9e=F}%zcvH=xC86U~n6_xbA53 z9&ot>3_t0TAvuztrcf*b?`QN)d0^-k=wEYtYwzRq0e{F+SIalR!67hFqU?2#clUMo z_V1Z?e?P{$a>%J(7A*h(010qNS#tmY9>M?s9>M``&~-il000McNliru=>r)Q9t|e( z%HaS22F6K5K~z}7)t7s0R9PLzKljd^x%23}Iy3EbW=dNqU8u;Twk|9*yUhv#)@7@x z+cadwNPl89K@wx)-zNUKf4Kh{qrpUD{DUq;vn~QF0?PtREp%Z^TPQ6sopz=(o%iF; z+?nGaT~Wdtm5t}0d(X{1=X}ojJA6#HUe_sJ zYx9X7k4f}z?Gw-a1isq4MRc3808B>HEZDqYvVRb2Y~bLbA?be#aA5DC$mBG>-MbpA z%T2jdVCwn=6DL1lI9fvln`v3u@x-QiDu8`^28EVbVE@2&Y>qnenH+^wlHAM`;Yft} zc#2Y{$eC;btFH}@$ITy({89R^01Wi+5~=BF-h88n4Qskd%|*z}&Ldayl=B&cRz^cc z=zkj5=ab~Z6P(FAP&{6m+u9!r@U9EXq#?c2Qq%LoaDuKX;XMJWQRnLaWD0 zqO2l{i==f2ezygioFksjbNJ!}Vd2CPT!zhI=g9Gs(o+E(*gGgDMo#m+J+I<(wv)R( zM`7U>g`*b$P-Q`&P$OcM?>_&%#bkKlt$#0aZd&5}>8qq1KI|B1TG_$DLqn4CIDoNh zlkDHVoz}Jx>EsOlmJ<1Z1J-TDRn3qxIItOI)@o5KCIxRIiGh;V7_@`0Y>z47-&U%jib&8!^+$qJicC|{ZXn$fhCr~2OoV}1Bwz}`W6n#(U$NPUE&Ky3(8v%(IUfqP0 zs8E>8qkfttA6hzr@=Ygh)9rhpHT~AzoM3jDC}jfZ4H8vf9p#|J{Kyz5rDl#_7`|`A z_k`i-cH6mrMN;N3m&6P@k=3$fTfxRN1UQ1wDexCph_Cn!hbTb*FJMb8Ee&m zCR8$MnM!$q`Ba9`+7`Gl{BRTO-my)rjL+b7Ek~1=xRwVLX2T^kS-~C6;havOIOnK} z4m8n-Dn-c|CvfT#zN#Q&gxLmIJq!5_ofMr0ve_hmiNN9E(FbN-<)7(x!Bp+=lQ z(5)~zU*+nxIDw!GuYXZN4Y)9@bRt;;ShE%C>^UqM6Rx@zR7J&@)-lzE; z!eW>Yu7+9h+5ilXKKeH7-`Xb@?p&uwt*~m-xL|`pHKYNLECd!uX z4fM1ciN-E*<5q%9O2c3@;R-b&FI!F3-b4-M?&38R6xD|6uBW6G_%Lh5(-e5*U31@E z@Z0x~OS^Y$6Q_pH5l|$2x`b9L5va>BH5J8Q=|C$LQOy=yp=Jt38@22L0Jb_SstT#a zIX<13Me?;hyMG|ry&Le0&@^GKJr6qs3UDEF>l^?HnDw^8Bi$?|fso==9k|kH;hin~h@gy3VJn zl;r;u;56W&A?d}Jw-M77E|<*s1EJ5S%H6kTQ0&_?DENPC{{Y-8=uPJmXdeIo002ov JPDHLkV1ltNN5B98 delta 979 zcmV;^11$W;5$FeyBYy#eX+uL$Nkc;*aB^>EX>4Tx04R}tkv&MmKpe$iQ?()$2MdZQ zWT;Md@e9XN#UfZJZG~1HOfLNpnlvOSE{=k0!NHHks)LKOt`4q(Aou~|E;uQ=NQwVT z3N2zhIPS;0dyl(!fKV?p)$E7@s%9CfcudUZR>Z(7{1`wNrhhRaF;h>Z7c%f1U-$6w z^)AA*ywCkPdX>D%0G~)4Wx8PzuM^K~S~}-_;t(rI3h_DdxIq^re&o9B@*C%(!vfC? z8JW}^afnzfwz1sCtYoOfQ^a9K)hJ)cx~y>C;;fddta(rV!eCxoPIH~+FydH50!fIF zQN;$zun?hDBY(w2iuPk3{vpSoB$rIC4KQ-dqXHF@;|KqP-`$#p$q6?p7y~+AZ2Myr z24l)zS@ca0rYQDSOT1-GANfz5RQp+20S{5pvPNNUa3` z000JJOGiWivjDRIvpZC4!~g&Q32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Rk0~ZGh zJ2_h7Hvj+t8FWQhbVF}#ZDnqB07G(RVRU6=Aa`kWXdp*PO;A^X4i^9b0l-N_K~z}7 z?UXTS6n{|=hX4QV?cNn?WnnOZ6c&QDjR>oR_Zs0W1W7*sK|1c+xJ_D61crWVxhQSH!#fn^Up9qMMXtL#lJ#fZC7c! z|4-Mg?F^KrjiO$^PH7tCK}atN+%Z{pccd`q-hU7{VZ48}YXL=)%u||R2&WLo?=cu0 zl`-c5j1&-gKfW6WxO4iDB%c^XV`gpbOX&)LrzD$@a+1@=`%YnP*Yx|xxv}xFu(k_w z6MzHonbHMjStnRK58xcg7{F@e{n=p$>h(!TZ_Aqh#E?(WXv`wdFA10h&>5OYdH~=u z$bZuUZgXmC2ILu%N6h;AyP=xD8~{Fm91qRr-jR0odXLQV@>fLBGXVQabNcs;ZqAe*Axx!f0$KvvN|FNrUKn!WcaBQNEb7NPpPLXa z%DKZqS^+Sj?d>g+H`r>0zvfq%>cv)6R8;);d("res://Classes/Notes/Assets/Note_PlayerBlock.png"), + null, + 1, + (director, note, timing) => + { + if (timing == Timing.Miss) + return; + director.Player.GainShield(note.GetBaseVal()); //todo: should scale with timing???? + } + ), }; public static readonly RelicTemplate[] RelicDictionary = new[] diff --git a/Globals/Translations/translations.csv b/Globals/Translations/translations.csv index cbdfe8bf..5a454f00 100644 --- a/Globals/Translations/translations.csv +++ b/Globals/Translations/translations.csv @@ -42,6 +42,8 @@ NOTE_PLAYERVAMPIRE_NAME,PlayerVampire,玩家吸血 NOTE_PLAYERVAMPIRE_TOOLTIP,"Steals health from enemy.","从敌人吸取生命值" NOTE_PLAYERQUARTER_NAME,PlayerQuarter,玩家一分之一 NOTE_PLAYERQUARTER_TOOLTIP,"Basic note at a quarter of the cost.","以四分之一的耗费时间量发出基础音符" +NOTE_PLAYERBLOCK_NAME,PlayerBlock,玩家格挡 +NOTE_PLAYERBLOCK_TOOLTIP,"Gives player one charge of block.","给予玩家一层格挡充能。" RELIC_BREAKFAST_NAME,Breakfast,早餐 RELIC_BREAKFAST_TOOLTIP,"Increases max hp.",提高最大生命值 RELIC_GOODVIBES_NAME,Good Vibes,良好消息 diff --git a/SharedAssets/Shield.png b/SharedAssets/Shield.png new file mode 100644 index 0000000000000000000000000000000000000000..ef7ebdcf23db74d012bb61fc66bc4d3e1ccc2e65 GIT binary patch literal 677 zcmV;W0$TlvP)EX>4Tx04R}tkv&MmKpe$iQ>7vm2Qx@<$WWauf)#NrRV;#q(pG5I!Q|2}Xws6T zxHt-~1qVMCs}3&Cx;nTDg5U>;yWphgA|?JWDYS_3;J6>}?mh0_0Ya^gBSkPB8T&FpP1eTCQ3KA4FP(c+IBDCtHm`Kxp+`}Jo{3&uNr-RIxLCBl=lDt02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{004bSL_t(o!|m0v5r7~NMA3zIti}qgjS8&BdNgww297)A zG;lYA46juSBAbN2%U<9Fwn*bJsHf{!J5SI85KtfpK90vdwNQW#UD2t+&00000 LNkvXXu0mjfbk`YV literal 0 HcmV?d00001 diff --git a/SharedAssets/Shield.png.import b/SharedAssets/Shield.png.import new file mode 100644 index 00000000..642ab775 --- /dev/null +++ b/SharedAssets/Shield.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bsg8b14xbddb6" +path="res://.godot/imported/Shield.png-c486d1322077e89abfccb7e98914abdd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://SharedAssets/Shield.png" +dest_files=["res://.godot/imported/Shield.png-c486d1322077e89abfccb7e98914abdd.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/scenes/Puppets/Enemies/BossBlood/Boss1.tscn b/scenes/Puppets/Enemies/BossBlood/Boss1.tscn index f7add1a0..cadd91f1 100644 --- a/scenes/Puppets/Enemies/BossBlood/Boss1.tscn +++ b/scenes/Puppets/Enemies/BossBlood/Boss1.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=8 format=3 uid="uid://bi5iqbwpsd381"] +[gd_scene load_steps=9 format=3 uid="uid://bi5iqbwpsd381"] [ext_resource type="Script" path="res://Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs" id="1_qj2oj"] [ext_resource type="Texture2D" uid="uid://veedngaorx3l" path="res://Scenes/Puppets/Enemies/BossBlood/Assets/Boss1.png" id="2_mul30"] [ext_resource type="Texture2D" uid="uid://b2iptr3o8rg4t" path="res://Scenes/Puppets/Enemies/BossBlood/Assets/Boss1EmissionShape.tres" id="3_yxnso"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="4_ffkxf"] +[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="5_pa2dv"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_3jiu6"] emission_shape = 4 @@ -22,12 +23,14 @@ colors = PackedColorArray(0.641048, 0.0406094, 0.0473231, 1) gradient = SubResource("Gradient_s7p55") width = 1 -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] script = ExtResource("1_qj2oj") _healthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) InitScale = Vector2(2, 2) +_shieldLogo = NodePath("Shield") +_shieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -32) @@ -47,3 +50,15 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 + +[node name="Shield" type="Sprite2D" parent="."] +position = Vector2(56, 20) +texture = ExtResource("5_pa2dv") + +[node name="ShieldText" type="Label" parent="Shield"] +offset_left = -13.0 +offset_top = -10.0 +offset_right = 13.0 +offset_bottom = 13.0 +text = "XX" +horizontal_alignment = 1 diff --git a/scenes/Puppets/Enemies/EnemyPuppet.tscn b/scenes/Puppets/Enemies/EnemyPuppet.tscn index 1c2672fe..eb525ada 100644 --- a/scenes/Puppets/Enemies/EnemyPuppet.tscn +++ b/scenes/Puppets/Enemies/EnemyPuppet.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=3 uid="uid://cwm0n2wu851nx"] +[gd_scene load_steps=4 format=3 uid="uid://cwm0n2wu851nx"] [ext_resource type="Script" path="res://Scenes/Puppets/Scripts/PuppetTemplate.cs" id="1_kgmh0"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="1_sxlrs"] +[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="2_xx60o"] [node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] script = ExtResource("1_kgmh0") @@ -10,6 +11,18 @@ Sprite = NodePath("Sprite") [node name="Sprite" type="Sprite2D" parent="."] +[node name="Shield" type="Sprite2D" parent="Sprite"] +position = Vector2(56, 20) +texture = ExtResource("2_xx60o") + +[node name="ShieldText" type="Label" parent="Sprite/Shield"] +offset_left = -13.0 +offset_top = -10.0 +offset_right = 13.0 +offset_bottom = 13.0 +text = "XX" +horizontal_alignment = 1 + [node name="ProgressBar" parent="." instance=ExtResource("1_sxlrs")] offset_left = -75.0 offset_top = 32.0 diff --git a/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn b/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn index f708d2cc..742e60dd 100644 --- a/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn +++ b/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn @@ -1,14 +1,17 @@ -[gd_scene load_steps=4 format=3 uid="uid://uvlux4t6h5de"] +[gd_scene load_steps=5 format=3 uid="uid://uvlux4t6h5de"] [ext_resource type="Script" path="res://Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs" id="1_ci2ca"] [ext_resource type="Texture2D" uid="uid://pngu3pw1pu4o" path="res://Scenes/Puppets/Enemies/Parasifly/Assets/Parasifly.png" id="2_g4o48"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_f74ri"] +[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_eemg7"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] script = ExtResource("1_ci2ca") _healthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) +_shieldLogo = NodePath("Shield") +_shieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -12) @@ -19,3 +22,15 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 + +[node name="Shield" type="Sprite2D" parent="."] +position = Vector2(56, 20) +texture = ExtResource("4_eemg7") + +[node name="ShieldText" type="Label" parent="Shield"] +offset_left = -13.0 +offset_top = -10.0 +offset_right = 13.0 +offset_bottom = 13.0 +text = "XX" +horizontal_alignment = 1 diff --git a/scenes/Puppets/Enemies/TheGWS/GWS.tscn b/scenes/Puppets/Enemies/TheGWS/GWS.tscn index 58c3fb82..951b9b8d 100644 --- a/scenes/Puppets/Enemies/TheGWS/GWS.tscn +++ b/scenes/Puppets/Enemies/TheGWS/GWS.tscn @@ -1,14 +1,17 @@ -[gd_scene load_steps=4 format=3 uid="uid://d1puw6fvmkrb5"] +[gd_scene load_steps=5 format=3 uid="uid://d1puw6fvmkrb5"] [ext_resource type="Script" path="res://Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs" id="1_dlike"] [ext_resource type="Texture2D" uid="uid://ci0a2h2eatjht" path="res://Scenes/Puppets/Enemies/TheGWS/Assets/GhostWolfSnake.png" id="2_77v4w"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_mr0it"] +[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_udalx"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] script = ExtResource("1_dlike") _healthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) +_shieldLogo = NodePath("Shield") +_shieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -54) @@ -19,3 +22,15 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 + +[node name="Shield" type="Sprite2D" parent="."] +position = Vector2(56, 20) +texture = ExtResource("4_udalx") + +[node name="ShieldText" type="Label" parent="Shield"] +offset_left = -13.0 +offset_top = -10.0 +offset_right = 13.0 +offset_bottom = 13.0 +text = "XX" +horizontal_alignment = 1 diff --git a/scenes/Puppets/PlayerPuppet.tscn b/scenes/Puppets/PlayerPuppet.tscn index 58e037d1..090dd233 100644 --- a/scenes/Puppets/PlayerPuppet.tscn +++ b/scenes/Puppets/PlayerPuppet.tscn @@ -1,14 +1,17 @@ -[gd_scene load_steps=4 format=3 uid="uid://eus17omen6yk"] +[gd_scene load_steps=5 format=3 uid="uid://eus17omen6yk"] [ext_resource type="Script" path="res://Scenes/Puppets/Scripts/PlayerPuppet.cs" id="1_f4rea"] [ext_resource type="Texture2D" uid="uid://b6fkei0i83vte" path="res://SharedAssets/Character1.png" id="2_affso"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_rechw"] +[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_5uc4u"] -[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] +[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] script = ExtResource("1_f4rea") _healthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(158, 125) +_shieldLogo = NodePath("Shield") +_shieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] texture = ExtResource("2_affso") @@ -18,3 +21,15 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 + +[node name="Shield" type="Sprite2D" parent="."] +position = Vector2(56, 20) +texture = ExtResource("4_5uc4u") + +[node name="ShieldText" type="Label" parent="Shield"] +offset_left = -13.0 +offset_top = -10.0 +offset_right = 13.0 +offset_bottom = 13.0 +text = "XX" +horizontal_alignment = 1 diff --git a/scenes/Puppets/scripts/PuppetTemplate.cs b/scenes/Puppets/scripts/PuppetTemplate.cs index accc9ec4..0737b8ef 100644 --- a/scenes/Puppets/scripts/PuppetTemplate.cs +++ b/scenes/Puppets/scripts/PuppetTemplate.cs @@ -29,6 +29,13 @@ public partial class PuppetTemplate : Node2D protected int _currentHealth = 100; //Stats would go here. + protected int _numShield = 0; //todo: shield mechanic to block / dodge damage + + [Export] + public Sprite2D _shieldLogo; + + [Export] + public Label _shieldText; protected string UniqName = ""; //Eventually make subclasses/scenes/real stuff @@ -39,6 +46,9 @@ public override void _Ready() Sprite.Scale = InitScale; _healthBar.Visible = !hideHealth; + + if (_numShield == 0) + _shieldLogo.Visible = false; } public override void _Process(double delta) @@ -111,6 +121,22 @@ protected virtual void DamageAnimate(int amount) public virtual void TakeDamage(int amount) { + GD.Print($"Taking Damage: {amount}, with shield count: {_numShield}"); + if (_numShield > 0 && amount > 0) + { + _numShield--; + _shieldText.Text = $"{_numShield}"; + if (_numShield == 0) + _shieldLogo.Visible = false; + + TextParticle blockText = new TextParticle(); + blockText.Modulate = Colors.White; //white text for blocked damage + Sprite.AddChild(blockText); + blockText.Text = "-0"; //blocked damage is 0 + + return; + } + amount = Math.Max(0, amount); //Should not be able to heal from damage. if (_currentHealth <= 0 || amount == 0) return; //Only check if hp would change @@ -120,6 +146,7 @@ public virtual void TakeDamage(int amount) { Defeated?.Invoke(this); } + TextParticle newText = new TextParticle(); newText.Modulate = Colors.Red; Sprite.AddChild(newText); @@ -143,4 +170,11 @@ public int GetCurrentHealth() { return _currentHealth; } + + public virtual void GainShield(int amount) + { + _shieldLogo.Visible = true; + _numShield += amount; + _shieldText.Text = $"{_numShield}"; + } } From cbbe0fa610e3dc89e0d6ab78d68e7ac1aaeb91b7 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Tue, 1 Apr 2025 14:53:51 -0700 Subject: [PATCH 3/9] Fixing errors from merge --- Scenes/BattleDirector/BattleScene.tscn | 4 ++-- scenes/Puppets/Enemies/BossBlood/Boss1.tscn | 6 +++--- scenes/Puppets/Enemies/EnemyPuppet.tscn | 6 ++++-- scenes/Puppets/Enemies/Parasifly/Parasifly.tscn | 6 +++--- scenes/Puppets/Enemies/TheGWS/GWS.tscn | 6 +++--- scenes/Puppets/PlayerPuppet.tscn | 6 +++--- scenes/Puppets/scripts/PuppetTemplate.cs | 16 ++++++++-------- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Scenes/BattleDirector/BattleScene.tscn b/Scenes/BattleDirector/BattleScene.tscn index 3d5d96d2..6af6318e 100644 --- a/Scenes/BattleDirector/BattleScene.tscn +++ b/Scenes/BattleDirector/BattleScene.tscn @@ -17,12 +17,12 @@ gradient = SubResource("Gradient_8uy3a") fill_from = Vector2(1, 0) fill_to = Vector2(0.738532, 1) -[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("CM", "NPB", "CD", "Audio", "_focusedButton")] +[node name="ProtoBattleDirector" type="Node2D" node_paths=PackedStringArray("CD", "CM", "NPB", "Audio", "_focusedButton")] process_mode = 1 script = ExtResource("1_jmdo1") +CD = NodePath("Conductor") CM = NodePath("SubViewport") NPB = NodePath("NotePlacementBar") -CD = NodePath("Conductor") Audio = NodePath("AudioStreamPlayer") _focusedButton = NodePath("StartButton") metadata/_edit_lock_ = true diff --git a/scenes/Puppets/Enemies/BossBlood/Boss1.tscn b/scenes/Puppets/Enemies/BossBlood/Boss1.tscn index 3ce17df7..e28e70a4 100644 --- a/scenes/Puppets/Enemies/BossBlood/Boss1.tscn +++ b/scenes/Puppets/Enemies/BossBlood/Boss1.tscn @@ -23,14 +23,14 @@ colors = PackedColorArray(0.641048, 0.0406094, 0.0473231, 1) gradient = SubResource("Gradient_s7p55") width = 1 -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] script = ExtResource("1_qj2oj") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) InitScale = Vector2(2, 2) -_shieldLogo = NodePath("Shield") -_shieldText = NodePath("Shield/ShieldText") +ShieldLogo = NodePath("Shield") +ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -32) diff --git a/scenes/Puppets/Enemies/EnemyPuppet.tscn b/scenes/Puppets/Enemies/EnemyPuppet.tscn index eb525ada..627a8d54 100644 --- a/scenes/Puppets/Enemies/EnemyPuppet.tscn +++ b/scenes/Puppets/Enemies/EnemyPuppet.tscn @@ -4,10 +4,12 @@ [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="1_sxlrs"] [ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="2_xx60o"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] script = ExtResource("1_kgmh0") -_healthBar = NodePath("ProgressBar") +HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") +ShieldLogo = NodePath("Sprite/Shield") +ShieldText = NodePath("Sprite/Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] diff --git a/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn b/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn index 9027c630..8911c62a 100644 --- a/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn +++ b/scenes/Puppets/Enemies/Parasifly/Parasifly.tscn @@ -5,13 +5,13 @@ [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_f74ri"] [ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_eemg7"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] script = ExtResource("1_ci2ca") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) -_shieldLogo = NodePath("Shield") -_shieldText = NodePath("Shield/ShieldText") +ShieldLogo = NodePath("Shield") +ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -12) diff --git a/scenes/Puppets/Enemies/TheGWS/GWS.tscn b/scenes/Puppets/Enemies/TheGWS/GWS.tscn index b0eca09f..7981bef7 100644 --- a/scenes/Puppets/Enemies/TheGWS/GWS.tscn +++ b/scenes/Puppets/Enemies/TheGWS/GWS.tscn @@ -5,13 +5,13 @@ [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_mr0it"] [ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_udalx"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] script = ExtResource("1_dlike") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(500, 125) -_shieldLogo = NodePath("Shield") -_shieldText = NodePath("Shield/ShieldText") +ShieldLogo = NodePath("Shield") +ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -54) diff --git a/scenes/Puppets/PlayerPuppet.tscn b/scenes/Puppets/PlayerPuppet.tscn index 4c933ca8..194a3c3b 100644 --- a/scenes/Puppets/PlayerPuppet.tscn +++ b/scenes/Puppets/PlayerPuppet.tscn @@ -5,13 +5,13 @@ [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_rechw"] [ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_5uc4u"] -[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("_healthBar", "Sprite", "_shieldLogo", "_shieldText")] +[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] script = ExtResource("1_f4rea") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") StartPos = Vector2(158, 125) -_shieldLogo = NodePath("Shield") -_shieldText = NodePath("Shield/ShieldText") +ShieldLogo = NodePath("Shield") +ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] texture = ExtResource("2_affso") diff --git a/scenes/Puppets/scripts/PuppetTemplate.cs b/scenes/Puppets/scripts/PuppetTemplate.cs index bc297927..4837cbdb 100644 --- a/scenes/Puppets/scripts/PuppetTemplate.cs +++ b/scenes/Puppets/scripts/PuppetTemplate.cs @@ -32,10 +32,10 @@ public partial class PuppetTemplate : Node2D protected int _numShield = 0; //todo: shield mechanic to block / dodge damage [Export] - public Sprite2D _shieldLogo; + public Sprite2D ShieldLogo; [Export] - public Label _shieldText; + public Label ShieldText; protected string UniqName = ""; //Eventually make subclasses/scenes/real stuff @@ -45,10 +45,10 @@ public override void _Ready() Position = StartPos; Sprite.Scale = InitScale; - _healthBar.Visible = !hideHealth; + HealthBar.Visible = !HideHealth; if (_numShield == 0) - _shieldLogo.Visible = false; + ShieldLogo.Visible = false; } public override void _Process(double delta) @@ -125,9 +125,9 @@ public virtual void TakeDamage(int amount) if (_numShield > 0 && amount > 0) { _numShield--; - _shieldText.Text = $"{_numShield}"; + ShieldText.Text = $"{_numShield}"; if (_numShield == 0) - _shieldLogo.Visible = false; + ShieldLogo.Visible = false; TextParticle blockText = new TextParticle(); blockText.Modulate = Colors.White; //white text for blocked damage @@ -173,8 +173,8 @@ public int GetCurrentHealth() public virtual void GainShield(int amount) { - _shieldLogo.Visible = true; + ShieldLogo.Visible = true; _numShield += amount; - _shieldText.Text = $"{_numShield}"; + ShieldText.Text = $"{_numShield}"; } } From 79532172cf3023d00e07a8cb765d3d51db2cd4cb Mon Sep 17 00:00:00 2001 From: cornerloan Date: Mon, 7 Apr 2025 01:32:15 -0700 Subject: [PATCH 4/9] added 2 new relics, 1 new note type, block mechanic -added relic "chips": deal damage when any note is hit -added relic "paper cut": deal damage each loop -added note "shield": gain 1 charge of block -added block mechanic: currently the shield note type gives 1 charge of block (stacking), which fully negates 1 instance of damage --- Globals/FunkEngineNameSpace.cs | 2 +- Globals/Scribe.cs | 12 +++++----- Globals/Translations/Translations.csv | 2 +- .../BattleDirector/Scripts/BattleDirector.cs | 23 +++++++++++++++++-- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index 0d1edb8d..9901b057 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -225,7 +225,7 @@ public enum Timing public enum BattleEffectTrigger { NotePlaced, - EnemyNoteHit, + NoteHit, SelfNoteHit, OnPickup, OnLoop, diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index 3466388f..e6bc0a57 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -186,16 +186,16 @@ public partial class Scribe : Node new RelicTemplate( 4, "Chips", - "Hitting an enemy note deals a bit of damage.", + "Hitting a note deals a bit of damage.", GD.Load("res://Classes/Relics/Assets/Relic_Chips.png"), new RelicEffect[] { new RelicEffect( - BattleEffectTrigger.EnemyNoteHit, + BattleEffectTrigger.NoteHit, 1, - (director, self, val) => + (e, self, val) => { - director.Enemy.TakeDamage(val); + e.BD.Enemy.TakeDamage(val); } ), } @@ -210,9 +210,9 @@ public partial class Scribe : Node new RelicEffect( BattleEffectTrigger.OnLoop, 5, - (director, self, val) => + (e, self, val) => { - director.Enemy.TakeDamage(val); + e.BD.Enemy.TakeDamage(val); } ), } diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 3baa8e0f..0d5effb6 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -53,7 +53,7 @@ RELIC_AUROBOROS_TOOLTIP,"Bigger number, better person. Increases combo multiplie RELIC_COLORBOROS_NAME,Colorboros,彩蛇轮回 RELIC_COLORBOROS_TOOLTIP,"Taste the rainbow. Charges the freestyle bar every riff.","品尝临岛,每次现场充值自由格条" RELIC_CHIPS_NAME,"Chips",薯片 -RELIC_CHIPS_TOOLTIP,"Hitting an enemy note deals a bit of damage.","击中敌方音符会造成少量伤害" +RELIC_CHIPS_TOOLTIP,"Hitting a note deals a bit of damage.","击中音符会造成少量伤害。" RELIC_PAPERCUT_NAME,Paper Cut,纸割伤 RELIC_PAPERCUT_TOOLTIP,"Deals damage each loop.","每轮造成伤害" INVENTORY_TAB_NOTES,Notes,乐谱 diff --git a/Scenes/BattleDirector/Scripts/BattleDirector.cs b/Scenes/BattleDirector/Scripts/BattleDirector.cs index 60e66ed5..549b723f 100644 --- a/Scenes/BattleDirector/Scripts/BattleDirector.cs +++ b/Scenes/BattleDirector/Scripts/BattleDirector.cs @@ -167,6 +167,7 @@ private void OnTimedInput(ArrowData data, double beatDif) Timing timed = CheckTiming(beatDif); data.NoteRef.OnHit(this, timed); + Harbinger.Instance.InvokeNoteHit(data.NoteRef); NPB.HandleTiming(timed, data.Type); CM.ComboText(timed, data.Type, NPB.GetCurrentCombo()); } @@ -255,8 +256,8 @@ private void AddEvent(IBattleEvent bEvent) case BattleEffectTrigger.OnLoop: Harbinger.Instance.ChartLooped += bEvent.OnTrigger; break; - case BattleEffectTrigger.EnemyNoteHit: - EnemyNoteHit += bEvent.OnTrigger; + case BattleEffectTrigger.NoteHit: + Harbinger.Instance.NoteHit += bEvent.OnTrigger; break; } } @@ -331,6 +332,16 @@ public class LoopEventArgs(BattleDirector bd, int incomingLoop) : BattleEventArg public int Loop = incomingLoop; } + /// + /// Event Args to handle notes being hit + /// + /// The BattleDirector calling the event. + /// The Note being hit. + public class NotHitArgs(BattleDirector bd, Note note) : BattleEventArgs(bd) + { + public Note Note = note; + } + internal delegate void NotePlacedHandler(BattleEventArgs e); internal event NotePlacedHandler NotePlaced; @@ -346,6 +357,14 @@ public void InvokeChartLoop(int incLoop) { ChartLooped?.Invoke(new LoopEventArgs(_curDirector, incLoop)); } + + internal delegate void NoteHitHandler(BattleEventArgs e); + internal event NoteHitHandler NoteHit; + + public void InvokeNoteHit(Note note) + { + NoteHit?.Invoke(new NotHitArgs(_curDirector, note)); + } } private void DebugKillEnemy() From 1b0aa23688b3651a70134bb965ce8b5cb3fd5c10 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Thu, 10 Apr 2025 00:24:56 -0700 Subject: [PATCH 5/9] Added rarities to items still need to redo GetRandomRelics() in scribe to account for rarities, might wait until more items implemented. --- Classes/Relics/RelicTemplate.cs | 6 +++++- Globals/FunkEngineNameSpace.cs | 10 ++++++++++ Globals/Scribe.cs | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Classes/Relics/RelicTemplate.cs b/Classes/Relics/RelicTemplate.cs index 3e51c656..5ae354ab 100644 --- a/Classes/Relics/RelicTemplate.cs +++ b/Classes/Relics/RelicTemplate.cs @@ -13,10 +13,13 @@ public partial class RelicTemplate : Resource, IDisplayable public Texture2D Texture { get; set; } public string Tooltip { get; set; } + public Rarity Rarity { get; set; } + public RelicTemplate( int id, string name = "", string tooltip = "", + Rarity rarity = Rarity.Common, Texture2D texture = null, RelicEffect[] effectTags = null ) @@ -26,11 +29,12 @@ public RelicTemplate( Name = name; Tooltip = tooltip; Texture = texture; + Rarity = rarity; } public RelicTemplate Clone() { - RelicTemplate newRelic = new RelicTemplate(Id, Name, Tooltip, Texture, Effects); + RelicTemplate newRelic = new RelicTemplate(Id, Name, Tooltip, Rarity, Texture, Effects); return newRelic; } } diff --git a/Globals/FunkEngineNameSpace.cs b/Globals/FunkEngineNameSpace.cs index 9901b057..0a89da57 100644 --- a/Globals/FunkEngineNameSpace.cs +++ b/Globals/FunkEngineNameSpace.cs @@ -241,6 +241,16 @@ public enum Stages Map, Load, } + +public enum Rarity +{ + Common, + Uncommon, + Rare, + Epic, + Legendary, + Breakfast, +} #endregion /** diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index e6bc0a57..531097fd 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -116,6 +116,7 @@ public partial class Scribe : Node 0, "Breakfast", //Reference ha ha, Item to give when relic pool is empty. "Increases max hp.", //TODO: Description can include the relics values? + Rarity.Breakfast, GD.Load("res://Classes/Relics/Assets/Relic_Breakfast.png"), new RelicEffect[] { @@ -134,6 +135,7 @@ public partial class Scribe : Node 1, "Good Vibes", "Heals the player whenever they place a note.", + Rarity.Common, GD.Load("res://Classes/Relics/Assets/Relic_GoodVibes.png"), new RelicEffect[] { @@ -151,6 +153,7 @@ public partial class Scribe : Node 2, "Auroboros", "Bigger number, better person. Increases combo multiplier every riff.", + Rarity.Common, GD.Load("res://Classes/Relics/Assets/Relic_Auroboros.png"), new RelicEffect[] { @@ -169,6 +172,7 @@ public partial class Scribe : Node 3, "Colorboros", "Taste the rainbow. Charges the freestyle bar every riff.", + Rarity.Common, GD.Load("res://Classes/Relics/Assets/Relic_Colorboros.png"), new RelicEffect[] { @@ -187,6 +191,7 @@ public partial class Scribe : Node 4, "Chips", "Hitting a note deals a bit of damage.", + Rarity.Common, GD.Load("res://Classes/Relics/Assets/Relic_Chips.png"), new RelicEffect[] { @@ -204,6 +209,7 @@ public partial class Scribe : Node 5, "Paper Cut", "Deals damage each loop.", + Rarity.Common, GD.Load("res://Classes/Relics/Assets/Relic_PaperCut.png"), new RelicEffect[] { From 6b7b9845b51bcad7dba8d50d8e2967ca62ceb72d Mon Sep 17 00:00:00 2001 From: cornerloan Date: Thu, 10 Apr 2025 14:20:47 -0700 Subject: [PATCH 6/9] Updated to include Michael's relic Added 4 new relics: -Energy Drink: decreases max combo bar on pickup - Bandage: heals player after each combat - Medkit: heals player after each loop - Vinyl record: all loop effects trigger twice (excluding vinyl record) --- Classes/Relics/Assets/Relic_Bandage.png | Bin 0 -> 775 bytes .../Relics/Assets/Relic_Bandage.png.import | 34 ++++++++ Classes/Relics/Assets/Relic_EnergyDrink.png | Bin 0 -> 911 bytes .../Assets/Relic_EnergyDrink.png.import | 34 ++++++++ Classes/Relics/Assets/Relic_Medkit.png | Bin 0 -> 668 bytes Classes/Relics/Assets/Relic_Medkit.png.import | 34 ++++++++ Classes/Relics/Assets/Relic_VinylRecord.png | Bin 0 -> 868 bytes .../Assets/Relic_VinylRecord.png.import | 34 ++++++++ Globals/FunkEngineNameSpace.cs | 2 + Globals/Scribe.cs | 77 ++++++++++++++++++ Globals/Translations/Translations.csv | 8 ++ .../BattleDirector/Scripts/BattleDirector.cs | 31 +++++-- .../Scripts/NotePlacementBar.cs | 1 + Scenes/Puppets/Scripts/PlayerStats.cs | 1 + 14 files changed, 248 insertions(+), 8 deletions(-) create mode 100644 Classes/Relics/Assets/Relic_Bandage.png create mode 100644 Classes/Relics/Assets/Relic_Bandage.png.import create mode 100644 Classes/Relics/Assets/Relic_EnergyDrink.png create mode 100644 Classes/Relics/Assets/Relic_EnergyDrink.png.import create mode 100644 Classes/Relics/Assets/Relic_Medkit.png create mode 100644 Classes/Relics/Assets/Relic_Medkit.png.import create mode 100644 Classes/Relics/Assets/Relic_VinylRecord.png create mode 100644 Classes/Relics/Assets/Relic_VinylRecord.png.import diff --git a/Classes/Relics/Assets/Relic_Bandage.png b/Classes/Relics/Assets/Relic_Bandage.png new file mode 100644 index 0000000000000000000000000000000000000000..f9cbc9c990997665bd03c541ec3e5ef50aad51ac GIT binary patch literal 775 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jPK-BC>eK@{oCO|{#S9GG z!XV7ZFl&wkPyt_nPlzi}@;?Up$G`wY5OFvIt1_S4L zu5#AO_4fVGiqlJviNR~;9uwe^Wly5|0N^r3pW2vOQ=51D)PLdJK(^t-pQYNCn%o!(KY+|QWoXM z?u^I2pWr$o_xYc2T8;9l6BYf@kJfcCC_mO^lY2S)1eZibiiG6)OyjtRfqTxZsh#$096dwm0g2nOaq8qHHK3G%Qm zlIltK<+GZTmSB=eK@{oCO|{#S9GG z!XV7ZFl&wkP=RTHPlzi}@*e}ke+&c>gi8S#Xd-Ye5GiC?Og2O@L>!Y16u~NmCJ5xh zMIa0~7w#Bj1|C_s6p#T&aA!bd(bOQz3P!uC0s}6+B*-tALGeGQu8EkljDeQQu5bTs z`#!TIw9f2mIwGpQdv(D{M&5&^>`%JcqTcPRbo(G(bCr2(?}4BGJc-v-<-J3zCkVtX ztM@UJxEW-nE@^z@;}*ZPH5)w_%zE*#CH=y^*NdOFCtntRzQ|*T(n8H>V4O90x;TbZ z%(;8P+uJEnfc?YI)hnmOsB|5Y6Oo#7y)`g!;=+U-M&cLk7QOIx6$lLE%#Cu>@9v7b za9S>fUweYnsnfc?pRawqday z9nT(X3cr}g-Ov#i%p#1o1`YPckX!9(0SFn@o~TS zs|U{;oy8*aPM5EJ&U7_-x#GfOX;u~wvdlYXZSq`~;jsHR*4#UW|8Iv{KMyjWZ!tAkcE(>$3&m3H zAGMZGZ}FuwWOIhGh6cUnQ1juK=X!FlSlGtWI;Q3o8Sz3k-OnaT-m`dbW8}Yko9yO| zKg3_OU9ZruFp0Z%XvI9EIFEO_zr!BvcD;T|cJ{%^_6HkSAM2F;wmN<(Z9{0U+1wPS zixcMfNNPWoSYza|$X9G(C1?40gjpC8D+H0ZKgyTo=jF!~uhUHx3v IIVCg!0NCYeM*si- literal 0 HcmV?d00001 diff --git a/Classes/Relics/Assets/Relic_EnergyDrink.png.import b/Classes/Relics/Assets/Relic_EnergyDrink.png.import new file mode 100644 index 00000000..b564e084 --- /dev/null +++ b/Classes/Relics/Assets/Relic_EnergyDrink.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bi678rx26dxdd" +path="res://.godot/imported/Relic_EnergyDrink.png-31545a8db92a3c6cae482d1f8ecceff0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Classes/Relics/Assets/Relic_EnergyDrink.png" +dest_files=["res://.godot/imported/Relic_EnergyDrink.png-31545a8db92a3c6cae482d1f8ecceff0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Classes/Relics/Assets/Relic_Medkit.png b/Classes/Relics/Assets/Relic_Medkit.png new file mode 100644 index 0000000000000000000000000000000000000000..dfe770ca505cb59448fca19ccb67f4ba984597b4 GIT binary patch literal 668 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jPK-BC>eK@{oCO|{#S9GG z!XV7ZFl&wkQ1E$xPlzj!{trg~UI3|4mz^&#bq~eQ3ku!RE$Z zzeU1RcvjHO3yY?7`3cNvv{&6-ny}(Vo#HF4W9A2{ck$m|V0o=fl-ED~>|&O<*X>1z z@BBQ>+yx5$ubwWBAr*6yQxq5^+(jp>Z4l)6XJD|w=wFjYLVC)da|aH7;a%78SYP_F zI2&8sG5; zP5!6Ljr>z2=bza3@1XLRm(R;9k5w-+V7*f>zwz&ngG*Vq{AT;D&ZcMADa|wM`PO%T z4Sv-~r?Bq-P^x=u_5B?s4bSRDEEq!${Fry}gGCJE?vIAACyS-m-7u0%+F*Yw?N~*O z!-L7kIREy4ud~>{hbcs1{jT=LgFn8hU*COR;@|%g>m#XEaWPfx>W>qT`A2p2M6+ea f^k^w~Gcx>>2v&Ub`ENBa02n-7{an^LB{Ts5U?KsI literal 0 HcmV?d00001 diff --git a/Classes/Relics/Assets/Relic_Medkit.png.import b/Classes/Relics/Assets/Relic_Medkit.png.import new file mode 100644 index 00000000..518fd23e --- /dev/null +++ b/Classes/Relics/Assets/Relic_Medkit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wtddl5ssgrm3" +path="res://.godot/imported/Relic_Medkit.png-44673854c4fdf8be51048f39e6d245d1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Classes/Relics/Assets/Relic_Medkit.png" +dest_files=["res://.godot/imported/Relic_Medkit.png-44673854c4fdf8be51048f39e6d245d1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Classes/Relics/Assets/Relic_VinylRecord.png b/Classes/Relics/Assets/Relic_VinylRecord.png new file mode 100644 index 0000000000000000000000000000000000000000..0191c7a31586836f7ac36c630745fb072e454c78 GIT binary patch literal 868 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jPK-BC>eK@{oCO|{#S9GG z!XV7ZFl&wkP=Q*2Plzi}@;?K^KNteCAzTOpSqhIDWGz5t$XvKN5C%jRO%NBC7{zew zkQqQWoQr8VTnfT~I}9$4CIaM6XIN_v45_4&AirP+mQBKQGV5OacbjltN$Y>tC7V}o zx2*7C{>Hc&chPrS#KZ>#NR9@=VlVBciJoaAGLqV)ra%$) z55)!{F7ARkUR$Pn2)6cn6+ZUy4Scf8b?b}WJB4pWxak*63|N-<#lY~0m@B{Wg^#&v zvC2tm8qv4z-Z{P3{+#8XogBGh|F|1&uuPb+R&U4Dt1O~VA{beLa6tuQKr)|(r{L?T znyG1}GZuafWU2D@s#z)ZVcMk!!Td?LS~LY2jF+7`DfS?dMR>}?a}wgs8;iF6e7eeawk46Uoa>A+6IdiW{&?@cX)J3 z{CYSuNO6aV+NE$+)b>+o{fL9M1c>r&n|C_Xq*cQWt9n&Zuf ze_qydn17c4ijUqun@V4y$5FZ#kv5v@Uu`1qS{(>dWw_$h_Ra9pUw((E1zCmtehfPK z6C=Zz_Uy|Dy1ehIZ_x*Z8@tO781?;|wdPL3VYlh!Z`ZDVnVKojW60m`("res://Classes/Relics/Assets/Relic_EnergyDrink.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.OnPickup, + 10, + (e, self, val) => + { + StageProducer.PlayerStats.MaxComboBar -= val; + } + ), + } + ), + new RelicTemplate( + 7, + "Bandage", + "A clean strip of cloth. Use it after a fight to patch up and feel better.", + Rarity.Common, + GD.Load("res://Classes/Relics/Assets/Relic_Bandage.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.OnBattleEnd, + 10, + (e, self, val) => + { + StageProducer.PlayerStats.CurrentHealth += val; + } + ), + } + ), + new RelicTemplate( + 8, + "Medkit", + "A small kit with medical supplies. Heals you a bit after each loop.", + Rarity.Common, + GD.Load("res://Classes/Relics/Assets/Relic_Medkit.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.OnLoop, + 5, + (e, self, val) => + { + e.BD.Player.Heal(val); + } + ), + } + ), + new RelicTemplate( + 9, + "Vinyl Record", + "Right round, right round. All loop effects trigger twice.", + Rarity.Legendary, + GD.Load("res://Classes/Relics/Assets/Relic_VinylRecord.png"), + new RelicEffect[] + { + new RelicEffect( + BattleEffectTrigger.OnLoop, + 0, + (e, self, val) => + { + if ( + (e is BattleDirector.Harbinger.LoopEventArgs eLoop) + && !eLoop.ArtificialLoop + ) + BattleDirector.Harbinger.Instance.InvokeChartLoop(eLoop.Loop); + } + ), + } + ), }; public static readonly SongTemplate[] SongDictionary = new[] @@ -285,6 +361,7 @@ public static RelicTemplate[] GetRandomRelics(RelicTemplate[] excludedRelics, in { availableRelics = availableRelics.Append(RelicDictionary[0].Clone()).ToArray(); } + return availableRelics; } diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 0d5effb6..3957214b 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -56,6 +56,14 @@ RELIC_CHIPS_NAME,"Chips",薯片 RELIC_CHIPS_TOOLTIP,"Hitting a note deals a bit of damage.","击中音符会造成少量伤害。" RELIC_PAPERCUT_NAME,Paper Cut,纸割伤 RELIC_PAPERCUT_TOOLTIP,"Deals damage each loop.","每轮造成伤害" +RELIC_ENERGYDRINK_NAME,Energy Drink,"能量饮料" +RELIC_ENERGYDRINK_TOOLTIP,"Take a chance to cool down and sip an energy drink to increase your max energy bar.","碰碰运气,喝一口能量饮料来冷静下来并增加你的最大能量条。" +RELIC_BANDAGE_NAME,Bandage,"绷带" +RELIC_BANDAGE_TOOLTIP,"A clean strip of cloth. Use it after a fight to patch up and feel better.","一块干净的布条,战斗后使用来包扎并恢复一些健康。" +RELIC_MEDKIT_NAME,Medkit,"急救包" +RELIC_MEDKIT_TOOLTIP,"A small kit with medical supplies. Heals you a bit after each loop.","包含一些医疗用品的小包,每次循环后恢复少量生命。" +RELIC_VINYLRECORD_NAME,Vinyl Record,"黑胶唱片" +RELIC_VINYLRECORD_TOOLTIP,"Right round, right round. All loop effects trigger twice.","把我转起来,把我转起来。所有循环效果触发两次。" INVENTORY_TAB_NOTES,Notes,乐谱 INVENTORY_TAB_RELICS,Relics,遗物 OPTIONS_VOLUME_LABEL,Master Volume,最终音量设置 diff --git a/Scenes/BattleDirector/Scripts/BattleDirector.cs b/Scenes/BattleDirector/Scripts/BattleDirector.cs index 549b723f..e6a33ad3 100644 --- a/Scenes/BattleDirector/Scripts/BattleDirector.cs +++ b/Scenes/BattleDirector/Scripts/BattleDirector.cs @@ -46,6 +46,7 @@ private bool PlayerAddNote(ArrowType type, Beat beat) CD.AddPlayerNote(noteToPlace, type, beat); Harbinger.Instance.InvokeNotePlaced(new ArrowData(type, beat, noteToPlace)); + Harbinger.Instance.InvokeNoteHit(noteToPlace, Timing.Okay); //TODO: test how this feels? maybe take it out later return true; } @@ -131,7 +132,7 @@ private void UpdateBeat(Beat beat) } if (beat.Loop > TimeKeeper.LastBeat.Loop) { - Harbinger.Instance.InvokeChartLoop(beat.Loop); + Harbinger.Instance.InvokeChartLoop(beat.Loop, false); } TimeKeeper.LastBeat = beat; } @@ -167,7 +168,7 @@ private void OnTimedInput(ArrowData data, double beatDif) Timing timed = CheckTiming(beatDif); data.NoteRef.OnHit(this, timed); - Harbinger.Instance.InvokeNoteHit(data.NoteRef); + Harbinger.Instance.InvokeNoteHit(data.NoteRef, timed); NPB.HandleTiming(timed, data.Type); CM.ComboText(timed, data.Type, NPB.GetCurrentCombo()); } @@ -259,6 +260,9 @@ private void AddEvent(IBattleEvent bEvent) case BattleEffectTrigger.NoteHit: Harbinger.Instance.NoteHit += bEvent.OnTrigger; break; + case BattleEffectTrigger.OnBattleEnd: + Harbinger.Instance.BattleEnded += bEvent.OnTrigger; + break; } } @@ -327,9 +331,11 @@ public class NoteEventArgs(BattleDirector bd, ArrowData data) : BattleEventArgs( /// /// The BattleDirector calling the event. /// The loop starting. - public class LoopEventArgs(BattleDirector bd, int incomingLoop) : BattleEventArgs(bd) + public class LoopEventArgs(BattleDirector bd, int incomingLoop, bool artificialLoop = true) + : BattleEventArgs(bd) { public int Loop = incomingLoop; + public bool ArtificialLoop = artificialLoop; } /// @@ -337,9 +343,10 @@ public class LoopEventArgs(BattleDirector bd, int incomingLoop) : BattleEventArg /// /// The BattleDirector calling the event. /// The Note being hit. - public class NotHitArgs(BattleDirector bd, Note note) : BattleEventArgs(bd) + public class NoteHitArgs(BattleDirector bd, Note note, Timing timing) : BattleEventArgs(bd) { public Note Note = note; + public Timing Timing = timing; } internal delegate void NotePlacedHandler(BattleEventArgs e); @@ -353,17 +360,25 @@ public void InvokeNotePlaced(ArrowData data) internal delegate void ChartLoopHandler(BattleEventArgs e); internal event ChartLoopHandler ChartLooped; - public void InvokeChartLoop(int incLoop) + public void InvokeChartLoop(int incLoop, bool artificialLoop = true) { - ChartLooped?.Invoke(new LoopEventArgs(_curDirector, incLoop)); + ChartLooped?.Invoke(new LoopEventArgs(_curDirector, incLoop, artificialLoop)); } internal delegate void NoteHitHandler(BattleEventArgs e); internal event NoteHitHandler NoteHit; - public void InvokeNoteHit(Note note) + public void InvokeNoteHit(Note note, Timing timing) + { + NoteHit?.Invoke(new NoteHitArgs(_curDirector, note, timing)); + } + + internal delegate void BattleEndedHandler(BattleEventArgs e); + internal event BattleEndedHandler BattleEnded; + + public void InvokeBattleEnded() { - NoteHit?.Invoke(new NotHitArgs(_curDirector, note)); + BattleEnded?.Invoke(new BattleEventArgs(_curDirector)); } } diff --git a/Scenes/BattleDirector/Scripts/NotePlacementBar.cs b/Scenes/BattleDirector/Scripts/NotePlacementBar.cs index 60d3ed0f..d584bbe9 100644 --- a/Scenes/BattleDirector/Scripts/NotePlacementBar.cs +++ b/Scenes/BattleDirector/Scripts/NotePlacementBar.cs @@ -81,6 +81,7 @@ public void Setup(PlayerStats playerStats) } ShuffleNoteQueue(); ProgressQueue(); + MaxValue = playerStats.MaxComboBar; } #endregion diff --git a/Scenes/Puppets/Scripts/PlayerStats.cs b/Scenes/Puppets/Scripts/PlayerStats.cs index cbb27a91..f41bc6eb 100644 --- a/Scenes/Puppets/Scripts/PlayerStats.cs +++ b/Scenes/Puppets/Scripts/PlayerStats.cs @@ -7,6 +7,7 @@ public partial class PlayerStats : Resource { public int MaxHealth = 100; public int CurrentHealth = 100; + public int MaxComboBar = 80; public Note[] CurNotes = new Note[] { Scribe.NoteDictionary[1].Clone(), From 57fad07b5df8d46f6d456c01d38acebdadbacbad Mon Sep 17 00:00:00 2001 From: cornerloan Date: Thu, 10 Apr 2025 14:41:49 -0700 Subject: [PATCH 7/9] Updated relics to work with multi-enemies --- Globals/Scribe.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index 018e5e40..02025d40 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -200,7 +200,7 @@ public partial class Scribe : Node 1, (e, self, val) => { - e.BD.Enemy.TakeDamage(val); + e.BD.GetFirstEnemy().TakeDamage(val); } ), } @@ -218,7 +218,7 @@ public partial class Scribe : Node 5, (e, self, val) => { - e.BD.Enemy.TakeDamage(val); + e.BD.GetFirstEnemy().TakeDamage(val); } ), } From 335da05523ab989093b63a2dca553368ab1e13a6 Mon Sep 17 00:00:00 2001 From: cornerloan Date: Thu, 10 Apr 2025 14:48:03 -0700 Subject: [PATCH 8/9] removed debug statement, everything should be working now --- Scenes/Puppets/Scripts/PuppetTemplate.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Scenes/Puppets/Scripts/PuppetTemplate.cs b/Scenes/Puppets/Scripts/PuppetTemplate.cs index 06bc0fc0..d6c8f982 100644 --- a/Scenes/Puppets/Scripts/PuppetTemplate.cs +++ b/Scenes/Puppets/Scripts/PuppetTemplate.cs @@ -127,7 +127,6 @@ protected virtual void Kill() public virtual void TakeDamage(int amount) { - GD.Print($"Taking Damage: {amount}, with shield count: {_numShield}"); if (_numShield > 0 && amount > 0) { _numShield--; From 37ea9b8b00bfb40fa2b8a1d9b90a634f2af65192 Mon Sep 17 00:00:00 2001 From: LifeHckr Date: Wed, 16 Apr 2025 17:29:53 -0700 Subject: [PATCH 9/9] Remove current implementation of block This would be a good addition, just want to better incorporate it in eventually. Ideally with a proposed status effect system. Co-Authored-By: Connor Lowe <74088480+cornerloan@users.noreply.github.com> --- Globals/Scribe.cs | 4 +-- Scenes/Puppets/Enemies/BossBlood/Boss1.tscn | 27 ++------------- Scenes/Puppets/Enemies/EnemyPuppet.tscn | 21 ++---------- .../Puppets/Enemies/Parasifly/Parasifly.tscn | 20 ++--------- Scenes/Puppets/Enemies/TheGWS/GWS.tscn | 20 ++--------- Scenes/Puppets/HealthBar.tscn | 2 +- Scenes/Puppets/PlayerPuppet.tscn | 20 ++--------- Scenes/Puppets/Scripts/PuppetTemplate.cs | 34 ------------------- 8 files changed, 14 insertions(+), 134 deletions(-) diff --git a/Globals/Scribe.cs b/Globals/Scribe.cs index 02025d40..cbc0f1a4 100644 --- a/Globals/Scribe.cs +++ b/Globals/Scribe.cs @@ -96,7 +96,7 @@ public partial class Scribe : Node ), new Note( 6, - "PlayerBlock", + "Play-c-HoldBlock", "Gives player one charge of block.", GD.Load("res://Classes/Notes/Assets/Note_PlayerBlock.png"), null, @@ -105,7 +105,7 @@ public partial class Scribe : Node { if (timing == Timing.Miss) return; - director.Player.GainShield(note.GetBaseVal()); //todo: should scale with timing???? + //director.Player.GainShield(note.GetBaseVal()); //todo: should scale with timing???? } ), }; diff --git a/Scenes/Puppets/Enemies/BossBlood/Boss1.tscn b/Scenes/Puppets/Enemies/BossBlood/Boss1.tscn index 8eabaebe..421588d7 100644 --- a/Scenes/Puppets/Enemies/BossBlood/Boss1.tscn +++ b/Scenes/Puppets/Enemies/BossBlood/Boss1.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=9 format=3 uid="uid://bi5iqbwpsd381"] +[gd_scene load_steps=8 format=3 uid="uid://bi5iqbwpsd381"] [ext_resource type="Script" uid="uid://bpyrrnhvisxgv" path="res://Scenes/Puppets/Enemies/BossBlood/P_BossBlood.cs" id="1_qj2oj"] [ext_resource type="Texture2D" uid="uid://veedngaorx3l" path="res://Scenes/Puppets/Enemies/BossBlood/Assets/Boss1.png" id="2_mul30"] [ext_resource type="Texture2D" uid="uid://b2iptr3o8rg4t" path="res://Scenes/Puppets/Enemies/BossBlood/Assets/Boss1EmissionShape.tres" id="3_yxnso"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="4_ffkxf"] -[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="5_pa2dv"] [sub_resource type="Gradient" id="Gradient_s7p55"] offsets = PackedFloat32Array(0) @@ -23,21 +22,11 @@ scale_min = 4.0 scale_max = 4.0 turbulence_noise_strength = 14.2 -[sub_resource type="Gradient" id="Gradient_s7p55"] -offsets = PackedFloat32Array(0) -colors = PackedColorArray(0.641048, 0.0406094, 0.0473231, 1) - -[sub_resource type="GradientTexture1D" id="GradientTexture1D_16sp0"] -gradient = SubResource("Gradient_s7p55") -width = 1 - -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite")] script = ExtResource("1_qj2oj") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") InitScale = Vector2(2, 2) -ShieldLogo = NodePath("Shield") -ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -32) @@ -57,15 +46,3 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 - -[node name="Shield" type="Sprite2D" parent="."] -position = Vector2(56, 20) -texture = ExtResource("5_pa2dv") - -[node name="ShieldText" type="Label" parent="Shield"] -offset_left = -13.0 -offset_top = -10.0 -offset_right = 13.0 -offset_bottom = 13.0 -text = "XX" -horizontal_alignment = 1 diff --git a/Scenes/Puppets/Enemies/EnemyPuppet.tscn b/Scenes/Puppets/Enemies/EnemyPuppet.tscn index 627a8d54..02e1ce82 100644 --- a/Scenes/Puppets/Enemies/EnemyPuppet.tscn +++ b/Scenes/Puppets/Enemies/EnemyPuppet.tscn @@ -1,30 +1,15 @@ -[gd_scene load_steps=4 format=3 uid="uid://cwm0n2wu851nx"] +[gd_scene load_steps=3 format=3 uid="uid://cwm0n2wu851nx"] -[ext_resource type="Script" path="res://Scenes/Puppets/Scripts/PuppetTemplate.cs" id="1_kgmh0"] +[ext_resource type="Script" uid="uid://bnfo57c070cll" path="res://Scenes/Puppets/Scripts/PuppetTemplate.cs" id="1_kgmh0"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="1_sxlrs"] -[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="2_xx60o"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite")] script = ExtResource("1_kgmh0") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") -ShieldLogo = NodePath("Sprite/Shield") -ShieldText = NodePath("Sprite/Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] -[node name="Shield" type="Sprite2D" parent="Sprite"] -position = Vector2(56, 20) -texture = ExtResource("2_xx60o") - -[node name="ShieldText" type="Label" parent="Sprite/Shield"] -offset_left = -13.0 -offset_top = -10.0 -offset_right = 13.0 -offset_bottom = 13.0 -text = "XX" -horizontal_alignment = 1 - [node name="ProgressBar" parent="." instance=ExtResource("1_sxlrs")] offset_left = -75.0 offset_top = 32.0 diff --git a/Scenes/Puppets/Enemies/Parasifly/Parasifly.tscn b/Scenes/Puppets/Enemies/Parasifly/Parasifly.tscn index 61869f4a..252c3d1c 100644 --- a/Scenes/Puppets/Enemies/Parasifly/Parasifly.tscn +++ b/Scenes/Puppets/Enemies/Parasifly/Parasifly.tscn @@ -1,17 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://uvlux4t6h5de"] +[gd_scene load_steps=4 format=3 uid="uid://uvlux4t6h5de"] [ext_resource type="Script" uid="uid://btaqgieybx0ep" path="res://Scenes/Puppets/Enemies/Parasifly/P_Parasifly.cs" id="1_ci2ca"] [ext_resource type="Texture2D" uid="uid://pngu3pw1pu4o" path="res://Scenes/Puppets/Enemies/Parasifly/Assets/Parasifly.png" id="2_g4o48"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_f74ri"] -[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_eemg7"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite")] script = ExtResource("1_ci2ca") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") -StartPos = Vector2(500, 125) -ShieldLogo = NodePath("Shield") -ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -12) @@ -22,15 +18,3 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 - -[node name="Shield" type="Sprite2D" parent="."] -position = Vector2(56, 20) -texture = ExtResource("4_eemg7") - -[node name="ShieldText" type="Label" parent="Shield"] -offset_left = -13.0 -offset_top = -10.0 -offset_right = 13.0 -offset_bottom = 13.0 -text = "XX" -horizontal_alignment = 1 diff --git a/Scenes/Puppets/Enemies/TheGWS/GWS.tscn b/Scenes/Puppets/Enemies/TheGWS/GWS.tscn index b5433721..1859a3e3 100644 --- a/Scenes/Puppets/Enemies/TheGWS/GWS.tscn +++ b/Scenes/Puppets/Enemies/TheGWS/GWS.tscn @@ -1,17 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://d1puw6fvmkrb5"] +[gd_scene load_steps=4 format=3 uid="uid://d1puw6fvmkrb5"] [ext_resource type="Script" uid="uid://3axgcdtdevtx" path="res://Scenes/Puppets/Enemies/TheGWS/P_TheGWS.cs" id="1_dlike"] [ext_resource type="Texture2D" uid="uid://ci0a2h2eatjht" path="res://Scenes/Puppets/Enemies/TheGWS/Assets/GhostWolfSnake.png" id="2_77v4w"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_mr0it"] -[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_udalx"] -[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] +[node name="EnemPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite")] script = ExtResource("1_dlike") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") -StartPos = Vector2(500, 125) -ShieldLogo = NodePath("Shield") -ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] position = Vector2(0, -54) @@ -22,15 +18,3 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 - -[node name="Shield" type="Sprite2D" parent="."] -position = Vector2(56, 20) -texture = ExtResource("4_udalx") - -[node name="ShieldText" type="Label" parent="Shield"] -offset_left = -13.0 -offset_top = -10.0 -offset_right = 13.0 -offset_bottom = 13.0 -text = "XX" -horizontal_alignment = 1 diff --git a/Scenes/Puppets/HealthBar.tscn b/Scenes/Puppets/HealthBar.tscn index c89d17c0..5950a341 100644 --- a/Scenes/Puppets/HealthBar.tscn +++ b/Scenes/Puppets/HealthBar.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://bgomxovxs7sr8"] -[ext_resource type="Script" path="res://Scenes/Puppets/Scripts/HealthBar.cs" id="1_b1t4i"] +[ext_resource type="Script" uid="uid://d24uqauywe5j5" path="res://Scenes/Puppets/Scripts/HealthBar.cs" id="1_b1t4i"] [sub_resource type="Gradient" id="Gradient_ve5ki"] colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1) diff --git a/Scenes/Puppets/PlayerPuppet.tscn b/Scenes/Puppets/PlayerPuppet.tscn index d9c2456c..13610852 100644 --- a/Scenes/Puppets/PlayerPuppet.tscn +++ b/Scenes/Puppets/PlayerPuppet.tscn @@ -1,17 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://eus17omen6yk"] +[gd_scene load_steps=4 format=3 uid="uid://eus17omen6yk"] [ext_resource type="Script" uid="uid://kkb4qp3s86n3" path="res://Scenes/Puppets/Scripts/PlayerPuppet.cs" id="1_f4rea"] [ext_resource type="Texture2D" uid="uid://b6fkei0i83vte" path="res://SharedAssets/Character1.png" id="2_affso"] [ext_resource type="PackedScene" uid="uid://bgomxovxs7sr8" path="res://Scenes/Puppets/HealthBar.tscn" id="3_rechw"] -[ext_resource type="Texture2D" uid="uid://bsg8b14xbddb6" path="res://SharedAssets/Shield.png" id="4_5uc4u"] -[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite", "ShieldLogo", "ShieldText")] +[node name="PlayerPuppet" type="Node2D" node_paths=PackedStringArray("HealthBar", "Sprite")] script = ExtResource("1_f4rea") HealthBar = NodePath("ProgressBar") Sprite = NodePath("Sprite") -StartPos = Vector2(158, 125) -ShieldLogo = NodePath("Shield") -ShieldText = NodePath("Shield/ShieldText") [node name="Sprite" type="Sprite2D" parent="."] texture = ExtResource("2_affso") @@ -21,15 +17,3 @@ offset_left = -75.0 offset_top = 32.0 offset_right = 75.0 offset_bottom = 52.0 - -[node name="Shield" type="Sprite2D" parent="."] -position = Vector2(56, 20) -texture = ExtResource("4_5uc4u") - -[node name="ShieldText" type="Label" parent="Shield"] -offset_left = -13.0 -offset_top = -10.0 -offset_right = 13.0 -offset_bottom = 13.0 -text = "XX" -horizontal_alignment = 1 diff --git a/Scenes/Puppets/Scripts/PuppetTemplate.cs b/Scenes/Puppets/Scripts/PuppetTemplate.cs index d6c8f982..24651cc9 100644 --- a/Scenes/Puppets/Scripts/PuppetTemplate.cs +++ b/Scenes/Puppets/Scripts/PuppetTemplate.cs @@ -27,15 +27,6 @@ public partial class PuppetTemplate : Node2D protected int MaxHealth = 100; protected int CurrentHealth = 100; - //Stats would go here. - protected int _numShield = 0; //todo: shield mechanic to block / dodge damage - - [Export] - public Sprite2D ShieldLogo; - - [Export] - public Label ShieldText; - protected string UniqName = ""; //Eventually make subclasses/scenes/real stuff public override void _Ready() @@ -45,9 +36,6 @@ public override void _Ready() Sprite.Scale = InitScale; HealthBar.Visible = !HideHealth; - - if (_numShield == 0) - ShieldLogo.Visible = false; } public override void _Process(double delta) @@ -127,21 +115,6 @@ protected virtual void Kill() public virtual void TakeDamage(int amount) { - if (_numShield > 0 && amount > 0) - { - _numShield--; - ShieldText.Text = $"{_numShield}"; - if (_numShield == 0) - ShieldLogo.Visible = false; - - TextParticle blockText = new TextParticle(); - blockText.Modulate = Colors.White; //white text for blocked damage - Sprite.AddChild(blockText); - blockText.Text = "-0"; //blocked damage is 0 - - return; - } - amount = Math.Max(0, amount); //Should not be able to heal from damage. if (CurrentHealth <= 0 || amount == 0) return; //Only check if hp would change @@ -175,11 +148,4 @@ public int GetCurrentHealth() { return CurrentHealth; } - - public virtual void GainShield(int amount) - { - ShieldLogo.Visible = true; - _numShield += amount; - ShieldText.Text = $"{_numShield}"; - } }