From cf9b40e8da01d065006a0ae684ef55c8f6bf6d84 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 30 Dec 2019 08:58:07 -0500 Subject: [PATCH] added plantation staff --- Buffs/Summon/PlantationBuff.cs | 36 ++ Buffs/Summon/PlantationBuff.png | Bin 0 -> 621 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Summon/PlantationStaff.cs | 120 ++++++ Items/Weapons/Summon/PlantationStaff.png | Bin 0 -> 1107 bytes ModSupport/WeakReferenceSupport.cs | 1 + Projectiles/Summon/PlantSeed.cs | 59 +++ Projectiles/Summon/PlantSeed.png | Bin 0 -> 381 bytes Projectiles/Summon/PlantSeedGreen.cs | 59 +++ Projectiles/Summon/PlantSeedGreen.png | Bin 0 -> 389 bytes Projectiles/Summon/PlantSummon.cs | 466 +++++++++++++++++++++++ Projectiles/Summon/PlantSummon.png | Bin 1240 -> 3691 bytes Projectiles/Summon/PlantThornBall.cs | 58 +++ Projectiles/Summon/PlantThornBall.png | Bin 0 -> 387 bytes 14 files changed, 801 insertions(+) create mode 100644 Buffs/Summon/PlantationBuff.cs create mode 100644 Buffs/Summon/PlantationBuff.png create mode 100644 Items/Weapons/Summon/PlantationStaff.cs create mode 100644 Items/Weapons/Summon/PlantationStaff.png create mode 100644 Projectiles/Summon/PlantSeed.cs create mode 100644 Projectiles/Summon/PlantSeed.png create mode 100644 Projectiles/Summon/PlantSeedGreen.cs create mode 100644 Projectiles/Summon/PlantSeedGreen.png create mode 100644 Projectiles/Summon/PlantSummon.cs create mode 100644 Projectiles/Summon/PlantThornBall.cs create mode 100644 Projectiles/Summon/PlantThornBall.png diff --git a/Buffs/Summon/PlantationBuff.cs b/Buffs/Summon/PlantationBuff.cs new file mode 100644 index 0000000000..c8e7c2711d --- /dev/null +++ b/Buffs/Summon/PlantationBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class PlantationBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Plantation"); + Description.SetDefault("The miniature plantera 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.plantera = true; + } + if (!modPlayer.plantera) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/PlantationBuff.png b/Buffs/Summon/PlantationBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..6972c771ca3b2c62be71a47da27e2f24168ffd35 GIT binary patch literal 621 zcmV-z0+RiSP)s5F?M1qxMtbM z9p6?*u{GQ)uD}_25axo8M3ZIrH+YsUOfBX95>wVl&Kzu07CtJPHFV@VX z`e%}N0T>**4M3)-#A^PNqY7vUbIt5t!jD^zk@_S6=Y2DA23rXp%{s1tj&{vld>e)A zmt6o}&Tjya+Rny~uebugE8+A9QwgW;By5R(oCTo0wgG?}wU+@%UbzUAe0`9!(`7Kb z2*7MU2b5>igJ#z%p^o-}3DYq@{ylVJdi@OmV}4Jp5*m6RcNEaL)mCjD9-C%w(zKi3 zc7ReWJW0O-V7TSxKYf5Z3g{?(_Iw=xKhX%lyX)KbfcIERNd8N9M8W;jFtw5g{;UUE z0MwW=z+vHnwSdHgKq_BU{_C5QI|>Md`PJS-pcDhSyiuY%IA;b1UxD&EA^Uq5)#U5inyx(HXVx5?qFwTy;L1hZz>sMTXzn+GI(X#9ycAWOPzGpad8lL_c zdH?<2@h@*WuH}-RFQEVc01|XXSad~LNk%$Pa%p95bYXO9Z*BlFgjnqF00000NkvXX Hu0mjfpp_Jz literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8726963528..2c2a7025fe 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -642,6 +642,7 @@ namespace CalamityMod.CalPlayer public bool cLamp = false; public bool pGuy = false; public bool sandnado = false; + public bool plantera = false; public bool gDefense = false; public bool gOffense = false; public bool gHealer = false; @@ -1385,6 +1386,7 @@ namespace CalamityMod.CalPlayer sCrystal = false; sGod = false; sandnado = false; + plantera = false; vUrchin = false; cSpirit = false; rOrb = false; diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs new file mode 100644 index 0000000000..e44b9ccbc6 --- /dev/null +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -0,0 +1,120 @@ +using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class PlantationStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plantation Staff"); + Tooltip.SetDefault("Summons a miniature plantera to protect you\n" + + "Fires seeds and spiky balls from afar to poison targets\n" + + "Enrages when you get under 50% health and begins ramming enemies\n" + + "Occupies 2 minion slots and there can only be one"); + } + + public override void SetDefaults() + { + item.damage = 60; + item.mana = 10; + item.width = 66; + item.height = 70; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 1f; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + item.UseSound = SoundID.Item76; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p.active && p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) + { + return false; + } + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.OpticStaff); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + 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) + { + int i = Main.myPlayer; + float num72 = item.shootSpeed; + float num74 = knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + vector2.X = (float)Main.mouseX + Main.screenPosition.X; + vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; + Vector2 spinningpoint = new Vector2(num78, num79); + spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default); + Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, type, damage, num74, i, 0f, 0f); + } + return false; + } + + public override bool UseItem(Player player) + { + if (player.altFunctionUse == 2) + { + player.MinionNPCTargetAim(); + } + return base.UseItem(player); + } + } +} diff --git a/Items/Weapons/Summon/PlantationStaff.png b/Items/Weapons/Summon/PlantationStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..638749a929cb537957add0429497b24efeda4a2b GIT binary patch literal 1107 zcmV-Z1g!gsP)W^00006VoOIv0RI60 z0RN!9r;`8x1L{dcK~!ko<(W-rR96^=pOa=xW^`tpWJpTdL}L6Ii6#gt6rl>OrYN|v zDrnYSxDZ9G(2Am76554}f@ur3P_QDlM#Y$_LlPBDjd2W)j#_UQ-~GHj z*9kF0%y^x5Gjs2`e>~^C@A=NThId6XSL#0}Uvp%B$N*%oJqMty*w0(2%#_{9BWkH^ zW(5GDgly;1IS1g#PmciT?5+o(zas;9$sh(VnBe2PnyS-bW5{%wdcx^1F$qw1;E`kD*;&e#fJdYZRrCb z*8I171tGm{^&kM9?zTTwRHaK?NjFr70grUYfzJWBc)AyWzt+wJ;D-%e*7R>8x4Y*6P|;Xn0CH(bozf+)=`k=o;sCTSmlRpFUI;7kz7s!N=WQI6R0-{u z+T+;1Zns4|tv#^w!dbu@VR?8)wu?=!P!&vEy&Vm|1Rxn{0-&|6(K@cREd{`x^>YE} z`s$SI-zNJ{bfy6~xqCJMwV&nk-cLtZRp}8|rH3=Fx1-kn?JG_LaP-$UYrpn@djDko z0;^qX6CFt*miNA;OI)QSckPw*NF|%B_DkQ(NU3R~zhAe@$f-3+>X3N3ze7m3e)`-1 zT>LF$T`#c23$6||Rq)Lb=haskfWE;8R<5@nUuT`KJ)mA!oxdh|eIaTLz~!6MrNPZ_ zRp}7_A87z8%Y{%Z`~d(%qgjh|*YCH0*FEn~8|?voN0O0*0r>H@UAL=BlDOq;|5^#iLkq$ z6~g0@R+R*Ci=5`P=hYh%zBar$VZYu#;!3(UCPeQ&%30~4UapJJaJ?!WqG_Wll<0VR ze~A0nNd|_W(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), new List() {ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType()}, new List() {(1f-0.6666666f), 0.3333333f, 0.3333333f}); //Entropy's Vigil is a bruh moment + 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()); diff --git a/Projectiles/Summon/PlantSeed.cs b/Projectiles/Summon/PlantSeed.cs new file mode 100644 index 0000000000..0733b3c384 --- /dev/null +++ b/Projectiles/Summon/PlantSeed.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class PlantSeed : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seed"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.extraUpdates = 2; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.aiStyle = 1; + aiType = 242; + projectile.penetrate = 1; + projectile.timeLeft = 600; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 2) + { + projectile.frame = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 60); + } + } +} diff --git a/Projectiles/Summon/PlantSeed.png b/Projectiles/Summon/PlantSeed.png new file mode 100644 index 0000000000000000000000000000000000000000..56d10c0cdd5b4885d8146a2fee7c2038b406cb54 GIT binary patch literal 381 zcmV-@0fPRCP)7Ae@(jxo2nd2~m%?tb zvPcn&^#vwzGTH2;@vrjp&&!t=X5N6Kj4`<}CU?!ZT?1cLgrYo+?g2RGDhG(;cq=SX zq=&(^wLtwPcNRIE$G!eB0L%2v>Y00ljfwI$=CpQUF*oF!5%qA;+Xt%N)N4*w61FC) zTz@r9KI(<7i7t;`;o8JS_PKgU>;>{x%r_<$=j?Y!jI-4aS=8C5%G;zjtX-&i z6f9T!Cx<}Qn|jT4hjjl}m#IhCn&|TA6|PMz-wj|VdAPenyInhCk_`VOMA-|_MXpBw bFIRs6u5+0*Zkm+Y00000NkvXXu0mjf?nSFh literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PlantSeedGreen.cs b/Projectiles/Summon/PlantSeedGreen.cs new file mode 100644 index 0000000000..ad3373aa60 --- /dev/null +++ b/Projectiles/Summon/PlantSeedGreen.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class PlantSeedGreen : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seed"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.extraUpdates = 3; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.aiStyle = 1; + aiType = 242; + projectile.penetrate = 1; + projectile.timeLeft = 600; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 2) + { + projectile.frame = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 180); + } + } +} diff --git a/Projectiles/Summon/PlantSeedGreen.png b/Projectiles/Summon/PlantSeedGreen.png new file mode 100644 index 0000000000000000000000000000000000000000..14abac4751244363632c2920df4f06d12267c0fa GIT binary patch literal 389 zcmV;00eb$4P)m8-;Xk+D~%nf$Gy~kPq3n+V&e%5!ZV^0`Nl+xa6 zI(e@a1`{=p{%U(-=XD)`bTP7|bkZ%%+Y{xs%Z=zcX66VTxA-|805QJ~pX^us1kj$` zSQt!{lJ8Xe1@UwB`hEz&#R-3$tBVB3617B+=ka*!5P*k|$3lO@OSP~uQM_%QJ-egf z%0-#S%hkc&H&FH_z07l87)+GX-fA|zs}=?mHIKEzUlS!iB~QVUB*~Zaw!~7pxf` 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (!enraged) + { + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + else + { + if (projectile.frame >= 8) + { + projectile.frame = 4; + } + } + + 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, 44, 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.plantera = false; + } + if (modPlayer.plantera) + { + projectile.timeLeft = 2; + } + } + + float num633 = 700f; + float num634 = 1300f; + float num635 = 2600f; + float num636 = 600f; + float num637 = 0.05f; + + //idle movement + for (int num638 = 0; num638 < 1000; num638++) + { + bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); + if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) + { + if (projectile.position.X < Main.projectile[num638].position.X) + { + projectile.velocity.X = projectile.velocity.X - num637; + } + else + { + projectile.velocity.X = projectile.velocity.X + num637; + } + if (projectile.position.Y < Main.projectile[num638].position.Y) + { + projectile.velocity.Y = projectile.velocity.Y - num637; + } + else + { + projectile.velocity.Y = projectile.velocity.Y + num637; + } + } + } + + bool flag24 = false; + if (enraged) + { + if (projectile.ai[0] == 2f) + { + projectile.ai[1] += 1f; + projectile.extraUpdates = 1; + if (projectile.ai[1] > 30f) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.extraUpdates = 0; + projectile.numUpdates = 0; + projectile.netUpdate = true; + } + else + { + flag24 = true; + } + } + if (flag24) + { + return; + } + 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) + { + num633 = num646; + 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; + } + } + } + } + if (flag25) + { + projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + } + else + { + projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + } + 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) + { + Vector2 vector47 = vector46 - projectile.Center; + float num648 = vector47.Length(); + vector47.Normalize(); + if (num648 > 200f) + { + float scaleFactor2 = 8f; + vector47 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + else + { + float num649 = 4f; + vector47 *= -num649; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + } + else + { + bool flag26 = false; + if (!flag26) + { + flag26 = projectile.ai[0] == 1f; + } + float num650 = 6f; + if (flag26) + { + num650 = 15f; + } + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); + float num651 = vector48.Length(); + if (num651 > 200f && num650 < 8f) + { + num650 = 8f; + } + if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + if (num651 > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num651 > 70f) + { + vector48.Normalize(); + vector48 *= num650; + projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + } + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + if (projectile.ai[1] > 40f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + if (projectile.ai[0] == 0f) + { + if (projectile.ai[1] == 0f && flag25 && num633 < 500f) + { + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + projectile.ai[0] = 2f; + Vector2 value20 = vector46 - projectile.Center; + value20.Normalize(); + if (Main.rand.NextBool(3)) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value20.X, value20.Y, ModContent.ProjectileType(), (int)(projectile.damage * 1.2f), 0f, Main.myPlayer, 0f, 0f); + } + projectile.velocity = value20 * 8f; + projectile.netUpdate = true; + } + } + } + } + else //if not enraged + { + 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; + } + } + } + } + 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) + { + Vector2 vector47 = vector46 - projectile.Center; + float num648 = vector47.Length(); + vector47.Normalize(); + if (num648 > 200f) + { + float scaleFactor2 = 18f; //12 + vector47 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + else + { + float num649 = 9f; + vector47 *= -num649; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + } + else + { + bool flag26 = false; + if (!flag26) + { + flag26 = projectile.ai[0] == 1f; + } + float num650 = 12f; + if (flag26) + { + num650 = 30f; + } + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f); + float num651 = vector48.Length(); + if (num651 > 200f && num650 < 16f) + { + num650 = 16f; + } + if (num651 < num636 && flag26) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + if (num651 > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num651 > 70f) + { + vector48.Normalize(); + vector48 *= num650; + projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + } + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + if (flag25) + { + projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + } + else + { + projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + } + 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 = (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); + int projDmg = (int)(projectile.damage * 0.7f); + if (Main.rand.NextBool(4)) + { + num658 = ModContent.ProjectileType(); + projDmg = (int)(projectile.damage * 1.2f) + } + if (flag25 && projectile.ai[1] == 0f) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + 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, projDmg, 0f, Main.myPlayer, 0f, 0f); + projectile.netUpdate = true; + } + } + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 300); + } + } +} diff --git a/Projectiles/Summon/PlantSummon.png b/Projectiles/Summon/PlantSummon.png index ea9d6b1441ce1ffac7c7b052599b6c2d7ea164dc..81ca69a658c1781720b2336fc16089dbb978d061 100644 GIT binary patch literal 3691 zcmV-x4wUhUP)Px@B}qgQq2b;F z0L-2$8%*6kdZocoQYN~G0a||NEgJv;ufI28Sg>bNKB{Nl{K)Ym9{>Oz-MbDzl?j4O z{bbjN6#!VicA)?OHz#Bw^9&ShZCXQH{*|Bp$awwWOUD2Jqa)V?0De6AR{+4C7gqoP zp5F5r0N|>dzOyfT5iq z0jM&;=jT4WHueXedFxX6TY;SS0Ry{l90d?<+q5_>8zQhgub;R)0RVXHn$7b3^Z;s!tt_1+R`}s+uFN`V668EeSi|%@4 zi*bEseA;;5zSGk7@BjI{aUW-BGIH;OR{{Y3@{Bq7%w3+b{&pZw3?LYVwyxR+pxTBx z`Ve{)B4~NO&gZB0yl&jb8CP4Lj1WmjrTj3^sXm}V%a^7GjO!eg`d5iRF@LrUAWsZH z&BU~zo(Eiv*yaH;v3l2g0HS?>iIcgk~4DV8L-a8FMKox0N8ih zTnn+y?+WhIYa!0a_dqO9MhZjns4XAI}QM-u6fwjZL3l~=cp6+n}MA60c~;P#+|opC;-3%zxiz}6MEG8W9cve zV9(>X0jPRjLpx2M__Yr&8qfD15GH$zGTxU<<+}es<{60fGvnZj3u*l7Z`T2+u6;ra z?-dI_x>wdrwx|Rw9+*bv8Au$Ndw1$z`jWxkVow+wHJH(sXOx-|y6p#r0a~7sxeF)z z68)~sGmy9sxKQJ(*3}25j?c&5$LRFiV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