From 54b0907b4eac00e8ce7de218b780888cd1fe3d79 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Wed, 1 Apr 2020 14:18:23 +0100 Subject: [PATCH] Cold Divinity Fix --- Items/CalamityGlobalItem.cs | 12 +++++++----- Projectiles/Summon/ColdDivinityPointyThing.cs | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index b98cf6d7fd..a6a6957898 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -673,14 +673,15 @@ namespace CalamityMod.Items { if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == player.whoAmI) { - if (Main.projectile[i].ai[1] >= 1f) + if (Main.projectile[i].ai[1] > 1f) { canContinue = false; break; } else if (Main.projectile[i].ai[1] == 0f) { - count++; + if (((ColdDivinityPointyThing)Main.projectile[i].modProjectile).circlingPlayer) + count++; } } } @@ -691,14 +692,15 @@ namespace CalamityMod.Items { int height = unluckyTarget.getRect().Height; int width = unluckyTarget.getRect().Width; - float dist = (height > width ? height : width) * 1.5f; //create distance between hitbox and spears. int pointyThingyAmount = count; - pointyThingyAmount += dist > 100 ? (int)dist / 100 : 0; float angleVariance = MathHelper.TwoPi / pointyThingyAmount; float angle = 0f; + for (int i = 0; i < pointyThingyAmount; i++) { - int projj = Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), (int)((80 * player.MinionDamage())), 1f, player.whoAmI, angle, 2f); + if (Main.projectile.Length == Main.maxProjectiles) + break; + int projj = Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, ModContent.ProjectileType(), (int)(80 * player.MinionDamage()), 1f, player.whoAmI, angle, 2f); angle += angleVariance; for (int j = 0; j < 22; j++) { diff --git a/Projectiles/Summon/ColdDivinityPointyThing.cs b/Projectiles/Summon/ColdDivinityPointyThing.cs index a1159ab4ce..5b60feae30 100644 --- a/Projectiles/Summon/ColdDivinityPointyThing.cs +++ b/Projectiles/Summon/ColdDivinityPointyThing.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon circling = circlingPlayer = false; projectile.netUpdate = true; } - else if (projectile.ai[1] == 2f && projectile.timeLeft > 900) + else if (projectile.ai[1] >= 2f && projectile.timeLeft > 900) { target = CalamityUtils.MinionHoming(projectile.position, 1000f, Main.player[projectile.owner]); projectile.timeLeft = 800; @@ -111,7 +111,9 @@ namespace CalamityMod.Projectiles.Summon circlingPlayer = false; float height = target.getRect().Height; float width = target.getRect().Width; - floatyDistance = (height > width ? height : width) * 1.15f; + floatyDistance = (height > width ? height : width) * 1.5f; + if (floatyDistance > Main.LogicCheckScreenWidth / 3) + floatyDistance = Main.LogicCheckScreenWidth / 3; projectile.penetrate = -1; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 4; @@ -182,10 +184,11 @@ namespace CalamityMod.Projectiles.Summon recharging = 0; projectile.usesIDStaticNPCImmunity = false; projectile.penetrate = 1; + float applicableDist = target.getRect().Width > target.getRect().Height ? target.getRect().Width : target.getRect().Height; if (projectile.timeLeft > 60) - floatyDistance += Main.rand.Next(0, 5); + floatyDistance += Main.rand.Next(0, 10); else - floatyDistance -= Main.rand.Next(5, 10); + floatyDistance -= Main.rand.Next(10, 20); } if (circlingPlayer) {