Mirror Blade fixes for walls

This commit is contained in:
Doze-Zoze committed 2025-06-19 08:50:08 -05:00
1 parent d6c7a2f4c8
commit b82b420d27
3 files changed
+51 -8

No files matched your search

+33 -6
View File
@@ -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<DoGLaserWalls>() && proj.ModProjectile<DoGLaserWalls>().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<MirrorBlast>() && 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<MirrorBlast>() && proj2.owner == player.whoAmI && (proj2.ModProjectile as MirrorBlast).isShard)
+12 -2
View File
@@ -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<DoGLaserWalls>() && proj.ModProjectile<DoGLaserWalls>().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<MirrorBlast>(), (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<MirrorBlast>(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner);
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact,Projectile.Center);
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact, Projectile.Center);
}
}
+6
View File
@@ -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)
{