From e1b0ebde4a5ff57dade327c422d0caeadca65162 Mon Sep 17 00:00:00 2001 From: Xyk Date: Fri, 7 Mar 2025 20:50:55 -0800 Subject: [PATCH] Weapon Fixes - Fixed Abyss Blade line teleporting out of your hand when thrown with high melee speed. - Adjusted the spread of Primordial Ancient projectiles to be consistent. - Made Forbidden/Exalted Oathblade only knock out swords on the first hit of a swing that would eject swords (same effect Devils Devastation had) so you can more easily chain swings between clumped enemies. --- Items/Weapons/Magic/PrimordialAncient.cs | 8 +++--- .../Mods.CalamityMod.Items.Accessories.hjson | 4 +-- .../en-US/Mods.CalamityMod.NPCs.hjson | 16 ++++++------ .../Magic/PrimordialAncientProjectile.cs | 10 ++----- Projectiles/Melee/AbyssBladeProjectile.cs | 2 +- Projectiles/Melee/DepthCrusherProjectile.cs | 2 +- Projectiles/Melee/ExaltedOathbladeHoldout.cs | 26 ++++++++++++------- .../Melee/ForbiddenOathbladeHoldout.cs | 26 ++++++++++++------- Projectiles/Melee/NeptunesBountyProjectile.cs | 2 +- 9 files changed, 52 insertions(+), 44 deletions(-) diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index c9d7f0fe57..b587e34686 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -8,6 +8,7 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Microsoft.Xna.Framework; +using System; namespace CalamityMod.Items.Weapons.Magic { @@ -41,10 +42,11 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness); - for (int i = 0; i < 5; i++) + for (int i = -2; i <= 2; i++) { - Vector2 vel = velocity.RotatedByRandom(0.2f * i); - Projectile.NewProjectile(source, position, vel * Main.rand.NextFloat(0.8f, 1.2f), type, damage, knockback, player.whoAmI, 0f, i == 0 ? 1 : 0, MaxMana ? 1f : 0f); + Vector2 vel = velocity.RotatedBy(0.1f * i) * MathHelper.Lerp(3 - Math.Abs(i), 1, 0.7f); + Projectile dust = Projectile.NewProjectileDirect(source, position, vel, type, damage, knockback, player.whoAmI, 0f, i == 0 ? 1 : 0, MaxMana ? 1f : 0f); + dust.localAI[0] = i * 0.45f; } return false; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index fac6d8b400..344f9d8928 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -292,8 +292,8 @@ BlackGlassBand: { DisplayName: Black Glass Band Tooltip: ''' -Enemy hits create an obsidian blast that always critically strikes -This effect has a 7 second cooldown, but is halved if the blast kills an enemy + Enemy hits create an obsidian blast that always critically strikes + This effect has a 7 second cooldown, but is halved if the blast kills an enemy ''' } diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index fa41dc31a8..37e84bc593 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -354,26 +354,26 @@ FAP: { BloodMoon2: If you're too lazy to craft potions normally, try Blood Orbs. Blood is fuel, dumbass. BloodMoon3: I'm trying to not be bitchy tonight, but it's hard when everyone else won't shut up. BloodMoonSlap1: Sorry, I have no moral compass at the moment. - BloodMoonSlap2: I could slap you... but you've done more for me than most. What do you need? + BloodMoonSlap2: I could slap you... but you've done more for me than most. What do you need? Normal1: What do you want this time? I have an appointment to get my nails done in 5 minutes, make it quick. - Normal1Alt: Whaddya need? I have candles and alcohols galore! + Normal1Alt: Whaddya need? I have candles and alcohols galore! Normal2: Maybe you should drink something that turns you into a magical flying unicorn, so you can be just like me. - Normal2Alt: Sometimes I think about returning to nature for a while to escape from all of this chaos. + Normal2Alt: Sometimes I think about returning to nature for a while to escape from all of this chaos. Normal3: Deals so good I'll [$$!$] myself! ...Sorry, I may have just had a minor stroke! - Normal3Alt: I've been thinking more about the future lately. I can't say I'm not worried, but I'll be trying my best to make it better. + Normal3Alt: I've been thinking more about the future lately. I can't say I'm not worried, but I'll be trying my best to make it better. Normal4: Did anyone ever tell you that large assets cause back pain? Well, they were right. - Normal4Alt: Do you have any idea how much extra money I make so {0} can afford her super fancy hair products? The back pain is worth it. + Normal4Alt: Do you have any idea how much extra money I make so {0} can afford her super fancy hair products? The back pain is worth it. Archmage: "{0} can share a drink with me any time! ...Or maybe not, I'm not sure his old heart could take it." BrimstoneWitch: The abuse {0} went through is something I can hardly comprehend. I'd offer her a drink, but I don't think she'd enjoy it. Tavernkeep1: My booze will always be better than {0}'s, and nobody can convince me otherwise. Tavernkeep2: Tell {0} to stop calling me. He's not wanted. Tavernkeep3: I've had to tell baldie where my eyes are so many times that I've lost count. Stylist1: Ever since {0} moved in I haven't been drinking as much... a strange, but not unwelcome, feeling. - Stylist1Alt: I've stopped drinking almost entirely, thanks to {0} and... you. Thank you, for making this world a safer place. + Stylist1Alt: I've stopped drinking almost entirely, thanks to {0} and... you. Thank you, for making this world a safer place. Stylist2: You can't stop me from trying to move in with {0}. - Stylist2Alt: If you have {0} and I housed in one of those so-called 'NPC prisons'... we WILL find you, and we WILL bring the scissors... + Stylist2Alt: If you have {0} and I housed in one of those so-called 'NPC prisons'... we WILL find you, and we WILL bring the scissors... Stylist3: I love it when {0}'s hands get sticky from all that... wax. - Stylist3Alt: "{0} and I will be building wax figures tonight. And no, there's nothing weird about that." + Stylist3Alt: "{0} and I will be building wax figures tonight. And no, there's nothing weird about that." Day1: I'm literally balls drunk off my sass right now, what do you want? Day2: I'm either laughing because I'm drunk or because I've lost my mind, probably both. Day3: When I'm drunk I'm way happier... at least until the talking worms start to appear. diff --git a/Projectiles/Magic/PrimordialAncientProjectile.cs b/Projectiles/Magic/PrimordialAncientProjectile.cs index 55c578264a..42821ea279 100644 --- a/Projectiles/Magic/PrimordialAncientProjectile.cs +++ b/Projectiles/Magic/PrimordialAncientProjectile.cs @@ -1,18 +1,14 @@ using System; using System.Collections.Generic; -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Steamworks; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Utilities.Terraria.Utilities; namespace CalamityMod.Projectiles.Magic { public class PrimordialAncientProjectile : ModProjectile, ILocalizedModType @@ -32,7 +28,6 @@ namespace CalamityMod.Projectiles.Magic ProjectileID.Sets.TrailCacheLength[Type] = 10; ProjectileID.Sets.TrailingMode[Type] = 2; } - public override void SetDefaults() { Projectile.width = 140; @@ -47,7 +42,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 40 * Projectile.extraUpdates; } - public override void AI() { if (time == 0) @@ -63,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic curve = MathHelper.Lerp(curve, 0f, 0.035f); Projectile.velocity *= Main.rand.NextFloat(0.985f, 0.995f); if (Projectile.ai[1] != 1) - Projectile.velocity = Projectile.velocity.RotatedBy(curve * rotDirection); + Projectile.velocity = Projectile.velocity.RotatedBy(curve * Projectile.localAI[0]); } if (Projectile.ai[2] == 1) @@ -203,7 +197,7 @@ namespace CalamityMod.Projectiles.Magic dust2.alpha = 100; } - Projectile.rotation += Main.rand.NextFloat(0.1f * Utils.GetLerpValue(-100, 360, time)) * (float)Projectile.direction * rotDirection; + Projectile.rotation += Main.rand.NextFloat(0.1f * Utils.GetLerpValue(-100, 360, time)) * (float)Projectile.direction * Projectile.localAI[0]; time++; } diff --git a/Projectiles/Melee/AbyssBladeProjectile.cs b/Projectiles/Melee/AbyssBladeProjectile.cs index b4249441b1..1ea0f6191b 100644 --- a/Projectiles/Melee/AbyssBladeProjectile.cs +++ b/Projectiles/Melee/AbyssBladeProjectile.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.netUpdate = true; SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); - Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.Center = Owner.MountedCenter + (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 12; // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 20; diff --git a/Projectiles/Melee/DepthCrusherProjectile.cs b/Projectiles/Melee/DepthCrusherProjectile.cs index ff4a63b424..7ef793f9d0 100644 --- a/Projectiles/Melee/DepthCrusherProjectile.cs +++ b/Projectiles/Melee/DepthCrusherProjectile.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.netUpdate = true; SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); - Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.Center = Owner.MountedCenter + (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 12; // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 15; startDamage = Projectile.damage; diff --git a/Projectiles/Melee/ExaltedOathbladeHoldout.cs b/Projectiles/Melee/ExaltedOathbladeHoldout.cs index 019497315b..23ca636df8 100644 --- a/Projectiles/Melee/ExaltedOathbladeHoldout.cs +++ b/Projectiles/Melee/ExaltedOathbladeHoldout.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Projectiles.Melee public bool holding = true; public int postSwingCooldown = 0; public bool willDie = false; + public bool hasLaunchedBlades = false; public bool swooshFade = false; public int postSwingCooldownMax => (int)(useAnim * 0.65f); public override void SetDefaults() @@ -145,6 +146,7 @@ namespace CalamityMod.Projectiles.Melee doSwing = true; finalFlip = false; playSwingSound = true; + hasLaunchedBlades = false; if (!Owner.Calamity().demonSwordKillMode && postSwingCooldown == 0) { willDie = true; @@ -272,18 +274,22 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(blastRing2); } - for (int x = 0; x < Main.maxProjectiles; x++) + if (!hasLaunchedBlades) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == target.whoAmI && projectile.localAI[0] != 5) + for (int x = 0; x < Main.maxProjectiles; x++) { - projectile.owner = Owner.whoAmI; - projectile.localAI[0] = 5; - projectile.velocity = (launchVel * 16.5f).RotatedByRandom(0.25f); - Owner.Calamity().demonSwordKillMode = true; - if (hasKillMode) - killModeCD.timeLeft = KillMode.cooldownMax + KillMode.buffMax; - Owner.Calamity().killModeCooldown = KillMode.cooldownMax + KillMode.buffMax; + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == target.whoAmI && projectile.localAI[0] != 5) + { + projectile.owner = Owner.whoAmI; + projectile.localAI[0] = 5; + projectile.velocity = (launchVel * 16.5f).RotatedByRandom(0.25f); + Owner.Calamity().demonSwordKillMode = true; + if (hasKillMode) + killModeCD.timeLeft = KillMode.cooldownMax + KillMode.buffMax; + Owner.Calamity().killModeCooldown = KillMode.cooldownMax + KillMode.buffMax; + hasLaunchedBlades = true; + } } } diff --git a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs index f3d9a92b77..b42a40d9ca 100644 --- a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs +++ b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs @@ -44,6 +44,7 @@ namespace CalamityMod.Projectiles.Melee public bool holding = true; public int postSwingCooldown = 0; public bool willDie = false; + public bool hasLaunchedBlades = false; public bool swooshFade = false; public int postSwingCooldownMax => (int)(useAnim * 0.65f); public override void SetDefaults() @@ -143,6 +144,7 @@ namespace CalamityMod.Projectiles.Melee doSwing = true; finalFlip = false; playSwingSound = true; + hasLaunchedBlades = false; if (!Owner.Calamity().demonSwordKillMode && postSwingCooldown == 0) { willDie = true; @@ -270,18 +272,22 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(blastRing2); } - for (int x = 0; x < Main.maxProjectiles; x++) + if (!hasLaunchedBlades) { - Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == target.whoAmI && projectile.localAI[0] != 5) + for (int x = 0; x < Main.maxProjectiles; x++) { - projectile.owner = Owner.whoAmI; - projectile.localAI[0] = 5; - projectile.velocity = (launchVel * 16.5f).RotatedByRandom(0.25f); - Owner.Calamity().demonSwordKillMode = true; - if (hasKillMode) - killModeCD.timeLeft = KillMode.cooldownMax + KillMode.buffMax; - Owner.Calamity().killModeCooldown = KillMode.cooldownMax + KillMode.buffMax; + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[2] == target.whoAmI && projectile.localAI[0] != 5) + { + projectile.owner = Owner.whoAmI; + projectile.localAI[0] = 5; + projectile.velocity = (launchVel * 16.5f).RotatedByRandom(0.25f); + Owner.Calamity().demonSwordKillMode = true; + if (hasKillMode) + killModeCD.timeLeft = KillMode.cooldownMax + KillMode.buffMax; + Owner.Calamity().killModeCooldown = KillMode.cooldownMax + KillMode.buffMax; + hasLaunchedBlades = true; + } } } diff --git a/Projectiles/Melee/NeptunesBountyProjectile.cs b/Projectiles/Melee/NeptunesBountyProjectile.cs index bdb1bb90f6..5c9268ace4 100644 --- a/Projectiles/Melee/NeptunesBountyProjectile.cs +++ b/Projectiles/Melee/NeptunesBountyProjectile.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.netUpdate = true; SoundEngine.PlaySound(SoundID.Item1, Projectile.Center); - Projectile.Center = Owner.MountedCenter + Projectile.velocity * 12f; + Projectile.Center = Owner.MountedCenter + (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 12; // 15NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 28; startDamage = Projectile.damage;