diff --git a/Items/Weapons/Rogue/CursedDagger.cs b/Items/Weapons/Rogue/CursedDagger.cs index 3b792327a8..4c55e2ac21 100644 --- a/Items/Weapons/Rogue/CursedDagger.cs +++ b/Items/Weapons/Rogue/CursedDagger.cs @@ -4,16 +4,19 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using log4net.Core; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Rogue { public class CursedDagger : RogueWeapon { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/CursedDaggerThrow") { Volume = 0.3f, PitchVariance = 0.4f }; public override void SetDefaults() { Item.damage = 34; - Item.useAnimation = Item.useTime = 8; - Item.shootSpeed = 12f; + Item.useAnimation = Item.useTime = 17; + Item.shootSpeed = 19f; Item.knockBack = 4.5f; Item.shoot = ModContent.ProjectileType(); @@ -22,16 +25,23 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 48; Item.DamageType = RogueDamageClass.Instance; Item.useStyle = ItemUseStyleID.Swing; - Item.UseSound = SoundID.Item1; + Item.UseSound = ThrowSound; Item.rare = ItemRarityID.Pink; Item.value = CalamityGlobalItem.Rarity5BuyPrice; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(23f)) * 0.6f; + Vector2 newVel2 = velocity.RotatedByRandom(MathHelper.ToRadians(23f)) * 0.8f; + if (!player.Calamity().StealthStrikeAvailable()) + { + Projectile.NewProjectile(source, position, newVel, type, damage / 2, knockback, player.whoAmI); + Projectile.NewProjectile(source, position, newVel2, type, damage / 2, knockback, player.whoAmI); + } + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index 01d6824127..bdea17ae64 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -1,30 +1,32 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Rogue { public class IchorSpear : RogueWeapon { + public static readonly SoundStyle ThrowSound = new("CalamityMod/Sounds/Item/IchorSpearThrow") { Volume = 0.2f, PitchVariance = 0.4f }; public override void SetDefaults() { Item.width = 52; - Item.damage = 84; + Item.damage = 98; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = Item.useTime = 20; + Item.useAnimation = Item.useTime = 39; Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; + Item.knockBack = 7f; + Item.UseSound = ThrowSound; Item.autoReuse = true; Item.height = 52; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; + Item.shootSpeed = 17f; Item.DamageType = RogueDamageClass.Instance; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index d9cc30c5cb..870ca84e46 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -248,8 +248,8 @@ CursedDagger: { DisplayName: Cursed Dagger Tooltip: ''' - Throws bouncing daggers - Stealth strikes are showered in cursed fireballs + Throws a fast cursed dagger and two inaccurate weaker daggers + Stealth strikes throw a single dagger that bursts into a vortex of cursed flames ''' } @@ -596,8 +596,8 @@ IchorSpear: { DisplayName: Ichor Spear Tooltip: ''' - Throws an ichor tipped trident - Stealth strikes are showered in splashes of ichor + Throws a high-velocity ichor tipped javelin that pierces through enemies + Stealth strikes impale enemies and deal repeated damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 20323580c5..9f05f37ec0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -65,6 +65,7 @@ Crystalline2.DisplayName: Crystalline CrystallineProj.DisplayName: Crystalline CrystalPiercerProjectile.DisplayName: Crystal Piercer CrystalPiercerShard.DisplayName: Crystal Shard +CursedDaggerBlastHitbox.DisplayName: Cursed Vortex CursedDaggerProj.DisplayName: Cursed Dagger DeepSeaDumbbell1.DisplayName: Deep Sea Dumbbell DeepSeaDumbbell2.DisplayName: Deep Sea Dumbbell diff --git a/Projectiles/Rogue/CursedDaggerBlastHitbox.cs b/Projectiles/Rogue/CursedDaggerBlastHitbox.cs new file mode 100644 index 0000000000..4e75f956fd --- /dev/null +++ b/Projectiles/Rogue/CursedDaggerBlastHitbox.cs @@ -0,0 +1,65 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using Terraria.Utilities; +using CalamityMod.Items.Weapons.Rogue; +using static Humanizer.In; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using System.Reflection.Metadata; + +namespace CalamityMod.Projectiles.Rogue +{ + public class CursedDaggerBlastHitbox : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = 200; + Projectile.height = 200; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.timeLeft = 300; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 15; + } + + public override void AI() + { + if (Projectile.timeLeft % 30 == 0) + SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing with { Volume = 1.2f }, Projectile.position); + + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(200f, 200f), 75); + dust2.scale = Main.rand.NextFloat(0.8f, 1.1f); + dust2.noGravity = true; + + int sparkCount = Main.rand.Next(18); + float offset = Main.rand.NextFloat(MathHelper.TwoPi); + for (int i = 0; i < sparkCount; i++) + { + float angle = i / (float)sparkCount * MathHelper.TwoPi + offset; + Vector2 sparkPos = Projectile.Center + angle.ToRotationVector2() * Main.rand.Next(65, 200); + int sparkLifetime = Main.rand.Next(10, 18); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) * 0.955f; + Color sparkColor = Color.Lerp(Color.LawnGreen, Color.Green, Main.rand.NextFloat(0.7f)); + sparkColor = Color.Lerp(sparkColor, Color.LawnGreen, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(sparkPos, (angle - MathHelper.PiOver2 * Projectile.direction).ToRotationVector2() * Main.rand.NextFloat(2f, 5.5f), false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.CursedInferno, 600); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width, targetHitbox); + } +} diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index 8c60f77ab5..8d73962a45 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -1,9 +1,12 @@ using CalamityMod.Dusts; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using static Humanizer.In; namespace CalamityMod.Projectiles.Rogue { @@ -11,11 +14,12 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/CursedDagger"; - + public bool slowstart = true; + public int speedup = 0; public override void SetDefaults() { Projectile.localNPCHitCooldown = 10; - Projectile.penetrate = 3; + Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.width = Projectile.height = 38; @@ -28,27 +32,27 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.NextBool(4)) + if (Main.rand.NextBool(Projectile.Calamity().stealthStrike ? 3 : 7)) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Dust dust = Main.dust[Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.velocity.X * -3f, Projectile.velocity.Y * -3f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.5f, 3.2f) : 1.5f)]; + dust.noGravity = true; } if (Projectile.Calamity().stealthStrike) { - if (Projectile.timeLeft % 6 == 0) + if (slowstart) { - if (Projectile.owner == Main.myPlayer) - { - Vector2 velocity = new Vector2(Main.rand.NextFloat(-14f, 14f), Main.rand.NextFloat(-14f, 14f)); - int flame = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.CursedFlameFriendly : ProjectileID.CursedDartFlame, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (flame.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flame].DamageType = RogueDamageClass.Instance; - Main.projectile[flame].usesLocalNPCImmunity = true; - Main.projectile[flame].localNPCHitCooldown = 10; - } - } + Projectile.velocity *= 0.5f; + Projectile.penetrate = 1; + slowstart = false; } + if (speedup <= 50) + { + Projectile.velocity *= 1.03f; + speedup++; + } + Projectile.aiStyle = 0; + Projectile.extraUpdates = 1; } } @@ -58,27 +62,11 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.penetrate--; - if (Projectile.penetrate <= 0) + if (Projectile.Calamity().stealthStrike) { - Projectile.Kill(); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.position); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 2, Projectile.owner, 0, 0f); } - else - { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; } public override bool PreDraw(ref Color lightColor) @@ -90,6 +78,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.CursedInferno, Projectile.Calamity().stealthStrike ? 600 : 120); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.damage = (int)(Projectile.damage * 0.8f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.CursedInferno, Projectile.Calamity().stealthStrike ? 600 : 120); } } diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index 9b5d98a920..592d105bac 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -1,7 +1,12 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil; using System; +using System.Reflection.Metadata; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -9,53 +14,72 @@ namespace CalamityMod.Projectiles.Rogue { public class IchorSpearProj : ModProjectile, ILocalizedModType { + public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/IchorSpear"; - + public bool posthit = false; + public int framesInAir = 0; public override void SetDefaults() { - Projectile.width = 12; - Projectile.height = 12; + Projectile.width = 14; + Projectile.height = 14; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 2; - Projectile.aiStyle = ProjAIStyleID.StickProjectile; - Projectile.timeLeft = 600; - AIType = ProjectileID.BoneJavelin; + Projectile.penetrate = 6; + Projectile.timeLeft = 900; + Projectile.aiStyle = 0; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 50; } public override void AI() { - if (Main.rand.NextBool(4)) + framesInAir++; + if (framesInAir > 90 && !Projectile.Calamity().stealthStrike) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - } - Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 0.785f; - if (Projectile.spriteDirection == -1) - { - Projectile.rotation -= 1.57f; + Projectile.velocity.X *= 0.998f; + Projectile.velocity.Y += 0.3f; } + Projectile.scale = 1.2f; + if (!Projectile.Calamity().stealthStrike) + Projectile.extraUpdates = 1; + + if (Main.rand.NextBool(2) && !posthit) + { + Vector2 position = Projectile.Center + Vector2.Normalize(Projectile.velocity); + Dust dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(1.9707963705062866, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(0.3, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + dust = Main.dust[Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0f, 0f, 0, default, Projectile.Calamity().stealthStrike ? Main.rand.NextFloat(2.1f, 3.2f) : Main.rand.NextFloat(1.2f, 1.5f))]; + dust.position = position; + dust.velocity = Projectile.velocity.RotatedBy(-1.9707963705062866, default) * 0.1f + Projectile.velocity / 8f; + dust.position += Projectile.velocity.RotatedBy(-0.3, default); + dust.fadeIn = 0.5f; + dust.noGravity = true; + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + bool defaultsonce = true; if (Projectile.Calamity().stealthStrike) { - if (Projectile.timeLeft % 6 == 0) + Projectile.tileCollide = false; + Projectile.aiStyle = 0; + Projectile.extraUpdates = 2; + if (Projectile.ai[0] == 0f) { - if (Projectile.owner == Main.myPlayer) + if (defaultsonce) { - Vector2 velocity = new Vector2(Main.rand.NextFloat(-14f, 14f), Main.rand.NextFloat(-14f, 14f)); - int ichor = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, Main.rand.NextBool(2) ? ProjectileID.GoldenShowerFriendly : ProjectileID.IchorSplash, Projectile.damage, Projectile.knockBack, Projectile.owner); - if (ichor.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[ichor].DamageType = RogueDamageClass.Instance; - Main.projectile[ichor].usesLocalNPCImmunity = true; - Main.projectile[ichor].localNPCHitCooldown = 10; - Main.projectile[ichor].extraUpdates = 2; - } + Projectile.penetrate = 10; + Projectile.localNPCHitCooldown = 60; + defaultsonce = false; } } + Projectile.StickyProjAI(10); } } @@ -66,16 +90,63 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void Kill(int timeLeft) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - for (int i = 0; i <= 10; i++) + Vector2 bloodSpawnPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height) * 0.04f; + Vector2 splatterDirection = (Projectile.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); + int sparkCount = Main.rand.Next(5); + for (int i = 0; i < sparkCount; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 246, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + Vector2 sparkVelocity = splatterDirection.RotatedByRandom(0.5f) * Main.rand.NextFloat(5f, 9f); + int sparkLifetime = Main.rand.Next(23, 25); + float sparkScale = Main.rand.NextFloat(0.8f, 1f) * 0.955f; + Color sparkColor = Color.Lerp(Color.Gold, Color.Goldenrod, Main.rand.NextFloat(0.7f)); + sparkColor = Color.Lerp(sparkColor, Color.Gold, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity * -2, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + SoundEngine.PlaySound(Hitsound, Projectile.position); + target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 900 : 180); + if (Projectile.Calamity().stealthStrike) + { + posthit = true; + for (int i = 0; i <= 17; i++) + { + Dust dust2 = Main.dust[Dust.NewDust(target.position, Projectile.width, Projectile.height, Main.rand.Next(169, 170), 0, 0, 0, default, 3.2f)]; + dust2.noGravity = true; + dust2.velocity.Y -= Main.rand.NextFloat(2.5f, 10.5f); + dust2.velocity.X += Main.rand.NextFloat(-3f, 3f); + } + SoundEngine.PlaySound(SoundID.NPCHit18, Projectile.position); } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.Calamity().stealthStrike && !posthit) + { + Projectile.ModifyHitNPCSticky(2); + posthit = true; + } + Projectile.damage = (int)(Projectile.damage * 0.9f); + if (Projectile.damage < 1) + Projectile.damage = 1; + } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 600 : 120); - + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8 && Projectile.Calamity().stealthStrike) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 9; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.Next(169, 170), Projectile.oldVelocity.X * 0.3f, Projectile.oldVelocity.Y * 0.3f, 0, default, Main.rand.NextFloat(1.2f, 1.6f)); + } + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Ichor, Projectile.Calamity().stealthStrike ? 600 : 120); } } diff --git a/Sounds/Item/CursedDaggerThrow.ogg b/Sounds/Item/CursedDaggerThrow.ogg new file mode 100644 index 0000000000..304cbb599a Binary files /dev/null and b/Sounds/Item/CursedDaggerThrow.ogg differ diff --git a/Sounds/Item/IchorSpearThrow.ogg b/Sounds/Item/IchorSpearThrow.ogg new file mode 100644 index 0000000000..36b9da89d4 Binary files /dev/null and b/Sounds/Item/IchorSpearThrow.ogg differ