From 175f13c4575dd051032aa9d36ac39abb9f1017e8 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Sun, 4 Apr 2021 01:23:03 +0100 Subject: [PATCH 1/4] Added the Phantomic Artifact Also made it and it's predecessors unstackable with their predecessors (hallowed rune) --- Buffs/StatBuffs/PhantomicArmourBuff.cs | 27 ++++ Buffs/StatBuffs/PhantomicArmourBuff.png | Bin 0 -> 744 bytes Buffs/StatBuffs/PhantomicEmpowermentBuff.cs | 25 ++++ Buffs/StatBuffs/PhantomicEmpowermentBuff.png | Bin 0 -> 638 bytes Buffs/StatBuffs/PhantomicRestorationBuff.cs | 30 ++++ Buffs/StatBuffs/PhantomicRestorationBuff.png | Bin 0 -> 607 bytes CalPlayer/CalamityPlayer.cs | 14 ++ CalPlayer/CalamityPlayerLifeRegen.cs | 17 +++ CalPlayer/CalamityPlayerMiscEffects.cs | 2 + CalPlayer/CalamityPlayerOnHit.cs | 52 ++++++- Items/Accessories/HallowedRune.cs | 2 +- Items/Accessories/PhantomicArtifact.cs | 49 +++++++ Items/Accessories/PhantomicArtifact.png | Bin 0 -> 1104 bytes Projectiles/Healing/PhantomicHeart.cs | 98 +++++++++++++ Projectiles/Healing/PhantomicHeart.png | Bin 0 -> 906 bytes Projectiles/Summon/PhantomicDagger.cs | 145 +++++++++++++++++++ Projectiles/Summon/PhantomicDagger.png | Bin 0 -> 472 bytes Projectiles/Summon/PhantomicShield.cs | 109 ++++++++++++++ Projectiles/Summon/PhantomicShield.png | Bin 0 -> 1234 bytes 19 files changed, 563 insertions(+), 7 deletions(-) create mode 100644 Buffs/StatBuffs/PhantomicArmourBuff.cs create mode 100644 Buffs/StatBuffs/PhantomicArmourBuff.png create mode 100644 Buffs/StatBuffs/PhantomicEmpowermentBuff.cs create mode 100644 Buffs/StatBuffs/PhantomicEmpowermentBuff.png create mode 100644 Buffs/StatBuffs/PhantomicRestorationBuff.cs create mode 100644 Buffs/StatBuffs/PhantomicRestorationBuff.png create mode 100644 Items/Accessories/PhantomicArtifact.cs create mode 100644 Items/Accessories/PhantomicArtifact.png create mode 100644 Projectiles/Healing/PhantomicHeart.cs create mode 100644 Projectiles/Healing/PhantomicHeart.png create mode 100644 Projectiles/Summon/PhantomicDagger.cs create mode 100644 Projectiles/Summon/PhantomicDagger.png create mode 100644 Projectiles/Summon/PhantomicShield.cs create mode 100644 Projectiles/Summon/PhantomicShield.png diff --git a/Buffs/StatBuffs/PhantomicArmourBuff.cs b/Buffs/StatBuffs/PhantomicArmourBuff.cs new file mode 100644 index 0000000000..ffb9114e63 --- /dev/null +++ b/Buffs/StatBuffs/PhantomicArmourBuff.cs @@ -0,0 +1,27 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + class PhantomicArmourBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Phantomic Shield"); + Description.SetDefault("Defense boosted by 8 and damage reduction boosted by 8%\n" + + "An ephereal bulwark protects you"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.endurance += 0.08f; + player.statDefense += 8; + } + } +} diff --git a/Buffs/StatBuffs/PhantomicArmourBuff.png b/Buffs/StatBuffs/PhantomicArmourBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..4d1a7b731e4f45071a8e62dabb9b165d512240ee GIT binary patch literal 744 zcmVP)JV{RpC@QVmLQaN?qNw-*q7@Idv}#czRH79m)E?RjIp{GS_RUN7C8;?j zJD11o?ChKWe`jZBU5$110L=cK&rwBLvBd2HSX9lQmJ%0`18Dbd1;FR=0=h)trIF;Wpx0Y>D&Xr_4_XXh#x(u>4IGR6C>j#12BgHJL?_iS40p#93IogcWex3 zy0@X;VrUBhU(%Tc12BgHkx(iDKyd8_AisBUpSmN~c|95v_ip(C=sG#3*+s-()|2(k zV?eS$l===p@uG=m_| zp9YofJv$W>Qt?DY@42jy_r6j&lkAY}SLZ)z<(PR4l#~3q9RT3R%oLEn1E$_j1NjR0 z`je^yp};^z0o0st4Zugv4+JD|8T5|NGv$6h=A&FhHzhaLb0-D^1n4y1PdDAPwc z#o1NYoB@|_WitTj-#@GRI&NOxWX9|G9}XVaKy1WxQ2+n{5_CmabVXQ6MmkS&X=QG7 aVRUJ4ZU8ZaSnTfr0000=gr3Pp5k z5Q5;~Qo4zo&{YGHSt5lx1Rd;P3AELI4aFhg7l_0VP+|tLP)LWn_v-t2mpCP_|K)hz z&-?%Gd7rzpf=vMcF8`Fu)KI~ufCbP{%T2vx0cC*Uwmtyb!)*X`2ihx6Ol7yV_*G;~ zYtNkSaC2QL)o&gFDdnsh2{|tQs8x#-=VzXT>Q121&+*UFzNaJQM5&|mh3)M3dPQO` z5vSi60&Wg0KYOb=Pd*v;oG|iv6@dIz1c3MH83106F9Fcu?Zh#hCN=H0>t01v}002Fh10G@`LwQB%BK8ch05c zTej{5tgev#b^EK3t?A!!S14k}-|;`-$*zx|rOEsN000tnMObu2SV=}YPjYExZggRE YX>V=-F@#v`?*IS*07*qoM6N<$f@_&2EdT%j literal 0 HcmV?d00001 diff --git a/Buffs/StatBuffs/PhantomicRestorationBuff.cs b/Buffs/StatBuffs/PhantomicRestorationBuff.cs new file mode 100644 index 0000000000..85a82c8f23 --- /dev/null +++ b/Buffs/StatBuffs/PhantomicRestorationBuff.cs @@ -0,0 +1,30 @@ +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + class PhantomicRestorationBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Phantomic Regen"); + Description.SetDefault("Regenerating life"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer calPlayer = player.Calamity(); + if (calPlayer.phantomicHeartRegen <= 0) + { + calPlayer.phantomicHeartRegen = 1000; + } + player.lifeRegen += 3; + } + } +} diff --git a/Buffs/StatBuffs/PhantomicRestorationBuff.png b/Buffs/StatBuffs/PhantomicRestorationBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..806d74e3583012ab956a4249a42ef35c8ce3f1d9 GIT binary patch literal 607 zcmV-l0-*hgP)KhiF8v86(Lek$F3G}423`u zTr8z?hfZ}6T^_iUk}MrE#zH|5C1N*GDk4Zg9EzH$PI0)q7vJB@dv!^!-*)%@ckjO6 z`|jR*UT=2-fUE0zgEs2%!+sCoK|611lLs^aa>`M?lIriz6ZH3Xh(J+G~H#tb{sFpsSVRz50>Wk#X{`B<>K=*PS5{WMFmb zL&&*5kh2b$-1>H}8yF%o6JBY-4FY#EAf3zf{;Cazu8$;-Bm3n%l7u@1g4Bx@O6Nn1 zUjg{Lf1vs+pCbDqdUv=(K*~Hb>HPJ(b6wF7K&7gkS5dD&sXR?Y&x%yPpDH2qo7vK(oK-1#@6m)ax$1(ty>j&DYa@Nd(osiiLM!_!7^HXw- zKyXrtg4yh~TCh&DNq2c=*zR2KhErW{#>*4XsN)2Jw_(HIwO4Fx1CT%2R3xh1K=WLX z`u$}-UGTVk>lNeRO*HtVn35sTq|C`OI56m--I~2sKYkoeAkY=0r7_ za*x1T@jGy9znT*(hQw&X{-x7O@~gVz1iW-#3V@@F)3*K{k37k^@ppU!RMoYVv)rh6 t0000IbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1kJA6}$id literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 61dab1884d..277054e90b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -559,6 +559,9 @@ namespace CalamityMod.CalPlayer public bool starTaintedGenerator = false; public bool hallowedRune = false; public int hallowedRuneCooldown = 0; + public bool phantomicArtifact = false; + public int phantomicBulwarkCooldown = 0; + public int phantomicHeartRegen = 0; // 0 = can spawn, 720 = regen applied, 600 = regen stops and 10 sec cd before it can spawn again public bool silvaWings = false; public int icicleCooldown = 0; public bool rustyMedal = false; @@ -1574,6 +1577,7 @@ namespace CalamityMod.CalPlayer sRegen = false; sPower = false; hallowedRune = false; + phantomicArtifact = false; hallowedDefense = false; hallowedRegen = false; hallowedPower = false; @@ -2052,6 +2056,8 @@ namespace CalamityMod.CalPlayer icicleCooldown = 0; statisTimer = 0; hallowedRuneCooldown = 0; + phantomicBulwarkCooldown = 0; + phantomicHeartRegen = 0; sulphurBubbleCooldown = 0; ladHearts = 0; prismaticLasers = 0; @@ -5916,6 +5922,14 @@ namespace CalamityMod.CalPlayer } } + if (phantomicArtifact && player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) + { + Projectile pro = Main.projectile.AsEnumerable().Where(projectile => projectile.friendly && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType()).First(); + phantomicBulwarkCooldown = 1200; // 20 second cooldown + pro.Kill(); + damage = (int)(damage * 0.8f); //20% damage reduction for a projectile. + } + if (auralisAuroraCounter >= 300) { damage -= 100; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index a62a6c0d19..a68a7435ac 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; +using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -668,6 +669,22 @@ namespace CalamityMod.CalPlayer player.lifeRegen += 3; } + if (modPlayer.phantomicHeartRegen <= 720 && modPlayer.phantomicHeartRegen >= 600) + { + player.lifeRegen += 5; //Boosts the life regen from 3 to 10 for a short time. + if (Main.rand.NextBool(2)) + { + int regen = Dust.NewDust(player.position, player.width, player.height, 5, 0f, 0f, 200, new Color(99, 54, 84), 2f); + Main.dust[regen].noGravity = true; + Main.dust[regen].fadeIn = 1.3f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); + Main.dust[regen].velocity = velocity; + velocity.Normalize(); + velocity *= 34f; + Main.dust[regen].position = player.Center - velocity; + } + } + if (modPlayer.community) { float floatTypeBoost = 0.05f + diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 27b9572866..697e0fe6e4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1078,6 +1078,8 @@ namespace CalamityMod.CalPlayer } // Cooldowns and timers + if (modPlayer.phantomicHeartRegen >= 0 && modPlayer.phantomicHeartRegen < 1000) + modPlayer.phantomicHeartRegen--; if (modPlayer.dodgeCooldownTimer > 0) modPlayer.dodgeCooldownTimer--; if (modPlayer.KameiBladeUseDelay > 0) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index dc7f1ac2b2..12dc6d21ec 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -18,6 +18,8 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using System.Linq; +using CalamityMod.Items.Weapons.Summon; namespace CalamityMod.CalPlayer { @@ -333,17 +335,45 @@ namespace CalamityMod.CalPlayer { if (npcCheck) { - if (modPlayer.sGenerator) + if (modPlayer.phantomicArtifact) { + int restoreBuff = BuffType(); + int empowerBuff = BuffType(); + int shieldBuff = BuffType(); int buffType = Utils.SelectRandom(Main.rand, new int[] { - BuffType(), - BuffType(), - BuffType() + restoreBuff, + empowerBuff, + shieldBuff }); - player.AddBuff(buffType, 120); + player.AddBuff(buffType, 420); //7 seconds + if (buffType == restoreBuff) + { + if (modPlayer.phantomicHeartRegen == 1000 && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0 && Main.rand.NextBool(20)) + { + Vector2 target = proj.Center; + target.Y += Main.rand.Next(-50, 50); + target.X += Main.rand.Next(-50, 50); + Projectile.NewProjectile(target, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f); + } + } + else if (buffType == empowerBuff) + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 5 && Main.rand.NextBool(10)) //at most 5 + { + int damage = (int)(100 * player.MinionDamage()); + Projectile.NewProjectile(proj.position, proj.velocity, ModContent.ProjectileType(), damage, 1f, player.whoAmI, 0f); + } + } + else + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0 && modPlayer.phantomicBulwarkCooldown <= 0) + { + Projectile.NewProjectile(player.position, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f); + } + } } - if (modPlayer.hallowedRune) + else if (modPlayer.hallowedRune) { int buffType = Utils.SelectRandom(Main.rand, new int[] { @@ -353,6 +383,16 @@ namespace CalamityMod.CalPlayer }); player.AddBuff(buffType, 120); } + else if (modPlayer.sGenerator) + { + int buffType = Utils.SelectRandom(Main.rand, new int[] + { + BuffType(), + BuffType(), + BuffType() + }); + player.AddBuff(buffType, 120); + } } // Fearmonger set's colossal life regeneration diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 91b095d965..04be50fda8 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Hallowed Rune"); - Tooltip.SetDefault("Whenever your minions hit an enemy you will gain a random buff\n" + + Tooltip.SetDefault("Whenever your minions hit an enemy you will gain a random buff, does not stack with downgrades\n" + "These buffs will either boost your defense, summon damage, or life regen for a while\n" + "If you have the offensive boost, enemies hit by minions will sometimes be hit by stars"); } diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs new file mode 100644 index 0000000000..a9183af297 --- /dev/null +++ b/Items/Accessories/PhantomicArtifact.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; + +namespace CalamityMod.Items.Accessories +{ + class PhantomicArtifact : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantomic Artifact"); + Tooltip.SetDefault("Whenever your minions hit an enemy you will gain a random phantomic buff, does not stack with downgrades\n" + + "These buffs will either boost your defense, summon damage, or life regen for a while\n" + + "If you have the offensive boost, enemies hit by minions will sometimes be hit by phantomic knives\n" + + "If you have the regenerative boost, a phantomic heart will occasionally materialise granting massive health regen\n" + + "If you have the defensive boost, a phantomic bulwark will absorb 20% of the next projectile's damage that hits the bulwark, shattering it"); + } + + public override void SetDefaults() + { + item.width = 48; + item.height = 62; + item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.PureGreen; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().phantomicArtifact = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Accessories/PhantomicArtifact.png b/Items/Accessories/PhantomicArtifact.png new file mode 100644 index 0000000000000000000000000000000000000000..50bc4f200b47c53e4574702ede84edab8733043c GIT binary patch literal 1104 zcmV-W1h4yvP)< z9ozN(@ryS?>!)U(hSnzv2tMXVhA#r}{pTV8*`Z;l+$`fKa%Td7FU5~eee4wo_S=A% z?@aXoP_C?pGCz9i5&)&;uK=7Mx#YBC8P5*p1Ay;K1*cx_BP0qm_=oFv3yJxL2hAyL4>x{gJZ>-;Mc z1q7e#w5sn5i2{Q4d5r-nP$(|8rVOo=eGcq z)>Z(>){+$4V?zqPnVW9*9i8VYJ0Y~60%HC|?hF85iXW>0mrdUmqL@@XkOI2Czc&*A ztgM!rdeQ6Sw*Z)$dFqUv_$%NW?P6YEuDOg{Wnpm^fOL0X0I;_4s|xj5X=!cVY0tV* zxw7Guqg=-#-Q5SYg94aQ-oU7Hp=G|it2gvIA(QS8tyjiQaicR;izDTV>t@-(n)}%m zo4vm+6aeZj^JZ?ksU4JZdAkog*UNQ;dt)~Nn4EtO)W?Xj7)!stRRK~RT>-#Qf40`n zQo$L6g4}FjtK2>c2tL18PE!nvIiZs31?r67$(^j7n79hSmkHmfnapx0#Kjp*u1`AcT&WN@ZsuRr#$g##wkyq9(T%_myc>k<5p46(HN2& z#$N&7-d2N4I5*faqS>c~n7W<60>FcJ&j5dXuzlOkvF!UCNe{KhTxff4?c3`TdVBf< zfYtSt(AlXXwOpoj?Y?u~_IW8}*U)0#K2NZbyL}W8c9|7AW5e$E3O4duck;Q9ZLeYM zg|3;~cTH^bGgcAn!-C?+lfvuJ2c3QO7=Y3I7_gIR9o3F?KVRM`_6kJq6We`YLF<8y z%~hvf3<`<^RvD|HuRYBFK^BKffhdG3p}3&FZ<%lA9pEr45QPwhoOq!OoqXTt?@4xg zzfhjWW+~M7Lo#zf^O-pxVz0n~|1V_YfZ&^T65;bvh`j= 10) + { + projectile.velocity.Y *= 0.99f; + } + else + { + projectile.velocity.Y *= 1.01f; + } + if (floatTimer >= 20) + floatTimer = 0; + else + floatTimer++; + + for (int i = 0; i < 3; i++) + { + Dust.NewDust(projectile.TopLeft, projectile.width, projectile.height, 5, Main.rand.NextFloat(-3, 3), -5f, 0, new Color(99, 54, 84), Main.rand.NextFloat(0.5f, 1.5f)); + } + + Player player = Main.player[projectile.owner]; + Vector2 playerVector = player.Center - projectile.Center; + float playerDist = playerVector.Length(); + if (projectile.timeLeft < 500 && playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) + { + if (player.whoAmI == Main.myPlayer) + { + CalamityPlayer calPlayer = player.Calamity(); + calPlayer.phantomicHeartRegen = 720; + projectile.Kill(); + } + } + if (player.lifeMagnet && projectile.timeLeft < 510) + { + float N = 18f; + playerDist = 15f / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); + projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); + } + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame % 2 == 0) + projectile.netUpdate = true; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } +} diff --git a/Projectiles/Healing/PhantomicHeart.png b/Projectiles/Healing/PhantomicHeart.png new file mode 100644 index 0000000000000000000000000000000000000000..72436358aab46f7e4ed04e5423ec89a4214295ad GIT binary patch literal 906 zcmV;519kj~P)mY;mH)v) z@E?ezx3Cu^T8ad>kQB;BjA*+l+=H33x!#%Cao>HzJ5_dO-sGJ*ciznVcmuT5&eryH zXKQ=fwjFh@Yr`T-E8YQ`*Ne9=-8TQy(lb2Y)LGLj;a!0^4pr>A<-BROOLy3~;-1}q ze5SK^$Ddj`jhEpf<7OTXEopX?SHuQVC~YiTEqR1uK@s~+Yf5nzyJIS02m*B zs9lM44*3V2GLzMdR{;PU*Y9>Z@xhn(0D$9P-)c_dj5Jp+uLJm-iDvld!c73ctKXk% z+j%_O(;=1qdC2>Y)yZn3v??i9Ev4-zlS$&SRCV;@u=blH2k%c-F*DNr+MY_EA?0P+ zbUU+4=FolO^Zr|t>a@mEYHXY@PKFe-r07UTAiWPYySNT5$6hsB%4d#WRn=7U9hSqQ zFd9Cm8U8Gszs9Rmz_CMWW)|hkTpvn?%K<7=s~E z?(>krkCig+zJEhtm`im7f+}3q_R- zdspE!bIz=J;cz%jQ;Ly~L*+HzXya9JoGSI4XwREgal8z*$NarHBTnkXtKv8rQXZl5 zoF%VPmzP?kN#}#AxFm|wH|(w?D&FjAxFkxevXH23NR(Tp7HMj`KUtNQHBn_vR3TC6 z9d=eBQAKf;-S>yXCsD1xdumEE!Z_@mVp#i=Ic&|^hLfSn`~EO2FLirmIqT{)|K*D5^7x}!djQkZPSaPZW~V);JQ79e z`nL3A>HqpVFP_6fq6&!`8|RCYAyr6JAyN4{%tj}Fu#z9fjMljT000tnMObu2SV=}Y gPjYExZggREX>V=-F@#v`?*IS*07*qoM6N<$f+6F-1ONa4 literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PhantomicDagger.cs b/Projectiles/Summon/PhantomicDagger.cs new file mode 100644 index 0000000000..8681e74e34 --- /dev/null +++ b/Projectiles/Summon/PhantomicDagger.cs @@ -0,0 +1,145 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + class PhantomicDagger : ModProjectile + { + private bool homing = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Dagger"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 38; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 600; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.alpha = 200; + projectile.minion = true; + } + + public override bool? CanHitNPC(NPC target) + { + if (homing) + return null; //cannot hit until it is beginning to home. + return false; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(homing); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + homing = reader.ReadBoolean(); + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + //Avoid touching things that you probably aren't meant to damage + if (target.defense > 999 || target.Calamity().DR >= 0.95f || target.Calamity().unbreakableDR) + return; + int cap = (int)(damage * 1.05f); //capped at 5% dr ignoring + damage = Math.Min((int)(damage * (1 / (1 - target.Calamity().DR))), cap); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + for (int d = 0; d < 4; d++) + { + int shadow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); + Main.dust[shadow].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[shadow].scale = 0.5f; + Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int d = 0; d < 12; d++) + { + int shadow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 3f); + Main.dust[shadow].noGravity = true; + Main.dust[shadow].velocity *= 5f; + shadow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 2f); + Main.dust[shadow].velocity *= 2f; + } + + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (CalamityConfig.Instance.Afterimages) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + } + return true; + } + + public override void AI() + { + if (Main.dust.Length < Main.maxDust - 3) + { + for (int i = 0; i < 3; i++) + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 3f); //new Color(99, 54, 84) + Main.dust[dust].noGravity = true; + } + } + if (projectile.alpha != 0) + { + projectile.rotation -= 0.25f; + projectile.velocity.X *= 0.985f; + projectile.velocity.Y *= 0.985f; + if (projectile.alpha < 3) + { + projectile.alpha = 0; + homing = true; + } + else + projectile.alpha -= 3; + } + else + { + NPC target = CalamityUtils.MinionHoming(projectile.Center, 1500f, Main.player[projectile.owner]); + if (target != null) + { + float num550 = 40f; + Vector2 vector43 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num551 = target.Center.X - vector43.X; + float num552 = target.Center.Y - vector43.Y; + float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552)); + if (num553 < 100f) + { + num550 = 28f; //14 + } + num553 = num550 / num553; + num551 *= num553; + num552 *= num553; + projectile.velocity.X = (projectile.velocity.X * 25f + num551) / 26f; + projectile.velocity.Y = (projectile.velocity.Y * 25f + num552) / 26f; + } + else + { + projectile.velocity *= 0.9f; + } + projectile.rotation = projectile.velocity.ToRotation() + (float)Math.Atan(90); + } + } + } +} diff --git a/Projectiles/Summon/PhantomicDagger.png b/Projectiles/Summon/PhantomicDagger.png new file mode 100644 index 0000000000000000000000000000000000000000..d0f6ad90ae56ece249ca019b48c736717baca977 GIT binary patch literal 472 zcmeAS@N?(olHy`uVBq!ia0vp^JV30*!3HEhI8|*2QY`6?zK#qG8~eHcB(ehejKx9j zP7LeL$-D$|6p}rHd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!tD z$=lt9;Xep2*t>i(&?Gfa7sn8b(_5#W^*Zbz(z@SMDw=oYmB2OJu7XEfcYNf0CH&&> z4~u=x)sEZsLhp!8&Uqrdpw_ z1=shpD=b)|wcq!R>2^koy!nw0Stg7B2$j8-W|(vAIz!KK<@1s*#V3Urw)2O7tLNDK zF)1x(o`P)Lym{;kj9>iSdBD~={laF3_Sx(VGNtEjQ#GPw)14-?2zpA0#s^GWu;rRq zLj7LW1FfFMl6tq*8IEjid;WRCbjf`?QfCO{6>Zp8`6YO1=UNN9{iTc*rv409mL;(o z)R_0N6izVSee2Fifg_f_!R}2KB2)kSwI6)$cP*+~?aE`;mDBc!&nsJ967??RWqa|| zDNEG9Z~OaYz3@ZkgS-LLWO&}%0>e 5) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame % 2 == 0) + projectile.netUpdate = true; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + } +} diff --git a/Projectiles/Summon/PhantomicShield.png b/Projectiles/Summon/PhantomicShield.png new file mode 100644 index 0000000000000000000000000000000000000000..162c288eb61d9989bee4fdbb0ce50be1106c12d3 GIT binary patch literal 1234 zcmY+EeNfV89Ke6}W^Z1z(I{N2rA|-W&tvI4U7Ka7;7gemsYJdI2}gqcL`i-VR!T)m z4HK6xJL^QFP;{Oc3g%Jy8g&`IBw$;bo{~_hn1wpny4&rZ@AG`_`+UEDeD0p_J%ZSM z5iV;{YXJao!Q-%Tc79{uf399-KbeIHXFFDW^8U=yVzu`xrHTyt>-QEg?N$hnw>(y!^fT9D@&XR);a2PFHd}g+ zx_)KCUu*Qet?x8_QGrf}P6VCnZVs2tYUP+IfpfJS0IXO)ivA|Xny5MU;k~iosqeuK z_33waPt?Ng!?uNG6_Z)EBi!0be9(6))ii6p4wkC=-_T`c0&}5LGG2#qskww7JjZ#4 zri+u@&^h0BMA9y%Q-`A`CY$6G-Pc+q^FZJ858LZV z;5p%X?*3hM8`B>}j)JlW@ib2eN!YnL&to!?`D!RP zHMS>(%6c-WQWhL-Zc0iBW{c>!mjhQ%oK26oRE{+Z8W>%eBK6aYL~@O`!$Tc&`&J9n zzeC|Uo|axiqIPX+YTxmMNiiG3^i>y#WKm1qM&&xR12Fy{Z|j4+UaVV#;}%0m6d3s8 zPE!0Ql)|~b1Q=&lGxP4)ytq6HxF`%zpAXC$NVb?cj34bT9(*F%JwZNr?!r-{D3hC0 zgd>g_Q0S7D?TL_thZpB$A|d9rfoMEF6ME4ruU9}wsq5}2LzbWPW@+6R=)YHehx`yi zq856r#oeSC%L4_Xe;VZcu&v;KDgw2~zt%7J&~6G79Dw+0&R2He2#Y$OEOX9Bg3aysIaPr|J0BP>Qx@o&DAdZwv2%3U)HDd) z3z3FA|EkxYedCpnOs#<1%f`UC@wrYLKVNQdVVOg(PyQPGwv!hZw)3gItNb=an{qcG zJ9V5i6WI6MpDlt{9RiJ*Dp5CSlp7JV#PJls;fVhR!_z)S4$apBXUV+t7&NneVf5=S q?BCEvR#?0}@ZrJxAsU6jN@3BM3;>fK|Jq`&0{F0f*xJzKvws8sZgW!r literal 0 HcmV?d00001 From c33909c0544623003e01bae292f887d09523e698 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Sun, 4 Apr 2021 01:34:31 +0100 Subject: [PATCH 2/4] Not sure how I forgot to decrement the cooldown tbh --- CalPlayer/CalamityPlayerMiscEffects.cs | 4 +++- CalPlayer/CalamityPlayerOnHit.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 697e0fe6e4..542a494230 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1078,8 +1078,10 @@ namespace CalamityMod.CalPlayer } // Cooldowns and timers - if (modPlayer.phantomicHeartRegen >= 0 && modPlayer.phantomicHeartRegen < 1000) + if (modPlayer.phantomicHeartRegen > 0 && modPlayer.phantomicHeartRegen < 1000) modPlayer.phantomicHeartRegen--; + if (modPlayer.phantomicBulwarkCooldown > 0) + modPlayer.phantomicBulwarkCooldown--; if (modPlayer.dodgeCooldownTimer > 0) modPlayer.dodgeCooldownTimer--; if (modPlayer.KameiBladeUseDelay > 0) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 12dc6d21ec..d8912cb3a9 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -367,7 +367,7 @@ namespace CalamityMod.CalPlayer } else { - if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0 && modPlayer.phantomicBulwarkCooldown <= 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0 && modPlayer.phantomicBulwarkCooldown == 0) { Projectile.NewProjectile(player.position, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f); } From cdaf254f699a710ee238a723a59a9e57fada1145 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sat, 3 Apr 2021 22:07:09 -0400 Subject: [PATCH 3/4] "ephereal" -> "ephemeral" --- Buffs/StatBuffs/PhantomicArmourBuff.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buffs/StatBuffs/PhantomicArmourBuff.cs b/Buffs/StatBuffs/PhantomicArmourBuff.cs index ffb9114e63..bdb6527e42 100644 --- a/Buffs/StatBuffs/PhantomicArmourBuff.cs +++ b/Buffs/StatBuffs/PhantomicArmourBuff.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Phantomic Shield"); Description.SetDefault("Defense boosted by 8 and damage reduction boosted by 8%\n" + - "An ephereal bulwark protects you"); + "An ephemeral bulwark protects you"); Main.debuff[Type] = false; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; From 1dc99c907853b94ba962523f37d6df78cfc029cf Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sat, 3 Apr 2021 22:07:30 -0400 Subject: [PATCH 4/4] fix addition inconsistency in code comment --- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index a68a7435ac..99f0269791 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -671,7 +671,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.phantomicHeartRegen <= 720 && modPlayer.phantomicHeartRegen >= 600) { - player.lifeRegen += 5; //Boosts the life regen from 3 to 10 for a short time. + player.lifeRegen += 5; //Boosts the life regen from 3 to 8 for a short time. if (Main.rand.NextBool(2)) { int regen = Dust.NewDust(player.position, player.width, player.height, 5, 0f, 0f, 200, new Color(99, 54, 84), 2f);