diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index 93ad7842c7..9f92e3ee66 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -46,8 +46,38 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, projectile.Calamity().stealthStrike ? 800f : 400f, 14f, 20f); - projectile.velocity = initStealth && !flag17 ? initialVelocity : projectile.velocity; + Vector2 center = projectile.Center; + float maxDistance = projectile.Calamity().stealthStrike ? 800f : 400f; + bool homeIn = false; + + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); + + bool canHit = true; + if (extraDistance < maxDistance && !ignoreTiles) + canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + + if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + { + center = Main.npc[i].Center; + homeIn = true; + break; + } + } + } + + if (homeIn) + { + Vector2 homeInVector = projectile.DirectionTo(center); + if (homeInVector.HasNaNs()) + homeInVector = Vector2.UnitY; + + projectile.velocity = (projectile.velocity * 20f + homeInVector * 14f) / (21f); + } + projectile.velocity = initStealth && !homeIn ? initialVelocity : projectile.velocity; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ScarletDevilBullet.cs b/Projectiles/Rogue/ScarletDevilBullet.cs index d75b3b6236..9d21e151bf 100644 --- a/Projectiles/Rogue/ScarletDevilBullet.cs +++ b/Projectiles/Rogue/ScarletDevilBullet.cs @@ -42,11 +42,7 @@ namespace CalamityMod.Projectiles.Rogue { float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); - bool canHit = true; - if (extraDistance < maxDistance && !ignoreTiles) - canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); - - if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance)) { center = Main.npc[i].Center; homeIn = true; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index a314d723ed..aa17350cc8 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -50,10 +50,6 @@ namespace CalamityMod.Projectiles.Rogue { float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); - bool canHit = true; - if (extraDistance < maxDistance && !ignoreTiles) - canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); - if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) { center = Main.npc[i].Center; diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index f6133cd959..de1b630a4a 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -237,7 +237,7 @@ namespace CalamityMod r.AddIngredient(ItemID.BottledWater); r.AddIngredient(ItemID.Daybloom); r.AddIngredient(ModContent.ItemType()); - r.AddTile(TileID.Bottle); + r.AddTile(TileID.Bottles); r.SetResult(ItemID.ArcheryPotion); r.AddRecipe(); }