From 80262bf1004ea364791e899220754c821a0c2e03 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Sat, 6 Jun 2020 12:00:15 -0400 Subject: [PATCH] Updated buffs sprites. Updated fire amulet's synergy. --- Content/Buffs/Buffs/Commander.cs | 2 +- Content/Buffs/Buffs/DemonicallyBewitched.cs | 5 +- Content/Buffs/Buffs/FatesSmile.cs | 5 +- Content/Buffs/Buffs/MysticFlame.cs | 3 +- Content/Buffs/Buffs/NaturesAura.cs | 5 +- Content/Buffs/Buffs/ScarabEndurance.cs | 1 + Content/Buffs/Buffs/SlimyFeet.cs | 3 +- Content/Buffs/Buffs/Ubered.cs | 5 +- Content/Buffs/Buffs/Ubered.png | Bin 429 -> 474 bytes Content/Buffs/Buffs/Vampire.cs | 3 +- Content/Buffs/Buffs/Warlock.cs | 2 +- Content/Buffs/Buffs/Werepire.cs | 3 +- Content/Buffs/Debuffs/Amnesia.cs | 3 +- Content/Buffs/Debuffs/AvianFlu.cs | 7 +- Content/Buffs/Debuffs/AvianFlu.png | Bin 392 -> 495 bytes Content/Buffs/Debuffs/Corrosion.cs | 3 +- Content/Buffs/Debuffs/Corrosion.png | Bin 392 -> 402 bytes Content/Buffs/Debuffs/Discombobulated.cs | 3 +- Content/Buffs/Debuffs/Enveloped.cs | 3 +- Content/Buffs/Debuffs/Enveloped.png | Bin 384 -> 393 bytes Content/Buffs/Debuffs/Hyperthermic.cs | 1 + Content/Buffs/Debuffs/Hyperthermic.png | Bin 465 -> 486 bytes Content/Buffs/Debuffs/InfernalGaze.cs | 3 +- Content/Buffs/Debuffs/PiercingGaze.cs | 3 +- Content/Buffs/Debuffs/Singed.cs | 3 +- Content/Buffs/Debuffs/Slimed.cs | 1 + ...ationPlayerImpl.cs => DecimationPlayer.cs} | 15 +- Content/Items/Ammo/TitanicStyngerBolt.cs | 1 + Content/Items/Amulets/FireAmulet.cs | 8 +- Content/NPCs/Arachnus/Arachnus.cs | 154 ++++++++---------- Content/NPCs/LivingMagma.cs | 3 +- Content/Projectiles/ArachnusFireball.cs | 3 +- Content/Projectiles/BloodBeam.cs | 3 +- Content/Projectiles/Ember.cs | 1 + Content/Synergies/FireAmuletSynergy.cs | 64 +++++++- Content/Synergies/GraniteAmuletSynergy.cs | 5 +- Content/Synergies/MarbleAmuletSynergy.cs | 16 +- .../Tiles/ShrineoftheMoltenOne/RedHotSpike.cs | 3 +- Lib/Amulets/AmuletTooltip.cs | 25 +-- Lib/Amulets/Synergy/AmuletSynergyAdapter.cs | 25 +-- Lib/Amulets/Synergy/IAmuletsSynergy.cs | 13 +- {Content => Lib}/Buffs/DecimationBuff.cs | 2 +- Lib/DecimationPlayer.cs | 14 -- Lib/IDecimationPlayer.cs | 12 -- Lib/Util/PlayerUtils.cs | 5 + Lib/Util/WeaponUtils.cs | 35 ++++ 46 files changed, 275 insertions(+), 199 deletions(-) rename Content/{DecimationPlayerImpl.cs => DecimationPlayer.cs} (98%) rename {Content => Lib}/Buffs/DecimationBuff.cs (95%) delete mode 100644 Lib/DecimationPlayer.cs delete mode 100644 Lib/IDecimationPlayer.cs create mode 100644 Lib/Util/WeaponUtils.cs diff --git a/Content/Buffs/Buffs/Commander.cs b/Content/Buffs/Buffs/Commander.cs index 7bede87..8874bd8 100644 --- a/Content/Buffs/Buffs/Commander.cs +++ b/Content/Buffs/Buffs/Commander.cs @@ -1,5 +1,5 @@ +using Decimation.Lib.Buffs; using Terraria; -using Terraria.ModLoader; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/DemonicallyBewitched.cs b/Content/Buffs/Buffs/DemonicallyBewitched.cs index c31e5dd..1eb1b7f 100644 --- a/Content/Buffs/Buffs/DemonicallyBewitched.cs +++ b/Content/Buffs/Buffs/DemonicallyBewitched.cs @@ -1,6 +1,5 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; +using Decimation.Lib.Buffs; +using Terraria; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/FatesSmile.cs b/Content/Buffs/Buffs/FatesSmile.cs index f72f0ce..49722ac 100644 --- a/Content/Buffs/Buffs/FatesSmile.cs +++ b/Content/Buffs/Buffs/FatesSmile.cs @@ -1,6 +1,5 @@ -using Terraria; -using Terraria.ModLoader; -using Terraria.DataStructures; +using Decimation.Lib.Buffs; +using Terraria; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/MysticFlame.cs b/Content/Buffs/Buffs/MysticFlame.cs index 600f45b..7e6843a 100644 --- a/Content/Buffs/Buffs/MysticFlame.cs +++ b/Content/Buffs/Buffs/MysticFlame.cs @@ -1,4 +1,5 @@ -using Terraria; +using Decimation.Lib.Buffs; +using Terraria; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/NaturesAura.cs b/Content/Buffs/Buffs/NaturesAura.cs index 44eb421..da9f89c 100644 --- a/Content/Buffs/Buffs/NaturesAura.cs +++ b/Content/Buffs/Buffs/NaturesAura.cs @@ -1,6 +1,5 @@ -using Terraria; -using Terraria.ModLoader; -using Terraria.DataStructures; +using Decimation.Lib.Buffs; +using Terraria; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/ScarabEndurance.cs b/Content/Buffs/Buffs/ScarabEndurance.cs index f7e4e59..a3b5fb5 100644 --- a/Content/Buffs/Buffs/ScarabEndurance.cs +++ b/Content/Buffs/Buffs/ScarabEndurance.cs @@ -1,4 +1,5 @@ using Decimation.Content.Projectiles; +using Decimation.Lib.Buffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Content/Buffs/Buffs/SlimyFeet.cs b/Content/Buffs/Buffs/SlimyFeet.cs index fdaae70..dcfd491 100644 --- a/Content/Buffs/Buffs/SlimyFeet.cs +++ b/Content/Buffs/Buffs/SlimyFeet.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework.Input; +using Decimation.Lib.Buffs; +using Microsoft.Xna.Framework.Input; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Content/Buffs/Buffs/Ubered.cs b/Content/Buffs/Buffs/Ubered.cs index 779bdcd..2aefb0c 100644 --- a/Content/Buffs/Buffs/Ubered.cs +++ b/Content/Buffs/Buffs/Ubered.cs @@ -1,6 +1,5 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; +using Decimation.Lib.Buffs; +using Terraria; namespace Decimation.Content.Buffs.Buffs { diff --git a/Content/Buffs/Buffs/Ubered.png b/Content/Buffs/Buffs/Ubered.png index 6274cbdffec068d9db0b674bfc9e2f50be1118a4..6561423f9d53fd5460408b7e9ac192bf3441cde0 100644 GIT binary patch literal 474 zcmV<00VV#4P)Nkl9YSsYfGs}z_8-_CXWv4cldE z{wiR;u`oo~SeOZ-j)8$;a5!MrEl3E!z^aFk7}@LU2Bv4;+6|`D)l%?=z|327pz2(~ zwDay=U^+}5Ikp)X($vsGV89)~)O`!=QYQmtFx_bcaWO1Sq^m)EL@a=X7%a}q&p|?T z--Wwi`d_IUn1-i;LFWKioWXnm^SOyI{*XBH7LrzA02YF444C8`4#2^^bo)m z66iih4*?h-R=(g&0|Vv&^lXUB=fvg$bak+_023!z4$$2J=yd@h2XH>Ug5t^V(mHqp z2NnWE*9D^vpnC`q$_40g{`$=ulsFd^5y6`#D9!~mcL1z1!c`EF>i~40lU)+h%>l6X z0Itdi7SY6(15~dK>E;0R77=>wh${rpOy`Vz(IjjYQOFzNd zkdOgXcL1TD5qedJUS6R0q;RPxx;7-%K=h^-t~wcC*9@j-z&fV`>Hq-t-Eb5|Lm=n? Q00009Y+5iGL56|}D4?5#V2gq~KA`yO$=iP@{8QZ}Q2s+S-^+vfW~DtS;xfWaDEze* z0$@JKhXZRN%x5qcuB!-!`d~GfM)(xs0hrHDb%%oaK^<$sG`cxBeMol;VF8cJVqD1= zm(O78iH<|`prx9H=B4kzW}&ApLOvzrGnoF9-9o6TlKV(rk02_g6s#4oS_Gu=^8eSKVfs~fvPP9l*Zb{@Vt_xRjL616^xU-LSq$?7Be zWRAuF=noh7H-zKmRSzF`kEJYh&yStw!SDAE^t$BqlE&4y+kXLod88hmT?S4L39(@Y zjKPy4a6OE|&YFQh1JMAy8))6V9X%VLT{{fqd9JUaRH%2i)6w_8mP>lh9Wi^ZF0M#h zpWk}y8S9pT)&N+HMy2Wp6C0i*iuh_1RnU}|fyM#Y_{QF0uT0#+bMC0sfQJd>3t0mY zQQZI}^&-yUd4E4mwewk)>G5_pbI1^xfEK{0$tQ9iU@0>`09FgsmH1m5FS_RkE&10dvZ9tAx9gQJ4k_g6zfgwX)lVpK5^Nn3;as3F{e&1%><0MidB z(*Z%XKn_immduieVA|UcG!I}pCO=pX2P1V$QG`uv0ZUpJN}M;0HHE=6n@9D@c;k- M07*qoM6N<$g4L4UV*mgE delta 366 zcmV-!0g?Xi1Be5VBYyw^b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^1poj54^T{0MF0Q* z&F%i0+WrEI+C;nk?!PLs0003ONklHnqB~GHxrmSfB@tQu+PuF{Rg6e zG?-$@*mwuRzyW6Xt3X*0K&*OWVK4=xA$}h`Au#I}Bm`h!)qg|OBoQW$oLmq-fdN>^ z!2lusX=;Nl1em&SfhYzi17$GXX#{aGy3f#kjt+3CFFywfk$o5Lg6V&yYG8W6Ljb1( zKt2IskPnbCA%LzPW)3be_(A}bTG3N1H2^Mi2Tv|QF9(Q;Z&CnyIv6zN0NeqvR7-1s zZqMKefq?>p$7cbAN-SytbbAIo1Tbnt^p*~#IRiaZVJ)Y@TN{E}GU%-tY5-j34!#h8 z0a%FzOSR~!7Z*TRk6!YjgTa#vMq9-rx@QCfn39YSsYfGz&NxDDctv**Fo zvk9y5hJsWWvM-`WR!YAT-GC!QlWjA2F<4hZ+LmL8yGFPvC;kkc0CH=x2n6 zFd_s7+5u0YPM4BohOoMtQPKq5XXrjhPbugj0aIUA3rSng|9^sMX{bJU2n;?4z~Y>c zkMZUeM6QCRDdIz5z#ITej3oLzdd3!%uvnVmgBmtypp_9UuF!pqo;Yy^1T5~MEhLg_!+~?ah-(pH)P^IjRXn15MzAbAV4c$ebpQZn W%SaTl2VZdj0000Px#1ZP1_K>z@;j|==^1poj54^T{0MF0Q* z&F%i0+WrEI+C;nk?!PLs0003ONklHnqB~GHxrmSfB@tQu+PuF{Rg6e zG?-$@*mwuRzyW6Xt3X*0K&*OWVK4=xA$}h`Au#I}Bm`h!)qg|OBoQW$oLmq-fdN>^ z!2lusX=;Nl1em&SfhYzi17$GXX#{aGy3f#kjt+3CFFywfk$o5Lg6V&yYG8W6Ljb1( zKt2IskPnbCA%LzPW)3be_(A}bTG3N1H2^Mi2Tv|QF9(Q;Z&CnyIv6zN0NeqvR7-1s zZqMKefq?>p$7cbAN-SytbbAIo1Tbnt^p*~#IRiaZVJ)Y@TN{E}GU%-tY5-j34!#h8 z0a%FzOSR~!7Z*TRk6!YjgTa#vMq9-rx@QCfn3c2$iagQkjSa#27-Op-G|2A3;Q%xrF|1sN8Uo=#sC=kT;DXSQgYyaKXM~0@ zA_NB70Z*Y$my%?Lu)3O2(gfURXmJQn!Dwj+T|GltEhKF{|9=anrJ)MoAu#wH0E=@R zKGxJSKuHtVuU$alqvtAEnj$^~2FwAl#7MyB>S_uoKE8SD0hmuHBw*zQ?ldq^4)~9r z4begX7U$?bmynPE`~1a=7hoDaBrwtfEcFvC2k7nqw0sOJsbCR}9s;$Mm0&4eK0YvA z2Ib>S3pk<{XJ=h7WE@~*W(E#{z`#JPX#ieQ(kcX~=KvCO0W9^yd`S0PKy?SeE2Dub zhz5@XVC{hctBeMX14dkn2%|O}ajoJJ-7|t$SSXD=+H(d+?-&4{2%r>X88!|80000< MMNUMnLSTXb0L9~!LI3~& delta 357 zcmV-r0h<1a1AqgNB!5OpL_t(oN99+s4uUWc)saD08F5gflW}m;@C6L~jERF^0+=T6|;A!G8pupd8}7_g(e#W z=6*4s6XS-e?Orn#=Xs&37yCIC1@Hisq}&wOA&Bq*0000@6B{(YR&X%zV&l-?PL@8 z!cz=@+qfB>dK`E6uBp#2BNeI}|5*=xTOIC3<8r=~kn7Ex-+#yMANzK)_ul|OMq6MG zrh$oIY&OV9Q zl(l`J6o5vabAQ@C!JM=QJ5XRn_yCpY90#~QI{=Xjg7;GaVRP*)w3LtvATA_x!9Rff z3ZzcKZ}|XofSL`pQ_wen&XG_7qIy3GAr7!|(z9VI67~gP=41pQAs#RSYB}KI%1y0b zKV92Wpg4fu3z9`&1+%KoUlFAMsM%0fNHF^C(?^sJHbqzGck zGW%&aBYA`3x-h?MHcVc%l&jfK01#xc%V|*nU))_r6fY8R+5i9m07*qoM6N<$f&c&t Cu*sGH delta 439 zcmV;o0Z9Jl1JMJJB!8GmL_t(oN9|X=P69y?=E_S9EtF7b!2?if=Q*JKyTgWiki3+ofQO+q?a_{pOqB%{qT=_wPN%Yqmdx9^8@v zpo2fAQ^Ik%-BMqcWx&GVc|qUnr!n<;o(J=Cy`&KPi&uBf&3|l0{hoo-0PsDT5Tf4W z+=0IhW!UgMM!&krsOLp>GJK0`q9H@ zD7wZ3ds)U_R)4X9WB}lX-j5Lvq|SxpSUd diff --git a/Content/Buffs/Debuffs/InfernalGaze.cs b/Content/Buffs/Debuffs/InfernalGaze.cs index 39627dc..ab2daa3 100644 --- a/Content/Buffs/Debuffs/InfernalGaze.cs +++ b/Content/Buffs/Debuffs/InfernalGaze.cs @@ -1,4 +1,5 @@ -using Terraria; +using Decimation.Lib.Buffs; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Content/Buffs/Debuffs/PiercingGaze.cs b/Content/Buffs/Debuffs/PiercingGaze.cs index 07f7711..5d9486b 100644 --- a/Content/Buffs/Debuffs/PiercingGaze.cs +++ b/Content/Buffs/Debuffs/PiercingGaze.cs @@ -1,4 +1,5 @@ -using Terraria; +using Decimation.Lib.Buffs; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Content/Buffs/Debuffs/Singed.cs b/Content/Buffs/Debuffs/Singed.cs index 116cd03..c95c688 100644 --- a/Content/Buffs/Debuffs/Singed.cs +++ b/Content/Buffs/Debuffs/Singed.cs @@ -1,4 +1,5 @@ -using Terraria; +using Decimation.Lib.Buffs; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Content/Buffs/Debuffs/Slimed.cs b/Content/Buffs/Debuffs/Slimed.cs index a45fa9f..ac13dcd 100644 --- a/Content/Buffs/Debuffs/Slimed.cs +++ b/Content/Buffs/Debuffs/Slimed.cs @@ -1,3 +1,4 @@ +using Decimation.Lib.Buffs; using Terraria; using Terraria.ModLoader; using Terraria.DataStructures; diff --git a/Content/DecimationPlayerImpl.cs b/Content/DecimationPlayer.cs similarity index 98% rename from Content/DecimationPlayerImpl.cs rename to Content/DecimationPlayer.cs index f44aca8..b23a3b0 100644 --- a/Content/DecimationPlayerImpl.cs +++ b/Content/DecimationPlayer.cs @@ -16,7 +16,7 @@ using Terraria.ModLoader.IO; namespace Decimation.Content { - public class DecimationPlayer : DecimationModPlayer + public class DecimationPlayer : ModPlayer { // Amulet slot private Amulet _amuletSlotAmulet; @@ -69,8 +69,7 @@ namespace Decimation.Content public bool wasJumping = false; public ICollection EquippedAccessories { get; } = new List(); - public override bool HasShield { get; set; } - public override bool HasLavaCharm { get; set; } + public bool HasShield { get; set; } public Item AmuletSlotItem { @@ -101,7 +100,6 @@ namespace Decimation.Content tideTurnerEquipped = false; vampire = false; - HasLavaCharm = false; HasShield = false; hasCursedAccessory = false; @@ -270,6 +268,8 @@ namespace Decimation.Content if (AmuletSlotItem.type == ModContent.ItemType()) CrystalAmuletEffect(); + + _amuletSlotAmulet?.Synergy.OnHitPlayer(this, target, item, ref damage, ref crit); } public override void OnHitNPC(Item item, NPC target, int damage, float knockback, bool crit) @@ -281,6 +281,8 @@ namespace Decimation.Content AmuletSlotItem.type != ModContent.ItemType()) if (Main.rand.Next(amuletsBuffChances, 100) < amuletsBuffChances) target.AddBuff(amuletsBuff, amuletsBuffTime); + + _amuletSlotAmulet?.Synergy.OnHitNPC(this, target, item, ref damage, ref crit); } public override void OnHitPvpWithProj(Projectile proj, Player target, int damage, bool crit) @@ -389,12 +391,12 @@ namespace Decimation.Content public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) { - _amuletSlotAmulet?.Synergy.OnHitPlayer(this, ref damage); + _amuletSlotAmulet?.Synergy.OnPlayerHit(this, ref damage); } public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit) { - _amuletSlotAmulet?.Synergy.OnHitPlayer(this, ref damage); + _amuletSlotAmulet?.Synergy.OnPlayerHit(this, ref damage); } public void DashMovement() @@ -829,7 +831,6 @@ namespace Decimation.Content DecimationPlayer modPlayer = player.GetModPlayer(); if (item.type == ItemID.CobaltShield || item.type == ItemID.AnkhShield || item.type == ItemID.PaladinsShield || item.type == ItemID.ObsidianShield) modPlayer.HasShield = true; - if (item.type == ItemID.LavaCharm) modPlayer.HasLavaCharm = true; } } } \ No newline at end of file diff --git a/Content/Items/Ammo/TitanicStyngerBolt.cs b/Content/Items/Ammo/TitanicStyngerBolt.cs index dca1911..6fe6b67 100644 --- a/Content/Items/Ammo/TitanicStyngerBolt.cs +++ b/Content/Items/Ammo/TitanicStyngerBolt.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Buffs.Buffs; using Decimation.Content.Items.Ores; using Decimation.Content.Tiles; using Decimation.Lib.Items; diff --git a/Content/Items/Amulets/FireAmulet.cs b/Content/Items/Amulets/FireAmulet.cs index c070366..3403dd6 100644 --- a/Content/Items/Amulets/FireAmulet.cs +++ b/Content/Items/Amulets/FireAmulet.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using Decimation.Content.Buffs.Debuffs; -using Decimation.Lib.Amulets; -using Decimation.Lib.Amulets.Synergy; using Decimation.Content.Items.Accessories; using Decimation.Content.Synergies; +using Decimation.Lib.Amulets; +using Decimation.Lib.Amulets.Synergy; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -54,7 +54,9 @@ namespace Decimation.Content.Items.Amulets .AddEffect("+3% melee critical strike chances") .AddEffect("+7 seconds of immunity to lava") .AddEffect("+4% chances to inflict \"Slimed!\" debuff to ennemies on strikes") - .AddSynergy("The lava charm grant an additional 5 seconds of lava immunity"); + .AddSynergy("Grants an additional 5 seconds of effect to lava immunity accessories") + .AddSynergy("Fire melee weapons inflicts \"Slimed!\" to ennemies on strikes") + .AddSynergy("The Fiery Greatsword shoots fireballs"); } } } \ No newline at end of file diff --git a/Content/NPCs/Arachnus/Arachnus.cs b/Content/NPCs/Arachnus/Arachnus.cs index 4bb06cd..58f5ea1 100644 --- a/Content/NPCs/Arachnus/Arachnus.cs +++ b/Content/NPCs/Arachnus/Arachnus.cs @@ -1,9 +1,4 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using System; using System.IO; using Decimation.Content.Buffs.Debuffs; using Decimation.Content.Items.Boss.Arachnus; @@ -11,15 +6,26 @@ using Decimation.Content.Items.Misc.Souls; using Decimation.Content.Items.Weapons.Arachnus; using Decimation.Content.Projectiles; using Decimation.Content.Tiles.ShrineoftheMoltenOne; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Decimation.Content.NPCs.Arachnus { [AutoloadBossHead] - class Arachnus : ModNPC + internal class Arachnus : ModNPC { - private int counter = 0; - private int counterMax = 1320; - private float speed = 2; + public enum ArachnusMessageType + { + RoarSound, + FlamesSound + } + + private int _counter; + private int _counterMax = 1320; + private float _speed = 2; public override void SetStaticDefaults() { @@ -56,7 +62,7 @@ namespace Decimation.Content.NPCs.Arachnus { npc.lifeMax = (int) (npc.lifeMax * 0.625f * bossLifeScale); npc.damage = (int) (npc.damage * 0.6f); - npc.defense = (int) (npc.defense + numPlayers * 2); + npc.defense = npc.defense + numPlayers * 2; } private bool CheckDispawn() @@ -83,18 +89,12 @@ namespace Decimation.Content.NPCs.Arachnus // Move Vector2 move = moveTo; float magnitude = (float) Math.Sqrt(move.X * move.X + move.Y * move.Y); - if (magnitude > speed) - { - move *= speed / magnitude; - } + if (magnitude > _speed) move *= _speed / magnitude; float turnResistance = 50f; move = (npc.velocity * turnResistance + move) / (turnResistance + 1f); magnitude = (float) Math.Sqrt(move.X * move.X + move.Y * move.Y); - if (magnitude > speed) - { - move *= speed / magnitude; - } + if (magnitude > _speed) move *= _speed / magnitude; npc.velocity = npc.ai[1] != 99 ? move : new Vector2(0, 0); } @@ -102,25 +102,19 @@ namespace Decimation.Content.NPCs.Arachnus private bool CheckForShrine() { bool tooFarFromShrine = true; - if (counter % 60 == 0) + if (_counter % 60 == 0) { int validBlockCount = 0; for (int i = (int) (-50 + npc.Center.X / 16f); i <= (int) (50 + npc.Center.X / 16f); i++) - { - for (int j = (int) (-50 + npc.Center.Y / 16f); j <= (int) (50 + npc.Center.Y / 16f); j++) - { - if (i >= 0 && i <= Main.maxTilesX && j >= 0 && j <= Main.maxTilesY) - { - if (Main.tile[i, j].type == ModContent.TileType() || - (Main.tile[i, j].type == ModContent.TileType() || - Main.tile[i, j].type == ModContent.TileType() || - Main.tile[i, j].type == ModContent.TileType()) || - Main.tile[i, j].type == ModContent.TileType() || - Main.tile[i, j].type == ModContent.TileType()) - validBlockCount++; - } - } - } + for (int j = (int) (-50 + npc.Center.Y / 16f); j <= (int) (50 + npc.Center.Y / 16f); j++) + if (i >= 0 && i <= Main.maxTilesX && j >= 0 && j <= Main.maxTilesY) + if (Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType()) + validBlockCount++; if (validBlockCount < 15) tooFarFromShrine = true; @@ -149,43 +143,46 @@ namespace Decimation.Content.NPCs.Arachnus { npc.velocity = new Vector2(0, 10f); npc.noTileCollide = true; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } + if (npc.timeLeft > 10) npc.timeLeft = 10; } - npc.TargetClosest(true); + npc.TargetClosest(); CheckEnraged(); // Normal ai if (npc.ai[0] == 0) { - float mouthX = (float) (((npc.height) / 2) * Math.Cos(npc.rotation - Math.PI * 0.5f)) + npc.Center.X; - float mouthY = (float) (((npc.height) / 2) * Math.Sin(npc.rotation - Math.PI * 0.5f)) + npc.Center.Y; + float mouthX = (float) (npc.height / 2 * Math.Cos(npc.rotation - Math.PI * 0.5f)) + npc.Center.X; + float mouthY = (float) (npc.height / 2 * Math.Sin(npc.rotation - Math.PI * 0.5f)) + npc.Center.Y; //Counter - if (npc.life <= npc.lifeMax / 2) counterMax = 1500; - if (counter >= counterMax && Main.netMode != 1) + if (npc.life <= npc.lifeMax / 2) _counterMax = 1500; + if (_counter >= _counterMax && Main.netMode != 1) { - counter = 0; + _counter = 0; npc.netUpdate = true; } // Fireballs - if (counter <= 600) npc.ai[1] = 0; - else if (counter > 600 && counter < 800) npc.ai[1] = 98; + if (_counter <= 600) + { + npc.ai[1] = 0; + } + else if (_counter > 600 && _counter < 800) + { + npc.ai[1] = 98; + } // Blast of Heat - else if (counter >= 800 && counter <= 1100) + else if (_counter >= 800 && _counter <= 1100) { npc.ai[1] = 1; } // Increase speed - else if (counter > 1320 && counter <= 1500 || - (Main.expertMode && counter > 600 && counter < 800 && npc.life <= npc.lifeMax / 4)) + else if (_counter > 1320 && _counter <= 1500 || + Main.expertMode && _counter > 600 && _counter < 800 && npc.life <= npc.lifeMax / 4) { - if (counter == 1321) + if (_counter == 1321) { if (Main.netMode == NetmodeID.SinglePlayer) Main.PlaySound(SoundID.Roar, (int) npc.position.X, (int) npc.position.Y, 0); @@ -194,16 +191,19 @@ namespace Decimation.Content.NPCs.Arachnus npc.ai[1] = 2; } - else npc.ai[1] = 99; + else + { + npc.ai[1] = 99; + } - if (counter % 40 == 0 && npc.ai[1] == 0 && Main.netMode != 1) + if (_counter % 40 == 0 && npc.ai[1] == 0 && Main.netMode != 1) { float speedX = (float) (6 * Math.Cos(npc.rotation - Math.PI * 0.5f)) * 2; float speedY = (float) (6 * Math.Sin(npc.rotation - Math.PI * 0.5f)) * 2; Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), ModContent.ProjectileType(), 30, 0f); } - else if (counter % 5 == 0 && npc.ai[1] == 1) + else if (_counter % 5 == 0 && npc.ai[1] == 1) { if (Main.netMode != 1) { @@ -212,7 +212,7 @@ namespace Decimation.Content.NPCs.Arachnus Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), npc.ai[2] == 1 ? ModContent.ProjectileType() - : ModContent.ProjectileType(), 30, 0f, 255); + : ModContent.ProjectileType(), 30, 0f); } Main.PlaySound(SoundID.Item34, npc.position); @@ -221,21 +221,20 @@ namespace Decimation.Content.NPCs.Arachnus } else if (npc.ai[1] == 2) { - speed = 20f; + _speed = 20f; if (Main.expertMode) { - speed = (npc.lifeMax - npc.life) / 500; + _speed = (npc.lifeMax - npc.life) / 500; if (npc.ai[2] == 1) - speed += 20; + _speed += 20; } else if (npc.ai[2] == 1) - speed = 40f; + { + _speed = 40f; + } } - if (npc.ai[1] != 2) - { - speed = 2f; - } + if (npc.ai[1] != 2) _speed = 2f; // Enraged if (npc.ai[2] == 1) @@ -245,12 +244,12 @@ namespace Decimation.Content.NPCs.Arachnus if (npc.ai[1] != 2) { - speed = 6f; + _speed = 6f; npc.defense = 300; } } - counter++; + _counter++; } Move(); @@ -258,16 +257,16 @@ namespace Decimation.Content.NPCs.Arachnus public override void SendExtraAI(BinaryWriter writer) { - writer.Write(counter); - writer.Write(counterMax); - writer.Write(speed); + writer.Write(_counter); + writer.Write(_counterMax); + writer.Write(_speed); } public override void ReceiveExtraAI(BinaryReader reader) { - counter = reader.ReadInt32(); - counterMax = reader.ReadInt32(); - speed = reader.ReadSingle(); + _counter = reader.ReadInt32(); + _counterMax = reader.ReadInt32(); + _speed = reader.ReadSingle(); } private ModPacket GetPacket(ArachnusMessageType type) @@ -295,10 +294,7 @@ namespace Decimation.Content.NPCs.Arachnus public override void OnHitPlayer(Player target, int damage, bool crit) { - if (npc.ai[1] == 2 && Main.expertMode) - { - target.AddBuff(ModContent.BuffType(), 900); - } + if (npc.ai[1] == 2 && Main.expertMode) target.AddBuff(ModContent.BuffType(), 900); base.OnHitPlayer(target, damage, crit); } @@ -308,7 +304,7 @@ namespace Decimation.Content.NPCs.Arachnus npc.frameCounter += 3f; if (npc.frameCounter >= 40) npc.frameCounter = 0; - npc.frame.Y = ((int) npc.frameCounter / 10) * frameHeight; + npc.frame.Y = (int) npc.frameCounter / 10 * frameHeight; } public override void NPCLoot() @@ -369,11 +365,5 @@ namespace Decimation.Content.NPCs.Arachnus ); return false; } - - public enum ArachnusMessageType - { - RoarSound, - FlamesSound - } } } \ No newline at end of file diff --git a/Content/NPCs/LivingMagma.cs b/Content/NPCs/LivingMagma.cs index 601d5fc..141da44 100644 --- a/Content/NPCs/LivingMagma.cs +++ b/Content/NPCs/LivingMagma.cs @@ -1,4 +1,5 @@ -using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Buffs.Buffs; +using Decimation.Content.Buffs.Debuffs; using Decimation.Content.Tiles.ShrineoftheMoltenOne; using Terraria; using Terraria.ID; diff --git a/Content/Projectiles/ArachnusFireball.cs b/Content/Projectiles/ArachnusFireball.cs index c7fd61b..159d544 100644 --- a/Content/Projectiles/ArachnusFireball.cs +++ b/Content/Projectiles/ArachnusFireball.cs @@ -1,4 +1,5 @@ -using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Buffs.Buffs; +using Decimation.Content.Buffs.Debuffs; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Content/Projectiles/BloodBeam.cs b/Content/Projectiles/BloodBeam.cs index c536e9e..3286915 100644 --- a/Content/Projectiles/BloodBeam.cs +++ b/Content/Projectiles/BloodBeam.cs @@ -1,10 +1,11 @@ -using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Buffs.Buffs; using Decimation.Content.Dusts; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Decimation.Content.Buffs.Debuffs; using Terraria; using Terraria.DataStructures; using Terraria.ID; diff --git a/Content/Projectiles/Ember.cs b/Content/Projectiles/Ember.cs index d6b243f..5c95745 100644 --- a/Content/Projectiles/Ember.cs +++ b/Content/Projectiles/Ember.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; +using Decimation.Content.Buffs.Buffs; using Decimation.Content.Buffs.Debuffs; using Microsoft.Xna.Framework; diff --git a/Content/Synergies/FireAmuletSynergy.cs b/Content/Synergies/FireAmuletSynergy.cs index 3071b97..61ece36 100644 --- a/Content/Synergies/FireAmuletSynergy.cs +++ b/Content/Synergies/FireAmuletSynergy.cs @@ -1,5 +1,12 @@ -using Decimation.Lib; +using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Items.Amulets; +using Decimation.Content.Projectiles; using Decimation.Lib.Amulets.Synergy; +using Decimation.Lib.Util; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Decimation.Content.Synergies { @@ -7,9 +14,60 @@ namespace Decimation.Content.Synergies { private const int AddedLavaTime = 500; - public override void Update(DecimationModPlayer modPlayer) + public override void Update(DecimationPlayer modPlayer) { - if (modPlayer.HasLavaCharm) modPlayer.player.lavaMax += AddedLavaTime; + if (modPlayer.player.lavaMax > 0) modPlayer.player.lavaMax += AddedLavaTime; + } + + public override void OnHitNPC(DecimationPlayer modPlayer, NPC target, Item weapon, ref int damages, + ref bool crit) + { + if (weapon.type.IsFireWeapon()) target.AddBuff(ModContent.BuffType(), 500); + } + + public override void OnHitPlayer(DecimationPlayer modPlayer, Player target, Item weapon, ref int damages, + ref bool crit) + { + if (weapon.type.IsFireWeapon()) target.AddBuff(ModContent.BuffType(), 500); + } + + private class FireAmuletSynergyFieryGreatswordEffect : GlobalItem + { + public override bool UseItem(Item item, Player player) + { + if (item.type == ItemID.FieryGreatsword && + player.HasEquippedAmulet(ModContent.ItemType())) + { + int proj = Projectile.NewProjectile(player.Center + player.Directions * new Vector2(24, -16), + player.Directions * new Vector2(6, 0), ModContent.ProjectileType(), 30, + 5f, player.whoAmI); + Main.projectile[proj].hostile = false; + Main.projectile[proj].friendly = true; + } + + return true; + } + } + + private class FireAmuletSynergyFlamarangEffect : GlobalProjectile + { + public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit) + { + if (projectile.type.IsFireMeleeProjectile() && + Main.LocalPlayer.HasEquippedAmulet(ModContent.ItemType())) + { + target.AddBuff(ModContent.BuffType(), 500); + } + } + + public override void OnHitPlayer(Projectile projectile, Player target, int damage, bool crit) + { + if (projectile.type.IsFireMeleeProjectile() && + Main.LocalPlayer.HasEquippedAmulet(ModContent.ItemType())) + { + target.AddBuff(ModContent.BuffType(), 500); + } + } } } } \ No newline at end of file diff --git a/Content/Synergies/GraniteAmuletSynergy.cs b/Content/Synergies/GraniteAmuletSynergy.cs index c9ff2d0..76c475c 100644 --- a/Content/Synergies/GraniteAmuletSynergy.cs +++ b/Content/Synergies/GraniteAmuletSynergy.cs @@ -1,5 +1,4 @@ -using Decimation.Lib; -using Decimation.Lib.Amulets.Synergy; +using Decimation.Lib.Amulets.Synergy; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ namespace Decimation.Content.Synergies { internal class GraniteAmuletSynergy : AmuletSynergyAdapter { - public override void OnHitPlayer(DecimationModPlayer modPlayer, ref int damages) + public override void OnPlayerHit(DecimationPlayer modPlayer, ref int damages) { if (modPlayer.HasShield && Main.rand.NextBool(10)) { diff --git a/Content/Synergies/MarbleAmuletSynergy.cs b/Content/Synergies/MarbleAmuletSynergy.cs index 6352301..205e3cf 100644 --- a/Content/Synergies/MarbleAmuletSynergy.cs +++ b/Content/Synergies/MarbleAmuletSynergy.cs @@ -1,5 +1,4 @@ using System; -using Decimation.Lib; using Decimation.Lib.Amulets.Synergy; using Microsoft.Xna.Framework; using Terraria; @@ -9,25 +8,26 @@ namespace Decimation.Content.Synergies { internal class MarbleAmuletSynergy : AmuletSynergyAdapter { - - public override void OnShoot(DecimationModPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, ref float speedY, + public override void OnShoot(DecimationPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, + ref float speedY, ref int projectileType, ref int damages, ref float knockBack) { int itemType = modPlayer.player.HeldItem.type; if (Main.rand.NextBool(4)) { - if (itemType == ItemID.Javelin || itemType == ItemID.Shuriken || itemType == ItemID.ThrowingKnife || itemType == ItemID.StarAnise || itemType == ItemID.BoneJavelin || itemType == ItemID.PoisonedKnife || itemType == ItemID.FrostDaggerfish) + if (itemType == ItemID.Javelin || itemType == ItemID.Shuriken || itemType == ItemID.ThrowingKnife || + itemType == ItemID.StarAnise || itemType == ItemID.BoneJavelin || + itemType == ItemID.PoisonedKnife || itemType == ItemID.FrostDaggerfish) { // Creation of the second projectile, with 10 degrees (0.174533 rad) rotation const double angle = 0.174533d; - float x2 = (float)(Math.Cos(angle) * speedX - Math.Sin(angle) * speedY); - float y2 = (float)(Math.Sin(angle) * speedX + Math.Cos(angle) * speedY); + float x2 = (float) (Math.Cos(angle) * speedX - Math.Sin(angle) * speedY); + float y2 = (float) (Math.Sin(angle) * speedX + Math.Cos(angle) * speedY); Projectile.NewProjectile(position, new Vector2(x2, y2), projectileType, damages, knockBack); } } } - } -} +} \ No newline at end of file diff --git a/Content/Tiles/ShrineoftheMoltenOne/RedHotSpike.cs b/Content/Tiles/ShrineoftheMoltenOne/RedHotSpike.cs index fccf9b9..fe43174 100644 --- a/Content/Tiles/ShrineoftheMoltenOne/RedHotSpike.cs +++ b/Content/Tiles/ShrineoftheMoltenOne/RedHotSpike.cs @@ -1,4 +1,5 @@ -using Decimation.Content.Buffs.Debuffs; +using Decimation.Content.Buffs.Buffs; +using Decimation.Content.Buffs.Debuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Lib/Amulets/AmuletTooltip.cs b/Lib/Amulets/AmuletTooltip.cs index 1ed4654..ff0ab5a 100644 --- a/Lib/Amulets/AmuletTooltip.cs +++ b/Lib/Amulets/AmuletTooltip.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria.ModLoader; using Terraria.UI.Chat; @@ -15,13 +14,12 @@ namespace Decimation.Lib.Amulets private readonly Color _synergyColor = Color.CadetBlue; private int _effectCount; - private bool _hasSynergy; public AmuletTooltip(Mod mod, Amulet amulet) { _mod = mod; _amulet = amulet; - this.Lines = new List(); + Lines = new List(); SetClassTooltip(); } @@ -30,7 +28,7 @@ namespace Decimation.Lib.Amulets private void SetClassTooltip() { - this.Lines.Add(new TooltipLine(_mod, "DecimationAmuletClass", _amulet.AmuletClass.ToString("F")) + Lines.Add(new TooltipLine(_mod, "DecimationAmuletClass", _amulet.AmuletClass.ToString("F")) { overrideColor = _classColor }); @@ -38,7 +36,7 @@ namespace Decimation.Lib.Amulets public AmuletTooltip AddEffect(string tooltip) { - this.Lines.Add(new TooltipLine(_mod, $"Effect{_effectCount}", tooltip) + Lines.Add(new TooltipLine(_mod, $"Effect{_effectCount}", tooltip) { overrideColor = _effectColor }); @@ -49,19 +47,10 @@ namespace Decimation.Lib.Amulets public AmuletTooltip AddSynergy(string tooltip) { - if (!_hasSynergy) + Lines.Add(new TooltipLine(_mod, "Synergy", tooltip) { - this.Lines.Add(new TooltipLine(_mod, "Synergy", tooltip) - { - overrideColor = _synergyColor - }); - - _hasSynergy = true; - } - else - { - throw new InvalidOperationException($"Can't add more than one synergy tooltip to {_amulet.Name}"); - } + overrideColor = _synergyColor + }); return this; } diff --git a/Lib/Amulets/Synergy/AmuletSynergyAdapter.cs b/Lib/Amulets/Synergy/AmuletSynergyAdapter.cs index 41c87b6..247856c 100644 --- a/Lib/Amulets/Synergy/AmuletSynergyAdapter.cs +++ b/Lib/Amulets/Synergy/AmuletSynergyAdapter.cs @@ -1,27 +1,32 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Decimation.Content; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; namespace Decimation.Lib.Amulets.Synergy { public class AmuletSynergyAdapter : IAmuletsSynergy { - public virtual void OnHitPlayer(DecimationModPlayer modPlayer, ref int damages) + public virtual void OnHitNPC(DecimationPlayer modPlayer, NPC target, Item weapon, ref int damages, ref bool crit) { } - public virtual void OnShoot(DecimationModPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, ref float speedY, + public virtual void OnHitPlayer(DecimationPlayer modPlayer, Player target, Item weapon, ref int damages, + ref bool crit) + { + } + + public virtual void OnPlayerHit(DecimationPlayer modPlayer, ref int damages) + { + } + + public virtual void OnShoot(DecimationPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, + ref float speedY, ref int projectileType, ref int damages, ref float knockBack) { } - public virtual void Update(DecimationModPlayer modPlayer) + public virtual void Update(DecimationPlayer modPlayer) { } } -} +} \ No newline at end of file diff --git a/Lib/Amulets/Synergy/IAmuletsSynergy.cs b/Lib/Amulets/Synergy/IAmuletsSynergy.cs index 27b5328..5448d3c 100644 --- a/Lib/Amulets/Synergy/IAmuletsSynergy.cs +++ b/Lib/Amulets/Synergy/IAmuletsSynergy.cs @@ -1,14 +1,15 @@ -using Microsoft.Xna.Framework; +using Decimation.Content; +using Microsoft.Xna.Framework; using Terraria; namespace Decimation.Lib.Amulets.Synergy { public interface IAmuletsSynergy { - void OnHitPlayer(DecimationModPlayer modPlayer, ref int damages); - - void OnShoot(DecimationModPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int projectileType, ref int damages, ref float knockBack); - - void Update(DecimationModPlayer modPlayer); + void OnHitNPC(DecimationPlayer modPlayer, NPC target, Item weapon, ref int damages, ref bool crit); + void OnHitPlayer(DecimationPlayer modPlayer, Player target, Item weapon, ref int damages, ref bool crit); + void OnPlayerHit(DecimationPlayer modPlayer, ref int damages); + void OnShoot(DecimationPlayer modPlayer, Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int projectileType, ref int damages, ref float knockBack); + void Update(DecimationPlayer modPlayer); } } diff --git a/Content/Buffs/DecimationBuff.cs b/Lib/Buffs/DecimationBuff.cs similarity index 95% rename from Content/Buffs/DecimationBuff.cs rename to Lib/Buffs/DecimationBuff.cs index 9fbb1e9..f50b7d4 100644 --- a/Content/Buffs/DecimationBuff.cs +++ b/Lib/Buffs/DecimationBuff.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; using Terraria; -namespace Decimation.Content.Buffs +namespace Decimation.Lib.Buffs { internal abstract class DecimationBuff : ModBuff { diff --git a/Lib/DecimationPlayer.cs b/Lib/DecimationPlayer.cs deleted file mode 100644 index a339fd0..0000000 --- a/Lib/DecimationPlayer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Decimation.Lib.Items; -using Decimation.Lib.Util; -using Terraria.ModLoader; - -namespace Decimation.Lib -{ - public abstract class DecimationModPlayer : ModPlayer, IDecimationPlayer - { - public abstract bool HasLavaCharm { get; set; } - public abstract bool HasShield { get; set; } - - } -} \ No newline at end of file diff --git a/Lib/IDecimationPlayer.cs b/Lib/IDecimationPlayer.cs deleted file mode 100644 index ac5bcba..0000000 --- a/Lib/IDecimationPlayer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Terraria.ModLoader; - -namespace Decimation.Lib -{ - public interface IDecimationPlayer - { - - bool HasLavaCharm { get; } - bool HasShield { get; } - - } -} diff --git a/Lib/Util/PlayerUtils.cs b/Lib/Util/PlayerUtils.cs index b59b2fd..a05bc43 100644 --- a/Lib/Util/PlayerUtils.cs +++ b/Lib/Util/PlayerUtils.cs @@ -20,5 +20,10 @@ namespace Decimation.Lib.Util { return player.GetModPlayer().EquippedAccessories.Contains(accessoryType); } + + public static bool HasEquippedAmulet(this Player player, int amuletType) + { + return player.GetModPlayer().AmuletSlotItem.type == amuletType; + } } } \ No newline at end of file diff --git a/Lib/Util/WeaponUtils.cs b/Lib/Util/WeaponUtils.cs new file mode 100644 index 0000000..39050cb --- /dev/null +++ b/Lib/Util/WeaponUtils.cs @@ -0,0 +1,35 @@ +using System.Linq; +using Terraria.ID; + +namespace Decimation.Lib.Util +{ + public static class WeaponUtils + { + private static readonly int[] FireWeapons = + { + ItemID.FieryGreatsword, + ItemID.SolarFlarePickaxe, + ItemID.MoltenHamaxe, + ItemID.Sunfury, + ItemID.SolarEruption, + ItemID.SolarFlareHammer, + ItemID.HelFire, + ItemID.MoltenPickaxe + }; + + private static readonly int[] FireMeleeProjectiles = + { + ProjectileID.Flamarang + }; + + public static bool IsFireWeapon(this int itemType) + { + return FireWeapons.Contains(itemType); + } + + public static bool IsFireMeleeProjectile(this int projectileType) + { + return FireMeleeProjectiles.Contains(projectileType); + } + } +} \ No newline at end of file