diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c1821d50b0..5774da0dd5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -287,13 +287,13 @@ namespace CalamityMod.CalPlayer { 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) { + int damage = (int)Player.GetBestClassDamage().ApplyTo(170); Player.endurance += 0.1f; 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); - int damage = (int)Player.GetBestClassDamage().ApplyTo(67); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 16f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Player.whoAmI); HasReducedDashFirstFrame = true; } float numberOfDusts = 10f; @@ -319,8 +319,7 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 6 == 0 && Player.velocity != Vector2.Zero) { - int damage = (int)Player.GetBestClassDamage().ApplyTo(170); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 10f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Player.whoAmI); } } else diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 1c875563b2..32b0722200 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged internal static readonly int ChargeLoopSoundFrames = 151; public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot"); public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot"); + public static readonly SoundStyle BigShot2 = new("CalamityMod/Sounds/Item/OntologicalDespoilerLargeShot"); public static readonly SoundStyle SmallImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1"); public static readonly SoundStyle LargeImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2"); diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index af88025aeb..ee3f0273a3 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -14,10 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public int SetUseTime = 6; - public int SetUseAnimation = 6; public int ShotNumber = 0; public bool Happy = false; + public float fireSpeed = 1; public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/PolarisShot") { Volume = 0.6f }; public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f }; @@ -31,11 +30,11 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 38; Item.height = 34; - Item.damage = 46; + Item.damage = 35; Item.DamageType = DamageClass.Ranged; - Item.useTime = SetUseTime; - Item.useAnimation = SetUseAnimation; + Item.useTime = 9; + Item.useAnimation = 9; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -48,7 +47,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 10f; } public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 2; // Max of 2 shots on screen at once, get closer to fire faster public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -116,17 +114,6 @@ namespace CalamityMod.Items.Weapons.Ranged } else { - if (Happy) // If she's happy, fire much faster - { - Item.useTime = (int)(SetUseTime * 0.5f); - Item.useAnimation = (int)(SetUseAnimation * 0.5f); - } - else // Otherwise reset usetime - { - Item.useTime = SetUseTime; - Item.useAnimation = SetUseAnimation; - } - if (Main.zenithWorld) // 1% chance to get tired when firing a projectile { if (Happy && Main.rand.NextBool(100)) @@ -141,7 +128,8 @@ namespace CalamityMod.Items.Weapons.Ranged else SoundEngine.PlaySound(Shot, player.Center); - Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ShotNumber); + for (int i = 0; i < (Happy ? 3 : 1); i++) + Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ShotNumber); if (ShotNumber >= 2) // Cycle the shot color ShotNumber = 0; @@ -150,5 +138,11 @@ namespace CalamityMod.Items.Weapons.Ranged } return false; } + public override float UseSpeedMultiplier(Player player) + { + NPC target = player.Center.ClosestNPCAt(400); + fireSpeed = (target == null ? 1 : Utils.Remap(Utils.Distance(player.Center, target.Center), 100, 400, 2, 1, true)); + return (Happy ? fireSpeed * 2 : fireSpeed); + } } } diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index 3ed5d4cfe3..2c5775d3a2 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -74,9 +74,6 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { - // Always fires Radiant Arrows regardless of ammo used - //type = Item.shoot; - // The arrow appears from a random location "on the bow". // They are also moved backwards so that they have some time to build up past positions. This helps make them not appear out of thin air. @@ -95,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Ranged SoundEngine.PlaySound(sound with { Volume = 0.25f, Pitch = Main.rand.NextFloat(-0.3f, -0.8f), MaxInstances = -1 }, player.Center); type = Item.shoot; } - Projectile.NewProjectile(source, position, velocity, type, (isHolyArrow ? (int)(damage * 1.2f) : damage), knockback, player.whoAmI); + Projectile.NewProjectile(source, (isHolyArrow || shots % 2 == 0) ? position : player.Center + velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90)) * Main.rand.NextFloat(-15, 15), velocity, type, (isHolyArrow ? (int)(damage * 1.2f) : damage), knockback, player.whoAmI); shots++; return false; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 0404d71005..3a50314d1d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -954,14 +954,14 @@ PolarisParrotfish: { Tooltip: "[GFB]" TooltipNormal: ''' - Rapidly fires an array of colorful star shots that bounce off tiles - However, only two shots can exist at once + Rapidly fires an array of colorful star shots + Firing speed increases the closer you are to an enemy 'It carries the mark of the Northern Star' ''' TooltipGFB: ''' - Rapidly fires an array of colorful star shots that bounce off tiles - However, only two shots can exist at once + Rapidly fires an array of colorful star shots + Firing speed increases the closer you are to an enemy Right click to give the little girl some attention 'She is a happy girl' ''' diff --git a/Particles/BloomArrow.png b/Particles/BloomArrow.png new file mode 100644 index 0000000000..dea3f50fd1 Binary files /dev/null and b/Particles/BloomArrow.png differ diff --git a/Projectiles/Melee/EarthMeteor.cs b/Projectiles/Melee/EarthMeteor.cs index 3c69d6b0a9..9efca6eb0a 100644 --- a/Projectiles/Melee/EarthMeteor.cs +++ b/Projectiles/Melee/EarthMeteor.cs @@ -11,6 +11,7 @@ using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework.Graphics; using CalamityMod.Particles; using Terraria.Graphics.Renderers; +using CalamityMod.Dusts; namespace CalamityMod.Projectiles.Melee { @@ -89,6 +90,14 @@ namespace CalamityMod.Projectiles.Melee } if (time == fallTime) { + for (int i = 0; i < 2; i++) + { + Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), 0, 0.8f, 0f, 27); + GeneralParticleHandler.SpawnParticle(bloom); + } + Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), 0, 0.65f, 0f, 27); + GeneralParticleHandler.SpawnParticle(bloom3); + Projectile.extraUpdates = 15; Vector2 mouse = Owner.ClampedMouseWorld(); @@ -121,10 +130,10 @@ namespace CalamityMod.Projectiles.Melee float randSize = Main.rand.NextFloat(0.8f, 1.2f); for (int i = 0; i < 2; i++) { - Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * Utils.Remap(time, 0, fallTime, 0, 0.65f), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 3), Utils.Remap(time, fallTime * 0.7f, fallTime, 1, 2)), 0, 0.8f * randSize, 0f, 3); + Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * (float)Math.Pow(Utils.Remap(time, 0, fallTime, 0f, 1f), 3), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 4), Utils.Remap(time, fallTime * 0.6f, fallTime, 1, 4)), 0, 0.8f * randSize, 0f, 3); GeneralParticleHandler.SpawnParticle(bloom); } - Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * Utils.Remap(time, 0, fallTime, 0f, 0.65f), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 3), Utils.Remap(time, fallTime * 0.7f, fallTime, 1, 2)), 0, 0.65f * randSize, 0f, 3); + Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * (float)Math.Pow(Utils.Remap(time, 0, fallTime, 0f, 1f), 3), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 4), Utils.Remap(time, fallTime * 0.6f, fallTime, 1, 4)), 0, 0.65f * randSize, 0f, 3); GeneralParticleHandler.SpawnParticle(bloom3); } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index c22e9af064..71efd6a9d1 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -400,14 +400,14 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 4; i++) { Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 278); - Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2().RotatedBy(starAngle) * 8f; + Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2().RotatedBy(starAngle) * 4f; - Particle pulse = new GlowSparkParticle(target.Center, vel, false, 12, 0.1f, Color.Orange, new Vector2(3.2f, 0.9f), true, true, 0.85f); + Particle pulse = new CustomSpark(target.Center, vel, "CalamityMod/Particles/BloomCircle", false, 12, 1.2f, Color.Orange, new Vector2(3.2f, 0.9f), true, true, shrinkSpeed: 0.95f); GeneralParticleHandler.SpawnParticle(pulse); } for (int i = 0; i < 4; i++) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -13).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI); } } } diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 10d9c66588..fd51d02d91 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -125,7 +125,11 @@ namespace CalamityMod.Projectiles.Melee dust.color = Color.Goldenrod; dust.noLightEmittence = true; } - Projectile.velocity *= 0.965f; + + if (Projectile.velocity.Length() > 8) + Projectile.velocity *= 0.88f; + else + Projectile.velocity *= 0.965f; } Projectile.frameCounter++; diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index 52d673fc7d..aa7d906b6b 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -51,14 +52,15 @@ namespace CalamityMod.Projectiles.Ranged if (splitShot) { + Projectile.scale = 0.01f; Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.15f); - if (Main.rand.NextBool(4)) + if (Main.rand.NextBool(9)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.65f, 0.85f); - dust.noLight = true; + dust.scale = Main.rand.NextFloat(0.35f, 0.85f); dust.noLightEmittence = true; + dust.color = Color.Lerp(Color.Red, Color.Crimson, Main.rand.NextFloat(0.3f, 0.8f)); } } else @@ -66,17 +68,17 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.3f); if (Time > 4f && Main.rand.NextBool(3)) { - float velMulti = Main.rand.NextFloat(0.1f, 0.75f); - Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti); + float velMulti = Main.rand.NextFloat(0.05f, 0.35f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType(), -Projectile.velocity.RotatedBy(0.45) * velMulti); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.45f, 0.75f); - dust.noLight = true; + dust.color = Color.Crimson; dust.noLightEmittence = true; - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType(), -Projectile.velocity.RotatedBy(-0.45) * velMulti); dust2.noGravity = true; dust2.scale = Main.rand.NextFloat(0.45f, 0.75f); - dust2.noLight = true; dust2.noLightEmittence = true; + dust2.color = Color.Crimson; } } } @@ -91,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < Dusts; i++) { Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i).RotatedBy(0.5f) * 6.5f; - Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f),Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-1, 1), true); + Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f), Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-0.3f, 0.3f), true); GeneralParticleHandler.SpawnParticle(smoke); } SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center); @@ -101,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 3; b++) { - Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-3.5f, -3f); + Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-5.5f, -4.5f); Projectile shrapnel = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.06f), 0f, Projectile.owner, ai2: 1f); shrapnel.timeLeft = 300; shrapnel.arrow = false; @@ -116,24 +118,21 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (splitShot) - { - target.AddBuff(ModContent.BuffType(), 180); - } + target.AddBuff(ModContent.BuffType(), splitShot ? 180 : 90); } public override bool PreDraw(ref Color lightColor) { if (splitShot) { - Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLine").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson * 0.3f, 1, texture); + Texture2D texture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson with { A = 0 } * 0.6f, 1, texture, true, true); return false; } else { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value; + Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLineBloom").Value; if (Time > 6f) - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White * 0.3f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson with { A = 0 } * 0.4f, 1, texture, true, true); return true; } } diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 11cf611ac4..5bf58ceb15 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -1,7 +1,9 @@ using System; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +16,8 @@ namespace CalamityMod.Projectiles.Ranged public float dustAngle = 0f; public bool growing = false; public bool dustWave = false; - public float variance; + public float variance = 0.8f; + public Vector2 lastPos; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 10; @@ -41,12 +44,13 @@ namespace CalamityMod.Projectiles.Ranged Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); - variance = Main.rand.NextFloat(0.3f, 1.7f); if (currentColor == Color.Black) { + variance = Main.rand.NextFloat(0.7f, 1f); dustWave = Main.rand.NextBool(); Projectile.scale = 1.5f; Projectile.velocity *= 0.3f; + lastPos = Projectile.velocity; switch (Main.rand.Next(0, 4 +1)) { case 4: // Yellow shot @@ -77,14 +81,22 @@ namespace CalamityMod.Projectiles.Ranged dustAngle += (growing ? 0.07f * variance : -0.07f * variance); Projectile.localAI[0] += 1f; + Vector2 orbPos = Projectile.Center + (Projectile.velocity.RotatedBy((dustWave ? 1 : -1) * dustAngle) * 4.5f - Projectile.velocity * 5); if (Projectile.localAI[0] > 12f && targetDist < 1200f) { - GlowOrbParticle orb = new GlowOrbParticle((Projectile.Center + Projectile.velocity.RotatedBy((dustWave ? 1 : -1) * dustAngle) * 4.5f) - Projectile.velocity * 5, Vector2.Zero, false, 5, 0.55f + MathF.Abs(dustAngle * 0.5f), currentColor, true, true); + CustomSpark orb = new CustomSpark(orbPos, Utils.DirectionTo(lastPos, orbPos), "CalamityMod/Particles/BloomCircle", false, 5, (0.55f + MathF.Abs(dustAngle * 0.65f)) * 0.2f, currentColor, new Vector2(1 + MathF.Abs(dustAngle * 0.6f), 1), true, true, 0, false, false, 0.8f - MathF.Abs(dustAngle * 0.7f), 0.7f, 0.8f); GeneralParticleHandler.SpawnParticle(orb); - PointParticle spark = new PointParticle(Projectile.Center + Projectile.velocity * 3.5f, Projectile.velocity, false, 2, 0.6f, currentColor); - GeneralParticleHandler.SpawnParticle(spark); + if (Main.rand.NextBool(7)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Projectile.velocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.3f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.5f, 0.8f); + dust.color = currentColor; + dust.noLightEmittence = true; + } } + lastPos = orbPos; } // This projectile is always fullbright. @@ -108,7 +120,8 @@ namespace CalamityMod.Projectiles.Ranged { for (int b = 0; b < 3; b++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -oldVelocity.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); + Vector2 vel = (-oldVelocity.SafeNormalize(Vector2.UnitX) * 5); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); } } return true; @@ -129,7 +142,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int b = 0; b < 3; b++) { - Vector2 velocity = Projectile.velocity.RotatedByRandom(0.5f); + Vector2 velocity = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5).RotatedByRandom(0.5f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 2f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); } } @@ -137,13 +150,14 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ShadowboltWallHit") with { Volume = 0.25f, Pitch = Main.rand.NextFloat(0.6f, 1f), MaxInstances = -1 }, Projectile.Center); for (int b = 0; b < 4; b++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 66, new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.7f, 1.4f); dust.color = currentColor; - dust.fadeIn = 0; + dust.noLightEmittence = true; } } } diff --git a/Projectiles/Ranged/HyperiusSplit.cs b/Projectiles/Ranged/HyperiusSplit.cs index 5c8111fc06..a6605021e9 100644 --- a/Projectiles/Ranged/HyperiusSplit.cs +++ b/Projectiles/Ranged/HyperiusSplit.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localAI[0]++; if (currentColor == Color.Black) { - Projectile.scale = 0.025f; + Projectile.scale = 0.015f; Projectile.alpha = 255; rotDirection = Main.rand.NextBool() ? 1 : -1; rotIntensity = Main.rand.NextFloat(0.5f, 1.5f); @@ -87,13 +87,6 @@ namespace CalamityMod.Projectiles.Ranged { for (int b = 0; b < 2; b++) { - /* - Dust dust = Dust.NewDustPerfect(Projectile.Center, 66, new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.5f, 1.1f); - dust.color = currentColor; - dust.fadeIn = 0; - */ GlowOrbParticle orb = new GlowOrbParticle(Projectile.Center, new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f), false, 5, Main.rand.NextFloat(0.35f, 0.45f), currentColor, true, true); GeneralParticleHandler.SpawnParticle(orb); } @@ -101,12 +94,9 @@ namespace CalamityMod.Projectiles.Ranged public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 12, targetHitbox); public override bool PreDraw(ref Color lightColor) { - Texture2D texture = ModContent.Request("CalamityMod/Particles/LargeBloom").Value; - Texture2D texture2 = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D texture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(currentColor, Color.White, 0.15f), 1, texture); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White with { A = 0 }, 1, texture2); - //Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, Projectile.scale * 1.5f, 0, 0f); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(currentColor, Color.White, 0.15f) with { A = 0 }, 1, texture, true, true); return false; } public override bool? CanDamage() => Projectile.localAI[0] < 20 ? false : null; diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs index 94fa8fc921..d00b251c19 100644 --- a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs +++ b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged public int MaxLoadableShots = 23; public float BulletSpeed = 6.5f; public SlotId OntologicalChargeSlot; + public SlotId OntologicalChargeSlotDeep; public int Time = 0; public ref float CurrentChargingFrames => ref Projectile.ai[0]; @@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Ranged if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying) ChargeSound.Position = Projectile.Center; + if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound6) && ChargeSound6.IsPlaying) + ChargeSound6.Position = Projectile.Center; if (Owner.shirtColor != Color.White) { @@ -188,6 +191,8 @@ namespace CalamityMod.Projectiles.Ranged if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound3)) ChargeSound3?.Stop(); + if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound4)) + ChargeSound4?.Stop(); KeepRefreshingLifetime = false; @@ -203,18 +208,20 @@ namespace CalamityMod.Projectiles.Ranged Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; int charge2DamagePos = Projectile.damage; // Most of the damage comes from the explosion - int charge2DamageNeg = Projectile.damage * 28; + int charge2DamageNeg = Projectile.damage * 40; // Big charge time? Check. No pierce? Check. 40x damage? Yes! if (Positive) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 2.5f, ModContent.ProjectileType(), charge2DamagePos, Projectile.knockBack, Projectile.owner); + SoundEngine.PlaySound(OntologicalDespoiler.BigShot, Projectile.Center); } else { Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 0.6f, ModContent.ProjectileType(), charge2DamageNeg, Projectile.knockBack * 3, Projectile.owner); Owner.Calamity().GeneralScreenShakePower = 12f; + SoundEngine.PlaySound(OntologicalDespoiler.BigShot2 with { Pitch = 0.2f }, Projectile.Center); + SoundEngine.PlaySound(OntologicalDespoiler.BigShot with { Pitch = -0.3f }, Projectile.Center); } - SoundEngine.PlaySound(OntologicalDespoiler.BigShot, Projectile.position); // Setting stats for the flash visual effect so it doesn't stick to the gun flashPos = GunTipPosition + Projectile.velocity * 90; @@ -271,7 +278,9 @@ namespace CalamityMod.Projectiles.Ranged } } - SoundEngine.PlaySound(OntologicalDespoiler.SmallShot, Projectile.position); + SoundEngine.PlaySound(OntologicalDespoiler.SmallShot with { Pitch = Positive ? 0 : -0.2f, MaxInstances = Positive ? 1 : -1, Volume = Positive ? 1 : 0.5f }, Projectile.Center); + if (!Positive) + SoundEngine.PlaySound(MagnaCannon.Fire with { Pitch = 0.3f, Volume = 0.5f }, Projectile.Center); for (int i = 0; i < 3; i++) { Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, !Positive ? (Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType()) : ModContent.DustType(), shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.3f, 2.3f)); @@ -296,7 +305,7 @@ namespace CalamityMod.Projectiles.Ranged if (ChargeLV1) ShotsLoaded = MaxLoadableShots; - CurrentChargingFrames += ((ChargeLV1 && !Positive) ? 1f : 2) * (Owner.Calamity().despoilerNerf ? 0.4f : 1); // Charges slower if nerfed, charge LV2 for Negative is slower + CurrentChargingFrames += ((ChargeLV1 && !Positive) ? 0.5f : 2) * (Owner.Calamity().despoilerNerf ? 0.4f : 1); // Charges slower if nerfed, charge LV2 for Negative is slower // Sounds if (!hasBegunFiring) @@ -308,6 +317,14 @@ namespace CalamityMod.Projectiles.Ranged } else OntologicalChargeSlot = SoundEngine.PlaySound(OntologicalDespoiler.ChargeLoop with { Volume = 0.01f, Pitch = 0f, IsLooped = true }, Projectile.Center); + + if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound5)) + { + ChargeSound5.Volume = Positive ? 0 : Utils.Remap(CurrentChargingFrames, Charge1Frames, Charge2Frames, 0, 1.8f, true) * 100; + ChargeSound5.Pitch = Utils.Remap(CurrentChargingFrames, Charge2Frames * 0.9f, Charge2Frames, 1f, (CurrentChargingFrames >= Charge2Frames ? -0.1f : 0.2f), true); + } + else + OntologicalChargeSlotDeep = SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MagnaCannonChargeLoop") with { Volume = 0.01f, Pitch = 0f, IsLooped = true }, Projectile.Center); } // Charge-up visuals @@ -400,6 +417,8 @@ namespace CalamityMod.Projectiles.Ranged { if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound)) ChargeSound?.Stop(); + if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound2)) + ChargeSound2?.Stop(); } public Color GetRandomColor() { diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index 90bebbef82..dc37463dd1 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -189,8 +189,8 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(orb2); } } - SoundStyle fire = OntologicalDespoiler.SmallImpact; - SoundEngine.PlaySound(fire with { Volume = (!Positive ? 1 : 0.7f), Pitch = Main.rand.NextFloat(0, 0.1f) * (!Positive ? 3 : 1) }, Projectile.Center); + SoundStyle fire = Positive ? new SoundStyle("CalamityMod/Sounds/Item/OntologicalDespoilerSmallImpact") : OntologicalDespoiler.SmallImpact; // Yes these are two different sounds... + SoundEngine.PlaySound(fire with { Volume = (!Positive ? 1 : 0.3f), Pitch = Main.rand.NextFloat(0.05f, 0.15f) * (!Positive ? 3 : 5), MaxInstances = !Positive ? 1 : 6 }, Projectile.Center); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index fd0109446f..6490f6fa34 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -29,11 +29,12 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.penetrate = -1; // Only hits once, "pierces" so that it can last a bit after hitting Projectile.extraUpdates = 2; - Projectile.timeLeft = 40; + Projectile.timeLeft = 60; Projectile.DamageType = DamageClass.Ranged; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.tileCollide = true; + Projectile.ArmorPenetration = 15; } public override void AI() @@ -84,15 +85,15 @@ namespace CalamityMod.Projectiles.Ranged dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.01f, 0.045f); } - if (Projectile.timeLeft % 2 == 0 && Time > 4 && DoSlowdown) // Particle trail + if (Time > 4 && DoSlowdown) // Particle trail { - PointParticle spark = new PointParticle(Projectile.Center - Projectile.velocity * 1f, -Projectile.velocity * 0.01f, false, 7, 2f, EffectsColor * 0.6f); + Particle spark = new CustomSpark(Projectile.Center - Projectile.velocity * 3f, -Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomLineFade", false, 6, 0.04f, EffectsColor * 0.8f, new Vector2(0.8f, 1), shrinkSpeed: 0.4f); GeneralParticleHandler.SpawnParticle(spark); } if (Projectile.timeLeft <= 2 && DoSlowdown) { - Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close + Projectile.timeLeft = 7; Projectile.velocity = Vector2.Zero; DoSlowdown = false; } @@ -109,7 +110,7 @@ namespace CalamityMod.Projectiles.Ranged { if (DoSlowdown) { - Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close + Projectile.timeLeft = 7; Projectile.velocity = Vector2.Zero; DoSlowdown = false; } @@ -123,8 +124,10 @@ namespace CalamityMod.Projectiles.Ranged for (int k = 0; k < points; k++) { Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f); - PointParticle spark = new PointParticle((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, false, 13, 1.2f, EffectsColor); - GeneralParticleHandler.SpawnParticle(spark); + //PointParticle spark = new PointParticle((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, false, 13, 1.2f, EffectsColor); + //GeneralParticleHandler.SpawnParticle(spark); + Particle spark3 = new CustomSpark((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, "CalamityMod/Particles/BloomLineFade", false, 13, 0.02f, EffectsColor * 0.8f, new Vector2(2.8f, 1), shrinkSpeed: 0.5f); + GeneralParticleHandler.SpawnParticle(spark3); } } public override bool? CanDamage() => Projectile.numHits > 1 ? false : null; diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 7067bd665a..706edd98ed 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -1,9 +1,11 @@ -using CalamityMod.Particles; +using System; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.GameContent.Animations.IL_Actions.Sprites; namespace CalamityMod.Projectiles.Ranged { @@ -22,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = -1; Projectile.timeLeft = 35; - Projectile.extraUpdates = 8; + Projectile.extraUpdates = 80; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; @@ -35,9 +37,10 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.ai[0] == 0) { Projectile.damage = (int)(Projectile.damage * 0.3f); - Projectile.velocity *= 0.25f; - LineParticle spark = new LineParticle(Projectile.Center + Projectile.velocity * 4, Projectile.velocity * 4.95f, false, 9, 2.4f, Color.LimeGreen); - GeneralParticleHandler.SpawnParticle(spark); + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5; + + Particle orb2 = new CustomSpark(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 86, Projectile.velocity * 0.1f, "CalamityMod/Particles/BloomArrow", false, 9, 0.7f, Main.rand.NextBool() ? Color.LimeGreen : Color.Lime, new Vector2(0.5f, 4f), true, true, shrinkSpeed: Main.rand.NextFloat(0.1f, 0.3f), glowCenterScale: 0.95f, glowOpacity: 0.8f); + GeneralParticleHandler.SpawnParticle(orb2); } Projectile.ai[0]++; @@ -51,6 +54,8 @@ namespace CalamityMod.Projectiles.Ranged Vector2 vel1 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(0.015f, 0.04f)); Vector2 vel2 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(-0.015f, -0.04f)); + Particle sparker = new CustomSpark(Projectile.Center, Projectile.velocity.RotatedByRandom(0.9f) * 0.01f, "CalamityMod/Particles/FullStar", false, 10, Main.rand.NextFloat(0.8f, 1.1f) * (hitDirect ? 4 : 2), Color.LimeGreen, new Vector2(1f, 0.5f), true, true, shrinkSpeed: 1f, glowCenterScale: 0.8f, glowOpacity: 0.8f); + GeneralParticleHandler.SpawnParticle(sparker); Projectile split1 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel1 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); Projectile split2 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel2 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); if (Projectile.Calamity().conditionalHomingRange > 0f) // Allows the split arrows to home when using Arterial Assault as well @@ -58,16 +63,11 @@ namespace CalamityMod.Projectiles.Ranged split1.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange; split2.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange; } - - PointParticle spark = new PointParticle(Projectile.Center - Projectile.velocity + Projectile.velocity.RotatedBy(2.3f), Projectile.velocity.RotatedBy(2.3f) * 0.5f, false, 5, 1.1f, Color.LimeGreen); - GeneralParticleHandler.SpawnParticle(spark); - PointParticle spark2 = new PointParticle(Projectile.Center - Projectile.velocity + Projectile.velocity.RotatedBy(-2.3f), Projectile.velocity.RotatedBy(-2.3f) * 0.5f, false, 5, 1.1f, Color.LimeGreen); - GeneralParticleHandler.SpawnParticle(spark2); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.timeLeft <= 4) + if (Projectile.timeLeft <= 6) { hitDirect = true; SoundEngine.PlaySound(SoundID.Item53 with { Pitch = 0.9f, Volume = 0.4f }, Projectile.Center); diff --git a/Projectiles/Ranged/SproutingArrowSplit.cs b/Projectiles/Ranged/SproutingArrowSplit.cs index 94009910e9..12b56377b0 100644 --- a/Projectiles/Ranged/SproutingArrowSplit.cs +++ b/Projectiles/Ranged/SproutingArrowSplit.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.25f); if (Projectile.alpha > 0) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 264, Projectile.velocity.RotatedByRandom(0.4) * Main.rand.NextFloat(0.05f, 0.3f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 264, Projectile.velocity.RotatedByRandom(0.6) * Main.rand.NextFloat(0.05f, 1.5f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.8f, 1.3f); dust.color = Main.rand.NextBool(3) ? Color.MediumAquamarine : Color.Lime; diff --git a/Projectiles/Typeless/ArtifactOfResilienceShards.cs b/Projectiles/Typeless/ArtifactOfResilienceShards.cs index dd74b76ed3..7e75dadd3c 100644 --- a/Projectiles/Typeless/ArtifactOfResilienceShards.cs +++ b/Projectiles/Typeless/ArtifactOfResilienceShards.cs @@ -135,7 +135,8 @@ namespace CalamityMod.Projectiles.Typeless int projNum = Owner.ownedProjectileCounts[ModContent.ProjectileType()] - 4; Projectile.velocity = ((MathHelper.TwoPi * Projectile.ai[2] / projNum).ToRotationVector2()) * 15 * speedMult; - + Owner.Calamity().GeneralScreenShakePower = 5f; + if (Projectile.ai[2] == 1) { SoundStyle boom = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianShieldDeactivate"); diff --git a/Projectiles/Typeless/PauldronDash.cs b/Projectiles/Typeless/PauldronDash.cs index 04613c3e65..31a4099d5a 100644 --- a/Projectiles/Typeless/PauldronDash.cs +++ b/Projectiles/Typeless/PauldronDash.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -35,29 +36,53 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff(BuffID.OnFire3, 240); target.AddBuff(ModContent.BuffType(), 300); - SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 0.6f, PitchVariance = 0.4f }, Projectile.Center); - for (int i = 0; i <= 8; i++) + SoundStyle sound = new("CalamityMod/Sounds/Item/HolyColliderProjectileHit"); + SoundEngine.PlaySound(sound with { Volume = 0.4f, Pitch = 0.15f }, Projectile.Center); + SoundStyle sound2 = new("CalamityMod/Sounds/Item/MagicRockImpact"); + SoundEngine.PlaySound(sound2 with { Volume = 0.6f, Pitch = 0.35f }, Projectile.Center); + + for (int i = 0; i <= 12; i++) { - Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); - dust.noGravity = false; - } - for (int i = 0; i <= 5; i++) - { - Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); + float variance = Main.rand.NextFloat(-0.7f, 0.7f); + int dustStyle = ModContent.DustType(); + Dust dust2 = Dust.NewDustPerfect(target.Center, dustStyle, Projectile.velocity); + dust2.scale = (Main.rand.NextFloat(1.1f, 1.3f) - Math.Abs(variance)) * 2.5f; + dust2.velocity = (Vector2.UnitY * -18).RotatedBy(variance) * Main.rand.NextFloat(0.7f, 1f) * (1 - Math.Abs(variance) * 1.3f); + dust2.color = Main.rand.NextBool() ? Color.Orange : Color.OrangeRed; dust2.noGravity = false; + + Particle spark = new SparkParticle(Projectile.Center, new Vector2(17, 17).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 1f), true, 55, 0.85f, Main.rand.NextBool() ? Color.Orange : Color.OrangeRed); + GeneralParticleHandler.SpawnParticle(spark); + } + float baseRot = Main.rand.NextFloat(-9f, 9f); + for (int i = 0; i < 5; i++) + { + float rot = Main.rand.NextFloat(-0.3f, 0.3f); + for (int b = 0; b < 2; b++) + { + Vector2 pulseVel = new Vector2(0, Main.rand.NextFloat(-7, -9)).RotatedBy(i * (MathHelper.ToRadians(360f) / 5)).RotatedBy(rot + baseRot + 0.9f); + Particle orb = new CustomPulse(target.Center, pulseVel, (Main.rand.NextBool() ? Color.Orange : Color.OrangeRed) * 0.9f, "CalamityMod/Projectiles/Summon/RustyBeaconPulse", Vector2.One, pulseVel.ToRotation(), 0.2f, Main.rand.NextFloat(0.55f, 0.85f) * 3f, Main.rand.Next(14, 19 + 1)); + GeneralParticleHandler.SpawnParticle(orb); + } + Particle orb2 = new CustomSpark(target.Center, new Vector2(0, -7).RotatedBy(i * (MathHelper.ToRadians(360f) / 5)).RotatedBy(rot + baseRot), "CalamityMod/Particles/BloomLineFade", false, 13, 0.095f, Main.rand.NextBool() ? Color.Orange : Color.OrangeRed, new Vector2(2.9f, 0.5f), shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(orb2); } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 15f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 0, Projectile.owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); public override bool? CanDamage() => base.CanDamage(); public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.HitDirectionOverride = Math.Sign(Owner.direction); + Owner.Calamity().GeneralScreenShakePower = 4f; + for (int i = 0; i < 2; i++) + { + Particle bloom = new CustomSpark(target.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 20, 1.2f, Color.OrangeRed, new Vector2(1, 1), true, true, glowCenterScale: 0.7f, glowOpacity: 0.8f); + GeneralParticleHandler.SpawnParticle(bloom); + } } - public override bool? CanCutTiles() => false; } } diff --git a/Projectiles/Typeless/PauldronExplosion.cs b/Projectiles/Typeless/PauldronExplosion.cs index e3fd808406..ee33729569 100644 --- a/Projectiles/Typeless/PauldronExplosion.cs +++ b/Projectiles/Typeless/PauldronExplosion.cs @@ -30,24 +30,28 @@ namespace CalamityMod.Projectiles.Typeless Projectile.timeLeft = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { 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); - Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20); - GeneralParticleHandler.SpawnParticle(pulse2); + //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); + //Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20); + //GeneralParticleHandler.SpawnParticle(pulse2); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); public override bool? CanDamage() => base.CanDamage(); public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.HitDirectionOverride = Math.Sign(Owner.direction); + if (target.CanBeMoved(true)) + { + // Custom knockback + Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 15; + target.velocity = launchVel * (target.knockBackResist == 0 ? 0.5f : 1f); + } } public override bool? CanCutTiles() => false; diff --git a/Sounds/Item/OntologicalDespoilerLargeShot.ogg b/Sounds/Item/OntologicalDespoilerLargeShot.ogg new file mode 100644 index 0000000000..38c32efc6e Binary files /dev/null and b/Sounds/Item/OntologicalDespoilerLargeShot.ogg differ diff --git a/Sounds/Item/OntologicalDespoilerSmallImpact.ogg b/Sounds/Item/OntologicalDespoilerSmallImpact.ogg new file mode 100644 index 0000000000..108ddd8332 Binary files /dev/null and b/Sounds/Item/OntologicalDespoilerSmallImpact.ogg differ