From 46d1e9fe00ed2cf34b5bdf6b077919cc7bcbe679 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Sat, 10 Apr 2021 21:24:14 +0100 Subject: [PATCH] Added Void Concentration Staff i'm committing because github desktop stashed my changes to a completely diff branch and that was spooky --- Buffs/Summon/VoidConcentrationBuff.cs | 36 ++++ Buffs/Summon/VoidConcentrationBuff.png | Bin 0 -> 551 bytes CalPlayer/CalamityPlayer.cs | 14 ++ CalPlayer/CalamityPlayerDrawEffects.cs | 20 ++ ExtraTextures/VoidConcentrationAura.png | Bin 0 -> 1280 bytes Items/CalamityGlobalItem.cs | 15 ++ .../Weapons/Summon/VoidConcentrationStaff.cs | 66 ++++++ .../Weapons/Summon/VoidConcentrationStaff.png | Bin 0 -> 1105 bytes NPCs/CeaselessVoid/CeaselessVoid.cs | 11 +- Projectiles/Summon/VoidConcentrationAura.cs | 94 +++++++++ .../Summon/VoidConcentrationBlackhole.cs | 190 ++++++++++++++++++ .../Summon/VoidConcentrationBlackhole.png | Bin 0 -> 1293 bytes Projectiles/Summon/VoidConcentrationOrb.cs | 115 +++++++++++ Projectiles/Summon/VoidConcentrationOrb.png | Bin 0 -> 1672 bytes 14 files changed, 557 insertions(+), 4 deletions(-) create mode 100644 Buffs/Summon/VoidConcentrationBuff.cs create mode 100644 Buffs/Summon/VoidConcentrationBuff.png create mode 100644 ExtraTextures/VoidConcentrationAura.png create mode 100644 Items/Weapons/Summon/VoidConcentrationStaff.cs create mode 100644 Items/Weapons/Summon/VoidConcentrationStaff.png create mode 100644 Projectiles/Summon/VoidConcentrationAura.cs create mode 100644 Projectiles/Summon/VoidConcentrationBlackhole.cs create mode 100644 Projectiles/Summon/VoidConcentrationBlackhole.png create mode 100644 Projectiles/Summon/VoidConcentrationOrb.cs create mode 100644 Projectiles/Summon/VoidConcentrationOrb.png diff --git a/Buffs/Summon/VoidConcentrationBuff.cs b/Buffs/Summon/VoidConcentrationBuff.cs new file mode 100644 index 0000000000..a83a737d5f --- /dev/null +++ b/Buffs/Summon/VoidConcentrationBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + class VoidConcentrationBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Concentrated Void"); + Description.SetDefault("The infinite void yearns for more..."); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer mp = player.Calamity(); + int count = player.ownedProjectileCounts[ModContent.ProjectileType()]; + player.minionDamage += 0.05f; //5% + player.armorPenetration += 10; + if (!mp.voidAuraDamage && count == 0) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/VoidConcentrationBuff.png b/Buffs/Summon/VoidConcentrationBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..0aff2acf1516806ed0cf7b15a081aedbbe74feb5 GIT binary patch literal 551 zcmV+?0@(eDP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00DJLL_t(o!_}8DOT$1E$A7V7QjT3FAb9g^Z+)u9RO0Le5m7%a};=9J3WY< z_^ojtYX83L0B};TVFZD+G$ite%kzN4N9)ClsM`i0mnj0!IlPLUxcz<|YG0_XdyP7V z5m2Q@t}4H~8ar{S5zHl(tjJsfs$}gY`!6>3Lj9yax3U=U%P!5234!9=G5}3K2cja6 z$_?ok|4MBK_}%~J6A;Ol%UbG6$Os9UCraiL7?sq2NTn1cGJXVfcSDq2C1M_drhDc! zT;JdXBiEJGk0=u65s)04Ai+>U<$qW*msWRaKA0000I pbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1lwm<)#1t literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5cf0890c55..5eda418cbf 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -571,6 +571,8 @@ namespace CalamityMod.CalPlayer public int roverDriveTimer = 0; public int roverFrameCounter = 0; public int roverFrame = 0; + public int voidFrameCounter = 0; + public int voidFrame = 0; #endregion #region Armor Set @@ -898,6 +900,8 @@ namespace CalamityMod.CalPlayer public bool plaguebringerMK2 = false; public bool igneousExaltation = false; public bool coldDivinity = false; + public bool voidAura = false; + public bool voidAuraDamage = false; public bool youngDuke = false; public bool virili = false; public bool frostBlossom = false; @@ -1926,6 +1930,8 @@ namespace CalamityMod.CalPlayer plaguebringerMK2 = false; igneousExaltation = false; coldDivinity = false; + voidAura = false; + voidAuraDamage = false; radiantResolution = false; virili = false; frostBlossom = false; @@ -3682,6 +3688,14 @@ namespace CalamityMod.CalPlayer } roverFrameCounter++; + int frames = 4; + if (voidFrameCounter >= 6) + { + voidFrameCounter = 0; + voidFrame = voidFrame == frames - 1 ? 0 : voidFrame + 1; + } + voidFrameCounter++; + for (int i = 0; i < player.dye.Length; i++) { if (player.dye[i].type == ModContent.ItemType()) diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 790c444a42..10fee31d19 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -404,6 +404,25 @@ namespace CalamityMod.CalPlayer } }); + public static readonly PlayerLayer ConcentratedVoidAura = new PlayerLayer("CalamityMod", "VoidAura", PlayerLayer.Skin, drawInfo => + { + Player drawPlayer = drawInfo.drawPlayer; + CalamityPlayer modPlayer = drawPlayer.Calamity(); + if (modPlayer.voidAura || modPlayer.voidAuraDamage) + { + Texture2D tex = ModContent.GetTexture("CalamityMod/ExtraTextures/VoidConcentrationAura"); + Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY); + drawPos.Y -= 9; + SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; //intentionally inverse due to giving more space for the player model without faffing about with the specific positioning + Rectangle frame = tex.Frame(1, 4, 0, modPlayer.voidFrame); + Vector2 origin = new Vector2(tex.Width / 2f, tex.Height / 2f / 4f); + float scale = 1.75f; + + DrawData data = new DrawData(tex, drawPos, frame, Color.White * 0.4f, 0f, origin, scale, spriteEffects, 0); + Main.playerDrawData.Add(data); + } + }); + public static readonly PlayerLayer RoverDriveShield = new PlayerLayer("CalamityMod", "RoverDrive", PlayerLayer.Skin, drawInfo => { Player drawPlayer = drawInfo.drawPlayer; @@ -682,6 +701,7 @@ namespace CalamityMod.CalPlayer list.Insert(drawTheStupidSign, ForbiddenCircletSign); } list.Add(ColdDivinityOverlay); + list.Add(ConcentratedVoidAura); list.Add(RoverDriveShield); list.Add(StratusSphereDrawing); list.Add(ProfanedMoonlightDyeEffects); diff --git a/ExtraTextures/VoidConcentrationAura.png b/ExtraTextures/VoidConcentrationAura.png new file mode 100644 index 0000000000000000000000000000000000000000..2b5d2fb66caae70a8acbf73bc13f2dbe230fe9f8 GIT binary patch literal 1280 zcmV+b1^@bqP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00d4+L_t(|+U=b|QX?@8MLSa|t^j+A zgK%;Vl41{6$R@M$Oyan0$t}y0{NFM_^6RIu-O{&v+kh@7={J0T`>g)_`{zsKbN-C+ zV?1Jx7o5J;KI^FS>pD(wy84;D&adZq%jw_i<>7~~FCW#<<~r}z@w32tRGrRWzjHqQ zUDvlB-|^Ors7+kQ88hN-+x}m}+);%~JjWR`V)6BY!=ku#{OLLqm=TM=SNZ*}88oEh zq#3c7qt3f^e46mz>m~mdZ(DmUKVSG!4v#8F>AlwDIG)gQzB0pBormL6P_Owoj?Z#B zr{%nV$E`S>v*)~9$4hrWCY;VcKd;BQbsWMWJi74Gs6whtX%TK5pLUnuBJ5h_-!*Qn z{=J9$_4wJ^s*qYockB4c$|#Z(c2qGdyj5E?E4&4SL-M>MIQSl4mJ_>MgiPcCqv)*Pji`U$s=4^Qk%C-oESI9|B6t6e(j+;}3s<$I^MkA2HyFsx%299?l8ZWTX+4-C-y0$3TbAfA~ln`bzJNk=Q_Xa9tp8=T)^?7 zrf`)ki^3l|$nS5T#afL;;Uv08l|2U3%Y%0$tR#lQcHL@gm8prL)|$qx;}8zv(S=LY z4u=qb9Ji8Y4!>40mu9Bo)^VhnwK;FboX&NGTOFF6ITP5=X$9B9U8R`sg}Vg#acyuC zf;OlfYJ(GPv^m^$Lt>xFu*5#&yu+%daD7gR#QxF55NmHlVjag5(zQlpvbf-keIhtx zUmM9v7WG8owe#Z;u1)tfPEGC?Kw_T-_sspm>ms;yeCD2IB=)ON`=N~INE9_7vCpOT zbeaSb`z@p^TFWN(EeR*(#w`kGp}t3g(aBq^T8qT~Af9H<*(I97q^bzk18hCCe-?iTgM?>8*?*f4ifuT z2q7H#aSf0k*9K2u(#G7(xn8w)7Thiz93Mrv{CLfAQpRd@&u0&}j;nXwq;f0q98VCE z`BSo4aUI_Sdn7v1c#g!7ryIa=?WY^Kb$rC?uyuy>+Iu7pJKmApM`FJV?wR}2xOIHy z4%#&n`$tBVt~2+g#`7f|uRbGXH1QoDeF9~Af829Q)mNm>oJhoTTzYRCX+u_IvityP2dMT~Pr`El5LeHED6Ei6C<64BzkDC+zd%fiU zR}W_knH5e2!XZ4maC2*w@Mlk;>!!{0XQiOCoHO9OT9THq=?S3CUm}D>vkPLqZvX%Q q5_CmabVXQ6MmkS&X=QG7VRUJ4ZU8ZaSnTfr0000() && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].modProjectile is VoidConcentrationAura) + { + if (Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI) + { + (Main.projectile[i].modProjectile as VoidConcentrationAura).HandleRightClick(); + break; + } + } + } + return false; + } if (player.ActiveItem().type == ModContent.ItemType()) { bool canContinue = true; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs new file mode 100644 index 0000000000..f7fc78b653 --- /dev/null +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -0,0 +1,66 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + class VoidConcentrationStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Void Concentration Staff"); + Tooltip.SetDefault("Summons a foreboding aura\n" + //If you have flavour text ideas, feel free to implement, my brain is still like nonexistant as per usual yeah. + "Requires three minion slots to use\n" + + "Only one may exist\n" + + "Right click to launch a black hole that grows in size"); + } + + public override void SetDefaults() + { + item.width = 52; + item.height = 72; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.DD2_EtherianPortalOpen; + item.summon = true; + + item.mana = 100; + item.damage = 150; + item.knockBack = 4f; + item.useTime = item.useAnimation = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + + item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.PureGreen; + } + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse != 2) + return player.ownedProjectileCounts[ModContent.ProjectileType()] == 0; + return base.CanUseItem(player); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f); + player.AddBuff(ModContent.BuffType(), 120); + } + return false; + } + + public override bool AltFunctionUse(Player player) + { + return base.AltFunctionUse(player); + } + } +} diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.png b/Items/Weapons/Summon/VoidConcentrationStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..d1cf945db4c214c6957a218e185d9a48b54feae2 GIT binary patch literal 1105 zcmV-X1g`suP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00W;%L_t(&-tC$_OcP-k$A4F8sTK)= z1Sp~+4Z#oxqjA8&gvEu~!I8!2sEH$SaM#g92L}g7Cu2flOdMb%4u(ifO`}qT1VRdh z+DhwiJka;$%H6f}BQN(~%6;^`kKg^D=l@=@Xs{Cf69D9jn*c;ZXG`VVbHz<-Z#@9X zKc9S!A8Pak)mv@NI#-SpV*6y0U{#1{zas2ilV`r@OObR7{?Cv@MXJYMk zhGWE6wUZgEp8fQGCo+!EvApLgxsVP zdj0g7vi;S&j{wZhzxOq+{(i1f9}Eb&NeGP&B>-4VB^^n1UB9F(e|R$k9C%Il-iakt zw?35F-cgptJEGZX)k8vXeD8B^!CxvD1%$k6c{Q!{Azicc_UGi|=KxGiKLid)eO>%n z)p3m@y6k z35epo1Ik#shh{#1aUAdVt*gqict?^%*g9?ky^>PDS7!x;#6$7k0RWa) z)4)N;mwwdK6}JG^HkKQDLB{2+9nr}nREdnt zUnCVbn~cbOLi&tUPXsy{y_z+PjOauWQf8!*)g+^}8X1v!gmlkD!Z85yg{-4z^m$CH zkP(?j=;H7V;Gn;VbkCH32U?Ge$T&i6dgm93XCmR41&}Xfn|-dHWF8^;L*CBFj8i0J zTGcbUj3Z=qbPqcIuV(=sy@Gk1Q)frH=pr01|XXSad~LNk%$Pa%p95bYXO9 XZ*BlFgjnqF00000NkvXXu0mjf`Ec?Q literal 0 HcmV?d00001 diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 61c77d6c3a..8efb2d4241 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -147,11 +148,13 @@ namespace CalamityMod.NPCs.CeaselessVoid // Materials DropHelper.DropItem(npc, ModContent.ItemType(), true, 2, 3); - // Weapons - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + // Weapons + float dropChance = DropHelper.NormalWeaponDropRateFloat; + DropHelper.DropItemChance(npc, ModContent.ItemType(), dropChance); + DropHelper.DropItemChance(npc, ModContent.ItemType(), dropChance); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 2); + // Equipment + DropHelper.DropItemChance(npc, ModContent.ItemType(), 2); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs new file mode 100644 index 0000000000..41076dda92 --- /dev/null +++ b/Projectiles/Summon/VoidConcentrationAura.cs @@ -0,0 +1,94 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Steamworks; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + class VoidConcentrationAura : ModProjectile + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public int timer = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Concentrated Void Aura"); + } + + public override void SetDefaults() + { + projectile.width = 46; + projectile.height = 80; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 3f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(timer); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + timer = reader.ReadInt32(); + } + + public override bool? CanCutTiles() + { + return true; + } + + public void HandleRightClick() + { + Vector2 velocity = Main.MouseWorld - Main.player[projectile.owner].Center; + velocity.Normalize(); + velocity *= 2f; + Projectile.NewProjectile(Main.player[projectile.owner].Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 5f), 0f, projectile.owner); + projectile.Kill(); + } + + public override void AI() + { + Player owner = Main.player[projectile.owner]; + CalamityPlayer mp = owner.Calamity(); + projectile.Center = owner.Center; + mp.voidAuraDamage = true; + if (owner.dead) + mp.voidAuraDamage = false; + if (!mp.voidAuraDamage) + { + mp.voidAura = false; + projectile.Kill(); + } + if (owner.whoAmI == Main.myPlayer && owner.ownedProjectileCounts[projectile.type] <= 25 && timer > 0 && timer % 4 == 0) + { + NPC target = CalamityUtils.MinionHoming(projectile.Center, 1800f, owner); + if (target != null) + { + Vector2 correctedVelocity = target.Center - owner.Center; + correctedVelocity.Normalize(); + correctedVelocity *= 3f; + int perturbificator9000 = Main.rand.Next(-1, 2); + Vector2 perturbedspeed = new Vector2(correctedVelocity.X + perturbificator9000, correctedVelocity.Y + perturbificator9000).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 3))); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.75f), 0f, owner.whoAmI); + } + timer = -1; + } + if (timer > 50 && timer % 4 == 0) + return; + timer++; + } + } +} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs new file mode 100644 index 0000000000..e05dd64f54 --- /dev/null +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -0,0 +1,190 @@ +using CalamityMod.NPCs; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + class VoidConcentrationBlackhole : ModProjectile + { + private int damage = 0; + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(damage); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + damage = reader.ReadInt32(); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Black Hole"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 80; //32 base, 2.5x the normal (for hitbox purposes) + projectile.height = 85; //34 base, 2.5x the normal (for hitbox purposes) + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 1800; + projectile.penetrate = -1; + + projectile.tileCollide = false; + projectile.minion = true; + projectile.scale = 0.01f; + } + + private void ApplySucc(NPC npc) + { + float succStrength = 4f / projectile.scale; + succStrength *= projectile.scale; + Vector2 velocity = projectile.Center - npc.Center; + velocity *= 2f; + velocity.SafeNormalize(Vector2.Zero); + float num550 = 5f * projectile.scale; + Vector2 vector43 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num551 = projectile.Center.X - vector43.X; + float num552 = projectile.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; + npc.velocity.X = (velocity.X * 15f + num551) / 16f; + npc.velocity.Y = (velocity.Y * 15f + num552) / 16f; + npc.velocity = (velocity / succStrength); + } + + private void Death() + { + if (projectile.scale >= 2.5f) //it's boom o' clock + { + projectile.height *= 2; + projectile.width *= 2; + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage = damage; + projectile.Damage(); + projectile.friendly = false; + projectile.Damage(); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + projectile.Kill(); + } + } + + public override void Kill(int timeLeft) + { + for (int d = 0; d < 6; d++) + { + int shadow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 4f); + 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 < 18; d++) + { + int shadow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, 0f, 0f, 100, new Color(0, 0, 0), 4f); + 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), 3f); + Main.dust[shadow].velocity *= 2f; + } + } + + public override bool PreAI() + { + if (damage == 0) + { + damage = projectile.damage; + projectile.damage = 0; + projectile.position = Main.player[projectile.owner].position; + } + return true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Vector2 drawPos = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + int height = texture.Height / Main.projFrames[projectile.type]; + int frameHeight = height * projectile.frame; + Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); + Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, projectile.rotation, origin, projectile.scale, spriteEffects, 0f); + return false; + } + + public override void AI() + { + + projectile.scale += 0.01f; + if (projectile.scale % 0.02f == 0) + { + projectile.scale += 0.01f; //speeds up the projectile's growth to prevent it being too long + } + int radius = (int)(projectile.scale * 100f); //0.01f; to a max of 2.5f; so radius of 1 to 250 by default + if (projectile.scale >= 2f) + radius *= 2; + + int baseWidth = 32; + int baseHeight = 34; + int newWidth = (int)(baseWidth * projectile.scale); + int newHeight = (int)(baseHeight * projectile.scale); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, newWidth, newHeight); + + + + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type] - 1) + { + projectile.frame = 0; + } + projectile.frameCounter++; + + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].active && !Main.npc[i].friendly /*&& CalamityGlobalNPC.ShouldAffectNPC(Main.npc[i])*/) //TODO - REMOVE COMMENT BEFORE MERGE + { + if (Vector2.Distance(projectile.Center, Main.npc[i].Center) <= radius) + ApplySucc(Main.npc[i]); + } + } + + + if (projectile.scale >= 2.5f) //it's boom o' clock + { + Death(); + } + } + } +} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.png b/Projectiles/Summon/VoidConcentrationBlackhole.png new file mode 100644 index 0000000000000000000000000000000000000000..ab6fe627707f4953b868f6ed58dbe897918da4d8 GIT binary patch literal 1293 zcmV+o1@iidP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00dh}L_t(|+U=XqYZE~f$G?+o8nq#` zDRr&nPzWAG=*7Rlg9ttO2l(gt2Y3?1gU8+rq96ee#Ttrf2#L+_^|1Szo!8x+ne5t` zkbEy`w#m-C&&<4e@9jh&MXe{V004veAL)9nd=LOYXYxb3?(aOK&kOc>06_cqm&A5T zuq?qZynFrz0C3*F1^^7_yNMR7L_~VCO924m#ULcqy>OHOSsqgW03SME3vVk1fNqs-a`T~t@+MMv~C(`>)|D65|0H9i`2>|e;cI^{buJeOj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..51bd4f81ad --- /dev/null +++ b/Projectiles/Summon/VoidConcentrationOrb.cs @@ -0,0 +1,115 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + class VoidConcentrationOrb : ModProjectile + { + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Void Orb"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 54; + projectile.height = 50; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 300; + projectile.penetrate = 1; + + projectile.tileCollide = false; + projectile.minion = true; + projectile.scale = 0.01f; + } + + public override bool? CanHitNPC(NPC target) + { + if (projectile.scale < 1f) + return false; + return null; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + for (int d = 0; d < 6; 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 < 10; 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 void AI() + { + Player owner = Main.player[projectile.owner]; + NPC target = CalamityUtils.MinionHoming(projectile.Center, 1800f, owner); + + if (projectile.scale >= 1f) + { + 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; + if (Main.rand.NextBool(5)) + projectile.velocity *= 1.1f; + } + + } + else + { + projectile.scale += 0.025f; + projectile.velocity *= 1.03f; + } + + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type] - 1) + { + projectile.frame = 0; + } + projectile.frameCounter++; + + if (projectile.timeLeft <= 60) + { + projectile.alpha += 4; + } + } + } +} diff --git a/Projectiles/Summon/VoidConcentrationOrb.png b/Projectiles/Summon/VoidConcentrationOrb.png new file mode 100644 index 0000000000000000000000000000000000000000..036c9b9603618a347c9bb686c76cd93d611646ee GIT binary patch literal 1672 zcmV;326y?1P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00q`bL_t(|+U=dea^p4(hJSgzNhY06 zZ|%y<0!JjU!*|dCp2JVK7IHC z0C+t80|2-?{P=SIc{u+J0Qlq2-(2TCZ2gZd#lYX77L@R|oP?y*U(de-0DigoOuw&E zF1}(?3lgo@JpY`6ky0E|j=pOurd{iV_nO!GD)D@J007(^?z4|sIMNGADWYge>U+b~ zaav!UU;u#U)5B1nKks7#$JP_@zC?XSy8;MOh!n$F!Pe0?zG8GuQwv&0Mc$Wg4)>V) zdkNlm`T1)Jt5|j9q22dtsf{!^VHNw{$EanBQEqgfT3V^z#8*t?(v*^7QM&TNDmG{b z6fLugQZy=3BtrK^J_cxOBw-b6jum?&MIweZlF{+0*xE?*KWS9v$ERYKf;0=^vyW6v zo3Hgox}Oy>>+Bj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