diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 431d44547b..00e47e524d 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -60,6 +60,7 @@ using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Projectiles.Melee; using CalamityMod.Items.Tools; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses.BrainOfCthulhu; namespace CalamityMod.CalPlayer { @@ -2353,8 +2354,9 @@ namespace CalamityMod.CalPlayer if (fleshTotem && hurtInfo.Damage > 0) { - if (fleshTotemManaStorage >= 100) - SoundEngine.PlaySound(BloodflareHeadRanged.ActivationSound, Player.Center); + SoundStyle Counter = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Shield_Down"); + if (fleshTotemManaStorage >= 100 && fleshTotemVisual) + SoundEngine.PlaySound(Counter with { Volume = 0.75f}, Player.Center); int lostSoulAmount = fleshTotemManaStorage / 25; if (Player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 37436c3066..b317b3fac5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -55,7 +55,6 @@ using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Packets; using CalamityMod.Particles; -using CalamityMod.Projectiles.Mage; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Pets; diff --git a/Items/Accessories/FleshTotem.cs b/Items/Accessories/FleshTotem.cs index 5685935916..0d19323f73 100644 --- a/Items/Accessories/FleshTotem.cs +++ b/Items/Accessories/FleshTotem.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.fleshTotem = true; modPlayer.fleshTotemMinion = true; + modPlayer.fleshTotemVisual = !hideVisual; player.statManaMax2 += 30; player.GetCritChance() += 5; if (player.whoAmI == Main.myPlayer) diff --git a/Projectiles/Magic/FleshTotemMinion.cs b/Projectiles/Magic/FleshTotemMinion.cs index 5263aff461..0b9af6471a 100644 --- a/Projectiles/Magic/FleshTotemMinion.cs +++ b/Projectiles/Magic/FleshTotemMinion.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic //Main.NewText(pulseMax); if (visuals) { - SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center); + SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound with { Volume = 0.65f }, Projectile.Center); for (int k = 0; k < 30; k++) { Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.IceTorch, new Vector2(9, 9).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.5f, 0.8f), 0, Color.LightSkyBlue, Main.rand.NextFloat(1.2f, 1.4f)); @@ -163,10 +163,10 @@ namespace CalamityMod.Projectiles.Magic dust.color = Color.Cyan; } Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); - //When at max, draw glowing eyes on the totem - if (modPlayer.fleshTotemManaStorage == 600) - Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } + //When at max, draw glowing eyes on the totem + if (modPlayer.fleshTotemManaStorage == 600) + Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; } public override bool? CanDamage() => false; diff --git a/Projectiles/Magic/FleshTotemSoul.cs b/Projectiles/Magic/FleshTotemSoul.cs index 32582c64aa..5efaa323c3 100644 --- a/Projectiles/Magic/FleshTotemSoul.cs +++ b/Projectiles/Magic/FleshTotemSoul.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Projectiles/Rogue/PhantasmalSoulBlue"; public ref float Time => ref Projectile.ai[0]; public float dustRotation = 0; + public Player Owner => Main.player[Projectile.owner]; + public bool visuals => Owner.Calamity().fleshTotemVisual; // Enables/disables visuals and sounds based on accessory visibility public override void SetStaticDefaults() { @@ -53,18 +55,18 @@ namespace CalamityMod.Projectiles.Magic float squash = Utils.GetLerpValue(1, 3, Projectile.velocity.Length(), true); if (squash > 0.15f) { - Particle fadeInfx = new CustomSpark(Projectile.Center, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f * Projectile.scale, Color.SkyBlue * 0.4f * squash, new Vector2(1 - 0.15f * squash, 1f), true, false, shrinkSpeed: 0.3f * squash); + Particle fadeInfx = new CustomSpark(Projectile.Center, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f * Projectile.scale, Color.SkyBlue * 0.4f * squash, new Vector2(1 - 0.15f * squash, 1f), true, false, shrinkSpeed: 0.1f * squash); GeneralParticleHandler.SpawnParticle(fadeInfx); } Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), Color.SkyBlue, 3, Main.rand.NextFloat(0.25f, 0.3f), 1f, Main.rand.NextFloat(-0.2f, 0.2f), false); GeneralParticleHandler.SpawnParticle(smoke); - if (Time > 5) + if (Time > 5 && visuals) { for (int i = 0; i < 3; i++) { dustRotation += 0.12f; Vector2 dustPos = Projectile.Center + (MathHelper.Pi + dustRotation + MathHelper.PiOver2).ToRotationVector2() * 10f * Projectile.scale; - Dust dust = Dust.NewDustPerfect(dustPos, 175, (MathHelper.Pi + dustRotation * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 2); + Dust dust = Dust.NewDustPerfect(dustPos, DustID.SpectreStaff, (MathHelper.Pi + dustRotation * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 2); dust.noGravity = false; dust.scale = Main.rand.NextFloat(0.75f, 1.2f); dust.alpha = Main.rand.Next(100, 170 + 1); @@ -91,12 +93,15 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { - for (int i = 0; i < 2; i++) + if (visuals) { - Vector2 sparkVel = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(24f)) * Main.rand.NextFloat(6f, 10f); - Color color = Main.hslToRgb(Main.rand.NextFloat(0.3f, 0.5f), 1f, 0.8f); - SparkParticle spark = new(Projectile.Center, sparkVel, false, 30, 1.3f, color); - GeneralParticleHandler.SpawnParticle(spark); + for (int i = 0; i < 2; i++) + { + Vector2 sparkVel = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(24f)) * Main.rand.NextFloat(6f, 10f); + Color color = Main.hslToRgb(Main.rand.NextFloat(0.3f, 0.5f), 1f, 0.8f); + SparkParticle spark = new(Projectile.Center, sparkVel, false, 30, 1.3f, color); + GeneralParticleHandler.SpawnParticle(spark); + } } } } diff --git a/Projectiles/Magic/MoonSigil.cs b/Projectiles/Magic/MoonSigil.cs index df3a4103aa..baf115d44b 100644 --- a/Projectiles/Magic/MoonSigil.cs +++ b/Projectiles/Magic/MoonSigil.cs @@ -11,11 +11,11 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Mage +namespace CalamityMod.Projectiles.Magic { public class MoonSigil : ModProjectile, ILocalizedModType { - public new string LocalizationCategory => "Projectiles.Mage"; + public new string LocalizationCategory => "Projectiles.Magic"; public override void SetDefaults() { Projectile.width = 20;