diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index ae24602deb..62a5b53f4e 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1127,7 +1127,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.ai[1] < 150f) - Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); else { if (npc.ai[1] == 150f) @@ -1135,7 +1135,7 @@ namespace CalamityMod.NPCs npc.localAI[0] = num743; npc.localAI[1] = num744; } - Projectile.NewProjectile(vector93.X, vector93.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector93.X, vector93.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); } } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index c8de3afca5..6c0a489521 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -15796,7 +15796,7 @@ namespace CalamityMod.NPCs float xAccel = 0.1f, float xAccelBoost1 = 0.06f, float xAccelBoost2 = 0.25f, float yAccel = 0.12f, float yAccelBoost1 = 0.07f, float yAccelBoost2 = 0.2f) { - if (npc.direction == -1 && npc.velocity.X > -maxXSpeed && npc.position.X > Main.player[npc.target].Center.X) + if (npc.direction == -1 && npc.velocity.X > -maxXSpeed) { npc.velocity.X -= xAccel; if (npc.velocity.X > maxXSpeed) @@ -15812,7 +15812,7 @@ namespace CalamityMod.NPCs npc.velocity.X = -maxXSpeed; } } - else if (npc.direction == 1 && npc.velocity.X < maxXSpeed && npc.Center.X < Main.player[npc.target].position.X) + else if (npc.direction == 1 && npc.velocity.X < maxXSpeed) { npc.velocity.X += xAccel; if (npc.velocity.X < -maxXSpeed) @@ -15828,7 +15828,7 @@ namespace CalamityMod.NPCs npc.velocity.X = maxXSpeed; } } - if (npc.directionY == -1 && npc.velocity.Y > -maxYSpeed && npc.position.Y > Main.player[npc.target].Center.Y) + if (npc.directionY == -1 && npc.velocity.Y > -maxYSpeed) { npc.velocity.Y -= yAccel; if (npc.velocity.Y > maxYSpeed) @@ -15844,7 +15844,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = -maxYSpeed; } } - else if (npc.directionY == 1 && npc.velocity.Y < maxYSpeed && npc.Center.X < Main.player[npc.target].position.Y) + else if (npc.directionY == 1 && npc.velocity.Y < maxYSpeed) { npc.velocity.Y += yAccel; if (npc.velocity.Y < -maxYSpeed) @@ -15861,6 +15861,7 @@ namespace CalamityMod.NPCs } } } + public static bool BuffedDemonEyeAI(NPC npc, Mod mod) { // Subtypes of enemies with this AI. Made for programmer convenience. diff --git a/Projectiles/Boss/BrimstoneTargetRay.cs b/Projectiles/Boss/BrimstoneTargetRay.cs index b4bc4d998b..a5f578d30d 100644 --- a/Projectiles/Boss/BrimstoneTargetRay.cs +++ b/Projectiles/Boss/BrimstoneTargetRay.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + projectile.tileCollide = Collision.CanHitLine(Main.npc[(int)projectile.ai[1]].Center, 1, 1, Main.player[Main.npc[(int)projectile.ai[1]].target].Center, 1, 1); + if (Main.rand.NextBool(2)) { Vector2 vector33 = projectile.position;