diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3844ca20a3..046760ef8d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -565,6 +565,7 @@ namespace CalamityMod.CalPlayer public bool giantPearl = false; public bool normalityRelocator = false; public bool flameLickedShell = false; + public bool Pauldron = false; public bool manaOverloader = false; public bool royalGel = false; public bool handWarmer = false; @@ -1656,6 +1657,7 @@ namespace CalamityMod.CalPlayer giantPearl = false; normalityRelocator = false; flameLickedShell = false; + Pauldron = false; manaOverloader = false; royalGel = false; handWarmer = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d6d749e1bd..e9b130a686 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -236,7 +236,7 @@ namespace CalamityMod.CalPlayer if (!HasIncreasedDashFirstFrame) { Player.velocity.X *= 1.15f; - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 75, 20f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), 75, 20f, Player.whoAmI); HasIncreasedDashFirstFrame = true; } float numberOfDusts = 10f; @@ -263,21 +263,21 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(spark2); } if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 90, 0f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), 90, 0f, Player.whoAmI); } else HasIncreasedDashFirstFrame = false; } - if (flameLickedShell) + if (Pauldron) { if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal) { - if (!HasReducedDashFirstFrame) + Player.endurance += 0.05f; + if (!HasReducedDashFirstFrame) // Dash isn't reduced, this is used to determine the first frame of dashing { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f , PitchVariance = 0.4f }, Player.Center); - Player.velocity.X *= 0.75f; //25% reduced dash velocity - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 67, 16f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), 67, 16f, Player.whoAmI); HasReducedDashFirstFrame = true; } float numberOfDusts = 10f; @@ -302,7 +302,7 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(spark2); if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 220, 16f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), 175, 10f, Player.whoAmI); } else HasReducedDashFirstFrame = false; diff --git a/CalPlayer/Dashes/AsgardianAegisDash.cs b/CalPlayer/Dashes/AsgardianAegisDash.cs index e355eaa282..7cc66bec8c 100644 --- a/CalPlayer/Dashes/AsgardianAegisDash.cs +++ b/CalPlayer/Dashes/AsgardianAegisDash.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Items.Accessories; +using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -18,43 +19,35 @@ namespace CalamityMod.CalPlayer.Dashes public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam; public override bool IsOmnidirectional => false; + public int Time = 0; public override float CalculateDashSpeed(Player player) => 23.3f; public override void OnDashEffects(Player player) { - // Spawn fire dust around the player's body. - for (int d = 0; d < 60; d++) - { - Dust holyFireDashDust = Dust.NewDustDirect(player.position, player.width, player.height, 246, 0f, 0f, 100, default, 3f); - holyFireDashDust.position += Main.rand.NextVector2Square(-5f, 5f); - holyFireDashDust.velocity += Main.rand.NextVector2Circular(5f, 5f); - holyFireDashDust.velocity *= 0.75f; - holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); - holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); - holyFireDashDust.noGravity = true; - holyFireDashDust.fadeIn = 0.5f; - } + Time = 0; } public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) { - // Spawn fire dust around the player's body. - for (int d = 0; d < 8; d++) + Time += 2; + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, Time, true)); + for (int i = 0; i < 3; i++) { - int dashDustID = Main.rand.Next(new int[] - { - (int)CalamityDusts.BlueCosmilite, - (int)CalamityDusts.PurpleCosmilite, - (int)CalamityDusts.ProfanedFire - }); - Dust fireDashDust = Dust.NewDustDirect(player.position + Vector2.UnitY * 4f, player.width, player.height - 8, dashDustID, 0f, 0f, 100, default, 2f); - fireDashDust.velocity *= 0.1f; - fireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); - fireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); - fireDashDust.noGravity = true; - if (Main.rand.NextBool(2)) - fireDashDust.fadeIn = 0.5f; + float offsetRotationAngle = player.velocity.ToRotation() + Time / 5f; + float radius = (15f + (float)Math.Cos(Time / 3f) * 12f) * radiusFactor; + Vector2 dustPosition = player.Center - player.velocity * 2; + dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(5) ? 181 : 295); + dust.alpha = 220; + dust.noGravity = true; + dust.velocity = player.velocity * 0.8f; + dust.scale = Main.rand.NextFloat(1.7f, 2.0f); + dust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); + Dust dust2 = Dust.NewDustPerfect(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) + (player.velocity * 1.5f), Main.rand.NextBool(8) ? 180 : 295, -player.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(1.7f, 1.9f)); + dust2.alpha = 170; + dust2.noGravity = true; + dust2.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); } // Dash at a faster speed than the default value. @@ -82,7 +75,7 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.Damage = (int)player.GetTotalDamage().ApplyTo(300f); int supremeExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(135); - Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, 20f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, 20f, Main.myPlayer, 3f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } } diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index 44c8883878..71b2ddb356 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -75,7 +75,7 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.Damage = (int)player.GetTotalDamage().ApplyTo(250f); int supremeExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(120); - Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, 15f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, 15f, Main.myPlayer, 1f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } } diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index 1238a7b1d4..8fb8b6eb64 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -4,7 +4,9 @@ using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -20,44 +22,85 @@ namespace CalamityMod.CalPlayer.Dashes public static int GodslayerCooldown = 45; + public SlotId GSDashSlot; + + public static readonly SoundStyle Impact = new("CalamityMod/Sounds/NPCKilled/DevourerDeathImpact") { Volume = 0.5f }; + public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam; public override bool IsOmnidirectional => true; + + public int Time = 0; + public float Size = 2.2f; + public bool SoundOnce = true; public override float CalculateDashSpeed(Player player) => 80f; public override void OnDashEffects(Player player) { - SoundEngine.PlaySound(DevourerofGodsHead.AttackSound, player.Center); + Time = 0; + Size = 2.2f; + GSDashSlot = SoundEngine.PlaySound(DevourerofGodsHead.DeathAnimationSound, player.Center); + SoundOnce = true; - for (int d = 0; d < 60; d++) + Particle pulse = new DirectionalPulseRing(player.Center, Vector2.Zero, Color.Orchid, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 12f, 18); + GeneralParticleHandler.SpawnParticle(pulse); + + for (int i = 0; i <= 15; i++) { - Dust cosmiliteDust = Dust.NewDustDirect(player.position, player.width, player.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 3f); - cosmiliteDust.position += Main.rand.NextVector2Square(-5f, 5f); - cosmiliteDust.velocity *= 0.2f; - cosmiliteDust.scale *= Main.rand.NextFloat(1f, 1.2f); - cosmiliteDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - cosmiliteDust.noGravity = true; - cosmiliteDust.fadeIn = 0.5f; + Dust dust = Dust.NewDustPerfect(player.position, 181, -player.velocity.RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.3f, 0.9f), 0, default, Main.rand.NextFloat(3.1f, 3.9f)); + dust.noGravity = false; } } public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) { + if (SoundEngine.TryGetActiveSound(GSDashSlot, out var Dashsound) && Dashsound.IsPlaying) + Dashsound.Position = player.Center; + + Time++; + Size -= 0.04f; + // Fall way, way, faster than usual. player.maxFallSpeed = 50f; - - for (int m = 0; m < 24; m++) + if (Time < 20) { - Dust cosmiliteDust = Dust.NewDustDirect(new Vector2(player.position.X, player.position.Y + 4f), player.width, player.height - 8, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2.75f); - cosmiliteDust.velocity *= 0.1f; - cosmiliteDust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - cosmiliteDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - cosmiliteDust.noGravity = true; - if (Main.rand.NextBool(2)) - { - cosmiliteDust.fadeIn = 0.5f; - } + Particle jaws = new Jaws(player.Center + player.velocity * 0.5f, player.velocity, Color.Fuchsia, new Vector2(0.8f, 1f), player.velocity.ToRotation() + MathHelper.PiOver2, Size, Size, 2); + GeneralParticleHandler.SpawnParticle(jaws); + Particle jaws2 = new Jaws(player.Center + player.velocity * 0.45f, player.velocity, Color.Aqua, new Vector2(0.8f, 1f), player.velocity.ToRotation() + MathHelper.PiOver2, Size - 0.3f, Size - 0.3f, 2); + GeneralParticleHandler.SpawnParticle(jaws2); + } + + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, Time, true)); + for (int i = 0; i < 9; i++) + { + float offsetRotationAngle = player.velocity.ToRotation() + Time / 20f; + float radius = (30f + (float)Math.Cos(Time / 3f) * 24f) * radiusFactor; + Vector2 dustPosition = player.Center + player.velocity * 0.8f; + dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; + Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(5) ? 181 : 295); + dust.noGravity = true; + dust.velocity = player.velocity * 0.5f; + dust.scale = Main.rand.NextFloat(2.7f, 3.0f); + Dust dust2 = Dust.NewDustPerfect(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) + (player.velocity * 0.5f), Main.rand.NextBool(14) ? 180 : 295, -player.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(2.7f, 3.9f)); + dust2.noGravity = true; + } + + float sparkscale = Size * 1.3f; + Vector2 SparkVelocity1 = player.velocity.RotatedBy(player.direction * -4, default) * 0.08f - player.velocity / 2f; + SparkParticle spark = new SparkParticle(player.Center + player.velocity.RotatedBy(2f * player.direction) * 1.2f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(3) ? Color.Aqua : Color.Fuchsia); + GeneralParticleHandler.SpawnParticle(spark); + Vector2 SparkVelocity2 = player.velocity.RotatedBy(player.direction * 4, default) * 0.08f - player.velocity / 2f; + SparkParticle spark2 = new SparkParticle(player.Center + player.velocity.RotatedBy(-2f * player.direction) * 1.2f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(3) ? Color.Aqua : Color.Fuchsia); + GeneralParticleHandler.SpawnParticle(spark2); + + if (Time > 20 && Time < 100) + { + Particle pulse = new DirectionalPulseRing(player.Center - player.velocity * 0.52f, player.velocity / 1.5f, Color.Fuchsia, new Vector2(1f, 2f), player.velocity.ToRotation(), 0.82f, 0.32f, 60); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse2 = new DirectionalPulseRing(player.Center - player.velocity * 0.40f, player.velocity / 1.5f * 0.9f, Color.Aqua, new Vector2(0.8f, 1.5f), player.velocity.ToRotation(), 0.58f, 0.28f, 50); + GeneralParticleHandler.SpawnParticle(pulse2); + Time = 111; } // Dash at a much, much faster speed than the default value. @@ -71,17 +114,16 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { - SoundEngine.PlaySound(SoundID.Item67, player.Center); - - for (int j = 0; j < 30; j++) + if (SoundOnce) { - Dust cosmiliteDust = Dust.NewDustDirect(player.position, player.width, player.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); - cosmiliteDust.position += Main.rand.NextVector2Square(-20f, 20f); - cosmiliteDust.velocity *= 0.9f; - cosmiliteDust.scale *= Main.rand.NextFloat(1f, 1.4f); - cosmiliteDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - if (Main.rand.NextBool(2)) - cosmiliteDust.scale *= Main.rand.NextFloat(1f, 1.4f); + SoundEngine.PlaySound(DevourerofGodsHead.DeathExplosionSound, player.Center); + SoundOnce = false; + } + + for (int i = 0; i <= 25; i++) + { + Dust dust = Dust.NewDustPerfect(player.position, Main.rand.NextBool(3) ? 226 : 272, player.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.5f), 0, default, Main.rand.NextFloat(2.1f, 2.9f)); + dust.noGravity = false; } float kbFactor = 15f; diff --git a/CalPlayer/Dashes/OrnateShieldDash.cs b/CalPlayer/Dashes/OrnateShieldDash.cs index facaf00b3c..dc6a380965 100644 --- a/CalPlayer/Dashes/OrnateShieldDash.cs +++ b/CalPlayer/Dashes/OrnateShieldDash.cs @@ -22,30 +22,19 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnDashEffects(Player player) { - for (int d = 0; d < 60; d++) - { - Dust iceDashDust = Dust.NewDustDirect(player.position, player.width, player.height, 67, 0f, 0f, 100, default, 1.25f); - iceDashDust.position += Main.rand.NextVector2Square(-5f, 5f); - iceDashDust.velocity *= 0.2f; - iceDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); - iceDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); - iceDashDust.noGravity = true; - iceDashDust.fadeIn = 0.5f; - } + //nothing left, could add a sound or other effect if we want later } public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) { - for (int m = 0; m < 24; m++) + for (int d = 0; d < 3; d++) { - Dust iceDashDust = Dust.NewDustDirect(player.position + Vector2.UnitY * 4f, player.width, player.height - 8, 67, 0f, 0f, 100, default, 1.25f); - iceDashDust.position += Main.rand.NextVector2Square(-5f, 5f); - iceDashDust.velocity *= 0.2f; - iceDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); + Dust iceDashDust = Dust.NewDustPerfect(player.Center + new Vector2 (Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 1.7f), Main.rand.NextBool(8) ? 223 : 180, -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(0.6f, 0.8f)); iceDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); iceDashDust.noGravity = true; - if (Main.rand.NextBool(2)) - iceDashDust.fadeIn = 0.5f; + iceDashDust.fadeIn = 0.5f; + if (iceDashDust.type == 180) + iceDashDust.scale = Main.rand.NextFloat(1.6f, 2.2f); } // Dash at a faster speed than the default value. @@ -71,7 +60,7 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.PlayerImmunityFrames = OrnateShield.ShieldSlamIFrames; hitContext.Damage = (int)player.GetTotalDamage().ApplyTo(50f); - npc.AddBuff(BuffID.Frostburn, 300); + npc.AddBuff(BuffID.Frostburn2, 180); //Great, Frostbite is ACTUALLY called Frostburn 2 } } } diff --git a/CalPlayer/Dashes/StatisVoidSashDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs index 66d92bf4eb..cc496e1705 100644 --- a/CalPlayer/Dashes/StatisVoidSashDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -1,4 +1,5 @@ using CalamityMod.Enums; +using CalamityMod.Particles; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -14,52 +15,43 @@ namespace CalamityMod.CalPlayer.Dashes public override DashCollisionType CollisionType => DashCollisionType.NoCollision; public override bool IsOmnidirectional => false; + public int Time = 0; + public bool AngleSwap = true; public override float CalculateDashSpeed(Player player) => 25.4f; public override void OnDashEffects(Player player) { - for (int d = 0; d < 60; d++) - { - Dust iceDashDust = Dust.NewDustDirect(player.position, player.width, player.height, 33, 0f, 0f, 100, default, 1.25f); - iceDashDust.position += Main.rand.NextVector2Square(-5f, 5f); - iceDashDust.velocity *= 0.2f; - iceDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); - iceDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - iceDashDust.noGravity = true; - iceDashDust.fadeIn = 0.5f; - } + Time = 0; } public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) { - // Spawn dust at the player's feet if they are moving vertically. Otherwise, spawn it around their body. - int dustSpawnHeight = 8; - float dustSpawnTop = player.Bottom.Y - 4f; - if (player.velocity.Y != 0f) + Time++; + if (Time % 3 == 0) { - dustSpawnHeight = 16; - dustSpawnTop = player.Center.Y - 8f; + Vector2 trailPos = player.Center - (player.velocity * 2) + Main.rand.NextVector2Circular(10, 20); + float trailScale = player.velocity.X * player.direction * 0.08f; + Color trailColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid; + Particle Trail = new SparkParticle(trailPos, player.velocity * 0.2f, false, 35, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(Trail); } - Vector2 dustSpawnPosition = new Vector2(player.position.X, dustSpawnTop); - - Dust purpleDashDust = Dust.NewDustDirect(dustSpawnPosition, player.width, dustSpawnHeight, 70, 0f, 0f, 100, default, 1.4f); - purpleDashDust.velocity *= 0.1f; - purpleDashDust.scale *= Main.rand.NextFloat(1f, 1.2f); - purpleDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); // Periodically release scythes. player.Calamity().statisTimer++; if (Main.myPlayer == player.whoAmI && player.Calamity().statisTimer % 5 == 0) { int scytheDamage = (int)player.GetBestClassDamage().ApplyTo(250); - int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, Vector2.Zero, ModContent.ProjectileType(), scytheDamage, 5f, player.whoAmI); + int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, player.velocity.RotatedBy(player.direction * (AngleSwap ? 30 : -30), default) * 0.1f - player.velocity / 2f, ModContent.ProjectileType(), scytheDamage, 5f, player.whoAmI);; if (scythe.WithinBounds(Main.maxProjectiles)) { Main.projectile[scythe].DamageType = DamageClass.Generic; Main.projectile[scythe].usesIDStaticNPCImmunity = true; Main.projectile[scythe].idStaticNPCHitCooldown = 10; } + + AngleSwap = !AngleSwap; + } // Dash at a faster speed than the default value. diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index f75e44e451..6301f27e98 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { - Item.defense = 18; + Item.defense = 20; Item.width = 36; Item.height = 42; Item.value = CalamityGlobalItem.Rarity5BuyPrice; diff --git a/Items/Accessories/Gehenna.cs b/Items/Accessories/Gehenna.cs deleted file mode 100644 index 870a516a8f..0000000000 --- a/Items/Accessories/Gehenna.cs +++ /dev/null @@ -1,79 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class Gehenna : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public const int FireProjectiles = 2; - public const float FireAngleSpread = 120; - public int FireCountdown = 0; - - public override void SetDefaults() - { - Item.width = 26; - Item.height = 26; - Item.value = CalamityGlobalItem.Rarity5BuyPrice; - Item.rare = ItemRarityID.Pink; - Item.accessory = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (FireCountdown == 0) - { - FireCountdown = 600; - } - if (FireCountdown > 0) - { - FireCountdown--; - if (FireCountdown == 0) - { - var source = player.GetSource_Accessory(Item); - if (player.whoAmI == Main.myPlayer) - { - int speed2 = 25; - float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; - float spawnY = -1000 + player.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = player.Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity *= speed2; - for (int i = 0; i < FireProjectiles; i++) - { - Vector2 spawn = baseSpawn; - spawn.X = spawn.X + i * 30 - (FireProjectiles * 15); - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-FireAngleSpread / 2 + (FireAngleSpread * i / FireProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - int damage = (int)player.GetBestClassDamage().ApplyTo(54); - Projectile.NewProjectile(source, spawn.X, spawn.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), damage, 5f, Main.myPlayer, 0f, 0f); - } - } - } - } - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - CalamityUtils.DrawInventoryCustomScale( - spriteBatch, - texture: TextureAssets.Item[Type].Value, - position, - frame, - drawColor, - itemColor, - origin, - scale, - wantedScale: 0.8f, - drawOffset: new(0f, 0f) - ); - return false; - } - } -} diff --git a/Items/Accessories/Gehenna.png b/Items/Accessories/Gehenna.png deleted file mode 100644 index 126a549103..0000000000 Binary files a/Items/Accessories/Gehenna.png and /dev/null differ diff --git a/Items/Accessories/SlagsplitterPauldron.cs b/Items/Accessories/SlagsplitterPauldron.cs new file mode 100644 index 0000000000..5ac8cda9eb --- /dev/null +++ b/Items/Accessories/SlagsplitterPauldron.cs @@ -0,0 +1,45 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class SlagsplitterPauldron : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public override void SetDefaults() + { + Item.width = 46; + Item.height = 52; + Item.value = CalamityGlobalItem.Rarity4BuyPrice; + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.Pauldron = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(12). + AddIngredient(3). + AddIngredient(8). + AddTile(TileID.Anvils). + Register(); + + } + } +} diff --git a/Items/Accessories/SlagsplitterPauldron.png b/Items/Accessories/SlagsplitterPauldron.png new file mode 100644 index 0000000000..4a6485404c Binary files /dev/null and b/Items/Accessories/SlagsplitterPauldron.png differ diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 765722c8d2..b466fbbe5b 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(ItemID.MoltenSkullRose). - AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index e564da1e10..9d20750c5d 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -76,7 +76,6 @@ namespace CalamityMod.Items.TreasureBags { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() })); itemLoot.Add(ModContent.ItemType(), 10); itemLoot.AddRevBagAccessories(); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 8e1998f43f..5c5aecc3bb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -716,9 +716,8 @@ FlameLickedShell: { DisplayName: Flame-Licked Shell Tooltip: ''' - 25% decreased dash velocity - Your dashes are empowered by fire, shredding enemies near you with violent explosions - Grants immunity to lava + Could it be? + OUT OF ORDER 2 ''' } @@ -771,11 +770,6 @@ FungalSymbiote: { ''' } -Gehenna: { - DisplayName: Gehenna - Tooltip: Drops brimstone fireballs from the sky occasionally -} - GiantPearl: { DisplayName: Giant Pearl Tooltip: @@ -2019,4 +2013,13 @@ YharimsInsignia: { All melee attacks inflict Holy Flames Increased melee knockback ''' +} + +SlagsplitterPauldron: { + DisplayName: Slagsplitter Pauldron + Tooltip: + ''' + You gain 5% damage reduction while dashing + Your dashes are empowered by fire, shredding enemies near you with violent explosions + ''' } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 67118e77bf..f21eb8bab3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -131,4 +131,6 @@ BlazingStarHeal.DisplayName: Blazing Star Heal BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal LeviAmberDash.DisplayName: Riptide Slam FlameLickedShellBurst.DisplayName: Flame Slam -FlameLickedShellExplosion.DisplayName: Fire Blast \ No newline at end of file +FlameLickedShellExplosion.DisplayName: Fire Blast +PauldronDash.DisplayName: Pauldron Dash +PauldronExplosion.DisplayName: Pauldron Explosion \ No newline at end of file diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index a4082a556f..f0552e4b87 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -207,7 +207,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental // Equipment int[] accs = new int[] { - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; diff --git a/Particles/Jaws.cs b/Particles/Jaws.cs new file mode 100644 index 0000000000..18af29b3d5 --- /dev/null +++ b/Particles/Jaws.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using static CalamityMod.CalamityUtils; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class Jaws : Particle + { + public override string Texture => "CalamityMod/Particles/Jaws"; + public override bool UseAdditiveBlend => true; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + private float OriginalScale; + private float FinalScale; + private float opacity; + private Vector2 Squish; + private Color BaseColor; + + public Jaws(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime) + { + Position = position; + Velocity = velocity; + BaseColor = color; + OriginalScale = originalScale; + FinalScale = finalScale; + Scale = originalScale; + Lifetime = lifeTime; + Squish = squish; + Rotation = rotation; + } + + public override void Update() + { + float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); + Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress); + + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); + + Color = BaseColor; + Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); + Velocity *= 0.95f; + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D tex = ModContent.Request(Texture).Value; + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0); + } + + } +} diff --git a/Particles/Jaws.png b/Particles/Jaws.png new file mode 100644 index 0000000000..77bdb925f0 Binary files /dev/null and b/Particles/Jaws.png differ diff --git a/Projectiles/Typeless/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs index bbf85638e9..3469e7c19c 100644 --- a/Projectiles/Typeless/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -1,15 +1,20 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Terraria.Graphics.Shaders; + namespace CalamityMod.Projectiles.Typeless { public class HolyExplosionSupreme : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; + public Player Owner => Main.player[Projectile.owner]; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public static readonly SoundStyle Impact = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak1") { Volume = 0.3f }; public override void SetDefaults() { Projectile.width = 60; @@ -25,30 +30,71 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); - Projectile.width = 60; - Projectile.height = 60; - Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); - Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + if (Projectile.ai[0] < 2) { - int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) + SoundEngine.PlaySound(SoundID.Item14, Projectile.position); + Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); + Projectile.width = 60; + Projectile.height = 60; + Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + for (int num621 = 0; num621 < 5; num621++) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Projectile.ai[0] == 1) + Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 10; num623++) + { + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + if (Projectile.ai[0] == 1) + Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + if (Projectile.ai[0] == 1) + Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); } } - for (int num623 = 0; num623 < 10; num623++) + else { - int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; + SoundEngine.PlaySound(Impact with { PitchVariance = 0.3f }, Projectile.position); + SoundEngine.PlaySound(SoundID.Item62 with { Volume = 0.5f, PitchVariance = 0.3f }, Projectile.position); + Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2); + Projectile.width = 60; + Projectile.height = 60; + Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); + for (int num621 = 0; num621 < 8; num621++) + { + int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, Main.rand.NextFloat(1.2f, 1.8f)); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 12; num623++) + { + int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 272, 0f, 0f, 100, default, 0.8f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); + num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 226, 0f, 0f, 100, default, 0.6f); + Main.dust[num624].velocity *= 2f; + Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner); + } } } } diff --git a/Projectiles/Typeless/LeviAmberDash.cs b/Projectiles/Typeless/LeviAmberDash.cs index fa9577fa3e..20ba764833 100644 --- a/Projectiles/Typeless/LeviAmberDash.cs +++ b/Projectiles/Typeless/LeviAmberDash.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Projectiles.Typeless { if (!target.boss) { - target.velocity.Y += -3f; - target.velocity.X += 5f * Owner.direction; + target.velocity.Y += -1.8f; + target.velocity.X += 5.5f * Owner.direction; } target.AddBuff(BuffID.Wet, 300); target.AddBuff(ModContent.BuffType(), 60); diff --git a/Projectiles/Typeless/FlameLickedShellBurst.cs b/Projectiles/Typeless/PauldronDash.cs similarity index 90% rename from Projectiles/Typeless/FlameLickedShellBurst.cs rename to Projectiles/Typeless/PauldronDash.cs index acf9bb556d..96f5fe4b58 100644 --- a/Projectiles/Typeless/FlameLickedShellBurst.cs +++ b/Projectiles/Typeless/PauldronDash.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class FlameLickedShellBurst : ModProjectile, ILocalizedModType + public class PauldronDash : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire3, 180); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.OnFire3, 240); + target.AddBuff(ModContent.BuffType(), 240); SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 0.6f, PitchVariance = 0.4f }, Projectile.Center); for (int i = 0; i <= 8; i++) @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless dust2.noGravity = false; } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 23f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 15f, Projectile.owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); diff --git a/Projectiles/Typeless/FlameLickedShellExplosion.cs b/Projectiles/Typeless/PauldronExplosion.cs similarity index 94% rename from Projectiles/Typeless/FlameLickedShellExplosion.cs rename to Projectiles/Typeless/PauldronExplosion.cs index 454f553441..e3fd808406 100644 --- a/Projectiles/Typeless/FlameLickedShellExplosion.cs +++ b/Projectiles/Typeless/PauldronExplosion.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class FlameLickedShellExplosion : ModProjectile, ILocalizedModType + public class PauldronExplosion : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(BuffID.OnFire3, 240); Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20); GeneralParticleHandler.SpawnParticle(pulse);