diff --git a/Items/Weapons/Melee/MirrorBlade.cs b/Items/Weapons/Melee/MirrorBlade.cs index 08ad1543fe..52e7405ed5 100644 --- a/Items/Weapons/Melee/MirrorBlade.cs +++ b/Items/Weapons/Melee/MirrorBlade.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Systems.Collections; @@ -65,8 +66,8 @@ namespace CalamityMod.Items.Weapons.Melee if (reflectTimer <= 50) { - float coneLength = 80f; - float maximumAngle = 0.8f; + float coneLength = 96f; + float maximumAngle = 1f; float coneRotation = player.DirectionTo(Main.MouseWorld).ToRotation(); var shardCount = 0; foreach (var proj in Main.projectile) @@ -78,19 +79,45 @@ namespace CalamityMod.Items.Weapons.Melee } foreach (var proj in Main.ActiveProjectiles) { - if (proj.hostile && proj.damage > 0 && proj.Hitbox.IntersectsConeSlowMoreAccurate(player.Center, coneLength, coneRotation, maximumAngle)) + if (proj.type == ModContent.ProjectileType() && proj.ModProjectile().time >= 29) { if (shardCount > 0) { SoundEngine.PlaySound(SeekingScorcher.LightShatterSound, player.Center); - SoundEngine.PlaySound(SoundID.DD2_WitherBeastDeath,player.Center); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastDeath, player.Center); } if (shardCount >= 10) { player.SetImmuneTimeForAllTypes(player.longInvince ? 60 : 30); } - proj.Calamity().multiplicativeDR += shardCount / 10f; - proj.Calamity().multiplicativeDRTimer = 60; + proj.Calamity().multiplicativeDR += shardCount / 10f; + proj.Calamity().multiplicativeDRTimer = 60; + foreach (var proj2 in Main.projectile) + { + if (proj2.active && proj2.type == ModContent.ProjectileType() && proj2.owner == player.whoAmI && (proj2.ModProjectile as MirrorBlast).isShard) + { + proj2.damage = (int)(proj2.damage * (shardCount >= 10 ? 3f : 2f)); + (proj2.ModProjectile as MirrorBlast).shardShield = 0; + (proj2.ModProjectile as MirrorBlast).shardNum = 11; + proj2.netUpdate = true; + } + } + reflectTimer = 0; + return; + } else + if (proj.hostile && proj.damage > 0 && proj.Hitbox.IntersectsConeSlowMoreAccurate(player.Center, coneLength, coneRotation, maximumAngle)) + { + if (shardCount > 0) + { + SoundEngine.PlaySound(SeekingScorcher.LightShatterSound, player.Center); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastDeath, player.Center); + } + if (shardCount >= 10) + { + player.SetImmuneTimeForAllTypes(player.longInvince ? 60 : 30); + } + proj.Calamity().multiplicativeDR += shardCount / 10f; + proj.Calamity().multiplicativeDRTimer = 60; foreach (var proj2 in Main.projectile) { if (proj2.active && proj2.type == ModContent.ProjectileType() && proj2.owner == player.whoAmI && (proj2.ModProjectile as MirrorBlast).isShard) diff --git a/Projectiles/Melee/MirrorBladeProjectile.cs b/Projectiles/Melee/MirrorBladeProjectile.cs index b2710900a3..9aa7f76830 100644 --- a/Projectiles/Melee/MirrorBladeProjectile.cs +++ b/Projectiles/Melee/MirrorBladeProjectile.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Boss; using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Terraria; @@ -71,11 +72,20 @@ namespace CalamityMod.Projectiles.Melee if (!inStartup && !inCooldown) foreach (var proj in Main.ActiveProjectiles) { - if (proj.Hitbox.Intersects(Projectile.Hitbox) && proj.hostile && !reflectedProjectiles.Contains(proj.whoAmI)) + if (proj.type == ModContent.ProjectileType() && proj.ModProjectile().canDamage && !reflectedProjectiles.Contains(proj.whoAmI)) + { + reflectedProjectiles.Add(proj.whoAmI); + for (var i = 0; i < 3; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), proj.Center, proj.velocity * -1, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact, Projectile.Center); + } + } + else if (proj.Hitbox.Intersects(Projectile.Hitbox) && proj.hostile && !reflectedProjectiles.Contains(proj.whoAmI)) { reflectedProjectiles.Add(proj.whoAmI); Projectile.NewProjectile(Projectile.GetSource_FromThis(), proj.Center, proj.velocity * -1, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); - SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact,Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact, Projectile.Center); } } diff --git a/Projectiles/Melee/MirrorBlast.cs b/Projectiles/Melee/MirrorBlast.cs index 98cc282745..337004dc4b 100644 --- a/Projectiles/Melee/MirrorBlast.cs +++ b/Projectiles/Melee/MirrorBlast.cs @@ -142,6 +142,12 @@ namespace CalamityMod.Projectiles.Melee else { float homingStrength = 0.025f; // Adjust this value for stronger or weaker homing + if (Projectile.timeLeft < 1000) + homingStrength *= 2f; + if (Projectile.timeLeft < 800) + homingStrength *= 2f; + if (Projectile.timeLeft < 600) + homingStrength *= 2f; NPC target = FindClosestNPC(3200f); if (target != null) {