diff --git a/Buffs/Summon/FleshTotemBuff.cs b/Buffs/Summon/FleshTotemBuff.cs deleted file mode 100644 index 524cc6f2a1..0000000000 --- a/Buffs/Summon/FleshTotemBuff.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Projectiles.Magic; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class FleshTotemBuff : BaseSummonBuff - { - protected override int MinionProjectileType => ModContent.ProjectileType(); - - protected override ref bool MinionBool => ref BuffModdedOwner.fleshTotem; - } -} diff --git a/Buffs/Summon/FleshTotemBuff.png b/Buffs/Summon/FleshTotemBuff.png deleted file mode 100644 index d99a0b8a19..0000000000 Binary files a/Buffs/Summon/FleshTotemBuff.png and /dev/null differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index cdf0d505c9..7654efd948 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -954,6 +954,7 @@ namespace CalamityMod.CalPlayer public bool shatteredCommunity = false; public bool fleshTotem = false; public bool fleshTotemMinion = false; + public bool fleshTotemVisual = false; public int fleshTotemManaStorage = 0; public bool bloodPact = false; public bool bloodflareCore = false; @@ -1079,6 +1080,7 @@ namespace CalamityMod.CalPlayer public bool moonCrown = false; public int mageCrownTimer = 0; public int mageCrownCount = 0; + public int crownShatterTimer = 0; public bool dragonScales = false; public bool gloveOfPrecision = false; public bool gloveOfRecklessness = false; @@ -2410,6 +2412,7 @@ namespace CalamityMod.CalPlayer stressPills = false; laudanum = false; fleshTotem = false; + fleshTotemVisual = false; fleshTotemMinion = false; bloodPact = false; bloodflareCore = false; @@ -3079,6 +3082,7 @@ namespace CalamityMod.CalPlayer theBeeCooldown = 0; scuttlerCooldown = 0; mageCrownTimer = 0; + crownShatterTimer = 0; wingProjectileCooldown = 0; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; @@ -4768,6 +4772,31 @@ namespace CalamityMod.CalPlayer } #endregion + #region PreItemChecks + public override bool PreItemCheck() + { + //For use when the player runs out of mana. Currently only used for Feather and Moonstone Crown + if (Player.HeldItem.mana > 0 && Player.controlUseItem && Player.itemAnimation == 0) + { + int manaCost = Player.GetManaCost(Player.HeldItem); + if (Player.statMana < manaCost) + { + if (moonCrown) + { + if (mageCrownCount > 0 && crownShatterTimer == 0) + { + mageCrownCount = -5; + mageCrownTimer = 300; + crownShatterTimer = 45; + } + if (mageCrownCount < 0) mageCrownCount = 0; + } + } + } + return true; + } + #endregion + #region PostUpdateEquips public override void PostUpdateEquips() { @@ -6194,7 +6223,7 @@ namespace CalamityMod.CalPlayer life.noGravity = true; } } - + if (modPlayer.fleshTotem) { if (Main.myPlayer == Player.whoAmI) @@ -6207,20 +6236,6 @@ namespace CalamityMod.CalPlayer } } } - //For when the player runs out of mana - if (Player.statMana <= manaConsumed || Player.statMana <= 6) - { - if (moonCrown && mageCrownCount > 0) - { - SoundStyle fire = new("CalamityMod/Sounds/Item/CursedDaggerThrow"); - SoundEngine.PlaySound(fire with { Volume = 0.9f, Pitch = 0.9f, PitchVariance = 0.2f, MaxInstances = -1 }, Player.Center); - mageCrownCount -= 5; - if (mageCrownCount < 0) - { - mageCrownCount = 0; - } - } - } } #endregion diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 648543a232..1c44b9825b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2088,22 +2088,26 @@ namespace CalamityMod.CalPlayer } if (moonCrown) { - int SpawnTimer = 120; int MaxSigils = 9; //Starts at 0, so cap is 10 - if (mageCrownTimer >= SpawnTimer) + if (mageCrownTimer == 0) { if (mageCrownCount <= MaxSigils) { - Main.NewText(mageCrownCount); + SoundEngine.PlaySound(SoundID.Item20, Player.Center); mageCrownCount += 1; float start = 360f / mageCrownCount; Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2((int)(Player.Center.X + (Math.Sin(0 * start) * 300)), (int)(Player.Center.Y + (Math.Cos(0 * start) * 300))), Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI, 0, mageCrownCount); } - mageCrownTimer = 0; + mageCrownTimer = 120; } else if (!Player.dead) { - mageCrownTimer++; + mageCrownTimer--; + if (crownShatterTimer > 0) + { + crownShatterTimer--; + } +; } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index d45858ad40..99f81602ac 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1187,10 +1187,14 @@ namespace CalamityMod.CalPlayer } if (magic) { - if (moonCrown && mageCrownCount >= 10) + if (moonCrown && mageCrownCount == 10) { target.AddBuff(BuffType(), 360); } + if(featherCrown && mageCrownCount == 5) + { + target.AddBuff(BuffID.Frostburn, 180); + } } if (summon) { @@ -1200,6 +1204,7 @@ namespace CalamityMod.CalPlayer if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) { target.AddBuff(BuffType(), 600); + } else if (pSoulArtifact) target.AddBuff(BuffType(), 300); diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index e940d508c5..334d2f6315 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Accessories player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per feather, up to 5% if (modPlayer.mageCrownCount == 5) { - player.manaCost -= 0.05f; player.GetCritChance() += 5; } } diff --git a/Items/Accessories/FleshTotem.cs b/Items/Accessories/FleshTotem.cs index 5222cdea01..5685935916 100644 --- a/Items/Accessories/FleshTotem.cs +++ b/Items/Accessories/FleshTotem.cs @@ -1,9 +1,6 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using CalamityMod.Cooldowns; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,10 +33,6 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { int damage = (int)player.GetTotalDamage().ApplyTo(lostSoulDamage); diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 035395144d..9445a14380 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Accessories { player.manaRegenBonus += 10; } - if (modPlayer.mageCrownCount == 9) + if (modPlayer.mageCrownCount == 10) //I don't know why it's like this { player.GetCritChance() += 10; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 787b1cf861..3a9852bc9d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -626,10 +626,11 @@ namespace CalamityMod.Items //Mana Potion interactions if (item.healMana > 0) { - //If mana potion used, kill - if (modPlayer.moonCrown || modPlayer.featherCrown) + //If mana potion used, kill all active Crown projectiles + if ((modPlayer.moonCrown || modPlayer.featherCrown) && modPlayer.mageCrownCount > 0) { - //modPlayer.mageCrownCount = 0; + modPlayer.mageCrownTimer = 300; + modPlayer.mageCrownCount = 0; } } @@ -1541,7 +1542,7 @@ namespace CalamityMod.Items return false; } - #endregion + #endregion #region On Create private static int cachedForgeID = -1; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index b79acfb13e..8987298478 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -769,8 +769,10 @@ FeatherCrown: { DisplayName: Feather Crown Tooltip: ''' - 15% increased rogue projectile velocity - Stealth strikes cause feathers to fall from the sky on enemy hits + Summons a Skyline Feather every 2 seconds, up to a maximum of 5 + Each Skyline Feather increases magic damage by 2% and decreases mana cost by 1% + With 5 feathers, increases magic critical strike chance by 5% and all magic attacks inflict Frostburn + Running out of mana sheds 3 feathers, drinking a mana potion sheds all feathers ''' } @@ -798,7 +800,7 @@ FleshTotem: { ''' 5% increased magic critical strike chance +30 max mana - Summons an effigy above your head that stores mana as you use it + Summons an effigy above your head that stores mana as you use it, up to 600 mana The effigy occasionally pulses, restoring 30 mana Pulses appear more frequently the more mana is stored Upon being struck, the effigy unleashes all stored up mana as vengeful souls that chase your enemies @@ -1150,9 +1152,9 @@ MoonstoneCrown: { +70 max mana Summons a Lunar Sigil every 2 seconds, up to a maximum of 10 Each Lunar Sigil increases magic damage by 2% and reduces mana cost by 1% - Having 5 sigils increases mana regeneration by +5 MP/s - Having 10 sigils increases magic critical strike chance by 10% and all magic attacks inflict Nightwither - Running out of mana removes 5 sigils + With 5 sigils, increases mana regeneration by +5 MP/s + With 10 sigils, increases magic critical strike chance by 10% and all magic attacks inflict Nightwither + Running out of mana shatters 5 sigils, drinking a mana potion shatters all sigils ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index b15d3e716e..460f796ac8 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -291,3 +291,4 @@ YharimsCrystalPrism.DisplayName: Yermes Christal FleshTotemMinion.DisplayName: Flesh Totem Minion FleshTotemSoul.DisplayName: Flesh Totem Soul SpectralFeather.DisplayName: Spectral Feather +MoonSigil.DisplayName: Moon Sigil diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index d14ff208af..2b9cc5c063 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -176,7 +176,6 @@ MetalShard.DisplayName: Metal Shard MeteorFistProj.DisplayName: Meteor Fist Gud For A Lot Of Shtuff MeteorFistMeteorite.DisplayName: Meteorite REALLY Gud For A Lot Of Shtuff MoltenAmputatorProj.DisplayName: Molten Amputator -MoonSigil.DisplayName: Moon Sigil MycorootProj.DisplayName: Mycoroot MythrilKnifeProjectile.DisplayName: Mythril Knife NanoblackMain.DisplayName: Nanoblack Reaper diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 2425fef8d8..f90b528002 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4054,20 +4054,6 @@ namespace CalamityMod.Projectiles } } } - else if (modPlayer.moonCrown) - { - if (Main.player[projectile.owner].miscCounter % 120 == 0 && projectile.FinalExtraUpdate()) - { - if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) - { - int damage = (int)player.GetTotalDamage().ApplyTo(42); - - int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].DamageType = DamageClass.Generic; - } - } - } if (modPlayer.dragonScales) { diff --git a/Projectiles/Magic/FleshTotemMinion.cs b/Projectiles/Magic/FleshTotemMinion.cs index 106579d284..add718b0bc 100644 --- a/Projectiles/Magic/FleshTotemMinion.cs +++ b/Projectiles/Magic/FleshTotemMinion.cs @@ -11,6 +11,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -21,6 +22,8 @@ namespace CalamityMod.Projectiles.Magic public new string LocalizationCategory => "Projectiles.Magic"; public int pulseTimer = 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 SetDefaults() { Projectile.width = 30; @@ -40,11 +43,13 @@ namespace CalamityMod.Projectiles.Magic bool isActive = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + //If the player takes off the accessory, kill the projectile if (!modPlayer.fleshTotemMinion) { Projectile.active = false; return; } + //Constantly ensure the projectile stays activem unless the player dies if (isActive) { if (player.dead) @@ -57,7 +62,9 @@ namespace CalamityMod.Projectiles.Magic } } Lighting.AddLight(Projectile.Center, 0f, 0.25f, 1.5f); + //The totem hovers above the player's head... Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 85f); + //Unless gravity is flipped, in which case it's below the player and flipped if (player.gravDir == -1f) { Projectile.position.Y += 170f; @@ -67,38 +74,43 @@ namespace CalamityMod.Projectiles.Magic { Projectile.rotation = 0f; } + //Pulses happen every 6 seconds, divided by how much mana the totem has stored int pulseMax = 360; pulseMax = 360 - (modPlayer.fleshTotemManaStorage / 2); - + //Ensure the pulse timer can never go below 1 second if (pulseMax < 60) { pulseMax = 60; } + //When the timer reaches max, pulse and restore 30 mana if (pulseTimer >= pulseMax) { //Main.NewText(pulseMax); - SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center); - for (int k = 0; k < 30; k++) + if (visuals) { - 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)); - dust.noGravity = true; - dust.alpha = Main.rand.Next(70, 90 + 1); - } - if (modPlayer.fleshTotemManaStorage == 600) - { - int Dusts = 8; - float radians = MathHelper.TwoPi / Dusts; - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); - for (int i = 0; i < Dusts; i++) + SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center); + for (int k = 0; k < 30; k++) { - Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i) * 12.5f; - GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center, dustVelocity * 0.7f, false, 12, 0.009f, Color.Cyan, new Vector2(3.5f, 1.3f), true); - GeneralParticleHandler.SpawnParticle(spark); - - Dust dust = Dust.NewDustPerfect(Projectile.Center, 59, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)), 0, default, 0.9f); + 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)); dust.noGravity = true; - Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 59, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)) * 0.4f, 0, default, 1.2f); - dust2.noGravity = true; + dust.alpha = Main.rand.Next(70, 90 + 1); + } + if (modPlayer.fleshTotemManaStorage == 600) + { + int Dusts = 8; + float radians = MathHelper.TwoPi / Dusts; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); + for (int i = 0; i < Dusts; i++) + { + Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i) * 12.5f; + GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center, dustVelocity * 0.7f, false, 12, 0.009f, Color.Cyan, new Vector2(3.5f, 1.3f), true); + GeneralParticleHandler.SpawnParticle(spark); + + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.BlueTorch, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)), 0, default, 0.9f); + dust.noGravity = true; + Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.BlueTorch, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)) * 0.4f, 0, default, 1.2f); + dust2.noGravity = true; + } } } int manaGained = 30; @@ -112,6 +124,14 @@ namespace CalamityMod.Projectiles.Magic } pulseTimer++; } + //Set the player's mana storage to 0 when equipping the accessory + public override void OnSpawn(IEntitySource source) + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.fleshTotemManaStorage = 0; + + } public override bool PreDraw(ref Color lightColor) { Player player = Main.player[Projectile.owner]; @@ -122,25 +142,29 @@ namespace CalamityMod.Projectiles.Magic Vector2 drawPosition = player.Center - Main.screenPosition + Vector2.UnitY * -67f; Vector2 origin = texture.Size() * 0.5f; - float fade = Utils.GetLerpValue(0, modPlayer.fleshTotemManaStorage, FleshTotem.manaStorageMax, true); - for (int i = 0; i < 10; i++) + if (visuals) { - Main.spriteBatch.Draw(texture, drawPosition + Vector2.UnitY * -1.5f, null, Color.Cyan with { A = 0 } * fade, Projectile.rotation, origin, Projectile.scale * (Main.rand.NextFloat(0.0016f, 0.002f) * modPlayer.fleshTotemManaStorage), SpriteEffects.None, 0f); + float fade = Utils.GetLerpValue(0, modPlayer.fleshTotemManaStorage, FleshTotem.manaStorageMax, true); + for (int i = 0; i < 10; i++) + { + Main.spriteBatch.Draw(texture, drawPosition + Vector2.UnitY * -1.5f, null, Color.Cyan with { A = 0 } * fade, Projectile.rotation, origin, Projectile.scale * (Main.rand.NextFloat(0.0016f, 0.002f) * modPlayer.fleshTotemManaStorage), SpriteEffects.None, 0f); + } + for (int i = 0; i < 1; i++) + { + int dustType = Main.rand.NextBool() ? 66 : 247; + float rotMulti = Main.rand.NextFloat(0.3f, 1f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Vector2.UnitY / 75f, dustType); + dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (modPlayer.fleshTotemManaStorage * 0.0009f) - rotMulti * 0.1f; + dust.noGravity = true; + dust.velocity = new Vector2(0, -2).RotatedByRandom(rotMulti * 0.3f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (modPlayer.fleshTotemManaStorage * 0.0009f); + dust.alpha = 1; + 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); } - for (int i = 0; i < 1; i++) - { - int dustType = Main.rand.NextBool() ? 66 : 247; - float rotMulti = Main.rand.NextFloat(0.3f, 1f); - Dust dust = Dust.NewDustPerfect(Projectile.Center + Vector2.UnitY / 75f, dustType); - dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (modPlayer.fleshTotemManaStorage * 0.0009f) - rotMulti * 0.1f; - dust.noGravity = true; - dust.velocity = new Vector2(0, -2).RotatedByRandom(rotMulti * 0.3f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (modPlayer.fleshTotemManaStorage * 0.0009f); - dust.alpha = 1; - dust.color = Color.Cyan; - } - Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); - 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 7bcb48165f..32582c64aa 100644 --- a/Projectiles/Magic/FleshTotemSoul.cs +++ b/Projectiles/Magic/FleshTotemSoul.cs @@ -2,12 +2,9 @@ using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; - using Terraria.ID; using Terraria.ModLoader; -using static CalamityMod.Systems.LavaRenderingSystem; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Magic/MoonSigil.cs similarity index 72% rename from Projectiles/Rogue/MoonSigil.cs rename to Projectiles/Magic/MoonSigil.cs index 902caf23e5..df3a4103aa 100644 --- a/Projectiles/Rogue/MoonSigil.cs +++ b/Projectiles/Magic/MoonSigil.cs @@ -1,24 +1,27 @@ using System; using System.Collections.Generic; using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Mage { public class MoonSigil : ModProjectile, ILocalizedModType { - public new string LocalizationCategory => "Projectiles.Rogue"; + public new string LocalizationCategory => "Projectiles.Mage"; public override void SetDefaults() { Projectile.width = 20; Projectile.height = 20; Projectile.scale = 0.9f; Projectile.friendly = true; - Projectile.penetrate = -1; Projectile.ignoreWater = true; Projectile.timeLeft = 18000; Projectile.penetrate = -1; @@ -33,7 +36,6 @@ namespace CalamityMod.Projectiles.Rogue CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.moonCrown) { - Projectile.active = false; modPlayer.mageCrownCount = 0; return; } @@ -81,7 +83,6 @@ namespace CalamityMod.Projectiles.Rogue if (!Projectile.FinalExtraUpdate()) return; - // Give off some light float lightScalar = Main.rand.NextFloat(0.9f, 1.1f) * Main.essScale; Lighting.AddLight(Projectile.Center, 0.3f * lightScalar, 0.26f * lightScalar, 0.15f * lightScalar); @@ -99,9 +100,27 @@ namespace CalamityMod.Projectiles.Rogue Projectile.spriteDirection = Projectile.direction; } + public override void OnSpawn(IEntitySource source) + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.mageCrownCount == 10) + { + SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact with { Volume = 1.3f }, player.Center); + } + + } public override void OnKill(int timeLeft) { - float dustSp = 0.2f; + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + //Ensures the breaking sound doesn't play when the player removes the accessory + if (modPlayer.moonCrown) + { + SoundEngine.PlaySound(SoundID.DeerclopsIceAttack with { Volume = 0.4f, Pitch = 0.3f, MaxInstances = 1 }, player.Center); + SoundEngine.PlaySound(Exoblade.BeamHitSound with { MaxInstances = 1 }, player.Center); + } + float dustSp = 0.9f; int dustD = 0; for (int i = 0; i < 4; i++) { @@ -112,10 +131,25 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[d].noGravity = true; Main.dust[d].position = Projectile.Center; Main.dust[d].velocity = dustspeed; - dustSp += 0.2f; } dustD += 90; - dustSp = 0.2f; + } + for (int i = 0; i < 4; i++) + { + Color colorAccent = Main.rand.NextBool() ? Color.PaleTurquoise : Color.SeaGreen; + + Dust shatter = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail); + shatter.velocity = Main.rand.NextVector2Circular(4.6f, 4.6f) + Projectile.velocity * 0.5f; + shatter.color = Color.Lerp(Color.Turquoise, colorAccent, Main.rand.NextFloat(0.23f)); + shatter.scale *= 1.1f; + shatter.fadeIn = 0.75f; + shatter.noGravity = true; + } + int shardsplash = 0; + while (shardsplash < 4) + { + GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Projectile.ai[0] == 0.6f ? 0.8f : 0.6f, Projectile.ai[0] == 1 ? Color.Turquoise : Color.LightSeaGreen, true, false)); + shardsplash += 1; } } public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) @@ -133,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.mageCrownCount >= 10) { - for (int i = 0; i < 6; i++) + for (int i = 0; i < 4; i++) { Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, (Color.Teal * 0.5f) with { A = 0 }, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale * 1.1f, SpriteEffects.None, 0f); } diff --git a/Projectiles/Rogue/MoonSigil.png b/Projectiles/Magic/MoonSigil.png similarity index 100% rename from Projectiles/Rogue/MoonSigil.png rename to Projectiles/Magic/MoonSigil.png diff --git a/Projectiles/Magic/SpectralFeather.cs b/Projectiles/Magic/SpectralFeather.cs index b17ceba93f..69b0d472d4 100644 --- a/Projectiles/Magic/SpectralFeather.cs +++ b/Projectiles/Magic/SpectralFeather.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Magic CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.featherCrown) { - Projectile.active = false; modPlayer.mageCrownTimer = 0; modPlayer.mageCrownCount = 0; return;