From 601672ec804364ff2754a7e6006e2a7af2ce4aed Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 30 Dec 2019 14:27:34 -0500 Subject: [PATCH] added godspawn helix staff --- Buffs/Summon/AstralProbeBuff.cs | 36 ++++ Buffs/Summon/AstralProbeBuff.png | Bin 0 -> 3107 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/TreasureBags/AstrumDeusBag.cs | 2 + Items/Weapons/Summon/GodspawnHelixStaff.cs | 44 +++++ Items/Weapons/Summon/GodspawnHelixStaff.png | Bin 0 -> 1155 bytes ModSupport/WeakReferenceSupport.cs | 3 +- NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs | 2 + Projectiles/Summon/AstralProbeRound.cs | 118 ++++++++++++ Projectiles/Summon/AstralProbeRound.png | Bin 0 -> 2833 bytes Projectiles/Summon/AstralProbeSummon.cs | 190 ++++++++++++++++++++ Projectiles/Summon/AstralProbeSummon.png | Bin 0 -> 675 bytes 12 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 Buffs/Summon/AstralProbeBuff.cs create mode 100644 Buffs/Summon/AstralProbeBuff.png create mode 100644 Items/Weapons/Summon/GodspawnHelixStaff.cs create mode 100644 Items/Weapons/Summon/GodspawnHelixStaff.png create mode 100644 Projectiles/Summon/AstralProbeRound.cs create mode 100644 Projectiles/Summon/AstralProbeRound.png create mode 100644 Projectiles/Summon/AstralProbeSummon.cs create mode 100644 Projectiles/Summon/AstralProbeSummon.png diff --git a/Buffs/Summon/AstralProbeBuff.cs b/Buffs/Summon/AstralProbeBuff.cs new file mode 100644 index 0000000000..d2e2aa00f4 --- /dev/null +++ b/Buffs/Summon/AstralProbeBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class AstralProbeBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Astral Probe"); + Description.SetDefault("The astral probe will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.aProbe = true; + } + if (!modPlayer.aProbe) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/AstralProbeBuff.png b/Buffs/Summon/AstralProbeBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..d8d97e9fab2c3db9c01ce6958fe0f88ddb15be91 GIT binary patch literal 3107 zcmV+;4BYdHP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gU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j+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0003_Nklv2+*f@v{2ECY-6eqw?*l0|kP+S2;t;2EwDpweT zhel9uD*K9NHzdV$#1p;q^S3sNngK+}D8@_E%CGj{mVsLAHrUtPs3k)&j2LK0A)xq)FdA})6F&kO? z_ya(bA!XaIa98u?Lg&jxoX<^W0s95O=a@mPCIUcRFuwrSPbEOGfB{%A1ON-;{s8J; xOsasmWL!E1N)Pbc%PD{utm(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); // Equipment diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.cs b/Items/Weapons/Summon/GodspawnHelixStaff.cs new file mode 100644 index 0000000000..208e16351b --- /dev/null +++ b/Items/Weapons/Summon/GodspawnHelixStaff.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class GodspawnHelixStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Godspawn Helix Staff"); + Tooltip.SetDefault("Summons astral probes to protect you"); + } + + public override void SetDefaults() + { + item.damage = 100; + item.mana = 10; + item.width = 50; + item.height = 50; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 1.25f; + item.value = Item.buyPrice(0, 95, 0, 0); + item.rare = 9; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.summon = true; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + return false; + } + } +} diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.png b/Items/Weapons/Summon/GodspawnHelixStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..46daf2f986e58c48f77d96fb867b809051deb3b6 GIT binary patch literal 1155 zcmV-}1bq96P)2fKHan> z)_!GZ0H}C_(A{+cczq=V1>`lbFWw*crZaZ^;}6Gx3d3pV358cc?omLDFDv~Az(m=# zTjqtdGs40vAonO>U0-hBvSvO2W4}L-eLpB5W#k?O_Id4$gslKK~X z&jkhK{Q_dDdF@63c5T@Vyc`wg0C1`IJOCr*5g=I!>NiP2g;zjsd4Qdx?Qc8R?;RM7 zeQ&|zao67dCICyW9|vGn%b}`PgD)u|_FPavy#}(3+g06A?=1j!e$WcQ=)@QRUroLR zz>*yc0r>mN?*M2mwd&Dn-Cmz!+>R#%1!UE+kMWPT?Exy49l8AQljqT=b9s5fx|Ob* zUw(QDz_(3{0ob`dQowo_J$m}iO*_7#i^i#BoK87G0a*`V=U#vJ_dsQi3;Vy=6uUlo zb_jq@mb->U(Tzwc${ZEnwRV7bhI#S+NUYzsjtxL%%~5y-WS$B7Dma4mhQTuzV)vC7 zC_0EyT?_I6F>l*_D7*qP_W)m}W|bjt&^~~LJVVi;|K>FSwnb4uZg0IIDN_szsP}-r z_-vV16wq9^%nGBW)c}m&af*0hydeoe0reWl*8YyY`w)Qbk;{ug!Om$5&243Ly0*K> zNeBwadH~D(>SZkeY`^a^Ix%l|e&qJ54Ego|Yuz^p3P`&{8{h4m@0@V$mU#>1?Aj^H z3PAyBb>y4tf|%DT>{aJ#wfh0pqVNi+`M>Hr(V+^Ds=BXQ&$s;wK>-;dH4hNu%H7*K zTn6{zPiNyj<&moT%ZhP}pn$YGvK5-UH?9M4uRID&t;W`i;UokF)Y^evg=xp;*?Y|Z zv`6dpnTopq3{Yw z%meJ{ZDn|3Txc}rg~BT!ku7`PPUtoD{6=G52nz7s==f~^B*5nLUjs0F?Oy=44!AgP zPjY5myUPlNSHP4gV3`;0Md$b)wJmiIp8XA&x~JD@2nx_2KIR8^p90{+u065#e=ax$ zG}@fE2nrDMiw(nlN3H_XFn`pY@Vs&PWJ5DA1O?cJtEYzncqejuF)qv&=7peuDGiak z3$u-Ji^40QNl`$U?TlL#UIG6D0iw-{jFwso0000IbVXQnMOaBjI!|(GWo~p~bZKvH V05ODE?C$^o002ovPDHLkV1o6(9*O_} literal 0 HcmV?d00001 diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index b95e3a5225..16bbf61445 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -307,7 +307,7 @@ namespace CalamityMod (Func)(() => CalamityWorld.downedStarGod), ModContent.ItemType(), new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, - new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion}, + new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion}, "Defeat 3 empowered astral titans or use a [i:" + ModContent.ItemType() + "] at Night", "[c/FFD700:The infected deity retreats to the heavens.]", "CalamityMod/NPCs/AstrumDeus/AstrumDeus_BossChecklist"); @@ -768,6 +768,7 @@ namespace CalamityMod SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), new List() {ModContent.ProjectileType(), ModContent.ProjectileType()}); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); + SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 19cfcc62e7..f1ee93a1ea 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -230,6 +231,7 @@ namespace CalamityMod.NPCs.AstrumDeus DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); // Equipment diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs new file mode 100644 index 0000000000..870461dc81 --- /dev/null +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -0,0 +1,118 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Dusts; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class AstralProbeRound : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blast"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.minionSlots = 0f; + projectile.minion = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.extraUpdates = 2; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f); + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.NextBool(3)) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = ModContent.DustType(); + } + else + { + randomDust = ModContent.DustType(); + } + int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, randomDust, 0f, 0f, 0, default, 0.5f); + Main.dust[num137].alpha = projectile.alpha; + Main.dust[num137].velocity *= 0f; + Main.dust[num137].noGravity = true; + } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 1200f; + bool flag17 = false; + for (int target = 0; target < 200; target++) + { + if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) + { + float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); + float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 17f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + for (int k = 0; k < 5; k++) + { + int randomDust = Main.rand.Next(2); + if (randomDust == 0) + { + randomDust = ModContent.DustType(); + } + else + { + randomDust = ModContent.DustType(); + } + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/Summon/AstralProbeRound.png b/Projectiles/Summon/AstralProbeRound.png new file mode 100644 index 0000000000000000000000000000000000000000..8e4b2a680f2fd06f50a52aa78361f251431a6bef GIT binary patch literal 2833 zcmV+s3-0uZP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnB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;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000yNkl00000NkvXXu0mjfFbY6y literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs new file mode 100644 index 0000000000..89f4b22da8 --- /dev/null +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -0,0 +1,190 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Dusts; +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class AstralProbeSummon : ModProjectile + { + private double rotation = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Astral Probe"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 22; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.timeLeft *= 5; + projectile.penetrate = -1; + projectile.minion = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType()), vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); + Main.dust[num228].noGravity = true; + Main.dust[num228].velocity = vector7; + } + projectile.localAI[0] += 1f; + } + if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.minionDamage); + projectile.damage = damage2; + } + bool flag64 = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.aProbe = false; + } + if (modPlayer.aProbe) + { + projectile.timeLeft = 2; + } + } + float num633 = 700f; + float num634 = 1300f; + float num635 = 2600f; + float num636 = 600f; + Vector2 vector46 = projectile.position; + bool flag25 = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + { + vector46 = npc.Center; + flag25 = true; + } + } + } + else + { + for (int num645 = 0; num645 < 200; num645++) + { + NPC nPC2 = Main.npc[num645]; + if (nPC2.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + { + num633 = num646; + vector46 = nPC2.Center; + flag25 = true; + } + } + } + } + Vector2 vector = player.Center - projectile.Center; + if (flag25) + { + projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + } + else + { + projectile.rotation = vector.ToRotation() - 1.57f - (projectile.spriteDirection == 1 ? MathHelper.ToRadians(270) : MathHelper.ToRadians(90) * projectile.direction); + } + projectile.Center = player.Center + new Vector2(80, 0).RotatedBy(rotation); + rotation += 0.03; + if (rotation >= 360) + { + rotation = 0; + } + projectile.velocity.X = (vector.X > 0f) ? -0.000001f : 0f; + + float num647 = num634; + if (flag25) + { + num647 = num635; + } + if (Vector2.Distance(player.Center, projectile.Center) > num647) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + if (!flag25 && projectile.ai[0] != 0f) + { + bool flag26 = false; + if (!flag26) + { + flag26 = projectile.ai[0] == 1f; + } + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f); + float num651 = vector48.Length(); + if (num651 < num636 && flag26) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + } + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + if (projectile.ai[1] > 90f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + if (projectile.ai[0] == 0f) + { + float scaleFactor3 = 6f; + int num658 = ModContent.ProjectileType(); + if (flag25 && projectile.ai[1] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + Vector2 value19 = vector46 - projectile.Center; + value19.Normalize(); + value19 *= scaleFactor3; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f); + projectile.netUpdate = true; + } + } + } + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Summon/AstralProbeSummon.png b/Projectiles/Summon/AstralProbeSummon.png new file mode 100644 index 0000000000000000000000000000000000000000..e08f7efc9e771dccdf159e8cca1025bdb73c7716 GIT binary patch literal 675 zcmV;U0$lxxP)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ;DM>^@RCwCdmrqC(Q5?rVQwoVh8n|0F>w*U_Vv@0-h@h1Pfkx6zv4fsEl!s1& zH}P6tJS~V2bV-E`f>0>Xg+Mll@FEzfTcCpfLJFd$!|YFdk2ljmmp9+b?ECHSy@Ahs zf4|?1<9QxYG;#Z>vY!2O06<|eYs|lXYdG}a!eZ7j#m``woFGDvzvqqd{QYS?WIUj1 zv=4yB%mw5A_!BaC!bl{DglKi;5P*Y;xs!WpUb3Cgi$OKgKLfzt-~%Px{jJI~5fK7c zCg1q$yuDIa={NIbN){mD`fxrwVD!0@9H0NMxcg>G1T z?|0nY;#mOJKNgfK3L^0@GWPeORI*tirS}z4ZQEr48an$Tk^55IG?I}Sc8XL?I<=5W zyJ-MAuVq3HkbYC+{x<$E#1?Y%MpE(y86QH1nHEY+pJlrD#B(~a?9_8gGtvPV&yL0X zt3#juA|Y4r)+zaV=MK`$>sNMn>awVbQU&^VmF~6wm34&v4gewB>b}7VQT+e_002ov JPDHLkV1f&kFkAot literal 0 HcmV?d00001