diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index 18cb45e199..b1c4ec134c 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos Deathray"); + DisplayName.SetDefault("T Hanos Deathray"); } public override void SetDefaults() diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index ea2ae5c374..25ff49f22e 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { - DisplayName.SetDefault("Thanatos Beam"); + DisplayName.SetDefault("T Hanos Beam"); Main.projFrames[projectile.type] = 4; } diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 7d493cda46..30b8eace4f 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -16,7 +16,16 @@ namespace CalamityMod.Projectiles.Melee public ref float SwordItemID => ref projectile.ai[1]; public ref float VerticalOffset => ref projectile.localAI[0]; public ref float Time => ref projectile.localAI[1]; - public float AttackCompletionRatio => 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; + public float AttackCompletionRatio + { + get + { + float completionRatio = 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; + if (float.IsNaN(completionRatio) || float.IsInfinity(completionRatio)) + completionRatio = 0f; + return completionRatio; + } + } public Player Owner => Main.player[projectile.owner]; public int Variant => (int)projectile.ai[0] % 2; @@ -124,6 +133,9 @@ namespace CalamityMod.Projectiles.Melee return; } + if (Owner.itemAnimationMax == 0) + Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.meleeSpeed); + float swingOffsetAngle = MathHelper.SmoothStep(-1.87f, 3.79f, AttackCompletionRatio); // Offset a little bit angularly if the secondary variant to prevent complete overlap. diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index abc384ed25..cb23b8ba13 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -158,9 +158,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { ReleaseHitDust(target.Center - projectile.velocity * 3f); - HitTargetIndex = target.whoAmI; - projectile.timeLeft = projectile.Calamity().stealthStrike ? 100 : 60; - projectile.netUpdate = true; + if (!Main.npc.IndexInRange((int)HitTargetIndex)) + { + HitTargetIndex = target.whoAmI; + projectile.timeLeft = projectile.Calamity().stealthStrike ? 100 : 60; + projectile.netUpdate = true; + } } } } diff --git a/Projectiles/Summon/UniverseSplitterHugeBeam.cs b/Projectiles/Summon/UniverseSplitterHugeBeam.cs index 5a211b41f3..fa8adf72e8 100644 --- a/Projectiles/Summon/UniverseSplitterHugeBeam.cs +++ b/Projectiles/Summon/UniverseSplitterHugeBeam.cs @@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = MathHelper.Lerp(LaserSize, 0f, 1f - (projectile.timeLeft / (float)TotalFadeoutTime)); } - Vector2 samplingPoint = projectile.Center; + Vector2 samplingPoint = projectile.Top; - float[] samples = new float[3]; + float[] samples = new float[12]; float determinedLength = 0f; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength + 72f, samples); + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength, samples); for (int i = 0; i < samples.Length; i++) { determinedLength += samples[i]; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Summon determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.3f, MaximumLength); float lerpDelta = 0.5f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength - 20f, lerpDelta); if (projectile.localAI[0] < 30f) { projectile.localAI[1] = MathHelper.Lerp(72f, projectile.localAI[1], projectile.localAI[0] / 30f); diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.cs b/Projectiles/Summon/UniverseSplitterSmallBeam.cs index 02d9aad775..8a177e8a5a 100644 --- a/Projectiles/Summon/UniverseSplitterSmallBeam.cs +++ b/Projectiles/Summon/UniverseSplitterSmallBeam.cs @@ -87,22 +87,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = MathHelper.Lerp(3.25f, 0.01f, (projectile.localAI[0] - (TimeLeft - 15f)) / 15f); } - Vector2 samplingPoint = projectile.Center; - - float[] samples = new float[3]; - - float determinedLength = 0f; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength, samples); - for (int i = 0; i < samples.Length; i++) - { - determinedLength += samples[i]; - } - determinedLength /= samples.Length; - - determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.5f, MaximumLength); - - float lerpDelta = 0.5f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], MaximumLength, 0.5f); Vector2 beamEndPosiiton = projectile.Center + projectile.velocity * (projectile.localAI[1] - 6f); // Draw white light across the laser