diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index e8d05be133..9135f782d7 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -126,11 +126,11 @@ internal static readonly float LifeStealRecoveryRate_Classic = 0.6f; internal static readonly float LifeStealRecoveryRate_Expert = 0.5f; - // Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s) - internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f; + // Nerfs the life steal recovery rate in Classic from 0.6 to 0.15 (36 HP/s to 9 HP/s) + internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.45f; - // Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s) - internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f; + // Nerfs the life steal recovery rate in Expert from 0.5 to 0.1 (30 HP/s to 6 HP/s) + internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.4f; #endregion #region Rogue Base Stats diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 9b1f59e913..816051bcf7 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -156,11 +156,13 @@ namespace CalamityMod.Buffs } } + if (type == BuffID.Frozen) + { + npc.Calamity().frozen = true; + } if (type == BuffID.Webbed) { npc.Calamity().webbed = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } if (type == BuffID.Electrified) { diff --git a/Buffs/DamageOverTime/Bane.cs b/Buffs/DamageOverTime/Bane.cs new file mode 100644 index 0000000000..c429af3dda --- /dev/null +++ b/Buffs/DamageOverTime/Bane.cs @@ -0,0 +1,118 @@ +using System; +using CalamityMod.DataStructures; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class Bane : ModBuff + { + public static Color baneColor1 = new Color(217, 115, 0); + public static Color baneColor2 = new Color(0, 232, 146); + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + NPCLifeRegenMethod = BaneNPCLifeRegen + }; + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; + } + public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + bool effected = (cnpc.abaddonEffected || cnpc.apollyonEffected); + bool strong = cnpc.apollyonEffected; + int baseDoTValue = (int)debuffData.EnemyLostRegen; + if (effected) + { + foreach (var player in Main.ActivePlayers) + { + { + float improvedDamage = baseDoTValue * player.Calamity().playerBaneDebuffDamage; + if (improvedDamage > baseDoTValue && (player.Calamity().abaddon || player.Calamity().apollyon)) + { + baseDoTValue = (int)improvedDamage; + } + } + } + } + cnpc.ApplyDPSDebuff(baseDoTValue, baseDoTValue / 20, ref npc.lifeRegen, ref damage); + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().bane = true; + } + + public override void Update(NPC npc, ref int buffIndex) + { + npc.Calamity().bane = true; + } + + internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) + { + Player player = drawInfo.drawPlayer; + Vector3 light = baneColor1.ToVector3(); + Lighting.AddLight(player.Center, light); + + float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); + if (Main.rand.NextBool(20)) + { + bool start = !Main.rand.NextBool(4); + Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * (Main.rand.NextBool(5) ? 2 : 1) + player.velocity * 0.35f; + Vector2 banePos = player.Center + Main.rand.NextVector2Circular(3, 8) + (Vector2.UnitY * 14) + Vector2.UnitY * ((1 - sine) * 2.3f); + Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f, start ? baneColor1 : baneColor2, start ? baneColor2 : baneColor1, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1)); + GeneralParticleHandler.SpawnParticle(baneRunes); + if (Main.rand.NextBool()) + baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; + } + } + + internal static void DrawEffects(NPC npc, ref Color drawColor) + { + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomRingAngled").Value; + Texture2D center = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Vector2 drawPosition = npc.Center - Main.screenPosition; + Color color = baneColor1; + Color color2 = baneColor2; + float maxSizeMult = 10f; + float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult, false), 0.8f); + float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi); + float sine2 = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 11.0f) / MathHelper.Pi); + float randSize = Main.rand.NextFloat(0.82f, 1.08f); + + float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * 60) % 120)), 5)); + + for (int i = 0; i < 2; i++) + { + float sizeMult = (i == 0 ? 1 : 0.8f); + float colorMult = (i == 0 ? 1 : 0.7f); + Main.EntitySpriteDraw(bloom, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine) * 2.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color2, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, bloom.Size() / 2, new Vector2((sine * 0.09f + 1.2f) * widthMult, 0.9f) * 0.18f * MathF.Pow(randSize, 0.3f) * npc.Calamity().baneVisual, SpriteEffects.None); + Main.EntitySpriteDraw(center, drawPosition + (Vector2.UnitY * npc.height / 2f) + Vector2.UnitY * ((1 - sine2) * 3.3f * MathF.Pow(widthMult, 0.55f)), null, Color.Lerp(color, Color.White, i * 0.7f) with { A = 0 } * colorMult, 0, center.Size() / 2, new Vector2((sine2 * 0.09f + 1.2f) * widthMult, 0.6f) * 0.18f * randSize * npc.Calamity().baneVisual, SpriteEffects.None); + } + + int chance = (int)(13 + 40 * (1 - npc.Calamity().baneVisual)); + if (Main.rand.NextBool(chance)) + { + bool start = !Main.rand.NextBool(4); + Vector2 baneVel = Vector2.UnitY * Main.rand.NextFloat(-0.5f, -1.5f) * widthMult * (Main.rand.NextBool(5) ? 2 : 1) + npc.velocity * 0.35f; + Vector2 banePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult, 8) + (Vector2.UnitY * npc.height / 3f) + Vector2.UnitY * ((1 - sine) * 2.3f); + Particle baneRunes = new BaneParticle(banePos, baneVel, false, 55, 1f * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color, Vector2.One, true, Main.rand.NextBool(3) ? Main.rand.NextFloat(-0.2f, 0.2f) : 0, 0.95f, MathHelper.PiOver2 * Main.rand.Next(4 + 1), sineRate: Main.rand.NextFloat(0.2f, 1f), sineIntensity: Main.rand.Next(14, 19 + 1) * widthMult); + GeneralParticleHandler.SpawnParticle(baneRunes); + if (Main.rand.NextBool()) + baneRunes.DrawLayer = Enums.GeneralDrawLayer.BeforeNPCs; + } + Lighting.AddLight(npc.Center, color.ToVector3() * 0.6f); + } + } +} diff --git a/Projectiles/Rogue/LanceofDestiny.png b/Buffs/DamageOverTime/Bane.png similarity index 77% rename from Projectiles/Rogue/LanceofDestiny.png rename to Buffs/DamageOverTime/Bane.png index 72395d8fa7..f793baae8e 100644 Binary files a/Projectiles/Rogue/LanceofDestiny.png and b/Buffs/DamageOverTime/Bane.png differ diff --git a/Buffs/DamageOverTime/DemonicFlames.cs b/Buffs/DamageOverTime/DemonicFlames.cs index 7f6827f0bb..8e8fd369a5 100644 --- a/Buffs/DamageOverTime/DemonicFlames.cs +++ b/Buffs/DamageOverTime/DemonicFlames.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Buffs.DamageOverTime { EnemyLostRegen = 60, //Unused in the method, this is the amount of DoT from Forbidden Oathblade demon flames HeatDebuffScaling = 1, //Unused in the method, but kept so other things can know this is a heat debuff - NPCLifeRegenMethod = DemonFlamesNPCLifeRegen + NPCLifeRegenMethod = DemonicFlamesNPCLifeRegen }; - public static void DemonFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + public static void DemonicFlamesNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) { - int baseDemonicFlamesDoTValue = (int)Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage); + int baseDemonicFlamesDoTValue = (int)Math.Max(Math.Max(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(npc.Calamity().demonicFlamesBonusDamage), npc.Calamity().demonicFlamesBonusDamage), (int)debuffData.EnemyLostRegen); npc.Calamity().ApplyDPSDebuff(baseDemonicFlamesDoTValue, baseDemonicFlamesDoTValue / 15, ref npc.lifeRegen, ref damage); } public override void SetStaticDefaults() @@ -30,7 +30,6 @@ namespace CalamityMod.Buffs.DamageOverTime Main.buffNoSave[Type] = true; BuffID.Sets.LongerExpertDebuff[Type] = true; BuffDatasets.DebuffDataset[Type] = debuffData; - } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/DamageOverTime/HadopelagicPressure.cs b/Buffs/DamageOverTime/HadopelagicPressure.cs index 7cde6908ed..6cc7804326 100644 --- a/Buffs/DamageOverTime/HadopelagicPressure.cs +++ b/Buffs/DamageOverTime/HadopelagicPressure.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 400, + EnemyLostRegen = 350, //175 dps WaterDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index 27cbd603f0..5065122406 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -1,4 +1,5 @@ using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Summon; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,8 +18,17 @@ namespace CalamityMod.Buffs.DamageOverTime public static float ViridVanguardPoisonMultiplier => 2; public static void SagePoisonPower(NPC npc, int buffType, ref int buffIndex, ref int damage) { - // The base DoT is multiplied by the amount of Viral Sprouts you have when applied - // See SageNeedle.cs for details + int viralCount = 0; + int viridCount = 0; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + viralCount++; + if (item.type == ModContent.ProjectileType()) + viridCount++; + } + if ((viralCount + viridCount) <= 0) + return; //Reduce power of weakness/resistances but leave sickness debuff boosters at full power //We first need to apply Irradiated as that isn't included in SicknessDebuffMultiplier due to needing to dynamically update if Irradiated is applied @@ -39,8 +49,9 @@ namespace CalamityMod.Buffs.DamageOverTime multiplier *= NewResistanceEffectiveness; //Apply the DOT - int baseSagePoisonDoTValue = (int)multiplier.ApplyTo(npc.Calamity().sagePoisonDamage); - npc.Calamity().ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 5, ref npc.lifeRegen, ref damage); + float SagePoisonRegen = (viralCount + ViridVanguardPoisonMultiplier * viridCount) * debuffData.EnemyLostRegen; + int totalDoT = (int)multiplier.ApplyTo(SagePoisonRegen); + npc.Calamity().ApplyDPSDebuff(totalDoT, totalDoT/(2*(viridCount+viralCount)), ref npc.lifeRegen, ref damage); } public override void SetStaticDefaults() { diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index de47a1c423..6b893d8bc9 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.DataStructures; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles; @@ -19,7 +20,10 @@ namespace CalamityMod.Buffs.DamageOverTime // This deals 600 DPS per stack, is boosted by ranged stats and can supercrit. internal static int BaseDamage = 120; internal static int FramesPerDamageTick = 12; - + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = BaseDamage + }; public override void SetStaticDefaults() { Main.debuff[Type] = true; diff --git a/Buffs/DamageOverTime/SulphuricPoisoning.cs b/Buffs/DamageOverTime/SulphuricPoisoning.cs index 79c6a49b58..614e9f0c56 100644 --- a/Buffs/DamageOverTime/SulphuricPoisoning.cs +++ b/Buffs/DamageOverTime/SulphuricPoisoning.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 240, + EnemyLostRegen = 350, //175 dps SicknessDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index cfeafcdb55..e7eb641700 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 3996, //6x the tick size + EnemyLostRegen = 2664, //4x the tick size HeatDebuffScaling = 1, MinimumDamageTickSize = 666, //Vhex should always have ticks of 666 MultiplierDamageTickSize = 0 @@ -41,9 +41,6 @@ namespace CalamityMod.Buffs.DamageOverTime cgn.trueVulnerabilityHex = true; if (cgn.VulnerabilityHexFireDrawer != null) cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex]; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0) - cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - } internal static void DrawEffects(NPC npc, ref Color drawColor) diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index e10223020b..87e8b8d1b7 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -34,8 +34,6 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().vaporfied = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/VermillionFlux.cs b/Buffs/DamageOverTime/VermillionFlux.cs index ab64762903..8e4f03ccc0 100644 --- a/Buffs/DamageOverTime/VermillionFlux.cs +++ b/Buffs/DamageOverTime/VermillionFlux.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData(DebuffData.DebuffBehavior.Electric) { - EnemyLostRegen = 100, + EnemyLostRegen = 75, //150 dps when moving, 37.5 dps when stationary ElectricDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/Voidfrost.cs b/Buffs/DamageOverTime/Voidfrost.cs index 22f0ebda79..37280063fa 100644 --- a/Buffs/DamageOverTime/Voidfrost.cs +++ b/Buffs/DamageOverTime/Voidfrost.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 400, + EnemyLostRegen = 500, //250 dps is extra strong for its tier due to being difficult to inflict ColdDebuffScaling = 1 }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index fcde0194fb..d1275f89ae 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -46,10 +46,6 @@ namespace CalamityMod.Buffs.DamageOverTime // Set the remaining time of the fire drawer to be exactly right. if (cgn.VulnerabilityHexFireDrawer != null) cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex]; - - // Apply immunity timer. - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0) - cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + +npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) { diff --git a/Buffs/StatBuffs/ChiBuff.cs b/Buffs/StatBuffs/ChiBuff.cs index d1c94aef0d..1465a83301 100644 --- a/Buffs/StatBuffs/ChiBuff.cs +++ b/Buffs/StatBuffs/ChiBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs @@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.endurance += 0.08f; + player.endurance += TrinketofChi.ChiBuffDamageReductionBoost; } } } diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index 0ae91c9625..53a0e6b247 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Buffs.StatBuffs public override void SetStaticDefaults() { - Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; } diff --git a/Buffs/StatBuffs/SmashedEvil.cs b/Buffs/StatBuffs/SmashedEvil.cs new file mode 100644 index 0000000000..9991a19dad --- /dev/null +++ b/Buffs/StatBuffs/SmashedEvil.cs @@ -0,0 +1,64 @@ +using System; +using CalamityMod.DataStructures; +using CalamityMod.Items.Accessories; +using Terraria; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class SmashedEvil : ModBuff + { + public static DebuffData debuffData = new DebuffData() + { + EnemyLostRegen = 40, + SicknessDebuffScaling = 1, + HeatDebuffScaling = 1, + ColdDebuffScaling = 1, + ElectricDebuffScaling = 1, + WaterDebuffScaling = 1, + NPCLifeRegenMethod = SmashedEvilNPCRegen + + }; + + public static void SmashedEvilNPCRegen(NPC npc, int buffType, ref int buffIndex, ref int damage) + { + var cnpc = npc.Calamity(); + float totalDPS = debuffData.EnemyLostRegen; + + var heat = cnpc.ActiveHeatDebuffMultiplier; + var cold = cnpc.ActiveColdDebuffMultiplier; + var sick = cnpc.ActiveSicknessDebuffMultiplier; + var elec = cnpc.ActiveElectricDebuffMultiplier; + var water = cnpc.ActiveWaterDebuffMultiplier; + StatModifier totalScaling = + DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveHeatDebuffMultiplier, debuffData.HeatDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveColdDebuffMultiplier, debuffData.ColdDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveSicknessDebuffMultiplier, debuffData.SicknessDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveWaterDebuffMultiplier, debuffData.WaterDebuffScaling) + .CombineWith(DebuffData.ForceModifierPositiveWithScaling(cnpc.ActiveElectricDebuffMultiplier, debuffData.ElectricDebuffScaling) + )))); + totalDPS = totalScaling.ApplyTo(totalDPS); + var totalDPSAdjusted = totalDPS - debuffData.EnemyVanillaRegenToCancelOut; + npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize), ref npc.lifeRegen, ref damage); + } + public override void SetStaticDefaults() + { + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; + } + + public override void Update(Player player, ref int buffIndex) + { + player.lifeRegenTime += 2; + player.GetDamage() += 0.1f; + player.moveSpeed += 0.2f; + } + + public override void Update(NPC npc, ref int buffIndex) + { + } + } +} diff --git a/Buffs/StatBuffs/SmashedEvil.png b/Buffs/StatBuffs/SmashedEvil.png new file mode 100644 index 0000000000..a75b74f944 Binary files /dev/null and b/Buffs/StatBuffs/SmashedEvil.png differ diff --git a/Buffs/StatDebuffs/Eutrophication.cs b/Buffs/StatDebuffs/Eutrophication.cs index eca32f09f7..0074bd591e 100644 --- a/Buffs/StatDebuffs/Eutrophication.cs +++ b/Buffs/StatDebuffs/Eutrophication.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().eutrophication = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 018e738c30..512476ef2d 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.DataStructures; +using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; @@ -14,13 +15,17 @@ namespace CalamityMod.Buffs.StatDebuffs Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } + // Purely to make it get electric color in tooltips + public static DebuffData debuffData = new DebuffData() + { + ElectricDebuffScaling = 1 + }; public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().galvanicCorrosion = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs deleted file mode 100644 index dc312681fa..0000000000 --- a/Buffs/StatDebuffs/GlacialState.cs +++ /dev/null @@ -1,28 +0,0 @@ -using CalamityMod.NPCs; -using CalamityMod.Systems.Collections; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatDebuffs -{ - public class GlacialState : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = true; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - BuffID.Sets.LongerExpertDebuff[Type] = true; - } - - public override void Update(NPC npc, ref int buffIndex) - { - npc.Calamity().glacialState = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; - } - } -} diff --git a/Buffs/StatDebuffs/GlacialState.png b/Buffs/StatDebuffs/GlacialState.png deleted file mode 100644 index 9513cc9d37..0000000000 Binary files a/Buffs/StatDebuffs/GlacialState.png and /dev/null differ diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index 943fefca48..cb132c8399 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -17,8 +17,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().temporalSadness = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/StatDebuffs/TimeDistortion.cs b/Buffs/StatDebuffs/TimeDistortion.cs index 3f84b4677e..bd6dd3e8a1 100644 --- a/Buffs/StatDebuffs/TimeDistortion.cs +++ b/Buffs/StatDebuffs/TimeDistortion.cs @@ -19,8 +19,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().timeDistortion = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/Summon/DemonshadeSetDevilBuff.cs b/Buffs/Summon/DemonshadeSetDevilBuff.cs deleted file mode 100644 index b9c589fc3a..0000000000 --- a/Buffs/Summon/DemonshadeSetDevilBuff.cs +++ /dev/null @@ -1,12 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class DemonshadeSetDevilBuff : BaseSummonBuff - { - protected override int MinionProjectileType => ModContent.ProjectileType(); - - protected override ref bool MinionBool => ref BuffModdedOwner.rDevil; - } -} diff --git a/Buffs/Summon/DemonshadeSetDevilBuff.png b/Buffs/Summon/DemonshadeSetDevilBuff.png deleted file mode 100644 index 2bf486ac3e..0000000000 Binary files a/Buffs/Summon/DemonshadeSetDevilBuff.png and /dev/null differ diff --git a/Buffs/Summon/VoidConcentrationBuff.cs b/Buffs/Summon/VoidConcentrationBuff.cs index 21e2ca5ce2..4e1c27ecbf 100644 --- a/Buffs/Summon/VoidConcentrationBuff.cs +++ b/Buffs/Summon/VoidConcentrationBuff.cs @@ -1,34 +1,14 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class VoidConcentrationBuff : ModBuff + public class VoidConcentrationBuff : BaseSummonBuff { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - //Main.persistentBuff[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer mp = player.Calamity(); - int count = player.ownedProjectileCounts[ModContent.ProjectileType()]; - player.GetDamage() += 0.05f; //5% - mp.voidConcentrationAura = true; - if (!mp.voidAuraDamage && count == 0) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } + protected override ref bool MinionBool => ref BuffModdedOwner.VoidConcentrationStaff; + protected override int MinionProjectileType => ModContent.ProjectileType(); } } diff --git a/Buffs/Summon/WulfrumDroidBuff.png b/Buffs/Summon/WulfrumDroidBuff.png index bec3e3f78c..d64a5b4b9b 100644 Binary files a/Buffs/Summon/WulfrumDroidBuff.png and b/Buffs/Summon/WulfrumDroidBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3a005c1529..fd8c49ad3f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -132,6 +132,7 @@ namespace CalamityMod.CalPlayer /// If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. public bool noLifeRegen = false; public float ammoCost = 1f; + public float partialLifeRegen = 0f; public float healingPotionMultiplier = 1f; /// /// Tracks whether or not the player is currently holding Gael's Greatsword.
@@ -311,6 +312,7 @@ namespace CalamityMod.CalPlayer #endregion #region Timer and Counter + public float partialLifeRegenCounter = 0f; public int gaelSwipes = 0; public int arsenalCooldown = 0; public int killModeCooldown = 0; @@ -326,15 +328,6 @@ namespace CalamityMod.CalPlayer public int deadSunCounter = 6; public int DragonsBreathAudioCooldown = 0; public int DragonsBreathAudioCooldown2 = 0; - public int darklightEnergy = 0; - public int darklightEnergyTimer = 0; - public bool darklightEnergyPaused = false; - public bool darklightEnergyMaxFXPlayed = false; - private int lucreciaParticleTimer = 0; - public int elementalMastery = 0; - public int elementalMasteryTimer = 0; - public bool elementalMasteryPaused = false; - public bool elementalMasterySFXPlayed = false; public float unstableCastersGauntletVis = 0; public int unstableCastersGauntletVisTimer = 0; public int PhotoAudioCooldown = 0; @@ -343,11 +336,6 @@ namespace CalamityMod.CalPlayer public int arpeggioCooldown = 0; /// Cooldown variable which prevents using Burning Sea during its "burn-out" mechanic. public int burningSeaBurnOut = 0; - /// - /// How many stacks of Evil Smasher's boost the player has. This increases the weapon's damage, use speed, and knockback.
- /// Getting hit decreases this by 1. Switching to a different item resets this to 0. - ///
- public int evilSmasherBoost = 0; /// Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. public int plagueTaintedSMGDroneCooldown = 0; /// Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. @@ -375,6 +363,9 @@ namespace CalamityMod.CalPlayer public int amputatorBuff = 0; /// Variable used to track the current fuel amount for Pristine Fury's right-click. public int furyFuel = 1800; + /// Variable to track the healing over time gained from Grand Dad. + public int grandDadHealPool = 0; + public int grandDadHealTimer = 0; public const int FuryFuelMax = 1800; public float furyRefuelTimer = 0; /// Variable used to track if Auger can do its big slash attack. @@ -454,6 +445,9 @@ namespace CalamityMod.CalPlayer public int consecutiveCaughtFish = 0; public float WeakTimeFreezeUseTimer = 0; public bool WeakTimeFreezeInUse = false; + + public int DemonAltarDialogueCounter = 0; + public int DemonAltarDialogueCooldown = 0; #endregion #region Sound @@ -722,8 +716,8 @@ namespace CalamityMod.CalPlayer public bool drawnAnyShieldThisFrame = false; // TODO -- Some way to show the player their total shield points. - public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability; - public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0); + public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability + (Starshield > 0 ? StratusStarburst : 0); + public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0) + (Starshield > 0 ? 100 : 0); public int RoverDriveShieldDurability = 0; public int LunicCorpsShieldDurability = 0; @@ -810,6 +804,7 @@ namespace CalamityMod.CalPlayer #region Accessory public bool shieldOfTheHighRulerDashVelocityBoosted = false; + public bool yharimsGift = false; public bool luxorsGift = false; public bool luxorHit = false; public bool luxorsGiftVanity = false; @@ -910,12 +905,16 @@ namespace CalamityMod.CalPlayer public bool lAmbergrisVisual = false; public bool tortShell = false; public bool absorber = false; + /// + /// Used for detetcing life regen hindering debuffs + /// + bool _hasNoNaturalRegen = false; public bool hadLifeRegenHinderingDebuff = false; public bool alwaysHoneyRegen = false; public float alwaysHoneyRegenAmount = 0; public bool honeyTurboRegen = false; - public bool honeyDewHalveDebuffs = false; - public bool livingDewHalveDebuffs = false; + public bool honeyDew = false; + public bool livingDew = false; public int jewelBonusDefense = 0; /// /// Counter variable for spawning Toxic Heart's pulses.
@@ -929,8 +928,6 @@ namespace CalamityMod.CalPlayer public float pulseRate = 1; public bool aAmpoule = false; public bool rOoze = false; - public float radiantOozeRegen = 0; - public float purityRegen = 0; public bool fBarrier = false; public bool aBrain = false; public bool amalgam = false; @@ -951,8 +948,12 @@ namespace CalamityMod.CalPlayer public bool seraphTracers = false; public bool frostFlare = false; public bool evolution = false; - public bool procDodgeEffects = true; + public bool v8Engine = false; + public bool v8000Engine = false; + public bool v8EngineFXPlayed = false; + public bool procDodgeEffects = false; public bool nanotech = false; + public int nanotechHitCooldown = 0; public bool deadshotBrooch = false; public bool shadowMinions = false; public bool holyMinions = false; @@ -960,6 +961,9 @@ namespace CalamityMod.CalPlayer public bool toxicHeart = false; public bool toxicHeartVisuals = false; public bool abaddon = false; + public int abaddonCooldown = 0; + public bool abaddonEffectVisual = false; + public float playerBaneDebuffDamage = 0; public bool aeroStone = false; public bool lifejelly = false; @@ -970,6 +974,9 @@ namespace CalamityMod.CalPlayer public bool community = false; 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; public int bloodflareCoreRemainingHealOverTime = 0; @@ -987,7 +994,6 @@ namespace CalamityMod.CalPlayer public bool purity = false; /// If true, reduces the damage of electricity debuffs by 50%. public bool eleResist = false; - public int PurityHealSlowdownFrames = 0; public bool harpyRing = false; public bool angelTreads = false; /// Makes Flesh Knuckles and its upgrades increase the player's max health. @@ -1032,7 +1038,7 @@ namespace CalamityMod.CalPlayer public bool IsFirstDashFrame = true; public int fallingBootVelCheckTimer = 0; public bool voidOfCalamity = false; - public bool voidOfExtinction = false; + public bool apollyon = false; public bool eArtifact = false; public bool dArtifact = false; public bool auricSArtifact = false; @@ -1092,7 +1098,9 @@ namespace CalamityMod.CalPlayer public bool eclipseMirror = false; public bool featherCrown = false; public bool moonCrown = false; - public int rogueCrownCooldown = 0; + public bool mageCrownVisibility = false; + public int mageCrownTimer = 0; + public int mageCrownCount = 0; public bool dragonScales = false; public bool gloveOfPrecision = false; public bool gloveOfRecklessness = false; @@ -1107,6 +1115,7 @@ namespace CalamityMod.CalPlayer public int spectralVeilImmunity = 0; /// Check for if the player has Plagued Fuel Pack OR Blunder Booster equipped. public bool hasJetpack = false; + public bool hasEngineDash = false; public bool plaguedFuelPack = false; public bool blunderBooster = false; public bool blunderBoosterVisibility = true; @@ -1269,7 +1278,6 @@ namespace CalamityMod.CalPlayer public int tailFrame = 0; public bool astralStarRain = false; public int astralStarRainCooldown = 0; - public int AbaddonCooldown = 0; public int VoidCooldown = 0; public int ursaSergeantCooldown = 0; public int AlchFlaskCooldown = 0; @@ -1277,6 +1285,7 @@ namespace CalamityMod.CalPlayer public bool plaguebringerPatronSet = false; public bool plaguebringerCarapace = false; public float ataxiaDmg; + public float hydroHealTimer = 0; public bool ataxiaMage = false; public bool ataxiaGeyser = false; public float xerocDmg; @@ -1308,8 +1317,6 @@ namespace CalamityMod.CalPlayer public bool daedalusCrystal = false; /// Hydrothermic armor's summoner set bonus minion. public bool chaosSpirit = false; - /// Demonshade armor's set bonus minion. - public bool redDevil = false; public bool GemTechSet = false; /// Calamity's Cobalt armor set bonus; increases damage and crit chance based on how fast the player is moving. public bool CobaltSet = false; @@ -1363,6 +1370,7 @@ namespace CalamityMod.CalPlayer public bool armorCrunch = false; public bool crumble = false; public bool irradiated = false; + public bool bane = false; public bool brimstoneFlames = false; public bool weakBrimstoneFlames = false; public bool demonicFlames = false; @@ -1564,8 +1572,6 @@ namespace CalamityMod.CalPlayer /// Pearl of Enthrallment. public bool waterEleBuff = false; public bool fClump = false; - /// Demonshade armor's Red Devil. - public bool rDevil = false; /// Aerospec armor's Valkyrie. public bool aValkyrie = false; public bool apexShark = false; @@ -1592,9 +1598,7 @@ namespace CalamityMod.CalPlayer public bool plaguebringerMK2 = false; public bool igneousExaltation = false; public bool GlacialEmbrace = false; - public bool voidAura = false; - public bool voidAuraDamage = false; - public bool voidConcentrationAura = false; + public bool VoidConcentrationStaff = false; public bool MutatedTruffleBool = false; public bool virili = false; public bool frostBlossom = false; @@ -2350,6 +2354,7 @@ namespace CalamityMod.CalPlayer blazingCursorDamage = false; blazingCursorVisuals = false; + yharimsGift = false; luxorsGift = false; luxorsGiftVanity = false; fungalSymbiote = false; @@ -2396,18 +2401,19 @@ namespace CalamityMod.CalPlayer lAmbergris = false; tortShell = false; absorber = false; - honeyDewHalveDebuffs = false; - livingDewHalveDebuffs = false; + honeyDew = false; + livingDew = false; aAmpoule = false; rOoze = false; - radiantOozeRegen = 0; - purityRegen = 0; fBarrier = false; aBrain = false; amalgam = false; frostFlare = false; evolution = false; + v8Engine = false; + v8000Engine = false; nanotech = false; + nanotechHitCooldown = 0; deadshotBrooch = false; tesla = false; teslaVisuals = true; @@ -2443,6 +2449,8 @@ namespace CalamityMod.CalPlayer stressPills = false; laudanum = false; fleshTotem = false; + fleshTotemVisual = false; + fleshTotemMinion = false; bloodPact = false; bloodflareCore = false; chaliceOfTheBloodGod = false; @@ -2459,7 +2467,7 @@ namespace CalamityMod.CalPlayer crawCarapace = false; baroclaw = false; voidOfCalamity = false; - voidOfExtinction = false; + apollyon = false; eArtifact = false; dArtifact = false; auricSArtifact = false; @@ -2523,6 +2531,7 @@ namespace CalamityMod.CalPlayer lunicCorpsLegs = false; ammoCost = 1f; + partialLifeRegen = 0f; healingPotionMultiplier = 1f; avertorBonus = false; @@ -2548,6 +2557,8 @@ namespace CalamityMod.CalPlayer spiritOrigin = false; spiritOriginVanity = false; critDamage = 0; + if (abaddonCooldown > 0) + abaddonCooldown--; astralStarRain = false; @@ -2625,6 +2636,7 @@ namespace CalamityMod.CalPlayer eclipseMirror = false; featherCrown = false; moonCrown = false; + mageCrownVisibility = false; dragonScales = false; gloveOfPrecision = false; gloveOfRecklessness = false; @@ -2635,11 +2647,15 @@ namespace CalamityMod.CalPlayer sandCloak = false; spectralVeil = false; hasJetpack = false; + hasEngineDash = false; plaguedFuelPack = false; blunderBooster = false; blunderBoosterVisibility = true; veneratedLocket = false; + if (DemonAltarDialogueCooldown > 0) + DemonAltarDialogueCooldown--; + alcoholPoisoning = false; shadowflame = false; daybroken = false; @@ -2652,6 +2668,7 @@ namespace CalamityMod.CalPlayer armorCrunch = false; crumble = false; irradiated = false; + bane = false; brimstoneFlames = false; witheredDebuff = false; absorberAffliction = false; @@ -2814,7 +2831,6 @@ namespace CalamityMod.CalPlayer brimEleBuff = false; waterEleBuff = false; fClump = false; - rDevil = false; aValkyrie = false; sCrystal = false; sGod = false; @@ -2841,7 +2857,6 @@ namespace CalamityMod.CalPlayer fungalClumpVanity = false; howlsHeart = false; howlsHeartVanity = false; - redDevil = false; valkyrie = false; slimeGod = false; chaosSpirit = false; @@ -2856,9 +2871,7 @@ namespace CalamityMod.CalPlayer plaguebringerMK2 = false; igneousExaltation = false; GlacialEmbrace = false; - voidAura = false; - voidAuraDamage = false; - voidConcentrationAura = false; + VoidConcentrationStaff = false; saros = false; if (sarosEclipseBeamUsage > 300) sarosEclipseBeamUsage = 300; @@ -3056,6 +3069,7 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.IsAir || Player.HeldItem.fishingPole == 0) consecutiveCaughtFish = 0; heldGaelsLastFrame = false; + partialLifeRegenCounter = 0f; gaelSwipes = 0; whitewaterHeal = 0; luxorHit = false; @@ -3090,7 +3104,6 @@ namespace CalamityMod.CalPlayer gSabatonTempJumpSpeed = 0; rOfDelivarenceRam = false; astralStarRainCooldown = 0; - AbaddonCooldown = 0; VoidCooldown = 0; AlchFlaskCooldown = 0; ascendantInsigniaCooldown = 0; @@ -3118,7 +3131,7 @@ namespace CalamityMod.CalPlayer andromedaCripple = 0; theBeeCooldown = 0; scuttlerCooldown = 0; - rogueCrownCooldown = 0; + mageCrownTimer = 0; wingProjectileCooldown = 0; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; @@ -3139,6 +3152,7 @@ namespace CalamityMod.CalPlayer armorCrunch = false; crumble = false; irradiated = false; + bane = false; brimstoneFlames = false; witheredDebuff = false; absorberAffliction = false; @@ -3175,7 +3189,6 @@ namespace CalamityMod.CalPlayer vaporfied = false; banishingFire = false; wither = false; - PurityHealSlowdownFrames = 0; ImmobilityDebuffImmunityTimer = 0; TypelessDebuffMultiplier = new(); HeatDebuffMultiplier = new(); @@ -3291,6 +3304,7 @@ namespace CalamityMod.CalPlayer healCounter = 300; danceOfLightCharge = 0; ammoCost = 1f; + partialLifeRegen = 0f; healingPotionMultiplier = 1f; avertorBonus = false; divineBless = false; @@ -3435,12 +3449,9 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - evilSmasherBoost = 0; burningSeaBurnOut = 0; flareGunOverheat = 0; hellbornShots = 0; - darklightEnergy = 0; - elementalMastery = 0; garandShots = 0; persecutedEnchantSummonTimer = 0; momentumCapacitorTime = 0; @@ -4479,6 +4490,10 @@ namespace CalamityMod.CalPlayer if (HasCustomDash && UsedDash.IsOmnidirectional) Player.maxFallSpeed = 50f; + // If the player isn't moving yet is still dashing, disable the dash (prevents weird hook jank) + if (Player.velocity == Vector2.Zero && Player.dashDelay == -1) + Player.dashDelay = 0; + tailFrameUp++; if (tailFrameUp == 8) { @@ -4839,6 +4854,29 @@ 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) + { + if (!Player.CheckMana(Player.HeldItem, -1, false, true)) + { + if (moonCrown || featherCrown) + { + if (mageCrownCount > 0) + { + mageCrownCount = 0; + mageCrownTimer = 300; + } + if (mageCrownCount < 0) mageCrownCount = 0; + } + } + } + return true; + } + #endregion + #region PostUpdateEquips public override void PostUpdateEquips() { @@ -4998,6 +5036,13 @@ namespace CalamityMod.CalPlayer else scionsCurioDebuffDamage = 0; + if (Player.Calamity().abaddon || Player.Calamity().apollyon) + { + Player.Calamity().playerBaneDebuffDamage = (1 + Player.GetTotalCritChance(Player.GetBestClass()) * 0.01f * (Player.Calamity().apollyon ? Apollyon.critScaling : Abaddon.critScaling)); + } + else + Player.Calamity().playerBaneDebuffDamage = 0; + // True melee damage from various vanilla equipment placed here. // Titan Glove and ALL upgrades. @@ -5014,6 +5059,9 @@ namespace CalamityMod.CalPlayer if (gSabaton && Player.whoAmI == Main.myPlayer) Player.jumpSpeedBoost += 2f; } + + //Update life regen that needs to happen before calculating debuffs + GeneralLifeRegen(); } #endregion @@ -5037,7 +5085,8 @@ namespace CalamityMod.CalPlayer //Flashlight //Due to being in postUpdate we need to adjust the mousepos for the player's movement that will have happened - var mouseworld = Main.MouseWorld + Player.position - Player.oldPosition; + mouseWorldListener = true; + var mouseworld = mouseWorld + Player.position - Player.oldPosition; EnhancedDarknessSystem.lights.Add(new(center: Player.Center + Player.DirectionTo(mouseworld) * 750f, rotation: Player.DirectionTo(mouseworld).ToRotation() - MathHelper.PiOver2, vectorScale: new Vector2(0.85f * abyssFlashlightWidthMultiplier, 0.75f), texture: Request("CalamityMod/Particles/BloomLineFade").Value)); } @@ -5142,7 +5191,7 @@ namespace CalamityMod.CalPlayer (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + - (getSandCloakAccelBoost ? 0.75f : 0f) + + (getSandCloakAccelBoost ? Items.Accessories.SandCloak.SandVeilAccelerationBoost : 0f) + (ascendantInsignia ? (AscendantInsignia.AccelerationBoost - 0.25f) : 0f) + // Subtracted 0.25 provided by Soaring Insignia (statisNinjaBelt ? 0.6f : 0f) + (statisVoidSash ? 0.85f : 0f) + @@ -6278,6 +6327,18 @@ namespace CalamityMod.CalPlayer life.noGravity = true; } } + + if (modPlayer.fleshTotem) + { + if (Main.myPlayer == Player.whoAmI) + { + fleshTotemManaStorage += manaConsumed; + if (fleshTotemManaStorage >= FleshTotem.manaStorageMax) + { + fleshTotemManaStorage = FleshTotem.manaStorageMax; + } + } + } } #endregion diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 35995aaf7c..cfc495120f 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -3,6 +3,7 @@ using CalamityMod.Balancing; using CalamityMod.CalPlayer.Dashes; using CalamityMod.EntitySources; using CalamityMod.Enums; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Mounts; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -132,6 +133,10 @@ namespace CalamityMod.CalPlayer dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown; if (DashID == DeepDiverDash.ID || (evasionScarf && DashID == CounterScarfDash.ID)) dashDelayToApply = (int)(dashDelayToApply * 0.75f); + if (DashID == V8EngineDash.ID) + dashDelayToApply = (int)(dashDelayToApply * V8Engine.DashDelayModifier); + if (DashID == V8000EngineDash.ID) + dashDelayToApply = (int)(dashDelayToApply * V8000Engine.DashDelayModifier); if (DashID == StatisNinjaBeltDash.ID || DashID == StatisVoidSashDash.ID || Player.dashType == 1) dashDelayToApply = BalancingConstants.UniversalSashDashCooldown; @@ -231,7 +236,7 @@ namespace CalamityMod.CalPlayer } // Handle first-frame effects. - else if (HasCustomDash && !Player.mount.Active) + else if (HasCustomDash && (!Player.mount.Active || DashID == V8EngineDash.ID || DashID == V8000EngineDash.ID)) { UsedDash.dashTime = 0; if (DoADash(UsedDash.CalculateDashSpeed(Player))) diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index e2e3352c4e..c00ca129b2 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -497,8 +497,7 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.brimstoneFlames && drawInfo.shadow == 0f) { - bool resistsBrimstoneFlames = abaddon; // Looks weaker if you have Abaddon equipped - BrimstoneFlames.DrawEffects(drawInfo, resistsBrimstoneFlames); + BrimstoneFlames.DrawEffects(drawInfo); } if (calamityPlayer.brainRot && drawInfo.shadow == 0f) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 5fc1264631..2c8276d8ee 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -8,6 +8,7 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; +using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Events; @@ -27,7 +28,7 @@ using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Potions; -using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Rogue; @@ -40,6 +41,8 @@ using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Typeless; @@ -52,13 +55,11 @@ using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.GameContent.Creative; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Items.Tools; namespace CalamityMod.CalPlayer { @@ -460,7 +461,53 @@ namespace CalamityMod.CalPlayer } #endregion + #region OnHitNPC + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Player.Calamity().yharimsGift) + target.AddBuff(ModContent.BuffType(),120); + + int debuffSpreadProj = ModContent.ProjectileType(); + if ((Player.Calamity().abaddon || Player.Calamity().apollyon) && (target.Calamity().abaddonEffected || target.Calamity().apollyonEffected) && hit.Crit && abaddonCooldown == 0 && Player.ownedProjectileCounts[debuffSpreadProj] == 0) + { + int maxTargetNum = target.Calamity().apollyonEffected ? 10 : 6; + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, Vector2.Zero, debuffSpreadProj, 0, 0, Player.whoAmI, 0, target.whoAmI, maxTargetNum); + abaddonCooldown = -1; // Prevents multiple projectiles hitting on the same frame from spawning multiple of these + } + } + #endregion + #region Modify Hit NPC + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (target.HasBuff()) + { + //This is essentially 10 AP, but independent of armor amount + modifiers.FlatBonusDamage += 5; + } + + if (Player.Calamity().apollyon) + { + target.Calamity().apollyonEffected = true; + // Check here for the amount of debuffs on enemy + int numOfDebuffs = 0; + for (int index = 0; index < target.buffType.Length; index++) + { + int type = target.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + if (debuffData != null) + numOfDebuffs++; + } + modifiers.CritDamage += Apollyon.critDamageBoostPerDebuff * numOfDebuffs; + } + else if (Player.Calamity().abaddon) + target.Calamity().abaddonEffected = true; + else + { + target.Calamity().abaddonEffected = false; + target.Calamity().apollyonEffected = false; + } + } public override void ModifyHitNPCWithItem(Item item, NPC target, ref NPC.HitModifiers modifiers) { modifiers.CritDamage += critDamage; @@ -744,10 +791,6 @@ namespace CalamityMod.CalPlayer // The amount of damage that will be dealt is yet to be determined. // - // Can't have any cooldowns here because dodges grrrrr.... - if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0) - modifiers.FinalDamage *= 0.5f; - if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID)) modifiers.FinalDamage *= (1f - TarragonHeadMelee.CloakContactDamageReduction); @@ -848,7 +891,7 @@ namespace CalamityMod.CalPlayer float cooldownDurationScalar = MathHelper.Clamp((actualProjDamage - dodgeDamageGateValue) / (float)maxCooldownDurationDamageValue, 0f, 1f); // The Evolution - if (evolution) + if (evolution && !Player.HasBuff()) { if (Player.whoAmI == Main.myPlayer) { @@ -1037,10 +1080,9 @@ namespace CalamityMod.CalPlayer if (!hasIFrames && !Player.creativeGodMode) nextHitDealsDefenseDamage |= npc.Calamity().canBreakPlayerDefense; - // ModifyHit (Flesh Totem effect happens here) -> Hurt (includes dodges) -> OnHit + // ModifyHit -> Hurt (includes dodges) -> OnHit // As such, to avoid cooldowns proccing from dodge hits, do it here - if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0) - Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20)); + if (NPC.AnyNPCs(ModContent.NPCType())) Player.AddBuff(ModContent.BuffType(), 15, true); @@ -1887,10 +1929,6 @@ namespace CalamityMod.CalPlayer Rectangle location = new Rectangle((int)Player.position.X, (int)Player.position.Y - 16, Player.width, Player.height); CombatText.NewText(location, Color.LightBlue, Language.GetTextValue(shieldDamageText)); - // Give the player iframes for taking a shield hit, regardless of whether or not the shields broke. - int shieldHitIFrames = Player.ComputeHitIFrames(info); - Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true); - // Spawn particles when hit with the shields up, regardless of whether or not the shields broke. // More particles spawn if a shield broke. if (pSoulArtifact) @@ -1961,6 +1999,10 @@ namespace CalamityMod.CalPlayer // If the shields completely absorbed the hit, then delete the hit using reflection. if (shieldsFullyAbsorbedHit) { + // Give the player iframes for taking a shield hit + int shieldHitIFrames = Player.ComputeHitIFrames(info); + Player.GiveIFrames(info.CooldownCounter, shieldHitIFrames, true); + freeDodgeFromShieldAbsorption = true; // Cancel defense damage, if it was going to occur this frame. @@ -2174,9 +2216,6 @@ namespace CalamityMod.CalPlayer LoseAdrenalineOnHurt(hurtInfo, false); } - if (evilSmasherBoost > 0) - evilSmasherBoost -= 1; - if (trinketOfChi) chiBuffTimer = 0; @@ -2283,11 +2322,36 @@ namespace CalamityMod.CalPlayer if (duration > 120) duration = 120; - npc.AddBuff(ModContent.BuffType(), (int)duration, false); + npc.AddBuff(BuffID.Frozen, (int)duration, false); } } } + if (fleshTotem && hurtInfo.Damage > 0) + { + 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) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + if (proj.active && proj.owner == Player.whoAmI && proj.type == ModContent.ProjectileType()) + { + for (int k = 0; k < lostSoulAmount; k++) + { + Projectile.NewProjectile(Player.GetSource_Accessory_OnHurt(FindAccessory(), hurtInfo.DamageSource), proj.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType(), FleshTotem.lostSoulDamage, 0f, Main.myPlayer, 0f, 0f, 3f); + } + break; + } + } + } + + fleshTotemManaStorage = 0; + } + // By setting brainOfConfusionItem, these accessories have this code already, // but doing it again allows for increased duration + The Amalgam's other buffs, // and also doesn't have random chance (why does Brain of Confusion not guarantee confusion on hit) @@ -2366,7 +2430,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(BuffID.Honey, 300, false); // Handle hit effects from the gem tech armor set. - Player.Calamity().GemTechState.PlayerOnHitEffects((int)hurtInfo.Damage); + Player.Calamity().GemTechState.PlayerOnHitEffects(hurtInfo); if (Player.whoAmI == Main.myPlayer) { @@ -2408,10 +2472,10 @@ namespace CalamityMod.CalPlayer if (dAmulet) { var source = Player.GetSource_Accessory_OnHurt(FindAccessory(), hurtInfo.DamageSource); - int projAmount = (rampartOfDeities ? 12 : 6); + var projAmount = (rampartOfDeities ? 12 : 6) * (Player.strongBees ? 1.5f : 1f); for (int n = 0; n < projAmount; n++) { - int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage) * (Player.strongBees ? 0.85f : 1f)); + int deificProjDamage = (int)(Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage)); Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15 * (rampartOfDeities && n % 2 == 0 ? 0.75f: 1.25f)).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType(), deificProjDamage, 4f, Player.whoAmI)]; if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2422,8 +2486,6 @@ namespace CalamityMod.CalPlayer onHitProj.tileCollide = false; onHitProj.extraUpdates = 1; onHitProj.Calamity().conditionalHomingRange = 600f; - if (Player.strongBees) - onHitProj.penetrate += 1; } } } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 11c1641360..5e33e56b73 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -48,22 +48,22 @@ namespace CalamityMod.CalPlayer { int totalVanillaDoT = 0; - if (Player.poisoned && !purity) + if (Player.poisoned) totalVanillaDoT += 4; - if (Player.onFire && !purity) + if (Player.onFire) totalVanillaDoT += 8; if (Player.tongued) totalVanillaDoT += 100; - if (Player.venom && !purity) + if (Player.venom) totalVanillaDoT += 12; - if (Player.onFrostBurn && !purity) + if (Player.onFrostBurn) totalVanillaDoT += 12; - if (Player.onFire2 && !purity) + if (Player.onFire2) totalVanillaDoT += 12; if (Player.burned) @@ -72,7 +72,7 @@ namespace CalamityMod.CalPlayer if (Player.suffocating) totalVanillaDoT += 40; - if (Player.electrified && !purity) + if (Player.electrified) { totalVanillaDoT += eleResist ? 4 : 8; if (Player.controlLeft || Player.controlRight) @@ -101,37 +101,38 @@ namespace CalamityMod.CalPlayer // Whispering Death sets positive regen to zero but doesn't actually deal any damage ApplyDoTDebuff(whisperingDeath, 0, laudanum); - ApplyDoTDebuff(irradiated, 4, purity); + ApplyDoTDebuff(irradiated, 4); int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0); - ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); - ApplyDoTDebuff(riptide, 6, purity); + ApplyDoTDebuff(sulphurPoison, sulphurDoT); + ApplyDoTDebuff(riptide, 6); ApplyDoTDebuff(weakBrimstoneFlames, 7); - ApplyDoTDebuff(burningBlood, 8, purity); - ApplyDoTDebuff(brainRot, 8, purity); - ApplyDoTDebuff(vaporfied, 8, purity); + ApplyDoTDebuff(burningBlood, 8); + ApplyDoTDebuff(brainRot, 8); + ApplyDoTDebuff(vaporfied, 8); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); - ApplyDoTDebuff(staticDischarge, staticDoT, purity); - ApplyDoTDebuff(heavybleeding, 16, purity); - ApplyDoTDebuff(crushDepth, 18, purity); - ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); - ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(brimstoneFlames, (int)MathF.Round(30 * (abaddon ? (1f - Abaddon.BrimstoneFlamesReduction) : 1f)), purity); - ApplyDoTDebuff(plague, (int)MathF.Round(30 * (abaddon ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity); + ApplyDoTDebuff(staticDischarge, staticDoT); + ApplyDoTDebuff(heavybleeding, 16); + ApplyDoTDebuff(crushDepth, 18); + ApplyDoTDebuff(astralInfection, 24, hideOfDeus); + ApplyDoTDebuff(shadowflame, 30); + ApplyDoTDebuff(brimstoneFlames, 30); + ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f))); ApplyDoTDebuff(vHex, 30); // Has other effects ApplyDoTDebuff(searingLava, 30); - ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player - ApplyDoTDebuff(laceration, 36, purity); - ApplyDoTDebuff(daybroken, 40, purity); - ApplyDoTDebuff(nightwither, 40, purity); - ApplyDoTDebuff(holyFlames, 40, purity); - ApplyDoTDebuff(voidfrost, 40, purity); - ApplyDoTDebuff(hadopelagicPressure, 40, purity); + ApplyDoTDebuff(demonicFlames, 33); // Never inflicted on the player + ApplyDoTDebuff(laceration, 36); + ApplyDoTDebuff(daybroken, 40); + ApplyDoTDebuff(bane, 40); + ApplyDoTDebuff(nightwither, 40); + ApplyDoTDebuff(holyFlames, 40); + ApplyDoTDebuff(voidfrost, 40); + ApplyDoTDebuff(hadopelagicPressure, 40); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); - ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player + ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player ApplyDoTDebuff(trueVHex, 50); int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); @@ -275,25 +276,23 @@ namespace CalamityMod.CalPlayer bool hasLifeRegenHinderingDebuff = Player.lifeRegenTime == 0; - #region Life Regen That Works Even During DoT Debuffs - if (honeyDewHalveDebuffs) - { - // Tick down all sickness debuffs; this makes them expire 2x faster - // Upgrades increase the sets of debuffs which expire faster - for (int l = 0; l < Player.MaxBuffs; ++l) - { - int buffID = Player.buffType[l]; - if (Player.buffTime[l] <= 2 || BuffDatasets.DebuffDataset[buffID] is null) - continue; - bool shouldHalveDuration = BuffDatasets.DebuffDataset[buffID].SicknessDebuffScaling > 0; - if (livingDewHalveDebuffs) - shouldHalveDuration |= BuffDatasets.DebuffDataset[buffID].HeatDebuffScaling > 0; - if (purity) - shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID]; - if (shouldHalveDuration) - --Player.buffTime[l]; - } + #region Life Regen That Works Even During DoT Debuffs + + //Negation of debuffs. These all will not take life regen above 0 + if (Player.lifeRegen < 0) + { + if (crownJewel) + Player.lifeRegen += CrownJewel.ReducedDoTAmount; + + if (infectedJewel) + Player.lifeRegen += InfectedJewel.ReducedDoTAmount; + + if (purity) + Player.lifeRegen += Radiance.ReducedDoTAmount; + + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; } if (divineBless) @@ -307,19 +306,6 @@ namespace CalamityMod.CalPlayer if (bloodfinBoost) { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < Bloodfin.DebuffedRegenTimeFloor) - Player.lifeRegenTime = Bloodfin.DebuffedRegenTimeFloor; - - Player.lifeRegen += Bloodfin.DebuffedRegenBoost; - } - else - { - Player.lifeRegen += Bloodfin.RegenBoost; - Player.lifeRegenTime += Bloodfin.RegenTimeBoost; - } - if (bloodfinTimer > 0) bloodfinTimer--; @@ -327,124 +313,37 @@ namespace CalamityMod.CalPlayer { bloodfinTimer = Bloodfin.FramesForExtraRegen; - if (Player.statLife < (int)(Player.statLifeMax2 * Bloodfin.ExtraRegenHealthThreshold) && !noLifeRegen) + if (!noLifeRegen) Player.HealPlayer(1, HealTextType.None); } } // Permafrost's Concoction increases life regen while afflicted with a fire debuff if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0)) - { - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; - Player.lifeRegen += 6; - } - // Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity - if (rOoze || aAmpoule || purity) + if (grandDadHealTimer == 0 && grandDadHealPool >= 7) { - float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2; - //Ambrosial Ampule and ooze give between 2 and 5 hp/s - int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(RadiantOoze.MinRegenBoost, RadiantOoze.MaxRegenBoost, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. - Player.lifeRegen += lifeRegenToGive; - radiantOozeRegen += lifeRegenToGive / 2f; - purityRegen += lifeRegenToGive / 2f; + Player.HealPlayer(7, HealTextType.Broadcast); + grandDadHealPool -= 7; + grandDadHealTimer = (int)(30 * Utils.GetLerpValue(260, 60, grandDadHealPool, true)); } + else if (grandDadHealTimer > 0) + grandDadHealTimer--; - if (purity) + //Raising natural regen post-damaging-debuff + if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) { - int intendedPurityDefense = 0; - int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); - if (currentDebuffs > 0) - { - // Healing rate is normally 5 HP/s (+1 every 12 frames) - // However, that 12 frames can and will slowly increase if you try to abuse this accessory - int healFrameCadence = 12; + if (infectedJewel) + Player.lifeRegenTime += InfectedJewel.PostDebuffRegenTimeBoost; - // Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows - // The upper limit to how slow it can get is after 15 seconds (900 frames) - int punishmentFrames = PurityHealSlowdownFrames - 300; - //lowest punishment is a little under a second between the one health heal - if (healFrameCadence < 52) - healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; + if (purity) + Player.lifeRegenTime += Radiance.PostDebuffRegenTimeBoost; - if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) - Player.Heal(1); - - intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; - if (jewelBonusDefense < intendedPurityDefense) - jewelBonusDefense = intendedPurityDefense; - - // Count up total frames spent healing for slowdown. - if (PurityHealSlowdownFrames < 900) - ++PurityHealSlowdownFrames; - purityRegen += (60 / (float)healFrameCadence); - } - - // If the defense should be ticking down to some lower value, do that. - // Purity loses 1 point of defense every second. - if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense) - --jewelBonusDefense; - - // If the player is clear of all debuffs then gradually reduce the slowdown frames - if (currentDebuffs <= 0) - { - --PurityHealSlowdownFrames; - if (PurityHealSlowdownFrames < 0) - PurityHealSlowdownFrames = 0; - } - - // Actually apply defense bonus - Player.statDefense += jewelBonusDefense; - } - - // Infected Jewel does not stack with Purity - else if (infectedJewel) - { - Player.lifeRegen += 2; - - // If the player has any debuffs, give the extra life regen and defense - // More defense is given for each additional debuff - int intendedJewelDefense = 0; - int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); - if (currentDebuffs > 0) - { - Player.lifeRegen += 4; - - intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; - if (jewelBonusDefense < intendedJewelDefense) - jewelBonusDefense = intendedJewelDefense; - } - - // If the defense should be ticking down to some lower value, do that. - // Infected Jewel loses 1 point of defense every 20 frames. - if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense) - --jewelBonusDefense; - - // Actually apply defense bonus - Player.statDefense += jewelBonusDefense; - } - - // Crown Jewel does not stack with Purity or Infected Jewel - else if (crownJewel) - { - Player.lifeRegen += 2; - - // If any debuff is detected, provide even more life regen - if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) - Player.lifeRegen += 3; - } - - //If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise - //This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken - if (tequilaSunrise) - { - if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) - { + if (tequilaSunrise) Player.lifeRegenTime += 1800; - } } + #endregion // During Silva revive or God Slayer dash, all negative life regen is canceled @@ -519,24 +418,43 @@ namespace CalamityMod.CalPlayer // The bleedout is applied by directly reducing the player's health. It is not canceled by anything. ChaliceOfTheBloodGod.HandleBleedout(Player); - //Finally, update the state of hadLifeRegenHinderingDebuff for next frame. - hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff; + //Finally, update the state of hadLifeRegenHinderingDebuff for next frame. Needs to check for 2 frames of 0 regen time to be sure they had a debuff + hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff && _hasNoNaturalRegen; + _hasNoNaturalRegen = hasLifeRegenHinderingDebuff; } #endregion #region Update Life Regen - public override void UpdateLifeRegen() + //This method runs BEFORE UpdateBadLifeRegen. Put most effects here. Ran at the end of PostUpdateEquips + public void GeneralLifeRegen() { + // Apply partial life regeneration + // Regenerator applies partial life regen as a part of its damage conversion straight up, so it will avoid this function + if (regenerator) + partialLifeRegenCounter = 0f; + else + { + partialLifeRegenCounter += partialLifeRegen; + if (partialLifeRegenCounter >= 1f || partialLifeRegenCounter <= -1f) + { + int flooredRegenAdded = (int)MathF.Floor(partialLifeRegenCounter); + Player.lifeRegen += flooredRegenAdded; + partialLifeRegenCounter -= flooredRegenAdded; + } + } + + float lifeRatio = (Player.statLife) / (float)Player.statLifeMax2; + if (mushy) Player.lifeRegen += Mushy.RegenBoost; if (permafrostsConcoction) { - if (Player.statLife < actualMaxLife / 2) + if (lifeRatio <= 0.5f) Player.lifeRegen++; - if (Player.statLife < actualMaxLife / 4) + if (lifeRatio <= 0.25f) Player.lifeRegen++; - if (Player.statLife < actualMaxLife / 10) + if (lifeRatio <= 0.1f) Player.lifeRegen += 2; } @@ -552,6 +470,25 @@ namespace CalamityMod.CalPlayer if (PinkJellyRegen) Player.lifeRegen += LifeJelly.AuraRegenBoost; + if (rOoze) + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(RadiantOoze.MaxRegenBoost, RadiantOoze.MinRegenBoost, lifeRatio)); + + if (livingDew) + Player.lifeRegenTime += LivingDew.RegenTimeBoost; + + if (aAmpoule) + { + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(AmbrosialAmpoule.MaxRegenBoost, AmbrosialAmpoule.MinRegenBoost, lifeRatio)); + Player.lifeRegenTime += AmbrosialAmpoule.RegenTimeBoost; + } + + if (purity) + { + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(Radiance.MaxRegenBoost, Radiance.MinRegenBoost, lifeRatio)); + Player.lifeRegenTime += Radiance.RegenTimeBoost; + } + + if (GreenJellyRegen) Player.lifeRegen += Items.Accessories.GrandGelatin.AuraRegenBoost; @@ -565,7 +502,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += Affliction.RegenBoost; if (trinketOfChi || chiRegen) - Player.lifeRegen += 2; + Player.lifeRegen += TrinketofChi.RegenBoost; if (darkSunRing) { @@ -576,6 +513,12 @@ namespace CalamityMod.CalPlayer if (silvaSet) Player.lifeRegen += SilvaArmor.SetBonusRegenBoost; + if (angelicAlliance) + { + if (Player.wingTime < Player.wingTimeMax) + Player.lifeRegen += AngelicAlliance.RegenBoostDuringFlight; + } + if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000) { Player.lifeRegen += PhantomicArtifact.RegenBoost; @@ -591,6 +534,27 @@ namespace CalamityMod.CalPlayer regen.position = Player.Center - velocity; } } + if (fearmongerSet && fearmongerRegenFrames > 0) + { + if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor) + Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor; + + Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost; + Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost; + } + if (handWarmer && eskimoSet) + { + Player.lifeRegen += 2; + } + } + + //This method runs AFTER UpdateBadLifeRegen. Only put effects that should bypass debuff DoT canceling here. + public override void UpdateLifeRegen() + { + if (avertorBonus) + { + Player.lifeRegen += 4; + } if (community) { @@ -605,22 +569,10 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += lesserEffect ? 1 : regenBoost; } - if (handWarmer && eskimoSet) + if (manaOverloader) { - Player.lifeRegen += 2; - } - if (avertorBonus) - { - Player.lifeRegen += 4; - } - - if (fearmongerSet && fearmongerRegenFrames > 0) - { - if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor) - Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor; - - Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost; - Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost; + float manaRatio = Player.statMana / (float)Player.statManaMax2; + Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f)); } if (pinkCandle && !noLifeRegen) @@ -637,12 +589,6 @@ namespace CalamityMod.CalPlayer else pinkCandleHealFraction = 0D; - if (manaOverloader) - { - float manaRatio = Player.statMana / (float)Player.statManaMax2; - Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f)); - } - #region Standing Still Life Regen // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0 && (shadeRegen || cFreeze)) @@ -728,6 +674,16 @@ namespace CalamityMod.CalPlayer public override void NaturalLifeRegen(ref float regen) { + // Honey Dew and its upgrades make natural regen more powerful + if (purity) + regen *= Radiance.NaturalRegenPower; + else if (aAmpoule) + regen *= AmbrosialAmpoule.NaturalRegenPower; + else if (livingDew) + regen *= LivingDew.NaturalRegenPower; + else if (honeyDew) + regen *= HoneyDew.NaturalRegenPower; + // The Camper counteracts the regen loss while moving horizontally if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0)) { @@ -750,13 +706,13 @@ namespace CalamityMod.CalPlayer // Regenerator trades all positive regen for damage, and caps your health gain at 50% if (regenerator) { - int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); - finalRegen = (int)Math.Max(finalRegen, 0); + float finalRegen = Player.lifeRegen + partialLifeRegen + MathF.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); + finalRegen = MathF.Max(finalRegen, 0f); // Rapid Healing increments RegenCount directly so it needs to be manually added // It also works while debuffs are active so the same logic applies here if (Player.palladiumRegen) - finalRegen += 4; + finalRegen += 4f; regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio; Player.GetDamage() += regeneratorDamage; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ddb7152309..8f40b12dd9 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -45,6 +45,7 @@ using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; @@ -69,6 +70,8 @@ using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.UI; +using CalamityMod.UI.DialogueDisplay; +using CalamityMod.UI.DialogueDisplay.DisplayEffects; using CalamityMod.Utilities; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -152,9 +155,6 @@ namespace CalamityMod.CalPlayer // Drawing parameters UpdateDrawingParameters(); - // Handle Lucrecia's passive energy effects - HandleLucreciaLineEffects(); - // Update all particle sets for items. // This must be done here instead of in the item logic because these sets are not properly instanced // in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items. @@ -205,15 +205,29 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type != ModContent.ItemType()) saharaSlicersBolts = 0; - if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) + // Spawning for items that have holdouts active when held + if (Player.whoAmI == Main.myPlayer && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) { - int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); - } - if (Player.whoAmI == Main.myPlayer && Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) && !Player.dead && !Main.mapFullscreen && !Player.mouseInterface) - { - int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } + if (Player.HeldItem.type == ModContent.ItemType() && (Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0)) + { + int damage = (int)Player.GetTotalDamage().ApplyTo(Player.HeldItem.damage); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); + } } // De-equipping Gael's Greatsword deletes all rage. @@ -291,7 +305,7 @@ namespace CalamityMod.CalPlayer } // First Frame dash effects - bool dashStart = (Player.dashDelay == -1 && ((!HasCustomDash && IsFirstDashFrame) || (HasCustomDash && UsedDash.DashTimeAdjustedForStartup == 1))); + bool dashStart = (Player.Calamity().DashID == DefaultDash.ID && Player.timeSinceLastDashStarted == 1 && Player.dashDelay != 0 ) || (Player.dashDelay == -1 && ((!HasCustomDash && IsFirstDashFrame) || (HasCustomDash && UsedDash.DashTimeAdjustedForStartup == 1))); int dir = MathF.Sign(Player.velocity.X); if (dashStart) @@ -397,120 +411,6 @@ namespace CalamityMod.CalPlayer Player.wingTime++; } - if (Player.HeldItem.type == ModContent.ItemType() && darklightEnergy > 0) - { - if (darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyPaused) - { - darklightEnergyPaused = true; - darklightEnergyTimer = 0; - } - - darklightEnergyTimer++; - - // If the energy is at max, pause for 180 ticks - if (darklightEnergyPaused) - { - if (darklightEnergyTimer >= 1 && !darklightEnergyMaxFXPlayed) - { - SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); - SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); - - for (int i = 0; i < 10; i++) // Circular ring of particles burst from player - { - float angle = MathHelper.TwoPi * (i / 10f); - Vector2 spawnDirection = angle.ToRotationVector2(); - Vector2 velocity = spawnDirection * 14f; - - CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); - GeneralParticleHandler.SpawnParticle(spark); - } - darklightEnergyMaxFXPlayed = true; - } - - // If the pause is Done, resume decrementing. - if (darklightEnergyTimer >= 180) - { - darklightEnergyPaused = false; - darklightEnergyTimer = 0; - darklightEnergy--; - } - } - else // Decrementing - { - darklightEnergyMaxFXPlayed = false; - // Once every 20 ticks - if (darklightEnergyTimer >= 20) - { - darklightEnergy--; - darklightEnergyTimer = 0; - } - } - } - else - { - // Reset all energy variables when not holding the weapon - darklightEnergyTimer = 0; - darklightEnergyPaused = false; - darklightEnergy = 0; - } - - if (Player.HeldItem.type == ModContent.ItemType() && elementalMastery > 0) - { - if (elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryPaused) - { - elementalMasteryPaused = true; - elementalMasteryTimer = 0; - } - - elementalMasteryTimer++; - - // If the mastery is at max, pause for 180 ticks - if (elementalMasteryPaused) - { - if (elementalMasteryTimer >= 1 && !elementalMasterySFXPlayed) - { - SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); - SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); - - for (int i = 0; i < 10; i++) // Circular ring of particles burst from player - { - float angle = MathHelper.TwoPi * (i / 10f); - Vector2 spawnDirection = angle.ToRotationVector2(); - Vector2 velocity = spawnDirection * 14f; - - CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); - GeneralParticleHandler.SpawnParticle(spark); - } - elementalMasterySFXPlayed = true; - } - // If the pause is Done, resume decrementing. - if (elementalMasteryTimer >= 180) - { - elementalMasteryPaused = false; - elementalMasteryTimer = 0; - elementalMastery--; - } - } - else // Decrementing - { - elementalMasterySFXPlayed = false; - // Once every 30 ticks - if (elementalMasteryTimer >= 30) - { - elementalMastery--; - elementalMasteryTimer = 0; - } - } - } - else - { - // Reset all EM variables when not holding the weapon - elementalMasteryTimer = 0; - elementalMasteryPaused = false; - elementalMastery = 0; - } - - if (Player.HeldItem.type == ModContent.ItemType() && unstableCastersGauntletVis < 100) { @@ -558,6 +458,30 @@ namespace CalamityMod.CalPlayer } + if (v8Engine || v8000Engine) + { + if (Player.dashDelay == 1 && !v8EngineFXPlayed) + { + + SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/ScornJump"); + SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.7f }, Player.Center); + + for (int i = 0; i < 10; i++) // Circular ring of particles burst from player + { + float angle = MathHelper.TwoPi * (i / 10f); + Vector2 spawnDirection = angle.ToRotationVector2(); + Vector2 velocity = spawnDirection * 18f; + + CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Player.Calamity().DashID == V8EngineDash.ID ? Color.OrangeRed : Color.Cyan, Color.White, Main.rand.NextFloat(1f)), Color.White * 0.5f, 1.2f, 12, 0.3f, 1.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + v8EngineFXPlayed = true; + } + + if (Player.dashDelay == -1) + v8EngineFXPlayed = false; + } + if (XykVisualsBlue || XykVisualsOrange) { bool Orange = XykVisualsOrange; @@ -629,7 +553,7 @@ namespace CalamityMod.CalPlayer // Spawn sand veil when dashing if it does not exist and you do not have the cooldown if (!(CalamityUtils.AnyProjectiles(ModContent.ProjectileType()) || Player.HasCooldown(Cooldowns.SandCloak.ID))) { - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 13, 2.5f, Player.whoAmI); + Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 10, 2.5f, Player.whoAmI); SoundEngine.PlaySound(SoundID.Item45, Player.Center); } } @@ -672,17 +596,6 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - // Hallowed Armor nerf - if (Player.onHitDodge) - { - for (int l = 0; l < Player.MaxBuffs; l++) - { - int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge) - Player.buffTime[l] = 600; - } - } - // Immunity Frames nerf int immuneTimeLimit = 150; if (Player.immuneTime > immuneTimeLimit) @@ -1110,12 +1023,17 @@ namespace CalamityMod.CalPlayer // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. - int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType() : ModContent.BuffType(); - if (!target.HasBuff(buffToInflict)) - target.AddBuff(buffToInflict, 52); - target.buffTime[target.FindBuffIndex(buffToInflict)] += 8; - if (target.buffTime[target.FindBuffIndex(buffToInflict)] < VulnerabilityHex.CalamityDuration) - target.buffTime[target.FindBuffIndex(buffToInflict)] = VulnerabilityHex.CalamityDuration; + int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType() : ModContent.BuffType(); + if (!target.buffImmune[buffToInflict]) + { + if (!target.HasBuff(buffToInflict)) + target.AddBuff(buffToInflict, 52); + + int index = target.FindBuffIndex(buffToInflict); + + if (index != -1) + target.buffTime[index] = Math.Max(target.buffTime[index] + 8, VulnerabilityHex.CalamityDuration); + } // Make some fancy dust to indicate damage is being done. for (int j = 0; j < 12; j++) @@ -1130,8 +1048,39 @@ namespace CalamityMod.CalPlayer } } + private void DemonAltarTalking() + { + + for (var h = -15; h < 15; h++) + { + for (var j = -15; j < 15; j++) + { + var tilePos = Player.Center.ToTileCoordinates() + new Point(h, j); + if (Main.tile[tilePos.X, tilePos.Y].TileType == TileID.DemonAltar) + { + string type = WorldGen.crimson ? "Mods.CalamityMod.EvilSmasher.CrimsonAltar" : "Mods.CalamityMod.EvilSmasher.DemonAltar"; + if (DialogueDisplaySystem.ContainsDialogueKey(type)) + DialogueDisplaySystem.RemoveDialogue(DialogueDisplaySystem.GetSlot(type)); + DialogueDisplaySystem.StartDialogueOnClient(type, new Vector2(tilePos.X * 16 + 16, tilePos.Y * 16), DemonAltarDialogueCounter, 180, false, new AltarText()); + DemonAltarDialogueCounter++; + DemonAltarDialogueCooldown = 300; + if (DemonAltarDialogueCounter >= 4) + { + DemonAltarDialogueCooldown = 3600; + DemonAltarDialogueCounter = 0; + } + return; + } + } + } + } private void MiscEffects() { + if (Player.inventory.Any(x => x.type == ItemID.Pwnhammer) && !Player.inventory.Any(x => x.type == ModContent.ItemType()) && Player.adjTile[TileID.DemonAltar] && DemonAltarDialogueCooldown <= 0 && Player.miscCounter % 30 == 0) + { + DemonAltarTalking(); + } + //Mana Burn update if (ManaBurnFireDrawer != null) { @@ -1300,7 +1249,7 @@ namespace CalamityMod.CalPlayer } if (brittleStar && brittleStarBuffMode) - Player.statDefense += 4 * Player.ownedProjectileCounts[ModContent.ProjectileType()]; + Player.statDefense += BrittleStarStaff.DefenseBoostPerBuffStar * Player.ownedProjectileCounts[ModContent.ProjectileType()]; // Reduce the rate of recovery of the Lifesteal variable // Classic Mode: 36 HP/s to 12 HP/s @@ -1421,19 +1370,31 @@ namespace CalamityMod.CalPlayer } } - // Hydrothermal blue smoke effects but it doesn't work epicccccc if (Player.whoAmI == Main.myPlayer) { - if (hydrothermalSmoke) + if (hydrothermalSmoke && !Main.dedServ) { + // Release effects when the player moves. if (Math.Abs(Player.velocity.X) > 0.1f || Math.Abs(Player.velocity.Y) > 0.1f) { - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(HydrothermicArmor.VanitySmokeEntitySourceContext); - Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + if (Main.rand.NextBool(6)) + { + int fieryDust = Dust.NewDust(Player.Top + Vector2.UnitY, 20, 42, DustID.Flare, 0f, 0f, 100, default, 0.7f); + if (Main.rand.NextBool(4)) + { + Main.dust[fieryDust].scale *= 0.35f; + } + Main.dust[fieryDust].velocity *= 0f; + } + + if (Main.rand.NextBool(2)) + { + float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); + MediumMistParticle mist = new MediumMistParticle(Player.Top + Vector2.UnitY, -Player.velocity + new Vector2(0.5f, upwardVariation), Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.Black, Color.Black, Main.rand.NextFloat(0.4f, 0.65f), 130); + GeneralParticleHandler.SpawnParticle(mist); + } } } - // Trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working if (!Player.armorEffectDrawOutlines) { hydrothermalSmoke = false; @@ -1644,7 +1605,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - Player.HealPlayer(15); + Player.HealPlayer(10); if (profanedCrystal) { @@ -1892,7 +1853,7 @@ namespace CalamityMod.CalPlayer { if (numOfEnergy < energyCap) { - int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(8); + int energyDamage = (int)Player.GetBestClassDamage().ApplyTo(12); Projectile energy = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, (Vector2.One * 4).RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType(), energyDamage, 0f, Player.whoAmI, 0, numOfEnergy); if (numOfEnergy + 1 == energyCap && Player.Calamity().sSpiritAmuletVisual) { @@ -2069,6 +2030,42 @@ namespace CalamityMod.CalPlayer if (Player.velocity.Length() < 6) hookPullVisuals = 0; } + if (featherCrown) + { + int MaxSigils = 4; //Starts at 0, so cap is 5 + if (mageCrownTimer == 0) + { + if (mageCrownCount <= MaxSigils && Main.myPlayer == Player.whoAmI) + { + mageCrownCount += 1; + float start = 360f / mageCrownCount; + Projectile.NewProjectile(Player.GetSource_Accessory(FindAccessory()), 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 = 120; + } + else if (!Player.dead) + { + mageCrownTimer--; + } + } + if (moonCrown) + { + int MaxSigils = 9; //Starts at 0, so cap is 10 + if (mageCrownTimer == 0) + { + if (mageCrownCount <= MaxSigils && Main.myPlayer == Player.whoAmI) + { + mageCrownCount += 1; + float start = 360f / mageCrownCount; + Projectile.NewProjectile(Player.GetSource_Accessory(FindAccessory()), 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 = 120; + } + else if (!Player.dead) + { + mageCrownTimer--; + } + } if (unstableGraniteCore) { @@ -2131,7 +2128,7 @@ namespace CalamityMod.CalPlayer if (whitewaterHeal > 0) { - if (whitewaterHeal % 15 == 0) + if (whitewaterHeal % 20 == 0) Player.HealPlayer(1); whitewaterHeal--; @@ -2241,8 +2238,6 @@ namespace CalamityMod.CalPlayer raiderSoundCooldown--; if (astralStarRainCooldown > 0) astralStarRainCooldown--; - if (AbaddonCooldown > 0) - AbaddonCooldown--; if (VoidCooldown > 0) VoidCooldown--; if (ursaSergeantCooldown > 0) @@ -2259,8 +2254,8 @@ namespace CalamityMod.CalPlayer silvaMageCooldown--; if (scuttlerCooldown > 0) scuttlerCooldown--; - if (rogueCrownCooldown > 0) - rogueCrownCooldown--; + if (nanotechHitCooldown > 0) + nanotechHitCooldown--; if (spectralVeilImmunity > 0) spectralVeilImmunity--; if (jetPackDash > 0) @@ -2316,6 +2311,10 @@ namespace CalamityMod.CalPlayer ataxiaDmg -= 1.5f; if (ataxiaDmg < 0f) ataxiaDmg = 0f; + if (hydroHealTimer > 0f) + hydroHealTimer -= 0.05f; + if (ataxiaDmg < 0f) + ataxiaDmg = 0f; if (xerocDmg > 0f) xerocDmg -= 2f; if (xerocDmg < 0f) @@ -2726,8 +2725,8 @@ namespace CalamityMod.CalPlayer { if (Player.isNearFairy()) { - Player.lifeRegen += 4; - Player.statDefense += 6; + Player.lifeRegen += 2; + Player.statDefense += 4; Player.moveSpeed += 0.1f; } } @@ -2804,10 +2803,10 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Chilled] = true; } - // Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff + // Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Frozen debuff if (cFreeze) { - int buffType = ModContent.BuffType(); + int buffType = BuffID.Frozen; float freezeDist = 200f; if (Player.whoAmI == Main.myPlayer) { @@ -3421,14 +3420,13 @@ namespace CalamityMod.CalPlayer if (graxDefense) { Player.statDefense += Grax.DefenseBoost; - Player.endurance += Grax.DamageReductionBoost; Player.GetDamage() += Grax.DamageBoost; } // Trinket of Chi bonus if (trinketOfChi) { - if (chiBuffTimer < TrinketofChi.ChiBuffTimerMax) + if (chiBuffTimer < TrinketofChi.ChiBuffHitlessTime) chiBuffTimer++; else Player.AddBuff(ModContent.BuffType(), 6); @@ -3620,11 +3618,6 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type != ModContent.ItemType()) planarSpeedBoost = 0; } - if (evilSmasherBoost > 0) - { - if (Player.HeldItem.type != ModContent.ItemType()) - evilSmasherBoost = 0; - } // Flight time boosts double flightTimeMult = 1D + @@ -3708,24 +3701,24 @@ namespace CalamityMod.CalPlayer if (tarraSet) Player.lifeMagnet = true; - if (whisperingDeath && !laudanum && !purity) + if (whisperingDeath && !laudanum) Player.GetDamage() -= 0.2f; - if (armorCrunch && !laudanum && !purity) + if (armorCrunch && !laudanum) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; } - if (wither && !purity) + if (wither) { Player.statDefense -= RemsRevenge.WitherDefenseReduction; } - if (eutrophication && !purity) + if (eutrophication) Player.velocity = Vector2.Zero; - if ((vaporfied && !purity) || galvanicCorrosion) + if (vaporfied || galvanicCorrosion) Player.velocity *= 0.98f; if (molluskHelmet) @@ -3735,7 +3728,7 @@ namespace CalamityMod.CalPlayer if (molluskLegs) Player.velocity.X *= 0.996f; - if ((warped) && !Player.slowFall && !Player.mount.Active) + if (warped && !Player.slowFall && !Player.mount.Active) { float velocityYMultiplier = 1.01f; Player.velocity.Y *= velocityYMultiplier; @@ -4426,82 +4419,6 @@ namespace CalamityMod.CalPlayer } #endregion - #region Lucrecia Line Effects - - public void HandleLucreciaLineEffects() - { - int lucreciaItemID = ModContent.ItemType(); - int lightspeedItemID = ModContent.ItemType(); - - if (Player.HeldItem.type == lucreciaItemID && darklightEnergy > 0) - { - lucreciaParticleTimer--; - - // If the timer is at or below zero, spawn a particle. - if (lucreciaParticleTimer <= 0) - { - // Reset the timer (spawn rate depends on energy) - lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60)); - - float radius = Main.rand.NextFloat(160f, 190f); // Distance from center - float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius - - Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; - - // Scale opacity with energy - float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy; - Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue; - color *= opacity * 0.5f; - - if (darklightEnergy >= 100) - { - color *= 2.4f; // Way brighter - } - - Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path - float rotationSpeed = 0.04f; - - var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); - GeneralParticleHandler.SpawnParticle(particle); - } - } - - if (Player.HeldItem.type == lightspeedItemID && elementalMastery > 0) - { - lucreciaParticleTimer--; - - // If the timer is at or below zero, spawn a particle. - if (lucreciaParticleTimer <= 0) - { - // Reset the timer (spawn rate depends on energy) - lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60)); - - float radius = Main.rand.NextFloat(160f, 190f); // Distance from center - float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius - - Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; - - // Scale opacity with energy - float opacity = elementalMastery / (float)Lightspeed.MaxEnergy; - Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed; - color *= opacity * 0.5f; - - if (elementalMastery >= 100) - { - color *= 2.4f; // Way brighter - } - - Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path - float rotationSpeed = 0.04f; - - var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); - GeneralParticleHandler.SpawnParticle(particle); - } - } - } - #endregion - - #region Energy Shields private void EnergyShields() { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 38abfc2178..f6ea8ea8b2 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -54,7 +54,7 @@ namespace CalamityMod.CalPlayer if (AdamantiteSet) { - adamantiteSetDefenseBoostInterpolant += 1.75f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays; + adamantiteSetDefenseBoostInterpolant += 1f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays; adamantiteSetDefenseBoostInterpolant = MathHelper.Clamp(adamantiteSetDefenseBoostInterpolant, 0f, 1f); AdamantiteSetDecayDelay = AdamantiteArmorSetChange.TimeUntilDecayBeginsAfterAttacking; } @@ -249,7 +249,7 @@ namespace CalamityMod.CalPlayer if (proj.IsMinionOrSentryRelated) center = proj.Center; Vector2 launchVel = Utils.DirectionTo(center, target.Center); - target.MoveNPC(launchVel, proj.knockBack, true); + target.MoveNPC(launchVel, proj.knockBack, true, Player); } if (moscowMule || bloodyMary) @@ -316,10 +316,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Venom, 60); break; - case ProjectileID.BoneArrow: - target.AddBuff(BuffType(), 300); - break; - case ProjectileID.NorthPoleWeapon: target.AddBuff(BuffID.Frostburn, 300); break; @@ -695,14 +691,14 @@ namespace CalamityMod.CalPlayer if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType()) { - int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10); + int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(Player.strongBees ? 15 : 10); Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f); Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); bee.ArmorPenetration = 20; bee.penetrate = 2; bee.extraUpdates = 1; - AlchFlaskCooldown = Player.strongBees ? 6 : 7; + AlchFlaskCooldown = 7; } bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability); @@ -733,20 +729,6 @@ namespace CalamityMod.CalPlayer } } - if (abaddon && crit && AbaddonCooldown <= 0 && !voidOfExtinction) - { - AbaddonCooldown = 15; - int AbaddonExploDamage = (int)Player.GetBestClassDamage().ApplyTo(Abaddon.AbaddonExploDamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); - } - - if (voidOfExtinction && crit && VoidCooldown <= 0) - { - VoidCooldown = 15; - int VoidExploDamage = (int)Player.GetBestClassDamage().ApplyTo(VoidofExtinction.VoidExploDamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), VoidExploDamage, 0f, Player.whoAmI); - } - if (ursaSergeant && ursaSergeantCooldown <= 0) { ursaSergeantCooldown = UrsaSergeant.MaxCooldown; @@ -776,7 +758,7 @@ namespace CalamityMod.CalPlayer if (hideOfDeus && hideOfDeusTimer == 0) { hideOfDeusTimer = 10; - int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); + int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(HideofAstrumDeus.StarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -1072,10 +1054,9 @@ namespace CalamityMod.CalPlayer break; } } - - if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 3) + if (modProj.stealthStrike && nanotechHitCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { - bool spawnedFeathers = false; + bool spawnedFlares = false; if (nanotech) { for (int i = 0; i < 3; i++) @@ -1086,41 +1067,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } - else if (moonCrown) - { - int lunarFlareDamage = (int)Player.GetTotalDamage().ApplyTo(MoonstoneCrown.BaseDamage); - float lunarFlareKB = 3f; - - for (int i = 0; i < 3; i++) - { - Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (position - source) / 10f; - int flare = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileID.LunarFlare, lunarFlareDamage, lunarFlareKB, proj.owner); - if (flare.WithinBounds(Main.maxProjectiles)) - Main.projectile[flare].DamageType = DamageClass.Generic; - } - } - else if (featherCrown) - { - for (int i = 0; i < 3; i++) - { - Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - float speedX = (position.X - source.X) / 30f; - float speedY = (position.Y - source.Y) * 8; - Vector2 velocity = new Vector2(speedX, speedY); - - int featherDamage = (int)Player.GetTotalDamage().ApplyTo(25); - - int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), featherDamage, 3f, proj.owner); - if (feather.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[feather].DamageType = DamageClass.Generic; - Main.projectile[feather].extraUpdates += 3; - } - } - spawnedFeathers = true; - } - rogueCrownCooldown = spawnedFeathers ? 15 : 60; + nanotechHitCooldown = spawnedFlares ? 15 : 60; } if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3) @@ -1235,12 +1182,25 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), TitanHeartMask.OnHitDebuffDuration); } } + if (magic) + { + if (moonCrown && mageCrownCount == 10) + { + target.AddBuff(BuffType(), 360); + } + if(featherCrown && mageCrownCount == 5) + { + target.AddBuff(BuffType(), 120); + } + } if (summon && !whip) { - if (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) + if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) + { target.AddBuff(BuffType(), 600); + } else if (pSoulArtifact) - target.AddBuff(BuffType(), 300); + target.AddBuff(BuffType(), 300); if (divineBless) target.AddBuff(BuffType(), AngelicAlliance.BanishingFireDuration); @@ -1266,10 +1226,10 @@ namespace CalamityMod.CalPlayer } if (amalgam) { - target.AddBuff(BuffID.Daybreak, 120); - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), 120); + target.AddBuff(BuffID.Frostburn2, 120); target.AddBuff(BuffType(), 120); - target.AddBuff(BuffType(), 120); + target.AddBuff(BuffID.Electrified, 120); target.AddBuff(BuffType(), 120); } if (frostFlare) @@ -1334,28 +1294,27 @@ namespace CalamityMod.CalPlayer if (heal > 2) heal = 2; - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.2f : 1.5f); } if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike && proj.numHits < 1) //Nanotech has the same heal as Electrician's glove - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f); - - if (bloodflareThrowing && proj.CountsAsClass() && crit) - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, 1.5f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, electricianGlove ? 2f : 3f); if (proj.CountsAsClass() && Player.HeldItem.CountsAsClass()) { if (manaOverloader) { double healMult = 0.1D - proj.numHits * 0.025D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.75f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 2f); } - if (ataxiaMage) + if (ataxiaMage && hydroHealTimer <= 0) { double healMult = HydrothermicHeadMagic.OrbHealingRatio - proj.numHits * HydrothermicHeadMagic.OrbHealingRatioLossPerPierce; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), HydrothermicHeadMagic.OrbHealingCooldownMult); + var heal = (int)Math.Round(damage * healMult); + hydroHealTimer += heal; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), heal, HydrothermicHeadMagic.OrbHealingCooldownMult); } } } diff --git a/CalPlayer/Dashes/V8000EngineDash.cs b/CalPlayer/Dashes/V8000EngineDash.cs new file mode 100644 index 0000000000..4b0e18f2ca --- /dev/null +++ b/CalPlayer/Dashes/V8000EngineDash.cs @@ -0,0 +1,190 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.Dashes +{ + public class V8000EngineDash : PlayerDashEffect + { + public static new string ID { get; private set; } + + public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam; + + public override bool IsOmnidirectional => false; + public int Time = 0; + + public override void Load() + { + ID = DashID; + } + + public override float CalculateDashSpeed(Player player) => 16f; + + public override void DashStartupEffects(Player player) + { + player.velocity *= 0.9f; + } + + public override void OnDashEffects(Player player) + { + Time = 0; + + // Burst of evenly spaced but random velocity dusts + for (int m = 0; m < 6; m++) + { + float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true); + + Vector2 trailPos = player.Center - (player.velocity * 2) + new Vector2(0, (18 - (m * 6))); + float trailScale = 1 * fxFade; + Color trailColor = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.LightSkyBlue; + + int dustStyle = ModContent.DustType(); + Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 21)); + dust2.scale = Main.rand.NextFloat(0.8f, 1.4f); + dust2.color = trailColor; + dust2.noGravity = true; + dust2.fadeIn = 0.5f; + } + + // Thruster prim + int beamCount = 3; + float maxAngle = MathHelper.ToRadians(10f); + + Vector2 baseDir = -player.velocity.SafeNormalize(Vector2.UnitX); + + for (int i = -1; i < beamCount; i++) + { + float t = i / (float)(beamCount - 1); + + float centered = t * 2f - 1f; + + float angleOffset = centered * maxAngle; + + Vector2 dir = baseDir.RotatedBy(angleOffset); + + float sizeFactor = 1f - Math.Abs(centered) * 0.7f; + + ThrusterParticle particle = new ThrusterParticle(player, dir, 16, 120f * sizeFactor, 1); + GeneralParticleHandler.SpawnParticle(particle, false, GeneralDrawLayer.BeforeProjectiles); + } + + SoundStyle sound = V8000Engine.DashSound; + SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.4f, -0.3f) }, player.Center); + } + + public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) + { + Time++; // For VFX + + if (Time % 2 == 0 && Time < 10) + { + // Angled, consistently placed sparks + Vector2 dustVel = -player.velocity.RotatedBy(0.05f + MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f; + Vector2 dustVel2 = -player.velocity.RotatedBy(-0.05f - MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f; + + PointParticle spark = new PointParticle(player.Center + new Vector2(0, -15 * player.direction) + dustVel, dustVel, false, 8, 1.25f, (Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue) * 0.66f); + GeneralParticleHandler.SpawnParticle(spark); + PointParticle spark2 = new PointParticle(player.Center + new Vector2(0, 15 * player.direction) + dustVel2, dustVel2, false, 8, 1.25f, (Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue) * 0.66f); + GeneralParticleHandler.SpawnParticle(spark2); + + // Glow beam + float fadeInLerp = Utils.GetLerpValue(0, 12, Time, true); + Color primaryColor = Color.Lerp(Color.DodgerBlue, Color.LightSkyBlue, fadeInLerp); + Particle beamBody = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 7, 0.65f - 0.3f * fadeInLerp, primaryColor * 0.8f, new Vector2(1.1f - 0.4f * fadeInLerp, 0.8f + 0.6f * fadeInLerp), true, true, shrinkSpeed: 0.6f); + GeneralParticleHandler.SpawnParticle(beamBody); + Particle beamCore = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 5, 0.35f - 0.15f * fadeInLerp, Color.Lerp(primaryColor, Color.White, 0.6f), new Vector2(0.5f, 1.4f), true, true, shrinkSpeed: 0.6f); + GeneralParticleHandler.SpawnParticle(beamCore); + + // Horizontal dust + float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true); + Vector2 trailPos = player.Center - (player.velocity * 2) + Main.rand.NextVector2Circular(10, 20); + float trailScale = 1 * fxFade; + Color trailColor = Main.rand.NextBool(3) ? Color.DodgerBlue : Color.LightSkyBlue; + + int dustStyle = ModContent.DustType(); + Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 21)); + dust2.scale = Main.rand.NextFloat(0.8f, 1.4f); + dust2.color = trailColor; + dust2.noGravity = true; + dust2.fadeIn = 0.5f; + } + + // SHPS-esque souls + if (Time % 4 == 0) + { + if (player.whoAmI == Main.myPlayer) + { + Vector2 spawnPos = player.Center + Main.rand.NextVector2Circular(10, 10); + Vector2 trailVel = -player.velocity * 0.6f + Main.rand.NextVector2Circular(3f, 3f); + + Projectile.NewProjectile(player.GetSource_FromThis(), spawnPos, trailVel, ModContent.ProjectileType(), 0, 0, player.whoAmI); + } + } + + dashSpeed = 14f; + } + + public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) + { + SoundStyle hit = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact"); + SoundEngine.PlaySound(hit with { Pitch = -0.2f, Volume = 0.4f }, player.Center); + SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 1f, Pitch = -0.2f }, player.Center); + SoundEngine.PlaySound(SoundID.Item74 with { Volume = 0.7f, Pitch = 1f }, player.Center); + + for (int i = 0; i <= 6; i++) + { + Dust dust = Dust.NewDustPerfect(player.Center, Main.rand.NextBool() ? 278 : 132, player.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(0.5f, 1f) + new Vector2(0, -3f)); + if (dust.type == 278) + { + dust.scale = 1.2f; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.LightSkyBlue; + } + else + { + dust.scale = 0.9f; + } + dust.noGravity = false; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player); + } + + Particle pulse = new DirectionalPulseRing(npc.Center, Vector2.Zero, Color.DodgerBlue * 0.8f, new Vector2(2f, 2f), 0, 0.05f, 1f, 24); + GeneralParticleHandler.SpawnParticle(pulse); + + for (int i = 0; i < 14; i++) + { + Vector2 velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(3f, 7f); + Color dustColor = Color.Lerp(Color.DodgerBlue, Color.White, Main.rand.NextFloat()); + + float scale = Main.rand.NextFloat(0.25f, .6f); + int lifetime = Main.rand.Next(30, 50); + + SquishyLightParticle plasma = new(player.Center, velocity, scale, dustColor, lifetime); + GeneralParticleHandler.SpawnParticle(plasma); + } + + // Define hit context variables. + int hitDirection = player.direction; + if (player.velocity.X != 0f) + hitDirection = Math.Sign(player.velocity.X); + hitContext.HitDirection = hitDirection; + hitContext.PlayerImmunityFrames = V8000Engine.ShieldSlamIFrames; + + // Define damage parameters. + hitContext.damageClass = DamageClass.Melee; + hitContext.BaseDamage = V8000Engine.ShieldSlamDamage; + hitContext.BaseKnockback = V8000Engine.ShieldSlamKnockback; + } + } +} diff --git a/CalPlayer/Dashes/V8EngineDash.cs b/CalPlayer/Dashes/V8EngineDash.cs new file mode 100644 index 0000000000..9b124c3cbf --- /dev/null +++ b/CalPlayer/Dashes/V8EngineDash.cs @@ -0,0 +1,117 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Graphics.Renderers; +using CalamityMod.Items.Accessories; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent.Drawing; +using Terraria.GameContent.Items; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.CalPlayer.Dashes +{ + public class V8EngineDash : PlayerDashEffect + { + public static new string ID { get; private set; } + + public override DashCollisionType CollisionType => DashCollisionType.NoCollision; + + public override bool IsOmnidirectional => false; + public int Time = 0; + + public override void Load() + { + ID = DashID; + } + + public override float CalculateDashSpeed(Player player) => 6.5f; + + public override void OnDashEffects(Player player) + { + Time = 0; + + // Burst of evenly spaced but random velocity dusts + for (int m = 0; m < 6; m++) + { + float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(player.velocity.X), true); + + Vector2 trailPos = player.Center - (player.velocity * 2) + new Vector2(0, (18 - (m * 6))); + float trailScale = 1 * fxFade; + Color trailColor = Main.rand.NextBool(3) ? Color.Firebrick : Color.OrangeRed; + + int dustStyle = ModContent.DustType(); + Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 16)); + dust2.scale = Main.rand.NextFloat(0.8f, 1.3f); + dust2.color = trailColor; + dust2.noGravity = true; + dust2.fadeIn = 0.5f; + } + + // Thruster prim + int beamCount = 3; + float maxAngle = MathHelper.ToRadians(10f); + + Vector2 baseDir = -player.velocity.SafeNormalize(Vector2.UnitX); + + for (int i = -1; i < beamCount; i++) + { + float t = i / (float)(beamCount - 1); + + float centered = t * 2f - 1f; + + float angleOffset = centered * maxAngle; + + Vector2 dir = baseDir.RotatedBy(angleOffset); + + float sizeFactor = 1f - Math.Abs(centered) * 0.7f; + + ThrusterParticle particle = new ThrusterParticle(player, dir, 12, 100f * sizeFactor, 0); + GeneralParticleHandler.SpawnParticle(particle, false, GeneralDrawLayer.BeforeProjectiles); + } + + SoundStyle sound = V8Engine.DashSound; + SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.4f, -0.3f) }, player.Center); + } + + public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor) + { + player.velocity.X *= 0.925f; + Dust hFlameDust = Dust.NewDustPerfect(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 5f), DustID.HeatRay, -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, Color.Firebrick, Main.rand.NextFloat(1.8f, 2.8f)); + + // Angled, consistently placed sparks + Vector2 dustVel = -player.velocity.RotatedBy(0.05f + MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f; + Vector2 dustVel2 = -player.velocity.RotatedBy(-0.05f - MathHelper.Clamp(Time * 0.03f, 0, 0.55f)) * 0.75f; + + PointParticle spark = new PointParticle(player.Center + new Vector2(0, -15 * player.direction) + dustVel, dustVel, false, 8, 1.25f, (Main.rand.NextBool() ? Color.Firebrick : Color.OrangeRed) * 0.66f); + GeneralParticleHandler.SpawnParticle(spark); + PointParticle spark2 = new PointParticle(player.Center + new Vector2(0, 15 * player.direction) + dustVel2, dustVel2, false, 8, 1.25f, (Main.rand.NextBool() ? Color.Firebrick : Color.OrangeRed) * 0.66f); + GeneralParticleHandler.SpawnParticle(spark2); + + // Glow beam + float fadeInLerp = Utils.GetLerpValue(0, 12, Time, true); + Color primaryColor = Color.Lerp(Color.Firebrick, Color.OrangeRed, fadeInLerp); + Particle beamBody = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 7, 0.65f - 0.3f * fadeInLerp, primaryColor * 0.8f, new Vector2(1.1f - 0.4f * fadeInLerp, 0.8f + 0.6f * fadeInLerp), true, false, shrinkSpeed: 0.6f); + GeneralParticleHandler.SpawnParticle(beamBody); + Particle beamCore = new CustomSpark(player.Center, -player.velocity * 0.15f, "CalamityMod/Particles/BloomCircle", false, 5, 0.35f - 0.15f * fadeInLerp, Color.Lerp(primaryColor, Color.White, 0.6f), new Vector2(0.5f, 1.2f), true, false, shrinkSpeed: 0.6f); + GeneralParticleHandler.SpawnParticle(beamCore); + + + for (int i = 0; i < 2; i++) + { + // Fruit loop particles, also used by Elysian Aegis + Dust dust = Dust.NewDustPerfect(player.Center + Main.rand.NextVector2Circular(6, 6) - player.velocity * 2.2f, DustID.GoldFlame); + dust.velocity = -player.velocity * Main.rand.NextFloat(0.66f, 1.8f); + dust.scale = Main.rand.NextFloat(0.4f, 1.3f); + dust.noGravity = true; + Particle sparkler = new CustomSpark(player.Center + new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-15f, 15f)) - (player.velocity * 1.2f), -player.velocity.RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.1f, 0.8f), "CalamityMod/Particles/ProvidenceMarkParticle", false, 17, Main.rand.NextFloat(1.15f, 1.25f), Main.rand.NextBool(4) ? Color.Khaki : Color.Orange, new Vector2(1.3f, 0.5f), true, false, 0, false, false, Main.rand.NextFloat(0.4f, 0.5f)); + GeneralParticleHandler.SpawnParticle(sparkler); + } + } + } +} diff --git a/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs index 74ea062c1e..6907aada5b 100644 --- a/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs +++ b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs @@ -14,7 +14,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { Player drawPlayer = drawInfo.drawPlayer; CalamityPlayer modPlayer = drawPlayer.Calamity(); - return drawInfo.shadow == 0f && !drawPlayer.dead && (modPlayer.voidAura || modPlayer.voidAuraDamage); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.VoidConcentrationStaff; } protected override void Draw(ref PlayerDrawSet drawInfo) diff --git a/CalPlayer/DrawLayers/SpringStoolBottom.png b/CalPlayer/DrawLayers/SpringStoolBottom.png new file mode 100644 index 0000000000..9c11a5cf0d Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolBottom.png differ diff --git a/CalPlayer/DrawLayers/SpringStoolLayer.cs b/CalPlayer/DrawLayers/SpringStoolLayer.cs new file mode 100644 index 0000000000..5343d50ce5 --- /dev/null +++ b/CalPlayer/DrawLayers/SpringStoolLayer.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.ExtraJumps; +using CalamityMod.Items.Accessories; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; +using static Terraria.ModLoader.PlayerDrawLayer; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class SpringStoolLayer : PlayerDrawLayer + { + private Asset stoolTexture; + private Asset springTexture; + private Asset topTexture; + + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Leggings); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + // Only draw if the player is holding Up and still + return drawInfo.drawPlayer.GetModPlayer().springStool && + drawInfo.drawPlayer.portableStoolInfo.IsInUse; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + // Load textures if null + stoolTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolBottom"); + springTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolSpring"); + topTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolTop"); + + Texture2D stoolTex = stoolTexture.Value; + Texture2D springTex = springTexture.Value; + Texture2D topTex = topTexture.Value; + + // Bottom Position + Vector2 bottomPosition = new Vector2( + (int)(drawInfo.Position.X - Main.screenPosition.X + drawPlayer.width / 2f), + (int)(drawInfo.Position.Y - Main.screenPosition.Y + drawPlayer.height + drawPlayer.portableStoolInfo.HeightBoost) + ); + Rectangle bottomSource = stoolTex.Frame(); + Vector2 bottomOrigin = new Vector2(bottomSource.Width / 2f, bottomSource.Height - 2); + + // Spring + Vector2 springPosition = bottomPosition - new Vector2(0, bottomSource.Height); + Rectangle springSource = springTex.Frame(); + Vector2 springOrigin = new Vector2(springSource.Width / 2f, springSource.Height - 2); + + // Top + Vector2 topPosition = springPosition - new Vector2(0, springSource.Height - 5); + Rectangle topSource = topTex.Frame(); + Vector2 topOrigin = new Vector2(topSource.Width / 2f, topSource.Height); + + // Add all to cache + DrawPart(ref drawInfo, stoolTex, bottomPosition, bottomSource, bottomOrigin); + DrawPart(ref drawInfo, springTex, springPosition, springSource, springOrigin); + DrawPart(ref drawInfo, topTex, topPosition, topSource, topOrigin); + } + + private void DrawPart(ref PlayerDrawSet drawInfo, Texture2D tex, Vector2 pos, Rectangle src, Vector2 origin) + { + drawInfo.DrawDataCache.Add(new DrawData(tex, pos, src, drawInfo.colorArmorLegs, drawInfo.drawPlayer.bodyRotation, origin, 1f, drawInfo.playerEffect, 0) + { shader = drawInfo.cPortableStool }); + } + } +} diff --git a/CalPlayer/DrawLayers/SpringStoolSpring.png b/CalPlayer/DrawLayers/SpringStoolSpring.png new file mode 100644 index 0000000000..82271ba49b Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolSpring.png differ diff --git a/CalPlayer/DrawLayers/SpringStoolTop.png b/CalPlayer/DrawLayers/SpringStoolTop.png new file mode 100644 index 0000000000..0cdc45e3ef Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolTop.png differ diff --git a/CalamityConfig.cs b/CalamityConfig.cs index af43e1923a..7c72d2f83d 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -46,6 +46,10 @@ namespace CalamityMod [DefaultValue(false)] public bool Photosensitivity { get; set; } + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + public bool BoCSpriteChange { get; set; } + [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool EnableVanillaTextureEdits { get; set; } diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 235da907f4..62b5f44039 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -18,6 +18,7 @@ namespace CalamityMod public static ModKeybind NormalityRelocatorHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } + public static ModKeybind SpringStoolJumpHotKey { get; private set; } public static ModKeybind TransformerHotKey { get; private set; } public static ModKeybind SwitchGravityHotkey {get; private set;} public static ModKeybind ExpandDebuffInfo { get; private set; } @@ -40,6 +41,7 @@ namespace CalamityMod NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z"); RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); + SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U"); TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K"); SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T"); ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl"); @@ -62,6 +64,7 @@ namespace CalamityMod NormalityRelocatorHotKey = null; RageHotKey = null; SpectralVeilHotKey = null; + SpringStoolJumpHotKey = null; TransformerHotKey = null; ExpandDebuffInfo = null; } diff --git a/ChatTags/CalamityBuffTagHandler.cs b/ChatTags/BuffTagEnemyEffectHandler.cs similarity index 97% rename from ChatTags/CalamityBuffTagHandler.cs rename to ChatTags/BuffTagEnemyEffectHandler.cs index d8f36a5862..c7f9735176 100644 --- a/ChatTags/CalamityBuffTagHandler.cs +++ b/ChatTags/BuffTagEnemyEffectHandler.cs @@ -11,7 +11,7 @@ using Terraria.UI.Chat; namespace CalamityMod.ChatTags { - public sealed class CalamityBuffTagHandler : AbstractTagHandler + public sealed class BuffTagEnemyEffectHandler : AbstractTagHandler { public sealed class Snippet(int buffId) : TextSnippet { diff --git a/ChatTags/BuffTagPlayerEffectHandler.cs b/ChatTags/BuffTagPlayerEffectHandler.cs new file mode 100644 index 0000000000..7a2c145c4f --- /dev/null +++ b/ChatTags/BuffTagPlayerEffectHandler.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; + +namespace CalamityMod.ChatTags +{ + public sealed class BuffTagPlayerEffectHandler : AbstractTagHandler + { + public sealed class Snippet(int buffId) : TextSnippet + { + private const float IconSize = 26f; + + public int BuffId => buffId; + + public bool DrawIcon => true; + + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = default, Color color = default, float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), IconSize); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + // Avoid re-drawing the icon when drawing borders. + if (DrawIcon) + { + // Tomat: I would love to support + // BuffLoader.[Pre/Post]Draw here, but it's not vaible + // because: + // 1. Main.DrawBuffIcon relies on LocalPlayer's buffs, + // 2. we can't control the source or destination + // rectangles. + + if (Main.netMode != NetmodeID.Server && !Main.dedServ) + { + var texture = TextureAssets.Buff[BuffId]; + spriteBatch.Draw(texture.Value, new Rectangle((int)position.X, (int)position.Y - 2, (int)IconSize, (int)IconSize), null, Color.White); + } + + position.X += IconSize; + } + + var buffColor = CalamityUtils.GetDebuffTooltipNameColor(buffId); + var name = $"{(DrawIcon ? " " : "")}{Lang.GetBuffName(buffId)}"; + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, name, position, buffColor, 0f, Vector2.Zero, new Vector2(scale)); + } + return true; + } + + public override float GetStringLength(DynamicSpriteFont font) + { + float iconSize = !DrawIcon ? 0f : IconSize + font.MeasureString(" ").X; + float size = iconSize + font.MeasureString(Lang.GetBuffName(buffId)).X; + return size * Scale; + } + } + + protected override string[] TagNames { get; } = ["cbuffplr"]; + + public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) + { + if (int.TryParse(text, out int buffId) && buffId >= 0 && buffId < BuffLoader.BuffCount) + { + return new Snippet(buffId); + } + + if (BuffID.Search.TryGetId(text, out buffId)) + { + return new Snippet(buffId); + } + + return new TextSnippet(text); + } + } +} diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index b697488611..e22fb8fb3a 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -6,7 +6,6 @@ using Terraria.ModLoader; namespace CalamityMod.Cooldowns { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. public sealed class CooldownRegistry : ModSystem { // Indexed by ushort netID. Contains every registered cooldown. diff --git a/Cooldowns/FleshTotem.cs b/Cooldowns/FleshTotem.cs deleted file mode 100644 index 8b1fe7812f..0000000000 --- a/Cooldowns/FleshTotem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria.Localization; - -namespace CalamityMod.Cooldowns -{ - public class FleshTotem : CooldownHandler - { - public static new string ID => "FleshTotem"; - - public override bool ShouldDisplay => true; - public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/FleshTotem"; - public override Color OutlineColor => new Color(157, 248, 234); - public override Color CooldownStartColor => new Color(111, 169, 241); - public override Color CooldownEndColor => new Color(111, 169, 241); - } -} diff --git a/Cooldowns/FleshTotem.png b/Cooldowns/FleshTotem.png deleted file mode 100644 index 02416e8b00..0000000000 Binary files a/Cooldowns/FleshTotem.png and /dev/null differ diff --git a/Cooldowns/FleshTotemOutline.png b/Cooldowns/FleshTotemOutline.png deleted file mode 100644 index 19a1f705eb..0000000000 Binary files a/Cooldowns/FleshTotemOutline.png and /dev/null differ diff --git a/Cooldowns/FleshTotemOverlay.png b/Cooldowns/FleshTotemOverlay.png deleted file mode 100644 index 7bb57aee77..0000000000 Binary files a/Cooldowns/FleshTotemOverlay.png and /dev/null differ diff --git a/Cooldowns/Stooldown.cs b/Cooldowns/Stooldown.cs new file mode 100644 index 0000000000..888044482c --- /dev/null +++ b/Cooldowns/Stooldown.cs @@ -0,0 +1,30 @@ +using System; +using CalamityMod.Items.Accessories; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Cooldowns +{ + public class Stooldown : CooldownHandler + { + public static new string ID => "Stooldown"; + public override bool ShouldDisplay => true; + public override bool CanTickDown => true; + public override void Tick() + { + base.Tick(); + } + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/Stooldown"; + public override Color OutlineColor => Color.SandyBrown; + public override Color CooldownStartColor => Color.Brown; + public override Color CooldownEndColor => Color.Khaki; + + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff"); + } +} diff --git a/Cooldowns/Stooldown.png b/Cooldowns/Stooldown.png new file mode 100644 index 0000000000..60913ece69 Binary files /dev/null and b/Cooldowns/Stooldown.png differ diff --git a/Cooldowns/StooldownOutline.png b/Cooldowns/StooldownOutline.png new file mode 100644 index 0000000000..93ce7852e0 Binary files /dev/null and b/Cooldowns/StooldownOutline.png differ diff --git a/Cooldowns/StooldownOverlay.png b/Cooldowns/StooldownOverlay.png new file mode 100644 index 0000000000..e9226d6904 Binary files /dev/null and b/Cooldowns/StooldownOverlay.png differ diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index 743b703740..ae5320365e 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -1,9 +1,9 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.WorldBuilding; namespace CalamityMod.DataStructures { @@ -224,7 +224,8 @@ namespace CalamityMod.DataStructures .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) )))) : - cnpc.ActiveTypelessDebuffMultiplier; + // Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point. + buffType == ModContent.BuffType() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default; //Ensure at least 25% effectiveness if (totalScaling.Multiplicative <= 0.25f) @@ -257,7 +258,8 @@ namespace CalamityMod.DataStructures .CombineWith(ApplyScalingToStatModifer(cnpc.ActiveElectricDebuffMultiplier, ElectricDebuffScaling) )))) : - cnpc.ActiveTypelessDebuffMultiplier; + // Bane doesn't scale with debuff multipliers. This should be implemented as a default feature you can apply to debuffs at some point. + buffType == ModContent.BuffType() ? cnpc.ActiveTypelessDebuffMultiplier : StatModifier.Default; //Ensure at least 25% effectiveness if (totalScaling.Multiplicative <= 0.25f) @@ -419,7 +421,7 @@ namespace CalamityMod.DataStructures }; public static DebuffData Electrified = new DebuffData(DebuffBehavior.Electric) { - EnemyLostRegen = 21, + EnemyLostRegen = 30, // 15 dps stationary, 60 dps moving EnemyVanillaRegenToCancelOut = 8, ElectricDebuffScaling = 1 }; diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index 19274a48c6..e117db21b2 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -202,7 +202,7 @@ namespace CalamityMod.DataStructures PreviouslyUsedGem = usedGemType; } - public void PlayerOnHitEffects(int hitDamage) + public void PlayerOnHitEffects(Player.HurtInfo hurtInfo) { // Don't do anything if the player is not wearing the Gem Tech set. var cgp = Owner.Calamity(); @@ -211,6 +211,7 @@ namespace CalamityMod.DataStructures bool gemWasLost = false; int gemDamage = 0; + int hitDamage = (int)hurtInfo.Damage; bool largeEnoughRegularHit = hitDamage >= GemTechHeadgear.GemBreakDamageLowerBound; // 09FEB2024: Ozzatron: chalice of the blood god no longer protects you when using gem tech armor. // It is now slightly anti-synergetic, in that taking tiny hits when you're already bleeding will make you keep losing gems. @@ -275,7 +276,7 @@ namespace CalamityMod.DataStructures gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold); if (Main.myPlayer == OwnerIndex) - Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.HeldItem), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); + Projectile.NewProjectile(Owner.GetSource_OnHurt(hurtInfo.DamageSource), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); } } diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json new file mode 100644 index 0000000000..2b0ab25d50 --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.CrimsonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF0000", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "You, slayer of the flesh tower...[Pause(0.25)] we have an offer fitting of your deeds." + ] + }, + { + "Lines": [ + "We can bestow you might untold...[Pause(0.25)] [Shaking:to grind your enemies to dust!]" + ] + }, + { + "Lines": [ + "Simply yield the holy hammer unto the altar." + ] + }, + { + "Lines": [ + "Kneel, and we shall render you the strength." + ] + } + ] +} diff --git a/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json new file mode 100644 index 0000000000..bfdd7ae10c --- /dev/null +++ b/Dialogues/en-US/Dialogue.Mods.CalamityMod.EvilSmasher.DemonAltar.json @@ -0,0 +1,47 @@ +{ + "Revision": 1, + "DefaultColor": "FF00FF", + "DefaultSpeaker": "DemonAltar", + "AlignType": 1, + "TextDelay": 2, + "BasePunctuationDelay": { + "Delay": 10, + "ForceSet": false, + "Locks": false + }, + "PunctuationDelayCap": 30, + "PunctuationDelays": { + "!": { + "Delay": 20, + "ForceSet": true, + "Locks": true + }, + "?": { + "Delay": 20, + "ForceSet": true, + "Locks": true + } + }, + "Pages": [ + { + "Lines": [ + "Bearer of the Holy Hammer...[Pause(0.25)] [Wavy:desirest thou to taste true power?]" + ] + }, + { + "Lines": [ + "Thine eyes shall be opened...[Pause(0.25)] [Shaking:thou shalt be even as the gods!]" + ] + }, + { + "Lines": [ + "Yield the hammer unto us upon the altar." + ] + }, + { + "Lines": [ + "Surrender, and thou shalt surely receive our might." + ] + } + ] +} diff --git a/Dusts/SquashDust.cs b/Dusts/SquashDust.cs index 8adfb2beaa..425763512a 100644 --- a/Dusts/SquashDust.cs +++ b/Dusts/SquashDust.cs @@ -56,7 +56,11 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { - Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); + Vector2 baseSize = Vector2.One; + if (dust.customData != null && dust.customData is Vector2) + baseSize = (Vector2)dust.customData; + + Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); // Glow Orb Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); @@ -82,7 +86,11 @@ namespace CalamityMod.Dusts private static void DrawPixelated(Dust dust) { - Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)); + Vector2 baseSize = Vector2.One; + if (dust.customData != null && dust.customData is Vector2) + baseSize = (Vector2)dust.customData; + + Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); // Glow Orb Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); diff --git a/Dusts/VoidDust.cs b/Dusts/VoidDust.cs index e66a8f3bf4..22eeafbd4c 100644 --- a/Dusts/VoidDust.cs +++ b/Dusts/VoidDust.cs @@ -31,30 +31,51 @@ namespace CalamityMod.Dusts public override bool Update(Dust dust) { - dust.rotation += MathF.Sign(dust.velocity.X); - dust.velocity *= 0.98f; + float fade = (1 + dust.fadeIn); + dust.velocity *= 0.96f; if (dust.noGravity) - dust.scale += 0.02f; + dust.scale -= 0.05f * fade; else - dust.scale -= 0.01f; + dust.scale -= 0.065f * fade; float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f); if (!dust.noLightEmittence) Lighting.AddLight(dust.position, dust.color.ToVector3() * light); + + if (dust.scale <= 0) + dust.active = false; - return true; + dust.position += dust.velocity; + return false; + } + public override bool MidUpdate(Dust dust) + { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; + return false; } public override bool PreDraw(Dust dust) { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; + Vector2 baseSize = Vector2.One; + bool useSquash = false; + float squashMaxSpeed = 0; + if (dust.customData != null && dust.customData is int) + { + useSquash = true; + squashMaxSpeed = (float)dust.customData; + } + + Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize; + if (!dust.noLight) { // Glow Orb - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); return false; } } @@ -65,20 +86,32 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts); return false; } private static void DrawPixelated(Dust dust) { + Vector2 baseSize = Vector2.One; + bool useSquash = false; + float squashMaxSpeed = 0; + if (dust.customData != null && dust.customData is int) + { + useSquash = true; + squashMaxSpeed = (int)dust.customData; + } + + Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize; + if (!dust.noLight) { // Glow Orb - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); } } } diff --git a/Gores/AquaticScourgeGores/AquaticUrchin.png b/Gores/AquaticScourgeGores/AquaticUrchin.png index 356efb49f0..ce015fb455 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin.png and b/Gores/AquaticScourgeGores/AquaticUrchin.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin2.png b/Gores/AquaticScourgeGores/AquaticUrchin2.png index 44a021dbe4..93e0dba709 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin2.png and b/Gores/AquaticScourgeGores/AquaticUrchin2.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin3.png b/Gores/AquaticScourgeGores/AquaticUrchin3.png index 8d8532f288..4bf306fc2b 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin3.png and b/Gores/AquaticScourgeGores/AquaticUrchin3.png differ diff --git a/Gores/DespairStoneGores/DespairStone.png b/Gores/DespairStoneGores/DespairStone.png index 2a59f561f1..044cd25bb1 100644 Binary files a/Gores/DespairStoneGores/DespairStone.png and b/Gores/DespairStoneGores/DespairStone.png differ diff --git a/Gores/DespairStoneGores/DespairStone2.png b/Gores/DespairStoneGores/DespairStone2.png index 1745408b2a..aa2b5b0df7 100644 Binary files a/Gores/DespairStoneGores/DespairStone2.png and b/Gores/DespairStoneGores/DespairStone2.png differ diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index bb03985b48..2e0e15714d 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -686,5 +686,67 @@ namespace CalamityMod.ILEditing return orig(self); } #endregion + + #region Adjust lifesteal costs + /// + /// Reimplemnts our own implementation of Spectre Healing so we can customize effects + /// Also means it will no longer reduce lifesteal cooldown when hitting with non-magic attacks, and not proc if every player is full HP + /// + /// + /// + /// + /// + /// + private static void AdjustSpectreHealing(On_Projectile.orig_ghostHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim) + { + float HealingMultiplier = 0.2f; + float LifestealCooldownMult = 0.66f; + + var owner = Main.player[self.owner]; + HealingMultiplier -= self.numHits * 0.05f; + int AmountToHeal = (int)Math.Round(dmg * HealingMultiplier); + if (!self.magic || AmountToHeal <= 0 || Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + float MissingLifeGoal = 0f; + int targetPlayer = self.owner; + foreach (var player in Main.ActivePlayers) + { + if (!player.dead && ((!self.hostile && !owner.hostile) || owner.team == player.team) && self.Distance(player.Center) <= 3000f) + { + int MissingLife = player.statLifeMax2 - player.statLife; + if ((float)MissingLife > MissingLifeGoal) + { + MissingLifeGoal = MissingLife; + targetPlayer = player.whoAmI; + } + } + } + AmountToHeal = (int)MathHelper.Min(AmountToHeal, MissingLifeGoal); + if (AmountToHeal <= 0) + return; + owner.lifeSteal -= AmountToHeal * LifestealCooldownMult; + Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.SetBonus_GhostHeal)), Position.X, Position.Y, 0f, 0f, ProjectileID.SpiritHeal, 0, 0f, self.owner, targetPlayer, AmountToHeal); + } + /// + /// Adjust Vampire Knives implementation, stopping them from trying to heal when at full HP + /// + /// + /// + /// + /// + /// + private static void AdjustVampireHealing(On_Projectile.orig_vampireHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim) + { + int healAmount = (int)(dmg * 0.075f); + float LifestealCooldownMult = 1f; + if ((int)healAmount != 0 && !(Main.player[Main.myPlayer].lifeSteal <= 0f) && Main.player[Main.myPlayer].statLifeMax2 > Main.player[Main.myPlayer].statLife) + { + Main.player[Main.myPlayer].lifeSteal -= healAmount * LifestealCooldownMult; + Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.VampireKnives)), Position.X, Position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, self.owner, self.owner, healAmount); + } + } + #endregion } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 0e39b0ffa5..d5fb8e25e0 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -3,7 +3,6 @@ using CalamityMod.Tiles.FurnitureExo; using Terraria; using Terraria.DataStructures; using Terraria.GameContent; -using Terraria.GameContent.Biomes; using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; using Terraria.GameContent.ItemDropRules; @@ -112,6 +111,8 @@ namespace CalamityMod.ILEditing On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable; IL_Player.UpdateBuffs += UpdateBuffsBalancingChanges; IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR; + On_Projectile.ghostHeal += AdjustSpectreHealing; + On_Projectile.vampireHeal += AdjustVampireHealing; // Movement speed balance IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 6f3dfd0ba5..cb9c3ab317 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -1,4 +1,6 @@ -using Terraria; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -10,11 +12,8 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int CritBoost = 8; public static float BrimstoneFlamesReduction = 0.5f; - public static int AbaddonExploDamage = 25; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, BrimstoneFlamesReduction.ToPercent()); - + public static float critScaling = 3f; // How effective crit chance is at increasing debuff damage public override void SetDefaults() { Item.width = 26; @@ -27,7 +26,13 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().abaddon = true; - player.GetCritChance() += CritBoost; + player.Calamity().abaddonEffectVisual = !hideVisual; + } + public override void ModifyTooltips(List list) + { + if (Main.LocalPlayer != null) + list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().abaddon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString()) + : this.GetLocalizedValue("Unequipped")); } } } diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 8cd7145e58..7804ef5748 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -13,8 +14,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MaxLifeBoost = 50; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond()); + public static int MinRegenBoost => 2; + public static int MaxRegenBoost => 6; + public static float RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() { @@ -28,19 +32,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += MaxLifeBoost; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - - // Inherits all effects of Honey Dew and Living Dew - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; - - // Add light if the other accessories aren't equipped and visibility is turned on - if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual) + if (!modPlayer.purity && !hideVisual) Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f)); } @@ -49,7 +42,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", player.Calamity().radiantOozeRegen.ToString("0.##")); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index e0cc74a488..aca8d30b28 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -48,8 +48,6 @@ namespace CalamityMod.Items.Accessories player.GetDamage() += DamageBoost; player.GetDamage() += TotalSummonDamageBoost - DamageBoost; player.maxMinions += MinionSlotBoost; - if (player.wingTime < player.wingTimeMax) - player.lifeRegen += RegenBoostDuringFlight; } public override void AddRecipes() diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/Apollyon.cs similarity index 50% rename from Items/Accessories/VoidofExtinction.cs rename to Items/Accessories/Apollyon.cs index 7be242b9da..6a886f3eff 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/Apollyon.cs @@ -1,20 +1,20 @@ -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class VoidofExtinction : ModItem, ILocalizedModType + [LegacyName("VoidofExtinction")] + public class Apollyon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public static int CritBoost = 13; - public static int VoidExploDamage = 40; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, Abaddon.BrimstoneFlamesReduction.ToPercent()); - + public static float critScaling = 8f; // How effective crit chance is at increasing debuff damage + public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff public override void SetDefaults() { Item.width = 26; @@ -37,10 +37,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.voidOfExtinction = true; - modPlayer.abaddon = true; - player.GetCritChance() += CritBoost; - + modPlayer.apollyon = true; + modPlayer.abaddonEffectVisual = !hideVisual; + } + public override void ModifyTooltips(List list) + { + if (Main.LocalPlayer != null) + list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().apollyon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString()) + : this.GetLocalizedValue("Unequipped")); } } } diff --git a/Items/Accessories/VoidofExtinction.png b/Items/Accessories/Apollyon.png similarity index 100% rename from Items/Accessories/VoidofExtinction.png rename to Items/Accessories/Apollyon.png diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index dbe9935d5d..c3106ab870 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MaxDefenseBoost = 20; + public static int MaxDefenseBoost = 15; public static float MaxMoveSpeedReduction = 0.1f; public static int TimeToReachMaxBoost = CalamityUtils.SecondsToFrames(10); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TimeToReachMaxBoost.FramesToSeconds(), MaxDefenseBoost, MaxMoveSpeedReduction.ToPercent()); diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index 8b743a1c10..ed7d14d158 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public class ChaosStone : ModItem, ILocalizedModType { public static float LostRegenPer100Mana => 8; - public static float DamageMultPer100Mana => 0.04f; + public static float DamageMultPer100Mana => 0.05f; public new string LocalizationCategory => "Items.Accessories"; public override void ModifyTooltips(List tooltips) { diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 9c4b4cfca5..6eebae181d 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,11 +9,14 @@ namespace CalamityMod.Items.Accessories public class CrownJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 1; + public static int ReducedDoTAmount = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 26; Item.height = 26; - Item.defense = 1; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; @@ -22,6 +26,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.crownJewel = true; + player.lifeRegen += RegenBoost; } } } diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index 32593b0266..4df2e3455a 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -83,6 +83,13 @@ namespace CalamityMod.Items.Accessories AddIngredient(10). AddTile(TileID.TinkerersWorkbench). Register(); + CreateRecipe(). + AddIngredient(ItemID.BeeCloak). + AddIngredient(ItemID.CrossNecklace). + AddIngredient(ItemID.PanicNecklace). + AddIngredient(10). + AddTile(TileID.TinkerersWorkbench). + Register(); } } } diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index 01132959e8..172ca19e4e 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [AutoloadEquip(EquipType.Face)] - public class FeatherCrown : ModItem, ILocalizedModType + public class FeatherCrown : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() @@ -28,12 +28,22 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Orange; Item.accessory = true; } + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) + { + return incomingItem.type != ModContent.ItemType(); + } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.rogueVelocity += 0.15f; modPlayer.featherCrown = true; + modPlayer.mageCrownVisibility = !hideVisual; + player.GetDamage() += (0.02f * modPlayer.mageCrownCount); //2% per feather, up to 10% + player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per feather, up to 5% + if (modPlayer.mageCrownCount >= 5) //At 5 feathers, grant 5% crit. Static Discharge infliction is handed in CalPlayerOnHit + { + player.GetCritChance() += 5; + } } public override void AddRecipes() diff --git a/Items/Accessories/FleshTotem.cs b/Items/Accessories/FleshTotem.cs index 43a6d21ea8..0d19323f73 100644 --- a/Items/Accessories/FleshTotem.cs +++ b/Items/Accessories/FleshTotem.cs @@ -1,4 +1,6 @@ using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Items.Accessories public class FleshTotem : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int manaStorageMax = 600; + public const int lostSoulDamage = 200; + public override void SetDefaults() { Item.width = 26; @@ -21,6 +27,22 @@ 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) + { + var source = player.GetSource_Accessory(Item); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + { + int damage = (int)player.GetTotalDamage().ApplyTo(lostSoulDamage); + + int effigy = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); + if (Main.projectile.IndexInRange(effigy)) + Main.projectile[effigy].originalDamage = lostSoulDamage; + } + } } } } diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 2630de753f..9bb739c49d 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,10 +9,10 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RegenBoost = 3; + public static int RegenBoost = 2; public static int DefenseBoost = 5; public static float SummonDamageBoost = 0.1f; - + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 26; diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index cedef67539..854d5f27b0 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,6 +9,9 @@ namespace CalamityMod.Items.Accessories public class HoneyDew : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent()); public override void SetDefaults() { Item.width = 20; @@ -19,11 +23,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 10; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.honeyDewHalveDebuffs = true; + modPlayer.honeyDew = true; } public override void AddRecipes() diff --git a/Items/Accessories/InfectedJewel.cs b/Items/Accessories/InfectedJewel.cs index 7746446c7f..c88977e5ba 100644 --- a/Items/Accessories/InfectedJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,11 +12,15 @@ namespace CalamityMod.Items.Accessories public class InfectedJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 2; + public static int ReducedDoTAmount = 8; + public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(10); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond(), PostDebuffRegenTimeBoost.FramesToSeconds()); public override void SetDefaults() { Item.width = 26; Item.height = 26; - Item.defense = 4; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; @@ -25,6 +30,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.infectedJewel = true; + player.lifeRegen += RegenBoost; } public override void AddRecipes() diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index ca84090d44..2ab98916c6 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Accessories public class LivingDew : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() { Item.width = 34; @@ -20,14 +25,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 25; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // Inherits all effects of Honey Dew CalamityPlayer modPlayer = player.Calamity(); - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; + modPlayer.livingDew = true; } public override void AddRecipes() diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index 094772ac70..13913e6373 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Blue; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.accessory = true; - Item.defense = 3; + Item.defense = 2; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 56872a2ae0..cc6ed61b48 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -7,15 +7,12 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [AutoloadEquip(EquipType.Face)] - public class MoonstoneCrown : ModItem, ILocalizedModType + public class MoonstoneCrown : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; - // Base damage of lunar flares on stealth strikes. Increased by rogue damage stats, but not stealth damage. - internal static int BaseDamage = 75; public override void SetStaticDefaults() { - if (!Main.dedServ) { int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); @@ -31,12 +28,27 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Purple; Item.accessory = true; } + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) + { + return incomingItem.type != ModContent.ItemType(); + } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.rogueVelocity += 0.15f; modPlayer.moonCrown = true; + modPlayer.mageCrownVisibility = !hideVisual; + player.statManaMax2 += 70; + player.GetDamage() += (0.02f * modPlayer.mageCrownCount); //2% per moon sigil, up to 20% + player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per moon sigil, up to 10% + if (modPlayer.mageCrownCount >= 5) //At 5 sigils, grant a mana regen bonus + { + player.manaRegenBonus += 10; + } + if (modPlayer.mageCrownCount >= 10) //At 10 sigils, grant 10% crit. Nightwither infliction is handed in CalPlayerOnHit + { + player.GetCritChance() += 10; + } } public override void AddRecipes() diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index 844359471b..270d1bbe1c 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). AddIngredient(). AddIngredient(4). AddTile(). diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index ab6f1b20eb..9804f10732 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -17,9 +18,9 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 2; - public static int DefenseBoost = 10; + public static int DefenseBoost = 8; public static float SummonDamageBoost = 0.1f; - + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index 7fbffc9bb8..46823c36ed 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; @@ -7,14 +8,23 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [LegacyName("AstralArcanum", "Purity")] - public class Radiance : ModItem, ILocalizedModType, IHoldShiftTooltipItem + public class Radiance : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MinRegenBoost => 2; + public static int MaxRegenBoost => 8; + public static int ReducedDoTAmount => 20; + public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(10); + public static float RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(),MaxRegenBoost.ToRegenPerSecond(),ReducedDoTAmount.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(),RegenTimeBoost.ToPercent()); public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); @@ -25,7 +35,6 @@ namespace CalamityMod.Items.Accessories { Item.width = 18; Item.height = 44; - Item.defense = 5; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); @@ -34,19 +43,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += 70; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving modPlayer.purity = true; - - // Inherits effects from Honey Dew and Living Dew - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; - - // Add light if the other accessories aren't equipped and visibility is turned on - if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual) + if (!hideVisual) Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f)); } @@ -56,8 +54,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", player.Calamity().purityRegen.ToString("0.##")); - list.FindAndReplace("[DEFENSE]", player.Calamity().jewelBonusDefense.ToString()); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 6c5173059b..e4f31b3ee8 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -13,8 +14,8 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MinRegenBoost = 4; - public static int MaxRegenBoost = 10; + public static int MinRegenBoost => 1; + public static int MaxRegenBoost => 5; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond()); public override void SetDefaults() @@ -29,11 +30,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - - // bool left in for abyss light purposes and life regen effects modPlayer.rOoze = true; - // Add light if the other accessories aren't equipped and visibility is turned on if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual) Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f)); } @@ -43,7 +41,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", (player.Calamity().radiantOozeRegen).ToString("0.##")); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index bfe585034b..fad5af576a 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,8 +9,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int SandVeilDefenseBoost = 4; - + public static int SandVeilDuration = CalamityUtils.SecondsToFrames(15); + public static int SandVeilDefenseBoost = 3; + public static float SandVeilAccelerationBoost = 0.75f; + public static int SandVeilCooldown = CalamityUtils.SecondsToFrames(15); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SandVeilDuration.FramesToSeconds(), SandVeilDefenseBoost, SandVeilAccelerationBoost.ToPercent(), SandVeilCooldown.FramesToSeconds()); public override void SetDefaults() { Item.width = 30; diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index 02daf35a01..00ef2c412f 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -78,11 +78,11 @@ namespace CalamityMod.Items.Accessories // If the NPC can be moved, violently shove them away. Make them susceptible to fall damage on empowered parries. // Otherwise, simply deal a large amount of damage to them if empowered. - if (npc.CanBeMoved(true)) + if (npc.CanBeMoved()) { // The NPC has to actually have its velocity changed, because TileCollisionHarmNPC only changes its position. Not confusing at all! Vector2 shoveVelocity = Utils.DirectionTo(player.Center, npc.Center) * (Main.zenithWorld ? 35f : 12.5f) - Vector2.UnitY * 6f; - npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true); + npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true, player); int scaledFallDamage = CalamityUtils.ScaleWithDifficulty(ShoveFallBaseDamage); var flungNPC = npc.GetGlobalNPC(); diff --git a/Items/Accessories/SlagsplitterPauldron.cs b/Items/Accessories/SlagsplitterPauldron.cs index 0bce37c59f..62ca8e1c6d 100644 --- a/Items/Accessories/SlagsplitterPauldron.cs +++ b/Items/Accessories/SlagsplitterPauldron.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Accessories public static int PauldronSlamDamage = 330; public override void SetDefaults() { - Item.width = 54; - Item.height = 56; + Item.width = 42; + Item.height = 34; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/SlagsplitterPauldron.png b/Items/Accessories/SlagsplitterPauldron.png index f80c4876b9..ced8412b7b 100644 Binary files a/Items/Accessories/SlagsplitterPauldron.png and b/Items/Accessories/SlagsplitterPauldron.png differ diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index c190df2877..1816783be4 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -10,10 +11,10 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RegenBoost = 2; - public static int DefenseBoost = 3; + public static int RegenBoost = 1; + public static int DefenseBoost = 2; public static float SummonDamageBoost = 0.1f; - + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 24; diff --git a/Items/Accessories/SpringStool.cs b/Items/Accessories/SpringStool.cs new file mode 100644 index 0000000000..e68a6b1687 --- /dev/null +++ b/Items/Accessories/SpringStool.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class SpringStool : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpringStoolJumpHotKey); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((JumpCooldown).FramesToSeconds(), (CritRateBoostAboveTargets)); + + public static int JumpCooldown = CalamityUtils.SecondsToFrames(20); + public static int CritRateBoostAboveTargets = 5; + + public override void SetDefaults() + { + Item.width = 30; + Item.height = 46; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer().springStool = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.PortableStool). + AddRecipeGroup("AnyCopperBar", 3). + AddTile(TileID.Anvils). + Register(); + } + } + + + public class SpringStoolPlayer : ModPlayer + { + public bool springStool = false; + public int springStoolTimer = 0; + public bool hasGroundedSinceJump = true; + + public override void Load() + { + // Hook directly into vanilla's stool drawing + On_PlayerDrawLayers.DrawPlayer_03_PortableStool += HandleStoolStacking; + + // Used to apply the conditional crit chance boost + // Projectiles uses standard tML hooks + On_Player.ProcessHitAgainstNPC += HandleExtraMeleeHitboxCrit; + } + + public override void PostUpdate() + { + bool theCollisionCheck = Collision.TileCollision(Player.position + Vector2.UnitY, Vector2.Zero, Player.width, Player.height, fallThrough: false, fall2: false).Y == 0f; + + if ((Player.velocity.Y == 0 && theCollisionCheck) || Player.grappling[0] >= 0) + hasGroundedSinceJump = true; + } + + public override void PostUpdateEquips() + { + if (CalamityKeybinds.SpringStoolJumpHotKey.JustPressed && springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && !Player.mount.Active && hasGroundedSinceJump) + { + springStoolTimer = 12; + + Player.AddCooldown(Stooldown.ID, (int)SpringStool.JumpCooldown, true); + hasGroundedSinceJump = false; + + Vector2 spawnPos = Player.Bottom + new Vector2(0f, -60f); + + // Spawn stool with downward and randomly angled force + Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos, new Vector2(Main.rand.NextFloat(-1f, 1f), 1.2f), ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + SoundEngine.PlaySound(SoundID.Item61 with { Pitch = 0.3f, Volume = 0.7f }, Player.Center); + + if (IsVanillaStoolEquipped(Player)) + { + // Spawn a step stool copy with a random velocity. Only works if step stool is equipped as well as spring stool. + Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos + new Vector2(0f, -4f), new Vector2(Main.rand.NextBool() ? Main.rand.NextFloat(6f, 7f) : Main.rand.NextFloat(-6f, -7f), Main.rand.NextFloat(-8f, -10f)), ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + } + } + + if (springStool) + { + bool holdingUp = Player.controlUp; + bool standingStill = Player.velocity.Y == 0 && Math.Abs(Player.velocity.X) < 0.1f; + + if (holdingUp && standingStill && !Player.mount.Active) + { + int boost = 61; + if (IsVanillaStoolEquipped(Player)) + boost += 24; + + Player.portableStoolInfo.HasAStool = true; + Player.portableStoolInfo.IsInUse = true; + Player.portableStoolInfo.HeightBoost = boost; + Player.portableStoolInfo.VisualYOffset = boost; + Player.portableStoolInfo.MapYOffset = boost; + + // Forces the player into the stool-standing frame + Player.UpdatePortableStoolUsage(); + } + + else + { + // Ensures the player can use the stool if they stop moving/hold up + Player.portableStoolInfo.HasAStool = true; + } + } + } + + private void HandleStoolStacking(On_PlayerDrawLayers.orig_DrawPlayer_03_PortableStool orig, ref PlayerDrawSet drawInfo) + { + bool isUsingStool = drawInfo.drawPlayer.portableStoolInfo.IsInUse; + var modPlayer = drawInfo.drawPlayer.GetModPlayer(); + bool hasSpring = modPlayer.springStool; + + if (!isUsingStool) + { + orig(ref drawInfo); + return; + } + + if (!hasSpring) + { + orig(ref drawInfo); + return; + } + + if (IsVanillaStoolEquipped(drawInfo.drawPlayer)) + { + orig(ref drawInfo); + return; + } + + return; + } + + private bool IsVanillaStoolEquipped(Player player) + { + for (int k = 3; k <= 12; k++) + { + if (player.armor[k].type == ItemID.PortableStool) + + return true; + } + return false; + } + + public override void PreUpdateMovement() + { + if (springStoolTimer > 0) + { + springStoolTimer--; + + if (Player.whoAmI == Main.myPlayer) + { + float launchPower = 20f * Utils.GetLerpValue(0, 10, springStoolTimer, true); + Player.velocity.Y = -launchPower * Player.gravDir; + + // Prevent vanilla jump logic from interfering + Player.jump = 0; + Player.fallStart = (int)(Player.position.Y / 16f); + } + } + } + + // Adds crit to melee hitboxes + private static void HandleExtraMeleeHitboxCrit(On_Player.orig_ProcessHitAgainstNPC orig, Player self, Item sItem, Rectangle itemRectangle, int originalDamage, float knockback, int npcIndex) + { + bool getBoost = self.GetModPlayer().springStool && self.Top.Y < Main.npc[npcIndex].Top.Y; + if (getBoost) + sItem.crit += SpringStool.CritRateBoostAboveTargets; + + orig(self, sItem, itemRectangle, originalDamage, knockback, npcIndex); + + if (getBoost) + sItem.crit -= SpringStool.CritRateBoostAboveTargets; + } + // Scuffed implementation to add crit to projectiles, using one hook to add it and then a later hook to remove it + // There are two return statements in between these hooks that I would normally be nervous of, however neither actually affect this at all: + // * The first is Electrosphere Launcher's rockets dying on hit, which kills the projectile anyways and can just have a manual check against + // * The second is Abigail's Flower hit cooldown logic, which does nothing since it's a minion that doesn't crit + public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers) + { + if (springStool && proj.type != ProjectileID.ElectrosphereMissile) + { + if (Player.Top.Y < target.Top.Y) + proj.CritChance += SpringStool.CritRateBoostAboveTargets; + } + } + public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone) + { + if (springStool && proj.type != ProjectileID.ElectrosphereMissile) + { + if (Player.Top.Y < target.Top.Y) + proj.CritChance -= SpringStool.CritRateBoostAboveTargets; + } + } + + public override void ResetEffects() + { + springStool = false; + springStoolTimer = 0; + } + + public override void UpdateDead() + { + springStool = false; + springStoolTimer = 0; + hasGroundedSinceJump = true; + } + } +} diff --git a/Items/Accessories/SpringStool.png b/Items/Accessories/SpringStool.png new file mode 100644 index 0000000000..1b7c3fd918 Binary files /dev/null and b/Items/Accessories/SpringStool.png differ diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index 40a8d86dd4..b7a3dd4452 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 4; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index d54b5c5e34..4d4836af00 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -39,11 +39,11 @@ namespace CalamityMod.Items.Accessories modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit modPlayer.amalgam = true; player.brainOfConfusionItem = Item; - modPlayer.HeatDebuffMultiplier += 2f; - modPlayer.ColdDebuffMultiplier += 2f; - modPlayer.SicknessDebuffMultiplier += 2f; - modPlayer.WaterDebuffMultiplier += 2f; - modPlayer.ElectricDebuffMultiplier += 2f; + modPlayer.HeatDebuffMultiplier += 3f; + modPlayer.ColdDebuffMultiplier += 3f; + modPlayer.SicknessDebuffMultiplier += 3f; + modPlayer.WaterDebuffMultiplier += 3f; + modPlayer.ElectricDebuffMultiplier += 3f; } public override void AddRecipes() @@ -51,11 +51,11 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(4). - AddIngredient(ItemID.LunarBar, 10). - AddIngredient(ItemID.FragmentSolar, 10). + AddIngredient(12). + AddIngredient(15). AddIngredient(15). AddIngredient(15). - AddIngredient(8). + AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index 0730b3c78a..5222c8b13a 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,7 +10,11 @@ namespace CalamityMod.Items.Accessories public class TrinketofChi : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - internal const int ChiBuffTimerMax = 600; + + public static float ChiBuffDamageReductionBoost = 0.2f; + public static int ChiBuffHitlessTime = CalamityUtils.SecondsToFrames(10); + public static int RegenBoost = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ChiBuffDamageReductionBoost.ToPercent(), ChiBuffHitlessTime.FramesToSeconds(), RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { diff --git a/Items/Accessories/UnholyTonic.cs b/Items/Accessories/UnholyTonic.cs index bef8b0ba72..1f3fa71470 100644 --- a/Items/Accessories/UnholyTonic.cs +++ b/Items/Accessories/UnholyTonic.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,9 @@ namespace CalamityMod.Items.Accessories public class UnholyTonic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoostInCorruption = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostInCorruption); public override void SetDefaults() { Item.width = 20; @@ -22,10 +26,7 @@ namespace CalamityMod.Items.Accessories { player.buffImmune[ModContent.BuffType()] = true; if (player.ZoneCorrupt) - { - player.statDefense += 6; - player.endurance += 0.04f; - } + player.statDefense += DefenseBoostInCorruption; } public override void AddRecipes() diff --git a/Items/Accessories/V8000Engine.cs b/Items/Accessories/V8000Engine.cs new file mode 100644 index 0000000000..2c5b7238df --- /dev/null +++ b/Items/Accessories/V8000Engine.cs @@ -0,0 +1,54 @@ +using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class V8000Engine : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public static float DashDelayModifier = 3.5f; + public const int ShieldSlamDamage = 900; + public const float ShieldSlamKnockback = 0.4f; + public const int ShieldSlamIFrames = 14; // While this has more i-frames than Elysian's dash, the dash speed sets this one back comparitively + + public static SoundStyle DashSound = new("CalamityMod/Sounds/Item/V8000Boost"); + + public override void SetDefaults() + { + Item.width = 54; + Item.height = 50; + Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.rare = ModContent.RarityType(); + Item.accessory = true; + } + + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasEngineDash; + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.hasEngineDash = true; + modPlayer.v8000Engine = true; + modPlayer.DashID = V8000EngineDash.ID; + player.dashType = 0; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ModContent.ItemType()). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ItemID.Nanites, 200). + AddTile(TileID.LunarCraftingStation). + Register(); + } + } +} diff --git a/Items/Accessories/V8000Engine.png b/Items/Accessories/V8000Engine.png new file mode 100644 index 0000000000..d764be8b92 Binary files /dev/null and b/Items/Accessories/V8000Engine.png differ diff --git a/Items/Accessories/V8Engine.cs b/Items/Accessories/V8Engine.cs new file mode 100644 index 0000000000..83f8e825ca --- /dev/null +++ b/Items/Accessories/V8Engine.cs @@ -0,0 +1,51 @@ +using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent.UI; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class V8Engine : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public static float DashDelayModifier = 4f; + + public static SoundStyle DashSound = new("CalamityMod/Sounds/Item/V8Boost"); + + public override void SetDefaults() + { + Item.width = 44; + Item.height = 42; + Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + } + + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasEngineDash; + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.hasEngineDash = true; + modPlayer.v8Engine = true; + modPlayer.DashID = V8EngineDash.ID; + player.dashType = 0; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyAdamantiteBar", 5). + AddIngredient(ModContent.ItemType(), 4). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Accessories/V8Engine.png b/Items/Accessories/V8Engine.png new file mode 100644 index 0000000000..a795ce0c96 Binary files /dev/null and b/Items/Accessories/V8Engine.png differ diff --git a/Items/Accessories/ViciousTonic.cs b/Items/Accessories/ViciousTonic.cs index 6df1a140cd..9cff8eb659 100644 --- a/Items/Accessories/ViciousTonic.cs +++ b/Items/Accessories/ViciousTonic.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,9 @@ namespace CalamityMod.Items.Accessories public class ViciousTonic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoostInCrimson = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostInCrimson); public override void SetDefaults() { Item.width = 20; @@ -22,10 +26,7 @@ namespace CalamityMod.Items.Accessories { player.buffImmune[ModContent.BuffType()] = true; if (player.ZoneCrimson) - { - player.statDefense += 6; - player.endurance += 0.04f; - } + player.statDefense += DefenseBoostInCrimson; } public override void AddRecipes() diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index 7289ae6af2..17965e2300 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Accessories public class VoidofCalamity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int BrimstoneFlamesDmg => CalamityUtils.ScaleWithDifficulty(15); public override void SetDefaults() { Item.width = 20; @@ -19,6 +21,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.expert = true; } + int cooldown = 0; public override void UpdateAccessory(Player player, bool hideVisual) { @@ -28,14 +31,17 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.immune) + if (player.HasIFrames()) { - if (player.miscCounter % 10 == 0) + if (cooldown <= 0) { - int damage = (int)player.GetBestClassDamage().ApplyTo(30); - CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); + cooldown = 20; + int damage = (int)player.GetBestClassDamage().ApplyTo(BrimstoneFlamesDmg); + for (var i = 0; i < 2; i++) + CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 5.5f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); } } + cooldown--; } } } diff --git a/Items/Accessories/WarbanneroftheRighteous.cs b/Items/Accessories/WarbanneroftheRighteous.cs index 78fcb24d41..1b880b8310 100644 --- a/Items/Accessories/WarbanneroftheRighteous.cs +++ b/Items/Accessories/WarbanneroftheRighteous.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; internal const float MaxBonus = 0.3f; - internal const float MaxDistance = 700f; + internal const float MaxDistance = 720f; public override void SetStaticDefaults() { @@ -110,8 +110,8 @@ namespace CalamityMod.Items.Accessories NPC closestTarget = player.Center.ClosestNPCAt(MaxDistance * 7); // extra range is to account for bonus range from massive targets if (closestTarget != null) { - float generousHitboxWidth = Math.Max(closestTarget.Hitbox.Width / 2f, closestTarget.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox - bonus = Utils.Remap(Utils.Distance(player.Center, closestTarget.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 0, MaxBonus, true); + Vector2 pointToCheck = Vector2.Clamp(player.Center, closestTarget.TopLeft, closestTarget.BottomRight); + bonus = Utils.Remap(Utils.Distance(player.Center, pointToCheck), MaxDistance, 80, 0, MaxBonus, true); } else bonus = 0; diff --git a/Items/Accessories/Wings/BaseWings.cs b/Items/Accessories/Wings/BaseWings.cs index 780b9224f3..ee58c30df0 100644 --- a/Items/Accessories/Wings/BaseWings.cs +++ b/Items/Accessories/Wings/BaseWings.cs @@ -2,10 +2,13 @@ using System.Linq; using System.Text; using CalamityMod.Balancing; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; namespace CalamityMod.Items.Accessories.Wings { @@ -86,26 +89,173 @@ namespace CalamityMod.Items.Accessories.Wings float baseJumpSpeed = (CalamityServerConfig.Instance.FasterJumpSpeed ? BalancingConstants.ConfigBoostedBaseJumpSpeed : 5.01f) + 1f; StringBuilder sb = new StringBuilder(512); sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (MaxAscentSpeed * baseJumpSpeed).ToMph())); - sb.Append('\n'); if (Main.keyState.PressingShift()) { - sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), BaseAscent.ToMphps(), + sb.Append(GetText($"Common.WingStatsFull").Format(time.FramesToSeconds(), + HorizontalSpeedText(run), run.ToMph(), + VerticalSpeedText(MaxAscentSpeed), (MaxAscentSpeed * baseJumpSpeed).ToMph(), + HorizontalAccelerationText(stats.AccRunAccelerationMult), rAcc.ToMphps(), + VerticalAccelerationText(BaseAscent), BaseAscent.ToMphps(), (BaseAscent + BonusAscentWhileRising).ToMphps(), (RisingSpeedThreshold * baseJumpSpeed).ToMph(), (BaseAscent + BonusAscentWhileFalling).ToMphps())); if (hover) { sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); + sb.Append(GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); } } else - sb.Append($"[c/B8B8B8:{CalamityUtils.GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + { + sb.Append(GetText($"Common.WingStats").Format(time.FramesToSeconds(), HorizontalSpeedText(run), VerticalSpeedText(MaxAscentSpeed), + HorizontalAccelerationText(stats.AccRunAccelerationMult), VerticalAccelerationText(BaseAscent))); + sb.Append('\n'); + sb.Append($"[c/B8B8B8:{GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + } // Add stats below the common "Allows flight" line - var wingTooltip = list.FirstOrDefault(x => x.Name == "Tooltip0" && x.Mod == "Terraria"); + TooltipLine wingTooltip = list.FirstOrDefault(x => x.Text == Language.GetTextValue("CommonItemTooltip.FlightAndSlowfall") && x.Mod == "Terraria"); if (wingTooltip != null) wingTooltip.Text += sb.ToString(); } + + public static string HorizontalSpeedText(float speed) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (speed > 9f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (speed >= 8f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (speed >= 7f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (speed <= 3f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (speed <= 6f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string VerticalSpeedText(float speed) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (speed > 2.5f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (speed >= 2f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (speed >= 1.65f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (speed <= 1f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (speed <= 1.35f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string HorizontalAccelerationText(float acc) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (acc > 2.5f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (acc >= 2f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (acc >= 1.25f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (acc <= 0.5f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (acc <= 0.75f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string VerticalAccelerationText(float acc) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (acc > 0.2f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (acc >= 0.135f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (acc >= 0.11f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (acc <= 0.05f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (acc <= 0.09f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } } } diff --git a/Items/Accessories/Wings/HadalMantle.cs b/Items/Accessories/Wings/HadalMantle.cs index 23778456c2..a0de1808f7 100644 --- a/Items/Accessories/Wings/HadalMantle.cs +++ b/Items/Accessories/Wings/HadalMantle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings public override float MaxAscentSpeed => 1.805f; public override float BaseAscent => 0.125f; - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(150, 8f, 2f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(130, 8f, 2f); public override void SetDefaults() { diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 310123dc78..1ee669e46a 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 3)); ItemID.Sets.AnimatesAsSoul[Type] = true; ItemID.Sets.ItemNoGravity[Type] = true; - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 6.25f, 1f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(160, 7.5f, 1f); } public override void SetDefaults() diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index b255d4609c..4f3b1fb1ec 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories.Wings [AutoloadEquip(EquipType.Wings)] public class StarlightWings : BaseWings { - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(160, 7.5f, 1.5f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(170, 7.5f, 1.5f); public override void SetDefaults() { diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index c505001aa1..224b1ed1c1 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -9,13 +9,14 @@ namespace CalamityMod.Items.Accessories public class YharimsGift : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public int dragonTimer = 60; + + public static int MeteorDamage => CalamityUtils.ScaleWithDifficulty(250); public override void SetDefaults() { Item.width = 20; Item.height = 22; - Item.defense = 12; + Item.defense = 10; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); @@ -24,38 +25,20 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { + player.Calamity().yharimsGift = true; var source = player.GetSource_Accessory(Item); - player.moveSpeed += 0.15f; - player.GetDamage() += 0.15f; + player.moveSpeed += 0.2f; + player.GetDamage() += 0.1f; player.noKnockback = true; - if (!player.StandingStill()) - { - dragonTimer--; - if (dragonTimer <= 0) - { - if (player.whoAmI == Main.myPlayer) - { - int damage = (int)player.GetBestClassDamage().ApplyTo(175); - - int projectile1 = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 5f, player.whoAmI, 0f, 0f); - Main.projectile[projectile1].timeLeft = 60; - } - dragonTimer = 60; - } - } - else - { - dragonTimer = 60; - } - if (player.immune) + if (player.HasIFrames()) { if (player.miscCounter % 8 == 0) { if (player.whoAmI == Main.myPlayer) { - int damage = (int)player.GetBestClassDamage().ApplyTo(375); + int damage = (int)player.GetBestClassDamage().ApplyTo(MeteorDamage); - CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI); + CalamityUtils.ProjectileRain(source, player.Center, 400f, 400f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI).Calamity().conditionalHomingRange = 160; } } } diff --git a/Items/Ammo/HailstormBullet.cs b/Items/Ammo/HailstormBullet.cs index 8571c98ecf..664f50c928 100644 --- a/Items/Ammo/HailstormBullet.cs +++ b/Items/Ammo/HailstormBullet.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,12 +22,21 @@ namespace CalamityMod.Items.Ammo Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2f; - Item.value = Item.buyPrice(copper: 80); // Sold by Archmage + Item.value = Item.sellPrice(copper: 16); Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 0.3f; Item.ammo = AmmoID.Bullet; Item.maxStack = Item.CommonMaxStack; } + public override void AddRecipes() + { + CreateRecipe(333). + AddIngredient(ItemID.MusketBall, 333). + AddIngredient(). + AddIngredient(ItemID.Ectoplasm). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Ammo/HyperiusBullet.cs b/Items/Ammo/HyperiusBullet.cs index 7d7083766f..850195e567 100644 --- a/Items/Ammo/HyperiusBullet.cs +++ b/Items/Ammo/HyperiusBullet.cs @@ -9,7 +9,8 @@ namespace CalamityMod.Items.Ammo { public class HyperiusBullet : ModItem, ILocalizedModType { - public static float overflowEfficency = 1.2f; // Multiplier applied to overflow damage done by other damage sources + public static float overflowEfficency = 0.8f; // Multiplier applied to hyperius stacks taken when enemies are damaged by other sources + public static float overflowAppliedMult = 0.9f; // The amount of damage from a hit taken into account when dealing overflow damage public static readonly SoundStyle hit = new("CalamityMod/Sounds/Item/HyperiusOverflow"); public new string LocalizationCategory => "Items.Ammo"; public override void SetStaticDefaults() diff --git a/Items/Ammo/IcicleArrow.cs b/Items/Ammo/IcicleArrow.cs index 4efafcd10a..9625571c1c 100644 --- a/Items/Ammo/IcicleArrow.cs +++ b/Items/Ammo/IcicleArrow.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,12 +22,21 @@ namespace CalamityMod.Items.Ammo Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2.5f; - Item.value = Item.buyPrice(copper: 80); // Sold by Archmage + Item.value = Item.sellPrice(copper: 20); Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 0.2f; Item.ammo = AmmoID.Arrow; Item.maxStack = Item.CommonMaxStack; } + public override void AddRecipes() + { + CreateRecipe(250). + AddIngredient(ItemID.WoodenArrow, 250). + AddIngredient(). + AddIngredient(ItemID.Ectoplasm). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 39e9bb66d6..6458df3a5a 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -1,8 +1,13 @@ -using CalamityMod.Items.Materials; +using System.Collections.Generic; +using System.IO; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Terraria.ModLoader.IO; namespace CalamityMod.Items.Armor.Astral { @@ -30,6 +35,42 @@ namespace CalamityMod.Items.Armor.Astral Item.rare = ItemRarityID.Cyan; Item.defense = 17; //63 } + #region Toggleable Omniscience effect + + bool toggleEnabled = true; + + public override bool CanRightClick() => Main.keyState.PressingShift(); + public override void RightClick(Player player) + { + toggleEnabled = !toggleEnabled; + Item.NetStateChanged(); + } + public override bool ConsumeItem(Player player) => false; + public override void SaveData(TagCompound tag) + { + tag.Add("toggleEffect", toggleEnabled); + } + + public override void LoadData(TagCompound tag) + { + toggleEnabled = tag.GetBool("toggleEffect"); + } + + public override void NetSend(BinaryWriter writer) + { + writer.Write(toggleEnabled); + } + + public override void NetReceive(BinaryReader reader) + { + toggleEnabled = reader.ReadBoolean(); + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled); + } + #endregion public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -46,7 +87,6 @@ namespace CalamityMod.Items.Armor.Astral player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusDamageBoost.ToPercent(), StarRainCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.astralStarRain = true; - modPlayer.omniscience = true; player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusDamageBoost; player.GetCritChance() += SetBonusCritBoost; @@ -57,6 +97,14 @@ namespace CalamityMod.Items.Armor.Astral { player.GetDamage() += DamageBoost; player.GetCritChance() += CritBoost; + var modPlayer = player.Calamity(); + modPlayer.omniscience = toggleEnabled; + } + + public override void ModifyTooltips(List tooltips) + { + if (!toggleEnabled) + tooltips.RemoveAll(x => x.Name == "Tooltip1"); } public override void AddRecipes() diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index 85a854995b..4b2eae5319 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Auric //Alternatively, their ModifyTooltips could simply return early if the item ID doesn't match the helmet type. if (Main.LocalPlayer.Calamity().auricSet) { - Main.LocalPlayer.armor[0].ModItem.ModifyTooltips(tooltips); + Main.LocalPlayer.armor[0].ModItem?.ModifyTooltips(tooltips); } } diff --git a/Items/Armor/Auric/AuricTeslaCuisses.cs b/Items/Armor/Auric/AuricTeslaCuisses.cs index 82d63d49bb..1ff610bc08 100644 --- a/Items/Armor/Auric/AuricTeslaCuisses.cs +++ b/Items/Armor/Auric/AuricTeslaCuisses.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Armor.Auric //Alternatively, their ModifyTooltips could simply return early if the item ID doesn't match the helmet type. if (Main.LocalPlayer.Calamity().auricSet) { - Main.LocalPlayer.armor[0].ModItem.ModifyTooltips(tooltips); + Main.LocalPlayer.armor[0].ModItem?.ModifyTooltips(tooltips); } if (!toggleEnabled) diff --git a/Items/Armor/Auric/AuricTeslaHeadMagic.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs index 7231f09ff0..e4a908579e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMagic.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSet = true; modPlayer.silvaMage = true; modPlayer.auricSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare } public override void ModifyTooltips(List tooltips) diff --git a/Items/Armor/Auric/AuricTeslaHeadMelee.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs index 33839d713e..feb38df486 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMelee.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayerDamage = true; modPlayer.auricSet = true; modPlayer.auricSetMelee = true; - player.crimsonRegen = true; // Inherited from Bloodflare player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index fa54b263bd..acd69acec9 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; modPlayer.auricSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index 6e73e4e0cc..ffe8c73ddf 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.auricSet = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/Auric/AuricTeslaHeadSummon.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs index afe538c9a8..206c06785e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadSummon.cs +++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSummon = true; modPlayer.auricSet = true; modPlayer.WearingPostMLSummonerSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index a61f3e79c9..c4f3fea04a 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSet = true; modPlayer.bloodflareMage = true; player.setBonus = this.GetLocalization("SetBonus").Format(GhostBoltCooldown.FramesToSeconds(), BloodsplosionCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index bf15e2dad8..ff42b9d5dd 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -47,7 +47,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareMelee = true; player.aggro += SetBonusAggroBoost; player.setBonus = this.GetLocalization("SetBonus").Format(HitsToActivateFrenzy, FrenzyDuration.FramesToSeconds(), FrenzyMeleeDamageBoost.ToPercent(), FrenzyContactDamageReduction.ToPercent(), FrenzyCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index 79d94d6d44..f4c1376e75 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -47,7 +47,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index 1eb93b9746..230ad7fed4 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public static float RogueDamageBoost = 0.15f; public static int RogueCritBoost = 10; public static float MoveSpeedBoost = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + public static int RegenBonus = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent(),RegenBonus.ToRegenPerSecond()); // Set Bonus public static float SetBonusRogueStealth = 1.2f; @@ -44,7 +45,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Bloodflare player.GetDamage() += RogueDamageBoost; player.GetCritChance() += RogueCritBoost; player.moveSpeed += MoveSpeedBoost; + player.lifeRegen += RegenBonus; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 22204e8e7c..2748a27213 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSummon = true; modPlayer.WearingPostMLSummonerSet = true; player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), DefenseBoostBelowHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); - player.crimsonRegen = true; player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index d169b687ba..b93e9b2d92 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 5; // 39 + Item.defense = 8; // 42 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index db0b4c87ef..09107dbbf4 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 21; // 55 + Item.defense = 22; // 56 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 5a62695eb4..b52bf0a10a 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 9; // 43 + Item.defense = 14; // 48 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index 5b4c79a506..495458d722 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 7; // 41 + Item.defense = 10; // 44 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index ed2f083749..997c216a6f 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Armor.Demonshade // Set Bonus public static int SetBonusMinionSlotBoost = 8; public static float SetBonusSummonDamageBoost = 1f; - public static int DevilDamage = 1000; public static int BeamDamage => CalamityUtils.ScaleWithDifficulty(300); public static int ScytheDamage => CalamityUtils.ScaleWithDifficulty(500); public static int EnrageDuration = CalamityUtils.SecondsToFrames(10); @@ -59,22 +58,6 @@ namespace CalamityMod.Items.Armor.Demonshade modPlayer.dsSetBonus = true; modPlayer.wearingRogueArmor = true; modPlayer.WearingPostMLSummonerSet = true; - if (player.whoAmI == Main.myPlayer && !modPlayer.chibii) - { - modPlayer.redDevil = true; - var source = player.GetSource_ItemUse(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(DevilDamage); - - var devil = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 2f, 0f); - devil.originalDamage = DevilDamage; - } - } player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index 18a2b1abd4..08759c2a23 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Armor.Empyrean var modPlayer = player.Calamity(); modPlayer.xerocSet = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), PermanentWrathHealthRatio.ToPercent()); if (player.statLife <= (int)(player.statLifeMax2 * PermanentWrathHealthRatio)) player.AddBuff(ModContent.BuffType(), 2); modPlayer.wearingRogueArmor = true; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index a6a9ad4c88..1eb312a365 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public static float OrbDamageCooldownMult = 0.5f; public static double OrbHealingRatio = 0.1D; public static double OrbHealingRatioLossPerPierce = 0.05D; - public static float OrbHealingCooldownMult = 1.25f; + public static float OrbHealingCooldownMult = 1f; public override void SetDefaults() { diff --git a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs index 43566922ae..50c282e3db 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); public override void SetStaticDefaults() diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index 1ae9a366f0..2bd239bc58 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public static float MoveSpeedBoost = 0.15f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index df326df8c0..3bf9a5e25f 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public static int MinionSlotBoost = 1; - public static float SummonDamageBoost = 0.15f; + public static float SummonDamageBoost = 0.20f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); // Set Bonus diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c75db9fbc2..5f20ad405b 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -21,7 +21,6 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; using CalamityMod.NPCs.TownNPCs; @@ -192,25 +191,25 @@ namespace CalamityMod.Items stats[(int)VanillaWingID.FrozenWings].AccRunAccelerationMult = 1.5f; // 160 -> 130 flight time stats[(int)VanillaWingID.FlameWings].FlyTime = 130; - // 160 -> 180 flight time, 7.5 -> 6.25 horizontal speed + // 160 -> 180 flight time, 7.5 -> 6.75 horizontal speed stats[(int)VanillaWingID.BatWings].FlyTime = 180; - stats[(int)VanillaWingID.BatWings].AccRunSpeedOverride = 6.25f; + stats[(int)VanillaWingID.BatWings].AccRunSpeedOverride = 6.75f; // 1 -> 1.5 acceleration multiplier stats[(int)VanillaWingID.ButterflyWings].AccRunAccelerationMult = 1.5f; // 170 -> 240 flight time stats[(int)VanillaWingID.BoneWings].FlyTime = 240; - // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 1.5 acceleration multiplier + // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 2 acceleration multiplier stats[(int)VanillaWingID.LeafWings].FlyTime = 170; stats[(int)VanillaWingID.LeafWings].AccRunSpeedOverride = 9f; - stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 1.5f; - // (Spectre Wings) 1 -> 2 acceleration multiplier - stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 2f; + stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 2f; + // (Spectre Wings) 1 -> 1.5 acceleration multiplier + stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 1.5f; // 170 -> 210 flight time stats[(int)VanillaWingID.BeetleWings].FlyTime = 210; - // 180 -> 210 flight time - stats[(int)VanillaWingID.TatteredFairyWings].FlyTime = 210; + // 180 -> 300 flight time + stats[(int)VanillaWingID.TatteredFairyWings].FlyTime = 300; // (Empress Wings) 150 -> 120 flight time stats[(int)VanillaWingID.RainbowWings].FlyTime = 120; @@ -562,13 +561,6 @@ namespace CalamityMod.Items #region Use Item Changes public override void HoldItem(Item item, Player player) { - // Clear Evil Smasher buffs if not holding Evil Smasher - if (player.Calamity().evilSmasherBoost > 0) - { - if (item.type != ItemType()) - player.Calamity().evilSmasherBoost = 0; - } - if (player.Calamity().ChaosStone && item.mana == 0 && !player.ItemTimeIsZero) { player.manaRegenDelay = player.maxRegenDelay; @@ -623,6 +615,17 @@ namespace CalamityMod.Items } } + //Mana Potion interactions + if (item.healMana > 0) + { + //If mana potion used, kill all active Crown projectiles + if ((modPlayer.moonCrown || modPlayer.featherCrown) && modPlayer.mageCrownCount > 0) + { + modPlayer.mageCrownTimer = 300; + modPlayer.mageCrownCount = 0; + } + } + // Staff/Axe of Regrowth growing Calamity grass if (item.type == ItemID.StaffofRegrowth || item.type == ItemID.AcornAxe) { @@ -644,7 +647,7 @@ namespace CalamityMod.Items return true; } } - + return base.UseItem(item, player); } @@ -654,21 +657,6 @@ namespace CalamityMod.Items { return false; } - if (player.HeldItem.type == ItemType() && player.ownedProjectileCounts[ProjectileType()] == 0) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.ModProjectile is VoidConcentrationAura) - { - if (p.owner == player.whoAmI) - { - p.ModProjectile().HandleRightClick(); - break; - } - } - } - return false; - } if (player.HeldItem.type == ItemType()) { bool canContinue = true; @@ -907,15 +895,13 @@ namespace CalamityMod.Items // Hyperius Overflow if (target.Calamity().hyperiusMarked) { - int damage = 0; - if (target.Calamity().hyperiusDamage < damageDone) - damage = damageDone - target.Calamity().hyperiusDamage; - else - damage = damageDone; - target.Calamity().hyperiusDamage -= damage; + int damageDealt = (int)(damageDone * HyperiusBullet.overflowAppliedMult); + int damage = (int)Math.Min(target.Calamity().hyperiusDamage / HyperiusBullet.overflowEfficency, damageDealt); + + target.Calamity().hyperiusDamage -= (int)(damage * HyperiusBullet.overflowEfficency); // Spawn overflow hit - Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, player.whoAmI, target.whoAmI); + Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), damage, 0, player.whoAmI, target.whoAmI); overflow.DamageType = item.DamageType; overflow.ArmorPenetration = item.ArmorPenetration; // Takes the armor pen from what did the hit @@ -950,6 +936,7 @@ namespace CalamityMod.Items public override void ModifyItemScale(Item item, Player player, ref float scale) { + // Xyk 3MARCH2026: Doesn't work on any non use style 1 items currently, Doze will fix it if (item.CountsAsClass() && player.HasBuff(BuffID.Tipsy)) scale += 0.15f; } @@ -977,7 +964,7 @@ namespace CalamityMod.Items } else if (set == "SpectreHealing") { - player.GetDamage() += 0.4f; + player.GetDamage() += 0.2f; player.setBonus = CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.SpectreHealing"); } else if (set == "SolarFlare") @@ -1228,12 +1215,12 @@ namespace CalamityMod.Items } if (item.type == ItemID.DemonWings && !player.mount.Active) - player.maxFallSpeed *= 1.3f; + player.maxFallSpeed *= 1.2f; if (item.type == ItemID.BeeWings && !player.mount.Active && !player.controlDown) { - player.gravity *= 0.6f; - player.maxFallSpeed *= 0.6f; + player.gravity *= 0.75f; + player.maxFallSpeed *= 0.75f; } if (item.type == ItemID.FinWings) @@ -1314,24 +1301,22 @@ namespace CalamityMod.Items switch (item.type) { case ItemID.AngelWings: - maxAscentMultiplier *= 1.3f; - constantAscend *= 1.5f; - break; - case ItemID.DemonWings: - ascentWhenFalling *= 2f; - ascentWhenRising *= 2f; - maxCanAscendMultiplier *= 2f; - break; - case ItemID.FlameWings: maxAscentMultiplier *= 1.2f; constantAscend *= 1.35f; break; + case ItemID.DemonWings: + ascentWhenFalling *= 2f; + break; + case ItemID.FlameWings: + maxAscentMultiplier *= 1.1067f; + constantAscend *= 1.25f; + break; case ItemID.ButterflyWings: - maxAscentMultiplier *= 0.9f; + maxAscentMultiplier *= 0.6667f; constantAscend *= 5f; break; case ItemID.GhostWings: - maxAscentMultiplier *= 0.904f; + maxAscentMultiplier *= 0.6025f; constantAscend *= 5f; break; default: @@ -1487,7 +1472,7 @@ namespace CalamityMod.Items return false; } - #endregion + #endregion #region On Create private static int cachedForgeID = -1; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e783511cf0..314a51650a 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -8,6 +8,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; @@ -162,6 +163,20 @@ namespace CalamityMod.Items } } + //Replace Crit Chance with Crit Damage on applicable tooltips + if (CalamityItemSets.ShowScalingCritDamageTooltip[item.type]) + { + float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(item.DamageType) * 0.02f; + tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent()); + } + + //Add "Uses X Minion Slots right above "Uses X Mana" + if (ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 || ContentSamples.ProjectilesByType[item.shoot].minionSlots > 0) + { + tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback") + 1, new(Mod, "Minions", CalamityUtils.GetText(ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 ? "Common.MinionSlotCost" : "Common.MinionSlotCostSingle").Format(ItemID.Sets.StaffMinionSlotsRequired[item.type]))); + } + + // Everything below this line can only apply to modded items. If the item is vanilla, stop here for efficiency. if (item.type < ItemID.Count) return; @@ -187,7 +202,7 @@ namespace CalamityMod.Items // If holding SHIFT, actually display the extended tooltip. if (holdingShift && firstTooltipIndex != -1) { - string holdShiftText = item.ModItem.GetLocalizedValue(holdShiftItem.TooltipExtensionKey); + string holdShiftText = holdShiftItem.TooltipExtensionText == LocalizedText.Empty ? item.ModItem.GetLocalizedValue(holdShiftItem.TooltipExtensionKey) : holdShiftItem.TooltipExtensionText.ToString(); TooltipLine holdShiftLine = new TooltipLine(Mod, IHoldShiftTooltipItem.ExtensionTooltipID, holdShiftText); if (holdShiftItem.TooltipExtensionColor is not null) holdShiftLine.OverrideColor = holdShiftItem.TooltipExtensionColor; @@ -278,8 +293,9 @@ namespace CalamityMod.Items tooltips.Insert(++difficultyTooltipIndex, donorLine); } - var buffIdsInTooltip = new HashSet(); - + // The int is the buff ID + // The byte determines what information to show; 0 = enemy, 1 = player, 2 = both + var buffIdsInTooltip = new Dictionary(); foreach (var tooltip in tooltips) { // Parse the tags of each line of text to find our buff tags' @@ -287,9 +303,18 @@ namespace CalamityMod.Items var snippets = ChatManager.ParseMessage(tooltip.Text, Color.White); foreach (var snippet in snippets) { - if (snippet is CalamityBuffTagHandler.Snippet buffSnippet) + if (snippet is BuffTagEnemyEffectHandler.Snippet enemy) { - buffIdsInTooltip.Add(buffSnippet.BuffId); + if (!buffIdsInTooltip.ContainsKey(enemy.BuffId)) + buffIdsInTooltip.Add(enemy.BuffId, 0); + } + else if (snippet is BuffTagPlayerEffectHandler.Snippet player) + { + if (!buffIdsInTooltip.TryAdd(player.BuffId, 1)) + { + buffIdsInTooltip.Remove(player.BuffId); + buffIdsInTooltip.Add(player.BuffId, 2); + } } } } @@ -298,26 +323,36 @@ namespace CalamityMod.Items { bool showTheTip = false; bool foundDebuff = false; - foreach (int buffId in buffIdsInTooltip) + foreach (var buffInfo in buffIdsInTooltip) { string tooltipKey = ""; - if (buffId < BuffID.Count) + string secondTooltipKey = ""; + // Change the localization based on whether it should display player or enemy info, or both + string locKey = buffInfo.Value == 1 ? "ItemTooltipPlayer" : "ItemTooltipEnemy"; + string secondLocKey = buffInfo.Value == 2 ? "ItemTooltipPlayer" : ""; + + if (buffInfo.Key < BuffID.Count) { - tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffId)}.ItemTooltip"; + tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{locKey}"; + if (buffInfo.Value == 2) + secondTooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{secondLocKey}"; } else { - var modBuff = BuffLoader.GetBuff(buffId); - tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.ItemTooltip"; + var modBuff = BuffLoader.GetBuff(buffInfo.Key); + tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{locKey}"; + if (buffInfo.Value == 2) + secondTooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{secondLocKey}"; } - if (!Language.Exists(tooltipKey)) - { - continue; - } + var text = ""; + var secondText = ""; + if (Language.Exists(tooltipKey)) + text = Language.GetTextValue(tooltipKey); + if (Language.Exists(secondTooltipKey)) + secondText = Language.GetTextValue(secondTooltipKey); - var text = Language.GetTextValue(tooltipKey); - if (string.IsNullOrWhiteSpace(text)) + if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(secondText)) { continue; } @@ -329,7 +364,11 @@ namespace CalamityMod.Items break; } - tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffId, $"[cbuff:{buffId}]\n{text}")); + string extraLoc = GetTextValue(buffInfo.Value == 1 ? "Buffs.OnPlayer" : "Buffs.OnEnemy"); + if (!string.IsNullOrWhiteSpace(text)) + tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {extraLoc}\n{text}")); + if (buffInfo.Value == 2 && !string.IsNullOrWhiteSpace(secondText)) + tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {GetTextValue("Buffs.OnPlayer")}\n{secondText}")); } if (showTheTip) @@ -859,10 +898,7 @@ namespace CalamityMod.Items // Crimson if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves) - { - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", "6%")); EditTooltipByNum(0, (line) => line.Text += AddedTooltip("CrimsonArmorPieces")); - } // Magic Hat nerf if (item.type == ItemID.MagicHat) @@ -901,20 +937,10 @@ namespace CalamityMod.Items if (item.type == ItemID.CobaltHat) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); - // Palladium - if (item.type == ItemID.PalladiumBreastplate) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}%")); - if (item.type == ItemID.PalladiumLeggings) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("2%", $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}%")); - // Mythril if (item.type == ItemID.MythrilHood) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("60", $"{MythrilArmorSetChange.MaxManaBoost + 60}")); - // Orichalcum - if (item.type == ItemID.OrichalcumBreastplate) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("6%", $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}%")); - // Adamantite if (item.type == ItemID.AdamantiteHeadgear) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("80", $"{AdamantiteArmorSetChange.MaxManaBoost + 80}")); @@ -1093,45 +1119,59 @@ namespace CalamityMod.Items float baseJumpSpeed = (CalamityServerConfig.Instance.FasterJumpSpeed ? BalancingConstants.ConfigBoostedBaseJumpSpeed : 5.01f) + 1f; StringBuilder sb = new StringBuilder(512); sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (tMax * baseJumpSpeed).ToMph())); - sb.Append('\n'); if (Main.keyState.PressingShift()) { - sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), asc.ToMphps(), (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), (asc + fall).ToMphps())); + sb.Append(GetText($"Common.WingStatsFull").Format(time.FramesToSeconds(), + BaseWings.HorizontalSpeedText(run), run.ToMph(), + BaseWings.VerticalSpeedText(tMax), (tMax * baseJumpSpeed).ToMph(), + BaseWings.HorizontalAccelerationText(stats.AccRunAccelerationMult), rAcc.ToMphps(), + BaseWings.VerticalAccelerationText(asc), asc.ToMphps(), + (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), + (asc + fall).ToMphps())); if (hover) { sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); + sb.Append(GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); } } else - sb.Append($"[c/B8B8B8:{CalamityUtils.GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + { + sb.Append(GetText($"Common.WingStats").Format(time.FramesToSeconds(), BaseWings.HorizontalSpeedText(run), BaseWings.VerticalSpeedText(tMax), + BaseWings.HorizontalAccelerationText(stats.AccRunAccelerationMult), BaseWings.VerticalAccelerationText(asc))); + sb.Append('\n'); + sb.Append($"[c/B8B8B8:{GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + } if (extraKey != null) { sb.Append('\n'); - sb.Append(CalamityUtils.GetTextValue($"Vanilla.Wings.{extraKey}")); + sb.Append(GetTextValue($"Vanilla.Wings.{extraKey}")); } return sb.ToString(); } // This function is shorthand for appending a stat sheet to a pair of wings. - void AddWingStats(int slot, float fall, float rise, float rMax, float tMax, float asc, string extraKey = null) => EditTooltipByNum(0, (line) => line.Text += WingStatsTooltip(ArmorIDs.Wing.Sets.Stats[slot], fall, rise, rMax, tMax, asc, extraKey)); + void AddWingStats(int slot, float fall, float rise, float rMax, float tMax, float asc, string extraKey = null) + { + TooltipLine commonWingTooltipLine = tooltips.FirstOrDefault(x => x.Text == Language.GetTextValue("CommonItemTooltip.FlightAndSlowfall") && x.Mod == "Terraria"); + if (commonWingTooltipLine != null) + commonWingTooltipLine.Text += WingStatsTooltip(ArmorIDs.Wing.Sets.Stats[slot], fall, rise, rMax, tMax, asc, extraKey); + } if (item.type == ItemID.CreativeWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.AngelWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.95f, 0.15f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.8f, 0.135f); if (item.type == ItemID.DemonWings) - AddWingStats(item.wingSlot, 1f, 0.2f, 1f, 1.5f, 0.1f, "DemonWings"); + AddWingStats(item.wingSlot, 1f, 0.1f, 0.5f, 1.5f, 0.1f, "DemonWings"); if (item.type == ItemID.Jetpack) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.ButterflyWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.35f, 0.5f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1f, 0.5f); if (item.type == ItemID.FairyWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); @@ -1146,13 +1186,13 @@ namespace CalamityMod.Items AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f, "BoneWings"); if (item.type == ItemID.FlameWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.8f, 0.135f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.125f); if (item.type == ItemID.FrozenWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.GhostWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.5f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1f, 0.5f); if (item.type == ItemID.BeetleWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 6c604ce7de..d51e357e31 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -30,372 +30,367 @@ namespace CalamityMod.Items IItemTweak[] trueMelee = Do(TrueMelee); IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable); - IItemTweak[] phaseblade = Do(UseTurn, DamageExact(36)); - IItemTweak[] phasesaber = Do(DamageExact(132)); + IItemTweak[] phaseblade = Do(UseTurn, DamageExact(36)); // VANILLA: 26 DMG + IItemTweak[] phasesaber = Do(DamageExact(132)); // VANILLA: 48 DMG // SORTING NOTES: // 1. Sort tweaks by categories first, then sort by the internal name in alphabetical order. Navigate through categories and names using the search function. // 2. Higher categories hold priority over lower ones (ie. Balancing with price tweaks belong in balancing, rather than price) - // 3. Items with different display names as opposed to internal ones should have comments for display names for ease of access. + // 3. All balancing tweaks should have comments with the vanilla stats for convenience and reference. + // 4. Items whose internal names are vastly different from their actual names should have comments for ease of access. currentTweaks = new SortedDictionary { #region CATEGORY 1: Weapon Balancing - { ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, - { ItemID.AdamantiteRepeater, Do(UseExact(14)) }, - { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, - { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, - { ItemID.AmethystStaff, Do(ManaExact(2)) }, - { ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, - { ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade - { ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // Uses ratios due to remix seed - { ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, - { ItemID.BatScepter, Do(DamageExact(50)) }, - { ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, - { ItemID.BeeGun, Do(DamageExact(11), ManaExact(4)) }, - { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, - { ItemID.Beenade, Do(DamageExact(11), UseTimeExact(22), ShootSpeedExact(10f)) }, - { ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) }, - { ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) }, - { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, - { ItemID.BloodyMachete, Do(DamageExact(24)) }, - { ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) }, + { ItemID.AdamantiteGlaive, Do(TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, // VANILLA: 49 DMG, 25 UT, 5 VEL + { ItemID.AdamantiteRepeater, Do(UseExact(14)) }, // VANILLA: 18 UT + { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, // VANILLA: 61 DMG, 21 UT + { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, // VANILLA: 28 UT/UA, 0 RUD + { ItemID.AmethystStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA + { ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, // VANILLA: 70 DMG, 20 UT + { ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade. VANILLA: 18 UT + { ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // VANILLA: 27 DMG. Uses ratios due to remix seed + { ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, // VANILLA: 45 DMG, 11 UT + { ItemID.BatScepter, Do(DamageExact(50)) }, // VANILLA: 45 DMG + { ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB + { ItemID.BeeGun, Do(DamageExact(11), ManaExact(4)) }, // VANILLA: 9 DMG, 5 MANA + { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, // VANILLA: 30 DMG + { ItemID.Beenade, Do(DamageExact(11), UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 12 DMG, 15 UT, 6 VEL + { ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) }, // VANILLA: 23 DMG, 23 UT + { ItemID.Bladetongue, Do(UseTurn, DamageExact(120), UseExact(22)) }, // VANILLA: 55 DMG, 28 UT + { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, // VANILLA: 58 DMG, 9 MANA + { ItemID.BloodyMachete, Do(DamageExact(24)) }, // VANILLA: 20 DMG + { ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) }, // VANILLA: 27 DMG, 13 VEL { ItemID.BluePhaseblade, phaseblade }, { ItemID.BluePhasesaber, phasesaber }, - { ItemID.BoneSword, Do(UseTurn, DamageExact(25)) }, - { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, - { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom - { ItemID.Boomstick, Do(DamageExact(11)) }, - { ItemID.BreakerBlade, Do(UseTurn, DamageExact(140)) }, - { ItemID.CandyCornRifle, Do(DamageExact(66)) }, - { ItemID.Cascade, Do(DamageExact(31)) }, - { ItemID.ChainGuillotines, Do(DamageExact(100)) }, - { ItemID.ChainGun, Do(DamageExact(35)) }, - { ItemID.ChainKnife, Do(DamageRatio(1.34f)) }, // Uses ratios due to remix seed - { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, - { ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(95)) }, - { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, - { ItemID.ChristmasTreeSword, Do(UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, - { ItemID.ClingerStaff, Do(DamageExact(63)) }, - { ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, - { ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, - { ItemID.CobaltRepeater, Do(UseExact(18)) }, - { ItemID.CobaltSword, Do(DamageExact(60), UseExact(9)) }, - { ItemID.Code2, Do(DamageExact(43)) }, - { ItemID.CoinGun, Do(UseExact(12)) }, - { ItemID.CorruptYoyo, Do(DamageExact(20)) }, // Malaise - { ItemID.CrimsonYoyo, Do(DamageExact(20)) }, // Artery - { ItemID.CrystalBullet, Do(DamageExact(6)) }, - { ItemID.CrystalDart, Do(DamageExact(20)) }, - { ItemID.CrystalStorm, Do(DamageExact(40)) }, - { ItemID.CrystalVileShard, Do(DamageExact(35)) }, - { ItemID.CursedArrow, Do(DamageExact(14)) }, - { ItemID.CursedDart, Do(DamageExact(25)) }, - { ItemID.Cutlass, Do(UseRatio(0.9f), DamageExact(90)) }, - { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, - { ItemID.DaoofPow, Do(DamageExact(85)) }, // Displays as 170 damage - { ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, - { ItemID.DartRifle, Do(DamageExact(58)) }, - { ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, - { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that - { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon - { ItemID.DeadlySphereStaff, Do(DamageExact(50)) }, - { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(65), ShootSpeedExact(15f)) }, - { ItemID.DemonBow, Do(DamageExact(12)) }, - { ItemID.DemonScythe, Do(DamageExact(28)) }, - { ItemID.DyeTradersScimitar, Do(UseTurn, DamageExact(24)) }, // Exotic Scimitar - { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, - { ItemID.EmeraldStaff, Do(DamageExact(27)) }, - { ItemID.EmpressBlade, Do(DamageExact(68)) }, // Terraprisma - { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, - { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, - { ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, - { ItemID.Excalibur, Do(TrueMelee, DamageExact(170)) }, - { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow - { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, - { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration - { ItemID.Flamarang, Do(DamageExact(37)) }, - { ItemID.Flamelash, Do(DamageExact(36), ManaExact(18)) }, - { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, - { ItemID.FlowerofFire, Do(ManaExact(7), DamageRatio(0.78f)) }, // Uses ratios due to remix seed - { ItemID.FlowerofFrost, Do(ManaExact(7), UseExact(22), DamageExact(70), ShootSpeedExact(14)) }, - { ItemID.FlyingKnife, Do(DamageExact(53)) }, - { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, - { ItemID.Gatligator, Do(UseExact(6)) }, - { ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) }, - { ItemID.GolemFist, Do(DamageExact(150)) }, - { ItemID.Gradient, Do(DamageExact(39)) }, + { ItemID.BoneSword, Do(UseTurn, DamageExact(25)) }, // VANILLA: 19 DMG + { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, // VANILLA: 29 DMG, 18 MANA, 3.5 VEL + { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom. VANILLA: 20 MANA + { ItemID.Boomstick, Do(DamageExact(11)) }, // VANILLA: 14 DMG + { ItemID.BreakerBlade, Do(UseTurn, DamageExact(140)) }, // VANILLA: 70 DMG + { ItemID.CandyCornRifle, Do(DamageExact(66)) }, // VANILLA: 44 DMG + { ItemID.Cascade, Do(DamageExact(31)) }, // VANILLA: 27 DMG + { ItemID.ChainGuillotines, Do(DamageExact(100)) }, // VANILLA: 59 DMG + { ItemID.ChainGun, Do(DamageExact(35)) }, // VANILLA: 31 DMG + { ItemID.ChainKnife, Do(DamageRatio(1.34f)) }, // VANILLA: 12 DMG. Uses ratios due to remix seed + { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, // VANILLA: 95 DMG, 26 UT, 8 VEL + { ItemID.ChlorophytePartisan, Do(UseMeleeSpeed, DamageExact(95)) }, // VANILLA: 49 DMG + { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, // VANILLA: 57 DMG, 16 UT + { ItemID.ChristmasTreeSword, Do(UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, // VANILLA: 86 DMG, 23 UT + { ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, // VANILLA: 17 DMG + { ItemID.CobaltNaginata, Do(TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, // VANILLA: 44 DMG, 28 UT, 4.3 VEL + { ItemID.CobaltRepeater, Do(UseExact(18)) }, // VANILLA: 23 UT + { ItemID.CobaltSword, Do(DamageExact(60), UseExact(9)) }, // VANILLA: 40 DMG, 19 UT + { ItemID.Code2, Do(DamageExact(43)) }, // VANILLA: 54 DMG + { ItemID.CoinGun, Do(UseExact(12)) }, // VANILLA: 8 UT + { ItemID.CorruptYoyo, Do(DamageExact(20)) }, // Malaise. VANILLA: 16 DMG + { ItemID.CrimsonYoyo, Do(DamageExact(20)) }, // Artery. VANILLA: 17 DMG + { ItemID.CrystalBullet, Do(DamageExact(6)) }, // VANILLA: 9 DMG + { ItemID.CrystalDart, Do(DamageExact(20)) }, // VANILLA: 14 DMG + { ItemID.CrystalStorm, Do(DamageExact(40)) }, // VANILLA: 32 DMG + { ItemID.CrystalVileShard, Do(DamageExact(35)) }, // VANILLA: 25 DMG + { ItemID.CursedArrow, Do(DamageExact(14)) }, // VANILLA: 17 DMG + { ItemID.CursedDart, Do(DamageExact(25)) }, // VANILLA: 9 DMG + { ItemID.Cutlass, Do(DamageExact(90), UseExact(14)) }, // VANILLA: 53 DMG, 16 UT + { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, // VANILLA: 38 DMG + { ItemID.DaoofPow, Do(DamageExact(85)) }, // Displays as 170 damage. VANILLA: 50 DMG (displays as 100) + { ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, // VANILLA: 34 DMG + { ItemID.DartRifle, Do(DamageExact(58)) }, // VANILLA: 52 DMG + { ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, // VANILLA: 150 DMG, 16 UT + { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // VANILLA: 39 DMG. Compensation for removing aerial multiplier + { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon. VANILLA: 180 DMG + { ItemID.DeadlySphereStaff, Do(DamageExact(50)) }, // VANILLA: 40 DMG + { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(65), ShootSpeedExact(15f)) }, // VANILLA: 57 DMG, 9 VEL + { ItemID.DemonBow, Do(DamageExact(12)) }, // VANILLA: 14 DMG + { ItemID.DemonScythe, Do(DamageExact(28)) }, // VANILLA: 35 DMG + { ItemID.DyeTradersScimitar, Do(UseTurn, DamageExact(24)) }, // Exotic Scimitar. VANILLA: 20 DMG + { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, // VANILLA: 8.5 VEL + { ItemID.EmeraldStaff, Do(DamageExact(27)) }, // VANILLA: 19 DMG + { ItemID.EmpressBlade, Do(DamageExact(68)) }, // Terraprisma. VANILLA: 90 DMG + { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, // VANILLA: 17 DMG + { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, // VANILLA: 23 DMG, 9.5 VEL + { ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, // VANILLA: 7 DMG. Gives it the same damage as Tungsten Bullet + { ItemID.Excalibur, Do(TrueMelee, DamageExact(170)) }, // VANILLA: 72 DMG + { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow. VANILLA: 50 DMG + { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, // VANILLA: 20 UT + { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration. VANILLA: 25 DMG, 30 UT + { ItemID.Flamarang, Do(DamageExact(37)) }, // VANILLA: 49 DMG + { ItemID.Flamelash, Do(DamageExact(36), ManaExact(18)) }, // VANILLA: 32 DMG, 21 MANA + { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL + { ItemID.FlowerofFire, Do(DamageRatio(0.78f), ManaExact(7)) }, // VANILLA: 48 DMG, 12 MANA. Uses ratios due to remix seed + { ItemID.FlowerofFrost, Do(DamageExact(70), UseExact(22), ManaExact(7), ShootSpeedExact(14)) }, // VANILLA: 60 DMG, 12 UT, 11 MANA, 9 VEL + { ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG + { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, // VANILLA: 49 DMG + { ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT + { ItemID.GoldShortsword, Do(TrueMelee, DamageExact(17)) }, // VANILLA: 12 DMG + { ItemID.GolemFist, Do(DamageExact(150)) }, // VANILLA: 90 DMG + { ItemID.Gradient, Do(DamageExact(39)) }, // VANILLA: 49 DMG { ItemID.GreenPhaseblade, phaseblade }, { ItemID.GreenPhasesaber, phasesaber }, - { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, - { ItemID.Gungnir, Do(TrueMelee, DamageExact(130), ShootSpeedExact(7f)) }, - { ItemID.HallowedRepeater, Do(UseExact(12)) }, - { ItemID.Handgun, Do(UseExact(20)) }, - { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, - { ItemID.HiveFive, Do(DamageExact(27)) }, - { ItemID.HornetStaff, Do(DamageExact(18)) }, + { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, // VANILLA: 60 DMG + { ItemID.Gungnir, Do(TrueMelee, DamageExact(130), ShootSpeedExact(7f)) }, // VANILLA: 61 DMG, 5.6 VEL + { ItemID.HallowedRepeater, Do(UseExact(12)) }, // VANILLA: 17 UT + { ItemID.Handgun, Do(UseExact(20)) }, // VANILLA: 15 UT + { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, // VANILLA: 11 DMG + { ItemID.HiveFive, Do(DamageExact(27)) }, // VANILLA: 24 DMG + { ItemID.HornetStaff, Do(DamageExact(18)) }, // VANILLA: 12 DMG { ItemID.IceBlade, Do(UseMeleeSpeed) }, - { ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) }, - { ItemID.IceRod, Do(UseExact(6), ShootSpeedExact(20)) }, - { ItemID.IceSickle, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, - { ItemID.IchorArrow, Do(DamageExact(13)) }, - { ItemID.IchorBullet, Do(DamageExact(11)) }, - { ItemID.ImpStaff, Do(DamageExact(25)) }, - { ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) }, - { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, - { ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) }, + { ItemID.IceBoomerang, Do(ShootSpeedExact(9), UseExact(25)) }, // VANILLA: 20 UT, 11.5 VEL + { ItemID.IceRod, Do(ShootSpeedExact(20), UseExact(6)) }, // VANILLA: 9 UT, 12 VEL + { ItemID.IceSickle, Do(UseMeleeSpeed, DamageExact(75), ShootSpeedExact(20f)) }, // VANILLA: 50 DMG, 12 VEL + { ItemID.IchorArrow, Do(DamageExact(13)) }, // VANILLA: 16 DMG + { ItemID.IchorBullet, Do(DamageExact(11)) }, // VANILLA: 13 DMG + { ItemID.ImpStaff, Do(DamageExact(25)) }, // VANILLA: 17 DMG + { ItemID.InfernoFork, Do(DamageExact(83), ShootSpeedExact(11)) }, // VANILLA: 70 DMG, 8 VEL + { ItemID.InfluxWaver, Do(UseMeleeSpeed, DamageExact(80), UseExact(25)) }, // VANILLA: 100 DMG, 20 UT + { ItemID.IronShortsword, Do(TrueMelee, DamageExact(10)) }, // VANILLA: 8 DMG { ItemID.Keybrand, Do(UseTurn) }, - { ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed - { ItemID.Kraken, Do(DamageExact(65)) }, - { ItemID.LaserMachinegun, Do(DamageExact(49)) }, - { ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) }, - { ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) }, - { ItemID.LeadShortsword, Do(TrueMelee, DamageExact(11)) }, - { ItemID.LeafBlower, Do(DamageExact(61)) }, - { ItemID.LightDisc, Do(DamageExact(80), ShootSpeedExact(18)) }, - { ItemID.LunarFlareBook, Do(DamageExact(110)) }, - { ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) }, - { ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) }, - { ItemID.Marrow, Do(DamageExact(60)) }, - { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(75)) }, - { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, - { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, - { ItemID.MiniNukeI, Do(DamageExact(90)) }, + { ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // VANILLA: 40 DMG. Uses ratios due to remix seed + { ItemID.Kraken, Do(DamageExact(65)) }, // VANILLA: 95 DMG + { ItemID.LaserMachinegun, Do(DamageExact(49)) }, // VANILLA: 60 DMG + { ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) }, // VANILLA: 29 DMG, 12 UT, 8 MANA + { ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) }, // VANILLA: 100 DMG, 12 MANA + { ItemID.LeadShortsword, Do(TrueMelee, DamageExact(11)) }, // VANILLA: 9 DMG + { ItemID.LeafBlower, Do(DamageExact(61)) }, // VANILLA: 48 DMG + { ItemID.LightDisc, Do(DamageExact(80), ShootSpeedExact(18)) }, // VANILLA: 60 DMG, 16 VEL + { ItemID.LunarFlareBook, Do(DamageExact(110)) }, // VANILLA: 100 DMG + { ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) }, // VANILLA: 42 DMG, 4.5 VEL + { ItemID.MagicMissile, Do(DamageExact(23), UseAnimationExact(20), UseTimeExact(10), ManaExact(10)) }, // VANILLA: 35 DMG, 22 UT/UA, 14 MANA + { ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG + { ItemID.MedusaHead, Do(DamageExact(75), ManaExact(6)) }, // VANILLA: 40 DMG, 15 MANA + { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG + { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, // VANILLA: 50 DMG, 9 MANA, 10 VEL + { ItemID.MiniNukeI, Do(DamageExact(90)) }, // VANILLA: 75 DMG { ItemID.MiniNukeII, Do(DamageExact(90)) }, - { ItemID.Minishark, Do(DamageExact(4)) }, - { ItemID.MoltenFury, Do(UseExact(28)) }, - { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod - { ItemID.MonkStaffT2, Do(TrueMelee, DamageExact(90)) }, // Ghastly Glaive - { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury - { ItemID.MoonlordBullet, Do(DamageExact(17)) }, // Luminite Bullet - { ItemID.MoonlordTurretStaff, Do(DamageExact(50)) }, // Lunar Portal Staff - { ItemID.Muramasa, Do(CritDelta(+10)) }, - { ItemID.MushroomSpear, Do(TrueMelee, UseRatio(0.8f), DamageExact(100)) }, - { ItemID.Musket, Do(DamageExact(22)) }, - { ItemID.MythrilHalberd, Do(TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, - { ItemID.MythrilRepeater, Do(UseExact(16)) }, - { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, - { ItemID.NailGun, Do(DamageExact(77)) }, - { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(65)) }, - { ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) }, + { ItemID.Minishark, Do(DamageExact(4)) }, // VANILLA: 6 DMG + { ItemID.MoltenFury, Do(UseExact(28)) }, // VANILLA: 22 UT + { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod. VANILLA: 50 DMG + { ItemID.MonkStaffT2, Do(TrueMelee, DamageExact(90)) }, // Ghastly Glaive. VANILLA: 45 DMG + { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury. VANILLA: 140 DMG + { ItemID.MoonlordBullet, Do(DamageExact(17)) }, // Luminite Bullet. VANILLA: 20 DMG + { ItemID.MoonlordTurretStaff, Do(DamageExact(50)) }, // Lunar Portal Staff. VANILLA: 100 DMG + { ItemID.Muramasa, Do(CritDelta(+10)) }, // VANILLA: 4% CRIT + { ItemID.MushroomSpear, Do(TrueMelee, DamageExact(100), UseExact(32)) }, // VANILLA: 60 DMG, 40 UT + { ItemID.Musket, Do(DamageExact(22)) }, // VANILLA: 31 DMG + { ItemID.MythrilHalberd, Do(TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, // VANILLA: 45 DMG, 26 UT, 4.5 VEL + { ItemID.MythrilRepeater, Do(UseExact(16)) }, // VANILLA: 20 UT + { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, // VANILLA: 50 DMG, 20 UT + { ItemID.NailGun, Do(DamageExact(77)) }, // VANILLA: 85 DMG + { ItemID.NettleBurst, Do(DamageExact(65), ManaExact(10)) }, // VANILLA: 35 DMG, 12 MANA + { ItemID.NightsEdge, Do(TrueMelee, DamageExact(45)) }, // VANILLA: 40 DMG { ItemID.NorthPole, Do(UseMeleeSpeed) }, { ItemID.OrangePhaseblade, phaseblade }, { ItemID.OrangePhasesaber, phasesaber }, - { ItemID.OrichalcumHalberd, Do(TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, - { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, - { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, - { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, - { ItemID.PalladiumPike, Do(TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, - { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, - { ItemID.PalladiumSword, Do(DamageExact(150)) }, - { ItemID.PearlwoodBow, Do(DamageExact(32)) }, - { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, - { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, - { ItemID.PhoenixBlaster, Do(UseExact(20)) }, - { ItemID.PlatinumShortsword, Do(TrueMelee, DamageExact(18)) }, - { ItemID.PoisonStaff, Do(DamageExact(57)) }, - { ItemID.PossessedHatchet, Do(DamageExact(135)) }, - { ItemID.PrincessWeapon, Do(DamageExact(80)) }, // Resonance Scepter - { ItemID.PsychoKnife, Do(UseTurn, UseExact(11), DamageExact(200)) }, - { ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) }, + { ItemID.OrichalcumHalberd, Do(TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, // VANILLA: 46 DMG, 4.5 VEL + { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, // VANILLA: 40 DMG + { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, // VANILLA: 59 DMG + { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, // VANILLA: 90 DMG, 14 VEL + { ItemID.PalladiumPike, Do(TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, // VANILLA: 44 DMG, 4.4 VEL + { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, // VANILLA: 37 DMG + { ItemID.PalladiumSword, Do(DamageExact(150)) }, // VANILLA: 49 DMG + { ItemID.PearlwoodBow, Do(DamageExact(32)) }, // VANILLA: 12 DMG + { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, // VANILLA: 30 DMG + { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, // VANILLA: 20 DMG, 14 VEL + { ItemID.PhoenixBlaster, Do(UseExact(20)) }, // VANILLA: 14 UT + { ItemID.PlatinumShortsword, Do(TrueMelee, DamageExact(18)) }, // VANILLA: 13 DMG + { ItemID.PoisonStaff, Do(DamageExact(57)) }, // VANILLA: 43 DMG + { ItemID.PossessedHatchet, Do(DamageExact(135)) }, // VANILLA: 80 DMG + { ItemID.PrincessWeapon, Do(DamageExact(80)) }, // Resonance Scepter. VANILLA: 70 DMG + { ItemID.PsychoKnife, Do(UseTurn, DamageExact(200), UseExact(11)) }, // VANILLA: 85 DMG, 8 UT + { ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) }, // VANILLA: 8 KB { ItemID.PurplePhaseblade, phaseblade }, { ItemID.PurplePhasesaber, phasesaber }, - { ItemID.PygmyStaff, Do(DamageExact(63)) }, - { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, - { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, - { ItemID.Rally, Do(DamageExact(18)) }, - { ItemID.RavenStaff, Do(DamageExact(36)) }, - { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, - { ItemID.Razorpine, Do(DamageExact(40)) }, + { ItemID.PygmyStaff, Do(DamageExact(63)) }, // VANILLA: 40 DMG + { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, // VANILLA: 45 DMG, 20 MANA + { ItemID.RainbowRod, Do(DamageExact(40), KnockbackExact(8f), ManaExact(13)) }, // VANILLA: 50 DMG, 6 KB, 21 MANA + { ItemID.Rally, Do(DamageExact(18)) }, // VANILLA: 14 DMG + { ItemID.RavenStaff, Do(DamageExact(36)) }, // VANILLA: 55 DMG + { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, // VANILLA: 85 DMG + { ItemID.Razorpine, Do(DamageExact(40)) }, // VANILLA: 48 DMG { ItemID.RedPhaseblade, phaseblade }, { ItemID.RedPhasesaber, phasesaber }, - { ItemID.RedRyder, Do(DamageExact(24)) }, - { ItemID.RedsYoyo, Do(DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats - { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, - { ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) }, - { ItemID.SapphireStaff, Do(DamageExact(25)) }, - { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, - { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, - { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, - { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, - { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, - { ItemID.ShadowFlameKnife, Do(DamageExact(50)) }, - { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn - { ItemID.Shotgun, Do(DamageExact(36)) }, - { ItemID.Shroomerang, Do(ShootSpeedExact(11)) }, - { ItemID.SilverBullet, Do(DamageExact(8)) }, - { ItemID.SilverShortsword, Do(TrueMelee, DamageExact(14)) }, - { ItemID.SkyFracture, Do(DamageExact(46)) }, - { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, - { ItemID.Smolstar, Do(DamageExact(9)) }, // Blade Staff - { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, - { ItemID.SolarEruption, Do(DamageExact(122)) }, - { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain - { ItemID.SpaceGun, Do(DamageExact(23)) }, - { ItemID.Spear, Do(TrueMelee, DamageExact(14)) }, - { ItemID.SpectreStaff, Do(DamageExact(72)) }, - { ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) }, - { ItemID.StaffofEarth, Do(DamageExact(150)) }, - { ItemID.StarCannon, Do(UseExact(18)) }, - { ItemID.StardustDragonStaff, Do(DamageExact(20)) }, - { ItemID.StormTigerStaff, Do(DamageExact(49)) }, // Desert Tiger Staff - { ItemID.StylistKilLaKillScissorsIWish, Do(UseTurn, DamageExact(21)) }, // Stylish Scissors - { ItemID.Stynger, Do(DamageExact(75)) }, - { ItemID.SuperStarCannon, Do(DamageExact(55)) }, - { ItemID.Swordfish, Do(TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(DamageExact(34)) }, - { ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane - { ItemID.TendonBow, Do(DamageExact(17)) }, - { ItemID.TerraBlade, Do(DamageExact(95)) }, - { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, - // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, - // Terrarian is extremely overpowered and requires a heavy nerf. - { ItemID.Terrarian, Do(DamageExact(90)) }, - { ItemID.TheEyeOfCthulhu, Do(DamageExact(80)) }, - { ItemID.TheMeatball, Do(DamageExact(24)) }, - { ItemID.TheRottedFork, Do(TrueMelee, DamageExact(20)) }, - { ItemID.TheUndertaker, Do(DamageExact(15)) }, + { ItemID.RedRyder, Do(DamageExact(24)) }, // VANILLA: 20 DMG + { ItemID.RedsYoyo, Do(DamageExact(48)) }, // VANILLA: 70 DMG. Has the same stats as Valkyrie Yoyo + { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, // VANILLA: 55 DMG, 5 VEL + { ItemID.Sandgun, Do(UseExact(20)) }, // VANILLA: 16 UT + { ItemID.SapphireStaff, Do(DamageExact(25)) }, // VANILLA: 18 DMG + { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, // VANILLA: 70 DMG + { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, // VANILLA: 50 DMG, 12 VEL + { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, // VANILLA: 80 DMG + { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, // VANILLA: 47 DMG + { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, // VANILLA: 32 DMG, 9 VEL + { ItemID.ShadowFlameKnife, Do(DamageExact(50)) }, // VANILLA: 38 DMG + { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn. VANILLA: 34 DMG + { ItemID.Shotgun, Do(DamageExact(36)) }, // VANILLA: 24 DMG + { ItemID.SilverBullet, Do(DamageExact(8)) }, // VANILLA: 9 DMG + { ItemID.SilverShortsword, Do(TrueMelee, DamageExact(14)) }, // VANILLA: 9 DMG + { ItemID.SkyFracture, Do(DamageExact(46)) }, // VANILLA: 38 DMG + { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, // VANILLA: 55 DMG + { ItemID.Smolstar, Do(DamageExact(9)) }, // Blade Staff. VANILLA: 6 DMG + { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, // VANILLA: 185 DMG, 36 UT + { ItemID.SolarEruption, Do(DamageExact(122)) }, // VANILLA: 105 DMG + { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain. VANILLA: 35 DMG + { ItemID.SpaceGun, Do(DamageExact(23)) }, // VANILLA: 17 DMG + { ItemID.Spear, Do(TrueMelee, DamageExact(14)) }, // VANILLA: 8 DMG + { ItemID.SpectreStaff, Do(DamageExact(72)) }, // VANILLA: 65 DMG + { ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) }, // VANILLA: 22 UT, 14 MANA, 3 VEL + { ItemID.StaffofEarth, Do(DamageExact(150)) }, // VANILLA: 125 DMG + { ItemID.StarCannon, Do(UseExact(18)) }, // VANILLA: 12 UT + { ItemID.StardustDragonStaff, Do(DamageExact(20)) }, // VANILLA: 40 DMG + { ItemID.StormTigerStaff, Do(DamageExact(49)) }, // Desert Tiger Staff. VANILLA: 41 DMG + { ItemID.StylistKilLaKillScissorsIWish, Do(UseTurn, DamageExact(21)) }, // Stylish Scissors. VANILLA: 14 DMG + { ItemID.Stynger, Do(DamageExact(75)) }, // VANILLA: 45 DMG + { ItemID.SuperStarCannon, Do(DamageExact(55)) }, // VANILLA: 60 DMG + { ItemID.Swordfish, Do(TrueMelee, DamageExact(24)) }, // VANILLA: 19 DMG + { ItemID.TacticalShotgun, Do(DamageExact(34)) }, // VANILLA: 29 DMG + { ItemID.TaxCollectorsStickOfDoom, Do(UseTurn, DamageExact(70), UseExact(12)) }, // Classy Cane. VANILLA: 16 DMG, 15 UT + { ItemID.TendonBow, Do(DamageExact(17)) }, // VANILLA: 19 DMG + { ItemID.TerraBlade, Do(DamageExact(95)) }, // VANILLA: 85 DMG + { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // VANILLA: 17 DMG + { ItemID.Terrarian, Do(DamageExact(90)) }, // VANILLA: 190 DMG. Required due to fixing iframes so yoyo and shots can hit simultaneously + { ItemID.TheEyeOfCthulhu, Do(DamageExact(80)) }, // VANILLA: 115 DMG + { ItemID.TheMeatball, Do(DamageExact(24)) }, // Displays as 48 damage. VANILLA: 17 DMG (displays as 34) + { ItemID.TheRottedFork, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 17 DMG + { ItemID.TheUndertaker, Do(DamageExact(15)) }, // VANILLA: 19 DMG { ItemID.ThunderSpear, Do(UseMeleeSpeed) }, // Storm Spear - { ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper - { ItemID.TitaniumRepeater, Do(DamageExact(52)) }, - { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, - { ItemID.TitaniumTrident, Do(TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, - { ItemID.TopazStaff, Do(ManaExact(2)) }, - { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33), ManaExact(20)) }, - { ItemID.Toxikarp, Do(UseExact(9)) }, - { ItemID.Trident, Do(TrueMelee, DamageExact(20)) }, - { ItemID.Trimarang, Do(DamageExact(24)) }, - { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, - { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, - { ItemID.Tsunami, Do(DamageExact(45)) }, - { ItemID.TungstenBullet, Do(DamageExact(8)) }, - { ItemID.TungstenShortsword, Do(TrueMelee, DamageExact(15)) }, - { ItemID.UnholyArrow, Do(DamageExact(11)) }, - { ItemID.UnholyTrident, Do(ManaRatio(0.78f), DamageRatio(0.91f)) }, // Uses ratios due to remix seed - { ItemID.Uzi, Do(UseExact(8)) }, - { ItemID.VampireKnives, Do(DamageExact(38)) }, - { ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats - { ItemID.VenomStaff, Do(UseExact(27)) }, - { ItemID.WaspGun, Do(DamageExact(44)) }, - { ItemID.WaterBolt, Do(DamageExact(23)) }, + { ItemID.ThunderStaff, Do(DamageExact(18)) }, // Thunder Zapper. VANILLA: 20 DMG + { ItemID.TitaniumRepeater, Do(DamageExact(52)) }, // VANILLA: 43 DMG + { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, // VANILLA: 61 DMG + { ItemID.TitaniumTrident, Do(TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, // VANILLA: 48 DMG, 5 VEL + { ItemID.TopazStaff, Do(ManaExact(2)) }, // VANILLA: 5 MANA + { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33), ManaExact(20)) }, // VANILLA: 52 DMG, 45 UT, 30 MANA + { ItemID.Toxikarp, Do(UseExact(9)) }, // VANILLA: 10 UT + { ItemID.Trident, Do(TrueMelee, DamageExact(20)) }, // VANILLA: 14 DMG + { ItemID.Trimarang, Do(DamageExact(24)) }, // VANILLA: 21 DMG + { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, // VANILLA: 72 DMG + { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, // VANILLA: 70 DMG + { ItemID.Tsunami, Do(DamageExact(45)) }, // VANILLA: 53 DMG + { ItemID.TungstenBullet, Do(DamageExact(8)) }, // VANILLA: 9 DMG + { ItemID.TungstenShortsword, Do(TrueMelee, DamageExact(15)) }, // VANILLA: 10 DMG + { ItemID.UnholyArrow, Do(DamageExact(11)) }, // VANILLA: 12 DMG + { ItemID.UnholyTrident, Do(DamageRatio(0.91f), ManaRatio(0.78f)) }, // VANILLA: 88 DMG, 19 MANA. Uses ratios due to remix seed + { ItemID.Uzi, Do(UseExact(8)) }, // VANILLA: 9 UT + { ItemID.ValkyrieYoyo, Do(DamageExact(48)) }, // VANILLA: 70 DMG. Has the same stats as Red's Throw + { ItemID.VenomStaff, Do(UseExact(27)) }, // VANILLA: 30 UT + { ItemID.WaspGun, Do(DamageExact(44)) }, // VANILLA: 31 DMG + { ItemID.WaterBolt, Do(DamageExact(23)) }, // VANILLA: 19 DMG { ItemID.WhitePhaseblade, phaseblade }, { ItemID.WhitePhasesaber, phasesaber }, - { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, - { ItemID.Yelets, Do(DamageExact(53)) }, + { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, // VANILLA: 10 DMG + { ItemID.Yelets, Do(DamageExact(53)) }, // VANILLA: 60 DMG { ItemID.YellowPhaseblade, phaseblade }, { ItemID.YellowPhasesaber, phasesaber }, - { ItemID.Zenith, Do(DamageExact(210)) }, - { ItemID.ZombieArm, Do(UseTurn, KnockbackExact(12f)) }, + { ItemID.Zenith, Do(DamageExact(210)) }, // VANILLA: 190 DMG + { ItemID.ZombieArm, Do(UseTurn, KnockbackExact(12f)) }, // VANILLA: 5.5 KB #endregion #region CATEGORY 2: Defense Balancing - { ItemID.LavaSkull, Do(DefenseExact(3)) }, // Magma Skull - { ItemID.MoltenCharm, Do(DefenseExact(3)) }, //Magma Charm - { ItemID.MoltenSkullRose, Do(DefenseExact(4)) }, - { ItemID.ObsidianSkull, Do(DefenseExact(2)) }, - { ItemID.ObsidianSkullRose, Do(DefenseExact(3)) }, - { ItemID.Shackle, Do(DefenseExact(3)) }, - { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, // Valhalla Knight set - { ItemID.SquireAltPants, Do(DefenseDelta(-3)) }, - { ItemID.SquireAltShirt, Do(DefenseDelta(-3)) }, - { ItemID.SquireGreatHelm, Do(DefenseDelta(-1)) }, - { ItemID.SquireGreaves, Do(DefenseDelta(-2)) }, - { ItemID.SquirePlating, Do(DefenseDelta(-4)) }, + { ItemID.LavaSkull, Do(DefenseExact(1)) }, // Magma Skull. VANILLA: 0 DEF + { ItemID.MoltenCharm, Do(DefenseExact(1)) }, // VANILLA: 0 DEF + { ItemID.MoltenSkullRose, Do(DefenseExact(3)) }, // VANILLA: 0 DEF + { ItemID.ObsidianSkullRose, Do(DefenseExact(1)) }, // VANILLA: 0 DEF + // Valhalla Knight armor + { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, // VANILLA: 20 DEF + { ItemID.SquireAltPants, Do(DefenseDelta(-3)) }, // VANILLA: 24 DEF + { ItemID.SquireAltShirt, Do(DefenseDelta(-3)) }, // VANILLA: 24 DEF + { ItemID.SquireGreatHelm, Do(DefenseDelta(-1)) }, // VANILLA: 13 DEF + { ItemID.SquireGreaves, Do(DefenseDelta(-2)) }, // VANILLA: 18 DEF + { ItemID.SquirePlating, Do(DefenseDelta(-4)) }, // VANILLA: 27 DEF #endregion #region CATEGORY 3: Tool Balancing - { ItemID.AcornAxe, Do(AxePower(100)) }, // Axe of Regrowth - { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(32)) }, - { ItemID.AdamantitePickaxe, Do(TileBoostExact(+1)) }, - { ItemID.AdamantiteWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13)) }, - { ItemID.BonePickaxe, Do(UseTimeExact(6)) }, - { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, - { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+0)) }, - { ItemID.CactusPickaxe, Do(UseTimeExact(9)) }, - { ItemID.CnadyCanePickaxe, Do(UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe - { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), DamageExact(112)) }, - { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+2), DamageExact(43)) }, - { ItemID.ChlorophyteGreataxe, Do(AxePower(165), TileBoostExact(+2)) }, - { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, UseTimeExact(5)) }, - { ItemID.ChlorophytePickaxe, Do(TileBoostExact(+2)) }, - { ItemID.ChlorophyteWarhammer, Do(UseTimeExact(8), TileBoostExact(+2)) }, - { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(4), DamageExact(51)) }, - { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, - { ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) }, - { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12)) }, - { ItemID.CopperAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.CopperHammer, Do(UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.CopperPickaxe, Do(UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.DeathbringerPickaxe, Do(UseTimeExact(10)) }, - { ItemID.Drax, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(80)) }, - { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, - { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13)) }, - { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14)) }, - { ItemID.GoldHammer, Do(HammerPower(60), UseTimeExact(9)) }, - { ItemID.GoldPickaxe, Do(UseTimeExact(9)) }, - { ItemID.Hammush, Do(UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15)) }, - { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11)) }, - { ItemID.IronPickaxe, Do(UseTimeExact(8)) }, - { ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4), DamageExact(54)) }, - { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15)) }, - { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11)) }, - { ItemID.LeadPickaxe, Do(PickPower(40), UseTimeExact(8)) }, - { ItemID.LucyTheAxe, Do(UseExact(13), TileBoostExact(+1)) }, - { ItemID.LunarHamaxeNebula, Do(AxePower(175), UseTimeExact(5)) }, - { ItemID.LunarHamaxeSolar, Do(AxePower(175), UseTimeExact(5)) }, - { ItemID.LunarHamaxeStardust, Do(AxePower(175), UseTimeExact(5)) }, - { ItemID.LunarHamaxeVortex, Do(AxePower(175), UseTimeExact(5)) }, - { ItemID.MeteorHamaxe, Do(HammerPower(70)) }, - { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125)) }, - { ItemID.MoltenPickaxe, Do(UseTimeExact(10)) }, - { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, - { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, - { ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11)) }, - { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) }, - { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, - { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, - { ItemID.OrichalcumPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11)) }, - { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), DamageExact(51)) }, - { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, UseTimeExact(5), DamageExact(21)) }, - { ItemID.PalladiumPickaxe, Do(UseTimeExact(9)) }, - { ItemID.PalladiumWaraxe, Do(AxePower(125)) }, - { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, - { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36)) }, - { ItemID.PickaxeAxe, Do(TileBoostExact(+1)) }, - { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14)) }, - { ItemID.PlatinumHammer, Do(HammerPower(60), UseTimeExact(9)) }, - { ItemID.PlatinumPickaxe, Do(PickPower(55), UseTimeExact(9)) }, - { ItemID.Pwnhammer, Do(UseTimeExact(11), TileBoostExact(+1)) }, - { ItemID.RichMahoganyHammer, Do(HammerPower(25), UseTimeExact(10)) }, - { ItemID.Rockfish, Do(HammerPower(50), UseTimeExact(10)) }, - { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45)) }, - { ItemID.ShadewoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, - { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14)) }, - { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10)) }, - { ItemID.SilverPickaxe, Do(PickPower(50)) }, - { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.SpectreHamaxe, Do(AxePower(170), TileBoostExact(+4)) }, - { ItemID.SpectrePickaxe, Do(TileBoostExact(+4)) }, - { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13)) }, - { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16)) }, - { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12)) }, - { ItemID.TinPickaxe, Do(UseTimeExact(10)) }, - { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), TileBoostExact(+1), DamageExact(32)) }, - { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, - { ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14)) }, - { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10)) }, - { ItemID.TungstenPickaxe, Do(UseTimeExact(11)) }, - { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13)) }, - { ItemID.WoodenHammer, Do(UseTimeExact(11), TileBoostExact(+0)) }, + { ItemID.AcornAxe, Do(AxePower(100)) }, // Axe of Regrowth. VANILLA: 150% AXE + { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, DamageExact(75), AxePower(90), TileBoostExact(+0)) }, // VANILLA: 33 DMG, 100 AXE, -1 TILE + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, DamageExact(32), TileBoostExact(+0)) }, // VANILLA: 20 DMG, -1 TILE + { ItemID.AdamantitePickaxe, Do(TileBoostExact(+1)) }, // VANILLA: 0 TILE + { ItemID.AdamantiteWaraxe, Do(UseTimeExact(10), AxePower(160), TileBoostExact(+1)) }, // VANILLA: 8 SPD, 100 AXE, 0 TILE + { ItemID.BloodLustCluster, Do(UseTimeExact(13), AxePower(100)) }, // VANILLA: 15 SPD, 75 AXE + { ItemID.BonePickaxe, Do(UseTimeExact(6)) }, // VANILLA: 11 SPD + { ItemID.BorealWoodHammer, Do(UseTimeExact(11), HammerPower(25)) }, // VANILLA: 23 SPD, 35 HAM + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+0)) }, // VANILLA: 4 SPD, -1 TILE + { ItemID.CactusPickaxe, Do(UseTimeExact(9)) }, // VANILLA: 16 SPD + { ItemID.CnadyCanePickaxe, Do(UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe. VANILLA: 16 SPD + { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, DamageExact(112), UseTimeExact(3), AxePower(120), TileBoostExact(+1)) }, // VANILLA: 50 DMG, 4 SPD, 115 AXE, 0 TILE + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, DamageExact(43), TileBoostExact(+1)) }, // VANILLA: 35 DMG, 0 TILE + { ItemID.ChlorophyteGreataxe, Do(AxePower(165), TileBoostExact(+2)) }, // VANILLA: 115 AXE, +1 TILE + { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, DamageExact(53), UseTimeExact(5), TileBoostExact(+1)) }, // VANILLA: 45 DMG, 4 SPD, 0 TILE + { ItemID.ChlorophytePickaxe, Do(TileBoostExact(+2)) }, // VANILLA: +1 TILE + { ItemID.ChlorophyteWarhammer, Do(UseTimeExact(8), TileBoostExact(+2)) }, // VANILLA: 14 SPD, +1 TILE + { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, DamageExact(51), UseTimeExact(4)) }, // VANILLA: 23 DMG, 7 SPD + { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, DamageExact(21), UseTimeExact(5), PickPower(130)) }, // VANILLA: 10 DMG, 7 SPD, 110 PICK + { ItemID.CobaltPickaxe, Do(UseTimeExact(9), PickPower(130)) }, // VANILLA: 13 SPD, 110 PICK + { ItemID.CobaltWaraxe, Do(UseTimeExact(12), AxePower(125)) }, // VANILLA: 13 SPD, 70 AXE + { ItemID.CopperAxe, Do(UseTimeExact(16), AxePower(50), TileBoostExact(+0)) }, // VANILLA: 21 SPD, 35 AXE, -1 TILE + { ItemID.CopperHammer, Do(UseTimeExact(12), TileBoostExact(+0)) }, // VANILLA: 23 SPD, -1 TILE + { ItemID.CopperPickaxe, Do(UseTimeExact(10), TileBoostExact(+0)) }, // VANILLA: 15 SPD, -1 TILE + { ItemID.DeathbringerPickaxe, Do(UseTimeExact(10)) }, // VANILLA: 14 SPD + { ItemID.Drax, Do(TrueMeleeNoSpeed, DamageExact(80), TileBoostExact(+0)) }, // VANILLA: 35 DMG, -1 TILE + { ItemID.EbonwoodHammer, Do(UseTimeExact(9), HammerPower(25)) }, // VANILLA: 20 SPD, 40 HAM + { ItemID.FleshGrinder, Do(UseTimeExact(13), HammerPower(70)) }, // VANILLA: 19 SPD, 55 HAM + { ItemID.GoldAxe, Do(UseTimeExact(14), AxePower(80)) }, // VANILLA: 18 SPD, 55 AXE + { ItemID.GoldHammer, Do(UseTimeExact(9), HammerPower(60)) }, // VANILLA: 23 SPD, 55 HAM + { ItemID.GoldPickaxe, Do(UseTimeExact(9)) }, // VANILLA: 17 SPD + { ItemID.Hammush, Do(UseTimeExact(10), TileBoostExact(+1)) }, // VANILLA: 14 SPD, 0 TILE + { ItemID.IronAxe, Do(UseTimeExact(15), AxePower(60)) }, // VANILLA: 19 SPD, 45 AXE + { ItemID.IronHammer, Do(UseTimeExact(11), HammerPower(45)) }, // VANILLA: 20 SPD, 40 HAM + { ItemID.IronPickaxe, Do(UseTimeExact(8)) }, // VANILLA: 13 SPD + { ItemID.LaserDrill, Do(DamageExact(54), UseTimeExact(4), PickPower(220)) }, // VANILLA: 35 DMG, 6 SPD, 230 PICK + { ItemID.LeadAxe, Do(UseTimeExact(15), AxePower(60)) }, // VANILLA: 19 SPD, 50 AXE + { ItemID.LeadHammer, Do(UseTimeExact(11), HammerPower(45)) }, // VANILLA: 19 SPD, 43 HAM + { ItemID.LeadPickaxe, Do(UseTimeExact(8), PickPower(40)) }, // VANILLA: 12 SPD, 43 PICK + { ItemID.LucyTheAxe, Do(UseExact(13), TileBoostExact(+1)) }, // VANILLA: 15 SPD/UT, 0 TILE + { ItemID.LunarHamaxeNebula, Do(UseTimeExact(5), AxePower(175)) }, // VANILLA: 7 SPD, 150 AXE + { ItemID.LunarHamaxeSolar, Do(UseTimeExact(5), AxePower(175)) }, + { ItemID.LunarHamaxeStardust, Do(UseTimeExact(5), AxePower(175)) }, + { ItemID.LunarHamaxeVortex, Do(UseTimeExact(5), AxePower(175)) }, + { ItemID.MeteorHamaxe, Do(HammerPower(70)) }, // VANILLA: 60 HAM + { ItemID.MoltenHamaxe, Do(AxePower(125), HammerPower(75)) }, // VANILLA: 150 AXE, 70 HAM + { ItemID.MoltenPickaxe, Do(UseTimeExact(10)) }, // VANILLA: 18 SPD + { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, DamageExact(63), UseTimeExact(4), AxePower(80)) }, // VANILLA: 29 DMG, 6 SPD, 85 AXE + { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, DamageExact(26), UseTimeExact(4), PickPower(160)) }, // VANILLA: 15 DMG, 6 SPD, 150 PICK + { ItemID.MythrilPickaxe, Do(UseTimeExact(8), PickPower(160)) }, // VANILLA: 10 SPD, 150 PICK + { ItemID.MythrilWaraxe, Do(UseTimeExact(11), AxePower(140)) }, // VANILLA: 10 SPD, 85 AXE + { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, DamageExact(95), UseTimeExact(3), TileBoostExact(+3)) }, // VANILLA: 50 DMG, 2 SPD, +2 TILE + { ItemID.NightmarePickaxe, Do(UseTimeExact(9), PickPower(66)) }, // VANILLA: 15 SPD, 65 PICK + { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, DamageExact(63), UseTimeExact(4), AxePower(80)) }, // VANILLA: 31 DMG, 5 SPD, 90 AXE + { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, DamageExact(26), UseTimeExact(4), PickPower(160)) }, // VANILLA: 17 DMG, 5 SPD, 165 PICK + { ItemID.OrichalcumPickaxe, Do(UseTimeExact(8), PickPower(160)) }, // VANILLA: 9 SPD, 165 PICK + { ItemID.OrichalcumWaraxe, Do(UseTimeExact(11), AxePower(140)) }, // VANILLA: 9 SPD, 90 AXE + { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, DamageExact(51), UseTimeExact(4), AxePower(70)) }, // VANILLA: 26 DMG, 7 SPD, 75 AXE + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, DamageExact(21), UseTimeExact(5)) }, // VANILLA: 12 DMG, 7 SPD + { ItemID.PalladiumPickaxe, Do(UseTimeExact(9)) }, // VANILLA: 12 SPD + { ItemID.PalladiumWaraxe, Do(AxePower(125)) }, // VANILLA: 75 AXE + { ItemID.PalmWoodHammer, Do(UseTimeExact(11), HammerPower(25)) }, // VANILLA: 23 SPD, 35 HAM + { ItemID.PearlwoodHammer, Do(DamageExact(36), UseTimeExact(4), UseAnimationExact(20), HammerPower(25)) }, // VANILLA: 10 DMG, 19 SPD/UT, 55 HAM + { ItemID.PickaxeAxe, Do(TileBoostExact(+1)) }, // VANILLA: 0 TILE + { ItemID.PlatinumAxe, Do(UseTimeExact(14), AxePower(80)) }, // VANILLA: 17 SPD, 60 AXE + { ItemID.PlatinumHammer, Do(UseTimeExact(9), HammerPower(60)) }, // VANILLA: 21 SPD, 59 HAM + { ItemID.PlatinumPickaxe, Do(UseTimeExact(9), PickPower(55)) }, // VANILLA: 15 SPD, 59 PICK + { ItemID.Pwnhammer, Do(UseTimeExact(11), TileBoostExact(+1)) }, // VANILLA: 14 SPD, 0 TILE + { ItemID.RichMahoganyHammer, Do(UseTimeExact(10), HammerPower(25)) }, // VANILLA: 23 SPD, 35 HAM + { ItemID.Rockfish, Do(UseTimeExact(10), HammerPower(50)) }, // VANILLA: 14 SPD, 70 HAM + { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45)) }, // VANILLA: 70 AXE + { ItemID.ShadewoodHammer, Do(UseTimeExact(9), HammerPower(25)) }, // VANILLA: 20 SPD, 40 HAM + { ItemID.SilverAxe, Do(UseTimeExact(14), AxePower(70)) }, // VANILLA: 18 SPD, 50 AXE + { ItemID.SilverHammer, Do(UseTimeExact(10), HammerPower(55)) }, // VANILLA: 19 SPD, 45 HAM + { ItemID.SilverPickaxe, Do(PickPower(50)) }, // VANILLA: 45 PICK + { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, DamageExact(95), UseTimeExact(3), TileBoostExact(+3)) }, // VANILLA: 50 DMG, 2 SPD, +2 TILE + { ItemID.SpectreHamaxe, Do(AxePower(170), TileBoostExact(+4)) }, // VANILLA: 150 AXE, +3 TILE + { ItemID.SpectrePickaxe, Do(TileBoostExact(+4)) }, // VANILLA: +3 TILE + { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, DamageExact(95), UseTimeExact(3), TileBoostExact(+3)) }, // VANILLA: 50 DMG, 2 SPD, +2 TILE + { ItemID.TheBreaker, Do(UseTimeExact(13), HammerPower(70)) }, // VANILLA: 19 SPD, 55 HAM + { ItemID.TinAxe, Do(UseTimeExact(16), AxePower(50)) }, // VANILLA: 20 SPD, 40 AXE + { ItemID.TinHammer, Do(UseTimeExact(12), HammerPower(35)) }, // VANILLA: 21 SPD, 38 HAM + { ItemID.TinPickaxe, Do(UseTimeExact(10)) }, // VANILLA: 14 SPD + { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, DamageExact(75), AxePower(90), TileBoostExact(+0)) }, // VANILLA: 34 DMG, 105 AXE, -1 TILE + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, DamageExact(32), PickPower(180), TileBoostExact(+0)) }, // VANILLA: 27 DMG, 190 PICK, -1 TILE + { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, // VANILLA: 7 SPD, 190 PICK, 0 TILE + { ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, // VANILLA: 7 SPD, 105 AXE, 0 TILE + { ItemID.TungstenAxe, Do(UseTimeExact(14), AxePower(70)) }, // VANILLA: 18 SPD, 55 AXE + { ItemID.TungstenHammer, Do(UseTimeExact(10), HammerPower(55)) }, // VANILLA: 25 SPD, 50 HAM + { ItemID.TungstenPickaxe, Do(UseTimeExact(11)) }, // VANILLA: 19 SPD + { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, DamageExact(95), UseTimeExact(3), TileBoostExact(+3)) }, // VANILLA: 50 DMG, 2 SPD, +2 TILE + { ItemID.WarAxeoftheNight, Do(UseTimeExact(13), AxePower(100)) }, // VANILLA: 15 SPD, 75 AXE + { ItemID.WoodenHammer, Do(UseTimeExact(11), TileBoostExact(+0)) }, // VANILLA: 25 SPD, -1 TILE #endregion #region CATEGORY 4: True Melee support diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 07e7f4cb50..384384a467 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,18 +11,11 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; - public static int RegenBoost = 4; - public static int RegenTimeBoost = 4; - - public static int DebuffedRegenBoost = 10; // Does not stack with above - public static int DebuffedRegenTimeFloor = 900; - - public static double ExtraRegenHealthThreshold = 0.75D; - public static int FramesForExtraRegen = 30; + public static int FramesForExtraRegen = 15; public static int BuffType = ModContent.BuffType(); public static int BuffDuration = 10; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), DebuffedRegenBoost.ToRegenPerSecond(), FramesForExtraRegen.FramesToSeconds(), ExtraRegenHealthThreshold.ToPercent(), BuffDuration); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FramesForExtraRegen.FramesToSeconds(), BuffDuration); public override void SetStaticDefaults() { diff --git a/Items/Fishing/EnchantedStarfish.cs b/Items/Fishing/EnchantedStarfish.cs index f34ae22667..24a8edd2b5 100644 --- a/Items/Fishing/EnchantedStarfish.cs +++ b/Items/Fishing/EnchantedStarfish.cs @@ -48,5 +48,7 @@ namespace CalamityMod.Items.Fishing } return true; } + + public override bool ConsumeItem(Player player) => player.ConsumedManaCrystals < Player.ManaCrystalMax; } } diff --git a/Items/Fishing/FishingRods/WulfrumRod.png b/Items/Fishing/FishingRods/WulfrumRod.png index 593ae2bc0c..ef0b27fb58 100644 Binary files a/Items/Fishing/FishingRods/WulfrumRod.png and b/Items/Fishing/FishingRods/WulfrumRod.png differ diff --git a/Items/IHoldShiftTooltipItem.cs b/Items/IHoldShiftTooltipItem.cs index 28938b7a60..69df795e2a 100644 --- a/Items/IHoldShiftTooltipItem.cs +++ b/Items/IHoldShiftTooltipItem.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Terraria.Localization; namespace CalamityMod.Items { @@ -75,6 +76,11 @@ namespace CalamityMod.Items #endregion #region Tooltip Extension Properties + /// + /// The localization text object itself. Override to allow text to be formatted. + /// + public virtual LocalizedText TooltipExtensionText => LocalizedText.Empty; + /// /// The lang/localization key which this item uses for its tooltip extension. /// diff --git a/Items/LabFinders/WhiteSeekingMechanism.cs b/Items/LabFinders/WhiteSeekingMechanism.cs index e415208707..a621e1835f 100644 --- a/Items/LabFinders/WhiteSeekingMechanism.cs +++ b/Items/LabFinders/WhiteSeekingMechanism.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.LabFinders { CreateRecipe(). AddIngredient(). - AddIngredient(ItemID.IceBlock, 50). + AddRecipeGroup("AnyIceBlock", 50). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Materials/CosmiliteBar.cs b/Items/Materials/CosmiliteBar.cs index 3bc6ddbe7c..80133e73e6 100644 --- a/Items/Materials/CosmiliteBar.cs +++ b/Items/Materials/CosmiliteBar.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; ItemID.Sets.SortingPriorityMaterials[Type] = 114; ItemID.Sets.AnimatesAsSoul[Type] = true; - Main.RegisterItemAnimation(Type, new DrawAnimationVertical(6, 10)); + Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 13)); } public override void SetDefaults() diff --git a/Items/Materials/CosmiliteBar.png b/Items/Materials/CosmiliteBar.png index 7c8f6ed134..2c84750b35 100644 Binary files a/Items/Materials/CosmiliteBar.png and b/Items/Materials/CosmiliteBar.png differ diff --git a/Items/Placeables/Astral/AstralSand.cs b/Items/Placeables/Astral/AstralSand.cs index a7e732363b..a317457627 100644 --- a/Items/Placeables/Astral/AstralSand.cs +++ b/Items/Placeables/Astral/AstralSand.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Astral Item.ResearchUnlockCount = 100; ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.SandBlock, 1); - ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType(), 0); + ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType(), 5); } public override void SetDefaults() diff --git a/Items/Placeables/Furniture/CorruptionEffigy.cs b/Items/Placeables/Furniture/CorruptionEffigy.cs index f4518459b6..a8a1a05932 100644 --- a/Items/Placeables/Furniture/CorruptionEffigy.cs +++ b/Items/Placeables/Furniture/CorruptionEffigy.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Placeables.Furniture public static float MoveSpeedBoost = 0.1f; public static int CritBoost = 10; // Both 10% so we only need just one in the tooltip - public static float DamageReductionLoss = 0.05f; + public static float DamageReductionLoss = 0.1f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, DamageReductionLoss.ToPercent()); public override void SetDefaults() diff --git a/Items/Placeables/Furniture/CrimsonEffigy.cs b/Items/Placeables/Furniture/CrimsonEffigy.cs index 3a69a53431..1662948a74 100644 --- a/Items/Placeables/Furniture/CrimsonEffigy.cs +++ b/Items/Placeables/Furniture/CrimsonEffigy.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Placeables.Furniture public new string LocalizationCategory => "Items.Placeables"; public static float DamageBoost = 0.15f; - public static int DefenseBoost = 10; + public static int DefenseBoost = 6; public static float MaxHealthLossPercent = 0.1f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, MaxHealthLossPercent.ToPercent()); diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index af8baea14b..1fcd4d64cf 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; - public static float CritLoss = 75; + public static float CritLoss = 50; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss); public override void SetStaticDefaults() diff --git a/Items/SummonItems/DesertMedallion.cs b/Items/SummonItems/DesertMedallion.cs index 5be0d32527..09a96a112c 100644 --- a/Items/SummonItems/DesertMedallion.cs +++ b/Items/SummonItems/DesertMedallion.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.SummonItems public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SandBlock, 40). + AddRecipeGroup("Sand", 40). AddIngredient(ItemID.AntlionMandible, 4). AddIngredient(2). AddTile(TileID.DemonAltar). diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 2b7ba2735c..0caf445b78 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools Item.width = 60; Item.height = 70; Item.damage = 80; + Item.crit = 25; Item.knockBack = 5f; Item.useTime = 5; Item.useAnimation = 20; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override void MeleeEffects(Player player, Rectangle hitbox) { Dust d = CalamityUtils.MeleeDustHelper(player, Main.rand.NextBool() ? ModContent.DustType() : ModContent.DustType(), 0.48f, 50, 78, -0.1f, 0.1f); diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index 5330fa612f..a0fc904380 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Tools Item.width = 50; Item.height = 60; Item.damage = 65; + Item.crit = 25; Item.knockBack = 5f; Item.useTime = 6; Item.useAnimation = 10; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 9949af0295..2e685defcd 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.SandBlock, 50). + AddRecipeGroup("Sand", 50). AddRecipeGroup("AnyAdamantiteBar", 10). AddIngredient(ItemID.AncientCloth, 5). AddTile(TileID.MythrilAnvil). diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index a4ad4abbf5..79a4fa8f1c 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Items.Tools Item.width = 70; Item.height = 70; Item.damage = 400; + Item.crit = 25; Item.knockBack = 9f; Item.useTime = 1; Item.useAnimation = 10; @@ -56,9 +57,6 @@ namespace CalamityMod.Items.Tools return new Vector2(10, 10); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index 1cd4cc87d7..73deccfbe7 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Tools @@ -14,9 +15,9 @@ namespace CalamityMod.Items.Tools private const int AxePower = 180 / 5; public static float DamageBoost = 0.15f; - public static int DefenseBoost = 30; - public static float DamageReductionBoost = 0.1f; - + public static int DefenseBoost = 15; + public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(10); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, GraxBoostDuration.FramesToSeconds()); public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -72,7 +73,7 @@ namespace CalamityMod.Items.Tools public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 600); + player.AddBuff(ModContent.BuffType(), GraxBoostDuration); } } } diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index e4b232899e..44429ca5dd 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Tools Item.width = 80; Item.height = 66; Item.damage = 110; + Item.crit = 10; Item.knockBack = 7f; Item.useTime = 8; Item.useAnimation = 12; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Tools Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) { hitbox = CalamityUtils.FixSwingHitbox(54, 54); diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index c0f2e9952f..690d11d151 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -67,7 +67,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[] { ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 43c6867f92..8ae7e117cf 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -20,7 +20,8 @@ namespace CalamityMod.Items.VanillaArmorChanges public const int MaxManaBoost = 20; public const int DefenseBoostMax = 10; public const int TimeUntilDecayBeginsAfterAttacking = 60; - public const int TimeUntilBoostCompletelyDecays = 210; + public const int TimeUntilBoostCompletelyDecays = 210; // Unlisted use: this is also the amount of hits to max out defense. + public const int CritToDRConversionPercent = 25; public override void ApplyHeadPieceEffect(Player player) { @@ -36,12 +37,12 @@ namespace CalamityMod.Items.VanillaArmorChanges setBonusText = CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}.Melee"); } - setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(DefenseBoostMax)}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(CritToDRConversionPercent, DefenseBoostMax, TimeUntilBoostCompletelyDecays.FramesToSeconds())}"; } public override void ApplyArmorSetBonus(Player player) { - int critBoost = (int)(MathHelper.Clamp(player.endurance, 0f, 1f) * 50f); + int critBoost = (int)(MathHelper.Clamp(player.endurance, 0f, 1f) * CritToDRConversionPercent); switch (player.armor[0].type) { case ItemID.AdamantiteHeadgear: diff --git a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs index 3ba4856861..233e6dcee9 100644 --- a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Crimson"; - public const float ArmorPieceDamage = 0.06f; public const int ArmorPieceLifeRegen = 1; // Set bonus clarification @@ -25,9 +24,6 @@ namespace CalamityMod.Items.VanillaArmorChanges private static void ApplyAnyPieceEffect(Player player) { - // Remove the vanilla +3% damage and add the new damage value at the same time - player.GetDamage() += ArmorPieceDamage - 0.03f; - // Give life regen player.lifeRegen += ArmorPieceLifeRegen; } diff --git a/Items/VanillaArmorChanges/FrostArmorSetChange.cs b/Items/VanillaArmorChanges/FrostArmorSetChange.cs index f84f8b0fa0..f98bfee7ba 100644 --- a/Items/VanillaArmorChanges/FrostArmorSetChange.cs +++ b/Items/VanillaArmorChanges/FrostArmorSetChange.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Frost"; - public const float ProximityBoost = 0.2f; - public const float MinDistance = 160f; - public const float MaxDistance = 800f; + public const float ProximityBoost = 0.25f; + public const float MinDistance = 80f; + public const float MaxDistance = 720f; public override void UpdateSetBonusText(ref string setBonusText) { diff --git a/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs b/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs deleted file mode 100644 index ec3cb749c2..0000000000 --- a/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.VanillaArmorChanges -{ - public class OrichalcumArmorSetChange : VanillaArmorChange - { - public override int? HeadPieceID => ItemID.OrichalcumHelmet; - - public override int? BodyPieceID => ItemID.OrichalcumBreastplate; - - public override int? LegPieceID => ItemID.OrichalcumLeggings; - - public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.OrichalcumHeadgear, ItemID.OrichalcumMask }; - - public override string ArmorSetName => "Orichalcum"; - - public const int ChestplateCritChanceBoost = 4; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestplateCritChanceBoost; - } -} diff --git a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs index 064aa47036..53913379ff 100644 --- a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs @@ -16,19 +16,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Palladium"; - public const int ChestplateDamagePercentageBoost = 2; - public const int LeggingsDamagePercentageBoost = 3; - - public override void ApplyBodyPieceEffect(Player player) - { - player.GetDamage() += ChestplateDamagePercentageBoost * 0.01f; - } - - public override void ApplyLegPieceEffect(Player player) - { - player.GetDamage() += LeggingsDamagePercentageBoost * 0.01f; - } - public override void UpdateSetBonusText(ref string setBonusText) { setBonusText = $"{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; diff --git a/Items/VanillaArmorChanges/RainArmorSetChange.cs b/Items/VanillaArmorChanges/RainArmorSetChange.cs index d777dc2c4a..cd67076673 100644 --- a/Items/VanillaArmorChanges/RainArmorSetChange.cs +++ b/Items/VanillaArmorChanges/RainArmorSetChange.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public static void SpawnRainArmorJump(Player Player) { bool rainBoost = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining; - int damage = (int)Player.GetBestClassDamage().ApplyTo(30 * (rainBoost ? 2f : 1)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(30 * (rainBoost ? 1.5f : 1)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Vector2.UnitY * 26, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer); } } diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 7223d35dbe..5bd42780b5 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 94; Item.height = 54; - Item.damage = 355; + Item.damage = 315; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useAnimation = Item.useTime = UseTime; diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs index e6b56a57c7..48329f3ad6 100644 --- a/Items/Weapons/Magic/AethersWhisper.cs +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 134; Item.height = 44; - Item.damage = 504; + Item.damage = 600; Item.knockBack = 5.5f; Item.useAnimation = Item.useTime = 24; Item.shootSpeed = 12f; diff --git a/Items/Weapons/Magic/Apathanull.cs b/Items/Weapons/Magic/Apathanull.cs index 862e88b275..799f6e63bc 100644 --- a/Items/Weapons/Magic/Apathanull.cs +++ b/Items/Weapons/Magic/Apathanull.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 63; Item.DamageType = DamageClass.Magic; + Item.crit = 12; Item.mana = 20; Item.useTime = 8; Item.useAnimation = 20; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.7f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Magic/AstralStaff.cs b/Items/Weapons/Magic/AstralStaff.cs index 03a48809e3..c7cc0e9a90 100644 --- a/Items/Weapons/Magic/AstralStaff.cs +++ b/Items/Weapons/Magic/AstralStaff.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 72; Item.damage = 245; Item.DamageType = DamageClass.Magic; + Item.crit = 15; Item.mana = 26; Item.useTime = 18; Item.useAnimation = 18; @@ -36,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 15f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f); diff --git a/Items/Weapons/Magic/CoralSpout.cs b/Items/Weapons/Magic/CoralSpout.cs index f0df8bd95b..29915efe9f 100644 --- a/Items/Weapons/Magic/CoralSpout.cs +++ b/Items/Weapons/Magic/CoralSpout.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 30; - Item.damage = 8; + Item.damage = 9; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 26; @@ -38,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; + Item.ArmorPenetration = 5; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index e231ed2ab4..db855f0b79 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 32; Item.DamageType = DamageClass.Magic; + Item.crit = 5; Item.mana = 7; Item.useTime = 7; Item.useAnimation = 21; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 12f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 5; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 spreadVelocity = velocity.RotatedByRandom(MathHelper.ToRadians(18f)) * Main.rand.NextFloat(0.8f, 1.2f); diff --git a/Items/Weapons/Magic/HyperdeathRiftScepter.cs b/Items/Weapons/Magic/HyperdeathRiftScepter.cs index 384dabfa6c..f8978a184f 100644 --- a/Items/Weapons/Magic/HyperdeathRiftScepter.cs +++ b/Items/Weapons/Magic/HyperdeathRiftScepter.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 80; Item.height = 84; - Item.damage = 4300; + Item.damage = 4100; Item.DamageType = DamageClass.Magic; Item.mana = 50; Item.useTime = Item.useAnimation = 50; diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index a162271cf9..5b4f710290 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 16; Item.damage = 50; Item.DamageType = DamageClass.Magic; + Item.crit = 25; Item.mana = 15; Item.useTime = 2; Item.useAnimation = 30; @@ -38,10 +39,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = 28f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 016e0e5e2a..7f76b27f3f 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -17,18 +17,17 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public static float BuffDamageReductionBoost = 0.08f; - public static float BuffDamageBoost = 0.18f; + public static float BuffDamageBoost = 0.15f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDamageReductionBoost.ToPercent(), BuffDamageBoost.ToPercent()); public override void SetDefaults() { Item.width = 40; Item.height = 56; - Item.damage = 4350; + Item.damage = 3825; Item.DamageType = DamageClass.Magic; Item.mana = 95; - Item.useTime = 78; - Item.useAnimation = 78; + Item.useTime = Item.useAnimation = 72; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 14; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 252fca4e1a..96af4794a6 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 38; Item.height = 54; Item.damage = 60; + Item.crit = 20; Item.mana = 17; Item.noMelee = true; Item.useAnimation = 22; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 6; i++) diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index f84d56f9d3..f7fa8e662f 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -1,10 +1,10 @@ -using CalamityMod.Items.Materials; +using System; +using System.Collections.Generic; +using System.IO; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.IO; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -92,6 +92,23 @@ namespace CalamityMod.Items.Weapons.Magic return soul; } + public override bool CanRightClick() + { + if (!Main.keyState.PressingShift()) + return false; + return true; + } + + public override void RightClick(Player player) + { + if (storedSoulpower > 0) + { + storedSoulpower = 0; + } + } + + public override bool ConsumeItem(Player player) => false; + public Color FindColorForSoul() { Color returnColor = new(0, 0, 0); diff --git a/Items/Weapons/Magic/StarShower.cs b/Items/Weapons/Magic/StarShower.cs index ae8c5a91a7..7711b1af37 100644 --- a/Items/Weapons/Magic/StarShower.cs +++ b/Items/Weapons/Magic/StarShower.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 40; Item.damage = 60; Item.DamageType = DamageClass.Magic; + Item.crit = 25; Item.mana = 15; Item.rare = ItemRarityID.Cyan; Item.useTime = 14; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.shootSpeed = ShootSpeed; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 mouse = player.ClampedMouseWorld(); diff --git a/Items/Weapons/Magic/TheDanceofLight.cs b/Items/Weapons/Magic/TheDanceofLight.cs index 32f4211022..9f50835ece 100644 --- a/Items/Weapons/Magic/TheDanceofLight.cs +++ b/Items/Weapons/Magic/TheDanceofLight.cs @@ -33,9 +33,10 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 40; Item.height = 42; Item.damage = 515; - Item.knockBack = 4f; Item.DamageType = DamageClass.Magic; + Item.crit = 20; Item.mana = 6; + Item.knockBack = 4f; Item.useStyle = ItemUseStyleID.Shoot; Item.useTime = 2; @@ -54,9 +55,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.Calamity().devItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override Vector2? HoldoutOffset() => Vector2.Zero; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 6dc127929d..79819761d0 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = Item.height = 70; Item.damage = 120; + Item.crit = 30; Item.knockBack = 5f; Item.useTime = 3; Item.reuseDelay = Item.useAnimation = 15; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ItemRarityID.Purple; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 30; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo projSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 5174f80dbc..10aff81ac9 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.Magic public class ValkyrieRay : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - // The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames. + // The base use time of the weapon is 36: 24 charge frames + 12 cooldown frames. // The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges. // This math is handled in its holdout projectile, ValkyrieRayStaff. - public const int ChargeFrames = 18; - public const int CooldownFrames = 10; + public const int ChargeFrames = 24; + public const int CooldownFrames = 12; public const float GemDistance = 18f; public static readonly Color LightColor = new Color(235, 40, 121); @@ -27,9 +27,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 54; Item.height = 52; - Item.damage = 115; + Item.damage = 90; Item.knockBack = 8.5f; Item.DamageType = DamageClass.Magic; + Item.crit = 11; Item.mana = 17; Item.useTime = ChargeFrames + CooldownFrames; Item.useAnimation = ChargeFrames + CooldownFrames; @@ -45,8 +46,6 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index b3e9f78474..63c8f0dcad 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.IceBlock, 30). + AddRecipeGroup("AnyIceBlock", 30). AddIngredient(ItemID.Feather, 3). AddIngredient(ItemID.FallenStar, 5). AddIngredient(ItemID.Cloud, 10). diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index 1b9615ad9c..4fac11427b 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 300); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); var source = player.GetSource_ItemUse(Item); int p = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, 12f, player.whoAmI); Main.projectile[p].Kill(); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 14a4346bf8..c119913376 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 136; Item.damage = 1800; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 15; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 15; @@ -93,9 +94,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 8a65882035..4dc95aa92f 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 172; Item.damage = 507; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 10; Item.noUseGraphic = true; Item.noMelee = true; Item.useAnimation = 20; @@ -71,9 +72,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 16f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index 688ef97985..68a9bd3f48 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 50; Item.damage = 90; Item.DamageType = TrueMeleeDamageClass.Instance; + Item.crit = 25; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 13f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void AddRecipes() diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index 4920f4ff29..99890c2b25 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Melee; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 40; + Item.damage = 85; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; @@ -30,6 +31,13 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Blue; } public override bool MeleePrefix() => true; + public override bool CanUseItem(Player player) => false; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index 02a837769c..c4503e4546 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -327,7 +327,7 @@ namespace CalamityMod.Items.Weapons.Melee AddIngredient(ItemType(), 10). AddIngredient(ItemID.HellstoneBar, 10). AddIngredient(ItemID.DirtBlock, 50). - AddIngredient(ItemID.StoneBlock, 50). + AddRecipeGroup("AnyStoneBlock", 50). AddTile(TileID.Anvils). Register(); } diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 99c244a22e..e9c89a9a0c 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 66; Item.damage = 420; Item.DamageType = DamageClass.MeleeNoSpeed; + Item.crit = 10; Item.useAnimation = 25; Item.useTime = 5; Item.noMelee = true; @@ -35,8 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.shootSpeed = 24f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; // You can't use the sword if you've thrown it, silly public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 27abbe6fa8..596829a8c7 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -1,38 +1,203 @@ -using Terraria; +using System; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Utilities.Daybreak; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class EvilSmasher : ModItem, ILocalizedModType + public class EvilSmasher : BaseSwordHoldoutItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override int ProjectileType => ModContent.ProjectileType(); + + public bool IsAnimating = false; + public int AnimationTime = 0; public override void SetDefaults() { + base.SetDefaults(); Item.width = 64; Item.height = 66; - Item.damage = 120; - Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = 38; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; + Item.damage = 200; + Item.DamageType = AverageDamageClass.Instance; + Item.useAnimation = Item.useTime = 120; + Item.channel = true; Item.knockBack = 6f; - Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; } - - public override float UseSpeedMultiplier(Player player) => 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void ModifyWeaponDamage(Player player, ref StatModifier damage) => damage *= 1f + player.Calamity().evilSmasherBoost * 0.1f; - - public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback *= 1f + (player.Calamity().evilSmasherBoost * 0.1f); - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + public override void UpdateInventory(Player player) { - if (target.life <= 0 && player.Calamity().evilSmasherBoost < 10) - player.Calamity().evilSmasherBoost += 1; + AnimationTime = 300; + base.UpdateInventory(player); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + if (!IsAnimating) + { + if (AnimationTime < 300) + AnimationTime++; + return; + } + float completion = AnimationTime / 240f; + Item.noGrabDelay = 120; + Item.velocity = new Vector2(0, -1f); + int dotAmount = 0; + for (var i = 0; i < dotAmount; i++) + { + var ringDir = getRingOffset(i / (float)dotAmount * -MathHelper.TwoPi + MathHelper.TwoPi * completion * 3, ySquish: 3f); + Dust.NewDustPerfect(Item.Center + (ringDir * (completion - MathF.Pow(completion, 2)) * 256), i % 2 == 0 ? DustID.Crimson : DustID.Corruption, ringDir); + } + if (Main.rand.NextFloat() < completion) + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch,Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + if (completion >= 1) + { + for (var i = 0; i < 50; i++) + { + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.CursedTorch : DustID.IchorTorch, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + Dust.NewDustPerfect(Item.Center, Main.rand.NextBool() ? DustID.Crimson : DustID.Corruption, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * 5); + } + IsAnimating = false; + Item.velocity = new Vector2(0, -5); + } + AnimationTime++; + } + + #region Textures + private static Asset GlowTex = null; + private static Texture2D GetGlowTex() + { + if (GlowTex == null) + { + GlowTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + return GlowTex.Value; + } + + private static Asset GlowBeamTex = null; + private static Texture2D GetGlowBeamTex() + { + if (GlowBeamTex == null) + { + GlowBeamTex = ModContent.Request("CalamityMod/Particles/BloomLineFade"); + } + return GlowBeamTex.Value; + } + private static Asset GlowBeamCapTex = null; + private static Texture2D GetGlowBeamCapTex() + { + if (GlowBeamCapTex == null) + { + GlowBeamCapTex = ModContent.Request("CalamityMod/Particles/BloomLineCap"); + } + return GlowBeamCapTex.Value; + } + #endregion + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + if (IsAnimating) + { + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * (AnimationTime / 240f), SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * (AnimationTime / 240f) * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + + Main.spriteBatch.End(); + } + + var tex = TextureAssets.Item[ItemID.Pwnhammer].Value; + Main.spriteBatch.Draw(tex, Item.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.Black, AnimationTime / 240f), 0, tex.Size() * 0.5f, MathHelper.Lerp(1, 1.75f, AnimationTime / 240f), SpriteEffects.None, 0); + return false; + + } + else if (AnimationTime < 300) + { + float completion = 1 - (AnimationTime - 240) / 60f; + var color = Color.Lerp(Color.Purple, Color.Red, MathF.Sin(Main.GlobalTimeWrappedHourly * 6) * 0.5f + 0.5f); + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(SpriteSortMode.Immediate, + BlendState.Additive, + SamplerState.PointClamp, + DepthStencilState.None, + Main.Rasterizer, + null, + Main.GameViewMatrix.TransformationMatrix + ); + + Main.spriteBatch.Draw(GetGlowTex(), Item.Center - Main.screenPosition, null, color, 0, GetGlowTex().Size() * 0.5f, 0.1f + 0.7f * completion, SpriteEffects.None, 0); + int rep = 0; + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.166f) + { + Main.spriteBatch.Draw(GetGlowBeamTex(), Item.Center - Main.screenPosition, null, color, MathHelper.WrapAngle(Main.GlobalTimeWrappedHourly) + i, new(GetGlowBeamTex().Size().X * 0.5f, 0), 0f + 0.06f * completion * (rep == 0 ? 1 : 0.75f), SpriteEffects.None, 0); + rep = (rep + 1) % 2; + } + + Main.spriteBatch.End(); + } + } + return base.PreDrawInWorld(spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI); + } + + private Vector2 getRingOffset(float rad, float xSquish = 1, float ySquish = 1) + { + return new Vector2((1 / xSquish) * MathF.Cos(rad), (1 / ySquish) * MathF.Sin(rad)); + } + } + + public class EvilSmasherSacrifice : GlobalItem + { + public override bool AppliesToEntity(Item entity, bool lateInstantiation) + { + return entity.type == ItemID.Pwnhammer; + } + + public override void Update(Item item, ref float gravity, ref float maxFallSpeed) + { + if (item.noGrabDelay > 0) return; //Only run once the item is fully settled + for (var i = 0; i < 5; i++) //Loop a couple times to check different vertical positions for the altar, improving accuracy. + { + var tileCheckPos = item.Center.ToTileCoordinates() + new Point(0, i); + if (Main.tile[tileCheckPos.X, tileCheckPos.Y].TileType == TileID.DemonAltar) + { + if (!(Main.netMode == NetmodeID.MultiplayerClient)) + { + var newItem = Main.item[Item.NewItem(item.GetSource_FromThis(), item.Hitbox, ModContent.ItemType())]; + newItem.noGrabDelay = 120; + newItem.prefix = item.prefix; + (newItem.ModItem as EvilSmasher).IsAnimating = true; + } + item.stack -= 1; + if (item.stack <= 0) + item.active = false; + return; + } + } } } } diff --git a/Items/Weapons/Melee/EvilSmasherGlow.png b/Items/Weapons/Melee/EvilSmasherGlow.png new file mode 100644 index 0000000000..a42c9964b6 Binary files /dev/null and b/Items/Weapons/Melee/EvilSmasherGlow.png differ diff --git a/Items/Weapons/Melee/ExaltedOathblade.cs b/Items/Weapons/Melee/ExaltedOathblade.cs index bfd403ae03..7b24615dc9 100644 --- a/Items/Weapons/Melee/ExaltedOathblade.cs +++ b/Items/Weapons/Melee/ExaltedOathblade.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 88; Item.height = 88; Item.damage = 90; + Item.crit = 31; Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Shoot; @@ -39,7 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 31; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !player.Calamity().mouseRight; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index b8339e9b17..1f474602f8 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 74; Item.height = 74; Item.damage = 58; + Item.crit = 21; Item.useAnimation = Item.useTime = 50; Item.useStyle = ItemUseStyleID.Shoot; @@ -38,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Pink; } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && !player.Calamity().mouseRight; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 6fdeb93033..bae656ef03 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -1,11 +1,9 @@ using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee.Spears; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Collections.Generic; -using System.Linq; namespace CalamityMod.Items.Weapons.Melee { @@ -18,15 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { base.SetStaticDefaults(); + CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true; } public override bool SizeModifiers => false; - - public override void ModifyTooltips(List tooltips) - { - float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(TrueMeleeNoSpeedDamageClass.Instance) * 0.02f; - tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent()); - - } public override void SetDefaults() { Item.width = 66; diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index fab3876b27..c22652b727 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 2407; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( + Item.damage = 3777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 77; Item.useTime = 77; @@ -56,14 +56,6 @@ namespace CalamityMod.Items.Weapons.Melee { list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"))); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(3). - AddTile(TileID.MythrilAnvil). - Register(); - } public override void OnSpawn(IEntitySource source) { time = 0; @@ -95,11 +87,21 @@ namespace CalamityMod.Items.Weapons.Melee int particleNumber = (int)Math.Max(15 * power, 2); for (int i = -particleNumber; i <= particleNumber; i++) { - Particle sparks = new AltSparkParticle(place, (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, false, Main.rand.Next(17, 30 + 1), Main.rand.NextFloat(0.2f, 0.8f), Main.rand.NextBool() ? Color.Lerp(Color.Blue, Color.DodgerBlue, 0.3f) : Color.Gold); - GeneralParticleHandler.SpawnParticle(sparks); - Dust dust = Dust.NewDustPerfect(place, ModContent.DustType(), (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, 0, default, Main.rand.NextFloat(0.85f, 1.2f) * power); + if (i % 2 == 0) + { + Vector2 vel = (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power; + Dust dust2 = Dust.NewDustPerfect(place + vel * 13, ModContent.DustType(), + vel, 0, default, Main.rand.NextFloat(1.3f, 1.2f)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + } + + Dust dust = Dust.NewDustPerfect(place, ModContent.DustType(), (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, 0, default, Main.rand.NextFloat(0.85f, 1.2f) * power); dust.noGravity = true; dust.color = Main.rand.NextBool() ? Color.Blue : Color.DodgerBlue; + dust.customData = 7; } SoundStyle sound = new("CalamityMod/Sounds/NPCHit/ExoHit3"); @@ -130,10 +132,11 @@ namespace CalamityMod.Items.Weapons.Melee maxFallSpeed = 75; oldVel = Item.velocity; } - public override void OnCreated(ItemCreationContext context) + public override bool OnPickup(Player player) { if (Main.zenithWorld) SoundEngine.PlaySound(GrandDadEasterEggSound, Main.LocalPlayer.MountedCenter); + return true; } } } diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index 53d2f6cc00..27700e8c12 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 26; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 115; + Item.damage = 222; Item.knockBack = 7f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/Lightspeed.cs b/Items/Weapons/Melee/Lightspeed.cs index 4c0551e7cb..28e525dd29 100644 --- a/Items/Weapons/Melee/Lightspeed.cs +++ b/Items/Weapons/Melee/Lightspeed.cs @@ -1,7 +1,10 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 74; Item.height = 94; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 220; + Item.damage = 200; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 20; Item.shootSpeed = 10f; @@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee } // You can only use the right-click if you have sufficient Elemental Mastery - public override bool AltFunctionUse(Player player) => player.Calamity().elementalMastery >= 100; + public override bool AltFunctionUse(Player player) => player.GetModPlayer().elementalMastery >= MaxEnergy; public override void HoldItem(Player player) { if (player.Calamity().cooldowns.TryGetValue(ElementalMastery.ID, out var cooldown)) { - cooldown.timeLeft = player.Calamity().elementalMastery; + cooldown.timeLeft = player.GetModPlayer().elementalMastery; } else { @@ -62,4 +65,125 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } + + public class LightspeedPlayer : ModPlayer + { + public int elementalMastery = 0; + public int elementalMasteryPrevious = 0; + public int elementalMasteryTimer = 0; + public bool elementalMasteryPaused = false; + public bool elementalMasteryMaxFXPlayed = false; + private int lucreciaParticleTimer = 0; + + public override void PostUpdateMiscEffects() + { + if (Player.HeldItem.type == ModContent.ItemType() && elementalMastery > 0) + { + lucreciaParticleTimer--; + + // If the timer is at or below zero, spawn a particle. + if (lucreciaParticleTimer <= 0) + { + // Reset the timer (spawn rate depends on energy) + lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60)); + + float radius = Main.rand.NextFloat(160f, 190f); // Distance from center + float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius + + Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; + + // Scale opacity with energy + float opacity = elementalMastery / (float)Lightspeed.MaxEnergy; + Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed; + color *= opacity * 0.5f; + + if (elementalMastery >= 100) + { + color *= 2.4f; // Way brighter + } + + Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path + float rotationSpeed = 0.04f; + + var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); + GeneralParticleHandler.SpawnParticle(particle); + } + } + + + if (Player.HeldItem.type == ModContent.ItemType()) + { + if (elementalMastery == 0) + elementalMasteryPrevious = 0; + + if (elementalMastery > 0) + { + if (elementalMastery > elementalMasteryPrevious) + { + elementalMasteryPaused = true; + elementalMasteryTimer = 0; + } + + elementalMasteryTimer++; + + // Pause for 180 ticks + if (elementalMasteryPaused) + { + if (elementalMasteryTimer >= 1 && elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryMaxFXPlayed) + { + SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); + SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); + + for (int i = 0; i < 10; i++) // Circular ring of particles burst from player + { + float angle = MathHelper.TwoPi * (i / 10f); + Vector2 spawnDirection = angle.ToRotationVector2(); + Vector2 velocity = spawnDirection * 14f; + + CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + elementalMasteryMaxFXPlayed = true; + } + + // If the pause is Done, resume decrementing. + if (elementalMasteryTimer >= 180) + { + elementalMasteryTimer = 0; + elementalMastery--; + } + } + else // Decrementing + { + // Once every 30 ticks + if (elementalMasteryTimer >= 30) + { + elementalMastery--; + elementalMasteryTimer = 0; + } + } + + if (elementalMastery != Lightspeed.MaxEnergy) + elementalMasteryMaxFXPlayed = false; + } + + // Update for next loop. + elementalMasteryPrevious = elementalMastery; + + } + else + { + // Reset all EM variables when not holding the weapon + elementalMasteryTimer = 0; + elementalMasteryPaused = false; + elementalMastery = 0; + } + } + + public override void UpdateDead() + { + elementalMastery = 0; + elementalMasteryPrevious = 0; + } + } } diff --git a/Items/Weapons/Melee/Lucrecia.cs b/Items/Weapons/Melee/Lucrecia.cs index 6fd7a2d0d9..e2160af239 100644 --- a/Items/Weapons/Melee/Lucrecia.cs +++ b/Items/Weapons/Melee/Lucrecia.cs @@ -1,8 +1,11 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 54; Item.height = 54; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 150; + Item.damage = 132; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 34; Item.shootSpeed = 10f; @@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee } - public override bool AltFunctionUse(Player player) => player.Calamity().darklightEnergy >= MaxEnergy; + public override bool AltFunctionUse(Player player) => player.GetModPlayer().darklightEnergy >= MaxEnergy; public override void HoldItem(Player player) { if (player.Calamity().cooldowns.TryGetValue(DarklightEnergy.ID, out var cooldown)) { - cooldown.timeLeft = player.Calamity().darklightEnergy; + cooldown.timeLeft = player.GetModPlayer().darklightEnergy; } else { @@ -64,4 +67,129 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } + + public class LucreciaPlayer : ModPlayer + { + private int lucreciaParticleTimer = 0; + public int darklightEnergy = 0; + public int darklightEnergyPrevious = 0; + public int darklightEnergyTimer = 0; + public bool darklightEnergyPaused = false; + public bool darklightEnergyMaxFXPlayed = false; + + + public override void PostUpdateMiscEffects() + { + if (Player.HeldItem.type == ModContent.ItemType()) + { + if (darklightEnergy == 0) + darklightEnergyPrevious = 0; + + if (darklightEnergy > 0) + { + // If the player's energy has increased since last tick + if (darklightEnergy > darklightEnergyPrevious) + { + darklightEnergyPaused = true; + darklightEnergyTimer = 0; + } + + darklightEnergyTimer++; + + // Pause for 180 ticks + if (darklightEnergyPaused) + { + if (darklightEnergyTimer >= 1 && darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyMaxFXPlayed) + { + SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); + SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); + + for (int i = 0; i < 10; i++) // Circular ring of particles burst from player + { + float angle = MathHelper.TwoPi * (i / 10f); + Vector2 spawnDirection = angle.ToRotationVector2(); + Vector2 velocity = spawnDirection * 14f; + + CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + darklightEnergyMaxFXPlayed = true; + } + + // If the pause is Done, resume decrementing. + if (darklightEnergyTimer >= 180) + { + darklightEnergyPaused = false; + darklightEnergyTimer = 0; + darklightEnergy--; + } + } + else // Decrementing + { + darklightEnergyMaxFXPlayed = false; + // Once every 20 ticks + if (darklightEnergyTimer >= 20) + { + darklightEnergy--; + darklightEnergyTimer = 0; + } + } + } + + if (darklightEnergy != Lucrecia.MaxEnergy) + darklightEnergyMaxFXPlayed = false; + + // Update for next loop. + darklightEnergyPrevious = darklightEnergy; + + } + else + { + // Reset all energy variables when not holding the weapon + darklightEnergyTimer = 0; + darklightEnergyPaused = false; + darklightEnergy = 0; + } + + + if (Player.HeldItem.type == ModContent.ItemType() && darklightEnergy > 0) + { + lucreciaParticleTimer--; + + // If the timer is at or below zero, spawn a particle. + if (lucreciaParticleTimer <= 0) + { + // Reset the timer (spawn rate depends on energy) + lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60)); + + float radius = Main.rand.NextFloat(160f, 190f); // Distance from center + float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius + + Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; + + // Scale opacity with energy + float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy; + Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue; + color *= opacity * 0.5f; + + if (darklightEnergy >= 100) + { + color *= 2.4f; // Way brighter + } + + Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path + float rotationSpeed = 0.04f; + + var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); + GeneralParticleHandler.SpawnParticle(particle); + } + } + } + + public override void UpdateDead() + { + darklightEnergy = 0; + darklightEnergyPrevious = 0; + } + } } diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index 72d7cdd46c..aeb2820dcd 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee xDist *= speedMult; yDist *= speedMult; - int knifeAmt = Main.rand.Next(4, 7); + int knifeAmt = Main.rand.Next(3, 5); for (int i = 0; i < knifeAmt; i++) { float xVec = xDist; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 5b5a7708c9..3f14bfa7fd 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 134; Item.damage = 2200; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 61; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -47,9 +48,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 61; - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture; diff --git a/Items/Weapons/Melee/OldLordClaymore.cs b/Items/Weapons/Melee/OldLordClaymore.cs index 82d8b08a91..d3673b326a 100644 --- a/Items/Weapons/Melee/OldLordClaymore.cs +++ b/Items/Weapons/Melee/OldLordClaymore.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 76; Item.damage = 144; Item.DamageType = TrueMeleeDamageClass.Instance; + Item.crit = 11; Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow Item.useStyle = ItemUseStyleID.Shoot; @@ -38,6 +39,5 @@ namespace CalamityMod.Items.Weapons.Melee Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/OldLordClaymoreGlow").Value); } public override bool MeleePrefix() => true; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; } } diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 1fc173a4e3..ac56bb47f4 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 146; Item.damage = 100; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 45; Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 12; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Yellow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 45; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void AddRecipes() diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index 367fe584f3..85cfbce481 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 40; Item.damage = 2705; Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Item.crit = 10; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults. - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index 8faaf618d0..ca5701977f 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 134; Item.height = 54; Item.damage = 3725; + Item.crit = 18; Item.knockBack = 12f; Item.useTime = 5; Item.useAnimation = 25; @@ -43,8 +44,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 18; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool AltFunctionUse(Player player) => true; public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/Roxcalibur.cs b/Items/Weapons/Melee/Roxcalibur.cs index debc3d50b2..c0d4f25266 100644 --- a/Items/Weapons/Melee/Roxcalibur.cs +++ b/Items/Weapons/Melee/Roxcalibur.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 100; Item.height = 100; Item.damage = 180; + Item.crit = 8; Item.knockBack = 13f; Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Shoot; @@ -39,10 +40,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.channel = true; } - public override void ModifyWeaponCrit(Player player, ref float crit) - { - crit += 8f; - } public override bool CanUseItem(Player player) => Main.hardMode && player.ownedProjectileCounts[Item.shoot] < 1; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -61,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee .AddIngredient(ItemID.SoulofNight, 10) .AddIngredient(5) .AddIngredient(ItemID.Obsidian, 10) - .AddIngredient(ItemID.StoneBlock, 100) + .AddRecipeGroup("AnyStoneBlock", 100) .AddIngredient(ItemID.Amethyst, 2) .AddTile(TileID.Anvils) .Register(); diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index b8b499265d..f2abc131a5 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public const int TrueMeleeHitHeal = 4; - public const int TrueMeleeGlacialStateTime = 30; + public const int TrueMeleeFrozenTime = 30; public const float SmallSlashDamageFactor = 0.4f; diff --git a/Items/Weapons/Melee/TitanArm.cs b/Items/Weapons/Melee/TitanArm.cs index 03b4a71cb1..425acf6f3a 100644 --- a/Items/Weapons/Melee/TitanArm.cs +++ b/Items/Weapons/Melee/TitanArm.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 46; Item.height = 58; Item.damage = 69; + Item.crit = 100; Item.knockBack = 80f; //This number doesn't mean anything, but it's not 9001f because that caused bugs. Item.useAnimation = Item.useTime = 12; Item.DamageType = DamageClass.Melee; @@ -24,9 +25,6 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityLimeBuyPrice; } - // Boosting crit in SetDefaults along with knockback seemed to severely inflate the reforging price. Guaranteed crits for more knockback. - public override void ModifyWeaponCrit(Player player, ref float crit) => crit = 100; - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); diff --git a/Items/Weapons/Melee/VoidEdge.cs b/Items/Weapons/Melee/VoidEdge.cs index 7ac33fbcb3..f7134929dd 100644 --- a/Items/Weapons/Melee/VoidEdge.cs +++ b/Items/Weapons/Melee/VoidEdge.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -104,5 +105,14 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center + new Vector2(0, 1300f), velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), soulDamage, 0f, player.whoAmI, 0f, ai1); Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center + new Vector2(0, 1300f), velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), soulDamage, 0f, player.whoAmI, 0f, ai1); } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(15). + AddIngredient(3). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index fdb7e08c9b..2866542d6e 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 39; Item.DamageType = DamageClass.Ranged; Item.scale = 0.85f; - Item.useTime = Item.useAnimation = 33; + Item.useTime = Item.useAnimation = 31; Item.reuseDelay = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 8ed530291d..a0a470a866 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 40; Item.damage = 1818; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; Item.useTime = Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override void HoldItem(Player player) => player.scope = true; - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index e6c0803a7a..eed33698bf 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 24; Item.damage = 120; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useTime = 15; Item.useAnimation = 15; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index cfeef85b6b..6c34e7b8ae 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 76; Item.height = 42; Item.damage = 56; + Item.crit = 21; Item.useTime = 30; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 2c4d7fcd6e..8bc2e73088 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 38; Item.damage = 75; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; Item.useTime = 45; Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Arrow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (CalamityUtils.CheckWoodenAmmo(type, player)) diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index a6dca96d15..d0b79472dc 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 60; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useTime = 60; Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; - public override Vector2? HoldoutOffset() => new Vector2(-7, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 69890dfbb8..791aaa307d 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 444; Item.knockBack = 5.5f; Item.DamageType = DamageClass.Ranged; + Item.crit = 20; // Burst of 5, one every 5 frames for 25 total. Cooldown of 39 frames. Item.useTime = 5; @@ -58,8 +59,6 @@ namespace CalamityMod.Items.Weapons.Ranged ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; public override void HoldItem(Player player) { if (player.mount.Type == MountID.Drill) diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 9e0189cacd..18c4fd76dd 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.DamageType = DamageClass.Ranged; Item.damage = 740; + Item.crit = 15; Item.knockBack = 16f; Item.useTime = Item.useAnimation = 74; Item.autoReuse = true; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Rocket; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { position += velocity.SafeNormalize(Vector2.UnitX) * 48f; diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 4eb04468eb..4c6c6151ff 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -21,11 +21,6 @@ namespace CalamityMod.Items.Weapons.Ranged public static int AmmoSavedPercent = 80; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - public override void SetDefaults() { Item.width = 56; @@ -49,11 +44,9 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = player.altFunctionUse == 2 ? type : ModContent.ProjectileType(); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction position = position + (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.UnitX) * 65; @@ -64,19 +57,11 @@ namespace CalamityMod.Items.Weapons.Ranged for (int i = -1; i <= 1; i += 2) { Vector2 helixVel = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(i * sine)); - Projectile.NewProjectile(source, position, helixVel, shotType, damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); + Projectile.NewProjectile(source, position, helixVel, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); } } - else if (player.altFunctionUse != 2) - { - Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), new Color(229, 49, 39)); - GeneralParticleHandler.SpawnParticle(spark2); - } - - // Reset altFunctionUse to zero to prevent blank frame appear between shots on Alt-fire - if (player.itemAnimation <= 1) - player.altFunctionUse = 0; - + Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), new Color(229, 49, 39)); + GeneralParticleHandler.SpawnParticle(spark2); return false; } diff --git a/Items/Weapons/Ranged/M1Garand.cs b/Items/Weapons/Ranged/M1Garand.cs index 27254cb375..e1428c34bf 100644 --- a/Items/Weapons/Ranged/M1Garand.cs +++ b/Items/Weapons/Ranged/M1Garand.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 75; Item.DamageType = DamageClass.Ranged; - + Item.crit = 10; Item.useTime = 40; Item.useAnimation = 40; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ItemRarityID.Orange; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void HoldItem(Player player) { diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 04583dd290..0dd35e7cab 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 110; Item.damage = 39; Item.DamageType = DamageClass.Ranged; + Item.crit = 10; Item.useTime = 5; Item.useAnimation = 15; Item.useLimitPerAnimation = 3; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override Vector2? HoldoutOffset() => new Vector2(-4, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index ee5b504667..04e64586c4 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 22; Item.damage = 210; Item.DamageType = DamageClass.Ranged; + Item.crit = 10; Item.useTime = 70; Item.useAnimation = 70; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-10, 8); - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/OntologicalDespoiler.cs b/Items/Weapons/Ranged/OntologicalDespoiler.cs index 577180c67e..2a68495738 100644 --- a/Items/Weapons/Ranged/OntologicalDespoiler.cs +++ b/Items/Weapons/Ranged/OntologicalDespoiler.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 445; Item.DamageType = DamageClass.Ranged; + Item.crit = 25; Item.useAnimation = Item.useTime = 8; Item.noMelee = true; Item.noUseGraphic = true; @@ -52,7 +53,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; } - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 25; public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void HoldItem(Player player) diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 46a5289e33..f9c5673f80 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 450; Item.DamageType = DamageClass.Ranged; + Item.crit = 38; Item.knockBack = 10f; Item.useTime = 50; Item.useAnimation = 50; @@ -39,9 +40,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 38; - public override Vector2? HoldoutOffset() => new Vector2(-6, 10); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index 68ac499b6d..25bb058a33 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 118; Item.DamageType = DamageClass.Ranged; + Item.crit = 15; Item.useTime = Item.useAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -38,8 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ModContent.RarityType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Shardshocker.cs b/Items/Weapons/Ranged/Shardshocker.cs index 27d64ec957..c16a177347 100644 --- a/Items/Weapons/Ranged/Shardshocker.cs +++ b/Items/Weapons/Ranged/Shardshocker.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 44; Item.damage = 115; Item.DamageType = DamageClass.Ranged; + Item.crit = 6; Item.useTime = 60; Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 50f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index e39b9b4e76..bd08738f73 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 38; Item.damage = 40; Item.DamageType = DamageClass.Ranged; + Item.crit = 15; Item.useTime = 70; Item.useAnimation = 70; Item.useStyle = ItemUseStyleID.Shoot; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Arrow; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (CalamityUtils.CheckWoodenAmmo(type, player)) diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 7657926ed4..d9768ef6a9 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -11,11 +11,6 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - public override void SetDefaults() { Item.width = 56; @@ -41,22 +36,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = (player.altFunctionUse == 2 ? type : ModContent.ProjectileType()); int bulletAmt = 3; Vector2 newPosition = position + velocity.SafeNormalize(Vector2.UnitY) * 50f; for (int index = 0; index < bulletAmt; index++) { - Projectile.NewProjectile(source, newPosition, (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedByRandom(0.2f), shotType, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, newPosition, (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedByRandom(0.2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); } - - // Reset altFunctionUse to zero to prevent blank frame appear between shots on Alt-fire - if (player.itemAnimation <= 1) - player.altFunctionUse = 0; - return false; } diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 2b619ab787..122cdf881c 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 150; Item.DamageType = DamageClass.Ranged; + Item.crit = 35; Item.useTime = 35; Item.useAnimation = 35; Item.useStyle = ItemUseStyleID.Shoot; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useAmmo = AmmoID.Bullet; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 35; - public override Vector2? HoldoutOffset() => new Vector2(-25, 0); public override void HoldItem(Player player) => player.scope = true; diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 016c4f32fa..8e85adde27 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 705; Item.DamageType = DamageClass.Ranged; + Item.crit = 26; Item.useAnimation = Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -40,9 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().devItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 26; - public override Vector2? HoldoutOffset() => new Vector2(-25, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index 7445e3628f..bee2941fdb 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 30; Item.damage = 180; Item.DamageType = DamageClass.Ranged; + Item.crit = 16; Item.useTime = 40; Item.useAnimation = 40; Item.useStyle = ItemUseStyleID.Shoot; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 3f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override Vector2? HoldoutOffset() { return new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 9685412233..69a4afb43a 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 100; Item.DamageType = DamageClass.Ranged; + Item.crit = 21; Item.useTime = 10; Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Shoot; @@ -71,8 +72,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = ShootSpeed; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 21; public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index d10a646a8a..ae859ea8b6 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -21,10 +21,6 @@ namespace CalamityMod.Items.Weapons.Ranged public static int AmmoSavedPercent = 80; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } public override void SetDefaults() { Item.width = 60; @@ -51,11 +47,9 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = (player.altFunctionUse == 2 ? type : ModContent.ProjectileType()); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction position = position + (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.UnitX) * 65; @@ -67,15 +61,12 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); - } - else if (player.altFunctionUse != 2) - { - Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), Main.rand.NextBool() ? Color.MediumOrchid : Color.DarkViolet); - GeneralParticleHandler.SpawnParticle(spark2); + Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); } + Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), Main.rand.NextBool() ? Color.MediumOrchid : Color.DarkViolet); + GeneralParticleHandler.SpawnParticle(spark2); return false; } diff --git a/Items/Weapons/Ranged/TheBlunderbass.cs b/Items/Weapons/Ranged/TheBlunderbass.cs index d29689df96..dd5a0564ae 100644 --- a/Items/Weapons/Ranged/TheBlunderbass.cs +++ b/Items/Weapons/Ranged/TheBlunderbass.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 26; Item.damage = 35; Item.DamageType = DamageClass.Ranged; + Item.crit = 6; Item.useTime = 55; Item.useAnimation = 55; Item.useStyle = ItemUseStyleID.Shoot; @@ -37,9 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 25f; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index f43d7cfdde..11f3c56554 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -20,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 92; Item.DamageType = DamageClass.Ranged; + Item.crit = 16; Item.useAnimation = Item.useTime = OriginalUseTime; Item.shoot = ProjectileType(); Item.shootSpeed = 13f; @@ -38,9 +40,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.9f, PitchVariance = 0.1f }; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; // Spawning the holdout won't consume ammo. @@ -61,6 +60,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(7). + AddIngredient(12). + AddTile(TileID.MythrilAnvil). + Register(); + } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request(Texture + "_Glow").Value); } diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index fc33f30846..55fc16c5d4 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -27,8 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.UseSound = SoundID.Item14; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 20f; - Item.useAmmo = AmmoID.Bullet; + Item.shootSpeed = 28f; } public override Vector2? HoldoutOffset() => new Vector2(-40f, -16f); diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index 9bafa9238f..56f34bfff0 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 1000; Item.DamageType = DamageClass.Ranged; + Item.crit = 8; Item.useTime = Item.useAnimation = 53; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override Vector2? HoldoutOffset() => new Vector2(-40, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/ThreadOfEradication.cs b/Items/Weapons/Ranged/ThreadOfEradication.cs index 2e959a2428..722fb0535e 100644 --- a/Items/Weapons/Ranged/ThreadOfEradication.cs +++ b/Items/Weapons/Ranged/ThreadOfEradication.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -16,6 +17,11 @@ namespace CalamityMod.Items.Weapons.Ranged public class ThreadOfEradication : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public override void SetStaticDefaults() + { + CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true; + } public override void ModifyTooltips(List tooltips) { tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); @@ -24,10 +30,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 40; Item.height = 82; - Item.damage = 4375; + Item.damage = 1500; Item.DamageType = DamageClass.Ranged; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useTime = Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; @@ -74,7 +79,9 @@ namespace CalamityMod.Items.Weapons.Ranged Main.LocalPlayer.SetScreenshake(2f); if (Main.myPlayer == player.whoAmI) { - Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG, storedKB, player.whoAmI, -1, 1); + int p = Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG, storedKB, player.whoAmI, -1, 1); + if (Main.projectile.IndexInRange(p)) + Main.projectile[p].DamageType = DamageClass.Ranged; } } } @@ -89,9 +96,10 @@ namespace CalamityMod.Items.Weapons.Ranged Main.LocalPlayer.SetScreenshake(5f); if (Main.myPlayer == player.whoAmI) { - int p = Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG*4, storedKB, player.whoAmI,-0.25f,1); + int p = Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG*4, storedKB, player.whoAmI,-0.25f,1); if (Main.projectile.IndexInRange(p)) { + Main.projectile[p].DamageType = DamageClass.Ranged; Main.projectile[p].scale = 4; } } diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 86672a1208..641402f62c 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 2150; Item.knockBack = 9.5f; Item.DamageType = DamageClass.Ranged; + Item.crit = 35; Item.useTime = 60; Item.useAnimation = 60; Item.shoot = ProjectileID.BulletHighVelocity; @@ -35,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().donorItem = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 35; - public override Vector2? HoldoutOffset() => new Vector2(-28, 0); public override void HoldItem(Player player) => player.scope = true; diff --git a/Items/Weapons/Ranged/WildfireBloom.cs b/Items/Weapons/Ranged/WildfireBloom.cs index efcde627f1..b3b7b5dbba 100644 --- a/Items/Weapons/Ranged/WildfireBloom.cs +++ b/Items/Weapons/Ranged/WildfireBloom.cs @@ -70,7 +70,6 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.Flamethrower). AddIngredient(). AddIngredient(12). - AddIngredient(5). AddTile(TileID.MythrilAnvil). Register(); } diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index ea514d1562..1fd2a9cfc4 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 66; Item.height = 64; Item.damage = 185; + Item.crit = 20; Item.shootSpeed = 18f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 26; @@ -32,9 +33,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void UseStyle(Player player, Rectangle heldItemFrame) { ExtraArmAnimations.ThrowArmAnimationFast(player, Item); diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index 5dd14afede..10e95bab7c 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 75; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 4; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; @@ -33,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override float StealthVelocityMultiplier => 1.3f; public override float StealthDamageMultiplier => 0.5f; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { var p = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f); diff --git a/Items/Weapons/Rogue/Cinquedea.cs b/Items/Weapons/Rogue/Cinquedea.cs index 9ef1e82297..e3f8c318ce 100644 --- a/Items/Weapons/Rogue/Cinquedea.cs +++ b/Items/Weapons/Rogue/Cinquedea.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 32; Item.height = 32; Item.damage = 35; + Item.crit = 8; Item.rare = ItemRarityID.Orange; Item.knockBack = 5; Item.autoReuse = true; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override float StealthDamageMultiplier => 1.5f; public override float StealthVelocityMultiplier => 1.25f; diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index 83add7844f..a835714b1c 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 50; Item.height = 50; Item.damage = 16; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override float StealthDamageMultiplier => 1.7f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 39545494e2..a43492d9e0 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 58; Item.damage = 81; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index d69d5b3f12..8dc8c9725f 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -17,19 +17,19 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 74; Item.height = 68; - Item.damage = 166; + Item.damage = 204; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 6; - Item.useAnimation = 24; - Item.reuseDelay = 11; + Item.useTime = 5; + Item.useAnimation = 20; + Item.reuseDelay = 15; Item.useLimitPerAnimation = 4; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 7.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.shootSpeed = 17f; Item.DamageType = RogueDamageClass.Instance; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index 9cbb1edc4a..2f6b9a5492 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 22; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 6; Item.autoReuse = true; Item.noMelee = true; Item.noUseGraphic = true; @@ -32,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override float StealthVelocityMultiplier => 1.3f; public override float StealthDamageMultiplier => 0.6f; - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { var p = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f); diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 31043a2f4e..10a951f840 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.height = 32; Item.damage = 148; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; Item.useTime = 4; Item.useAnimation = 12; Item.reuseDelay = 1; @@ -39,9 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index 9d025acef4..0beafe26c6 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = Item.height = 66; Item.damage = 45; + Item.crit = 7; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 12; @@ -28,9 +29,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 7; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index 6ed83a923b..fdbb110ebd 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -15,8 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 34; Item.height = 50; Item.damage = 12; - Item.knockBack = 12; Item.DamageType = RogueDamageClass.Instance; + Item.crit = 16; + Item.knockBack = 12; + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.useTime = 25; @@ -29,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index 8977ed8739..5ed879a35f 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 54; Item.height = 54; Item.damage = 36; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 20; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 9c04347e38..5814d9db9d 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 68; Item.height = 68; Item.damage = 222; + Item.crit = 15; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -33,9 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ProfanedPartisan.png b/Items/Weapons/Rogue/ProfanedPartisan.png index 24b45d1ccc..3b46003a0d 100644 Binary files a/Items/Weapons/Rogue/ProfanedPartisan.png and b/Items/Weapons/Rogue/ProfanedPartisan.png differ diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 16e52c9fc5..3b22c78a60 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 54; Item.height = 54; - Item.damage = 55; //33 + Item.damage = 55; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 12; @@ -29,9 +30,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index a915b82bc8..9ca38e95d4 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 30; Item.height = 30; Item.damage = 16; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 16; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index 52d204654e..0489ff32d1 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 108; Item.height = 108; Item.damage = 10000; + Item.crit = 20; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 60; @@ -41,9 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Rogue/ShatteredDawn.cs b/Items/Weapons/Rogue/ShatteredDawn.cs index 0602d4e927..7331b6f831 100644 --- a/Items/Weapons/Rogue/ShatteredDawn.cs +++ b/Items/Weapons/Rogue/ShatteredDawn.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 66; Item.height = 66; Item.damage = 80; + Item.crit = 10; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 12; @@ -31,9 +32,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override float StealthDamageMultiplier => 1.2f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 60f192551e..0331d03098 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -17,8 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.useAnimation = 26; - Item.useTime = 26; + Item.useTime = Item.useAnimation = 16; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index 17823595ac..5bd53ebda4 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Weapons.Rogue private bool BigSpear = false; public override void SetDefaults() { - Item.width = 52; - Item.height = 52; + Item.width = 100; + Item.height = 100; Item.damage = 70; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/SpearofDestiny.png b/Items/Weapons/Rogue/SpearofDestiny.png index 4e198d9042..0fb7e725de 100644 Binary files a/Items/Weapons/Rogue/SpearofDestiny.png and b/Items/Weapons/Rogue/SpearofDestiny.png differ diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index abe77f582a..5b7d1b4f7c 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 32; Item.height = 34; Item.damage = 69; + Item.crit = 4; Item.noMelee = true; Item.noUseGraphic = true; Item.useTime = Item.useAnimation = 9; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[Item.shoot] < knifeLimit) diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index 3d98b335f5..1d4d1e40e5 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -35,15 +35,13 @@ namespace CalamityMod.Items.Weapons.Rogue Item.useAnimation = 20; Item.useTime = 20; Item.damage = 38; + Item.crit = 8; Item.knockBack = 7f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 8.2f; Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override float StealthDamageMultiplier => 1.2f; public override float StealthVelocityMultiplier => 1.5f; diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index d290fbacab..d976788301 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 28; Item.height = 20; Item.damage = 14; + Item.crit = 20; Item.shootSpeed = 15f; Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 25; @@ -34,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void UseStyle(Player player, Rectangle heldItemFrame) { ExtraArmAnimations.ThrowArmAnimationFast(player, Item); diff --git a/Items/Weapons/Rogue/TitaniumShuriken.cs b/Items/Weapons/Rogue/TitaniumShuriken.cs index baee97518b..0824bd3e35 100644 --- a/Items/Weapons/Rogue/TitaniumShuriken.cs +++ b/Items/Weapons/Rogue/TitaniumShuriken.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 34; Item.height = 34; Item.damage = 38; + Item.crit = 10; Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -28,10 +29,6 @@ namespace CalamityMod.Items.Weapons.Rogue } public override float StealthVelocityMultiplier => 1.25f; - - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index eada2f3536..633fb1f6cd 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 30; Item.height = 30; Item.damage = 16; + Item.crit = 8; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 16; @@ -30,9 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TwistingThunder.cs b/Items/Weapons/Rogue/TwistingThunder.cs index 1ff0517975..66aadf552c 100644 --- a/Items/Weapons/Rogue/TwistingThunder.cs +++ b/Items/Weapons/Rogue/TwistingThunder.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.width = 56; Item.height = 56; Item.damage = 466; + Item.crit = 12; Item.knockBack = 10f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; @@ -33,8 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12; public override float StealthVelocityMultiplier => 1.5f; public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) diff --git a/Items/Weapons/Rogue/UrchinStinger.cs b/Items/Weapons/Rogue/UrchinStinger.cs index 606271f7d4..01fe4cb223 100644 --- a/Items/Weapons/Rogue/UrchinStinger.cs +++ b/Items/Weapons/Rogue/UrchinStinger.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 10; - Item.height = 26; + Item.height = 32; Item.damage = 13; Item.DamageType = RogueDamageClass.Instance; Item.useAnimation = Item.useTime = 17; diff --git a/Items/Weapons/Rogue/UrchinStinger.png b/Items/Weapons/Rogue/UrchinStinger.png index a5c38c11b9..9b6087ce19 100644 Binary files a/Items/Weapons/Rogue/UrchinStinger.png and b/Items/Weapons/Rogue/UrchinStinger.png differ diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 7eb8ef10a1..647b17cfac 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon @@ -14,6 +15,8 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; public float Knockback = 2f; + public static int DefenseBoostPerBuffStar = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostPerBuffStar); public override void SetDefaults() { Item.width = 44; diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index 32000195ad..7165e12837 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.mana = 10; - Item.damage = 28; + Item.damage = 46; Item.useAnimation = Item.useTime = 36; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 5a39da29cf..5c3e05a492 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 32; Item.height = 32; Item.mana = 10; - Item.damage = 25; + Item.damage = 22; Item.useStyle = ItemUseStyleID.Swing; Item.useAnimation = Item.useTime = 36; Item.noMelee = true; diff --git a/Items/Weapons/Summon/GammaHeart.cs b/Items/Weapons/Summon/GammaHeart.cs index ae0778527f..ca1eb43c66 100644 --- a/Items/Weapons/Summon/GammaHeart.cs +++ b/Items/Weapons/Summon/GammaHeart.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item42; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.damage = 85; + Item.damage = 93; Item.knockBack = 3f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 24; diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index 70feda5470..2c927aab9a 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 50; Item.height = 50; - Item.damage = 56; + Item.damage = 25; Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 5fa54ffc7a..e71c91306d 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -1,22 +1,50 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.Items.Weapons.Melee; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { + #region Item public class VoidConcentrationStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public static SummonTag summonTag = new SummonTag() + { + MultiplicativeTagDamage = 0.3f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. + AllowsWhipStacking = true, + TagOnHit = tagOnHit, + TagModifyHitEffects = SummonTag.BlankTagModifyHit, + AutoDrawTooltip = false + }; + public static void tagOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone) => npc.GetGlobalNPC().StoredDamage += (int)(damageDone); public override void SetStaticDefaults() { - ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + summonTag.TagItem = Type; + CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType(), summonTag); } public override void SetDefaults() @@ -28,34 +56,573 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.DD2_EtherianPortalOpen; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.damage = 105; + Item.damage = 200; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 24; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse != 2) - return player.ownedProjectileCounts[ModContent.ProjectileType()] == 0; - return base.CanUseItem(player); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse != 2) { - player.AddBuff(Item.buffType, 2); - var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - minion.originalDamage = Item.damage; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + item.Kill(); + } + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + } + else + { + player.MinionNPCTargetAim(true); + if (player.MinionAttackTargetNPC >= 0) + { + var target = Main.npc[player.MinionAttackTargetNPC]; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + item.Kill(); + } + Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, target.whoAmI); + } } return false; } - - // TODO -- should be strictly unnecessary as per API design - public override bool AltFunctionUse(Player player) => base.AltFunctionUse(player); + public override bool AltFunctionUse(Player player) => true; } + + #endregion +} + +namespace CalamityMod.Projectiles.Summon +{ + + #region Left Click + public class VoidConcentrationMinion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = 46; + Projectile.height = 80; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.minionSlots = 4f; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.minion = true; + Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + } + public override bool? CanHitNPC(NPC target) => false; + public override void AI() + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + + if (player.dead) + { + modPlayer.VoidConcentrationStaff = false; + } + if (modPlayer.VoidConcentrationStaff) + { + Projectile.timeLeft = 2; + } + + Projectile.Center = player.Center; + + //Spawn proj code taken from Ceaseless Void + int numPerRing = 7; + int numRings = 3; + int spacing = 360 / numPerRing; + int distance2 = 10; + if (Main.netMode != NetmodeID.MultiplayerClient && player.ownedProjectileCounts[ModContent.ProjectileType()] + player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + for (int i = 0; i < numPerRing; i++) + { + for (int j = 0; j < numRings; j++) + Projectile.NewProjectile(Projectile.GetSource_FromAI(), new Vector2((Projectile.Center.X + (MathF.Sin(i * spacing) * distance2)), (int)(Projectile.Center.Y + (MathF.Cos(i * spacing) * distance2))), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, i * spacing, j); + } + } + + } + } + public class VoidConcentrationDarkEnergy : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Summon"; + private double minDistance => 10; + private double distance { get; set; } = 10; + private double maxDistance => 400; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionShot[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 32; + Projectile.height = 32; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 10; + Projectile.penetrate = -1; + Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + texture = TextureAssets.Npc[ModContent.NPCType()].Value; + var gt = DarkEnergy.GlowTexture.Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + var frame = texture.Frame(1, 8, 0, Projectile.frame); + Main.EntitySpriteDraw(texture, drawPos, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(gt, drawPos, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + return false; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] - player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + for (int k = 0; k < 20; k++) + { + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0, -1f, 0, default, 1f); + Main.dust[dust].noGravity = true; + } + Projectile.Kill(); + return; + } + else + { + Projectile.timeLeft++; + } + + + if (Projectile.FinalExtraUpdate()) + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + if (Projectile.frame == 1) + Projectile.frame++; + + #region Movement Code (Taken from Ceaseless Void) + + Projectile.velocity = Vector2.Zero; + double rateOfChangeIncrease = (maxDistance / 80) - 1D; + double rateOfChange = ((Projectile.ai[1] * 0.5f) + 3.2D) * (maxDistance / 960); + if (Projectile.ai[2] == 0f) + { + distance += rateOfChange; + if (distance >= maxDistance) + { + distance = maxDistance; + Projectile.ai[2] = 1f; + } + } + else + { + distance -= rateOfChange; + if (distance <= minDistance) + { + distance = minDistance; + Projectile.ai[2] = 0f; + } + } + + // Rotation velocity + float minRotationVelocity = 0.5f; + float rotationVelocityIncrease = 0.15f; + rotationVelocityIncrease += rotationVelocityIncrease * (Projectile.ai[1] * 0.5f); + + // Rotate around Ceaseless Void + double degrees = Projectile.ai[0]; + double radians = degrees * (Math.PI / 180); + Projectile.position.X = player.Center.X - (int)(Math.Cos(radians) * distance) - Projectile.width / 2; + Projectile.position.Y = player.Center.Y - (int)(Math.Sin(radians) * distance) - Projectile.height / 2; + Projectile.ai[0] += minRotationVelocity + rotationVelocityIncrease; + #endregion + } + } + + #endregion + + #region Right Click + public class VoidConcentrationMark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + } + public override void SetDefaults() + { + Projectile.width = 54; + Projectile.height = 50; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 600; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = DamageClass.Summon; + } + public override bool? CanHitNPC(NPC target) => false; + public override void AI() + { + if (!Main.npc[(int)Projectile.ai[0]].active) + { + Projectile.Kill(); + return; + } + Player owner = Main.player[Projectile.owner]; + + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; + Main.npc[(int)Projectile.ai[0]].AddBuff(ModContent.BuffType(), 5); + if (Projectile.timeLeft % 60 == 0) + { + var w = Main.npc[(int)Projectile.ai[0]].width + 200; + var v1 = Main.rand.NextVector2CircularEdge(1, 1); + for (var i = 0; i < 3; i++) + { + var v = v1.RotatedBy(MathHelper.TwoPi * (i / 3f)); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(-MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner,1); + } + } + } + + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame >= Main.projFrames[Type] - 1) + { + Projectile.frame = 0; + } + Projectile.frameCounter++; + + if (Projectile.timeLeft <= 60) + { + Projectile.alpha += 4; + } + } + } + public class VoidConcentrationBeam : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 24; + Projectile.height = 24; + Projectile.friendly = true; + Projectile.timeLeft = 600; + Projectile.DamageType = DamageClass.Summon; + Projectile.MaxUpdates = 3; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; + Projectile.penetrate = 1; + } + public override void AI() + { + if (Projectile.timeLeft == 600 && Projectile.ai[0] == 0) + { + GeneralParticleHandler.SpawnParticle(new CustomSprite(Projectile.Center, Vector2.Zero, 30, TextureAssets.Projectile[ModContent.ProjectileType()].Value, 1, Color.White, AddativeBlend: false, frameCount: 5)); + + } + NPC target = Projectile.Center.MinionHoming(5000f, Main.player[Projectile.owner]); + // Move towards the target. + if (target != null && Projectile.localNPCImmunity[target.whoAmI] <= 0) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, (target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * (Projectile.timeLeft < 300 ? 24f : 10f), 0.05f); + Projectile.netUpdate = true; + Projectile.Calamity().HomingTarget = target.whoAmI; + } + Projectile.rotation = Projectile.velocity.ToRotation(); + + if (Projectile.damage <= 0) + { + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.Zero) * 4; + Projectile.timeLeft = (int)MathHelper.Min(8, Projectile.timeLeft); + } + + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i < 12; i++) + { + Vector2 dustVelocity = Main.rand.NextVector2Circular(1f, 1f) * 6f; + float dustScale = Main.rand.NextFloat(3f, 5f); + Color dustColor = Color.Lerp(Color.Yellow, Color.Gold, Main.rand.NextFloat(0.5f, 1f)); + + Dust dust = Dust.NewDustDirect(Projectile.Center, 1, 1, DustID.TintableDustLighted, dustVelocity.X, dustVelocity.Y, 0, dustColor, dustScale); + dust.noGravity = true; + dust.noLight = false; + dust.noLightEmittence = false; + } + } + + public override bool PreDraw(ref Color lightColor) + { + Main.spriteBatch.End(out var ss); + + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + + using (lease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + + Vector2[] fireCoreLength = Projectile.oldPos.Take(8).ToArray(); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + + return false; + } + + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = Color.DarkSlateBlue * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 16; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = Color.SkyBlue; + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } + } + + #endregion + + #region Summon Tag + public class VoidTagDmgType : DamageClass //Custom damage class used to prevent the voids from activating themselves + { + public static VoidTagDmgType getInstance => ModContent.GetInstance(); + public override bool UseStandardCritCalcs => false; + } + public class VoidTagNPC : GlobalNPC + { + public override bool InstancePerEntity => true; + + public int StoredDamage = 0; + int voidTimer = 0; + float rot = 0; + + public override void PostAI(NPC npc) + { + voidTimer++; + if (StoredDamage > 0) + { + if (voidTimer > 10) + { + voidTimer = 0; + var dmg = (int)Math.Max(1, (StoredDamage)); + StoredDamage -= dmg; + rot += 0.15f; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(npc.GetSource_OnHurt(null), npc.Center, Vector2.UnitX.RotatedBy(rot), ModContent.ProjectileType(), (int)Math.Max((dmg * VoidConcentrationStaff.summonTag.MultiplicativeTagDamage), 1), 0, -1, npc.whoAmI); + } + } + } + base.PostAI(npc); + } + } + public class VoidTagPlayer : ModPlayer + { + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (hit.DamageType != VoidTagDmgType.getInstance && target.HasBuff()) + target.GetGlobalNPC().StoredDamage += damageDone; + } + + public override void ModifyHurt(ref Player.HurtModifiers modifiers) + { + if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modifiers.FinalDamage *= 0.85f; //15% less dmg taken, multipicative. This is not meant to be additive to avoid needing DR scaling. + } + } + public class VoidConcentrationSummonTagProj : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Summon"; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 8; + } + + public override void SetDefaults() + { + Projectile.width = 32; + Projectile.height = 32; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 60; + Projectile.penetrate = 1; + Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = ModContent.GetInstance(); + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 1000; + } + + NPC target => Main.npc[(int)Projectile.ai[0]]; + + public override bool? CanHitNPC(NPC target) + { + if (Projectile.timeLeft < 5) + return null; + return false; + } + public override bool PreDraw(ref Color lightColor) + { + for (float i = 0; i < MathHelper.TwoPi; i += MathHelper.TwoPi / 3f) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + texture = TextureAssets.Npc[ModContent.NPCType()].Value; + var gt = DarkEnergy.GlowTexture.Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + Projectile.velocity.RotatedBy(i); + var frame = texture.Frame(1, 8, 0, Projectile.frame); + Main.EntitySpriteDraw(texture, drawPos, frame, lightColor, 0, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(gt, drawPos, frame, Color.White, 0, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + } + return false; + } + public override void AI() + { + if (target == null || !target.active) + { + Projectile.Kill(); + return; + } + var w = target.width + 200; + Projectile.Center = target.Center; + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.velocity = Projectile.rotation.ToRotationVector2() * w * Projectile.timeLeft / 60f; + + if (Projectile.FinalExtraUpdate()) + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + if (Projectile.frame == 1) + Projectile.frame++; + } + + public override bool ShouldUpdatePosition() => false; + } + + public class VoidConcentrationSummonTagBuff : ModBuff + { + public override string Texture => "CalamityMod/Buffs/Summon/Whips/SentinalLash"; //Shared placeholder by all summon tag buffs. This is never seen in game. + + public override void SetStaticDefaults() + { + BuffID.Sets.IsATagBuff[Type] = true; + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + } + } + + #endregion } diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 5d433d0621..6352a8efc2 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon @@ -13,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; + public static float PartialRegenBoostPerBuffDroid = 0.5f; + public static int DefenseBoostPerBuffDroid = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PartialRegenBoostPerBuffDroid.ToRegenPerSecond(), DefenseBoostPerBuffDroid); public override void SetDefaults() { Item.width = 28; @@ -68,15 +72,13 @@ namespace CalamityMod.Items.Weapons.Summon buffingDrones = 0; } - public override void UpdateLifeRegen() + // This needs to be a fair bit earlier for partial life regen to work + public override void PostUpdateBuffs() { if (buffingDrones > 0) { - // 1 life regen per drone. - Player.lifeRegen += (int)(buffingDrones); - - // 3 defense per drone. - Player.statDefense += buffingDrones * 3; + Player.Calamity().partialLifeRegen += buffingDrones * WulfrumController.PartialRegenBoostPerBuffDroid; + Player.statDefense += buffingDrones * WulfrumController.DefenseBoostPerBuffDroid; buffingDrones = 0; } diff --git a/Items/Weapons/Typeless/RelicOfDeliverance.cs b/Items/Weapons/Typeless/RelicOfDeliverance.cs index 8dd3c542b9..d6d2974145 100644 --- a/Items/Weapons/Typeless/RelicOfDeliverance.cs +++ b/Items/Weapons/Typeless/RelicOfDeliverance.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.width = 32; Item.height = 46; Item.damage = 1700; + Item.crit = 55; Item.useAnimation = Item.useTime = 35; Item.reuseDelay = 15; Item.useStyle = ItemUseStyleID.Shoot; @@ -38,9 +39,6 @@ namespace CalamityMod.Items.Weapons.Typeless itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 55; - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.Calamity().DashID != GodslayerArmorDash.ID; } } diff --git a/Localization/en-US/Mods.CalamityMod.Attunement.hjson b/Localization/en-US/Mods.CalamityMod.Attunement.hjson index bb971a8498..df17618bce 100644 --- a/Localization/en-US/Mods.CalamityMod.Attunement.hjson +++ b/Localization/en-US/Mods.CalamityMod.Attunement.hjson @@ -1,7 +1,7 @@ // Broken Biome Blade DefaultAttunement: { Name: Pure Clarity - Function: Fires a weak sword beam that crushes enemy defenses + Function: Fires a weak sword beam } HotAttunement: { @@ -28,7 +28,7 @@ TrueDefaultAttunement: { Name: Pure Clarity Function: ''' - Fires a weak sword beam that crushes enemy defenses + Fires a weak sword beam Landing three true melee hits charges a powerful lunge, unleashed when you stop swinging the sword Enemies struck by the lunge are marked with a sigil that sword beams will home in on ''' @@ -124,7 +124,7 @@ ShockwaveAttunement: { ''' Charge an earth-shattering lunge, release to unleash a devastating blow Homing sword beams are emitted as the sword charges up - Striking an enemy with the lunge creates a shockwave and marks them with an armor crunching sigil that attracts sword beam homing + Striking an enemy with the lunge creates a shockwave and marks them with a sigil that attracts sword beam homing Striking the earth with the lunge will cause several blasts of dust to erupt around you ''' PassiveDesc: Periodically emit large shock waves while attacking diff --git a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson index 8e6b15daba..3578ce8f43 100644 --- a/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson +++ b/Localization/en-US/Mods.CalamityMod.BossChecklistIntegration.hjson @@ -53,7 +53,7 @@ CalamitasClone: { CeaselessVoid: { EntryName: Ceaseless Void - SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the dungeon. + SpawnInfo: Use a [i:CalamityMod/MarkofProvidence] in the dungeon. DespawnMessage: "[c/4B0082:The ancient spatial rift slips away to places unknown.]" } @@ -180,7 +180,7 @@ Ravager: { Signus: { EntryName: Signus - SpawnInfo: Use a [i:CalamityMod/RuneofKos] in the underworld. + SpawnInfo: Use a [i:CalamityMod/MarkofProvidence] in the underworld. DespawnMessage: "[c/BA55D3:Signus inexplicably ceases to be where he once was.]" } @@ -192,7 +192,7 @@ SlimeGod: { StormWeaver: { EntryName: Storm Weaver - SpawnInfo: Use a [i:CalamityMod/RuneofKos] high in the sky or in space. + SpawnInfo: Use a [i:CalamityMod/MarkofProvidence] high in the sky or in space. DespawnMessage: "[c/EE82EE:Storm Weaver hides itself within the fierce anvilhead clouds.]" } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 75dab61d8c..f9f02b828f 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1,3 +1,7 @@ +// General (Player) and (Enemy) indicators for buff tags +OnPlayer: (Player) +OnEnemy: (Enemy) + // Alcohols (including Odd Mushroom) AlcoholPoisoning: { DisplayName: Alcohol Poisoning @@ -129,85 +133,104 @@ Withered: { AstralInfectionDebuff: { DisplayName: Astral Infection Description: Your flesh is melting off - ItemTooltip: Sickness - 37.5 DPS + ItemTooltipPlayer: Sickness - 12 DPS + ItemTooltipEnemy: Sickness - 37.5 DPS } AuricRebuke: { DisplayName: Auric Rebuke Description: Your cells are violently bouncing off each other - ItemTooltip: Electric - 100 DPS. Deals 4x damage against moving targets + ItemTooltipPlayer: Electric - 8 DPS. Deals 5x damage against moving players + ItemTooltipEnemy: Electric - 100 DPS. Deals 4x damage against moving targets } BanishingFire: { DisplayName: Banishing Fire Description: You shall not be forgiven for your sins - ItemTooltip: Heat - Deals DPS equal to 0.1% of max HP or 2000, whichever is greater + ItemTooltipEnemy: Heat - Deals DPS equal to 0.1% of max HP or 2000, whichever is greater } BrimstoneFlames: { DisplayName: Brimstone Flames Description: Incinerating both body and mind - ItemTooltip: Heat - 30 DPS + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: Heat - 30 DPS } BurningBlood: { DisplayName: Burning Blood Description: Your blood is on fire - ItemTooltip: Sickness - 20 DPS + ItemTooltipPlayer: Sickness - 4 DPS + ItemTooltipEnemy: Sickness - 20 DPS } BrainRot: { DisplayName: Brain Rot Description: Your neurons are popping like corn kernels - ItemTooltip: Sickness - 20 DPS + ItemTooltipPlayer: Sickness - 4 DPS + ItemTooltipEnemy: Sickness - 20 DPS } DemonicFlames: { DisplayName: Demonic Flames Description: Immolating flames sear your soul - ItemTooltip: Heat - DPS depends on inflicting item + ItemTooltipEnemy: Heat - DPS depends on inflicting item } ElementalMix: { DisplayName: Elemental Mix Description: A beautiful elemental symphony is flaying you alive - ItemTooltip: Typeless - 200 DPS + ItemTooltipEnemy: Typeless - 200 DPS } CrushDepth: { DisplayName: Crush Depth Description: Crushed by aquatic pressure - ItemTooltip: Water - 50 DPS -} - -RiptideDebuff: { - DisplayName: Riptide - Description: Lashed at by powerful waters - ItemTooltip: Water - 15 DPS + ItemTooltipPlayer: + ''' + Water - 9 DPS + Increases breath loss rate in the Abyss + ''' + ItemTooltipEnemy: Water - 50 DPS } Dragonfire: { DisplayName: Dragonfire Description: Engulfed by roaring flames - ItemTooltip: Heat - 480 DPS + ItemTooltipPlayer: Heat - 25 DPS + ItemTooltipEnemy: Heat - 480 DPS } GodSlayerInferno: { DisplayName: God Slayer Inferno Description: Your flesh is burning off - ItemTooltip: Heat - 250 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 250 DPS +} + +HadopelagicPressure: { + DisplayName: Hadopelagic Pressure + Description: Rapidly sinking to a watery grave + ItemTooltipPlayer: + ''' + Water - 20 DPS + Increases breath loss rate in the Abyss + ''' + ItemTooltipEnemy: Water - 175 DPS } HeavyBleeding: { DisplayName: Heavy Bleeding Description: That's gonna need stitches - ItemTooltip: Typeless - 40 DPS + ItemTooltipPlayer: Typeless - 8 DPS + ItemTooltipEnemy: Typeless - 40 DPS } HolyFlames: { DisplayName: Holy Flames Description: Dissolving from holy light - ItemTooltip: Heat - 150 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 150 DPS } HolyInferno: { @@ -218,41 +241,52 @@ HolyInferno: { Laceration: { DisplayName: Laceration Description: You're a bloody mess - ItemTooltip: Typeless - 200 DPS + ItemTooltipPlayer: Typeless - 18 DPS + ItemTooltipEnemy: Typeless - 200 DPS } ManaBurn: { DisplayName: Mana Burn Description: The excess of mana sears your body and mind - ItemTooltip: + ItemTooltipEnemy: ''' Typeless - Every 100 negative mana reduces your life regen by 4 HP/s, but burns enemies for 3% of dealt damage + Every 100 negative mana reduces your life regen by 4 HP/s, but burns enemies for 5% of dealt damage ''' } MiracleBlight: { DisplayName: Miracle Blight Description: Exotic resonance shreds your corporeal form - ItemTooltip: Typeless - 1500 DPS + ItemTooltipPlayer: Typeless - 30 DPS + ItemTooltipEnemy: Typeless - 1500 DPS } Nightwither: { DisplayName: Nightwither Description: Incinerated by lunar rays - ItemTooltip: Cold - 100 DPS + ItemTooltipPlayer: Cold - 20 DPS + ItemTooltipEnemy: Cold - 100 DPS } Plague: { DisplayName: Plague Description: Rotting from the inside - ItemTooltip: Sickness - 50 DPS + ItemTooltipPlayer: Sickness - 15 DPS + ItemTooltipEnemy: Sickness - 50 DPS +} + +RiptideDebuff: { + DisplayName: Riptide + Description: Lashed at by powerful waters + ItemTooltipPlayer: Water - 3 DPS + ItemTooltipEnemy: Water - 15 DPS } SagePoison: { DisplayName: Sage Poison Description: Poisoned - ItemTooltip: + ItemTooltipEnemy: ''' Sickness - 25 DPS per Viral Sprout / 50 DPS per Virid Vanguard Ignores 75% of enemy sickness weaknesses and resistances @@ -262,7 +296,8 @@ SagePoison: { SearingLava: { DisplayName: Searing Lava Description: The brimstone lava sears your flesh - ItemTooltip: + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: ''' Heat - 20 DPS Ignores enemy heat weaknesses and resistances @@ -273,37 +308,46 @@ SearingLava: { ShellfishClaps: { DisplayName: Shellfish Claps Description: Clamfest + ItemTooltipEnemy: Typeless - 75 DPS for each Shellfish minion } Shred: { DisplayName: Shred Description: Someone built ten Tri-Tip Daggers... - ItemTooltip: "" + ItemTooltipEnemy: "" } SnapClamDebuff: { DisplayName: Clammed Description: Clapped by Snap Clams + ItemTooltipEnemy: Typeless - 7.5 DPS for each latched clam } StaticDischarge: { DisplayName: Static Discharge Description: Shocked by static electricity - ItemTooltip: Electric - 2.5 DPS. 4x damage to moving targets + ItemTooltipPlayer: Electric - 1.5 DPS. 4x damage to moving players + ItemTooltipEnemy: Electric - 2.5 DPS. 4x damage to moving targets } SulphuricPoisoning: { DisplayName: Sulphuric Poisoning Description: The acidic water burns away your flesh - ItemTooltip: Sickness - 120 DPS + ItemTooltipPlayer: Sickness - 3 DPS + ItemTooltipEnemy: Sickness - 175 DPS } TrueVulnerabilityHex: { DisplayName: True Vulnerability Hex Description: The end has come - ItemTooltip: + ItemTooltipPlayer: ''' - Heat - 1998 DPS + Heat - 25 DPS + Increases damage taken from all sources + ''' + ItemTooltipEnemy: + ''' + Heat - 1332 DPS Increases damage taken from all sources Slows enemies ''' @@ -312,7 +356,7 @@ TrueVulnerabilityHex: { Vaporfied: { DisplayName: Vaporfied Description: Vape - ItemTooltip: + ItemTooltipEnemy: ''' Typeless - 15 DPS Slows enemies @@ -322,19 +366,26 @@ Vaporfied: { VermillionFlux: { DisplayName: Vermillion Flux Description: Sharp arcs of scarlet course through you - ItemTooltip: Electric - 50 DPS. Deals 4x damage against moving targets + ItemTooltipPlayer: Electric - 5 DPS. 5x damage to moving players + ItemTooltipEnemy: Electric - 37.5 DPS. 4x damage to moving targets } Voidfrost: { DisplayName: Voidfrost Description: The emptiness of space devours all warmth and life - ItemTooltip: Cold - 200 DPS + ItemTooltipPlayer: Cold - 20 DPS + ItemTooltipEnemy: Cold - 250 DPS } VulnerabilityHex: { DisplayName: Vulnerability Hex Description: Your mental fortitude is fading - ItemTooltip: + ItemTooltipPlayer: + ''' + Heat - 15 DPS + Reduces defense and damage reduction + ''' + ItemTooltipEnemy: ''' Heat - 1332 DPS Slows enemies @@ -713,7 +764,7 @@ AbsorberRegen: { You are blessed by the culmimation of nature's powers Life regen increased by {0} HP/s, damage increased by {1}%, damage reduction increased by {2}% ''' - ItemTooltip: Increases life regeneration, damage, and damage reduction + ItemTooltipPlayer: Increases life regeneration, damage, and damage reduction } AbyssalDivingSuitBuff: { @@ -738,6 +789,7 @@ AeolianEarthBuff: { You are strengthened by primordial powers Damage reduction increased by {0}%, damage increased by {1}%, and massively buffed mana regen ''' + ItemTooltipPlayer: Increases damage, damage reduction, and mana regeneration } Afflicted: { @@ -804,12 +856,13 @@ ChiRegenBuff: { CoralSymbiosis: { DisplayName: Coral Symbiosis Description: Coral Spout charges up faster and deals {0} extra damage + ItemTooltipPlayer: Increases Coral Spout's charge rate and damage } CosmicFreeze: { DisplayName: Cosmic Freeze Description: You feel as cold as the empty expanse of outer space - ItemTooltip: Increases regeneration, especially when standing still, and freezes nearby enemies + ItemTooltipPlayer: Increases regeneration, especially when standing still, and freezes nearby enemies } DivineBless: { @@ -820,6 +873,7 @@ DivineBless: { EmpyreanWrath: { DisplayName: Empyrean Wrath Description: Wrath of the cosmos + ItemTooltipPlayer: Increases damage and critical strike chance } Encased: { @@ -870,7 +924,7 @@ IceShieldBuff: { Mushy: { DisplayName: Mushy Description: Increased defense by {0} and life regen by {1} HP/s - ItemTooltip: Increases defense and life regeneration + ItemTooltipPlayer: Increases defense and life regeneration } PhantomicEmpowerment: { @@ -941,7 +995,7 @@ ReaverRage: { Rage of the earth Defense increased by {0} and damage increased by {1}% ''' - ItemTooltip: Increased defense and damage + ItemTooltipPlayer: Increased defense and damage } SandsWindBuff: { @@ -951,6 +1005,7 @@ SandsWindBuff: { You are strengthened by the powers of sand Defense increased by {0}, damage increased by {1}%, and greatly buffed mana regen ''' + ItemTooltipPlayer: Increases damage, defense, and mana regeneration } SilvaRevival: { @@ -986,14 +1041,14 @@ TarragonImmunity: { TarraLifeRegen: { DisplayName: Tarra Life Description: Rapid healing - ItemTooltip: "" + ItemTooltipPlayer: "" } // Stat debuffs AbsorberAffliction: { DisplayName: Absorber Affliction Description: Damn nature, you scary! - ItemTooltip: Sickness - 200 DPS + ItemTooltipEnemy: Sickness - 200 DPS } AndromedaCripple: { @@ -1004,13 +1059,25 @@ AndromedaCripple: { ArmorCrunch: { DisplayName: Armor Crunch Description: Your armor is shredded - ItemTooltip: Damage Reduction is 15% less effective + ItemTooltipPlayer: Reduces defense and damage reduction + ItemTooltipEnemy: Damage Reduction is 15% less effective +} + +Bane: { + DisplayName: Bane + Description: An ancient curse envelops you + ItemTooltipEnemy: + ''' + Typeless - 20 DPS + Does not scale with debuff multipliers + Scales based on your critical strike chance + ''' } Crumbling: { DisplayName: Crumbling Description: Your armor is damaged - ItemTooltip: Damage Reduction is 8% less effective + ItemTooltipEnemy: Damage Reduction is 8% less effective } Clamity: { @@ -1035,7 +1102,7 @@ Enraged: { Eutrophication: { DisplayName: Eutrophication Description: Excessive nutrients restrict your movement - ItemTooltip: Slows enemies + ItemTooltipEnemy: Slows enemies } ExoFreeze: { @@ -1056,19 +1123,7 @@ FrozenLungs: { GalvanicCorrosion: { DisplayName: Galvanic Corrosion Description: Your limbs have begun to corrode - ItemTooltip: Slows enemies -} - -GlacialState: { - DisplayName: Glacial State - Description: Cannot move - ItemTooltip: Freezes enemies -} - -HadopelagicPressure: { - DisplayName: Hadopelagic Pressure - Description: Rapidly sinking to a watery grave - ItemTooltip: Water - 200 DPS + ItemTooltipEnemy: Slows enemies } IcarusFolly: { @@ -1083,7 +1138,12 @@ IcarusFolly: { Irradiated: { DisplayName: Irradiated Description: Your skin is burning off - ItemTooltip: + ItemTooltipPlayer: + ''' + Typeless - 2 DPS + Reduces defense and damage reduction + ''' + ItemTooltipEnemy: ''' Typeless - 10 DPS Increases damage taken from Sickness debuffs @@ -1093,12 +1153,13 @@ Irradiated: { MarkedforDeath: { DisplayName: Marked for Death Description: Damage reduction reduced - ItemTooltip: Damage reduction is 50% less effective + ItemTooltipEnemy: Damage reduction is 50% less effective } PearlAura: { DisplayName: Pearl Aura Description: Slowed down + ItemTooltipEnemy: Slows enemies } ProfanedWeakness: { @@ -1109,13 +1170,13 @@ ProfanedWeakness: { TemporalSadness: { DisplayName: Temporal Sadness Description: You are crying - ItemTooltip: Freezes enemies + ItemTooltipEnemy: Slows enemies } TimeDistortion: { DisplayName: Time Distortion Description: Time is slowed - ItemTooltip: Slows enemies + ItemTooltipEnemy: Slows enemies } Warped: { @@ -1131,7 +1192,8 @@ WeakPetrification: { WhisperingDeath: { DisplayName: Whispering Death Description: Death approaches; attack power and life regen reduced - ItemTooltip: Reduced contact damage + ItemTooltipPlayer: Negates life regen, reduces damage + ItemTooltipEnemy: Reduced contact damage } WitherDebuff: { @@ -1141,6 +1203,7 @@ WitherDebuff: { Withered... Defense decreased by {0} ''' + ItemTooltipEnemy: Decreases defense } // Summons @@ -1289,11 +1352,6 @@ DazzlingStabberBuff: { Description: En garde! } -DemonshadeSetDevilBuff: { - DisplayName: Red Devil - Description: The red devil will protect you -} - EnchantedKnifeStaffBuff: { DisplayName: Enchanted Knife Description: Junk knives not included @@ -1679,12 +1737,14 @@ PopoNoselessBuff: { Daybroken: { DisplayName: Daybroken - ItemTooltip: Heat - 100 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 100 DPS } Shadowflame: { DisplayName: Shadowflame - ItemTooltip: Heat - 30 DPS + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: Heat - 30 DPS } ForbiddenStealthSummonTagBuff: { @@ -1701,3 +1761,24 @@ CnidarianSummonTagBuff: { DisplayName: Cnidarian Summon Tag Buff Description: you are not seeing this } + +SmashedEvil: { + DisplayName: Smashed Evil + Description: Increased damage, movement speed, and regeneration + ItemTooltipEnemy: + ''' + All types - 20 DPS + +5 damage taken + ''' + ItemTooltipPlayer: + ''' + Regen returns to full strength 200% faster + 10% increased damage + 20% increased movement speed + ''' +} + +VoidConcentrationSummonTagBuff: { + DisplayName: Void Concentration Summon Tag Buff + Description: You should never see this. +} diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index 186125b51b..77ec346020 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -11,6 +11,8 @@ NoArmorSetBonusKey: Press the Armor Set Bonus key ArmorSetBonusKey: Press {0} DoubleTapDown: Double tap {0} // Miscellaneous stats/info +MinionSlotCost: Uses {0} minion slots +MinionSlotCostSingle: Uses {0} minion slot AggroBoost: Enemies are more likely to target you AggroReduction: Enemies are less likely to target you KnockbackImmunity: Grants immunity to knockback @@ -47,19 +49,30 @@ GrappleStats: Reelback Velocity: {2} Pull Velocity: {3} ''' +StatsAwful: Awful +StatsPoor: Poor +StatsAverage: Average +StatsGood: Good +StatsGreat: Great +StatsExcellent: Excellent WingStats: ''' Flight time: {0} seconds - Max horizontal speed: {1} mph - Max vertical speed: {2} mph + Max horizontal speed: {1} + Max vertical speed: {2} + Horizontal acceleration: {3} + Vertical acceleration: {4} ''' -WingStatsAcceleration: +WingStatsFull: ''' - Horizontal acceleration: {0} mph/s - Vertical acceleration: - {1} mph/s - {2} mph/s if ascending slower than {3} mph - {4} mph/s if ascending while falling + Flight time: {0} seconds + Max horizontal speed: {1} ({2} mph) + Max vertical speed: {3} ({4} mph) + Horizontal acceleration: {5} ({6} mph/s) + Vertical acceleration: {7} + - {8} mph/s + - {9} mph/s if ascending slower than {10} mph + - {11} mph/s if ascending while falling ''' WingStatsHover: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index d99892c2dd..b757a152d4 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -52,6 +52,8 @@ Drops: { // Other conditions HasFlareGun: While holding a Flare Gun upgrade LacewingBestiary: When at least 40% of the Bestiary has been completed +CrescentMoons: During a crescent moon +GibbousMoons: During a gibbous moon HasRogueArmor: While wearing rogue armor HasWings: While wearing wings InAstral: In the Astral Infection diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index e4eb0c04ad..d4d7fac81b 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -208,6 +208,15 @@ CalamityClientConfig: { ''' } + BoCSpriteChange: { + Label: "[i:BrainOfConfusion] Remove Potentially Disturbing Imagery" + Tooltip: + ''' + Replaces some boss sprites to remove potentially upsetting imagery that could trigger phobias. + Highly recommended if you are uncomfortable with body horror or have trypophobia. + ''' + } + RageMeterPosX: { Label: "[i:LaserRuler] Rage Meter X Position" Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson index b261db6100..4b00ee161b 100644 --- a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson +++ b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson @@ -4,3 +4,4 @@ RogueDamageClass.DisplayName: rogue damage StealthDamageClass.DisplayName: stealth damage TrueMeleeDamageClass.DisplayName: true melee damage TrueMeleeNoSpeedDamageClass.DisplayName: true melee damage +VoidTagDmgType.DisplayName: void tag damage diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 100e290574..367ad5e519 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -22,7 +22,7 @@ ExodusWings: { Tooltip: ''' {$CommonItemTooltip.FlightAndSlowfall} - Grants permanent Empyrean Wrath while wearing the Empyrean armor + Grants permanent [cbuffplr:CalamityMod/EmpyreanWrath] while wearing the Empyrean armor Pulsing with an alien heartbeat ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 131259954e..b2ab571ea3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -2,10 +2,12 @@ Abaddon: { DisplayName: Abaddon Tooltip: ''' - {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] - Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% + Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies + [DAMAGELINE] ''' + Equipped: Current [cbuff:CalamityMod/Bane] damage: {0} DPS + Unequipped: Equip this accessory to view your current [cbuff:CalamityMod/Bane] damage } AbyssalDivingGear: { @@ -28,8 +30,8 @@ AbyssalDivingSuit: { Grants the ability to swim, extends underwater breathing, emits light underwater, and improves mobility on ice Provides a moderate amount of light, reduces breath loss, and reduces damage caused by drowning in the abyss Abyss creatures are less likely to see you, mitigates the abyss' defense reduction, and lets you sink faster in liquids - Grants immunity to the sulphurous waters and [cbuff:CalamityMod/CrushDepth]'s increased breath loss - Grants resistance to the increased breath loss caused by [cbuff:CalamityMod/HadopelagicPressure] + Grants immunity to the sulphurous waters and [cbuffplr:CalamityMod/CrushDepth]'s increased breath loss + Grants resistance to the increased breath loss caused by [cbuffplr:CalamityMod/HadopelagicPressure] ''' } @@ -65,9 +67,9 @@ AlchemicalDecanter: { DisplayName: Alchemical Decanter Tooltip: ''' - All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuff:CalamityMod/Plague] by {0}% + All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuffplr:CalamityMod/Plague] by {0}% Projectiles spawn plague seekers on enemy hits - Releases plague bees and douses you in [cbuff:Honey] when damaged + Releases plague bees and douses you in [cbuffplr:Honey] when damaged ''' } @@ -96,11 +98,8 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - +{0} max life - Grants +{1} to +{2} HP/s life regen based on missing health - Grants the [cbuff:Honey] buff - Current boost: +[REGEN] HP/s - Fire and sickness debuff durations are halved + +{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)] + Natural life regen is {2}% more potent and returns {3}% faster You emit yellow light if visibility is enabled ''' } @@ -152,6 +151,19 @@ AngelTreads: { ''' } +Apollyon: { + DisplayName: Apollyon + Tooltip: + ''' + Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance + When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies + Critical strikes deal an additional 3% damage per debuff on the enemy + [DAMAGELINE] + ''' + Equipped: Current [cbuff:CalamityMod/Bane] damage: {0} DPS + Unequipped: Equip this accessory to view your current [cbuff:CalamityMod/Bane] damage +} + AquaticEmblem: { DisplayName: Aquatic Emblem Tooltip: @@ -177,7 +189,7 @@ AquaticHeart: { Wow, you can swim now! Being underwater increases max speed and acceleration by {0}% Greatly reduces breath loss and reduces the darkness intensity in the abyss - Attackers are inflicted with [cbuff:CalamityMod/GlacialState] + Attackers are inflicted with [cbuff:Frozen] Gain a fragile ice barrier that grants {1}% damage reduction for one hit The ice shield regenerates after {2} seconds ''' @@ -220,8 +232,8 @@ AsgardianAegis: { Tooltip: ''' {$Common.KnockbackImmunity} - Allows the ability to dash, empowered by a cosmic inferno - This dash can ram through enemies without taking damage + Allows the ability to ram dash, empowered by a cosmic inferno + This dash can ram through enemies without taking damage, inflicting [cbuff:CalamityMod/GodSlayerInferno] ''' } @@ -258,7 +270,7 @@ Baroclaw: { Tooltip: ''' 10% increased damage and 5% increased damage reduction - Attackers take high damage and are inflicted with Armor Crunch and Crush Depth + Attackers take high damage and are inflicted with [cbuff:CalamityMod/ArmorCrunch] and [cbuff:CalamityMod/CrushDepth] ''' } @@ -351,7 +363,7 @@ BlunderBooster: { ''' 12% increased rogue damage and 15% increased rogue projectile velocity Stealth generates 10% faster - Summons a red lightning aura around the player that electrifies nearby enemies + Summons a red lightning aura around the player that electrifies nearby enemies with [cbuff:CalamityMod/VermillionFlux] The aura has reduced opacity if visibility is disabled Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards diagonal dash This dash leaves a trail of red lightning bolts @@ -364,9 +376,9 @@ Calamity: { Tooltip: ''' Lights your cursor ablaze with the Witch's flames, engulfing it in a blazing aura - Enemies touching the blaze take immense damage and are inflicted with Vulnerability Hex + Enemies touching the blaze take immense damage and are inflicted with [cbuff:CalamityMod/VulnerabilityHex] Focusing an enemy for 2.5 seconds curses them, ascending Vulnerability Hex to its True form - Foes afflicted with True Vulnerability Hex take 1.15x damage from all sources + Foes afflicted with [cbuff:CalamityMod/TrueVulnerabilityHex] take 1.15x damage from all sources This effect is increased to 2.5x for the blazing cursor itself Equip in a vanity slot to change the cursor without dealing damage These changes work in conjunction with the Rainbow Cursor @@ -425,7 +437,7 @@ CorrosiveSpine: { ''' 5% increased movement speed 25% increased Sickness and Water debuff damage - All attacks irradiate enemies and reduces the severity of the sulphuric waters + All attacks inflict [cbuff:CalamityMod/Irradiated] and reduces the severity of the sulphuric waters You burst into radioactive clouds when struck ''' } @@ -444,7 +456,7 @@ CrawCarapace: { Tooltip: ''' 7% increased damage - Attackers take damage and are inflicted with Crumbling + Attackers take damage and are inflicted with [cbuff:CalamityMod/Crumbling] ''' } @@ -452,8 +464,8 @@ CrownJewel: { DisplayName: Crown Jewel Tooltip: ''' - +1 HP/s life regen - You gain an additional +1.5 HP/s life regen while afflicted with any debuff + +{0} HP/s life regen + Reduces damage over time taken by {1} HP/s ''' } @@ -544,7 +556,7 @@ DeificAmulet: { DisplayName: Deific Amulet Tooltip: ''' - Releases a burst of homing star-bees[TOGGLE] and drenches you in [cbuff:Honey] after taking damage + Releases a burst of homing star-bees[TOGGLE] and drenches you in [cbuffplr:Honey] after taking damage Increases the length of invincibility, with it increasing even more when at low health [c/aaaaaa:Shift- this item in your inventory to toggle] [i:PanicNecklace] [c/aaaaaa:Panic Necklace's effect] ''' @@ -556,7 +568,7 @@ DepthCharm: { Tooltip: ''' Reduces the damage caused by drowning in the abyss - Removes the increased breath loss of Crush Depth + Removes the increased breath loss of [cbuffplr:CalamityMod/CrushDepth] ''' } @@ -569,9 +581,9 @@ DiamondOfTheDeep: { Dash to disperse the spirits and have them attack enemies When dispersed [c/CB7AD7:below 50% life], the spirits support you instead The spirits appear in order and have different effects based on color: - [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] - [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 10 temporarily] - [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] + [c/3CB371: Explodes on impact and inflicts] [cbuff:CalamityMod/CrushDepth] / [c/CB7AD7:Heals for 8 HP] + [c/FF4500: Pierces enemies and inflicts] [cbuff:OnFire3] / [c/CB7AD7:Increases defense by 10 temporarily] + [c/1E90FF: Hits multiple times and inflicts] [cbuff:CalamityMod/HadopelagicPressure] / [c/CB7AD7:Heals 5% of max HP] Spirits are transparent and silent when visibility is toggled off ''' } @@ -615,7 +627,7 @@ DragonScales: { Rogue projectiles spawn slow fireballs as they travel Stealth strikes create infernados where they hit +10% max run speed and acceleration - Grants immunity to Dragonfire + Grants immunity to [cbuffplr:CalamityMod/Dragonfire] 'Only a living dragon holds true treasure' ''' } @@ -626,7 +638,7 @@ DynamoStemCells: { ''' 10% increased ranged damage and movement speed Ranged weapons fire a powerful mini swarmer every 3 seconds - Reduces damage taken from Dragonfire + Reduces damage taken from [cbuffplr:CalamityMod/Dragonfire] ''' } @@ -651,7 +663,7 @@ EldritchSoulArtifact: { Tooltip: ''' Boosts melee speed by 10%, ranged velocity by 25%, rogue stealth regen by 15%, max minions by 1 and reduces mana cost by 25% - Grants immunity to Whispering Death + Grants immunity to [cbuffplr:CalamityMod/WhisperingDeath] Knowledge ''' } @@ -669,7 +681,7 @@ ElementalGauntlet: { DisplayName: Elemental Gauntlet Tooltip: ''' - Melee attacks and projectiles inflict Elemental Mix + Melee attacks and projectiles inflict [cbuff:CalamityMod/ElementalMix] 15% increased melee damage and melee speed 5% increased melee critical strike chance 20% increased true melee damage and increased melee knockback @@ -689,7 +701,7 @@ ElysianAegis: { ''' {$Common.KnockbackImmunity} Allows the ability to dash, empowered by holy fire - This dash can ram through enemies without taking damage + This dash can ram through enemies without taking damage, inflicting [cbuff:CalamityMod/HolyFlames] 'Blessed by the Profaned Flame' ''' } @@ -744,8 +756,16 @@ FeatherCrown: { DisplayName: Feather Crown Tooltip: ''' - 15% increased rogue projectile velocity - Stealth strikes cause feathers to fall from the sky on enemy hits + Summons a [c/81B7F7:Skyline Feather] every 2 seconds, up to a maximum of 5 + Each [c/81B7F7: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 [cbuff:CalamityMod/StaticDischarge] + Running out of mana or drinking a mana potion sheds all feathers + Upon shedding a feather, no new feathers can be gained for 5 seconds + ''' + HoldShiftTooltip: + ''' + [c/81B7F7:Young mages would don feathers and gaze into the starlit night, as if welcoming the breath of the heavens.] + [c/81B7F7:To commune with mana was to commune with the world, and further, its draconic masters.] ''' } @@ -771,8 +791,12 @@ FleshTotem: { DisplayName: Flesh Totem Tooltip: ''' - Halves enemy contact damage - When you take contact damage this effect has a 20 second cooldown + 5% increased magic critical strike chance + +30 max mana + Summons an effigy above your head that stores mana as you use it, up to 600 mana + The effigy occasionally pulses, restoring 20 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 ''' } @@ -789,7 +813,7 @@ FrostFlare: { DisplayName: Frost Flare Tooltip: ''' - All attacks and projectiles inflict Frostbite + All attacks and projectiles inflict [cbuff:Frostburn2] Grants immunity to Frostburn, Chilled and Frozen Being above 50% life grants 10% increased damage Being below 50% life grants 15 defense and 15% increased max movement speed and acceleration @@ -811,8 +835,8 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, granting 5 defense and +1 HP/s life regen - 10% increased damage while you have the Mushy buff + Consuming mushrooms provides [cbuffplr:CalamityMod/Mushy], granting 5 defense and +1 HP/s life regen + 10% increased damage while you have [cbuffplr:CalamityMod/Mushy] ''' } @@ -821,7 +845,7 @@ GiantPearl: { Tooltip: ''' You have a light aura around you - Enemies within the aura are slowed down + Enemies within the aura are afflicted with [cbuff:CalamityMod/PearlAura] and slowed down Enemies that remain within the aura are bombarded by homing prism shards {$Common.AbyssGlow} ''' @@ -893,9 +917,9 @@ HallowedRune: { ''' HoldShiftTooltip: ''' - [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants 10% increased summon damage and rains stars on enemies] - [c/d08aff: Hallowed Defense] [c/eed4ff: grants 5 defense] - [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +1.5 HP/s life regen] + [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants {0}% increased summon damage and rains stars on enemies] + [c/d08aff: Hallowed Defense] [c/eed4ff: grants {1} defense] + [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +{2} HP/s life regen] ''' } @@ -925,18 +949,13 @@ HideofAstrumDeus: { True melee strikes drops astral stars from the sky Releases an explosion and temporarily increases true melee damage by 30% when damaged Boost duration scales with the amount of damage you took, up to 10 seconds - Nullifies the Astral Infection debuff + Nullifies the [cbuffplr:CalamityMod/AstralInfectionDebuff] ''' } HoneyDew: { DisplayName: Honey Dew - Tooltip: - ''' - +10 max life - Grants the Honey buff - Sickness debuff durations are halved - ''' + Tooltip: Natural life regen is {0}% more potent } HowlsHeart: { @@ -952,7 +971,7 @@ IlmerisSpark: { DisplayName: Ilmeris' Spark Tooltip: ''' - Attacks inflict Static Discharge while underwater + Attacks inflict [cbuff:CalamityMod/StaticDischarge] while underwater Taking damage causes the enemy to be shocked Shocked enemies constantly release sparks ''' @@ -962,11 +981,9 @@ InfectedJewel: { DisplayName: Infected Jewel Tooltip: ''' - Passively grants +1 HP/s life regen - Grants 12 defense and +2 HP/s life regen while afflicted with any debuff - Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 4 additional defense - Nullifies the Astral Infection debuff + +{0} HP/s life regen + Reduces damage over time taken by {1} HP/s + Jump-starts regeneration after a damaging debuff ends 'A beautiful gemstone tarnished by spaceborne rot' ''' } @@ -1024,7 +1041,7 @@ JellyChargedBattery: { Tooltip: ''' Increases your max number of minions by 1, and summon damage by 7% - Minion attacks create orbs of static discharge + Minion attacks create orbs of [cbuff:CalamityMod/StaticDischarge] ''' } @@ -1047,7 +1064,7 @@ LeviathanAmbergris: { Tooltip: ''' 120% increased initial dash velocity, 33% faster dash cooldown, and greatly increased dash deceleration - Your dashes are empowered by water, knocking back and damaging nearby enemies with viscous currents + Your dashes are empowered by water, knocking back and damaging enemies with vicious currents that inflict [cbuff:CalamityMod/RiptideDebuff] Visual effects are reduced if visibility is disabled ''' } @@ -1063,12 +1080,7 @@ LifeJelly: { LivingDew: { DisplayName: Living Dew - Tooltip: - ''' - +25 max life - Grants the Honey buff - Fire and sickness debuff durations are halved - ''' + Tooltip: Natural life regen is {0}% more potent and returns {1}% faster } LuxorsGift: { @@ -1118,9 +1130,18 @@ MoonstoneCrown: { DisplayName: Moonstone Crown Tooltip: ''' - 15% increased rogue projectile velocity - Stealth strikes release lunar flares on enemy hits - Rogue projectiles summon homing moon sigils as they travel + +70 max mana + Summons a [c/27F5E0:Lunar Sigil] every 2 seconds, up to a maximum of 10 + Each [c/27F5E0:Lunar Sigil] increases magic damage by 2% and reduces mana cost by 1% + 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 [cbuff:CalamityMod/Nightwither] + Running out of mana or using a mana potion shatters all sigils + Upon shattering a sigil, no new sigils can appear for 5 seconds + ''' + HoldShiftTooltip: + ''' + [c/27F5E0:Countless tears were shed over Chrysadia's marring: when its eventide clouds gave way not to beloved stars,] + [c/27F5E0:or to dear patrons, but to a ravenous void and its unyielding dread.] ''' } @@ -1153,7 +1174,7 @@ NecklaceofVexation: { ''' Up to 30% increased damage the lower your life is Current boost: [DAMAGE]% - All attacks inflict acid venom + All attacks inflict [cbuff:Venom] Revenge ''' } @@ -1163,8 +1184,8 @@ NuclearFuelRod: { Tooltip: ''' Increases your max number of minions by 1 - Minions release an irradiated aura on enemy hits - Grants immunity to Irradiated + Minions release an [cbuff:CalamityMod/Irradiated] aura on enemy hits + Grants immunity to [cbuffplr:CalamityMod/Irradiated] ''' } @@ -1173,7 +1194,7 @@ Nucleogenesis: { Tooltip: ''' Increases your max number of minions by 4 - Grants immunity to Shadowflame and Irradiated + Grants immunity to [cbuffplr:CalamityMod/Shadowflame] and [cbuffplr:CalamityMod/Irradiated] 15% increased summon damage, and increased minion knockback Minions inflict a variety of debuffs Minions spawn damaging sparks on enemy hits @@ -1243,7 +1264,7 @@ OrnateShield: { Tooltip: ''' Allows the ability to dash - This dash can ram through enemies without taking damage + This dash can ram through enemies without taking damage, inflicting [cbuff:Frostburn2] ''' } @@ -1277,9 +1298,9 @@ PhantomicArtifact: { ''' HoldShiftTooltip: ''' - [c/8ce0ff: Phantomic Empowerment] [c/ccf1ff: grants 10% increased summon damage and throws knives at enemies] - [c/d08aff: Phantomic Shield] [c/eed4ff: grants 10 defense and a 20% damage reduction bulwark] - [c/ff8cb5: Phantomic Regen] [c/ffccde: grants 1 HP/s life regen and occasionally drops phantom hearts which grant an additional 1 HP/s life regen] + [c/8ce0ff: Phantomic Empowerment] [c/ccf1ff: grants {0}% increased summon damage and throws knives at enemies] + [c/d08aff: Phantomic Shield] [c/eed4ff: grants {1} defense and a 20% damage reduction bulwark] + [c/ff8cb5: Phantomic Regen] [c/ffccde: grants {2} HP/s life regen and occasionally drops phantom hearts which grant an additional 1 HP/s life regen] ''' } @@ -1316,7 +1337,7 @@ ProfanedSoulArtifact: { [ADREN] Once depleted, the rocks are flung outward and will regenerate 5 seconds after being hit Taking damage resets the timer - The healer guardian restores 15 health every few seconds + The healer guardian restores 10 health every few seconds Purity ''' ShieldAdren: Halved Adrenaline loss if all damage is absorbed @@ -1338,7 +1359,7 @@ ProfanedSoulCrystal: { ''' Provides passive buffs depending on the time of day Greatly boosts the power of the Guardian's relics - Grants additional effects if you have {0} minion slots + Grants additional effects if you have {0} unused minion slots Summons your own personal Guardians to fight alongside you All non-summon attacks are transformed, and are empowered if no minions are active [c/ffa680:Melee] [c/ffd2bf:attacks become a barrage of spears] @@ -1377,32 +1398,21 @@ Radiance: { DisplayName: Radiance Tooltip: ''' - +70 max life - Provides greatly improved life regen, increasing with lost health - Gain increased defense from debuffs inflicted on you, and greatly reduces their effectiveness - Current boosts: +[REGEN] HP/s and [DEFENSE] defense. + +{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)] + Reduces damage over time taken by {2} HP/s and jump-starts regeneration after a damaging debuff ends + Natural life regen is {3}% more potent and returns {4}% faster You emit shining blue light if visibility is enabled 'A once putrid crystal, now glimmering with immaculate purity' ''' - HoldShiftTooltip: - ''' - [c/CDF69C:Grants +2 to +5 HP/s life regen based on missing health] - [c/CDF69C:Recover an additional 6 HP/s while inflicted with a debuff] - [c/CDF69C:This eventually slows to 1.33 HP/s when debuffed for an extended time period] - [c/CDF69C:Grants the Honey buff] - [c/CDF69C:Grants 15 defense while afflicted with any debuff] - [c/CDF69C:Each additional debuff grants 5 defense, which slowly decays while not debuffed] - [c/CDF69C:Weak damaging debuffs are harmless and halves the duration of most other debuffs] - ''' } RadiantOoze: { DisplayName: Radiant Ooze Tooltip: ''' - Grants +{0} to +{1} HP/s life regen based on missing health - Current boost: +[REGEN] HP/s + +{0} to +{1} HP/s life regen based on missing health You emit yellow light if visibility is enabled + [c/999999:(Current regen: +[REGEN] HP/s)] ''' } @@ -1416,7 +1426,7 @@ RampartofDeities: { Tooltip: ''' {$Common.KnockbackImmunity} - Releases a blast of homing star-bees[TOGGLE] and drenches you in [cbuff:Honey] after taking damage + Releases a blast of homing star-bees[TOGGLE] and drenches you in [cbuffplr:Honey] after taking damage Increases the length of invincibility, with it increasing even more when at low health or taking high damage attacks Reduces damage taken by 25% when below 50% life Absorbs 25% of damage done to players on your team when you are above 25% life @@ -1477,7 +1487,7 @@ RottenBrain: { RottenDogtooth: { DisplayName: Rotten Dogtooth - Tooltip: Stealth strikes inflict Crumbling for 2.5 seconds and deal 8% more damage + Tooltip: Stealth strikes inflict [cbuff:CalamityMod/Crumbling] and deal 8% more damage } RoverDrive: { @@ -1507,9 +1517,9 @@ SandCloak: { Tooltip: ''' Dashing creates a large protective sand veil which damages enemies inside it - The sand veil lasts 15 seconds, but dissipates early if you dash again - The veil slowly follows you, and any player inside it gains 4 defense and 1.75x acceleration - After dissipating, the sand veil has a 15 second cooldown before it can be used again + The sand veil lasts {0} seconds, but dissipates early if you dash again + The veil slowly follows you, and any player inside it gains {1} defense and {2}% acceleration + After dissipating, the sand veil has a {3} second cooldown before it can be used again ''' } @@ -1632,9 +1642,9 @@ SlagsplitterPauldron: { DisplayName: Slagsplitter Pauldron Tooltip: ''' - Your dashes become empowered by flame, erupting on contact with enemies + Your dashes become empowered by [cbuff:OnFire3], erupting on contact with enemies Grants immunity to knockback and 10% damage reduction while dashing - Enemies hit by your dashes have their armor crushed + Enemies hit by your dashes are afflicted with [cbuff:CalamityMod/ArmorCrunch] Visual effects are reduced if visibility is disabled ''' } @@ -1661,9 +1671,20 @@ SpiritGlyph: { Tooltip: Minion attacks provide various buffs HoldShiftTooltip: ''' - [c/8ce0ff: Spirit Power] [c/ccf1ff:grants 10% increased summon damage] - [c/d08aff: Spirit Defense] [c/eed4ff:grants 3 defense] - [c/ff8cb5: Spirit Regen] [c/ffccde:grants +1 HP/s life regeneration] + [c/8ce0ff: Spirit Power] [c/ccf1ff:grants {0}% increased summon damage] + [c/d08aff: Spirit Defense] [c/eed4ff:grants {1} defense] + [c/ff8cb5: Spirit Regen] [c/ffccde:grants +{2} HP/s life regeneration] + ''' +} + +SpringStool: { + DisplayName: Spring Stool + Tooltip: + ''' + Hold {$Key.UP} to reach higher + Press [KEY] to jump super high + Super jumps can only be performed once every {0} seconds and after landing + +{1}% critical strike chance when striking enemies below you ''' } @@ -1672,7 +1693,7 @@ StarbusterCore: { Tooltip: ''' Increases your max number of minions by 1 - Summons release an astral explosion on enemy hits + Summons release an [cbuff:CalamityMod/AstralInfectionDebuff] explosion on enemy hits ''' } @@ -1682,7 +1703,7 @@ StarTaintedGenerator: { ''' Increases your max number of minions by 2, and summon damage by 7% Minion attacks spawn astral explosions and inflict several debuffs - Grants immunity to Irradiated + Grants immunity to [cbuffplr:CalamityMod/Irradiated] Does not stack with downgrades ''' } @@ -1702,7 +1723,7 @@ StatisCurse: { ''' Increases your max number of minions by 3, and summon damage by 12% Increased minion knockback - Minion attacks inflict Shadowflame, and grants immunity to Shadowflame + Minion attacks inflict [cbuff:CalamityMod/Shadowflame], and grants immunity to [cbuffplr:CalamityMod/Shadowflame] Does not stack with downgrades ''' } @@ -1833,9 +1854,10 @@ TeslasAmulet: { DisplayName: Tesla's Amulet Tooltip: ''' - Generates an electrifying field that slows enemies + Generates an electrifying field around you + The field inflicts [cbuff:CalamityMod/StaticDischarge] and [cbuff:CalamityMod/GalvanicCorrosion] The field has reduced opacity if visibility is disabled - Reduces the duration of the Static Discharge debuff + Reduces the duration of [cbuffplr:CalamityMod/StaticDischarge] ''' } @@ -1845,7 +1867,7 @@ TheAbsorber: { ''' {$Common.KnockbackImmunity} {0}% increased movement and jump speed - Attackers take immense damage and are afflicted with a crippling sickness debuff + Attackers take immense damage and are afflicted with [cbuff:CalamityMod/AbsorberAffliction] Using a healing potion will spawn a green aura that lasts for {1} seconds Walking into the aura removes all debuffs once and grants {2} HP/s regen, {3}% damage, and {4}% damage reduction {5}% of the damage from enemy attacks is converted into healing @@ -1856,7 +1878,7 @@ TheAmalgam: { DisplayName: The Amalgam Tooltip: ''' - All attacks inflict a variety of debuffs, 200% increased elemental debuff damage + All attacks inflict a variety of debuffs, 300% increased elemental debuff damage Most buffs last twice as long, and persist after dying Taking damage confuses nearby enemies and spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds @@ -1923,7 +1945,7 @@ TheFirstShadowflame: { Tooltip: ''' Increases your max number of minions by 1 - Minion attacks inflict Shadowflame, and grants immunity to Shadowflame + Minion attacks inflict [cbuff:CalamityMod/Shadowflame], and grants immunity to [cbuffplr:CalamityMod/Shadowflame] ''' } @@ -1977,7 +1999,7 @@ ToxicHeart: { DisplayName: Toxic Heart Tooltip: ''' - Your heart beats with the plague, pulsing outside of your body + Your heart beats with the [cbuff:CalamityMod/Plague], pulsing outside of your body Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you 50% increased Sickness debuff damage Effects are transparent and silent if visibility is disabled @@ -1988,9 +2010,9 @@ TrinketofChi: { DisplayName: Trinket of Chi Tooltip: ''' - Increases damage reduction by 8% if you avoid taking damage for 10 seconds + Increases damage reduction by {0}% if you avoid taking damage for {1} seconds This buff expires on hit - +1 HP/s life regen for you and your teammates + +{2} HP/s life regen for you and your teammates ''' } @@ -1998,8 +2020,8 @@ UnholyTonic: { DisplayName: Unholy Tonic Tooltip: ''' - Increases damage reduction by 4% and defense by 6 while in the corruption - Grants immunity to Brain Rot + Increases defense by {0} while in the corruption + Grants immunity to [cbuffplr:CalamityMod/BrainRot] ''' } @@ -2012,13 +2034,28 @@ UnstableGraniteCore: { ''' } +V8Engine: { + DisplayName: V8 Engine + Tooltip: Grants a short dash with a long cooldown that works while mounted +} + +V8000Engine: { + DisplayName: V8000 Engine + Tooltip: + ''' + Grants a dash with a long cooldown that works while mounted + This dash can ram through enemies without taking damage + 'Are soul-powered engines eco-friendly?' + ''' +} + VampiricTalisman: { DisplayName: Vampiric Talisman Tooltip: ''' Rogue critical strikes steal enemy life Stealth strikes grant 15% critical strike chance and increased lifesteal to non-stealth strikes for 10 seconds - Stealth strikes inflict Heavy Bleeding and Armor Crunch, and deal 8% more damage + Stealth strikes inflict [cbuff:CalamityMod/HeavyBleeding] and [cbuff:CalamityMod/ArmorCrunch], and deal 8% more damage 'Possessing the talisman makes you yearn for blood' ''' YearningForBlood: THIS ENDLESS HUNGER WON'T END @@ -2039,8 +2076,8 @@ ViciousTonic: { DisplayName: Vicious Tonic Tooltip: ''' - Increases damage reduction by 4% and defense by 6 while in the crimson - Grants immunity to Burning Blood + Increases defense by {0} while in the crimson + Grants immunity to [cbuffplr:CalamityMod/BurningBlood] ''' } @@ -2054,17 +2091,7 @@ VoidofCalamity: { Tooltip: ''' 12% increased damage - Brimstone fire rains down after getting hit - ''' -} - -VoidofExtinction: { - DisplayName: Void of Extinction - Tooltip: - ''' - {$CommonItemTooltip.PercentIncreasedCritChance} - Critical strikes explode, igniting nearby foes with [cbuff:CalamityMod/BrimstoneFlames] - Reduces damage taken from [cbuff:CalamityMod/BrimstoneFlames] by {1}% + Calamitous flames rain down while invincible ''' } @@ -2073,7 +2100,7 @@ VoltaicJelly: { Tooltip: ''' Increases your max number of minions by 1 - Minion attacks inflict Static Discharge + Minion attacks inflict [cbuff:CalamityMod/StaticDischarge] ''' } @@ -2083,7 +2110,7 @@ WarbanneroftheRighteous: { ''' Multiplies all damage based on how close you are to enemies Maximum damage boost is 15%, minimum damage boost is -15% - Emit a blazing aura that burns and repels nearby enemies + Emit a blazing aura that burns and repels nearby enemies with [cbuff:CalamityMod/HolyFlames] Enemies take increasing damage the closer they are to you and the longer they are near you Effects are transparent and silent if visibility is disabled ''' @@ -2120,9 +2147,9 @@ YharimsGift: { Tooltip: ''' {$Common.KnockbackImmunity} - Flaming meteors rain down after getting hit - Volatile dragon dust trails behind you - Increases damage and movement speed by 15% + Increases damage by 10% and movement speed by 20% + All attacks inflict [cbuff:CalamityMod/AuricRebuke] + Flaming meteors rain down while invincible [c/FCA92B:'The power to kill a god pulses from within this artifact'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 3ba3ea1a9b..26c714ad61 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -38,7 +38,7 @@ BloodRune: { BubonicRound: { DisplayName: Bubonic Round - Tooltip: Spreads the plague on hit and ignores 10% of enemy defense + Tooltip: Spreads the [cbuff:CalamityMod/Plague] on hit and ignores 10% of enemy defense } CinderArrow: { @@ -48,7 +48,13 @@ CinderArrow: { DryadsTear: { DisplayName: Dryad's Tear - Tooltip: Splits into homing shards on impact which ignore 10 points of enemy defense + Tooltip: + ''' + An extremely powerful magic bullet blessed with nature's essence that becomes unstable when multiple are nearby + Carries a teardrop along with it which on impact will detach and crash down upon the hit enemy and burst + All bullet and teardrop hits have 18 armor penetration + [c/40E091:'Focus. Breathe. Just one more shot, and the violence will fade away...'] + ''' } ElysianArrow: { @@ -96,7 +102,7 @@ HolyFireBullet: { DisplayName: Holy Fire Bullet Tooltip: ''' - Profaned bullets that deal 1.15x damage and explode on impact + Profaned bullets that deal 1.15x damage and explode on impact, inflicting [cbuff:CalamityMod/HolyFlames] The explosion is larger and the bullet deals increased damage if impact occurs immediately after firing The extra damage bonus caps at 1.15x ''' @@ -110,7 +116,7 @@ HyperiusBullet: { Damage that would be dealt from the bullets is instead stored on the target As more damage is stored, it will begin to overflow, slowly releasing and damaging the enemy Attacks from sources other than Hyperius Bullets will release some of the charge - Releasing charge in this way deals 20% more damage + Releasing charge in this way is 20% more efficient ''' } @@ -165,7 +171,7 @@ VanquisherArrow: { DisplayName: Vanquisher Arrow Tooltip: ''' - Pierces through tiles and homes in on enemies + Pierces through tiles and homes in on enemies, inflicting [cbuff:CalamityMod/GodSlayerInferno] Tears a rift in space on enemy hits ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 35c60fa863..7cd148e6f7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -10,12 +10,16 @@ AstralBreastplate: { AstralHelm: { DisplayName: Astral Helm - Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + Detects nearby creatures, enemy projectiles, danger sources, and treasure + [c/aaaaaa:Shift- in your inventory to toggle the] [cbuffplr:CalamityMod/Omniscience] [c/aaaaaa:effect] + ''' SetBonus: ''' {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} - Detects nearby creatures, enemy projectiles, danger sources, and treasure Whenever you crit an enemy, a barrage of stars will rain down This effect has a {2} {^2:second;seconds} cooldown before it can trigger again ''' @@ -45,7 +49,7 @@ BrimflameCowl: { ''' {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} {$CommonItemTooltip.PercentIncreasedMagicDamageCritChance@2} - Immunity to [cbuff:OnFire], [cbuff:CalamityMod/BrimstoneFlames] and [cbuff:Frostburn] + Immunity to [cbuffplr:OnFire], [cbuffplr:CalamityMod/BrimstoneFlames] and [cbuffplr:Frostburn] ''' SetBonus: ''' @@ -197,7 +201,7 @@ HydrothermicArmor: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedDamage} - Grants immunity to lava and [cbuff:OnFire] + Grants immunity to lava and [cbuffplr:OnFire] ''' CommonSetBonus: ''' @@ -346,7 +350,7 @@ MolluskShellmet: { SetBonus: ''' {0}% increased damage reduction - Two shellfishes aid you in combat + Two shellfishes aid you in combat, inflicting [cbuff:CalamityMod/ShellfishClaps] ''' } @@ -365,7 +369,7 @@ PlaguebringerCarapace: { ''' {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} - Grants immunity to [cbuff:CalamityMod/Plague] + Grants immunity to [cbuffplr:CalamityMod/Plague] ''' } @@ -425,7 +429,7 @@ PlagueReaperVest: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamage} - Grants immunity to the Plague + Grants immunity to [cbuffplr:CalamityMod/Plague] ''' } @@ -472,7 +476,7 @@ ReaverHeadTank: { {$Common.AggroBoost} Reduces the life regen lost from damage over time debuffs by {0}% {1}% decreased movement speed and flight time - Grants [cbuff:CalamityMod/ReaverRage] for {2} {^2:second;seconds} after taking damage + Grants [cbuffplr:CalamityMod/ReaverRage] for {2} {^2:second;seconds} after taking damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 10cdedab20..b55af2186e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -168,7 +168,6 @@ BloodflareBodyArmor: { Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Greatly increased life regen, equivalent to Crimson armor Enemies below 50% life drop a heart when struck This effect has a 5 second cooldown ''' @@ -243,6 +242,7 @@ BloodflareHeadRogue: { ''' {$Common.RogueDamage} and {$Common.RogueCrit@1} {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} + Increases regeneration by {3} HP/s ''' SetBonus: ''' @@ -252,7 +252,6 @@ BloodflareHeadRogue: { SetBonusEffect: ''' Grants {0} defense when above {1}% life - Rogue critical strikes have lifesteal {$BloodflareBodyArmor.CommonSetBonus} ''' } @@ -307,7 +306,6 @@ DemonshadeHelm: { {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Shadowbeams and demon scythes will fire down when you are hit - A friendly red devil follows you around {2} to enrage nearby enemies with a dark magic spell for {3} seconds This makes them take {4}x total damage, but they will deal {5}x damage to you ''' @@ -338,7 +336,7 @@ EmpyreanMask: { ''' {$Common.RogueStealth} Rogue projectiles have special effects on enemy hits - Imbued with cosmic wrath when you are damaged + Imbued with [cbuffplr:CalamityMod/EmpyreanWrath] when you are damaged or while below {1}% life ''' } @@ -500,7 +498,7 @@ OmegaBlueChestplate: { ''' {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} {$CommonItemTooltip.PercentChanceToSaveAmmo@2} - Your attacks inflict Hadopelagic Pressure + Your attacks inflict [cbuff:CalamityMod/HadopelagicPressure] No positive life regen ''' } @@ -669,7 +667,7 @@ TarragonHeadMelee: { ''' SetBonusEffect: ''' - Taking damage gives [cbuff:CalamityMod/TarraLifeRegen], which grants +{0} HP/s life regen + Taking damage gives [cbuffplr:CalamityMod/TarraLifeRegen], which grants +{0} HP/s life regen {1} to cloak yourself in life energy that heavily reduces enemy contact damage for {2} seconds This has a {3} second cooldown {$TarragonBreastplate.CommonSetBonus} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index 040f049fb8..a3bcceedcc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -91,7 +91,7 @@ DesertProwlerPants: { Tooltip: ''' {$Common.RogueCrit} - Grants immunity to {$BuffName.WindPushed} + Grants immunity to [cbuffplr:WindPushed] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 44d944cf2c..ebc986797d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -46,8 +46,8 @@ UrsaSergeant: { DisplayName: Ursa Sergeant Tooltip: ''' - Attacks maul enemies with astral claw swipes - Taking damage reduces the cooldown, but inflicts you with {$Buffs.AstralInfectionDebuff.DisplayName} + Attacks maul enemies with astral claw swipes that inflict [cbuff:CalamityMod/AstralInfectionDebuff] + Taking damage reduces the cooldown, but inflicts you with [cbuffplr:CalamityMod/AstralInfectionDebuff] Enemy kills also reduce the cooldown Swipes will be translucent and silent if visibility is disabled ''' @@ -58,10 +58,8 @@ Bloodfin: { DisplayName: Bloodfin Tooltip: ''' - Grants a buff that massively boosts natural life regen and grants +{0} HP/s life regen - This increases to +{1} HP/s while suffering from damage over time debuffs - This buff also directly restores HP every {2} seconds if below {3}% health - {$CommonItemTooltip.SecondDuration@4} + Grants a buff that restores 1 HP every {0} seconds + {$CommonItemTooltip.SecondDuration@1} 'The wonders of angiogenesis' ''' } @@ -336,7 +334,7 @@ NavyFishingRod: { DisplayName: Navy Fishing Rod Tooltip: ''' - Fires bobbers that inflict Static Discharge on nearby enemies + Fires bobbers that inflict [cbuff:CalamityMod/StaticDischarge] on nearby enemies 'The sea is a city. Just below are highways, boulevards, streets, and roundabouts bustling with submarine traffic.' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index d8d310e8b3..50f567d1bb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -54,7 +54,6 @@ CosmicPlushie: { Tooltip: ''' Summons the devourer of the cosmos...? - Suppresses friendly red devils 'Sharp objects possibly included' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 75bc1378a2..0719eba5fb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -195,7 +195,7 @@ Grax: { DisplayName: Grax Tooltip: ''' - Hitting an enemy will greatly boost your damage, defense, and damage reduction for a short time + Hitting an enemy increases your damage by {0}% and defense by {1} for {2} seconds Press to use without hammering down walls or chopping down trees ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index ee8d2c7dd1..895e42de07 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -22,7 +22,7 @@ AethersWhisper: { DisplayName: Aether's Whisper Tooltip: ''' - Inflicts long-lasting shadowflame and splits on tile hits + Inflicts long-lasting [cbuff:CalamityMod/Shadowflame] and splits on tile hits Projectiles gain damage as they travel ''' } @@ -161,21 +161,21 @@ BlackAnurian: { BloodBath: { DisplayName: Blood Bath - Tooltip: Drenches your foes in blood + Tooltip: Drenches your foes in blood that inflicts [cbuff:CalamityMod/BurningBlood] } BrimroseStaff: { DisplayName: Brimrose Staff - Tooltip: Fires a spread of brimstone beams + Tooltip: Fires a spread of splitting beams of [cbuff:CalamityMod/BrimstoneFlames] } BurningSea: { DisplayName: Burning Sea Tooltip: ''' - Conjures a massive brimstone fireball that hovers near you and incinerates foes + Conjures a massive fireball that hovers near you and incinerates foes with [cbuff:CalamityMod/BrimstoneFlames] Holding the fireball for too long causes it to burn out - This burns you with Brimstone Flames and gives a long delay before another can be cast + This burns you with [cbuffplr:CalamityMod/BrimstoneFlames] and gives a long delay before another can be cast ''' } @@ -202,9 +202,10 @@ CoralSpout: { ''' Casts a shotgun-like blast of coral shards Keep the attack button held down to narrow the spread + Coral shards ignore 5 points of enemy defense Fully charging the attack releases a single, bigger chunk of coral that sticks to enemies Grabbing the chunk of coral after it falls from the enemy replenishes 150 mana - The mana-charged coral also provides a buff that increases the coral's damage and the convergence speed + The mana-charged coral also provides the [cbuffplr:CalamityMod/CoralSymbiosis] buff [c/5C95A1:'Knowledge is important, and the Old Sea Kingdom's many scribes knew it had to be preserved at any cost.] [c/5C95A1:Their libraries were much larger than most, because of the water-proof stone tablets occupying them.'] ''' @@ -238,8 +239,8 @@ DeathValleyDuster: { Tooltip: ''' Casts an enchanted blast of sand that passes through enemies and tiles - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the Sand's Wind Buff - The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/SandsWindBuff] buff + [cbuffplr:CalamityMod/SandsWindBuff] increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' } @@ -298,7 +299,7 @@ EventHorizon: { EvergladeSpray: { DisplayName: Everglade Spray - Tooltip: Fires a stream of burning green ichor + Tooltip: Fires a stream of [cbuff:CursedInferno] and [cbuff:Ichor] } FaceMelter: { @@ -511,7 +512,7 @@ MadAlchemistsCocktailGlove: { Tooltip: ''' Fires a variety of high-velocity flasks - Press to throw a prismatic flask that inflicts Elemental Mix + Press to throw a prismatic flask that inflicts [cbuff:CalamityMod/ElementalMix] Red flasks explode violently Blue flasks contain poison gas Green flasks summon lunar flares @@ -592,7 +593,11 @@ Omicron: { ParasiticSceptor: { DisplayName: Parasitic Scepter - Tooltip: Fires a spread of radioactive water leeches that latch onto enemies, increasing damage over time per leech + Tooltip: + ''' + Fires a spread of radioactive water leeches that latch onto enemies + Deals stacking [cbuff:CalamityMod/Irradiated] damage over time per leech + ''' } PhantasmalFury: { @@ -604,7 +609,7 @@ PhoenixFlameBarrage: { DisplayName: Phoenix Flame Barrage Tooltip: ''' - Casts a barrage of fire from the sky + Casts a barrage of [cbuff:CalamityMod/Dragonfire] from the sky 'Baptism by draconic fire' ''' } @@ -616,7 +621,7 @@ Photosynthesis: { PlagueStaff: { DisplayName: Plague Staff - Tooltip: Fires a tight spread of 4 plague fangs + Tooltip: Fires a tight spread of 4 plague fangs that inflict [cbuff:CalamityMod/Plague] } PlasmaRifle: { @@ -634,7 +639,7 @@ PlasmaRod: { ''' Casts a low-damage plasma bolt Shooting a tile will cause several bolts with increased damage to fire - Shooting an enemy will inflict shadowflame + Shooting an enemy will inflict [cbuff:CalamityMod/Shadowflame] ''' } @@ -648,8 +653,8 @@ PrimordialAncient: { Tooltip: ''' Casts five primordial sand blasts that converge at your cursor after a moment and create a giant explosion - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.AeolianEarthBuff.DisplayName} buff - The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/AeolianEarthBuff] buff + [cbuffplr:CalamityMod/AeolianEarthBuff] increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen ''' } @@ -657,9 +662,9 @@ PrimordialEarth: { DisplayName: Primordial Earth Tooltip: ''' - Casts two enchanted blasts of sand that coverge with each other and explode - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.SandsWindBuff.DisplayName} buff - The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen + Casts two enchanted blasts of sand that converge with each other and explode + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/SandsWindBuff] buff + [cbuffplr:CalamityMod/SandsWindBuff] increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' } @@ -709,7 +714,7 @@ RelicofRuin: { RougeSlash: { DisplayName: Rouge Slash - Tooltip: Fires a wave of 3 rouge air slashes + Tooltip: Fires a wave of 3 rouge air slashes that inflict [cbuff:CalamityMod/VermillionFlux] } SandstreamScepter: { @@ -727,7 +732,7 @@ SanguineFlare: { ''' Charges up a sanguine flare that gains power over time When striking an enemy, this flare causes a bloodsplosion and splits into blood orbs - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -781,6 +786,7 @@ SHPC: { {0} Press to use the machine as a vacuum, pulling in lingering souls Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in + Shift- this item in your inventory to eject the currently loaded Soul ''' // These are the soul effect descriptions, the number is the item ID of the soul NoSoul: "[c/808080:There is currently no soul type injected into the weapon]" @@ -821,7 +827,11 @@ SnowstormStaff: { SoulPiercer: { DisplayName: Soul Piercer - Tooltip: Casts a powerful ray that summons extra rays on its first hit + Tooltip: + ''' + Casts a powerful ray that summons extra rays on its first hit + Inflicts [cbuff:CalamityMod/GodSlayerInferno] + ''' } StaffofBlushie: { @@ -831,7 +841,7 @@ StaffofBlushie: { StarShower: { DisplayName: Star Shower - Tooltip: Casts a spread of astral stars from the sky that converge at the cursor + Tooltip: Casts a spread of astral stars from the sky that converge at the cursor and inflict [cbuff:CalamityMod/AstralInfectionDebuff] } SubsumingVortex: { @@ -843,6 +853,7 @@ SubsumingVortex: { When enemies are near the vortex, it sends multiple fast-moving smaller vortices towards them Releasing fires the vortex towards the mouse if enough time has passed Damage scales based on how long the vortex was held out + Inflicts [cbuff:CalamityMod/MiracleBlight] ''' } @@ -859,7 +870,7 @@ TacticiansTrumpCard: { DisplayName: Tactician's Trump Card Tooltip: ''' - Fires a sword beam that electrifies enemies on hit + Fires a sword beam that inflicts [cbuff:Electrified] on hit 'Faint memories of a Princess from the future cross your mind...' ''' } @@ -961,8 +972,8 @@ UnstableCastersGauntlet: { ''' [c/DBD7CA:Ordo] sigils always land critical strikes [c/ABB6D4:Perdito] sigils ignore 25 points of enemy defense - [c/E89B8E:Ignis] sigils inflict Daybroken - [c/8ECBE8:Aqua] sigils inflict Crush Depth + [c/E89B8E:Ignis] sigils inflict [cbuff:CalamityMod/Daybroken] + [c/8ECBE8:Aqua] sigils inflict [cbuff:CalamityMod/CrushDepth] [c/E1E88E:Aer] sigils boast substantial knockback [c/ACCF9F:Terra] sigils split into sharp rocks ''' @@ -1007,7 +1018,7 @@ Viscera: { ''' Fires a rapid barrage of piercing blood beams The first enemy struck by each beam will burst into blood orbs - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Each successive beam in the barrage deals more damage The last beam of the barrage instead explodes upon hitting an enemy ''' @@ -1017,8 +1028,8 @@ VitriolicViper: { DisplayName: Vitriolic Viper Tooltip: ''' - Charges up and fires a slithering beam of radiation - If fully charged, instead fires a huge spread of short range fangs which quickly vanish + Charges up and fires a slithering [cbuff:CalamityMod/Irradiated] beam + If fully charged, instead fires a huge spread of short range fangs which inflict [cbuff:CalamityMod/SulphuricPoisoning] ''' } @@ -1027,8 +1038,8 @@ VividClarity: { Tooltip: ''' Fires five randomized rays of exo-energy towards the cursor - On enemy and tile hits, beams either explode into a big flash, - summon an additonal laser from the sky, or split into energy orbs + Enemy and tile hits either cause a big flash explosion, an additional laser from the sky, or split into energy orbs + Inflicts [cbuff:CalamityMod/MiracleBlight] 'Its majesty inspires a stroke of unparalleled genius' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 55706016b7..ec4d7d4bc6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -166,11 +166,7 @@ BansheeHook: { Basher: { DisplayName: Basher - Tooltip: - ''' - Swings a rotten club that poisons and irradiates enemies on hit - Holding while swinging will increase the club's damage, but will also knock you back on hit - ''' + Tooltip: Swings a rotten club that inflicts [cbuff:CalamityMod/Irradiated] while knocking you back in the process } BladecrestOathsword: { @@ -195,7 +191,11 @@ BlightedCleaver: { Bonebreaker: { DisplayName: Bonebreaker - Tooltip: Fires javelins that stick to enemies before bursting into shrapnel + Tooltip: + ''' + Fires javelins that stick to enemies before bursting into shrapnel + Javelins cause [cbuff:CalamityMod/HeavyBleeding], [cbuff:Venom], and [cbuff:CalamityMod/ArmorCrunch] + ''' } BotanicPiercer: { @@ -270,7 +270,7 @@ Carnage: { CelestialClaymore: { DisplayName: Celestial Claymore - Tooltip: Spawns cosmic energy stars near the cursor that inflict several debuffs + Tooltip: Spawns cosmic energy stars near the cursor that inflict [cbuff:Frostburn2], [cbuff:OnFire3], or [cbuff:Ichor] } ClamCrusher: { @@ -291,8 +291,8 @@ CosmicDischarge: { DisplayName: Cosmic Discharge Tooltip: ''' - Striking an enemy with the whip causes glacial explosions and grants the player the cosmic freeze buff - This buff gives the player +2 HP/s life regen while standing still and freezes enemies near the player + Striking an enemy with the whip causes glacial explosions and grants the player the [cbuffplr:CalamityMod/CosmicFreeze] buff + [cbuffplr:CalamityMod/CosmicFreeze] gives the player +2 HP/s life regen while standing still and freezes enemies near the player ''' } @@ -404,7 +404,7 @@ DragonRage: { DisplayName: Dragon Rage Tooltip: ''' - Twirls a baton that causes explosions on enemy hits + Twirls a baton that causes explosions of [cbuff:CalamityMod/Dragonfire] on enemy hits Every ten hits will summon a ring of fireballs ''' } @@ -420,7 +420,7 @@ Earth: { ''' A beautiful prismatic blade with unrivaled close combat proficiency Heals you greatly on hit - Every other swing will summon three Gaia meteors to fall upon nearby enemies + Every other swing will summon three Gaia meteors to annihilate nearby enemies with [cbuff:CalamityMod/MiracleBlight] 'All Its spawn shall know the beauty and wrath of their creator' ''' } @@ -430,7 +430,7 @@ EarthenPike: { Tooltip: ''' Sprays fossil shards on swing - Crushes enemy defenses + Inflicts [cbuff:CalamityMod/ArmorCrunch] ''' } @@ -458,12 +458,19 @@ EvilSmasher: { DisplayName: Evil Smasher Tooltip: ''' - For every enemy you kill this hammer gains stat bonuses - These bonuses stack until a cap is reached - The bonus stacks will reset if you select a different item - The bonus stacks will be reduced by 1 every time you get hit + Channels a powerful hammer strike with the capability to crush all evil + Striking a tile with the hammer strike will cause an explosion and push you back + Striking enemies inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target + Charging strikes increases damage, explosion radius, and [cbuffplr:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' + //All damage and kill dialogue has the capitalization randomized when said + DamageDialogue0: smash! + DamageDialogue1: evil! + DamageDialogue2: crush! + DamageDialogue3: des.. troy! + KillDialogue0: smash evil! + KillDialogue1: smash.. er! } ExaltedOathblade: { @@ -495,6 +502,7 @@ Exoblade: { Enemy hits from the blade during the dash result in massive damage and a rebound Press immediately after a rebound to perform a powerful slash Powerful slashes are larger, heal you, and create a large explosion + Inflicts [cbuff:CalamityMod/MiracleBlight] ''' } @@ -661,18 +669,16 @@ GrandDad: { TooltipNormal: ''' An unfathomably heavy blade that rips through enemies using its sheer mass - Heals you on hit - Striking weaker enemies will launch them with incredible force - Launched enemies take immense damage when colliding with walls and floors - Holding while swinging will heavily reduce the damage of the blade and increase its launch damage and velocity + Provides healing over time to you and all nearby allies on hit + Striking low health enemies will launch them with incredible force + Launched enemies are killed instantly on impact with walls and floors [c/00B8DF:'How are you swinging something that has half the mass of a star?'] ''' TooltipGFB: ''' A high quality blade that rips through enemies - Striking weaker enemies will yeet them with incredible force, often leaving them Stuck Inside tiles + Striking low health enemies will yeet them with incredible force, nice >:] Yeeted enemies will turn to JAM when SLAMMED into walls and floors - Holding while swinging will heavily reduce the damage of the blade and increase its yeet damage and velocity, nice >:] [c/00B8DF:'Please read the weapon description.'] ''' } @@ -747,7 +753,6 @@ HolyCollider: { Charged swings create four lingering flares that float around the point of impact Striking a flare with an uncharged strike will push it around and extend its lifetime Charged swings can empower flares, turning them into massive fireballs on hit and launching them to your cursor - Holding while swinging will repeatedly do uncharged slashes that create a spread of flames on hit ''' } @@ -760,7 +765,7 @@ InsidiousImpaler: { DisplayName: Insidious Impaler Tooltip: ''' - Throws self-propelling radioactive harpoons which chase foes + Throws self-propelling radioactive harpoons which chase foes and cause [cbuff:CalamityMod/SulphuricPoisoning] Harpoons ricochet at close range for additional hits ''' } @@ -773,7 +778,7 @@ Lacerator: { Striking enemies conjures a bloody saw to shred them The saw does more damage the more often the yoyo hits, and fades away when not striking enemies Enemies touching the edge of the sawblade get blood orbs torn out of them - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] The direction of the saw's spin depends on which direction you originally threw the yoyo [GFB] ''' @@ -791,7 +796,7 @@ Lightspeed: { Tooltip: ''' [c/c7f5ff:Unleash a flurry of stabs which build Elemental Mastery on hit] - [c/c2fff2:Elemental Mastery is lost over time but briefly stops depleting after reaching its maximum] + [c/c2fff2:Elemental Mastery is lost over time if it has not been gained for a few seconds] [c/ffdfba:Press with maximum Elemental Mastery to dash toward your cursor] [c/ffc7c7:Hitting an enemy during the dash refunds some Elemental Mastery] ''' @@ -813,7 +818,7 @@ Lucrecia: { ''' [c/9370db:Fires a spiraling darklight shard when swung] [c/837ce4:Hits with the blade itself build Darklight Energy] - [c/7489ee:Darklight Energy is lost over time but briefly stops depleting after reaching its maximum] + [c/7489ee:Darklight Energy is lost over time if it has not been gained for a few seconds] [c/6495f7:Press with maximum energy to fire a double helix comet] ''' } @@ -873,7 +878,7 @@ MonolithSword: { MonstrousKnives: { DisplayName: Monstrous Knives - Tooltip: Throws a spread of short-range knives that have a chance to heal the user + Tooltip: Throws a spread of short-range knives that heal the user } Mourningstar: { @@ -894,14 +899,14 @@ Murasama: { MycelialClaws: { DisplayName: Mycelial Claws - Tooltip: Grants the Mushy buff for 6 seconds on enemy hits + Tooltip: Grants the [cbuffplr:CalamityMod/Mushy] buff for 6 seconds on enemy hits } Nadir: { DisplayName: Nadir Tooltip: ''' - Fires void essences which flay nearby enemies with tentacles + Fires void essences which flay nearby enemies with [cbuff:CalamityMod/Nightwither] tentacles 'The abyss has stared back at you long enough. It now speaks, and it does not speak softly' ''' } @@ -931,7 +936,7 @@ Oblivion: { OldLordClaymore: { DisplayName: Old Lord Claymore - Tooltip: A slow but powerful blade that sets enemies ablaze and has substantial knockback + Tooltip: A slow but powerful blade that lights enemies with [cbuff:OnFire3] and has substantial knockback HoldShiftTooltip: ''' [c/df4420:A gift to outstanding Demons, a replica of the sword used by the greatest of all Demon Lords.] @@ -1012,7 +1017,7 @@ PhotonRipper: { DisplayName: Photon Ripper Tooltip: ''' - Projects a directed stream of hardlight teeth at ultra high velocity + Projects a directed stream of hardlight teeth at ultra high velocity which cause [cbuff:CalamityMod/MiracleBlight] This weapon and its projectiles function as a chainsaw Press to use without chopping down trees ''' @@ -1060,7 +1065,8 @@ RemsRevenge: { DisplayName: Rem's Revenge Tooltip: ''' - Summons blood explosions and lowers enemy defense by {0} on hit + Summons blood explosions and inflicts [cbuff:CalamityMod/WitherDebuff] on hit + [cbuff:CalamityMod/WitherDebuff] lowers enemy defense by {0} 'A deadly morning star befitting its demonic owner' ''' } @@ -1110,7 +1116,7 @@ SaharaSlicers: { SausageMaker: { DisplayName: Sausage Maker - Tooltip: Sprays homing blood on hit + Tooltip: Sprays homing blood and causes [cbuff:CalamityMod/BurningBlood] on hit } ScourgeoftheCosmos: { @@ -1163,7 +1169,7 @@ SolsticeClaymore: { Tooltip: ''' Changes projectile color based on the time of year - Inflicts daybroken during the day and nightwither during the night + Inflicts [cbuff:CalamityMod/Daybroken] during the day and [cbuff:CalamityMod/Nightwither] during the night ''' } @@ -1172,7 +1178,7 @@ SoulHarvester: { Tooltip: ''' Shoots a soul scythe - Enemies explode when on low health, spreading the plague + Enemies explode when on low health, spreading the [cbuff:CalamityMod/Plague] ''' } @@ -1272,12 +1278,12 @@ Swordsplosion: { TaintedBlade: { DisplayName: Tainted Blade - Tooltip: Inflicts poison on enemy hits + Tooltip: Inflicts [cbuff:Poisoned] on enemy hits } TeardropCleaver: { DisplayName: Teardrop Cleaver - Tooltip: Makes your enemies cry + Tooltip: Gives your enemies [cbuff:CalamityMod/TemporalSadness] } TenebreusTides: { @@ -1314,7 +1320,7 @@ TheBurningSky: { DisplayName: The Burning Sky Tooltip: ''' - Rains down a stream of draconic fire at the cursor + Rains down a stream of [cbuff:CalamityMod/Dragonfire] at the cursor 'Hold the blade to the sky, and witness Armageddon' ''' } @@ -1363,7 +1369,7 @@ TheMutilator: { ''' Striking enemies empowers The Mutilator, increasing its damage At full charge, striking enemies causes a blood orb explosion - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -1383,7 +1389,7 @@ TheOracle: { Tooltip: ''' {$Common.YoyoStatsInfinite} - Emits an aura of lightning which charges up when hitting enemies + Emits an aura of [cbuff:CalamityMod/AuricRebuke] lightning which charges up when hitting enemies Fires auric orbs when supercharged 'Gaze into the past, the present, the future... and the circumstances of your inevitable demise' ''' @@ -1448,7 +1454,7 @@ TrueCausticEdge: { Tooltip: ''' Fires a bouncing caustic beam - Inflicts acid venom and slows down on enemy hits + Inflicts [cbuff:Venom] and slows down on enemy hits ''' } @@ -1512,13 +1518,13 @@ Violence: { ''' A demonic pitchfork, cursed to cause endless bloodshed commands the trident to follow your cursor and shred enemies with devastating speed - throws the trident, violently tearing through enemies with immense power and inflicting Vulnerability Hex + throws the trident, violently tearing through enemies with immense power and inflicting [cbuff:CalamityMod/VulnerabilityHex] ''' } Virulence: { DisplayName: Virulence - Tooltip: Fires a plague cloud + Tooltip: Fires a [cbuff:CalamityMod/Plague] cloud } VoidEdge: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 5a5f9f648a..3afeaa551b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -33,7 +33,7 @@ AngelicShotgun: { DisplayName: Angelic Shotgun Tooltip: ''' - Each shot casts a radiant beam of holy light from the sky + Each shot casts a radiant beam of [cbuff:CalamityMod/HolyFlames] from the sky Musket balls convert into hallow-point rounds which also empower the beam 'Fighting 'til the war's won' ''' @@ -45,8 +45,8 @@ Animosity: { Tooltip: "[GFB]" TooltipNormal: ''' - Fires a shotgun blast with a tight spread which is imbued with Brimstone Flames - Press to fire a powerful brimstone round that inflicts Whispering Death + Fires a shotgun blast with a tight spread which is imbued with [cbuff:CalamityMod/BrimstoneFlames] + Press to fire a powerful brimstone round that causes enemies to become [cbuff:CalamityMod/MarkedforDeath] ''' TooltipGFB: ''' @@ -109,7 +109,7 @@ ArterialAssault: { ''' Fires a group of 5 homing blood arrows These blood arrows burst into blood orbs upon striking an enemy - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -127,7 +127,7 @@ Auralis: { DisplayName: Auralis Tooltip: ''' - Fires a high speed glowing bullet that reduces enemy protection + Fires a high speed glowing bullet that inflicts [cbuff:CalamityMod/MarkedforDeath] Press to zoom out Standing still provides increasing damage bonuses up to 25% Standing still for 5 or more seconds while using the scope ability will summon an aurora @@ -171,7 +171,7 @@ BlightSpewer: { DisplayName: Blight Spewer Tooltip: ''' - Fires clouds of plague nanomachines that stick to tiles + Fires clouds of [cbuff:CalamityMod/Plague] nanomachines that stick to tiles Nanomachines aggressively lock onto nearby enemies {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -182,7 +182,7 @@ BlissfulBombardier: { Tooltip: ''' Launches a crystalline missile high into the sky, raining holy fire on the cursor - The missile relentlessly seeks out a target before bursting into a massive explosion + The missile relentlessly seeks out a target before bursting into a massive [cbuff:CalamityMod/HolyFlames] explosion ''' } @@ -191,7 +191,7 @@ BloodBoiler: { Tooltip: ''' Fires twin streams of bloodfire that returns to you - Returning bloodfire reduces [cbuff:PotionSickness] if it struck an enemy + Returning bloodfire reduces [cbuffplr:PotionSickness] if it struck an enemy Uses your health as ammo 20% chance to save health ''' @@ -236,7 +236,7 @@ Buzzkill: { Tooltip: ''' Hold to rev up a buzzsaw that deals close-range damage - Release to fire the buzzsaw, which bounces off tiles and lacerates foes + Release to fire the buzzsaw, which bounces off tiles and causes [cbuff:CalamityMod/HeavyBleeding] in foes Revving up the saws increases their damage and allows them to pierce more enemies 'Not to be confused with the Sawed-On Shotgun' ''' @@ -244,7 +244,7 @@ Buzzkill: { ChickenCannon: { DisplayName: Chicken Cannon - Tooltip: Fires chicken flares which create enormous incendiary explosions + Tooltip: Fires chicken flares which create enormous incendiary explosions of [cbuff:CalamityMod/Dragonfire] } ChromaticEruption: { @@ -266,7 +266,7 @@ CleansingBlaze: { DisplayName: Cleansing Blaze Tooltip: ''' - Unleashes a torrent of flames which can pass through tiles + Unleashes a torrent of [cbuff:CalamityMod/GodSlayerInferno] flames which can pass through tiles Uses gel for ammo ''' } @@ -328,7 +328,7 @@ CorinthPrime: { CorrodedCaustibow: { DisplayName: Corroded Caustibow - Tooltip: Converts wooden arrows into slow, powerful shells that trail an irradiated aura + Tooltip: Converts wooden arrows into slow, powerful shells that trail an [cbuff:CalamityMod/Irradiated] aura } CrackshotColt: { @@ -384,9 +384,9 @@ DragonsBreath: { DisplayName: Dragon's Breath Tooltip: ''' - Fires dragon fireballs at an accelerating pace + Fires [cbuff:CalamityMod/Dragonfire] fireballs at an accelerating pace Upon firing for long enough, you will begin using a cartridge of energy - While using a cartridge you will shoot a draconic beam of fire that doesn't consume ammo + While using a cartridge you will shoot a draconic beam of [cbuff:CalamityMod/Dragonfire] that doesn't consume ammo Once a cartridge has been ejected you will return to the original fire rate {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -416,7 +416,7 @@ EternalBlizzard: { Eviscerator: { DisplayName: Eviscerator - Tooltip: Converts musket balls into fast-moving blood clots + Tooltip: Converts musket balls into fast-moving blood clots that cause [cbuff:CalamityMod/BurningBlood] } FetidEmesis: { @@ -554,7 +554,7 @@ HavocsBreath: { DisplayName: Havoc's Breath Tooltip: ''' - Projects cone-shaped blasts of scorching brimstone fire + Projects cone-shaped blasts of scorching [cbuff:CalamityMod/BrimstoneFlames] Uses gel for ammo ''' } @@ -563,7 +563,7 @@ HeavenlyGale: { DisplayName: Heavenly Gale Tooltip: ''' - Fires a rapid stream of supercharged exo-crystals + Fires a rapid stream of supercharged exo-crystals that inflict [cbuff:CalamityMod/MiracleBlight] Holding the bow and waiting for some time before firing causes the crystals to become more powerful If the crystals are sufficiently powerful enough they will summon torrents of exo-lightning above whatever target they hit ''' @@ -603,7 +603,7 @@ Hydra: { DisplayName: Hydra Tooltip: ''' - Fires a spread of 4 toxic bullets + Fires a spread of 4 [cbuff:Venom] bullets Grows a gun-head every 3 seconds, up to a maximum of 3 heads Press to command any existing heads to fire Press to launch the heads for powerful explosive damage @@ -616,7 +616,6 @@ Infinity: { Tooltip: ''' Fires a twin stream of energy bolts that split - Press to fire a barrage of normal bullets {$CommonItemTooltip.PercentChanceToSaveAmmo} 'They say infinity is neverending, yet you hold it in your hands' ''' @@ -633,7 +632,7 @@ Kingsbane: { ''' After revving up, rapidly fire bullets When you stop firing you will release a barrage of auric bullets - Auric bullets aggressively home in on enemies and ignore 50 points of defense + Auric bullets aggressively home in on enemies, ignore 50 points of defense, and inflict [cbuff:CalamityMod/AuricRebuke] Constantly consumes ammo while in use {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -644,7 +643,7 @@ Leviatitan: { Tooltip: ''' Fires high velocity aqua blasts - Releases homing aberrations that shred enemy defense every six shots + Releases homing aberrations that cause [cbuff:CalamityMod/ArmorCrunch] every six shots to vomit a meteor that explodes on hit 'The L in LMG stands for Leviathan' ''' @@ -684,7 +683,7 @@ MagnomalyCannon: { DisplayName: Magnomaly Cannon Tooltip: ''' - Launches a powerful exo rocket to nuke anything and everything + Launches a powerful exo rocket to nuke anything and everything with [cbuff:CalamityMod/MiracleBlight] Rockets are surrounded by an invisible damaging aura and split into damaging beams on hit {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -695,7 +694,7 @@ Malevolence: { Tooltip: ''' Fires two arrows at once - Converts wooden arrows into plague arrows that explode into bees + Converts wooden arrows into [cbuff:CalamityMod/Plague] arrows that explode into bees ''' } @@ -885,14 +884,14 @@ PearlGod: { PestilentDefiler: { DisplayName: Pestilent Defiler - Tooltip: Converts musket balls into plague rounds that explode and split apart on hit + Tooltip: Converts musket balls into [cbuff:CalamityMod/Plague] rounds that explode and split apart on hit } Photoviscerator: { DisplayName: Photoviscerator Tooltip: ''' - Emits a continuous beam of exo radiation that disintegrates everything + Emits a continuous beam of [cbuff:CalamityMod/MiracleBlight] radiation that disintegrates everything Press to fire homing exo flares which stick to and incinerate enemies Uses gel for ammo The beam has a {0}% chance to save ammo @@ -903,7 +902,7 @@ PlagueTaintedSMG: { DisplayName: Plague Tainted SMG Tooltip: ''' - Shoots plague bullets that spawn drones on critical hits + Shoots [cbuff:CalamityMod/Plague] bullets that spawn drones on critical hits Bullets deal more damage and knockback the closer the enemy is Drones have a much higher crit chance upon hitting a plagued enemy Press to fire a drone swarm @@ -942,7 +941,7 @@ PridefulHuntersPlanarRipper: { Tooltip: ''' Every fourth shot deals 135% damage - Converts musket balls into lightning bolts + Converts musket balls into [cbuff:Electrified] lightning bolts Lightning bolts travel extremely fast and explode on enemy kills Lightning bolt crits grant a stacking speed boost to the player This stacks up to 20 percent bonus movement speed and acceleration @@ -955,7 +954,7 @@ PristineFury: { DisplayName: Pristine Fury Tooltip: ''' - Fires an intense helix of flames that burst into a column of smoke + Fires an intense helix of [cbuff:CalamityMod/HolyFlames] that burst into a column of smoke to disperse a limited supply of flammable crystalline powder that restores over time Powder can be ignited, causing it to explode for extra damage Both helix flames and other nearby explosions can ignite the powder @@ -1078,7 +1077,7 @@ SepticSkewer: { Tooltip: ''' Launches a vile chained harpoon infested with toxins - Harpoons stick into enemies and inflict Sulphuric Poisoning for a long time + Harpoons stick into enemies and inflict [cbuff:CalamityMod/SulphuricPoisoning] for a long time After being impaled for one second, harpoons rip themselves back out and spray damaging gores Press to manually rip out all harpoons, dealing bonus damage Enemies close to death are dragged back with returning harpoons and executed when they reach you @@ -1090,7 +1089,7 @@ Shadethrower: { DisplayName: Shadethrower Tooltip: ''' - Spits clouds of shade which afflict enemies with brain rot + Spits clouds of shade which afflict enemies with [cbuff:CalamityMod/BrainRot] Uses gel for ammo ''' } @@ -1121,7 +1120,6 @@ Shredder: { Tooltip: ''' Fires a barrage of energy bolts that split and bounce - Press to fire a barrage of normal bullets instead 'The myth, the legend, the weapon that drops more frames than any other' ''' } @@ -1151,10 +1149,10 @@ SomaPrime: { Tooltip: ''' This weapon can supercrit if its crit chance is over 100% - All bullets fired have a 5% chance to inflict Shred, a stacking bleed debuff - Critical strikes deal 3x damage instead of 2x by default and have a 30% chance to inflict Shred - Shred deals 600 DPS per stack and scales with your ranged stats - Damage ticks of Shred can critically strike for 3x damage and can supercrit + All bullets fired have a 5% chance to inflict [cbuff:CalamityMod/Shred], a stacking bleed debuff + Critical strikes deal 3x damage instead of 2x by default and have a 30% chance to inflict [cbuff:CalamityMod/Shred] + [cbuff:CalamityMod/Shred] deals 600 DPS per stack and scales with your ranged stats + Damage ticks of [cbuff:CalamityMod/Shred] can critically strike for 3x damage and can supercrit Replaces musket balls with enhanced High Velocity Bullets {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -1264,7 +1262,7 @@ SulphuricAcidCannon: { Tooltip: ''' Fires homing Acid Rockets - Acid Rockets stick to enemies and explode into toxic mist after a short delay + Acid Rockets stick to enemies and explode into [cbuff:CalamityMod/SulphuricPoisoning] mist after a short delay ''' } @@ -1280,6 +1278,7 @@ SuperradiantSlaughterer: { ''' Hold to rev up an elemental buzzsaw that deals close-range damage Release to fire the buzzsaw which bounces off tiles, releasing homing bolts when returning depending on hits + Buzzsaws inflict [cbuff:CalamityMod/ElementalMix] and [cbuff:CalamityMod/Laceration] Revving up the saw increases its damage and allows it to pierce more enemies ''' AltInfo: @@ -1304,7 +1303,6 @@ Svantechnical: { Tooltip: ''' Fires a trinity of energy bolts that split into beams that track your cursor - Press to fire a barrage of normal bullets {$CommonItemTooltip.PercentChanceToSaveAmmo} 'The age old balance of trading damage for frames' ''' @@ -1335,7 +1333,7 @@ TelluricGlare: { TheBallista: { DisplayName: The Ballista - Tooltip: Converts wooden arrows into greatarrows that crush enemy armor and break into shards + Tooltip: Converts wooden arrows into greatarrows that cause [cbuff:CalamityMod/ArmorCrunch] and break into shards } TheBlunderbass: { @@ -1351,9 +1349,9 @@ TheHive: { DisplayName: The Hive Tooltip: ''' - Launches a wide spread of 4 missiles that explode on contact with enemies and tiles + Launches a wide spread of 4 [cbuff:CalamityMod/Plague] missiles that explode on contact with enemies and tiles Charging the launcher decreases the spread and increases the velocity of the missile barrage - Fully charging the launcher will cause it to fire a nuke to decimate a massive area on impact + Fully charging the launcher will cause it to fire a [cbuff:CalamityMod/Plague] nuke to decimate a massive area on impact ''' } @@ -1364,7 +1362,7 @@ TheJailor: { TheMaelstrom: { DisplayName: The Maelstrom - Tooltip: Fires charged Reaper Sharks that explode into water + Tooltip: Fires charged Reaper Sharks that cause [cbuff:CalamityMod/HadopelagicPressure] water explosions } ThePack: { @@ -1376,7 +1374,7 @@ ThermoclineBlaster: { DisplayName: Thermocline Blaster Tooltip: ''' - Alternates between firing bullets imbued with fire and ice + Alternates between firing bullets imbued with [cbuff:OnFire3] and [cbuff:Frostburn2] Any bullet type can be imbued when fired from this gun ''' } @@ -1426,7 +1424,7 @@ TitaniumRailgun: { Toxibow: { DisplayName: Toxibow - Tooltip: Converts wooden arrows into slow arrows that inflict irradiated + Tooltip: Converts wooden arrows into slow arrows that inflict [cbuff:CalamityMod/Irradiated] } TyrannysEnd: { @@ -1434,7 +1432,7 @@ TyrannysEnd: { Tooltip: ''' Converts musket balls into .70 caliber sniper rounds that deal devastating damage - Inflicts Marked for Death on enemy hits and bypasses defense + Inflicts [cbuff:CalamityMod/MarkedforDeath] on enemy hits and bypasses defense Critical hits summon a swarm of 6 additional bullets 'Pierce the heart of even the most heavily-armored foe' ''' @@ -1445,8 +1443,7 @@ Ultima: { Tooltip: ''' Casts a continuous stream of plasma bolts - Over time the bolts are replaced with powerful lasers - Bolts power up into solid beams as you continue shooting + Over time bolts power up into solid beams that inflict [cbuff:CalamityMod/ElementalMix] as you continue shooting {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1474,7 +1471,7 @@ Voidragon: { DisplayName: Voidragon Tooltip: ''' - Fires void blasts that explode every other shot + Fires [cbuff:CalamityMod/Voidfrost] blasts that explode every other shot Shoots demon flame tentacles alongside every shot Void blasts consume no ammo and bullets have a {0}% chance to save ammo ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index a3aaa437db..79545b4952 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -47,8 +47,8 @@ BallisticPoisonBomb: { DisplayName: Ballistic Poison Bomb Tooltip: ''' - Throws a sticky bomb that explodes into spikes and venomous clouds - Stealth strikes erupt into more clouds with a longer lasting venom + Throws a sticky bomb that explodes into spikes and [cbuff:Venom] clouds + Stealth strikes erupt into more clouds with a longer lasting [cbuff:Venom] ''' } @@ -79,7 +79,7 @@ BloodsoakedCrasher: { Throws a bloody axe that is affected by gravity and can bounce twice The axe speeds up over time, but will slow down upon hitting an enemy Spews blood orbs upon enemy hits - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Stealth strikes spawn homing blood bolts on hit ''' } @@ -107,7 +107,7 @@ BurningStrife: { DisplayName: Burning Strife Tooltip: ''' - Throws a shadowflame spiky ball that explodes into flames + Throws a [cbuff:CalamityMod/Shadowflame] spiky ball that explodes into flames Stealth strikes make the ball erupt into tentacles on hit 'Definitely not pocket safe' ''' @@ -157,7 +157,7 @@ ContaminatedBile: { DisplayName: Contaminated Bile Tooltip: ''' - Throws a flask of irradiated bile which shatters and lingers in a cloud + Throws a flask of [cbuff:CalamityMod/Irradiated] bile which shatters and lingers in a cloud Stealth strikes cause sulphuric bubbles to quickly rise from the cloud ''' } @@ -259,8 +259,8 @@ CursedDagger: { DisplayName: Cursed Dagger Tooltip: ''' - Throws a fast cursed dagger and two inaccurate weaker daggers - Stealth strikes throw a single dagger that bursts into a vortex of cursed flames + Throws a fast cursed dagger and two inaccurate weaker daggers that inflict [cbuff:CursedInferno] + Stealth strikes throw a single dagger that bursts into a [cbuff:CursedInferno] vortex ''' } @@ -278,7 +278,7 @@ DeepWounder: { DisplayName: Deep Wounder Tooltip: ''' - Throws an abyssal hatchet that inflicts Heavy Bleeding and Crush Depth to the enemies it hits + Throws an abyssal hatchet that inflicts [cbuff:CalamityMod/HeavyBleeding] and [cbuff:CalamityMod/CrushDepth] to the enemies it hits Stealth strikes cause the hatchet to stick to struck enemies, releasing a barrage of water projectiles Water projectiles launch at the closest enemy after a brief delay ''' @@ -299,7 +299,7 @@ DesecratedWater: { Tooltip: ''' Throws an unholy flask of water that explodes into an explosion of evil bubbles - Stealth strikes spawn additional bubbles that inflict Ichor and Cursed Inferno + Stealth strikes spawn additional bubbles that inflict [cbuff:Ichor] and [cbuff:CursedInferno] ''' } @@ -378,7 +378,7 @@ EpidemicShredder: { DisplayName: Epidemic Shredder Tooltip: ''' - Throws a plagued boomerang that releases plague seekers when it hits tiles or enemies + Throws a [cbuff:CalamityMod/Plague] boomerang that releases plague seekers when it hits tiles or enemies Stealth strikes cause the boomerang to release plague seekers constantly as it travels Contrary to its name, it will probably cause an epidemic if used incorrectly ''' @@ -388,7 +388,7 @@ Equanimity: { DisplayName: Equanimity Tooltip: ''' - Throws a confusing boomerang that ricochets between enemies + Throws a boomerang that ricochets between enemies and makes them [cbuff:Confused] Enemy hits alternate summoning homing light shards or piercing dark shards Stealth strikes cause an alternating explosion of light or dark on every ricochet, empowering the opposite color of shard ''' @@ -398,7 +398,7 @@ ExecutionersBlade: { DisplayName: Executioner's Blade Tooltip: ''' - Throws a stream of homing blades + Throws a stream of homing blades that inflict [cbuff:CalamityMod/GodSlayerInferno] Stealth strikes summon a guillotine of blades on hit ''' } @@ -477,7 +477,7 @@ GelDart: { DisplayName: Gel Dart Tooltip: ''' - Throws bouncing gel darts that cover struck enemies in slime + Throws bouncing gel darts that cover enemies in [cbuff:Slimed] Stealth strikes ignore gravity, bounce more vigorously, and constantly leak slime ''' } @@ -537,7 +537,7 @@ GraveGrimreaver: { Hurls a cursed scythe which homes in The scythe summons skulls as it flies and explodes into bats on hit Stealth strikes spawn a flood of bats and falling skulls when destroyed - Inflicts cursed flames and confusion + Inflicts [cbuff:CursedInferno] and [cbuff:Confused] 'A dapper skeleton's weapon of choice' ''' } @@ -593,7 +593,7 @@ IchorSpear: { DisplayName: Ichor Spear Tooltip: ''' - Throws a high-velocity ichor tipped javelin that pierces through enemies + Throws a high-velocity [cbuff:Ichor] tipped javelin that pierces through enemies Stealth strikes impale enemies and deal repeated damage ''' } @@ -612,7 +612,7 @@ InfestedClawmerang: { Tooltip: ''' Fires a slow, long-ranged boomerang - Stealth strikes grant the Mushy buff to the user on enemy hits and summon homing spores + Stealth strikes grant the [cbuffplr:CalamityMod/Mushy] buff to the user on enemy hits and summon homing spores ''' } @@ -629,9 +629,9 @@ JawsOfOblivion: { DisplayName: Jaws of Oblivion Tooltip: ''' - Throws a tight spread of six venomous reaper teeth that stick in enemies - This venom can stack when more teeth are stuck in an enemy - Stealth strikes cause the teeth to emit a crushing shockwave on impact + Throws a tight spread of six reaper teeth with [cbuff:Venom] that stick in enemies + The [cbuff:Venom] can stack when more teeth are stuck in an enemy + Stealth strikes cause the teeth to emit a crushing [cbuff:CalamityMod/HadopelagicPressure] shockwave on impact 'You're gonna need a bigger boat' ''' } @@ -688,8 +688,8 @@ Lionfish: { DisplayName: Lionfish Tooltip: ''' - Sticks to enemies and injects a potent venom - This venom can stack when more lionfish are stuck in an enemy + Sticks to enemies and injects a potent [cbuff:Venom] + The [cbuff:Venom] can stack when more lionfish are stuck in an enemy Stealth strikes spawn homing urchin spikes as they travel ''' } @@ -698,7 +698,7 @@ LunarKunai: { DisplayName: Lunar Kunai Tooltip: ''' - Throws out a set of three kunai that ignore gravity and slightly home in on enemies + Throws out a set of three kunai that ignore gravity and slightly home in on enemies, inflicting [cbuff:CalamityMod/Nightwither] After traveling enough distance, the kunai supercharge with lunar energy, homing in far more aggressively and exploding on impact Stealth strikes instantly throw ten supercharged Kunai ''' @@ -708,7 +708,7 @@ Malachite: { DisplayName: Malachite Tooltip: ''' - Throws a stream of kunai that stick to enemies and explode + Throws a stream of kunai that stick to enemies and explode into [cbuff:CalamityMod/Plague] Press to throw a single kunai that pierces, after piercing an enemy it emits a massive explosion on the next enemy hit Stealth strikes fire three kunai that home in, stick to enemies, and explode ''' @@ -773,13 +773,13 @@ Mycoroot: { ''' Fires a stream of short-range fungal roots Stealth strikes spawn an explosion of fungi spores - This grants you and nearby players on your team the Mushy buff for 15 seconds + This grants you and nearby players on your team the [cbuffplr:CalamityMod/Mushy] buff for 15 seconds ''' } MythrilKnife: { DisplayName: Mythril Knife - Tooltip: Stealth strikes are coated in deadly toxins, inflicting irradiated, poison, and acid venom + Tooltip: Stealth strikes are coated in deadly toxins, inflicting [cbuff:CalamityMod/Irradiated], [cbuff:Poisoned], and [cbuff:Venom] } NanoblackReaper: { @@ -847,7 +847,7 @@ Plaguenade: { DisplayName: Plaguenade Tooltip: ''' - Releases a swarm of angry plague bees + Releases a swarm of angry [cbuff:CalamityMod/Plague] bees Stealth strikes spawn more bees and generate a larger explosion ''' } @@ -975,8 +975,8 @@ ScourgeoftheSeas: { DisplayName: Scourge of the Seas Tooltip: ''' - Snaps apart into irradiated clouds upon striking an enemy - Stealth strikes irradiate for longer and are additionally coated with venomous toxins + Snaps apart into [cbuff:CalamityMod/Irradiated] clouds upon striking an enemy + Stealth strikes cause a longer [cbuff:CalamityMod/Irradiated] and are additionally coated with [cbuff:Venom] ''' } @@ -1068,8 +1068,8 @@ SnapClam: { DisplayName: Snap Clam Tooltip: ''' - Can latch on enemies and deal damage over time - Stealth strikes throw five clams at once that cause increased damage over time + Can latch on enemies and inflict [cbuff:CalamityMod/SnapClamDebuff] + Stealth strikes throw five clams at once ''' } @@ -1098,7 +1098,7 @@ SpentFuelContainer: { ''' Throws a fuel container with trace amounts of plutonium that causes a nuclear explosion The explosion does not occur if there are no tiles below it - Stealth strikes leave a lingering irradiated zone after the explosion dissipates + Stealth strikes leave a lingering [cbuff:CalamityMod/Irradiated] zone after the explosion dissipates 'War Never Changes' ''' } @@ -1107,7 +1107,7 @@ SporeKnife: { DisplayName: Spore Knife Tooltip: ''' - Throws an overgrown dagger that bursts into a cloud of poisonous spores + Throws an overgrown dagger that bursts into a cloud of [cbuff:Poisoned] spores Stealth strikes erupt into hungry homing buds that stick to enemies and gnaw them ''' } @@ -1137,7 +1137,7 @@ StormfrontRazor: { DisplayName: Stormfront Razor Tooltip: ''' - Throws a knife that summons lightning on hit + Throws a knife that summons [cbuff:CalamityMod/StaticDischarge] lightning on hit Stealth strikes cause the knife to be faster and summon multiple lightning bolts on hit [c/24C7F0:'Strike and stem the flow'] ''' @@ -1158,7 +1158,7 @@ Supernova: { ''' Tosses a smart bomb that locks onto and tracks targets If no target is found it will return to you - Each bomb creates a miniature supernova that drags in weak enemies and chases strong enemies + Each bomb creates a miniature [cbuff:CalamityMod/MiracleBlight] supernova that drags in weak enemies and chases strong enemies Stealth strikes create a blast that shakes the foundations of reality itself ''' } @@ -1206,10 +1206,10 @@ TheOldReaper: { DisplayName: The Old Reaper Tooltip: ''' - Throws an irradiated scythe that cuts through enemies + Throws a [cbuff:CalamityMod/SulphuricPoisoning] scythe that cuts through enemies Deposits unstable isotopes on hit, which create delayed nuclear explosions when they decay Stealth strikes are thrown into the sky and fall upon enemies a few seconds later - On hit, stealth strikes create a focused deluge of acid rain + On hit, stealth strikes create a focused deluge of [cbuff:CalamityMod/SulphuricPoisoning] acid rain ''' } @@ -1218,8 +1218,8 @@ TheSyringe: { Tooltip: ''' Throws a high velocity syringe that increases damage as it travels - Shatters into glass and plague cinders on impact - Stealth strikes also shatter into plague bees + Shatters into glass and [cbuff:CalamityMod/Plague] cinders on impact + Stealth strikes also shatter into [cbuff:CalamityMod/Plague] bees 'I'm pretty sure this isn't healthy' ''' } @@ -1237,7 +1237,7 @@ TimeBolt: { DisplayName: Time Bolt Tooltip: ''' - Throws a temporal knife that distorts time around enemies + Throws a temporal knife that causes [cbuff:CalamityMod/TimeDistortion] around enemies Stealth strikes can hit more enemies and create a larger time field 'There should be no boundary to human endeavor' ''' @@ -1258,7 +1258,7 @@ TotalityBreakers: { Tooltip: ''' Explodes into highly flammable black tar - Black tar oils enemies and sets them alight + Black tar makes enemies [cbuff:Oiled] and lights them with [cbuff:OnFire3] Stealth strikes leak black tar as they fly 'I need a bigger breaker' ''' @@ -1268,8 +1268,8 @@ ToxicantTwister: { DisplayName: Toxicant Twister Tooltip: ''' - Throws a fan of four spinning disks that swirl around your cursor - Stealth strikes swirl in a wider range and create a vortex of toxic raindrops that home in on enemies + Throws a fan of four spinning disks that swirl around your cursor and inflict [cbuff:CalamityMod/SulphuricPoisoning] + Stealth strikes swirl in a wider range and create a vortex of [cbuff:CalamityMod/SulphuricPoisoning] raindrops that home in on enemies ''' } @@ -1287,7 +1287,7 @@ TwistingThunder: { DisplayName: Twisting Thunder Tooltip: ''' - Fires a lightning bolt to electrocute enemies + Fires an [cbuff:Electrified] lightning bolt to electrocute enemies The lightning bolt travels faster while it is raining Summons lightning from the sky on impact Stealth strikes summon more lightning and travel faster @@ -1298,9 +1298,9 @@ UrchinStinger: { DisplayName: Urchin Stinger Tooltip: ''' - Sticks into enemies and injects an extremely potent poison - Stealth strikes stick into and poison enemies for longer - Sticking seven stingers in an enemy with a stealth strike stuck in it spawns an irradiated blast + Sticks into enemies and injects an extremely potent [cbuff:Poisoned] effect + Stealth strikes stick into and make enemies [cbuff:Poisoned] for longer + Sticking seven stingers in an enemy with a stealth strike stuck in it spawns an [cbuff:CalamityMod/Irradiated] blast ''' } @@ -1308,8 +1308,8 @@ UtensilPoker: { DisplayName: Utensil Poker Tooltip: ''' - Fires utensils in bursts of three - Stealth strikes replace any utensil with a powerful butcher knife + Fires utensils in bursts of three that cause [cbuff:CalamityMod/HeavyBleeding] + Stealth strikes replace any utensil with a powerful butcher knife that causes [cbuff:CalamityMod/Laceration] 'Space chickens, that is all' ''' } @@ -1349,7 +1349,7 @@ WebBall: { DisplayName: Web Ball Tooltip: ''' - Throws a web-covered ball that covers enemies in cobwebs to slow them down + Throws a web-covered ball that gets enemies [cbuff:Webbed] and slows them down Stealth strikes slow enemies down longer ''' } @@ -1370,7 +1370,7 @@ Wrathwing: { DisplayName: Wrathwing Tooltip: ''' - Throws an agile, homing winged spear that constantly spits fire + Throws an agile, homing winged spear of [cbuff:CalamityMod/Dragonfire] that constantly spits fire Stealth strikes create an eruption of cinders on hit ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 21a0c5eb27..b4cf866c6f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -73,7 +73,7 @@ AtlasMunitionsBeacon: { BelladonnaSpiritStaff: { DisplayName: Belladonna Spirit Staff - Tooltip: Summons a cute forest spirit that flings magical toxic petals + Tooltip: Summons a cute forest spirit that flings magical [cbuff:Poisoned] petals } BlackHawkRemote: { @@ -91,7 +91,7 @@ BorealisBomber: { Tooltip: ''' Summons aureus bombers to chase down your enemies - Aureus bombers explode violently on enemy impact + Aureus bombers explode violently on enemy impact, inflicting [cbuff:CalamityMod/AstralInfectionDebuff] Does not consume minion slots ''' } @@ -103,7 +103,7 @@ BrittleStarStaff: { Summons a small brittle starfish that will dash through enemies until it shatters Starfish will quickly regenerate after shattering Holding will swap starfish between dashing and circling you - When the starfish are circling, each one provides you with 4 defense + When the starfish are circling, each one provides you with {0} defense ''' } @@ -205,7 +205,7 @@ CosmicImmaterializer: { Tooltip: ''' Summons a cosmic energy spiral to fight for you - The orb will fire swarms of homing energy bolts when enemies are detected by it + The orb will fire swarms of homing energy bolts that cause [cbuff:CalamityMod/MiracleBlight] Requires 10 minion slots to use and there can only be one energy spiral ''' } @@ -292,7 +292,7 @@ DormantBrimseeker: { ''' Summons a brimseeker to keep you company Firing another brimseeker when all minion slots are filled summons a brimstone aura - The aura empowers your brimseeker summons and produces damaging fireballs + The aura empowers your brimseeker summons and produces damaging [cbuff:CalamityMod/BrimstoneFlames] fireballs Only one aura can persist at a time You could've sworn that they turned even scarier when you looked at their reflections in a mirror ''' @@ -304,7 +304,7 @@ DragonbloodDisgorger: { ''' Summons a skeletal dragon and her two children Baby spits burst into blood orbs upon hitting an enemy - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Requires 6 minion slots to be summoned There can only be one family at a time ''' @@ -401,7 +401,7 @@ FlowersOfMortality: { DisplayName: Flowers of Mortality Tooltip: ''' - Summons five rainbow flowers over your head + Summons five rainbow flowers over your head that inflict [cbuff:CalamityMod/ElementalMix] The combined flowers consume three minion slots ''' } @@ -514,7 +514,7 @@ InfectedRemote: { Summons a humanoid-hybrid Plaguebringer, codenamed 'Virili', to aid you in battle Virili requires 3 minion slots to summon, and can only be summoned once Virili uses a variety of attacks which she cycles through on a timer - All attacks spread the plague, as was her original design intention + All attacks spread the [cbuff:CalamityMod/Plague], as was her original design intention 'There's a single label on the back: [c/1FFBFF:WARNING: Subject is extremely corrosive and contagious. Avoid direct contact.'] ''' @@ -599,7 +599,7 @@ OrthoceraShell: { Tooltip: ''' {$CommonItemTooltip.Sentry} - Summons a flying orthocera to spit acid streams at your enemies + Summons a flying orthocera to spit [cbuff:CalamityMod/Irradiated] and [cbuff:Venom] streams at your enemies ''' } @@ -652,7 +652,7 @@ RustyBeaconPrototype: { Tooltip: ''' {$CommonItemTooltip.Sentry} - Summons a long-abandoned drone that passively emits irradiated waves + Summons a long-abandoned drone that passively emits [cbuff:CalamityMod/Irradiated] waves ''' } @@ -662,7 +662,7 @@ SanctifiedSpark: { ''' {$CommonItemTooltip.Sentry} Summons a friendly immolator that will float towards you - Immolators rapidly fire homing flares at nearby enemies, before continuing to float near you again + Immolators rapidly fire homing flares of [cbuff:CalamityMod/HolyFlames] at nearby enemies, before continuing to float near you again After firing, Immolators will fire one healing bolt at you for every 4 summon slots you have 'They might be a bit clingy, but at least they're warm' ''' @@ -704,7 +704,7 @@ ShellfishStaff: { DisplayName: Shellfish Staff Tooltip: ''' - Summons a shellfish to fight for you + Summons a shellfish to latch onto enemies and inflict [cbuff:CalamityMod/ShellfishClaps] Each shellfish takes 2 minion slots ''' } @@ -876,7 +876,7 @@ ViridVanguard: { Alternates between summoning axes and swords, both laced with a powerful poison Axes orbit the player, dealing high damage at a close range Swords chase down enemies with extreme precision, tearing them to shreds - All weapons inflict [cbuff:CalamityMod/Sage Poison], which becomes more powerful the more weapons are summoned + All weapons inflict [cbuff:CalamityMod/SagePoison], which becomes more powerful the more weapons are summoned When all minion slots are full, again to spin up a flurry of slashes aimed at your cursor This ability has a five-second cooldown that requires holding this item Shift- this item in your inventory to change the rotation direction @@ -887,11 +887,11 @@ VoidConcentrationStaff: { DisplayName: Void Concentration Staff Tooltip: ''' - Summons a foreboding aura that attacks by firing void orbs - Minion damage is increased by 5% while the aura is active - Requires three minion slots to use - There can only be one aura at a time - to launch a black hole that grows in size + Surrounds you with dark energy, which makes all attacks deal 15% less damage + to condense the energy onto a target, focusing your minions on them and creating homing beams + When the focused enemy takes damage from any source, they will be struck by additional dark energies + These dark energy are twice as strong when the strike was from a minion or sentry + After 10 seconds, the dark energy will resume orbiting you ''' } @@ -920,7 +920,7 @@ WitherBlossomsStaff: { DisplayName: Wither Blossoms Staff Tooltip: ''' - Summons four decaying flowers over your head + Summons four decaying [cbuff:CalamityMod/Plague] flowers over your head The combined flowers consume two minion slots ''' } @@ -932,7 +932,7 @@ WulfrumController: { Summons a wulfrum droid to fight for you Hold while holding the remote to switch all of your drones between regular and supercharge mode Supercharged droids will stop attacking and focus wulfrum energy onto you - Supercharged droids provide +0.5 HP/s life regen and 3 defense per droid + Supercharged droids provide +{0} HP/s life regen and {1} defense per droid Can also be used to heal other players by keeping your mouse cursor close enough to them ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index 9a4e9142f1..a93cf238be 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -2,7 +2,7 @@ Aestheticus: { DisplayName: Aestheticus Tooltip: ''' - Fires crystals that explode and slow enemies down + Fires crystals that explode and inflict [cbuff:CalamityMod/Vaporfied] This weapon scales with all your damage stats at once ''' } @@ -14,8 +14,8 @@ ClaretCannon: { Fires a hypercondensed claret round The round explodes upon striking an enemy and releases blood orbs The explosion shreds enemies, inflicting [cbuff:CalamityMod/Laceration] and dramatically reducing their defense - Picking up the blood orbs will reduce [cbuff:PotionSickness] when possible - If you do not have [cbuff:PotionSickness], your natural regeneration will be enhanced + Picking up the blood orbs will reduce [cbuffplr:PotionSickness] when possible + If you do not have [cbuffplr:PotionSickness], your natural regeneration will be enhanced Can only fire once every 10 seconds ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index 8c950f3fd4..b139893fdb 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -16,3 +16,4 @@ TransformerHotKey.DisplayName: Transformer Hot Key GravitySwapOverride.DisplayName: Gravity Swap Override ExpandDebuffInfo.DisplayName: See Debuff Information ThePointerLock.DisplayName: The Pointer Lock On +SpringStoolJumpHotKey.DisplayName: Spring Stool Jump Hotkey diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 12a58c2e4b..da3390cf62 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -514,7 +514,7 @@ SeaKing: { DoGDefeated3: The Devourer of Gods is truly an enigma. Some say it's not even from this world at all. What is known is that he is a being that can devour the essence of gods entirely, leaving absolutely nothing left. It's no wonder Yharim recruited that monster. PolterghastDefeated1: The Abyss holds many secrets revealed with time. Checking it out again may not be a bad idea. PolterghastDefeated2: Ah... I can sense a powerful change in the weather. You may want to venture to the Sulphurous Seas once more during the rain to experience it. - ProvidenceDefeated1: The Rune of Kos holds a significant portion of Providence's brand of magic, easily distinguishable from all others. Activating it in certain places would have some... risky consequences. + ProvidenceDefeated1: The Mark of Providence holds a significant portion of her brand of magic, easily distinguishable from all others. Activating it in certain places would have some... risky consequences. ProvidenceDefeated2: I do wonder what has happened to Braelor and Statis. I have heard or seen very little of either. In my days, both were great heroes to those who worshiped the gods. Have they been killed, captured, or are they simply in hiding? MoonLordDefeated1: Your adventure focuses to the jungle it seems. The Dragonfolly and its swarming offspring should be eliminated before their numbers spiral out of control. MoonLordDefeated2: Profaned creatures now lurk in the Hallow and in Hell. If you destroy enough and gather their essence together you shall be able to capture the attention of the Profaned Guardians. diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index d0515c4a86..460f796ac8 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -288,3 +288,7 @@ WyvernFeatherPurple.DisplayName: Feather WyvernProjectile.DisplayName: Wyvern YharimsCrystalBeam.DisplayName: Yharim's Beam 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.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index bb4a5def16..7586da81d3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -311,3 +311,4 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +EvilSmasherProjectile.DisplayName: Evil Smasher diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 7d68549da7..11c64b5d92 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -67,7 +67,6 @@ DrizzlefishFire.DisplayName: Drizzlefish Flames DrizzlefishFireball.DisplayName: Drizzlefish Fireball DrizzlefishFireSplit.DisplayName: Drizzlefish Flames DryadsTearMain.DisplayName: Dryad's Tear -DryadsTearSplit.DisplayName: Dryad's Tear ElysianArrowProj.DisplayName: Elysian Arrow ElysianArrowRain.DisplayName: Elysian Light EmesisGore.DisplayName: Rotten Gore diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 5d761dc64b..ac3e08848f 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 diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 6877f85cf9..1d481724b0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -315,9 +315,11 @@ VengefulSunSpiritMinion.DisplayName: Vengeful Sun Spirit VileFeederProjectile.DisplayName: Eater of Souls Mini VileFeederSummon.DisplayName: Baby Eater ViridVanguardBlade.DisplayName: Vanguard Blade -VoidConcentrationAura.DisplayName: Concentrated Void Aura -VoidConcentrationBlackhole.DisplayName: Black Hole -VoidConcentrationOrb.DisplayName: Void Orb +VoidConcentrationSummonTagProj.DisplayName: Dark Energy Vortex +VoidConcentrationBeam.DisplayName: Concentrated Beam +VoidConcentrationDarkEnergy.DisplayName: Orbiting Dark Energy +VoidConcentrationMinion.DisplayName: Void Concentration Minion +VoidConcentrationMark.DisplayName: Void Concentration Mark VoidEaterMarionetteProjectile.DisplayName: Void Eater Marionette VolcanicFireballSummon.DisplayName: Volcanic Fireball WaterElementalMinion.DisplayName: Anahita diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 4521bdd13e..0fc9ab152c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -1,4 +1,3 @@ -AbaddonCrit.DisplayName: Brimstone Blast AeroExplosive.DisplayName: Aeroboom AllianceTriangle.DisplayName: Alliance Triangle AmuletEnergy.DisplayName: Sea Spirit @@ -43,7 +42,6 @@ CursorProjSplit.DisplayName: Aestheticus Crystal CyanLabSeeker.DisplayName: Seeking Mechanism DarkIce.DisplayName: Dark Ice DeepseaBlaze.DisplayName: Deepsea Blaze -DemonshadeRedDevil.DisplayName: Red Devil DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit DirectStrike.DisplayName: Nondescript Damaging Entity @@ -137,8 +135,10 @@ SkyFlareFriendly.DisplayName: Flare SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye -StandingFire.DisplayName: Flame +SpringStoolFX.DisplayName: Spring Stool +StandingFire.DisplayName: Calamitous Flame StarStruckWaterBottle.DisplayName: Bottle +StepStoolBonusFX.DisplayName: Step Stool Bonus StickyFeatherAero.DisplayName: Feather StomperSlam.DisplayName: Stomper Slam SuicideBomberDemon.DisplayName: Demon @@ -148,6 +148,7 @@ TarraEnergy.DisplayName: Tarra Energy TarragonAura.DisplayName: Tarragon Aura TatteredFairyDust.DisplayName: Tattered Fairy Dust TeslaAura.DisplayName: Tesla's Electricity +TileSlamDamage.DisplayName: Grand Damage TitanHeartBoom.DisplayName: Titan Heart Boom TransformerAura.DisplayName: Transformer Aura TransformerBlob.DisplayName: Transformer Shard @@ -169,7 +170,7 @@ WulfrumDiggingTurtleProjectile.DisplayName: Digging Turtle WulfrumHook.DisplayName: Wulfrum Slingshot WulfrumLureSignal.DisplayName: Signal YellowLabSeeker.DisplayName: Seeking Mechanism -VoidofExtinctionCrit.DisplayName: Void of Extinction Crit XykDeathAnim.DisplayName: Xyk Death Animation XykWings.DisplayName: Xyk Wings StratusBlackHole.DisplayName: Stratus Singularity +DebuffSpreadEffect.DisplayName: Debuff Spread Effect diff --git a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index 3b293f65f6..e9a1183133 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -130,6 +130,8 @@ PermafrostSecondBirbSwarmText: I must say, those birds earlier were rather cute! PermafrostNonchalantText: I must say, I am not the mage I used to be. This is starting to tire my old body... PermafrostBruhText: Ha! Just kidding! Watch what happens when I cast a spell I know! PermafrostGiveUpText: Gah, I think I pulled a muscle! Ah, well. I seems that I must concede. Well fought! +// Primordial Wyrm +PrimordialWyrmSpawn: The chaotic teleportation energy enrages an abyssal behemoth... // April Fools AprilFools: The LORDE is approaching... AprilFoolsGFB: La Ruga is approaching... diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index c912701a81..92531f5615 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -151,9 +151,11 @@ Cooldowns: { SpongeDurability: Sponge Barrier Durability SpongeRecharge: Sponge Barrier Recharge Starburst: Stratus Starbursts + Stooldown: Stooldown SuperradiantSawBoost: Superradiant Saw Boost TarragonCloak: Tarragon Cloak Cooldown TarragonImmunity: Tarragon Immunity Cooldown + TransformerCooldown: The Transformer Cooldown UniverseSplitter: Universe Splitter Cooldown WarbanneroftheRighteousBuff: Warbanner Strength WardingWave: Warding Wave Cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 4fe4d6f239..bcc871f221 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -2,9 +2,9 @@ SetBonus: { Adamantite: { $parentVal: ''' - Half of your current DR is added to your critical strike chance - Continuously doing damage makes you gradually gain more and more defense, up to a maximum of {0} - When not doing damage, this bonus gradually decays + {0}% of your current damage reduction is added to your critical strike chance + Continuously doing damage makes you gradually gain more and more defense, up to a maximum of {1} + When not doing damage, this bonus gradually decays over {2} seconds This added defense can be broken by defense damage ''' Melee: 15% increased melee speed and 20% increased movement speed @@ -121,7 +121,7 @@ SetBonus: { ''' SpectreHealing: ''' - Converts magic damage to healing force + Reduces Magic damage by 20% and converts it to healing force Magic damage done to enemies heals the player with lowest health ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson index 2a9963a8f4..e88ac0d6e1 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson @@ -1,6 +1,6 @@ BeeWings: Decreases fall speed while not pressing {$Key.DOWN} BoneWings: Halves flight time when taking a hit -DemonWings: Increases fall speed +DemonWings: Increases fall speed and accelerates up faster while falling FestiveWings: Spawns ornaments which restore flight time FinWings: Allows quick travel in water TatteredFairyWings: Leaves a trail of flight draining fairy dust diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 6d3948119d..504863dab8 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -23,7 +23,7 @@ AddedTooltip: { FairyBoots: ''' Fairies can spawn at any time on the surface and spawn far more frequently - Nearby fairies grant +2 HP/s life regen, 6 defense and 10% movement speed + Nearby fairies grant +1 HP/s life regen, 4 defense and 10% movement speed Fairies are immune to damage and will no longer flee ''' FleshKnucklesLine: Max life increased by 25 @@ -142,11 +142,7 @@ EditedTooltip: { /* OOA armors */ - ApprenticeHat: Increases your max number of sentries by 1, 10% reduced mana cost - ApprenticeRobe: 15% increased summon damage and magic damage - ApprenticeTrousers: 10% increased summon damage, 15% increased magic critical strike chance, 20% increased movement speed SquireGreatHelm: Increases your max number of sentries by 1 and grants +2 HP/s life regen - SquireGreaves: 10% increased summon damage, 15% increased melee critical strike chance and movement speed MonkBrows: Increases your max number of sentries by 1 and increases rogue velocity by 20% MonkShirt: 20% increased summon and rogue damage MonkPants: 15% increased rogue critical strike chance and 20% increased movement speed diff --git a/Localization/en-US/Mods.Terraria.Buffs.hjson b/Localization/en-US/Mods.Terraria.Buffs.hjson index ea70752e4b..aaf2511da3 100644 --- a/Localization/en-US/Mods.Terraria.Buffs.hjson +++ b/Localization/en-US/Mods.Terraria.Buffs.hjson @@ -1,22 +1,54 @@ -Venom.ItemTooltip: Sickness - 30 DPS +Venom: { + ItemTooltipPlayer: Sickness - 15 DPS + ItemTooltipEnemy: Sickness - 30 DPS +} + BetsysCurse.ItemTooltip: -40 defense -CursedInferno.ItemTooltip: Heat - 24 DPS -Frostburn2.ItemTooltip: Cold - 50 DPS -Frostburn.ItemTooltip: Cold - 8 DPS -OnFire3.ItemTooltip: Heat - 15 DPS -OnFire.ItemTooltip: Heat - 6 DPS -Ichor.ItemTooltip: -10 defense -Oiled.ItemTooltip: + +CursedInferno: { + ItemTooltipPlayer: Heat - 12 DPS + ItemTooltipEnemy: Heat - 24 DPS +} + +Frostburn2: { + ItemTooltipPlayer: Cold - 8 DPS + ItemTooltipEnemy: Cold - 25 DPS +} + +// Frostburn deals the same damage to players and enemies +Frostburn: { + ItemTooltipPlayer: Cold - 8 DPS + ItemTooltipEnemy: Cold - 8 DPS +} + +OnFire3.ItemTooltipEnemy: Heat - 15 DPS + +// On Fire deals the same damage to players and enemies +OnFire: { + ItemTooltipPlayer: Heat - 6 DPS + ItemTooltipEnemy: Heat - 6 DPS +} + +Ichor.ItemTooltipEnemy: -10 defense +Oiled.ItemTooltipEnemy: ''' Heat - 25 DPS. Recieves 2x the effect from Heat multipliers Only does damage when paired with another Heat debuff ''' -Poisoned.ItemTooltip: Sickness - 6 DPS -PotionSickness.ItemTooltip: "" -Slimed.ItemTooltip: Enhances Heat debuff damage -Wet.ItemTooltip: Enhances Electric debuff damage -Electrified.ItemTooltip: Electric - 10.5 DPS. Deals 4x damage to moving targets -Honey.ItemTooltip: +Poisoned.ItemTooltipEnemy: Sickness - 6 DPS +PotionSickness.ItemTooltipPlayer: "" +Slimed.ItemTooltipEnemy: Enhances Heat debuff damage +Wet.ItemTooltipEnemy: Enhances Electric debuff damage +Confused.ItemTooltipEnemy: Reverses movement +Webbed.ItemTooltipEnemy: Slows enemies +Frozen.ItemTooltipEnemy: Freezes enemies + +Electrified: { + ItemTooltipPlayer: Electric - 4 DPS. Deals 5x damage to moving players + ItemTooltipEnemy: Electric - 15 DPS. Deals 4x damage to moving targets +} + +Honey.ItemTooltipPlayer: ''' Increases health regeneration by 1 HP/s Increases natural regeneration acceleration by 300% diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 0fcbeb04a1..8a5b7692f8 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1203,7 +1203,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 4ac27bd126..f24782ec3c 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -17,6 +17,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class CannonballJellyfish : ModNPC { public bool hasBeenHit = false; diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 2ef44a8f59..407135ec7b 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ChaoticPuffer : ModNPC { public bool puffedUp = false; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 951075b079..dfe2e0cab1 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ColossalSquid : ModNPC { public bool hasBeenHit = false; diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 52c405524e..dae263984c 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -26,6 +26,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class EidolonWyrmHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; @@ -462,9 +463,9 @@ namespace CalamityMod.NPCs.Abyss // Post-Polterghast: Soul Edge, Eidolic Wail, Stardust Staff LeadingConditionRule postPolter = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedPolterghast)); aewMinionCondition.Add(postPolter); - postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); + postPolter.Add(ModContent.ItemType(), 3); // Post-Leviathan: 6-8 Lumenyl (8-11 on Expert) LeadingConditionRule postLevi = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedLeviathan)); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index b3db09830a..24d56ebdb6 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -17,6 +17,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class GulperEelHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 13dcc29c85..963c4580e0 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class MirageJelly : ModNPC { private bool teleporting = false; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index fec514fc15..3a49ef77ef 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class OarfishHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index cce3312e48..ceee4b8ef8 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -20,6 +20,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ReaperShark : ModNPC { public static Asset ManTexture; diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 99d5a112fe..55b402b4df 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class SlabCrab : ModNPC { enum AIState diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index a91b3a9793..e79dc4ba06 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -14,7 +14,6 @@ using Terraria; using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities; @@ -23,6 +22,7 @@ using Terraria.WorldBuilding; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class CragmawMire : ModNPC { public enum CragmawAttackState @@ -519,13 +519,8 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { - // If post-Polter, the drop rates are 10%. Otherwise they're 100%. - // This is accomplished by adding rules if the CONDITION "Post-Polter" fails. - LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); - postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); - postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); - postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); - postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); + npcLoot.Add(ModContent.ItemType()); + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index a2f6a64262..cf6b88cc32 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class FlakCrab : ModNPC { public Player Target => Main.player[NPC.target]; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index c3bae2cc77..55f41a9b93 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class GammaSlime : ModNPC { public float DustAngleMultiplier1; diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 51ed39b3da..fb3fe345bf 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -21,6 +21,7 @@ using Terraria.WorldBuilding; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class Mauler : ModNPC { // TODO -- Potentially add another attack in higher difficulty modes at some point? diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 7d6d04049f..a5bf709271 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class NuclearTerror : ModNPC { public enum SpecialAttackState diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 51a9914263..e34dfe714d 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class SulphurousSkater : ModNPC { public bool Flying = false; diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index b9f91cbcc0..6204ae467e 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -155,16 +155,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Fire teeth if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4)) { diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 56a6c7432c..cec29d817c 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -151,16 +151,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Kill body and tail bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 28db71c293..9b0e5564aa 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -291,16 +291,6 @@ namespace CalamityMod.NPCs.AquaticScourge } } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = doSpiral || getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Spawn segments if (calamityGlobalNPC.newAI[2] == 0f && NPC.ai[0] == 0f) { diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 75935256b7..66538d7824 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -150,16 +150,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Kill body and tail bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 9f9a0c9703..60823673ec 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Astral { + [HeavyKnockbackWhitelisted] public class AstralachneaWall : ModNPC { public static Asset glowmask; diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index d3c9e0f44a..acb2a97565 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Astral { + [HeavyKnockbackWhitelisted] public class SightseerSpitter : ModNPC { public static Asset glowmask; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 9d20520ac4..e45bf95817 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AstrumAureus { + [HeavyKnockbackWhitelisted] public class AureusSpawn : ModNPC { public static Asset GlowTexture; @@ -136,7 +137,7 @@ namespace CalamityMod.NPCs.AstrumAureus float lifeRatio = NPC.life / (float)NPC.lifeMax; // Phase 2 check - bool phase2 = lifeRatio <= 0.5f || Main.IsItDay(); + bool phase2 = lifeRatio <= 0.5f; // Charge towards the target and explode after some time int inertia = 30; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index fe6991d43f..cb1e741b72 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.AstrumDeus } } - SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center); + SoundEngine.PlaySound(SplitSound, player.Center); } return; } @@ -401,10 +401,18 @@ namespace CalamityMod.NPCs.AstrumDeus for (int segments = 0; segments < maxLength; segments++) { int lol; + + // Spawn offsets prevent the body segments from spawning bunched on top of each other, which is exploitable if (segments >= 0 && segments < maxLength - 1) - lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, bodyType, NPC.whoAmI); + { + Vector2 bodySpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * (segments + 1) / 2; + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - bodySpawnOffset.X), (int)(NPC.Center.Y - bodySpawnOffset.Y), bodyType, NPC.whoAmI); + } else - lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, tailType, NPC.whoAmI); + { + Vector2 tailSpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * maxLength / 2; + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - tailSpawnOffset.X), (int)(NPC.Center.Y - tailSpawnOffset.Y), tailType, NPC.whoAmI); + } if (segments % 2 == 0) Main.npc[lol].localAI[3] = 1f; @@ -761,13 +769,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; - // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer - if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) - { - SoundEngine.PlaySound(SpawnSound, NPC.Center); - calamityGlobalNPC.newAI[1] = 1f; - } - // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) calamityGlobalNPC.newAI[1] += 1f; diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index 51810443f1..db966cd60c 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -139,16 +139,6 @@ namespace CalamityMod.NPCs.Bumblebirb bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 3f || NPC.ai[0] == 3.1f || NPC.ai[0] == 3.2f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // If target is outside the jungle for more than 5 seconds, enrage if (!player.ZoneJungle && !BossRushEvent.BossRushActive) { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 00d7c4dbd7..decf8303fd 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -252,15 +252,10 @@ namespace CalamityMod.NPCs /// If set to true, allows for manually disabling this NPC's Boss Health Bar, even if they are still active. public bool ShouldCloseHPBar = false; - /// Constant representing the cooldown, in frames, before a boss can be affected by a slowing debuff. - public const int slowingDebuffResistanceMin = 1800; - /// Tracks the current slowing debuff cooldown for this NPC. - public int debuffResistanceTimer = 0; - #region Debuffs public bool vaporfied = false; public bool timeDistortion = false; - public bool glacialState = false; + public bool frozen = false; public bool galvanicCorrosion = false; public bool temporalSadness = false; public bool eutrophication = false; @@ -290,9 +285,12 @@ namespace CalamityMod.NPCs public bool absorberAffliction = false; public bool irradiated = false; public double irradiatedContactBoost = 1.5; + public bool bane = false; + public float baneVisual = 0; public bool brimstoneFlames = false; public bool demonicFlames = false; public int demonicFlamesBonusDamage = 0; + public int demonicFlamesClearTimer = 0; public bool holyFlames = false; public bool plague = false; public bool armorCrunch = false; @@ -300,6 +298,8 @@ namespace CalamityMod.NPCs public int antlionCloudDebuffTimer = 0; public bool scionsCurioEffected = false; + public bool abaddonEffected = false; + public bool apollyonEffected = false; public int warbannerBurnTime = 0; // Determines the rate that the enemy is damaged public int warbannerBurnTimer = 0; // The duration of the debuff public int warbannerBurnStacks = 0; // The stacks increase how fast the debuff hits @@ -329,8 +329,8 @@ namespace CalamityMod.NPCs public int hyperiusDamage = 0; public static int hyperiusOverflowTime = 100; public int hyperiusOverflowTimer = hyperiusOverflowTime; - /// Constant variable representing the % of max health Hyperius Bullet's damage stacks must reach before they start to overflow. - public const float HyperiusLifePercentThreshold = 0.07f; + /// Constant variable representing the % of max health Hyperius Bullet's damage stacks must reach before they start to bleed. + public const float HyperiusLifePercentThreshold = 0.10f; public int hyperiusFxTimer = 0; public int glaiveShredTimer = 0; @@ -382,7 +382,6 @@ namespace CalamityMod.NPCs public int ladHearts = 0; public bool relicOfResilienceWeakness = false; public bool sagePoison = false; - public int sagePoisonDamage = 0; public bool vulnerabilityHex = false; public bool trueVulnerabilityHex = false; public bool banishingFire = false; @@ -545,11 +544,9 @@ namespace CalamityMod.NPCs myClone.CanHaveBossHealthBar = CanHaveBossHealthBar; myClone.ShouldCloseHPBar = ShouldCloseHPBar; - myClone.debuffResistanceTimer = debuffResistanceTimer; - myClone.vaporfied = vaporfied; myClone.timeDistortion = timeDistortion; - myClone.glacialState = glacialState; + myClone.frozen = frozen; myClone.galvanicCorrosion = galvanicCorrosion; myClone.temporalSadness = temporalSadness; myClone.eutrophication = eutrophication; @@ -566,9 +563,12 @@ namespace CalamityMod.NPCs myClone.absorberAffliction = absorberAffliction; myClone.irradiated = irradiated; myClone.irradiatedContactBoost = irradiatedContactBoost; + myClone.bane = bane; + myClone.baneVisual = baneVisual; myClone.brimstoneFlames = brimstoneFlames; myClone.demonicFlames = demonicFlames; myClone.demonicFlamesBonusDamage = demonicFlamesBonusDamage; + myClone.demonicFlamesClearTimer = demonicFlamesClearTimer; myClone.holyFlames = holyFlames; myClone.plague = plague; myClone.armorCrunch = armorCrunch; @@ -576,6 +576,8 @@ namespace CalamityMod.NPCs myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; myClone.scionsCurioEffected = scionsCurioEffected; + myClone.abaddonEffected = abaddonEffected; + myClone.apollyonEffected = apollyonEffected; myClone.warbannerBurnTime = warbannerBurnTime; myClone.warbannerBurnTimer = warbannerBurnTimer; myClone.warbannerBurnStacks = warbannerBurnStacks; @@ -626,7 +628,6 @@ namespace CalamityMod.NPCs myClone.ladHearts = ladHearts; myClone.relicOfResilienceWeakness = relicOfResilienceWeakness; myClone.sagePoison = sagePoison; - myClone.sagePoisonDamage = sagePoisonDamage; myClone.vulnerabilityHex = vulnerabilityHex; myClone.trueVulnerabilityHex = trueVulnerabilityHex; myClone.banishingFire = banishingFire; @@ -741,12 +742,9 @@ namespace CalamityMod.NPCs //Debuff Bool clearing. // Doze 2jun2025 - Moved here from PostAI so drawing can read the bools. - if (debuffResistanceTimer > 0) - debuffResistanceTimer--; - timeDistortion = false; galvanicCorrosion = false; - glacialState = false; + frozen = false; temporalSadness = false; eutrophication = false; webbed = false; @@ -769,9 +767,8 @@ namespace CalamityMod.NPCs irradiated = false; if (scionsCurioEffected) irradiatedContactBoost = 2f; + bane = false; brimstoneFlames = false; - if (!demonicFlames) - demonicFlamesBonusDamage = 0; demonicFlames = false; holyFlames = false; plague = false; @@ -1008,6 +1005,7 @@ namespace CalamityMod.NPCs dmg += 480; // 240 DPS blazingStarShredTimer--; } + dmg = (int)ActiveTypelessDebuffMultiplier.ApplyTo(dmg); npc.lifeRegenCount -= dmg; if (damage < dmg / 12) // 1/6th of the DPS dealt by Glaive Shred shows up as the indicator, unless another debuff does more per tick damage = dmg / 12; @@ -1207,7 +1205,6 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.WallofFleshEye) npc.netAlways = true; - sagePoisonDamage = 0; if (npc.type == NPCID.Golem && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) npc.noGravity = true; @@ -1291,7 +1288,10 @@ namespace CalamityMod.NPCs npc.lifeMax *= 4; break; case NPCID.BrainofCthulhu: - npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.75); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.95); + break; + case NPCID.Creeper: + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.1); break; case NPCID.QueenBee: npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.8); @@ -3127,6 +3127,12 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) npc.ai[3] = 0f; } + if (demonicFlames) + demonicFlamesClearTimer = 0; + else + demonicFlamesClearTimer++; + if (demonicFlamesClearTimer >= 2) + demonicFlamesBonusDamage = 0; if (warbannerBurnTimer > 0) warbannerBurnTimer--; @@ -3166,7 +3172,7 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(fullPower with { Volume = 0.7f, Pitch = 0.7f }, npc.Center); warbannerBurnStacks++; } - if (warbannerBurnIntensity > 2.5f && npc.CanBeMoved(true)) + if (warbannerBurnIntensity > 2.5f && npc.CanBeMoved()) { npc.velocity *= 1f - 0.25f * Utils.GetLerpValue(2.5f, 3, warbannerBurnIntensity); if (npc.velocity.Length() > 5 && warbannerBurnIntensity > 2.85f) // Repel leaping enemies @@ -3202,6 +3208,11 @@ namespace CalamityMod.NPCs } warbannerBurnTime--; } + float fadeSpeed = 0.15f; + if (bane) + baneVisual = MathHelper.Lerp(baneVisual, 1, fadeSpeed); + else if (baneVisual > 0) + baneVisual = MathHelper.Lerp(baneVisual, 0, fadeSpeed); if (veriumDoomTimer > 0) veriumDoomTimer--; @@ -3303,10 +3314,6 @@ namespace CalamityMod.NPCs laserBurnDamage = 0; } - // Queen Bee is completely immune to having her movement impaired if not in a high difficulty mode. - if (npc.type == NPCID.QueenBee && !CalamityWorld.revenge && !BossRushEvent.BossRushActive) - return; - // Pearl Aura shard spawning // Slowing is handled in the general slowing code below if (pearlAura) @@ -3337,7 +3344,7 @@ namespace CalamityMod.NPCs pearlAuraOwner = -1; } - if (demonSwordImpales > 0 && npc.CanBeMoved(true)) + if (demonSwordImpales > 0 && npc.CanBeMoved()) { npc.velocity *= Utils.Remap(demonSwordImpales, 1, 5, 0.95f, 0.3f, true); if (impalePacketTimer > 30) // There's probably a better solution, but this is the best for now @@ -3348,8 +3355,8 @@ namespace CalamityMod.NPCs } impalePacketTimer++; - // Apply slowing debuff effects - if (debuffResistanceTimer <= 0 || (debuffResistanceTimer > slowingDebuffResistanceMin)) + // Apply slowing debuff effects, will not apply to bosses + if (!(CalamityNPCSets.ImmuneToSlowsAndOtherSpecialEffects[npc.type] || npc.boss)) { // Slowing debuffs which set a velocity hard cap take priority first. if (vulnerabilityHex) @@ -3368,7 +3375,7 @@ namespace CalamityMod.NPCs if (webbed) velocitySlownessFactor += 0.15f; - if (glacialState) + if (frozen) { float baseSlownessFactor = 0.1f; if (VulnerableToCold.HasValue) @@ -3547,8 +3554,6 @@ namespace CalamityMod.NPCs target.AddBuff(BuffType(), 480); break; - case NPCID.GolemHead: - case NPCID.GolemHeadFree: case NPCID.GolemFistRight: case NPCID.GolemFistLeft: if (CalamityWorld.revenge) @@ -4657,6 +4662,9 @@ namespace CalamityMod.NPCs if (astralInfection) AstralInfectionDebuff.DrawEffects(npc, ref drawColor); + if (bane || baneVisual > 0.05f) + Bane.DrawEffects(npc, ref drawColor); + // Brimstone Flames and Demonshade Enrage set bonus share the same visual effects // TODO -- change this when Demonshade is reworked if (brimstoneFlames || npc.HasBuff()) @@ -4857,7 +4865,7 @@ namespace CalamityMod.NPCs // Calamity debuff coloring effects // These are in order of precedence because they override each other. - if (glacialState) + if (frozen) drawColor = Color.Cyan; else if (auricRebuke) @@ -4924,6 +4932,7 @@ namespace CalamityMod.NPCs // All Calamity DoTs in alphabetical order ("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff", NPC => NPC.Calamity().astralInfection), ("CalamityMod/Buffs/DamageOverTime/AuricRebuke", NPC => NPC.Calamity().auricRebuke), + ("CalamityMod/Buffs/DamageOverTime/Bane", NPC => NPC.Calamity().bane), ("CalamityMod/Buffs/DamageOverTime/BanishingFire", NPC => NPC.Calamity().banishingFire), ("CalamityMod/Buffs/DamageOverTime/BrainRot", NPC => NPC.Calamity().brainRot), ("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames", NPC => NPC.Calamity().brimstoneFlames), @@ -4961,11 +4970,11 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/StatDebuffs/Crumbling", NPC => NPC.Calamity().crumble), ("CalamityMod/Buffs/StatDebuffs/Eutrophication", NPC => NPC.Calamity().eutrophication), ("CalamityMod/Buffs/StatDebuffs/GalvanicCorrosion", NPC => NPC.Calamity().galvanicCorrosion), - ("CalamityMod/Buffs/StatDebuffs/GlacialState", NPC => NPC.Calamity().glacialState), ("CalamityMod/Buffs/StatDebuffs/Irradiated", NPC => NPC.Calamity().irradiated), ("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath), ("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura), ("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness", NPC => NPC.Calamity().relicOfResilienceWeakness), + ("CalamityMod/Buffs/StatBuffs/SmashedEvil", NPC => NPC.HasBuff()), ("CalamityMod/Buffs/StatDebuffs/TemporalSadness", NPC => NPC.Calamity().temporalSadness), ("CalamityMod/Buffs/StatDebuffs/TimeDistortion", NPC => NPC.Calamity().timeDistortion), ("CalamityMod/Buffs/StatDebuffs/WhisperingDeath", NPC => NPC.Calamity().whisperingDeath), @@ -5051,6 +5060,8 @@ namespace CalamityMod.NPCs currentDebuffs.Add(TextureAssets.Buff[BuffID.Confused].Value); if (npc.ichor) currentDebuffs.Add(TextureAssets.Buff[BuffID.Ichor].Value); + if (frozen) + currentDebuffs.Add(TextureAssets.Buff[BuffID.Frozen].Value); if (webbed) currentDebuffs.Add(TextureAssets.Buff[BuffID.Webbed].Value); if (npc.midas) @@ -5461,7 +5472,7 @@ namespace CalamityMod.NPCs if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.Creeper && target.type != NPCType() && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCID.GolemFistLeft && target.type != NPCID.GolemFistRight && - target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ImmuneToSlowsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 8576c9b207..5fa1266546 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -497,36 +497,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); npcLoot.Add(ItemID.HallowedKey, 10); break; - - // World Feeder - // 6-15 Cursed Flame INSTEAD OF 2-5 in Death Mode - // 4-8 Souls of Night in Death Mode - // Also let World Feeders drop their other loot in Death Mode, as only the Head contains loot normally but it may not be killed last - // Monster Meat is already dropped by all 3 segments - case NPCID.SeekerHead: - npcLoot.RemoveWhere( - // The following expression returns true if the following conditions are met: - rule => rule is CommonDrop drop // If the rule is an CommonDrop instance - && drop.itemId == ItemID.CursedFlame // And that instance drops a Cursed Flame - ); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => !CalamityWorld.death, () => !CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 2, 5); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 6, 15); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death, CalamityUtils.GetTextValue("Condition.Drops.IsDeath"))).Add(ItemID.SoulofNight, 1, 4, 8); - break; - case NPCID.SeekerBody: - case NPCID.SeekerTail: - npcLoot.RemoveWhere( - // The following expression returns true if the following conditions are met: - rule => rule is CommonDrop drop // If the rule is an CommonDrop instance - && drop.itemId == ItemID.CursedFlame // And that instance drops a Cursed Flame - ); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => !CalamityWorld.death, () => !CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 2, 5); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 6, 15); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death, CalamityUtils.GetTextValue("Condition.Drops.IsDeath"))).Add(ItemID.SoulofNight, 1, 4, 8); - - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, false)).Add(ItemID.MeatGrinder, 200); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death && Main.WindyEnoughForKiteDrops, false)).Add(ItemID.KiteWorldFeeder, 25); - break; #endregion #region Jungle diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 30f02069d7..0d477e9611 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1231,6 +1231,8 @@ namespace CalamityMod.NPCs Condition spelunkerGlowCondition = new(Language.GetText("Conditions.NightDayFullMoon"), () => !Main.dayTime || Main.GetMoonPhase() == MoonPhase.Full); // Identical to the one in NPCShopDatabase Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); + Condition crescentMoons = new(CalamityUtils.GetText("Condition.CrescentMoons"), () => Main.GetMoonPhase() == MoonPhase.QuarterAtLeft || Main.GetMoonPhase() == MoonPhase.QuarterAtRight); // for Craw Carapace + Condition gibbousMoons = new(CalamityUtils.GetText("Condition.GibbousMoons"), () => Main.GetMoonPhase() == MoonPhase.ThreeQuartersAtLeft || Main.GetMoonPhase() == MoonPhase.ThreeQuartersAtRight); // for Giant Shell if (type == NPCID.Merchant) { @@ -1375,12 +1377,12 @@ namespace CalamityMod.NPCs if (type == NPCID.SkeletonMerchant) { - shop.InsertAfter(ItemID.HealingPotion, ItemType()) - .InsertAfter(ItemID.HealingPotion, ItemID.MilkCarton) + shop.InsertAfter(ItemID.HealingPotion, ItemType(), Condition.MoonPhasesHalf0) + .InsertAfter(ItemID.HealingPotion, ItemID.MilkCarton, Condition.MoonPhasesHalf1) .InsertAfter(ItemID.SpelunkerFlare, ItemID.SpelunkerFlare, spelunkerGlowCondition, hasFlareGunUpgrade) - .AddWithCustomValue(ItemID.Marrow, Item.buyPrice(gold: 25), Condition.Hardmode) - .AddWithCustomValue(Item.buyPrice(gold: 15)) - .AddWithCustomValue(Item.buyPrice(gold: 15)); + .AddWithCustomValue(ItemID.Marrow, Item.buyPrice(gold: 25), Condition.Hardmode, Condition.MoonPhases26) // 26 = half moons + .AddWithCustomValue(Item.buyPrice(gold: 15), gibbousMoons) + .AddWithCustomValue(Item.buyPrice(gold: 15), crescentMoons); } if (type == NPCID.BestiaryGirl) diff --git a/NPCs/CalamityHeavyKnockbackWhitelist.cs b/NPCs/CalamityHeavyKnockbackWhitelist.cs new file mode 100644 index 0000000000..3a579641bf --- /dev/null +++ b/NPCs/CalamityHeavyKnockbackWhitelist.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using CalamityMod.Balancing; +using CalamityMod.Items.Accessories; +using CalamityMod.Systems.Collections; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.NPCs +{ + public sealed class CalamityHeavyKnockbackWhitelist : GlobalNPC + { + // General rule of thumb I used for this is to not put it on anything that is a stationary entity (EX: Tesla Turrets, Antlions, Hive Cysts) + // No putting it on any bosses, though boss minions are fair game when applicable (no stuff like Scal hearts obviously, sending them into the void would be bad) + internal static HashSet whitelistNPC; + public override void Load() + { + whitelistNPC = new(); + } + public override void Unload() + { + whitelistNPC?.Clear(); + whitelistNPC = null; + } + public override void SetStaticDefaults() + { + // Add vanilla enemies to the whitelist + whitelistNPC.Add(NPCID.AncientCultistSquidhead); + whitelistNPC.Add(NPCID.DesertDjinn); + whitelistNPC.Add(NPCID.DD2DrakinT2); + whitelistNPC.Add(NPCID.DD2DrakinT3); + whitelistNPC.Add(NPCID.GrayGrunt); + whitelistNPC.Add(NPCID.HeadlessHorseman); + whitelistNPC.Add(NPCID.LihzahrdCrawler); + whitelistNPC.Add(NPCID.MartianProbe); + whitelistNPC.Add(NPCID.MartianWalker); + whitelistNPC.Add(NPCID.Paladin); + whitelistNPC.Add(NPCID.PirateCaptain); + whitelistNPC.Add(NPCID.ShadowFlameApparition); + whitelistNPC.Add(NPCID.ThePossessed); + whitelistNPC.Add(NPCID.EyeballFlyingFish); + whitelistNPC.Add(NPCID.Yeti); + whitelistNPC.Add(NPCID.ZombieMerman); + whitelistNPC.Add(NPCID.FungiBulb); + whitelistNPC.Add(NPCID.GiantFungiBulb); + whitelistNPC.Add(NPCID.ManEater); + whitelistNPC.Add(NPCID.Snatcher); + whitelistNPC.Add(NPCID.BloodEelHead); + whitelistNPC.Add(NPCID.BoneSerpentHead); + whitelistNPC.Add(NPCID.DevourerHead); + whitelistNPC.Add(NPCID.DiggerHead); + whitelistNPC.Add(NPCID.DuneSplicerHead); + whitelistNPC.Add(NPCID.GiantWormHead); + whitelistNPC.Add(NPCID.LeechHead); + whitelistNPC.Add(NPCID.StardustWormHead); + whitelistNPC.Add(NPCID.CultistDragonHead); + whitelistNPC.Add(NPCID.TombCrawlerHead); + whitelistNPC.Add(NPCID.SeekerHead); + whitelistNPC.Add(NPCID.WyvernHead); + whitelistNPC.Add(NPCID.Creeper); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.TheHungry); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.TheHungryII); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.DD2DarkMageT1); + whitelistNPC.Add(NPCID.DD2DarkMageT3); + whitelistNPC.Add(NPCID.DD2OgreT2); + whitelistNPC.Add(NPCID.DD2OgreT3); + whitelistNPC.Add(NPCID.MourningWood); + whitelistNPC.Add(NPCID.Pumpking); + whitelistNPC.Add(NPCID.Everscream); + whitelistNPC.Add(NPCID.SantaNK1); + whitelistNPC.Add(NPCID.IceQueen); + whitelistNPC.Add(NPCID.MartianSaucerCore); + whitelistNPC.Add(NPCID.Sharkron); + whitelistNPC.Add(NPCID.Sharkron2); + // Below are enemies Calamity gives KB immunity, but that aren't KB immune in vanilla + whitelistNPC.Add(NPCID.Mothron); + whitelistNPC.Add(NPCID.BigMimicCorruption); + whitelistNPC.Add(NPCID.BigMimicCrimson); + whitelistNPC.Add(NPCID.BigMimicHallow); + whitelistNPC.Add(NPCID.BigMimicJungle); + whitelistNPC.Add(NPCID.SolarCorite); + whitelistNPC.Add(NPCID.CrimsonAxe); + whitelistNPC.Add(NPCID.CursedHammer); + whitelistNPC.Add(NPCID.EnchantedSword); + whitelistNPC.Add(NPCID.GiantTortoise); + whitelistNPC.Add(NPCID.IceTortoise); + whitelistNPC.Add(NPCID.GoblinSummoner); + whitelistNPC.Add(NPCID.Butcher); + + var npcs = GetContent(); + foreach (var npc in npcs) + { + try + { + var type = npc.GetType(); + var whitelisted = type.GetCustomAttribute(); + if (whitelisted != null) + { + int npcType = npc.Type; + whitelistNPC.Add(npcType); + } + } + catch (Exception e) + { + CalamityMod.Log.Error($"Exception thrown while evaluating type \"{npc.FullName}\": {e}"); + } + } + } + } +} diff --git a/NPCs/CalamityTileCollisionHarmNPC.cs b/NPCs/CalamityTileCollisionHarmNPC.cs index e8c8ce2d34..65507bd0af 100644 --- a/NPCs/CalamityTileCollisionHarmNPC.cs +++ b/NPCs/CalamityTileCollisionHarmNPC.cs @@ -1,7 +1,13 @@ using System; +using System.Collections.Generic; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ModLoader; namespace CalamityMod.NPCs @@ -30,6 +36,7 @@ namespace CalamityMod.NPCs private bool hitVoid = false; private Player attacker; private int packetTimer = 0; + private bool GrandDad = false; public int PotentialEnergyDamage { @@ -76,12 +83,8 @@ namespace CalamityMod.NPCs /// The maximum fall damage taken by the npc once they hit the ground /// The downwards velocity necessary to recieve the full fall damage. By default 10, the npc max fall speed /// Will check for tiles in the collision instead of velocity - public void ApplyCollisionDamage(NPC npc, Player player, int potentialDamage, Vector2 forcedVel, float terminalVelocityForFullDamage = 10f, bool checkTiles = false) + public void ApplyCollisionDamage(NPC npc, Player player, int potentialDamage, Vector2 forcedVel, float terminalVelocityForFullDamage = 10f, bool checkTiles = false, bool grandDad = false) { - //NPCs that don't collide with tiles simply don't get fall damage, lol. - if (npc.noTileCollide) - return; - PotentialEnergyDamage = potentialDamage; OldVelocity = npc.velocity; OlderVelocity = npc.velocity; @@ -89,6 +92,7 @@ namespace CalamityMod.NPCs CheckTiles = checkTiles; ForcedVel = forcedVel; attacker = player; + GrandDad = grandDad; } /// @@ -100,10 +104,6 @@ namespace CalamityMod.NPCs /// Will check for tiles in the collision instead of velocity public void ApplyForcedVelocity(NPC npc, Player player, Vector2 forcedVel, bool checkTiles = false) { - // NPCs that don't collide with tiles simply don't get velocity, lol. - if (npc.noTileCollide) - return; - OldVelocity = npc.velocity; OlderVelocity = npc.velocity; CheckTiles = checkTiles; @@ -118,17 +118,71 @@ namespace CalamityMod.NPCs { if (CheckTiles) { - float oldVelocity = OldVelocity.Length(); - npc.Center += ForcedVel; ForcedVel *= 0.995f; + Vector2 safeVel = ForcedVel.SafeNormalize(Vector2.UnitX); - if (Collision.SolidCollision(npc.Center, (int)(npc.width * 0.5f), (int)(npc.height * 0.5f)) || !WorldGen.InWorld(npc.Center.ToTileCoordinates().X, npc.Center.ToTileCoordinates().Y, 40)) + if (npc.velocity == Vector2.Zero || ForcedVel.Length() < 2 || Collision.SolidCollision(npc.Center, (int)(npc.width * 0.5f), (int)(npc.height * 0.5f)) || !WorldGen.InWorld(npc.Center.ToTileCoordinates().X, npc.Center.ToTileCoordinates().Y, 40)) { - if (!ForceVelocityOnly) + if (!ForceVelocityOnly && potentialEnergyDamage > 0) { + float oldVelocity = OldVelocity.Length(); + if (GrandDad) + { + float scale = (npc.boss ? 1.35f : 1) + Utils.GetLerpValue(20, 800, Math.Max(npc.width, npc.height)); + + attacker.SetScreenshake(7f * scale); + if (!CalamityClientConfig.Instance.Photosensitivity) + { + Vector2 pulseVel = -safeVel; + Particle pulse1 = new CustomSpark(npc.Center, pulseVel * 2, "CalamityMod/Particles/BloomCircle", false, (int)(23 * MathF.Pow(scale, 2)), 0.6f * MathF.Pow(scale, 2), Color.DodgerBlue, new Vector2(2f, 1f), shrinkSpeed: -0.1f / scale, noShrink: true, glowCenter: true, glowOpacity: 0.8f); + GeneralParticleHandler.SpawnParticle(pulse1); + pulse1.Pixelate = true; + Particle pulse2 = new CustomSpark(npc.Center, pulseVel, "CalamityMod/Particles/BloomRing", false, (int)(18 * MathF.Pow(scale, 2)), 0.5f * MathF.Pow(scale, 2), Color.Blue, new Vector2(4f, 0.7f), shrinkSpeed: -0.3f / scale, noShrink: true); + GeneralParticleHandler.SpawnParticle(pulse2); + pulse2.Pixelate = true; + } + + + for (int i = 0; i < 2; i++) + { + SoundStyle die = new("CalamityMod/Sounds/Item/HolyFireBulletExplosion"); + SoundEngine.PlaySound(die with { Pitch = 0.5f, Volume = Math.Min(0.6f * scale, 1f), MaxInstances = 2 }, npc.Center); + if (npc.boss) + { + SoundStyle dieHard = new("CalamityMod/Sounds/Item/HellkiteSmallHit3"); + SoundEngine.PlaySound(dieHard with { Pitch = -1f, Volume = Math.Min(0.5f * scale, 1f), MaxInstances = 2 }, npc.Center); + } + SoundStyle dieHarder = new("CalamityMod/Sounds/Item/HeliumFlashCoreImpact"); + SoundEngine.PlaySound(dieHarder with { Pitch = -1.8f, Volume = Math.Min(0.6f * scale, 1f), MaxInstances = 2 }, npc.Center); + } + for (int i = 0; i < 30; i++) + { + float variance = Main.rand.NextFloat(-0.8f, 0.8f); + Dust dust = Dust.NewDustPerfect(npc.Center, ModContent.DustType(), + -safeVel.RotatedBy(variance * 2).RotatedByRandom(MathF.Abs(variance) / 3) * scale * Main.rand.NextFloat(30.0f, 33.0f) * MathF.Pow((1 - MathF.Abs(variance)), 2), 0, default, scale * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 2; + dust.fadeIn = 0.5f * scale; + } + for (int i = 0; i < 15; i++) + { + float variance = Main.rand.NextFloat(-0.8f, 0.8f); + Vector2 vel = -safeVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(20.0f, 23.0f) * MathF.Pow((1 - MathF.Abs(variance)), 2); + Dust dust2 = Dust.NewDustPerfect(npc.Center + vel * 13, ModContent.DustType(), + vel, 0, default, 2 * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + + } + } + + bool instakill = (GrandDad && potentialEnergyDamage != 1); int wallImpactDamage = (int)(PotentialEnergyDamage * Math.Clamp(oldVelocity / terminalVelocityForFullFallDamage, (ForcedVel.Length() > 0 ? 1f : 0f), 1f)); - Projectile wallImpact = Projectile.NewProjectileDirect(attacker.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), wallImpactDamage, 0f, attacker.whoAmI, npc.whoAmI); + Projectile wallImpact = Projectile.NewProjectileDirect(attacker.GetSource_FromThis(), npc.Center, Vector2.Zero, instakill ? ModContent.ProjectileType() : ModContent.ProjectileType(), wallImpactDamage, 0f, attacker.whoAmI, npc.whoAmI); wallImpact.DamageType = DamageClass.Melee; wallImpact.CritChance = (int)attacker.GetCritChance(DamageClass.Melee) + attacker.HeldItem.crit; } diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index cfc7c0469f..6b1b8c374d 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags { + [HeavyKnockbackWhitelisted] public class HeatSpirit : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 96898e2192..052bd98c2d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -83,6 +83,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.boss = true; NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; + NPC.Calamity().canBreakPlayerDefense = true; if (Main.zenithWorld) NPC.scale *= 1.5f; diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index fc60264b5f..09230077a7 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -13,6 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.DraedonLabThings { + [HeavyKnockbackWhitelisted] public class Androomba : ModNPC { diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 4aebb02ae2..a3c7bcb9c1 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.DraedonLabThings { + [HeavyKnockbackWhitelisted] public class RepairUnitCritter : ModNPC { public enum BehaviorState diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 42af41cb27..42d7441b6c 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -20,6 +20,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.GreatSandShark { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class GreatSandShark : ModNPC { private bool resetAI = false; diff --git a/NPCs/HeavyKnockbackWhitelistedAttribute.cs b/NPCs/HeavyKnockbackWhitelistedAttribute.cs new file mode 100644 index 0000000000..0bc40aa705 --- /dev/null +++ b/NPCs/HeavyKnockbackWhitelistedAttribute.cs @@ -0,0 +1,13 @@ +using System; + +namespace CalamityMod.NPCs +{ + /// + /// This attribute puts an NPC into the heavy knockback whitelist + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] + public sealed class HeavyKnockbackWhitelistedAttribute : Attribute + { + + } +} diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index e25f31ae91..8f7a674da0 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -218,16 +218,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.dontTakeDamage = spawnAnimation; - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 2f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Despawn if (!player.active || player.dead || Vector2.Distance(player.Center, npcCenter) > 5600f) { diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 19205bd748..415325546d 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -64,6 +64,9 @@ namespace CalamityMod.NPCs.Leviathan public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { + int associatedNPCType = ModContent.NPCType(); + bestiaryEntry.UIInfoProvider = new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[associatedNPCType], quickUnlock: true); + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean, diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 95e4beec0b..d013f9f032 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class AuroraSpirit : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index c4fa0d8395..07040968de 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class PlanterasFreeTentacle : ModNPC { public override string Texture => $"Terraria/Images/NPC_{NPCID.PlanterasTentacle}"; diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 2891aa5e74..dffd4e8a18 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -12,6 +12,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class ScornEater : ModNPC { diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index dc51b1a0f1..4592d3b4b4 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.OldDuke { + [HeavyKnockbackWhitelisted] public class SulphurousSharkron : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 4494237d73..c7411a4d2a 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 40; NPC.defense = 6; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 9b872ecaba..b35bc6f9c9 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Perforator if (!TailSpawned) { int Previous = NPC.whoAmI; - int maxLength = death ? 27 : revenge ? 24 : expertMode ? 21 : 15; + int maxLength = death ? 27 : expertMode ? 21 : 15; for (int segments = 0; segments < maxLength; segments++) { int lol; @@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 033cd052fa..2d80c05878 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 68; NPC.defense = 2; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; @@ -465,7 +465,7 @@ namespace CalamityMod.NPCs.Perforator public static int GetMediumPerforatorSegmentsCount() { - return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; + return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : Main.expertMode ? 12 : 10; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 8b6fbc6406..bd7536b1d2 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Perforator if (!TailSpawned) { int Previous = NPC.whoAmI; - int maxLength = death ? 9 : revenge ? 8 : expertMode ? 7 : 5; + int maxLength = death ? 9 : expertMode ? 7 : 5; for (int segments = 0; segments < maxLength; segments++) { int lol; @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index b7401df0b0..9419c0346b 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 50; NPC.defense = 10; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 8cd56e8f01..e9c9606af2 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -14,6 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.PlaguebringerGoliath { + [HeavyKnockbackWhitelisted] public class PlagueHomingMissile : ModNPC { public static Asset GlowTexture; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 47724c6a71..0b9018bce2 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -180,16 +180,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath nukeBarrageChallengeAmt *= 1.5f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 0f || NPC.ai[0] == 4f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Light Lighting.AddLight((int)(NPC.Center.X / 16f), (int)(NPC.Center.Y / 16f), 0.3f, 0.7f, 0f); @@ -1337,7 +1327,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath int[] weapons = new int[] { ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 2bc598ef88..0b932099d2 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -341,16 +341,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm iceMistDuration *= 0.5f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = AIState == (float)Phase.FinalPhase || AIState == (float)Phase.ShadowFireballSpin; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Adjust opacity bool invisiblePartOfChargePhase = calamityGlobalNPC.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC.newAI[2] <= chargePhaseGateValue + 1f && (AIState == (float)Phase.ChargeOne || AIState == (float)Phase.ChargeTwo || AIState == (float)Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC.newAI[2] <= lightningChargePhaseGateValue + 1f && AIState == (float)Phase.LightningCharge; @@ -1492,7 +1482,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType()); - npcLoot.Add(ModContent.ItemType()); + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 1, 80, 100); diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 33d6c79feb..4bcda5bc2f 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Signus { + [HeavyKnockbackWhitelisted] public class CosmicLantern : ModNPC { public static Asset GlowTexture; diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 8a2a83f901..4b7e8cb2fd 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -19,6 +19,7 @@ namespace CalamityMod.NPCs.Signus public override void SetStaticDefaults() { NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.BossBestiaryPriority.Add(Type); } public override void SetDefaults() @@ -42,6 +43,9 @@ namespace CalamityMod.NPCs.Signus public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { + int associatedNPCType = ModContent.NPCType(); + bestiaryEntry.UIInfoProvider = new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[associatedNPCType], quickUnlock: true); + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld, diff --git a/NPCs/TownNPCs/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index d9f67f8926..e5f9ec3ef8 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -165,8 +165,6 @@ namespace CalamityMod.NPCs.TownNPCs .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add() .Add(ItemID.SuperManaPotion) .Add() diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs index 35fc92c954..a41c9c6511 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs @@ -569,7 +569,9 @@ public class BrainOfCthulhuAI : VanillaAIOverride if (d > 592900) //770^2 distanceScaleFactor = 1 / (1 + (((float)Math.Sqrt(d) - 770) / 32f)); - float spawnCounter = Time - Math.Abs(SpawnTime); + // Time spent in the spawn animation is shortened when summoned via item + float spawnAnimTimeReduction = (SummonedViaItem || BossRushEvent.BossRushActive) ? 120 : 0; + float spawnCounter = Time - Math.Abs(SpawnTime) + spawnAnimTimeReduction; if (spawnCounter < 180) { @@ -686,7 +688,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride AttackCounter++; if (SummonedViaItem || BossRushEvent.BossRushActive) - SpawnDelay = 2; + SpawnDelay = 1; else SpawnDelay = AttackCounter switch { @@ -3096,7 +3098,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride return false; } - public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 30 : 21; + public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 27 : 18; public static List GetAllValidTargets(Vector2 brainPosition) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs index 8ad34c50b4..72043d55fa 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs @@ -177,7 +177,8 @@ public class CreeperAI : VanillaAIOverride if (bocAI.SpawnTime != 0 && Time >= 0) //Brain has appeared { - float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime); + float spawnAnimTimeReduction = (SummonedViaItem || BossRushEvent.BossRushActive) ? 120 : 0; + float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime) + spawnAnimTimeReduction; if (brainTime < 180) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs index c69afe955c..86a7aa7f8c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs @@ -166,7 +166,7 @@ public class FalseBrain : ModNPC, ILocalizedModType float endLerp = AttackTime / 60f; float startLerp = SpawnTime / 60f; - if (BrainOfCthulhuSystem.IsBrainOfCthulhuTextureVanilla) + if (BrainOfCthulhuSystem.IsBrainOfCthulhuTextureVanilla && !CalamityClientConfig.Instance.BoCSpriteChange) { tex = TextureAssets.Npc[Type].Value; frame = tex.Frame(7, 4, Variant, (int)NPC.frameCounter); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index 3f33e6802b..711da670b0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -24,9 +24,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Variables bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool phase2 = lifeRatio < (death ? 0.6f : 0.7f); - bool phase3 = lifeRatio < (death ? 0.3f : 0.4f); - bool phase4 = lifeRatio < (death ? 0.1f : 0.2f); + bool phase2 = lifeRatio < 0.7f; + bool phase3 = lifeRatio < 0.4f; + bool phase4 = lifeRatio < 0.2f; bool phase2AI = NPC.ai[0] > 4f; bool phase3AI = NPC.ai[0] > 9f; bool charging = NPC.ai[3] < 10f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 71945eabe4..9af1bd482c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -243,7 +243,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int whoAmI = NPC.whoAmI; float ai0Holdover = NPC.ai[0]; float newAI1Holdover = calamityGlobalNPC.newAI[1]; - int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer; // Actually transform the body segment into a head segment. NPC.SetDefaultsKeepPlayerInteraction(NPC.type); @@ -253,7 +252,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Heads spawned mid fight by splitting do not get reset spawn invincibility. CalamityGlobalNPC newCGN = NPC.Calamity(); newCGN.newAI[1] = newAI1Holdover; - newCGN.debuffResistanceTimer = slowingDebuffResistTimer; CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); @@ -268,14 +266,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float segmentLifeRatio = MathHelper.Lerp(0.5f, 1f, NPC.life / (float)NPC.lifeMax); int whoAmI = NPC.whoAmI; float ai1Holdover = NPC.ai[1]; - int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer; // Actually transform the body segment into a tail segment. NPC.SetDefaultsKeepPlayerInteraction(NPC.type); NPC.life = (int)(NPC.lifeMax * segmentLifeRatio); NPC.whoAmI = whoAmI; NPC.ai[1] = ai1Holdover; - NPC.Calamity().debuffResistanceTimer = slowingDebuffResistTimer; CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index b553015d05..93f63dd357 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -744,8 +744,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Expert attack or not. bool expertAttack = calamityGlobalNPC.newAI[2] == 0f; - int numLanceWalls = expertAttack ? 6 : 4; - float lanceWallSpawnGateValue = expertAttack ? (death ? 42f : 36f) : 54f; + int numLanceWalls = (death && !expertAttack) ? 9 : 6; + float lanceWallSpawnGateValue = expertAttack ? 50f : (death ? 32f : 45f); if (dayTimeEnrage) lanceWallSpawnGateValue -= expertAttack ? 4f : 6f; @@ -760,73 +760,26 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.Item162, NPC.Center); - float totalProjectiles = death ? 18f : 15f; - float lanceSpacing = death ? 150f : 175f; + float totalProjectiles = death ? 19f : 15f; + float lanceSpacing = death ? (expertAttack ? 150f : 200f) : 175f; float lanceWallSize = totalProjectiles * lanceSpacing; Vector2 lanceSpawnOffset = targetData9.Center; if (NPC.Distance(lanceSpawnOffset) <= 3200f) { - Vector2 lanceWallStartingPosition = Vector2.Zero; - Vector2 lanceWallDirection = Vector2.UnitY; - float lanceWallConvergence = 0.4f; - float lanceWallSizeMult = 1.4f; totalProjectiles += 5f; - lanceSpacing += 50f; - lanceWallSize *= (death ? 0.7f : 0.5f); - float direction = 1f; - - int randomLanceWallType; - do randomLanceWallType = Main.rand.Next(numLanceWalls); - while (randomLanceWallType == calamityGlobalNPC.newAI[3]); - - // This is set so that Empress doesn't use the same wall type twice in a row. - calamityGlobalNPC.newAI[3] = randomLanceWallType; + lanceWallSize *= (death && expertAttack) ? 0.7f : 0.5f; + // Used to give the lance walls a random rotation. + calamityGlobalNPC.newAI[3] = Main.rand.NextFloat(MathHelper.TwoPi); // Keeps track of the total number of lance walls used. calamityGlobalNPC.newAI[1] += 1f; - // Sync the Calamity AI variables. NPC.SyncExtraAI(); - switch (randomLanceWallType) - { - case 0: - lanceSpawnOffset += new Vector2((0f - lanceWallSize) / 2f, 0f) * direction; - lanceWallStartingPosition = new Vector2(0f, lanceWallSize); - lanceWallDirection = Vector2.UnitX; - break; - - case 1: - lanceSpawnOffset += new Vector2(lanceWallSize / 2f, lanceSpacing / 2f) * direction; - lanceWallStartingPosition = new Vector2(0f, lanceWallSize); - lanceWallDirection = -Vector2.UnitX; - break; - - case 2: - lanceSpawnOffset += new Vector2(0f - lanceWallSize, 0f - lanceWallSize) * lanceWallConvergence * direction; - lanceWallStartingPosition = new Vector2(lanceWallSize * lanceWallSizeMult, 0f); - lanceWallDirection = new Vector2(1f, 1f); - break; - - case 3: - lanceSpawnOffset += new Vector2(lanceWallSize * lanceWallConvergence + lanceSpacing / 2f, (0f - lanceWallSize) * lanceWallConvergence) * direction; - lanceWallStartingPosition = new Vector2((0f - lanceWallSize) * lanceWallSizeMult, 0f); - lanceWallDirection = new Vector2(-1f, 1f); - break; - - case 4: - lanceSpawnOffset += new Vector2(0f - lanceWallSize, lanceWallSize) * lanceWallConvergence * direction; - lanceWallStartingPosition = new Vector2(lanceWallSize * lanceWallSizeMult, 0f); - lanceWallDirection = lanceSpawnOffset.DirectionTo(targetData9.Center); - break; - - case 5: - lanceSpawnOffset += new Vector2(lanceWallSize * lanceWallConvergence + lanceSpacing / 2f, lanceWallSize * lanceWallConvergence) * direction; - lanceWallStartingPosition = new Vector2((0f - lanceWallSize) * lanceWallSizeMult, 0f); - lanceWallDirection = lanceSpawnOffset.DirectionTo(targetData9.Center); - break; - } + lanceSpawnOffset += -Vector2.UnitX.RotatedBy(calamityGlobalNPC.newAI[3]) * (lanceWallSize / 2f); + Vector2 lanceWallStartingPosition = Vector2.UnitY.RotatedBy(calamityGlobalNPC.newAI[3]) * lanceWallSize; + Vector2 lanceWallDirection = calamityGlobalNPC.newAI[3].ToRotationVector2(); int projectileType = ProjectileID.FairyQueenLance; int projectileDamage = lanceDamage; @@ -846,13 +799,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnLocation, Vector2.Zero, projectileType, projectileDamage, 0f, Main.myPlayer, v2.ToRotation(), i); } } - - // Chance to stop using the lance walls and switch to a different attack after 3 lance walls are used. - if (Main.rand.NextBool(5 - ((int)calamityGlobalNPC.newAI[1] - 2)) && calamityGlobalNPC.newAI[1] >= 2f) - { - NPC.ai[1] = lanceWallPhaseTime; - NPC.netUpdate = true; - } } NPC.ai[1] += 1f; @@ -927,9 +873,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, ai3); - if (Main.getGoodWorld) - Main.projectile[proj].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, ai3); } // Spawn extra homing Rainbow Streaks per player. @@ -1163,12 +1107,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, streakHomeTime); if (phase3) { - int proj2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, 1f - streakHomeTime); - if (Main.getGoodWorld) - { - Main.projectile[proj2].extraUpdates += 1; - Main.projectile[proj2].netUpdate = true; - } + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, 1f - streakHomeTime); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 8c3203650f..437d1b4969 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -136,16 +136,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.player[NPC.target].dead) NPC.ai[0] = 7f; - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 0f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Always start in enemy spawning phase if (calamityGlobalNPC.newAI[3] == 0f) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index 04e40a86a0..0412e9874e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -326,38 +326,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn crown gore if (NPC.ai[1] == teleportTime) - { Gore.NewGore(NPC.GetSource_FromAI(), NPC.Center + new Vector2(-40f, -NPC.height / 2), NPC.velocity, GoreID.QueenSlimeCrown); - // Spawn spread of projectiles in Master Mode - if (death) - { - int numGelProjectiles = 12; - if (Main.getGoodWorld) - numGelProjectiles = 15; - - float gelVelocity = death ? 20f : 16f; - int type = ProjectileID.QueenSlimeGelAttack; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int j = 0; j < numGelProjectiles; j++) - { - Vector2 spinningpoint = new Vector2(gelVelocity, 0f); - - if (Main.getGoodWorld) - spinningpoint *= Main.rand.NextFloat() + 0.5f; - - spinningpoint = spinningpoint.RotatedBy((float)(-j) * MathHelper.TwoPi / (float)numGelProjectiles, Vector2.Zero); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); - Main.projectile[proj].timeLeft = 900; - } - } - - SoundEngine.PlaySound(SoundID.Item155, NPC.Center); - } - } - if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) { NPC.Bottom = new Vector2(NPC.localAI[1], NPC.localAI[2]); @@ -459,9 +429,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.ai[2] += 1f; } - if (death) - NPC.velocity.X *= (death ? 1.4f : 1.2f); - NPC.noTileCollide = true; } else @@ -527,15 +494,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.QueenSlimeSmash; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Bottom, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer); - // Line of explosions in Master Mode + // Line of explosions in Death Mode if (death) { float expandDelay = 0f; - int maxSmashes = death ? 22 : 16; + int maxSmashes = 16; float maxSmashOffset = maxSmashes * 100f; Vector2 extraSmashPosition = NPC.Bottom + Vector2.UnitX * maxSmashOffset; int maxSmashesPerSide = maxSmashes / 2; - float maxExpandDelay = (death ? 10f : 15f) * maxSmashesPerSide; + float maxExpandDelay = 15f * maxSmashesPerSide; float smashSpawnDistanceOffset = 200f; for (int i = 0; i < maxSmashes + 1; i++) { @@ -550,7 +517,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Eruption of crystals in phase 3 if (NPC.ai[0] == 6f && phase3) { - float projectileVelocity = death ? 18f : 12f; + float projectileVelocity = 12f; type = ProjectileID.QueenSlimeMinionBlueSpike; Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; @@ -564,7 +531,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase5) { - numProj = 15; + numProj = 12; destination *= 0.65f; for (int i = 0; i < numProj; i++) { @@ -853,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn small slimes // Don't spawn any slimes in final phase - if (NPC.life <= 0 || (phase4 && !death)) + if (NPC.life <= 0 || (phase4 && !death) || phase5) return false; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -926,7 +893,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float flyVelocity = death ? 19f : 16f; float flyAcceleration = death ? 0.15f : 0.12f; - float flyDistanceY = death ? 350f : 450f; + float flyDistanceY = 450f; Vector2 desiredVelocity = npc.Center; @@ -1005,7 +972,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float num20 = obj.Center.Y - center.Y; float num21 = (float)Math.Sqrt(num19 * num19 + num20 * num20); int num22 = NPC.CountNPCS(NPCID.QueenSlimeMinionBlue); - if (Main.expertMode && num22 < 5 && Math.Abs(num19) < 500f && Math.Abs(num20) < 550f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height) && NPC.velocity.Y == 0f) + if (num22 < 5 && Math.Abs(num19) < 500f && Math.Abs(num20) < 550f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height) && NPC.velocity.Y == 0f) { NPC.ai[0] = -40f; if (NPC.velocity.Y == 0f) @@ -1026,8 +993,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses vector6 *= 1.5f; int type = ProjectileID.QueenSlimeMinionBlueSpike; - Projectile.NewProjectile(NPC.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer); - NPC.localAI[0] = 25f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), center, vector6 * (death ? 0.7f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer); + NPC.localAI[0] = death ? 50f : 25f; if (num22 > 4) break; } @@ -1053,9 +1020,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses num19 *= num21; num20 *= num21; - NPC.localAI[0] = 50f; + NPC.localAI[0] = death ? 100f : 50f; int type = ProjectileID.QueenSlimeMinionBlueSpike; - Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.8f : 0.5f); + Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.7f : 0.5f); Projectile.NewProjectile(NPC.GetSource_FromAI(), center, spikeVelocity, type, SpikeDamage, 0f, Main.myPlayer); } } @@ -1113,7 +1080,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((double)NPC.velocity.X > -0.1 && (double)NPC.velocity.X < 0.1) NPC.velocity.X = 0f; - NPC.ai[0] += (death ? 16f : Main.expertMode ? 10f : 7f); + NPC.ai[0] += death ? 16f : 10f; float num33 = -1000f; @@ -1136,14 +1103,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (num34 == 3) { NPC.velocity.Y = -8f; - NPC.velocity.X += (death ? 9 : Main.expertMode ? 6 : 3) * NPC.direction; + NPC.velocity.X += (death ? 9 : 6) * NPC.direction; NPC.ai[0] = -200f; NPC.ai[3] = NPC.position.X; } else { NPC.velocity.Y = -6f; - NPC.velocity.X += (death ? 6 : Main.expertMode ? 4 : 2) * NPC.direction; + NPC.velocity.X += (death ? 6 : 4) * NPC.direction; NPC.ai[0] = -120f; if (num34 == 1) NPC.ai[0] += num33; @@ -1208,12 +1175,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses num24 *= num26; num25 *= num26; - NPC.localAI[0] = 40f; - if (Main.expertMode) - NPC.localAI[0] = 30f; + NPC.localAI[0] = death ? 60f : 30f; int type = ProjectileID.QueenSlimeMinionPinkBall; - Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.8f : 0.5f); + Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.7f : 0.5f); Projectile.NewProjectile(NPC.GetSource_FromAI(), center2, pinkBallVelocity, type, SmallGelDamage, 0f, Main.myPlayer); } } @@ -1271,7 +1236,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((double)NPC.velocity.X > -0.1 && (double)NPC.velocity.X < 0.1) NPC.velocity.X = 0f; - NPC.ai[0] += (death ? 11f : Main.expertMode ? 7f : 5f); + NPC.ai[0] += death ? 11f : 7f; float num33 = -500f; @@ -1294,14 +1259,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (num34 == 3) { NPC.velocity.Y = -8f; - NPC.velocity.X += (death ? 9 : Main.expertMode ? 6 : 3) * NPC.direction; + NPC.velocity.X += (death ? 9 : 6) * NPC.direction; NPC.ai[0] = -200f; NPC.ai[3] = NPC.position.X; } else { NPC.velocity.Y = -6f; - NPC.velocity.X += (death ? 6 : Main.expertMode ? 4 : 2) * NPC.direction; + NPC.velocity.X += (death ? 6 : 4) * NPC.direction; NPC.ai[0] = -120f; if (num34 == 1) NPC.ai[0] += num33; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index da0d5b69d4..870dd18391 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -147,16 +147,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[1] == 5f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - bool normalLaserRotation = NPC.localAI[1] % 2f == 0f; // Float near player diff --git a/Particles/BaneParticle.cs b/Particles/BaneParticle.cs new file mode 100644 index 0000000000..f688eef51e --- /dev/null +++ b/Particles/BaneParticle.cs @@ -0,0 +1,132 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class BaneParticle : Particle + { + public override string Texture => "CalamityMod/Particles/BaneParticle"; + public Color InitialColor; + public Color EndColor; + public Color glowColor = Color.White; + public bool AffectedByGravity; + public bool FadeIn = false; + public float FadeInScale = 0f; + public float SineRate = 0; + public float SineIntensity = 0; + public float Sine = 0; + public int sineTime = 0; + + public string NewTexture; + public float ActiveRotation; + public float AddedRotation = 0; + public float SpeedReduction = 0.95f; + public float ExtraRotation = 0; + + public Vector2 Stretch = Vector2.One; + public float ShrinkSpeed = 0; + public bool AltVisual = false; + public override bool UseAdditiveBlend => AltVisual; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public override int FrameVariants => 5; + + public BaneParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, Color colorEnd, Vector2 stretch, bool useAddativeBlend = false, float activeRotation = 0, float speedReduction = 0.95f, float extraRotation = 0, float sineRate = 1, float sineIntensity = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0) + { + Position = relativePosition; + Velocity = velocity; + ActiveRotation = activeRotation; + AffectedByGravity = affectedByGravity; + AffectedByLight = affectedByLight; + Scale = scale; + Stretch = stretch; + FadeInScale = scale; + Lifetime = lifetime; + Color = InitialColor = color; + EndColor = colorEnd; + ShrinkSpeed = shrinkSpeed; + SpeedReduction = speedReduction; + ExtraRotation = extraRotation; + SineRate = sineRate; + SineIntensity = sineIntensity; + sineTime = Main.rand.Next(0, 400 + 1); + + + AltVisual = useAddativeBlend; + + FadeIn = fadeIn; + + if (FadeIn) + Scale = 0f; + + Variant = Main.rand.Next(FrameVariants); + } + + public override void Update() + { + if (!FadeIn) + { + Scale *= 0.95f; + Color = Color.Lerp(InitialColor, EndColor, LifetimeCompletion); + } + else + { + if ((float)Time / (float)Lifetime < 0.5f) + { + Scale = MathHelper.Lerp(Scale, FadeInScale, 0.2f); + } + else + { + Scale = MathHelper.Lerp(Scale, FadeInScale, -0.21f); + } + } + Velocity *= SpeedReduction; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + + float velRot = ActiveRotation == 0 ? (Velocity.ToRotation() + MathHelper.PiOver2) : ActiveRotation; + Rotation = velRot + AddedRotation; + AddedRotation += ActiveRotation; + ActiveRotation *= 0.975f; + + Stretch.X *= (1 - 0.2f * ShrinkSpeed); + Stretch.Y *= (1 + 0.2f * ShrinkSpeed); + + Sine = (float)Math.Sin((sineTime * SineRate) / MathHelper.Pi) * SineIntensity; + sineTime++; + } + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/BaneParticleGlow").Value; + int frameWidth = 18; + int frameHeight = 18; + int frameSpacing = frameHeight + 2; + Rectangle frame = new Rectangle(0, frameSpacing * Variant, frameWidth, frameHeight); + + Texture2D texture2 = ModContent.Request("CalamityMod/Particles/BaneParticle").Value; + int frameWidth2 = 14; + int frameHeight2 = 10; + int frameSpacing2 = frameHeight2 + 2; + Rectangle frame2 = new Rectangle(0, frameSpacing2 * Variant, frameWidth2, frameHeight2); + + Vector2 scale = Stretch * Scale; + + Color col = Color; + + if (AffectedByLight) + { + col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); + } + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, 3D)); + spriteBatch.Draw(texture, Position - Main.screenPosition + Vector2.UnitX * Sine, frame, col * fadeOut, Rotation + ExtraRotation, frame.Size() * 0.5f, scale, 0, 0f); + spriteBatch.Draw(texture2, Position - Main.screenPosition + Vector2.UnitX * Sine, frame2, Color.Lerp(glowColor, col, 0.2f) * 0.75f * fadeOut, Rotation + ExtraRotation, frame2.Size() * 0.5f, scale * 0.95f, 0, 0f); + } + } +} diff --git a/Particles/BaneParticle.png b/Particles/BaneParticle.png new file mode 100644 index 0000000000..89703f1e16 Binary files /dev/null and b/Particles/BaneParticle.png differ diff --git a/Particles/BaneParticleGlow.png b/Particles/BaneParticleGlow.png new file mode 100644 index 0000000000..afbabdf11c Binary files /dev/null and b/Particles/BaneParticleGlow.png differ diff --git a/Particles/BloomRingAngled.png b/Particles/BloomRingAngled.png new file mode 100644 index 0000000000..fa6506a992 Binary files /dev/null and b/Particles/BloomRingAngled.png differ diff --git a/Particles/CircularSmearLarge.png b/Particles/CircularSmearLarge.png new file mode 100644 index 0000000000..d9d51baaef Binary files /dev/null and b/Particles/CircularSmearLarge.png differ diff --git a/Particles/CustomColorChangeSpark.cs b/Particles/CustomColorChangeSpark.cs new file mode 100644 index 0000000000..d17c5d92ce --- /dev/null +++ b/Particles/CustomColorChangeSpark.cs @@ -0,0 +1,141 @@ +using System; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class CustomColorChangeSpark : Particle + { + public Color InitialColor; + public Color EndColor; + public bool AffectedByGravity; + public bool FadeIn = false; + public float FadeInScale = 0f; + public bool GlowCenter = false; + public float GlowCenterScale = 1; + public float GlowOpacity = 1; + public string NewTexture; + public float ExtraRotation; + public Vector2 Stretch = new Vector2(0.5f, 1.6f); + public float ShrinkSpeed = 0; + public bool FlipHorizontal = false; + public bool NoShrink = false; + public float Spin = 0; + public float ColorFadeSpeed = 0; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public bool AltVisual = true; + public override bool UseAdditiveBlend => AltVisual; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public CustomColorChangeSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color startColor, Color endColor, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0, float colorFadeSpeed = 3) + { + Position = relativePosition; + Velocity = velocity; + NewTexture = texture; + ExtraRotation = extraRotation; + AffectedByGravity = affectedByGravity; + AffectedByLight = affectedByLight; + Scale = scale; + Stretch = stretch; + FadeInScale = scale; + Lifetime = lifetime; + Color = InitialColor = startColor; + EndColor = endColor; + ShrinkSpeed = shrinkSpeed; + + AltVisual = useAddativeBlend; + GlowCenter = glowCenter; + GlowCenterScale = glowCenterScale; + GlowOpacity = glowOpacity; + FlipHorizontal = flipHorizontal; + NoShrink = noShrink; + + FadeIn = fadeIn; + + if (FadeIn) + Scale = 0f; + Spin = spin; + ColorFadeSpeed = colorFadeSpeed; + } + + public override void Update() + { + if (!FadeIn) + { + if (!NoShrink) + Scale *= 0.95f; + Color = Color.Lerp(InitialColor, EndColor, LifetimeCompletion); + } + else + { + if ((float)Time / (float)Lifetime < 0.5f) + { + Scale = MathHelper.Lerp(Scale, FadeInScale, 0.2f); + } + else + { + Scale = MathHelper.Lerp(Scale, FadeInScale, -0.21f); + } + } + Velocity *= 0.95f; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + ExtraRotation += Spin; + Rotation = Velocity.ToRotation() + MathHelper.PiOver2 + ExtraRotation; + + Stretch.X *= (1 - 0.2f * ShrinkSpeed); + Stretch.Y *= (1 + 0.2f * ShrinkSpeed); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Vector2 scale = Stretch * Scale; + Texture2D texture = ModContent.Request(NewTexture).Value; + + float scaleMult = 1; + if (Main.zenithWorld) + { + DateTime day = DateTime.Now; + if (day.DayOfWeek == DayOfWeek.Tuesday) + { + Texture2D joke = ModContent.Request("CalamityMod/Particles/MammothParticle").Value; + scaleMult = (MathHelper.Lerp(texture.Size().X / joke.Size().X, texture.Size().Y / joke.Size().Y, 0.5f)); + texture = joke; + AltVisual = true; + } + } + + Color col = Color; + + if (AffectedByLight) + { + col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); + } + + if (Pixelate) + { + PixelationManager.AddPixelatedDrawer((_) => + { + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, col * fadeOut, Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.White, 0.8f) * fadeOut * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + }, Enums.GeneralDrawLayer.AfterProjectiles, UseAdditiveBlend ? BlendState.Additive : null); + } + else + { + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, col * fadeOut, Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.White, 0.8f) * fadeOut * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + } + } + } +} diff --git a/Particles/CustomSpark.cs b/Particles/CustomSpark.cs index 72087bb46b..295709d63d 100644 --- a/Particles/CustomSpark.cs +++ b/Particles/CustomSpark.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -22,13 +23,14 @@ namespace CalamityMod.Particles public bool FlipHorizontal = false; public bool NoShrink = false; public float Spin = 0; + public float ColorFadeSpeed = 0; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public bool AltVisual = true; public override bool UseAdditiveBlend => AltVisual; public override bool SetLifetime => true; public override bool UseCustomDraw => true; - public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0) + public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0, float colorFadeSpeed = 3) { Position = relativePosition; Velocity = velocity; @@ -55,6 +57,7 @@ namespace CalamityMod.Particles if (FadeIn) Scale = 0f; Spin = spin; + ColorFadeSpeed = colorFadeSpeed; } public override void Update() @@ -63,7 +66,7 @@ namespace CalamityMod.Particles { if (!NoShrink) Scale *= 0.95f; - Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); } else { @@ -114,9 +117,21 @@ namespace CalamityMod.Particles col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); } - spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); - if (GlowCenter) - spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + if (Pixelate) + { + PixelationManager.AddPixelatedDrawer((_) => + { + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + }, Enums.GeneralDrawLayer.AfterProjectiles, UseAdditiveBlend ? BlendState.Additive : null); + } + else + { + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + } } } } diff --git a/Particles/ThrusterParticle.cs b/Particles/ThrusterParticle.cs new file mode 100644 index 0000000000..92179e0b8e --- /dev/null +++ b/Particles/ThrusterParticle.cs @@ -0,0 +1,219 @@ +using System; +using CalamityMod.Enums; +using CalamityMod.Items.Accessories; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using rail; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class ThrusterParticle : Particle + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public Vector2[] Path = new Vector2[2]; + public Vector2 DashDirection; + private VertexPositionColorTexture[] vertices; + private BasicEffect effect; + + private Vector2 lastPlayerCenter; + private Vector2[] pos = new Vector2[20]; + public float length; + private int time; + private Player Owner; + private int ColorSelection; + + private static readonly Color[] V8Colors = + { + Color.White, + Color.Yellow, + Color.OrangeRed, + Color.Red, + Color.Transparent + }; + + private static readonly Color[] V8000Colors = +{ + Color.White, + Color.LightBlue, + Color.LightCyan, + Color.Cyan, + Color.Transparent + }; + Vector2 GetPlayerDrawCenter(Player p) + { + return p.Center + new Vector2(0f, p.gfxOffY); + } + + public ThrusterParticle(Player player, Vector2 direction, int lifetime, float scale, int colors) + { + Owner = player; + + Position = player.Center; + Velocity = direction; + Scale = scale; + Lifetime = lifetime; + ColorSelection = colors; + + Vector2 start = GetPlayerDrawCenter(player); + Vector2 dir = direction; + + if (dir == Vector2.Zero) + dir = Vector2.UnitX; + + dir.Normalize(); + + length = scale; + Vector2 tip = start + dir * length; + + for (int i = 0; i < pos.Length; i++) + { + float t = i / (float)(pos.Length - 1); + pos[i] = Vector2.Lerp(start, tip, t); + } + + lastPlayerCenter = start; + } + + public override void Update() + { + Path[0] = GetPlayerDrawCenter(Owner); + Path[^1] = Position; + + float lifeProgress = 1f - (time / (float)Lifetime); + if (lifeProgress < 0f) + lifeProgress = 0f; + if (lifeProgress > 1f) + lifeProgress = 1f; + + time++; + + } + + private Color SampleGradient(float t) + { + Color[] ThrusterGradient = ColorSelection == 1 ? V8000Colors : V8Colors; + + t = MathHelper.Clamp(t, 0, 1); + float scaled = t * (ThrusterGradient.Length - 1); + + int index = (int)scaled; + int next = Math.Min(index + 1, ThrusterGradient.Length - 1); + + float interp = scaled - index; + + return Color.Lerp(ThrusterGradient[index], ThrusterGradient[next], interp); + } + + private void BuildPrimitive() + { + int count = pos.Length - 1; + + if (vertices == null || vertices.Length != count * 2) + vertices = new VertexPositionColorTexture[count * 2]; + + float width = 18f; + float lifeProgress = 1f - (time / (float)Lifetime); + + float widthFactor = MathF.Sin(lifeProgress); + + for (int i = 0; i < count; i++) + { + Vector2 current = pos[i]; + + Vector2 direction; + + if (i == count - 1) + direction = pos[i] - pos[i - 1]; + else + direction = pos[i + 1] - pos[i]; + + if (direction == Vector2.Zero) + direction = Vector2.UnitX; + + direction.Normalize(); + + Vector2 normal = direction.RotatedBy(MathHelper.PiOver2); + + float progress = i / (float)(count - 1); + float profile = 0; + if (length < 100) + profile = (float)Math.Sinh(progress * MathHelper.PiOver2) * 1.8f + 0.2f; + else + profile = (float)Math.Sin(progress * Math.PI) * 0.8f + 0.2f; + + float scaledWidth = width * profile * widthFactor; + + Vector2 left = current - normal * scaledWidth; + Vector2 right = current + normal * scaledWidth; + + Color color = SampleGradient(progress); + + vertices[i * 2] = new VertexPositionColorTexture( + new Vector3(left - Main.screenPosition, 0), + color, + new Vector2(progress, 0)); + + vertices[i * 2 + 1] = new VertexPositionColorTexture( + new Vector3(right - Main.screenPosition, 0), + color, + new Vector2(progress, 1)); + } + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + if (pos == null || pos.Length < 2) + return; + + Vector2 drawCenter = GetPlayerDrawCenter(Owner); + Vector2 delta = drawCenter - lastPlayerCenter; + + for (int i = 0; i < pos.Length; i++) + pos[i] += delta; + + lastPlayerCenter = drawCenter; + BuildPrimitive(); + + GraphicsDevice device = Main.graphics.GraphicsDevice; + + RasterizerState rasterizer = new RasterizerState { CullMode = CullMode.None, FillMode = FillMode.Solid }; + + effect ??= new BasicEffect(device) + { + VertexColorEnabled = true, + TextureEnabled = false, + Projection = Matrix.CreateOrthographicOffCenter( + 0, + Main.screenWidth, + Main.screenHeight, + 0, + -1, + 1) + }; + effect.World = Matrix.Identity; + effect.View = Main.GameViewMatrix.ZoomMatrix; + + device.RasterizerState = rasterizer; + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointWrap, default, device.RasterizerState, null, Main.GameViewMatrix.TransformationMatrix); + foreach (EffectPass pass in effect.CurrentTechnique.Passes) + { + pass.Apply(); + + device.DrawUserPrimitives( + PrimitiveType.TriangleStrip, + vertices, + 0, + vertices.Length - 2); + } + } + } +} diff --git a/Particles/VerticalSmear.png b/Particles/VerticalSmear.png index 74d237ccaa..b7dbc5945c 100644 Binary files a/Particles/VerticalSmear.png and b/Particles/VerticalSmear.png differ diff --git a/Particles/VerticalSmearThin.png b/Particles/VerticalSmearThin.png new file mode 100644 index 0000000000..7f60001d96 Binary files /dev/null and b/Particles/VerticalSmearThin.png differ diff --git a/Prefixes/AccessoryPrefix.cs b/Prefixes/AccessoryPrefix.cs index 389f304da9..5a2128f08a 100644 --- a/Prefixes/AccessoryPrefix.cs +++ b/Prefixes/AccessoryPrefix.cs @@ -11,9 +11,10 @@ namespace CalamityMod.Prefixes public new string LocalizationCategory => "Prefixes.Accessory"; public override PrefixCategory Category => PrefixCategory.Accessory; + public static float GetPartialLifeRegenAmount = 0.5f; public override void ApplyAccessoryEffects(Player player) { - player.lifeRegen += GetLifeRegenAmount(); + player.Calamity().partialLifeRegen += GetPartialLifeRegenAmount; } public override void ModifyValue(ref float valueMult) @@ -24,17 +25,11 @@ namespace CalamityMod.Prefixes public LocalizedText LifeRegenTooltip => CalamityUtils.GetText($"{LocalizationCategory}.LifeRegenTooltip"); public override IEnumerable GetTooltipLines(Item item) { - var perSecHP = (GetLifeRegenAmount() / 2.0f).ToString("0.#"); - yield return new TooltipLine(Mod, "CalamityMod:PrefixLifeRegenBoost", LifeRegenTooltip.Format(perSecHP)) + yield return new TooltipLine(Mod, "CalamityMod:PrefixLifeRegenBoost", LifeRegenTooltip.Format(GetPartialLifeRegenAmount.ToRegenPerSecond())) { IsModifier = true }; } - - public static int GetLifeRegenAmount() - { - return 1; - } } public class Dauntless : ModPrefix, ILocalizedModType @@ -63,7 +58,7 @@ namespace CalamityMod.Prefixes public static int GetHealthBoostAmount() { - return 15; + return 20; } } } diff --git a/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs b/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs index 8d7d538926..88bec366ee 100644 --- a/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs +++ b/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Prefixes.VanillaPrefixChanges public override IEnumerator PopulateStats() { - yield return new PrefixDefenseStat(5); + yield return new PrefixDRStat(0.03f); } } @@ -47,7 +47,6 @@ namespace CalamityMod.Prefixes.VanillaPrefixChanges public override IEnumerator PopulateStats() { yield return new PrefixDefenseStat(4); - yield return new PrefixDRStat(0.01f); } } } diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index 886d0f4802..068a7bed17 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -154,8 +154,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.width = Projectile.height = ItemTexture is null ? 1 : ItemTexture.Width(); Projectile.tileCollide = false; Projectile.netImportant = true; - // While having this enabled would be good, it seems to mess with crits on all holdout when applied, so it will stay disabled - //Projectile.ContinuouslyUpdateDamageStats = true; + // Base class assumes that the weapon is a ranged weapon. If it's not a ranged weapon, be sure to override this in its own SetDefaults + // This is necessary in order for dynamic stat updating to function properly! + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnSpawn(IEntitySource source) => OffsetLengthFromArm = MaxOffsetLengthFromArm; diff --git a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 13125da4a5..8c9a1641a9 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -297,6 +297,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.extraUpdates = 0; Projectile.aiStyle = -2; Projectile.DamageType = ModLoader.GetMod("CalamityMod").Find("TrueMeleeDamageClass"); + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 100; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 52afa6e287..730f564336 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; Projectile.timeLeft = timeLeft; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs index 686fb8adac..9caa3a9e92 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs @@ -29,6 +29,7 @@ public class BloodBomb : ModNPC, ILocalizedModType { NPCID.Sets.ProjectileNPC[Type] = true; BloodBombYellow = ModContent.Request("CalamityMod/Projectiles/Boss/BrainOfCthulhu/BloodBomb2"); + this.HideFromBestiary(); } internal static Texture2D GetBombGlow() diff --git a/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs b/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs index c956e3bf77..93eef1ad99 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs @@ -44,6 +44,7 @@ public class BloodScythe : ModProjectile, ILocalizedModType Projectile.damage = 10; Projectile.scale = 0.1f; Projectile.hostile = true; + Projectile.Calamity().DealsDefenseDamage = true; } public override void OnSpawn(IEntitySource source) diff --git a/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs b/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs index 8e6996e16b..961f091fb3 100644 --- a/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs +++ b/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs @@ -46,6 +46,7 @@ public class TelekineticEnemyGrab : ModProjectile, ILocalizedModType Projectile.hostile = true; if(NPC.crimsonBoss != -1) MyTarget = Main.npc[NPC.crimsonBoss].target; + Projectile.Calamity().DealsDefenseDamage = true; } public override void OnSpawn(IEntitySource source) diff --git a/Projectiles/Boss/DeusRitualDrama.cs b/Projectiles/Boss/DeusRitualDrama.cs index 95812d46ba..9c2a1b7d4a 100644 --- a/Projectiles/Boss/DeusRitualDrama.cs +++ b/Projectiles/Boss/DeusRitualDrama.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss public const int TotalSinePeriods = 6; public const int PulseTime = 45; public const int TotalRitualTime = 420; - public const float MaxUpwardRise = 540f; + public const float MaxUpwardRise = 900f; public static readonly Point PulseSize = new(300, 300); public override void SetDefaults() { @@ -42,11 +42,17 @@ namespace CalamityMod.Projectiles.Boss Time++; if (Time == TotalRitualTime - PulseTime) { + SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, Projectile.Center); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType(), 1); + int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)(MaxUpwardRise * 3f), ModContent.NPCType(), 1); if (idx != -1) + { CalamityUtils.BossAwakenMessage(idx); + Main.npc[idx].velocity = Vector2.UnitY * 20f; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx); + } } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 26a5993dbd..5aea36abe3 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -192,6 +192,8 @@ namespace CalamityMod.Projectiles /// Used by Arterial Assault, Deific Amulet's stars, and certain sand projectiles from the Sand Gun. /// public float conditionalHomingRange = 0f; + public float conditionalHomingVelocity = 12f; + public float conditionalHomingInertia = 20f; /// /// Whether or not this proj was spawned with grape beer on @@ -431,7 +433,7 @@ namespace CalamityMod.Projectiles if (ProjectileID.Sets.LightPet[projectile.type] && Main.LocalPlayer.Calamity().ZoneAbyss) EnhancedDarknessSystem.lights.Add(new() { center = projectile.Center, scale = 1 }); - if (projectile.bobber && projectile.type != ProjectileType() && RunFishingMinigames(projectile)) + if (projectile.bobber && projectile.type != ProjectileType() && RunFishingMinigames(projectile) && !Main.LocalPlayer.dead) return false; //Reset the Homing Target immediately before AI can re-set it on applicable projectiles HomingTarget = -1; @@ -3316,6 +3318,12 @@ namespace CalamityMod.Projectiles { projectile.Center = Main.npc[(int)PersistentFishingData].Center + PersistentFishingDataVector2; projectile.velocity = Vector2.Zero; + + if (owner.Distance(Main.npc[(int)PersistentFishingData].Center) > 1450) // Slightly before when fishing lines stop rendering due to distance from target + { + projectile.ai[0] = 1; + } + if (cplayer.mouseRight && projectile.ai[1] == 0 && owner.miscCounter % 10 == 0) { owner.lifeRegenCount -= 600; // -5 health per 10 ticks @@ -4087,20 +4095,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) { @@ -4289,157 +4283,170 @@ namespace CalamityMod.Projectiles arcFlashCooldown--; if (arcFlashCooldown == 0) showArcFlash = true; - if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile) + if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && !grapeBeer) { - CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f,true); + CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, conditionalHomingVelocity, conditionalHomingInertia, true); } - if (brimstoneBullets) - { - PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f); - GeneralParticleHandler.SpawnParticle(spark); - Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.5f, 1f); - } - if (fireBullet) + // Grape beer-specific homing. If the projectile is aligned a certain amount to the direction to the target, it will home in. + else if (conditionalHomingRange > 0f && Main.player[projectile.owner].heldProj != projectile.whoAmI && projectile.aiStyle != ProjAIStyleID.HeldProjectile && grapeBeer) { - if (projectile.timeLeft > 200) + NPC target = projectile.Center.ClosestNPCAt(conditionalHomingRange); + if (target is not null) + { + Vector2 targetDirection = projectile.SafeDirectionTo(target.Center); + + float trackingSpeed = Vector2.Dot(targetDirection, projectile.velocity.SafeNormalize(Vector2.UnitX)) > 0.835f ? 0.01325f : 0f; // Delicate values, please test changes you make to them + + Vector2 currVelocity = projectile.velocity; + + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(targetDirection.ToRotation(), trackingSpeed).ToRotationVector2() * currVelocity.Length(); + } + } + + if (projectile.Opacity > 0 && projectile.scale > 0.01f) // Only apply bullet visuals if the bullet is visible + { + if (brimstoneBullets) + { + PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f * projectile.scale, Color.Crimson * 0.7f); + GeneralParticleHandler.SpawnParticle(spark); + + Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.5f, 1f) * projectile.scale; + } + if (fireBullet) { float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * 8f; - Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); + Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation) * projectile.scale; for (int i = 0; i < 2; ++i) { Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, Main.rand.NextBool() ? 174 : 6, projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.4f, 0.8f); + dust.scale = Main.rand.NextFloat(0.4f, 0.8f) * projectile.scale; } } - } - if (iceBullet) - { - if (projectile.timeLeft > 200) + if (iceBullet) { float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * -8f; - Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); + Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation) * projectile.scale; for (int i = 0; i < 2; ++i) { Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, Main.rand.NextBool() ? 135 : 137, projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.4f, 0.8f); + dust.scale = Main.rand.NextFloat(0.4f, 0.8f) * projectile.scale; } } - } - if (shockBullet) - { - float targetDist = Vector2.Distance(player.Center, projectile.Center); - if (projectile.timeLeft > 200 && targetDist < 1400f) + if (shockBullet) { - SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 1.1f, Color.Turquoise * 0.75f); - GeneralParticleHandler.SpawnParticle(spark); - if (Main.rand.NextBool(3)) + float targetDist = Vector2.Distance(player.Center, projectile.Center); + if (targetDist < 1400f) { - SparkParticle spark2 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.4f), false, 20, 0.4f, Color.Turquoise * 0.75f); - GeneralParticleHandler.SpawnParticle(spark2); + SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 1.1f * projectile.scale, Color.Turquoise * 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + if (Main.rand.NextBool(3)) + { + SparkParticle spark2 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6) * projectile.scale, -projectile.velocity * Main.rand.NextFloat(0.05f, 0.4f), false, 20, 0.4f * projectile.scale, Color.Turquoise * 0.75f); + GeneralParticleHandler.SpawnParticle(spark2); + } } } - } - if ((pearlBullet1 || pearlBullet2 || pearlBullet3)) - { - float targetDist = Vector2.Distance(player.Center, projectile.Center); - if (projectile.timeLeft > 200 && targetDist < 1400f) + if ((pearlBullet1 || pearlBullet2 || pearlBullet3)) { - Color color = pearlBullet1 ? Color.LightBlue : pearlBullet2 ? Color.LightPink : Color.Khaki; - Particle spark = new GlowSparkParticle(projectile.Center + projectile.velocity * 1.5f, -projectile.velocity * 0.05f, false, 3, 0.0093f, color, new Vector2(0.6f, 1.8f), false, false); - GeneralParticleHandler.SpawnParticle(spark); - if (Main.rand.NextBool(5)) + float targetDist = Vector2.Distance(player.Center, projectile.Center); + if (targetDist < 1400f) { - PearlParticle pearl1 = new PearlParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, Main.rand.Next(15, 20 + 1), Main.rand.NextFloat(0.4f, 0.55f), color, 0.9f, Main.rand.NextFloat(1, -1), true); - GeneralParticleHandler.SpawnParticle(pearl1); + Color color = pearlBullet1 ? Color.LightBlue : pearlBullet2 ? Color.LightPink : Color.Khaki; + Particle spark = new GlowSparkParticle(projectile.Center + projectile.velocity * 1.5f, -projectile.velocity * 0.05f, false, 3, 0.0093f * projectile.scale, color, new Vector2(0.6f, 1.8f), false, false); + GeneralParticleHandler.SpawnParticle(spark); + if (Main.rand.NextBool(5)) + { + PearlParticle pearl1 = new PearlParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6) * projectile.scale, -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, Main.rand.Next(15, 20 + 1), Main.rand.NextFloat(0.4f, 0.55f) * projectile.scale, color, 0.9f, Main.rand.NextFloat(1, -1), true); + GeneralParticleHandler.SpawnParticle(pearl1); + } } } - } - if (lifeBullet) - { - float targetDist = Vector2.Distance(player.Center, projectile.Center); - if (projectile.timeLeft > 200 && targetDist < 1400f) + if (lifeBullet) { - SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 0.85f, Color.White * 0.75f); - GeneralParticleHandler.SpawnParticle(spark); - - for (int i = 0; i < 2; ++i) + float targetDist = Vector2.Distance(player.Center, projectile.Center); + if (targetDist < 1400f) { - Dust dust = Dust.NewDustPerfect(projectile.Center + projectile.velocity, DustID.AncientLight, -projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.65f, 0.9f); - dust.alpha = 100; + SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, -projectile.velocity * 0.05f, false, 2, 0.85f * projectile.scale, Color.White * 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int i = 0; i < 2; ++i) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + projectile.velocity, DustID.AncientLight, -projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.65f, 0.9f) * projectile.scale; + dust.alpha = 100; + } + } - } - } - - #region betterLifeBullet - if (betterLifeBullet1) - { - float targetDist = Vector2.Distance(player.Center, projectile.Center); - if (projectile.timeLeft > 200 && targetDist < 1400f) + #region betterLifeBullet + if (betterLifeBullet1) { - int randomColor = Main.rand.Next(1, 3 + 1); - Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki; - - float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * -8f; - Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); - - for (int i = 0; i < 3; ++i) + float targetDist = Vector2.Distance(player.Center, projectile.Center); + if (targetDist < 1400f) { - Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.35f, 0.45f); - dust.color = color; - } + int randomColor = Main.rand.Next(1, 3 + 1); + Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki; - SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f, color); - GeneralParticleHandler.SpawnParticle(spark); + float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * -8f; + Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); - if (Main.rand.NextBool(3)) - { - SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f, color * 0.5f); - GeneralParticleHandler.SpawnParticle(spark3); + for (int i = 0; i < 3; ++i) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.35f, 0.45f) * projectile.scale; + dust.color = color; + } + + SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f * projectile.scale, color); + GeneralParticleHandler.SpawnParticle(spark); + + if (Main.rand.NextBool(3)) + { + SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6) * projectile.scale, -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f * projectile.scale, color * 0.5f); + GeneralParticleHandler.SpawnParticle(spark3); + } } } - } - if (betterLifeBullet2) - { - float targetDist = Vector2.Distance(player.Center, projectile.Center); - if (projectile.timeLeft > 200 && targetDist < 1400f) + if (betterLifeBullet2) { - int randomColor = Main.rand.Next(1, 3 + 1); - Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki; - - float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * 8f; - Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); - - for (int i = 0; i < 3; ++i) + float targetDist = Vector2.Distance(player.Center, projectile.Center); + if (targetDist < 1400f) { - Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.35f, 0.45f); - dust.color = color; - } + int randomColor = Main.rand.Next(1, 3 + 1); + Color color = randomColor == 1 ? Color.LightBlue : randomColor == 2 ? Color.LightPink : Color.Khaki; - SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f, color); - GeneralParticleHandler.SpawnParticle(spark); + float helixOffset = (float)Math.Sin(projectile.timeLeft / 25f * MathHelper.TwoPi) * 8f; + Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation) * projectile.scale; - if (Main.rand.NextBool(3)) - { - SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6), -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f, color * 0.5f); - GeneralParticleHandler.SpawnParticle(spark3); + for (int i = 0; i < 3; ++i) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.35f, 0.45f) * projectile.scale; + dust.color = color; + } + + SparkParticle spark = new SparkParticle(projectile.Center + projectile.velocity, projectile.velocity * 0.05f, false, 2, 0.85f * projectile.scale, color); + GeneralParticleHandler.SpawnParticle(spark); + + if (Main.rand.NextBool(3)) + { + SparkParticle spark3 = new SparkParticle(projectile.Center + Main.rand.NextVector2Circular(6, 6) * projectile.scale, -projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f), false, 20, 0.55f * projectile.scale, color * 0.5f); + GeneralParticleHandler.SpawnParticle(spark3); + } } } + #endregion } - #endregion } } #endregion @@ -4738,16 +4745,13 @@ namespace CalamityMod.Projectiles // Hyperius Overflow if (projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && target.Calamity().hyperiusMarked) { - int damage = 0; - if (target.Calamity().hyperiusDamage < damageDone) - damage = damageDone - target.Calamity().hyperiusDamage; - else - damage = damageDone; + int damageDealt = (int)(damageDone * HyperiusBullet.overflowAppliedMult); + int damage = (int)MathF.Min(target.Calamity().hyperiusDamage / HyperiusBullet.overflowEfficency, damageDealt); - target.Calamity().hyperiusDamage -= damage; + target.Calamity().hyperiusDamage -= (int)(damage * HyperiusBullet.overflowEfficency); // Spawn overflow hit - Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, projectile.owner, target.whoAmI); + Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), damage, 0, projectile.owner, target.whoAmI); overflow.DamageType = projectile.DamageType; overflow.ArmorPenetration = projectile.ArmorPenetration; // Takes the armor pen from what did the hit diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index e906bedf4b..3bdf1d4a51 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -126,6 +126,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) }, { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, { ProjectileID.ChlorophyteDrill, standardDrillTweaks }, + { ProjectileID.ChlorophyteJackhammer, standardDrillTweaks }, { ProjectileID.ChlorophyteOrb, Do(NoPiercing) }, { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, { ProjectileID.CobaltDrill, standardDrillTweaks }, @@ -143,7 +144,7 @@ namespace CalamityMod.Projectiles { ProjectileID.DeadlySphere, Do(LocalIFrames(30)) }, { ProjectileID.EmeraldBolt, Do(NoPiercing) }, { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, - { ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5), SingleHitImmunity) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, @@ -217,7 +218,6 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 3: True Melee support - { ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed }, { ProjectileID.CopperShortswordStab, trueMelee }, { ProjectileID.DarkLance, trueMelee }, { ProjectileID.GoldShortswordStab, trueMelee }, @@ -249,18 +249,30 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 4: Defense Damage support - { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados + { ProjectileID.BombSkeletronPrime, defenseDamage }, + { ProjectileID.CannonballHostile, defenseDamage }, + { ProjectileID.Cthulunado, defenseDamage }, + { ProjectileID.CultistBossFireBall, defenseDamage }, + { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, // Also used by Storm Weaver { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, - { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance - { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes - { ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions - { ProjectileID.PaladinsHammerHostile, defenseDamage }, + { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, + { ProjectileID.FairyQueenLance, defenseDamage }, // EoL lance + { ProjectileID.FairyQueenSunDance, defenseDamage }, // EoL sun dance + { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking scythes + { ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves, reused by Storm Weaver + { ProjectileID.HallowBossRainbowStreak, defenseDamage }, // EoL rainbow bolt + { ProjectileID.HallowBossLastingRainbow, defenseDamage }, // EoL everlasting rainbow { ProjectileID.PhantasmalDeathray, defenseDamage }, { ProjectileID.PhantasmalSphere, defenseDamage }, + { ProjectileID.Present, defenseDamage }, // Santa-NK1 presents + { ProjectileID.QueenSlimeSmash, defenseDamage }, + { ProjectileID.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets, reused by Rev+ Skeletron Prime { ProjectileID.SaucerDeathray, defenseDamage }, + { ProjectileID.SaucerMissile, defenseDamage }, { ProjectileID.Sharknado, defenseDamage }, - { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls + { ProjectileID.Spike, defenseDamage }, // Santa-NK1 spike balls + { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, #endregion #region CATEGORY 5: ID-Static Immunity Frame changes @@ -447,7 +459,6 @@ namespace CalamityMod.Projectiles { ProjectileID.NettleBurstLeft, defaultIFrames }, { ProjectileID.NettleBurstRight, defaultIFrames }, { ProjectileID.NightBeam, defaultIFrames }, - { ProjectileID.NorthPoleSnowflake, defaultIFrames }, { ProjectileID.NorthPoleSpear, defaultIFrames }, { ProjectileID.NorthPoleWeapon, defaultIFrames }, { ProjectileID.NurseSyringeHeal, defaultIFrames }, diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs index 65c00ee576..fb204c9e16 100644 --- a/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.width = Projectile.height = 1; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; } diff --git a/Projectiles/DraedonsArsenal/AugerHoldout.cs b/Projectiles/DraedonsArsenal/AugerHoldout.cs index 55dc54e885..0322389e2f 100644 --- a/Projectiles/DraedonsArsenal/AugerHoldout.cs +++ b/Projectiles/DraedonsArsenal/AugerHoldout.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.width = Projectile.height = 100; Projectile.friendly = true; Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.timeLeft = 5; Projectile.penetrate = -1; Projectile.tileCollide = false; diff --git a/Projectiles/DraedonsArsenal/AugerPull.cs b/Projectiles/DraedonsArsenal/AugerPull.cs index ce365ce951..4abb72e134 100644 --- a/Projectiles/DraedonsArsenal/AugerPull.cs +++ b/Projectiles/DraedonsArsenal/AugerPull.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) + if (target != null && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) { Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); target.velocity = moveDir; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) + if (target != null && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) { if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 300) { diff --git a/Projectiles/DraedonsArsenal/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs index ac72757579..8d57ef5c26 100644 --- a/Projectiles/DraedonsArsenal/AugerSlash.cs +++ b/Projectiles/DraedonsArsenal/AugerSlash.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -81,16 +82,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = (Projectile.ai[2] == 5 ? 35 : 14); - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); if (Projectile.ai[2] == 5) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.3f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (Projectile.ai[2] == 5 ? (1f + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= damageMult; if (Projectile.numHits == 0) { diff --git a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs index 295d12422c..b94a6f39b0 100644 --- a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs +++ b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 25; - targeted.MoveNPC(launchVel, launchPower, true); + targeted.MoveNPC(launchVel, launchPower, true, Owner); } time++; } @@ -54,17 +55,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); + Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 40; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/DraedonsArsenal/NidhoggExplosion.cs b/Projectiles/DraedonsArsenal/NidhoggExplosion.cs index 428ab220d0..dcbec391c1 100644 --- a/Projectiles/DraedonsArsenal/NidhoggExplosion.cs +++ b/Projectiles/DraedonsArsenal/NidhoggExplosion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true)) + if (target != null && target.CanBeMoved()) { if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 500) { diff --git a/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs b/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs index a05b781b79..d3805014a1 100644 --- a/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs +++ b/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs @@ -1,8 +1,9 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; @@ -78,17 +79,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (onKill && Projectile.numHits > 0) Projectile.numHits--; - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); + Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 20; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs b/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs index ba71ef2c53..bcb44deb3c 100644 --- a/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs +++ b/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity, false, 8, MathHelper.Clamp(0.06f - Projectile.numHits * 0.01f, 0f, 0.06f), Effects.ArsenalEffects.ArsenalGaussColor * 0.9f, new Vector2(1f, 0.5f), true, true, 0.9f); GeneralParticleHandler.SpawnParticle(spark); @@ -74,7 +75,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 6; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs b/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs index 8fcacbe4d0..6e597a6e2b 100644 --- a/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs +++ b/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Player Owner = Main.player[Projectile.owner]; float distMult = Utils.GetLerpValue(400, 10, Utils.Distance(target.Center, Projectile.Center), true); Vector2 launchVel = startVel; - target.MoveNPC(launchVel, 10 + 35 * distMult, true); + target.MoveNPC(launchVel, 10 + 35 * distMult, true, Owner); if (Projectile.numHits == 0) { diff --git a/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs b/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs index e931f7966f..f9740376b1 100644 --- a/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs +++ b/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 12, true); + target.MoveNPC(launchVel, 12, true, Owner); } public override void AI() diff --git a/Projectiles/DraedonsArsenal/ShortCircuitShot.cs b/Projectiles/DraedonsArsenal/ShortCircuitShot.cs index 95c1b5dc0d..ac88bcf212 100644 --- a/Projectiles/DraedonsArsenal/ShortCircuitShot.cs +++ b/Projectiles/DraedonsArsenal/ShortCircuitShot.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal target.AddBuff(ModContent.BuffType(), 40); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 8, false); + target.MoveNPC(launchVel, 8, false, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.cs b/Projectiles/DraedonsArsenal/VulcanHoldout.cs index d86259fbd3..fe420edf1f 100644 --- a/Projectiles/DraedonsArsenal/VulcanHoldout.cs +++ b/Projectiles/DraedonsArsenal/VulcanHoldout.cs @@ -40,6 +40,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public int spearFakeCooldown = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { diff --git a/Projectiles/DraedonsArsenal/VulcanProjectile.cs b/Projectiles/DraedonsArsenal/VulcanProjectile.cs index 8f805e1a94..915998cce8 100644 --- a/Projectiles/DraedonsArsenal/VulcanProjectile.cs +++ b/Projectiles/DraedonsArsenal/VulcanProjectile.cs @@ -60,11 +60,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; impactDust(); Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 4; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.cs b/Projectiles/DraedonsArsenal/VulcanSpear.cs index 55707121f9..c921a059c7 100644 --- a/Projectiles/DraedonsArsenal/VulcanSpear.cs +++ b/Projectiles/DraedonsArsenal/VulcanSpear.cs @@ -128,11 +128,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; impactDust(); Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 12; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Healing/BurntSiennaProj.cs b/Projectiles/Healing/BurntSiennaProj.cs index 52efdc55f8..71e7e6d524 100644 --- a/Projectiles/Healing/BurntSiennaProj.cs +++ b/Projectiles/Healing/BurntSiennaProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Healing { Projectile.velocity *= 0.95f; - Projectile.HealingProjectile(3, (int)Projectile.ai[0], 6f, 15f, false); + Projectile.HealingProjectile(2, (int)Projectile.ai[0], 6f, 15f, false); int dusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 1f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/CactusHealOrb.cs b/Projectiles/Healing/CactusHealOrb.cs index 23f54b162e..9925677a4d 100644 --- a/Projectiles/Healing/CactusHealOrb.cs +++ b/Projectiles/Healing/CactusHealOrb.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Healing { Projectile.velocity.Y *= 0.98f; - Projectile.HealingProjectile(15, Projectile.owner, 12f, 15f, false); + Projectile.HealingProjectile(10, Projectile.owner, 12f, 15f, false); int dusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.TerraBlade, 0f, 0f, 100, new Color(0, 200, 0), 1.5f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 22726a859c..289e1475bf 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -30,6 +30,11 @@ namespace CalamityMod.Projectiles.Magic public float postShotFade = 0; public override void SetStaticDefaults() => Main.projFrames[Type] = 8; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } public override void KillHoldoutLogic() { diff --git a/Projectiles/Magic/ApoctosisArrayHoldout.cs b/Projectiles/Magic/ApoctosisArrayHoldout.cs index 61c854a9f0..1cbfe4d6e6 100644 --- a/Projectiles/Magic/ApoctosisArrayHoldout.cs +++ b/Projectiles/Magic/ApoctosisArrayHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int shotNum = 0; public SlotId ionHum { get; set; } + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.dead) diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 2d2b200bac..3fd943a129 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -258,7 +258,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300, true); - target.AddBuff(ModContent.BuffType(), 300, true); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/ArcticBearPawProj.cs b/Projectiles/Magic/ArcticBearPawProj.cs index 900684983b..0caa6c9a1b 100644 --- a/Projectiles/Magic/ArcticBearPawProj.cs +++ b/Projectiles/Magic/ArcticBearPawProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/ArtAttackHoldout.cs b/Projectiles/Magic/ArtAttackHoldout.cs index 3593087353..88b9ed5af2 100644 --- a/Projectiles/Magic/ArtAttackHoldout.cs +++ b/Projectiles/Magic/ArtAttackHoldout.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 70; Projectile.height = 70; Projectile.friendly = false; + Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 90000; diff --git a/Projectiles/Magic/AuroraAustralis.cs b/Projectiles/Magic/AuroraAustralis.cs index 9381f68bf7..de69370f2b 100644 --- a/Projectiles/Magic/AuroraAustralis.cs +++ b/Projectiles/Magic/AuroraAustralis.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 180; + Projectile.timeLeft = 144; Projectile.DamageType = DamageClass.Magic; Projectile.alpha = 255; @@ -77,8 +77,9 @@ namespace CalamityMod.Projectiles.Magic if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 30) { float dmgKBMult = Main.rand.NextFloat(0.25f, 0.75f); - Projectile star = CalamityUtils.ProjectileRain(source, Projectile.Center, Projectile.velocity.X, 100f, 500f, 800f, Main.rand.NextFloat(10f, 20f), ModContent.ProjectileType(), (int)(Projectile.damage * dmgKBMult), Projectile.knockBack * dmgKBMult, Projectile.owner); - star.timeLeft = 120; + Projectile star = CalamityUtils.ProjectileRain(source, Projectile.Center, Projectile.velocity.X, 100f, 500f, 640f, Main.rand.NextFloat(16f, 20f), ModContent.ProjectileType(), (int)(Projectile.damage * dmgKBMult), Projectile.knockBack * dmgKBMult, Projectile.owner); + star.extraUpdates += Main.rand.Next(1, 3); + star.timeLeft = 90; star.ai[0] = 1f; } } diff --git a/Projectiles/Magic/CauldronHoldout.cs b/Projectiles/Magic/CauldronHoldout.cs index 3039f77888..a7dc3080e6 100644 --- a/Projectiles/Magic/CauldronHoldout.cs +++ b/Projectiles/Magic/CauldronHoldout.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } public override void AI() diff --git a/Projectiles/Magic/ChronomancersScytheHoldout.cs b/Projectiles/Magic/ChronomancersScytheHoldout.cs index f594450c37..37ce392c9d 100644 --- a/Projectiles/Magic/ChronomancersScytheHoldout.cs +++ b/Projectiles/Magic/ChronomancersScytheHoldout.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 60; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; diff --git a/Projectiles/Magic/ChronomancersScytheSwing.cs b/Projectiles/Magic/ChronomancersScytheSwing.cs index 07c79e9f38..6ad0a08f6a 100644 --- a/Projectiles/Magic/ChronomancersScytheSwing.cs +++ b/Projectiles/Magic/ChronomancersScytheSwing.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 3312bcb246..e9319efd17 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 30; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; } @@ -148,7 +149,7 @@ namespace CalamityMod.Projectiles.Magic if (Owner.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.MountedCenter + direction * 30f, direction * 35, ModContent.ProjectileType(), (int)Projectile.damage * (ShotProjectiles + 1), Projectile.knockBack, Owner.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.MountedCenter + direction * 30f, direction * 35, ModContent.ProjectileType(), (int)Projectile.damage * 7, Projectile.knockBack, Owner.whoAmI); } Color pulseColor = Main.rand.NextBool() ? Color.Coral : Color.DeepSkyBlue; diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index a25787701b..9c249aed59 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn2, 180); } } diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index 310cec8de3..136a815361 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index 07ddff29fc..bb8e559c85 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/FireImplosion.cs b/Projectiles/Magic/FireImplosion.cs index b053d51ba6..aedb225937 100644 --- a/Projectiles/Magic/FireImplosion.cs +++ b/Projectiles/Magic/FireImplosion.cs @@ -98,6 +98,7 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; if (frigidFlash) { target.AddBuff(BuffID.OnFire3, 30); @@ -112,7 +113,7 @@ namespace CalamityMod.Projectiles.Magic modifiers.SourceDamage *= damageMult * (frigidFlash ? 0.5f : 1); // Frigidflash explosion are spawned at full power, so their damage is reduced here // The vortex sucks in enemies - target.MoveNPC(-pushVelocity, customKnockback, frigidFlash); + target.MoveNPC(-pushVelocity, customKnockback, frigidFlash, Owner); } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Magic/FleshTotemEyes.png b/Projectiles/Magic/FleshTotemEyes.png new file mode 100644 index 0000000000..22d855200d Binary files /dev/null and b/Projectiles/Magic/FleshTotemEyes.png differ diff --git a/Projectiles/Magic/FleshTotemMinion.cs b/Projectiles/Magic/FleshTotemMinion.cs new file mode 100644 index 0000000000..065e405317 --- /dev/null +++ b/Projectiles/Magic/FleshTotemMinion.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories; +using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class FleshTotemMinion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + + public int pulseTimer = 0; + + static Asset totemEyeTexture; + 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; + Projectile.height = 26; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Magic; + } + + public override void AI() + { + 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) + { + modPlayer.fleshTotemMinion = false; + } + if (modPlayer.fleshTotemMinion) + { + Projectile.timeLeft = 2; + } + } + 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; + Projectile.rotation = MathHelper.Pi; + } + else + { + 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 20 mana + if (pulseTimer >= pulseMax) + { + if (visuals) + { + 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)); + 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++) + { + 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 = 20; + player.statMana += manaGained; + if (Main.myPlayer == player.whoAmI) + player.ManaEffect(manaGained); + + if (player.statMana > player.statManaMax2) + player.statMana = player.statManaMax2; + pulseTimer = 0; + } + 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]; + CalamityPlayer modPlayer = player.Calamity(); + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + totemEyeTexture ??= ModContent.Request("CalamityMod/Projectiles/Magic/FleshTotemEyes"); + Texture2D totemEyes = totemEyeTexture.Value; + Vector2 eyesDrawPosition = player.Center - Main.screenPosition + Vector2.UnitY * -69f; + Vector2 drawPosition = player.Center - Main.screenPosition + Vector2.UnitY * -67f; + Vector2 origin = texture.Size() * 0.5f; + + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor) * (visuals ? 1f : 0.5f), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + if (visuals) + { + 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); + return false; + } + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Magic/FleshTotemMinion.png b/Projectiles/Magic/FleshTotemMinion.png new file mode 100644 index 0000000000..3d5cb92fcf Binary files /dev/null and b/Projectiles/Magic/FleshTotemMinion.png differ diff --git a/Projectiles/Magic/FleshTotemSoul.cs b/Projectiles/Magic/FleshTotemSoul.cs new file mode 100644 index 0000000000..5efaa323c3 --- /dev/null +++ b/Projectiles/Magic/FleshTotemSoul.cs @@ -0,0 +1,108 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class FleshTotemSoul : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "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() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 22; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = 1; + Projectile.timeLeft = 240; + Projectile.tileCollide = false; + Projectile.extraUpdates = 1; + Projectile.scale = 0.5f; + } + + public override void AI() + { + Time++; + // Handle animation + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + if (Time >= 45f) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 1200f, 30f, 40f); + } + //Welcome back to Sunny tries to smash 5 different visual effects together in the effort to get something to look good + 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.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 && 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, 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); + dust.velocity = dust.velocity.RotatedByRandom(0f); + } + } + Projectile.rotation = Projectile.velocity.ToRotation() + -MathHelper.PiOver2; + // Blue light + Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.7f); + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D Texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Rectangle frame = Texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); + Vector2 drawPosition; + Vector2 origin = frame.Size() * 0.5f; + + drawPosition = Projectile.Center - Main.screenPosition; + Main.EntitySpriteDraw(Texture, drawPosition, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override bool? CanDamage() => Time >= 15f; + + public override void OnKill(int timeLeft) + { + if (visuals) + { + 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/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index 1cae76f266..2137c1e5a2 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -31,6 +31,12 @@ namespace CalamityMod.Projectiles.Magic public float Windup { get; set; } = StarterWindup; public Color EffectsColor { get; set; } = Color.MediumSlateBlue; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (HeldItem.type != Owner.HeldItem.type || Owner.CantUseHoldout()) diff --git a/Projectiles/Magic/HadalUrnHoldout.cs b/Projectiles/Magic/HadalUrnHoldout.cs index c5d7c6e301..1387155526 100644 --- a/Projectiles/Magic/HadalUrnHoldout.cs +++ b/Projectiles/Magic/HadalUrnHoldout.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/HeliumFlashHoldout.cs b/Projectiles/Magic/HeliumFlashHoldout.cs index bf3d5019cd..1c88496522 100644 --- a/Projectiles/Magic/HeliumFlashHoldout.cs +++ b/Projectiles/Magic/HeliumFlashHoldout.cs @@ -29,6 +29,12 @@ namespace CalamityMod.Projectiles.Magic public int starcoreFrameCounter = 0; public int starcoreFrame = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type) diff --git a/Projectiles/Magic/HeresyProj.cs b/Projectiles/Magic/HeresyProj.cs index e14d893f13..487a67cc6c 100644 --- a/Projectiles/Magic/HeresyProj.cs +++ b/Projectiles/Magic/HeresyProj.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index b0bdd946ac..2337b0b96e 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -132,6 +132,6 @@ namespace CalamityMod.Projectiles.Magic } public override bool? CanDamage() => Timer == 140f ? null : false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 60); } } diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index 4ce8847842..860cb394ed 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); if (Projectile.damage > 10) { diff --git a/Projectiles/Magic/IncineratingFireball.cs b/Projectiles/Magic/IncineratingFireball.cs index 77ef628275..eee796c453 100644 --- a/Projectiles/Magic/IncineratingFireball.cs +++ b/Projectiles/Magic/IncineratingFireball.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.alpha = 255; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.timeLeft = 60000; Projectile.tileCollide = false; diff --git a/Projectiles/Magic/IonBlasterHoldout.cs b/Projectiles/Magic/IonBlasterHoldout.cs index 53fa872562..967b4dc028 100644 --- a/Projectiles/Magic/IonBlasterHoldout.cs +++ b/Projectiles/Magic/IonBlasterHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int shotNum = 0; public SlotId ionHum { get; set; } + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.dead) diff --git a/Projectiles/Magic/MoonSigil.cs b/Projectiles/Magic/MoonSigil.cs new file mode 100644 index 0000000000..60a6503f4d --- /dev/null +++ b/Projectiles/Magic/MoonSigil.cs @@ -0,0 +1,185 @@ +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.Magic +{ + public class MoonSigil : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public Player Owner => Main.player[Projectile.owner]; + public bool visuals => Owner.Calamity().mageCrownVisibility; // Enables/disables visuals and sounds based on accessory visibility + public override void SetDefaults() + { + Projectile.width = 20; + Projectile.height = 20; + Projectile.scale = 0.9f; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.extraUpdates = 1; + } + + public override void AI() + { + bool isActive = Projectile.type == ModContent.ProjectileType(); + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (!modPlayer.moonCrown) + { + modPlayer.mageCrownCount = 0; + return; + } + if (isActive) + { + if (player.dead) + { + modPlayer.moonCrown = false; + } + if (modPlayer.moonCrown) + { + Projectile.timeLeft = 2; + } + } + Projectile.rotation += MathHelper.ToRadians(1.3f); + + int cap = modPlayer.mageCrownCount; + if (Owner.ownedProjectileCounts[Type] > cap) + { + Projectile.Kill(); + return; + } + int sigils = 0; + int sigilAmt = 0; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && Main.projectile[i].type == Projectile.type) + { + if (Main.projectile[i] == Projectile) + { + sigils = sigilAmt; + } + sigilAmt++; + } + } + float f = ((float)sigils / (float)sigilAmt + player.miscCounterNormalized * 2f) * ((float)Math.PI * 2f); + float num = 24f + (float)sigilAmt * 4.5f; + Vector2 vector = player.position - player.oldPosition; + base.Projectile.Center += vector; + Vector2 vector2 = f.ToRotationVector2(); + Projectile.localAI[0] = vector2.Y; + Vector2 value = (player.Center + new Vector2(0f, 5f)) + vector2 * new Vector2(1f, 0.05f) * num; + base.Projectile.Center = value; + + if (!Projectile.FinalExtraUpdate()) + return; + + float lightScalar = Main.rand.NextFloat(0.9f, 1.1f) * Main.essScale; + Lighting.AddLight(Projectile.Center, 0.3f * lightScalar, 0.26f * lightScalar, 0.15f * lightScalar); + + Vector2 direction = player.Center - Projectile.Center; + direction.Normalize(); + direction *= 6f; + if (direction.X >= 0.25f) + { + Projectile.direction = -1; + } + else if (direction.X < -0.25f) + { + Projectile.direction = 1; + } + Projectile.spriteDirection = Projectile.direction; + + } + public override void OnSpawn(IEntitySource source) + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (visuals) + { + SoundEngine.PlaySound(SoundID.Item8, player.Center); + } + if (modPlayer.mageCrownCount == 10) + { + SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact with { Volume = 1.3f }, player.Center); + } + } + public override void OnKill(int timeLeft) + { + 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++) + { + for (int j = 0; j < 5; j++) + { + Vector2 dustspeed = new Vector2(dustSp, dustSp).RotatedBy(MathHelper.ToRadians(dustD)); + int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(213, 242, 232, 200), 1f); + Main.dust[d].noGravity = true; + Main.dust[d].position = Projectile.Center; + Main.dust[d].velocity = dustspeed; + } + dustD += 90; + } + 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) + { + if (Projectile.localAI[0] < 0) + { + overPlayers.Add(index); + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.mageCrownCount >= 10 && visuals) + { + 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); + } + } + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * (visuals ? 1f : 0.5f), Projectile.rotation, texture.Size() * 0.5f, Projectile.scale * 0.9f, SpriteEffects.None, 0); + return false; + } + public override bool? CanDamage() => false; + } +} 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/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index 54bed4ff59..4ab9fe2854 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -30,6 +30,11 @@ namespace CalamityMod.Projectiles.Magic private ref float ChargeTowardsNextShot => ref Projectile.ai[1]; public override void SetStaticDefaults() => Main.projFrames[Type] = 4; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } public float postShotFade = 0; diff --git a/Projectiles/Magic/NebulousCataclysm_Held.cs b/Projectiles/Magic/NebulousCataclysm_Held.cs index 016f2c14e1..0a1276b3f3 100644 --- a/Projectiles/Magic/NebulousCataclysm_Held.cs +++ b/Projectiles/Magic/NebulousCataclysm_Held.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index 4d83523c81..71f91a0114 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -27,6 +27,12 @@ namespace CalamityMod.Projectiles.Magic public float Windup { get; set; } = StarterWinup; public Color EffectsColor { get; set; } = Color.MediumVioletRed; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout() && PostFireCooldown <= 0) diff --git a/Projectiles/Magic/PhantasmalFuryProj.cs b/Projectiles/Magic/PhantasmalFuryProj.cs index ac35739eca..9c79b761b0 100644 --- a/Projectiles/Magic/PhantasmalFuryProj.cs +++ b/Projectiles/Magic/PhantasmalFuryProj.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = (Owner.Center - target.Center).SafeNormalize(Vector2.UnitY) * -10 * (launched ? 0.5f : 1); - target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true); + target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true, Owner); } public override bool? CanHitNPC(NPC target) { diff --git a/Projectiles/Magic/Phantom.cs b/Projectiles/Magic/Phantom.cs index eb3af39916..1b12a7f910 100644 --- a/Projectiles/Magic/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true); + target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true, Owner); } public override bool? CanHitNPC(NPC target) diff --git a/Projectiles/Magic/PrimordialAncientExplosion.cs b/Projectiles/Magic/PrimordialAncientExplosion.cs index f5783774a8..371b6cb0a1 100644 --- a/Projectiles/Magic/PrimordialAncientExplosion.cs +++ b/Projectiles/Magic/PrimordialAncientExplosion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 40, true); + target.MoveNPC(launchVel, 40, true, Owner); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.95f); diff --git a/Projectiles/Magic/PrimordialEarthExplosion.cs b/Projectiles/Magic/PrimordialEarthExplosion.cs index d35a7323a5..95ffc29e30 100644 --- a/Projectiles/Magic/PrimordialEarthExplosion.cs +++ b/Projectiles/Magic/PrimordialEarthExplosion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.9f); diff --git a/Projectiles/Magic/PurgeGuzzlerHoldout.cs b/Projectiles/Magic/PurgeGuzzlerHoldout.cs index 5041446fb2..a465def812 100644 --- a/Projectiles/Magic/PurgeGuzzlerHoldout.cs +++ b/Projectiles/Magic/PurgeGuzzlerHoldout.cs @@ -35,6 +35,13 @@ namespace CalamityMod.Projectiles.Magic public Color color1 = Color.Goldenrod; public Color color2 = Color.Orange; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (!isOnCooldown && (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type)) diff --git a/Projectiles/Magic/RainbowPartyCannonProjectile.cs b/Projectiles/Magic/RainbowPartyCannonProjectile.cs index e891606c3b..7e4a2d6d76 100644 --- a/Projectiles/Magic/RainbowPartyCannonProjectile.cs +++ b/Projectiles/Magic/RainbowPartyCannonProjectile.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 66; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/RancorHoldout.cs b/Projectiles/Magic/RancorHoldout.cs index 0a72c89b15..8091e26805 100644 --- a/Projectiles/Magic/RancorHoldout.cs +++ b/Projectiles/Magic/RancorHoldout.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.hide = true; Projectile.timeLeft = 90000; diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index 05e4966f84..c79eea665f 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = Projectile.height = 32; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 02d318930e..908e460f4d 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.timeLeft = 90000; } diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index 0183bcdc66..9f2231225d 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -266,11 +266,11 @@ namespace CalamityMod.Projectiles.Magic } // Might launches enemies - if (GetSoulEffects((int)Projectile.ai[0]) == SoulType.Might && target.CanBeMoved(false)) + if (GetSoulEffects((int)Projectile.ai[0]) == SoulType.Might && target.CanBeMoved()) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Vector2 launchVel = Utils.DirectionTo(owner.Center, owner.Calamity().mouseWorld) - Vector2.UnitY * 5f; - target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false); + target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false, owner); } } diff --git a/Projectiles/Magic/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs index 4b0bda748a..04fec18c74 100644 --- a/Projectiles/Magic/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -75,13 +75,13 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // Might launches enemies - if (SHPB.GetSoulEffects((int)Projectile.ai[0]) == SHPB.SoulType.Might && target.CanBeMoved(false)) + if (SHPB.GetSoulEffects((int)Projectile.ai[0]) == SHPB.SoulType.Might && target.CanBeMoved()) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Player owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(owner.Center, owner.Calamity().mouseWorld) - Vector2.UnitY * 5f; - target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false); + target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false, owner); } } diff --git a/Projectiles/Magic/SHPV.cs b/Projectiles/Magic/SHPV.cs index e89fb91356..92937065c8 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -49,6 +49,8 @@ namespace CalamityMod.Projectiles.Magic { Projectile.width = Projectile.height = 70; Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; } diff --git a/Projectiles/Magic/Snowball.cs b/Projectiles/Magic/Snowball.cs index e62ac2ff5b..5431ead7f9 100644 --- a/Projectiles/Magic/Snowball.cs +++ b/Projectiles/Magic/Snowball.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index edcd3fe031..c6d7098a65 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = -1; Projectile.timeLeft = 280; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.coldDamage = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 40; diff --git a/Projectiles/Magic/SparklingEmpressHoldout.cs b/Projectiles/Magic/SparklingEmpressHoldout.cs index 92726655cf..c9725236cd 100644 --- a/Projectiles/Magic/SparklingEmpressHoldout.cs +++ b/Projectiles/Magic/SparklingEmpressHoldout.cs @@ -35,6 +35,12 @@ namespace CalamityMod.Projectiles.Magic public int CooldownTime => 20 * (deservesMana ? 2 : 1); private const int FishShineTime = 150; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (HeldItem.type != Owner.HeldItem.type || Owner.dead) diff --git a/Projectiles/Magic/SpectralFeather.cs b/Projectiles/Magic/SpectralFeather.cs new file mode 100644 index 0000000000..1949f0703d --- /dev/null +++ b/Projectiles/Magic/SpectralFeather.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CalPlayer; +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.Magic +{ + public class SpectralFeather : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "CalamityMod/Projectiles/Magic/StickyFeather"; + public Player Owner => Main.player[Projectile.owner]; + public bool visuals => Owner.Calamity().mageCrownVisibility; // Enables/disables visuals and sounds based on accessory visibility + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.scale = 0.8f; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.extraUpdates = 1; + } + + public override void AI() + { + bool isActive = Projectile.type == ModContent.ProjectileType(); + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (!modPlayer.featherCrown) + { + modPlayer.mageCrownTimer = 0; + modPlayer.mageCrownCount = 0; + return; + } + if (isActive) + { + if (player.dead) + { + modPlayer.featherCrown = false; + } + if (modPlayer.featherCrown) + { + Projectile.timeLeft = 2; + } + } + Projectile.rotation += MathHelper.ToRadians(1.3f); + + int cap = modPlayer.mageCrownCount; + if (Owner.ownedProjectileCounts[Type] > cap) + { + Projectile.Kill(); + return; + } + int feathers = 0; + int featherAmt = 0; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Projectile.owner && Main.projectile[i].type == Projectile.type) + { + if (Main.projectile[i] == Projectile) + { + feathers = featherAmt; + } + featherAmt++; + } + } + float f = ((float)feathers / (float)featherAmt + player.miscCounterNormalized * 2f) * ((float)Math.PI * 2f); + float num = 18f + (float)featherAmt; + Vector2 vector = player.position - player.oldPosition; + base.Projectile.Center += vector; + Vector2 vector2 = f.ToRotationVector2(); + Projectile.localAI[0] = vector2.Y; + Vector2 value = (player.Center + new Vector2(0f, -25f)) + vector2 * new Vector2(1f, 0.05f) * num; + base.Projectile.Center = value; + + 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); + + Vector2 direction = player.Center - Projectile.Center; + direction.Normalize(); + direction *= 6f; + if (direction.X >= 0.25f) + { + Projectile.direction = -1; + } + else if (direction.X < -0.25f) + { + Projectile.direction = 1; + } + Projectile.spriteDirection = Projectile.direction; + + } + public override void OnSpawn(IEntitySource source) + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (visuals) + { + SoundEngine.PlaySound(SoundID.Item20 with { volume = 0.6f }, player.Center); + } + if (modPlayer.mageCrownCount == 5) + { + SoundStyle max = new("CalamityMod/Sounds/Item/AscendantOff"); + SoundEngine.PlaySound(max with { volume = 0.6f }, player.Center); + } + } + + public override void OnKill(int timeLeft) + { + float dustSp = 0.2f; + int dustD = 0; + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 5; j++) + { + Vector2 dustspeed = new Vector2(dustSp, dustSp).RotatedBy(MathHelper.ToRadians(dustD)); + int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(213, 242, 232, 200), 1f); + Main.dust[d].noGravity = true; + Main.dust[d].position = Projectile.Center; + Main.dust[d].velocity = dustspeed; + dustSp += 0.2f; + } + dustD += 90; + dustSp = 0.2f; + } + if (!Main.dedServ) + { + for (int i = 0; i < 4; i++) + { + Particle dust = new GlowOrbParticle(Projectile.Center, Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(2.5f, 3), false, 20, Main.rand.NextFloat(0.5f, 0.65f), Main.rand.NextBool(5) ? Color.AliceBlue : Color.DodgerBlue, true, false, false); + GeneralParticleHandler.SpawnParticle(dust); + } + } + 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.featherCrown) + { + SoundStyle f = new("CalamityMod/Sounds/Item/MeldShoot"); + SoundEngine.PlaySound(f with { Volume = 0.35f, Pitch = 0.95f }, Projectile.Center); + SoundStyle aud = new("CalamityMod/Sounds/Item/MittFail"); + SoundEngine.PlaySound(aud with { Volume = 0.6f, Pitch = 0 }, Projectile.Center); + SoundStyle shed = new("CalamityMod/Sounds/Item/FeatherBreak"); + SoundEngine.PlaySound(shed with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + if (Projectile.localAI[0] < 0) + { + overPlayers.Add(index); + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.mageCrownCount == 5 && visuals) + { + for (int i = 0; i < 6; 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.01f, SpriteEffects.None, 0f); + } + } + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * (visuals ? 1f : 0.5f), Projectile.rotation, texture.Size() * 0.5f, Projectile.scale * 0.9f, SpriteEffects.None, 0); + return false; + } + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Magic/SylvestaffHoldout.cs b/Projectiles/Magic/SylvestaffHoldout.cs index eb344012ef..61b6a1ee5a 100644 --- a/Projectiles/Magic/SylvestaffHoldout.cs +++ b/Projectiles/Magic/SylvestaffHoldout.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index 61bf80969b..8c6f71bd4a 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; + Projectile.localNPCHitCooldown = Lifetime / 2; // The beam lasts for only some frames and fades out over that time. Projectile.timeLeft = Lifetime; diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index 64143f3e25..dfc485f8d0 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -13,6 +14,9 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Items/Weapons/Magic/ValkyrieRay"; private const float AimResponsiveness = 0.66f; + public ref float Timer => ref Projectile.ai[0]; + public ref float Fired => ref Projectile.ai[1]; + public ref float TimeRate => ref Projectile.ai[2]; public override void SetDefaults() { @@ -25,8 +29,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.timeLeft = 900; } - // ai[0] is a time-dilated frame counter. ai[1] is whether the beam has already fired. - // localAI[0] is the rate at which the "frame" counter increases. public override void AI() { Player player = Main.player[Projectile.owner]; @@ -34,20 +36,19 @@ namespace CalamityMod.Projectiles.Magic // Calculate how quickly the staff should charge. Charge increases by some number close to 1 every frame. // Speed increasing reforges make this number greater than 1. Slowing reforges make it smaller than 1. - if (Projectile.localAI[0] == 0f) - Projectile.localAI[0] = (ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.HeldItem.useTime; + if (TimeRate == 0f) + TimeRate = MathF.Round((float)(ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.HeldItem.useTime, 3); // Increment the timer for the staff. If the timer has passed the total time, destroy it. - Projectile.ai[0] += Projectile.localAI[0]; + Timer += TimeRate; int maxTime = ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames; - if (Projectile.ai[0] > maxTime) + if (Timer > maxTime) { Projectile.Kill(); return; } - // Compute the weapon's charge. - float chargeLevel = MathHelper.Clamp(Projectile.ai[0] / ValkyrieRay.ChargeFrames, 0f, 1f); + float chargeLevel = MathHelper.Clamp(Timer / ValkyrieRay.ChargeFrames, 0f, 1f); // Common code among holdouts to keep the holdout projectile directly in the player's hand UpdatePlayerVisuals(player, rrp); @@ -58,9 +59,9 @@ namespace CalamityMod.Projectiles.Magic Vector2 gemPos = Projectile.Center + gemOffset.RotatedBy(angle); // Firing or charging? - if (chargeLevel >= 1f && Projectile.ai[1] == 0f) + if (chargeLevel >= 1f && Fired == 0f) { - Projectile.ai[1] = 1f; // so it never fires again + Fired = 1f; // so it never fires again FiringEffects(gemPos); if (Projectile.owner == Main.myPlayer) { @@ -68,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic laser.Center = gemPos; } } - else if (Projectile.ai[1] == 0f) + else if (Fired == 0f) { // The player can constantly re-aim the staff while it's charging, but once it fires it is locked in place. UpdateAim(rrp, Projectile.velocity.Length()); diff --git a/Projectiles/Magic/VeeringWindFrostWave.cs b/Projectiles/Magic/VeeringWindFrostWave.cs index 5a0b2b5596..ee7a6c11d8 100644 --- a/Projectiles/Magic/VeeringWindFrostWave.cs +++ b/Projectiles/Magic/VeeringWindFrostWave.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } } } diff --git a/Projectiles/Magic/VitriolicViperHoldout.cs b/Projectiles/Magic/VitriolicViperHoldout.cs index ae04de7f52..86f1f61480 100644 --- a/Projectiles/Magic/VitriolicViperHoldout.cs +++ b/Projectiles/Magic/VitriolicViperHoldout.cs @@ -38,6 +38,12 @@ namespace CalamityMod.Projectiles.Magic public float vortexRotation = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Magic; + } + public override void KillHoldoutLogic() { if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.HeldItem.type) diff --git a/Projectiles/Magic/VolterionHoldout.png b/Projectiles/Magic/VolterionHoldout.png index ade1fd2fec..5b6ddae9a0 100644 Binary files a/Projectiles/Magic/VolterionHoldout.png and b/Projectiles/Magic/VolterionHoldout.png differ diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index ea5730ca5b..2ca085d156 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 18; Projectile.height = 18; Projectile.DamageType = DamageClass.Magic; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.alpha = 255; // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. diff --git a/Projectiles/Melee/BasherHoldout.cs b/Projectiles/Melee/BasherHoldout.cs index ff82182a62..3428fbe1dc 100644 --- a/Projectiles/Melee/BasherHoldout.cs +++ b/Projectiles/Melee/BasherHoldout.cs @@ -1,250 +1,294 @@ -using CalamityMod.Buffs.StatDebuffs; +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; -using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +using static Terraria.Player; namespace CalamityMod.Projectiles.Melee { [PierceResistException] - public class BasherHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + public class BasherHoldout : ModProjectile, ILocalizedModType { - public override int AssignedItemID => ModContent.ItemType(); - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/Basher"; - public override float HitboxOutset => 60; - - public override Vector2 HitboxSize => new Vector2(80, 80); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(-7, 65); - public Vector2 mousePos; - public Vector2 aimVel; - public bool doSwing = true; - public bool postSwing = false; - public float fadeIn = 0; - public int useAnim; - public int swingCount; - public bool finalFlip = false; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public int fireRate => (int)((Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates) / 2.75f); + public int time = 0; + public Vector2 toMouse = Vector2.Zero; + public int cooldown => (int)(-Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Visual effects of the blade + // Checks to make sure sounds only happen once per swing + public bool makeSound = true; + public bool performSwing = false; + public float enabledHitbox = 0; // Deals damage when above 0, ticks down quickly + public float angledHold = 0; // Adds some angle based on swing direction + public float rumble = 0; + public override bool? CanDamage() => enabledHitbox > 0 ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float outset = 15 * Projectile.scale; + Vector2 hitboxPosition = Owner.Center + toMouse * outset; + float hitboxSize = 70 * Projectile.scale; + return CalamityUtils.CircularHitboxCollision(hitboxPosition, hitboxSize, targetHitbox); + } public override void SetDefaults() { - base.SetDefaults(); + Projectile.width = Projectile.height = 100; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.extraUpdates = 2; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.noEnchantmentVisuals = true; + Projectile.scale = 0; } - public override void WhenSpawned() + public void OnSpawn() { - Projectile.knockBack = 0; - Projectile.scale = 1; - Projectile.ai[1] = 1; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - useAnim = Owner.itemAnimationMax; - - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - - FlipAsSword = Owner.direction == -1 ? true : false; - } - - public override void UseStyle() - { - AnimationProgress = Animation % useAnim; - DrawUnconditionally = false; - - if (CanHit || postSwing) - mousePos = Owner.Center - aimVel; - else + if (time == 0) { - mousePos = Owner.Calamity().mouseWorld; + Projectile.knockBack = 0; + attackTimer = cooldown; + swingCount = 1; } + } + public void ResetVariables() // After a swing, reset/adjust many stats + { + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; + Projectile.numHits = 0; + swingCount++; + makeSound = true; + enabledHitbox = 0; + Projectile.ForceNetUpdate(); + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); - if (CanHit && Owner.Calamity().mouseRight) - fadeIn = MathHelper.Lerp(fadeIn, 1, 0.1f); - else - fadeIn = MathHelper.Lerp(fadeIn, 0, 0.15f); + float angleVariation = (float)Math.Sin(time * 0.06f / Projectile.MaxUpdates) * 0.1f; + float outwardDistance = 5; + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + (bladeRot + angleVariation) * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * outwardDistance; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); - if (!doSwing) + Projectile.velocity = toMouse.RotatedBy((bladeRot + angleVariation + angledHold) * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Projectile.scale = MathHelper.Lerp(Projectile.scale, Owner.GetMeleeScale() + 0.1f, 0.3f / Projectile.MaxUpdates); + toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + OnSpawn(); + + if (enabledHitbox > 0) { - for (int i = 0; i < Main.maxNPCs; i++) - Projectile.localNPCImmunity[i] = 0; - - Projectile.numHits = 0; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - FlipAsSword = Owner.direction == -1 ? true : false; - doSwing = true; - swingCount++; - finalFlip = false; + bladefx = MathHelper.Lerp(bladefx, 1, 0.5f / Projectile.MaxUpdates * Owner.meleeSpeed); + if (Projectile.FinalExtraUpdate()) + enabledHitbox--; } else + bladefx = MathHelper.Lerp(bladefx, 0, 0.55f / Projectile.MaxUpdates * Owner.meleeSpeed); + + if (attackTimer == -1 || time < 25) { - if (!CanHit && !postSwing) + if (Owner.HeldItem.type != ItemType() || Main.mapFullscreen || Owner.mouseInterface || Owner.dead) { - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; + Projectile.Kill(); + return; } + } + else + Owner.itemTime = Owner.itemAnimation = 5; + + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging + { + Timers(); + + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + + float lerpSpeed = 0.2f / Projectile.MaxUpdates * Owner.meleeSpeed; + float maxAngle = MathHelper.PiOver4; + if (swingCount % 2 == 0) + angledHold = MathHelper.Lerp(angledHold, maxAngle, lerpSpeed); else + angledHold = MathHelper.Lerp(angledHold, -maxAngle, lerpSpeed); + + if (attackTimer == 0) // Reset a few things in prep for the next swing + ResetVariables(); + else // Wind up animation in prep for the next swing { - if ((Owner.Center - aimVel).X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp2 = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + float start = -MathHelper.Pi * swingDir; + float end = -MathHelper.PiOver4 * 3 * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp2, 2f, 2f)); + + if (Owner.controlUseItem && lerp > 0.9f) + performSwing = true; } - - - Projectile.rotation = Projectile.rotation.AngleLerp(Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f), 0.1f); + return; + } + #endregion - if (AnimationProgress < (useAnim / 3)) + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown; + performSwing = false; + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float start = -MathHelper.PiOver4 * 3 * swingDir; + float end = MathHelper.Pi * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp, 5f, 3f)); + + if (lerp > 0.3f && lerp < 0.8f) { - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - postSwing = false; - if (AnimationProgress == 0) - { - doSwing = false; - Projectile.ai[1] = -Projectile.ai[1]; - } - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction), 0.2f); - } - else - { - if (!finalFlip) - { - FlipAsSword = Owner.direction < 0 ? true : false; - } + Vector2 dustPosition = Projectile.Center + Projectile.velocity * 78 * Projectile.scale; + Vector2 swingVel = Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (swingCount % 2 == 0 ? -1 : 1) * Owner.direction); + Dust dust = Dust.NewDustPerfect(dustPosition, DustID.Pearlwood); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.85f, 1.3f); + dust.velocity = swingVel.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.5f, 2.5f); - float time = (AnimationProgress) - (useAnim / 3); - float timeMax = useAnim - (useAnim / 3); - - if (time == (int)(timeMax * 0.4f)) - { - SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.35f, -0.55f) }, Projectile.Center); - } - if ( time > (int)(timeMax * 0.2f) && time < (int)(timeMax * 0.85f)) - { - CanHit = true; - - Vector2 particleVel = new Vector2(0, 7 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)); - Vector2 particlePos = Owner.Center + (new Vector2(Main.rand.Next(10, 90), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))); - - Dust dust = Dust.NewDustPerfect(particlePos, DustID.Pearlwood); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.85f, 1.3f); - dust.velocity = -particleVel.RotatedByRandom(0.2f); - } + bool fall = Main.rand.NextBool(8); + Dust dust2 = Dust.NewDustPerfect(dustPosition, ModContent.DustType(), swingVel * Main.rand.NextFloat(3.5f, 5.5f)); + dust2.scale = Main.rand.NextFloat(0.65f, 0.85f); + dust2.noGravity = fall ? false : true; + dust2.color = Color.Chartreuse; + if (!fall) + dust2.fadeIn = 0.9f; else - CanHit = false; - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), - 0.2f); - - if (time >= timeMax) - doSwing = false; - if (time < (int)(timeMax * 0.7f)) - postSwing = true; - - if (CanHit) { - for (int i = 0; i < (Owner.Calamity().mouseRight ? 3 : 2); i++) - { - Vector2 dustPos = Owner.Center + (new Vector2(90, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)); - Dust dust2 = Dust.NewDustPerfect(dustPos, i == 2 ? 278 : DustID.JungleTorch, Utils.DirectionTo(Owner.Center, dustPos) * Main.rand.NextFloat(1.2f, 2.5f)); - dust2.scale = Main.rand.NextFloat(0.55f, 0.85f) * (Owner.Calamity().mouseRight ? 1.3f : 1); - dust2.noGravity = i == 2 ? false : true; - dust2.color = i == 2 ? Color.Chartreuse : default; - } - } + dust.velocity.Y = 1.5f; + dust2.fadeIn = -0.5f; + } + } - } - ArmRotationOffset = MathHelper.ToRadians(-140f); - ArmRotationOffsetBack = MathHelper.ToRadians(-140f); - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Projectile.numHits > 0) - Projectile.numHits -= 1; - - SoundStyle fire = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit", 3); - SoundEngine.PlaySound(fire with { Volume = 0.65f, Pitch = -0.2f }, Projectile.Center); - SoundEngine.PlaySound(SoundID.DrumTomHigh with { Volume = 0.45f, Pitch = -0.9f }, Projectile.Center); - - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Poisoned, 90); - - Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 7.5f * (Owner.Calamity().mouseRight ? 2.5f : 1), true); - - if (Owner.Calamity().mouseRight) - { - Owner.SetScreenshake(1.2f); - - SoundStyle fire3 = new("CalamityMod/Sounds/Item/DampExplosion"); - SoundEngine.PlaySound(fire3 with { Volume = 0.35f, Pitch = 0.7f }, Projectile.Center); - for (int i = 0; i < MathHelper.Clamp(15 - Projectile.numHits * 3, 2, 15); i++) + if (lerp > 0.4f) // Partway through make the hitbox and sound { - bool dType = i % 4 == 0; - Dust dust2 = Dust.NewDustPerfect(target.Center, dType ? 278 : DustID.JungleTorch, launchVel.RotatedByRandom(0.5f) * Main.rand.NextFloat(3.5f, 7f) * (dType ? 2 : 1)); - dust2.scale = Main.rand.NextFloat(0.65f, 1.35f) * (dType ? 0.7f : 1f); - dust2.noGravity = true; - dust2.color = dType ? Color.Chartreuse : default; + if (makeSound) + { + enabledHitbox = 8; + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing with { Volume = 0.75f, Pitch = Main.rand.NextFloat(-0.35f, -0.55f) }, Projectile.Center); + makeSound = false; + } } - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Vector2 playerLaunchVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * 10; - Owner.velocity = playerLaunchVel; - } - - for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) - { - Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool(5) ? DustID.JungleTorch : 79, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -20).RotatedByRandom(0.7) * Main.rand.NextFloat(0.1f, 0.7f)); - dust2.scale = Main.rand.NextFloat(0.75f, 1.25f); - dust2.noGravity = true; + #endregion } + Timers(); + } + public void Timers() + { + time++; + // Only increment the attack animation when on cooldown or when allowed to swing + if ((attackTimer < fireRate && performSwing) || attackTimer < -1) + attackTimer++; + if (rumble > 0) + rumble -= 0.2f; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + if (Projectile.numHits == 0) + { + Owner.SetScreenshake(2f); + + SoundStyle bash1 = new("CalamityMod/Sounds/Item/DampExplosion"); + SoundEngine.PlaySound(bash1 with { Volume = 0.45f, Pitch = 0.7f }, Projectile.Center); + SoundStyle bash2 = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit", 3); + SoundEngine.PlaySound(bash2 with { Volume = 0.75f, Pitch = -0.2f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DrumTomHigh with { Volume = 0.55f, Pitch = -0.9f }, Projectile.Center); + + Vector2 playerLaunchVel = -toMouse * 10; + Owner.velocity = playerLaunchVel; + rumble = 20; + } + + target.AddBuff(ModContent.BuffType(), 300); + + Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + target.MoveNPC(launchVel, 14f, true, Owner); + + for (int i = 0; i < MathHelper.Clamp(15 - Projectile.numHits * 3, 2, 15); i++) + { + bool dType = i % 4 == 0; + Dust dust = Dust.NewDustPerfect(target.Center, !dType ? DustID.Pearlwood : ModContent.DustType(), launchVel.RotatedByRandom(dType ? 0.2f : 0.5f) * Main.rand.NextFloat(2.5f, 7f) * (dType ? 3 : 1)); + dust.scale = Main.rand.NextFloat(0.65f, 1.05f) * ((dType || Main.rand.NextBool(3)) ? 2.2f : 1f); + dust.noGravity = true; + dust.color = dType ? Color.Chartreuse : default; + if (dType) + dust.fadeIn = 1.7f; + } + float minMult = 0.3f; int hitsToMinMult = 5; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult * (Owner.Calamity().mouseRight ? 2f : 1); + modifiers.SourceDamage *= damageMult; } public override bool PreDraw(ref Color lightColor) { - // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. - if ((useAnim > 0 || DrawUnconditionally) && Owner.ItemAnimationActive) - { - Asset tex = ModContent.Request(Texture); + if (time < 3) + return false; - float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D swoosh = ModContent.Request("CalamityMod/Particles/VerticalSmearThin").Value; - for (int i = 0; i < 8; i++) - { - Color auraColor = Color.Chartreuse with { A = 0 } * 0.35f * fadeIn; - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 8 * fadeIn; - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), auraColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4); + Vector2 rotationPoint = (Owner.direction == -1) ? new Vector2(texture.Width, texture.Height) : new Vector2(0, texture.Height); + SpriteEffects flipSprite = (Owner.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f + ((swingCount % 2 == 0 ? new Vector2(-6, 0) : new Vector2(-2, 0)).RotatedBy(drawRotation) * Owner.direction); - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + Color clr = Color.Tan; + int swingCountFlip = (swingCount % 2 == 0 ? 1 : 3) + Owner.direction == 0 ? 2 : 0; + Vector2 vel2 = Projectile.velocity.RotatedBy(MathHelper.PiOver2); + float extraRot = MathHelper.PiOver4 * 1.2f * (swingCount % 2 == 0 ? (Owner.direction == -1 ? 1 : -1) : (Owner.direction == -1 ? -1 : 1)); + float swooshDrawRotation = vel2.ToRotation() + extraRot; + SpriteEffects swooshFlipSprite = (swingCount % 2 == 0 ? (Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (Owner.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally)); + + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f, null, clr with { A = 0 } * bladefx * 0.4f, swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.5f, swooshFlipSprite); //flipSprite | (swingCount % 2 == 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally) + + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust + Main.rand.NextVector2Circular(rumble, rumble), null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + return false; } - public override void ResetStyle() + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) { + overPlayers.Add(index); } } } diff --git a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs index 4164215be3..8205cb5f9a 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index f8d4d6935c..eb67acd237 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee { base.OnHitNPC(target, hit, damageDone); if (SwingMode == 2) - target.AddBuff(BuffType(), 20); + target.AddBuff(BuffID.Frozen, 20); } public override void AI() diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 4f6706afe6..a8da7a3b52 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.25f); //Idk if its too much or what but at the same time its close range as fuck + Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.5f); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs index 02c71828d9..3b6a91704e 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs @@ -63,7 +63,5 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dustParticle].velocity = Projectile.oldVelocity; } } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffType(), 90); } } diff --git a/Projectiles/Melee/CometQuasherHoldout.cs b/Projectiles/Melee/CometQuasherHoldout.cs index fb612dd221..08ff873084 100644 --- a/Projectiles/Melee/CometQuasherHoldout.cs +++ b/Projectiles/Melee/CometQuasherHoldout.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.55f, Pitch = 0.7f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 7, true); + target.MoveNPC(launchVel, 7, true, Owner); for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) { diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index 5eaf0a592f..40d16b3e2b 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee { Player player = Main.player[Projectile.owner]; target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, 10f, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); diff --git a/Projectiles/Melee/DarkIceZero.cs b/Projectiles/Melee/DarkIceZero.cs index 4c06f168f6..267c30d1d3 100644 --- a/Projectiles/Melee/DarkIceZero.cs +++ b/Projectiles/Melee/DarkIceZero.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 36f9c36aee..f52f7a653f 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 8; diff --git a/Projectiles/Melee/DevilsDevastationHoldout.cs b/Projectiles/Melee/DevilsDevastationHoldout.cs index 501bccd737..093afc45b2 100644 --- a/Projectiles/Melee/DevilsDevastationHoldout.cs +++ b/Projectiles/Melee/DevilsDevastationHoldout.cs @@ -392,7 +392,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 40, true); + CalamityUtils.MoveNPC(target, launchVel, 40, true, Owner); if (target.Calamity().demonSwordImpales != 0 || Projectile.numHits == 0) { diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 56e91d066e..9fdf15536d 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Melee/DragoonBigBolt.cs b/Projectiles/Melee/DragoonBigBolt.cs index 828cbe7972..baf5c2aef5 100644 --- a/Projectiles/Melee/DragoonBigBolt.cs +++ b/Projectiles/Melee/DragoonBigBolt.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 2a230edb90..c51b91ec44 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.Melee armoredHits++; Vector2 launchVel = (Projectile.ai[1] != 1 ? Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) : Utils.DirectionTo(Owner.Center, target.Center)); - target.MoveNPC(launchVel, 37, true); + target.MoveNPC(launchVel, 37, true, Owner); if (spawnBoom) { diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs new file mode 100644 index 0000000000..f7182884f2 --- /dev/null +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Sounds; +using Humanizer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + + public class EvilSmasherProjectile : BaseSwordHoldoutProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public Player Owner => Main.player[Projectile.owner]; + public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType()).Item; + + public override string Texture => BaseItem.ModItem.Texture; + public override int AfterImageLength => 10; + public override int OffsetDistance => 50; + public override int CooldownTime { get; set; } + public override bool AlternateSwings => false; + public override bool useMeleeSpeed => false; + public override SoundStyle? UseSound => SoundID.DD2_MonkStaffSwing with {Volume = 1f}; + + bool hasSmashedTile = false; + bool playedChargeSound = false; + bool firstEnemyHit = true; + + public override void Defaults() + { + Projectile.extraUpdates = 3; + swingWidth = 200; + RotateInCooldown = 0; + RotateInStartup = 0; + Projectile.width = 64; + Projectile.height = 66; + } + + public override void Spawn() + { + angle = new Vector2(angle.X.DirectionalSign(), 0); + var player = Main.player[Projectile.owner]; + var modplayer = player.GetModPlayer(); + StartupTime = 80; + CooldownTime = 30; + swingTime = 10; + modplayer.swingNum = 0; + Projectile.timeLeft = 600; + Projectile.scale *= 1.25f; + Projectile.originalDamage = Projectile.damage; + } + + public override void AdditionalAI() + { + if (inStartup) + { + Projectile.damage = (int)(Projectile.originalDamage * (timer / (float)(StartupTime-1))); + Owner.velocity.X *= 0.97f; + } + if (inStartup && !Owner.channel && timer > 30) + { + timer = StartupTime - 1; + } + if (Owner.channel && timer == StartupTime - 1) + { + Projectile.timeLeft++; + timer--; + if (!playedChargeSound) { + SoundEngine.PlaySound(SoundID.Item178,Projectile.Center); + playedChargeSound = true; + for (int i = 0; i < 5; i++) + { + int sparkLifetime = Main.rand.Next(8, 12); + float sparkScale = Main.rand.NextFloat(0.5f, 1f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(Projectile.Center + angle * 30, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + } + if (!hasSmashedTile && inSwing && SwingCompletion > 0.275f) + { + var adjustedAngle = angle.RotatedBy(Projectile.spriteDirection * SwingFunction()); + Vector2 HammerFrontPos = Projectile.Center + adjustedAngle * -16 * Projectile.scale + (adjustedAngle.RotatedBy(MathHelper.PiOver2) * 20 * Projectile.scale * angle.X); + if (Collision.SolidCollision(HammerFrontPos, 1, 1)) + { + + Owner.velocity *= 0.15f; + Owner.velocity -= adjustedAngle.RotatedBy(MathHelper.PiOver2) * angle.X * MathHelper.Lerp(7.5f,16f,Projectile.damage / (float)Projectile.originalDamage); + float ringRot = SwingCompletion < 0.5f ? 0 : MathHelper.PiOver2; + GeneralParticleHandler.SpawnParticle(new CustomPulse(HammerFrontPos, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloatDirection(), 0.03f, 0.04f * (2 + Projectile.damage / (float)Projectile.originalDamage), 15)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.2f, 0.75f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(HammerFrontPos, Vector2.Zero, Color.Purple, new Vector2(0.2f, 1f), ringRot, 0.1f, 0.5f * (2 + Projectile.damage / (float)Projectile.originalDamage), 30)); + int radius = (int)(4 * Projectile.damage / (float)Projectile.originalDamage); + Point scanAreaStart = HammerFrontPos.ToTileCoordinates() + new Point(-radius, -radius); + Point scanAreaEnd = HammerFrontPos.ToTileCoordinates() + new Point(radius, radius); + Projectile.CreateImpactExplosion((int)(10 * Projectile.damage / (float)Projectile.originalDamage), Projectile.Center, ref scanAreaStart, ref scanAreaEnd, Projectile.width, out bool causedShockwaves); + + hasSmashedTile = true; + timer = StartupTime + swingTime; + angle = adjustedAngle; + var pos = Projectile.Center; + Projectile.Size *= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = HammerFrontPos; + Projectile.Damage(); + Projectile.Size /= 2 + Projectile.damage / (float)Projectile.originalDamage; + Projectile.Center = pos; + + if ((Projectile.damage / (float)Projectile.originalDamage) >= 1) + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with {VariantsWeights = new ReadOnlySpan(new float[] { 1, 0, 0 })}); + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact); + } + } + Owner.heldProj = Projectile.whoAmI; + } + + public override float SwingFunction() + { + if (hasSmashedTile) + return MathHelper.ToRadians(MathHelper.Lerp(0, -swingWidth * 0.4f, MathF.Pow(CooldownCompletion, 0.5f))); + if (inStartup) + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * 0.8f, -swingWidth * 0.66f, 1 - MathF.Pow(StartupCompletion, 0.5f))); + if (inCooldown) + return MathHelper.ToRadians(MathHelper.SmoothStep(swingWidth * 0.33f, swingWidth * 0.45f, MathF.Pow(CooldownCompletion, 0.5f))); + return MathHelper.ToRadians(MathHelper.SmoothStep(-swingWidth * .66f, (swingWidth * 0.33f), SwingCompletion)); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (firstEnemyHit && Main.rand.NextFloat() < (Projectile.damage / (float)Projectile.originalDamage)) + { + string text = ""; + if (target.life > 0) + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.DamageDialogue" + Main.rand.Next(4)); + else + text = CalamityUtils.GetTextValue("Items.Weapons.Melee.EvilSmasher.KillDialogue" + Main.rand.Next(2)); + char[] textToFormat = text.ToCharArray(); + for (var i = 0; i < textToFormat.Length; i++) + { + if (Main.rand.NextBool()) + textToFormat[i] = char.ToUpper(textToFormat[i]); + } + text = new string(textToFormat); + bool intense = target.life <= 0; + CombatText.NewText(Projectile.Hitbox, Color.Lerp(Color.DarkGray,Color.Gold, intense ? 0.25f: 0.1f), text, intense); + firstEnemyHit = false; + } + if (!hasSmashedTile && (Projectile.damage / (float)Projectile.originalDamage) >= 1) + { + for (int i = 0; i < 16; i++) + { + int sparkLifetime = Main.rand.Next(10, 15); + float sparkScale = Main.rand.NextFloat(1f, 2f); + var sparkColor = Main.rand.NextBool() ? Color.Purple : Color.Red; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi) * MathHelper.Lerp(10, 30, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + + } + SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with { Volume = 0.5f, LimitsArePerVariant = false, MaxInstances = 1 }); + } + else if (!hasSmashedTile) + { + + SoundEngine.PlaySound(SoundID.Item69 with { Volume = 1f, LimitsArePerVariant = false, MaxInstances = 1 }); + } + target.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + Owner.AddBuff(ModContent.BuffType(), (int)MathHelper.Lerp(60, 900, Projectile.damage / (float)Projectile.originalDamage)); + } + + public override bool PreDraw(ref Color lightColor) + { + if (!inCooldown) + { + var tex = ModContent.Request(Texture + "Glow").Value; + float outlineWidth = (int)(4 * (Projectile.damage / (float)Projectile.originalDamage)) * 0.5f; + if (inSwing) + { + outlineWidth *= 1 - SwingCompletion; + } + for (float i = 0; i <= MathHelper.TwoPi; i += MathHelper.TwoPi * 0.25f) + { + Main.spriteBatch.Draw( + tex, + Projectile.Center + new Vector2(0, Projectile.gfxOffY) + Vector2.UnitX.RotatedBy(i + Projectile.rotation) * outlineWidth * Projectile.scale - Main.screenPosition, + null, + Color.Lerp(Color.Purple,Color.Red,MathF.Sin(Main.GlobalTimeWrappedHourly * 6)* 0.5f + 0.5f), + Projectile.rotation, + tex.Size() * 0.5f, + Projectile.scale, + Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, + 0 + ); + } + } + if (inSwing) + return base.PreDraw(ref lightColor); + return true; + } + } +} diff --git a/Projectiles/Melee/ExaltedOathbladeHoldout.cs b/Projectiles/Melee/ExaltedOathbladeHoldout.cs index c4db13d8e4..279b825edd 100644 --- a/Projectiles/Melee/ExaltedOathbladeHoldout.cs +++ b/Projectiles/Melee/ExaltedOathbladeHoldout.cs @@ -251,7 +251,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 23, true); + CalamityUtils.MoveNPC(target, launchVel, 23, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 0c11323fc6..4eeb944925 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -616,7 +616,7 @@ namespace CalamityMod.Projectiles.Melee } // Freeze the target briefly, to allow the player to more easily perform a powerful slash. - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); } if (State == SwingState.Swinging && PerformingPowerfulSlash && Owner.ownedProjectileCounts[ModContent.ProjectileType()] < 1) diff --git a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs index b4088066bc..ba2800c800 100644 --- a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs +++ b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Cooldowns; @@ -307,7 +307,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 17, true); + CalamityUtils.MoveNPC(target, launchVel, 17, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) diff --git a/Projectiles/Melee/Galaxia_AndromedasStride.cs b/Projectiles/Melee/Galaxia_AndromedasStride.cs index feb707f2c8..fb799c055b 100644 --- a/Projectiles/Melee/Galaxia_AndromedasStride.cs +++ b/Projectiles/Melee/Galaxia_AndromedasStride.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_AriesWrath.cs b/Projectiles/Melee/Galaxia_AriesWrath.cs index a1b0c8100a..bf80280e05 100644 --- a/Projectiles/Melee/Galaxia_AriesWrath.cs +++ b/Projectiles/Melee/Galaxia_AriesWrath.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index 1d5953a2f1..feb887a46b 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -50,6 +50,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index e7e4fa40cc..4ccc7f91a2 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index cd7d39d564..630fa6b82b 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -1,223 +1,270 @@ -using CalamityMod.Dusts; +using System; +using System.Collections.Generic; +using CalamityMod.Dusts; +using CalamityMod.Enums; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.Particles; -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +using static Terraria.Player; namespace CalamityMod.Projectiles.Melee { [PierceResistException] - public class GrandDadHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + public class GrandDadHoldout : ModProjectile, ILocalizedModType { - public override int AssignedItemID => ModContent.ItemType(); - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/GrandDad"; - public override float HitboxOutset => 125; - public override Vector2 HitboxSize => new Vector2(190, 190); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(0, 124); - public Vector2 mousePos; - public Vector2 aimVel; - public bool doSwing = true; - public bool postSwing = false; - public float fadeIn = 0; - public int useAnim; - public int swingCount; - public bool finalFlip = false; - public bool swingSound = true; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public int fireRate => (int)((Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates) / 2.75f); + public int time = 0; + public Vector2 toMouse = Vector2.Zero; + public int cooldown => (int)(-Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Visual effects of the blade + // Checks to make sure sounds only happen once per swing + public bool makeSound = true; + public bool performSwing = false; + public float enabledHitbox = 0; // Deals damage when above 0, ticks down quickly + public float angledHold = 0; // Adds some angle based on swing direction + public float angleArmHold = 0; + public static int hitboxFramesMax = 11; + public bool canReleaseHoldout = false; public int armoredHits = 0; - private NPC target => Main.npc[(int)Projectile.ai[0]]; - + public float startAngle = MathHelper.Pi * 0.9f; + public float endAngle = -MathHelper.PiOver4 * 3 * 0.9f; + public override bool? CanDamage() => enabledHitbox > 0 ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float outset = 40 * Projectile.scale; + Vector2 hitboxPosition = Owner.Center + toMouse * outset; + float hitboxSize = 155 * Projectile.scale; + return CalamityUtils.CircularHitboxCollision(hitboxPosition, hitboxSize, targetHitbox); + } public override void SetDefaults() { - base.SetDefaults(); + Projectile.width = Projectile.height = 124; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.extraUpdates = 8; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.noEnchantmentVisuals = true; + Projectile.scale = 0; } - - public override void WhenSpawned() + public void OnSpawn() { - Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; - Projectile.knockBack = 0; - Projectile.scale = 1; - Projectile.ai[1] = -1; - - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, as Grand Dad has no projectiles - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - useAnim = Owner.itemAnimationMax; - - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - - FlipAsSword = Owner.direction == -1; - } - - public override void UseStyle() - { - AnimationProgress = Animation % useAnim; - DrawUnconditionally = false; - - if (CanHit || postSwing) - mousePos = Owner.Center - aimVel; - else + if (time == 0) { - mousePos = Owner.Calamity().mouseWorld; + Projectile.knockBack = 0; + attackTimer = cooldown; + swingCount = 1; } + } + public void ResetVariables() // After a swing, reset/adjust many stats + { + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; + Projectile.numHits = 0; + swingCount++; + makeSound = true; + enabledHitbox = 0; + canReleaseHoldout = false; + armoredHits = 0; + Projectile.ForceNetUpdate(); + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); - if (CanHit) - fadeIn = MathHelper.Lerp(fadeIn, 1, 0.3f); - else - fadeIn = MathHelper.Lerp(fadeIn, 0, 0.35f); + angleArmHold = MathHelper.Lerp(angleArmHold, angledHold * MathF.Pow(Utils.GetLerpValue(cooldown, cooldown * 0.35f, attackTimer, true), 5), 0.12f / Projectile.MaxUpdates * Owner.meleeSpeed); + float angleVariation = (float)Math.Sin(time * 0.04f / Projectile.MaxUpdates) * 0.05f; + float outwardDistance = 5; + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + (bladeRot + angleArmHold + angleVariation) * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * outwardDistance; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); - if (!doSwing) + Projectile.velocity = toMouse.RotatedBy((bladeRot + angledHold + angleVariation) * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Projectile.scale = MathHelper.Lerp(Projectile.scale, Owner.GetMeleeScale(), 0.3f / Projectile.MaxUpdates); + toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + OnSpawn(); + + bool fadeInFX = enabledHitbox > (int)(hitboxFramesMax / 3f); + if (enabledHitbox > 0) { - for (int i = 0; i < Main.maxNPCs; i++) - Projectile.localNPCImmunity[i] = 0; + if (Projectile.FinalExtraUpdate()) + enabledHitbox--; + } + if (fadeInFX) + bladefx = MathHelper.Lerp(bladefx, 1, 0.25f / Projectile.MaxUpdates * Owner.meleeSpeed); + else + bladefx = MathHelper.Lerp(bladefx, 0, 0.15f / Projectile.MaxUpdates * Owner.meleeSpeed); - Projectile.numHits = 0; - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - FlipAsSword = Owner.direction == -1; - - doSwing = true; - swingCount++; - finalFlip = false; - swingSound = true; - armoredHits = 0; + if (canReleaseHoldout || time < 25) + { + if (Owner.HeldItem.type != ItemType() || Main.mapFullscreen || Owner.mouseInterface || Owner.dead) + { + Projectile.Kill(); + return; + } } else + Owner.itemTime = Owner.itemAnimation = 5; + + + float lerpSpeed = 0.1f / Projectile.MaxUpdates * Owner.meleeSpeed; + float maxAngle = MathHelper.PiOver4 * 0.8f; + if (swingCount % 2 == 0) + angledHold = MathHelper.Lerp(angledHold, maxAngle, lerpSpeed); + else + angledHold = MathHelper.Lerp(angledHold, -maxAngle, lerpSpeed); + + + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging { - if (!CanHit && !postSwing) + Timers(); + + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + + if (attackTimer == 0) // Reset a few things in prep for the next swing + ResetVariables(); + else // Wind up animation in prep for the next swing { - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - } - else - { - if ((Owner.Center - aimVel).X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - } + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp2 = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + float start = -startAngle * swingDir; + float end = endAngle * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp2, 2f, 2f)); - - Projectile.rotation = Projectile.rotation.AngleLerp(Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f), 0.1f); - - if (AnimationProgress < (useAnim / 1.5f)) - { - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - postSwing = false; - if (AnimationProgress == 0) + if (lerp >= 0.85f) { - doSwing = false; - Projectile.ai[1] = -Projectile.ai[1]; - } - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction * (1 + (Utils.GetLerpValue(useAnim * 0.8f, useAnim, Animation, true)) * 0.35f)), 0.2f); - } - else - { - if (!finalFlip) - { - FlipAsSword = Owner.direction < 0; - } - - float time = (AnimationProgress) - (useAnim / 3); - float timeMax = useAnim - (useAnim / 3); - - if (time >= (int)(timeMax * 0.4f) && swingSound) - { - SoundStyle fire = new("CalamityMod/Sounds/Item/HeavySwing"); - SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.32f) }, Projectile.Center); - swingSound = false; - } - if (time > (int)(timeMax * 0.4f) && time < (int)(timeMax * 0.7f)) - { - CanHit = true; - - for (int i = 0; i < 3; i++) + if (Owner.controlUseItem || performSwing) + performSwing = true; + else { - Vector2 particleVel = new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)); - Vector2 particlePos = Owner.Center + (new Vector2(Main.rand.Next(30, 165), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))); - GeneralParticleHandler.SpawnParticle(new LineParticle(particlePos, -particleVel.RotatedByRandom(0.2f) * 2, false, 19, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue)); - GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(particlePos, -particleVel.RotatedByRandom(0.2f) * 2, Main.rand.NextBool(4) ? Color.Black : Color.DarkBlue, 23, Main.rand.NextFloat(0.5f, 1f), 0.65f)); - } - } - else - CanHit = false; - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), - 0.2f); - - if (time >= timeMax) - doSwing = false; - if (time < (int)(timeMax * 0.7f)) - postSwing = true; - - if (CanHit) - { - for (int i = 0; i < 6; i++) - { - if (Main.rand.NextBool(3)) - { - Dust dust = Dust.NewDustPerfect(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), ModContent.DustType(), Vector2.Zero, 0, default, Main.rand.NextFloat(1.15f, 1.5f)); - dust.noGravity = true; - dust.color = Color.DodgerBlue; - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Color.Black, false, false, false)); - } - else - { - Dust dust = Dust.NewDustPerfect(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), ModContent.DustType(), Vector2.Zero, 0, default, Main.rand.NextFloat(1.15f, 1.5f)); - dust.noGravity = true; - dust.color = Color.Blue; - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue)); - } - } - for (int i = 0; i < 3; i++) - { - float randRot = Main.rand.NextFloat(-30, -60); - Vector2 dustVel = (new Vector2(0, 15 * -Projectile.ai[1] * Owner.direction)).RotatedBy(FinalRotation + MathHelper.ToRadians(randRot)); - Dust dust2 = Dust.NewDustPerfect(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), DustID.FireworksRGB, dustVel * Main.rand.NextFloat(0.1f, 0.5f)); - dust2.scale = Main.rand.NextFloat(0.55f, 1.05f); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool(3) ? Color.Goldenrod : Color.Gold; + canReleaseHoldout = true; + attackTimer--; + lerp = 0.85f; } } } + if (lerp > 0.85f) + { + angledHold = MathHelper.Lerp(angledHold, maxAngle * 3.5f * (swingCount % 2 == 0 ? 1 : -1), lerpSpeed * 1.5f); + } + + return; } + #endregion - ArmRotationOffset = MathHelper.ToRadians(-140f); - ArmRotationOffsetBack = MathHelper.ToRadians(-140f); + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown; + performSwing = false; + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float start = endAngle * swingDir; + float end = startAngle * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp, 11f, 11f)); + + if (lerp > 0.3f && lerp < 0.8f && Main.rand.NextBool((int)(1 + 4 * Projectile.MaxUpdates * Math.Abs(Utils.GetLerpValue(0.5f, 1.2f, lerp))))) + { + Vector2 dustPosition = Projectile.Center + Projectile.velocity * 170 * Projectile.scale; + Vector2 dustPosition2 = Projectile.Center + Projectile.velocity.RotatedByRandom(0.3f) * 170 * Projectile.scale; + Vector2 swingVel = Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (swingCount % 2 == 0 ? 1 : -1) * Owner.direction); + + Dust dust = Dust.NewDustPerfect(dustPosition, ModContent.DustType(), + swingVel.RotatedByRandom(0.1f) * Main.rand.NextFloat(9.5f, 15.5f), 0, default, Main.rand.NextFloat(1.55f, 2.2f)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 7; + + if (Main.rand.NextBool(3, 4)) + { + Vector2 vel = swingVel.RotatedByRandom(0.1f) * Main.rand.NextFloat(9.5f, 15.5f); + Dust dust2 = Dust.NewDustPerfect(dustPosition2, ModContent.DustType(), + vel, 0, default, 2 * Main.rand.NextFloat(1.0f, 1.3f)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.0f); + dust2.fadeIn = 0.2f; + } + + } + if (lerp > 0.4f) // Partway through make the hitbox and sound + { + if (makeSound) + { + enabledHitbox = hitboxFramesMax; + SoundStyle swing1 = new("CalamityMod/Sounds/Item/HeavySwing"); + SoundEngine.PlaySound(swing1 with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.32f) }, Projectile.Center); + makeSound = false; + } + } + #endregion + } + Timers(); } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public void Timers() { - if ((target.life <= 0 && target.realLife == -1) && Projectile.numHits > 0) - Projectile.numHits -= 1; - if (damageDone <= 2) + time++; + // Only increment the attack animation when on cooldown or when allowed to swing + if ((attackTimer < fireRate && performSwing) || attackTimer < -1) + attackTimer++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + // Dont increment numHits on armored targets or kills + if (((target.life <= 0 && target.realLife == -1) || target.Calamity().IsArmored())) armoredHits++; - if (Main.zenithWorld && Projectile.numHits == 0 && target.type != ModContent.NPCType() && Main.rand.NextBool(5)) + float distanceToTiles = -100; + bool canBeLaunched = false; + bool lowEnoughToExecute = target.life <= Projectile.damage * 15; + bool jared = target.type == ModContent.NPCType(); + Vector2 toMouse = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + Vector2 launchVel = lowEnoughToExecute ? toMouse : Utils.DirectionTo(Owner.Center, target.Center); + + if (lowEnoughToExecute || jared) { - SoundStyle fire3 = new("CalamityMod/Sounds/Item/GFBScreams/Scream", 8); - SoundEngine.PlaySound(fire3 with { Volume = 0.8f }, Projectile.Center); + distanceToTiles = CalamityUtils.DistanceToTileCollisionHit(target.Center, launchVel, 200) ?? -100; + canBeLaunched = jared || ((distanceToTiles == -100 ? false : distanceToTiles < 200 ? true : false) && target.realLife == -1); } if (Projectile.numHits == 0) { @@ -227,60 +274,81 @@ namespace CalamityMod.Projectiles.Melee SoundStyle fire2 = new("CalamityMod/Sounds/Item/FinalDawnSlash"); SoundEngine.PlaySound(fire2 with { Volume = 0.65f, Pitch = Main.rand.NextFloat(-0.2f, -0.3f) }, Projectile.Center); } - - int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 12, 1, 20)); + int heal = (int)(MathHelper.Clamp(18 - Projectile.numHits * 13, 1, 20)); if (Projectile.numHits < 10) { - Owner.DoLifestealDirect(target, heal, 0.5f); + Owner.Calamity().grandDadHealPool += heal; + // Give partial Grand Dad healing to all nearby players + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + float targetDist = player.Center.DistanceSQ(Owner.Center); + + if (targetDist < 500f && player.team == Owner.team && player != Owner) + { + player.Calamity().grandDadHealPool += (int)(heal / 2); + } + } } - if (target.CanBeMoved(true) || Main.zenithWorld || target.type == ModContent.NPCType() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) + // Regular knockback + float launchPower = 60; + target.MoveNPC(toMouse, launchPower * (canBeLaunched ? 0.5f : 0.25f), true, Owner); + if (canBeLaunched) // launches/executes enemies { - if (target.type == ModContent.NPCType()) + if (jared) { CombatText.NewText(target.Hitbox, Color.Aqua, CalamityUtils.GetTextValue("Misc.HecBoop")); SoundStyle boop = new("CalamityMod/Sounds/Item/SnootBooped"); SoundEngine.PlaySound(boop with { Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, Projectile.Center); } - bool rightClicked = Owner.Calamity().mouseRight; + target.Calamity().pacified = true; - // Make all hit enemies able to hit tiles, so you can dunk them - target.noTileCollide = false; - - // Launch the suckers - Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - float launchPower = 30 * (rightClicked ? 2 : 1); - target.MoveNPC(launchVel, launchPower * 0.5f, true); - - // Remove knockback resist, just like it used to - target.knockBackResist = 1; - - // Apply tile collison damage (is boosted even further if both final bosses are gone) - float damageMults = ((DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) ? 5 : 1) * (rightClicked ? 3 : 1); - int damage = (int)(Projectile.damage * damageMults); - target.GetGlobalNPC().ApplyCollisionDamage(target, Owner, damage, launchVel * launchPower, 5f, true); + // Apply tile collison damage and forced velocity to launch the suckers + // This always kills (unless it's Jared) + int damage = (int)(Projectile.damage); + target.GetGlobalNPC().ApplyCollisionDamage(target, Owner, (jared && !lowEnoughToExecute) ? 1 : damage, launchVel * launchPower, 5f, true, true); } if (Projectile.numHits < 3) { - Particle spark = new VoidSparkParticle(target.Center, (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * (-45 + Projectile.numHits * 5), false, (int)(16 - Projectile.numHits * 3), 0.6f - Projectile.numHits * 0.15f, Color.DodgerBlue, 0.45f); - GeneralParticleHandler.SpawnParticle(spark); + for (int i = 0; i < 2; i++) + { + Particle spark = new CustomSpark(target.Center, launchVel * 65, "CalamityMod/Particles/GlowSpark2", false, (int)(16 - Projectile.numHits * 3), 0.145f - Projectile.numHits * 0.015f, Color.Black, new Vector2(2f, 1f), false, shrinkSpeed: 1f, colorFadeSpeed: 10); + GeneralParticleHandler.SpawnParticle(spark); + spark.Pixelate = true; + Particle spark2 = new CustomSpark(target.Center, launchVel * 65, "CalamityMod/Particles/GlowSpark", false, (int)(16 - Projectile.numHits * 3), 0.105f - Projectile.numHits * 0.015f, Color.Lerp(Color.Blue, Color.DodgerBlue, 0.65f), new Vector2(2f, 1f), true, false, shrinkSpeed: 1f, colorFadeSpeed: 10); + GeneralParticleHandler.SpawnParticle(spark2); + spark2.Pixelate = true; + spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + } + + for (int i = 0; i < 25 - Projectile.numHits * 3; i++) + { + float hitMult = 1 - 0.15f * Projectile.numHits; + float variance = Main.rand.NextFloat(-0.6f, 0.6f); + Dust dust = Dust.NewDustPerfect(target.Center, ModContent.DustType(), + launchVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(30.0f, 33.0f) * hitMult * MathF.Pow((1 - MathF.Abs(variance)), 2), 0, default, 3 * hitMult * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 3; + dust.fadeIn = 2.1f; + + if (i % 2 == 0) + { + Vector2 vel = launchVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(20.0f, 23.0f) * hitMult * MathF.Pow((1 - MathF.Abs(variance)), 2); + Dust dust2 = Dust.NewDustPerfect(target.Center + vel * 13, ModContent.DustType(), + vel, 0, default, 2 * hitMult * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + } + } } - for (int i = 0; i < MathHelper.Clamp(10 - Projectile.numHits * 2, 2, 10); i++) - { - Particle spark2 = new SparkParticle(target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -35).RotatedByRandom(0.7) * Main.rand.NextFloat(0.2f, 1f), false, 55, Main.rand.NextFloat(0.4f, 1.5f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dust = Dust.NewDustPerfect(target.Center, ModContent.DustType(), ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -35).RotatedByRandom(0.7) * Main.rand.NextFloat(0.2f, 1f), 0, default, Main.rand.NextFloat(1.55f, 2.2f)); - dust.noGravity = true; - dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; - } - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Owner.Calamity().mouseRight) + if (canBeLaunched) { modifiers.SourceDamage *= 0; modifiers.FinalDamage.Flat = 0.1f; @@ -293,34 +361,61 @@ namespace CalamityMod.Projectiles.Melee modifiers.SourceDamage *= damageMult; } } - public override bool PreDraw(ref Color lightColor) { - // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. - if ((useAnim > 0 || DrawUnconditionally) && Owner.ItemAnimationActive) + if (time < 3) + return false; + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D swoosh = ModContent.Request("CalamityMod/Particles/CircularSmearLarge").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4); + Vector2 rotationPoint = (Owner.direction == -1) ? new Vector2(texture.Width, texture.Height) : new Vector2(0, texture.Height); + SpriteEffects flipSprite = (Owner.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 handLatchingAdjustments = (swingCount % 2 == 0 ? new Vector2(-6, 0) : new Vector2(-2, 0)); + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f + (handLatchingAdjustments.RotatedBy(drawRotation) * Owner.direction); + + float lerp = 1 - bladefx; + int swingCountFlip = (swingCount % 2 == 0 ? 1 : 3) + Owner.direction == 0 ? 2 : 0; + Vector2 vel2 = Vector2.Lerp(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Owner.Center.DirectionTo(Owner.ClampedMouseWorld()).RotatedBy(-MathHelper.PiOver2), 0f); + float extraRot = MathHelper.PiOver4 * MathHelper.Lerp(3, 1.9f, lerp) * (swingCount % 2 == 0 ? (Owner.direction == -1 ? 1 : -1) : (Owner.direction == -1 ? -1 : 1)); + float swooshDrawRotation = vel2.ToRotation() + extraRot; + SpriteEffects swooshFlipSprite = (swingCount % 2 == 0 ? (Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (Owner.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally)); + if (bladefx > 0.02f) { - Asset tex = ModContent.Request(Texture); - Asset glowTex = ModContent.Request("CalamityMod/Items/Weapons/Melee/GrandDadGlow"); - - float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; - - Asset swoosh = ModContent.Request("CalamityMod/Particles/VerticalSmearLarge"); - if (Animation > useAnim * 0.2f) - Main.EntitySpriteDraw(swoosh.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), null, Color.DodgerBlue with { A = 0 } * fadeIn * 0.65f, (FinalRotation + MathHelper.ToRadians(45)) + MathHelper.ToRadians(Projectile.ai[1] == 1 ? -90 : 90) * -Owner.direction, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, SpriteEffects.None); - - for (int i = 0; i < 25; i++) + PixelationManager.AddPixelatedDrawer((_) => { - Texture2D centerTexture = ModContent.Request("CalamityMod/Projectiles/Melee/GrandDadGhost").Value; - Color auraColor = Color.Gold with { A = 0 } * 0.15f * fadeIn; - Vector2 drawOffset = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * 6 * fadeIn; - Main.EntitySpriteDraw(centerTexture, Projectile.Center - Main.screenPosition + drawOffset + new Vector2(0, Owner.gfxOffY), centerTexture.Frame(1, FrameCount, 0, Frame), auraColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); + int draws = 15; + for (int i = 0; i < draws; i++) + { + Color clr = Color.Black; + Vector2 outlineOffset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 3.5f; + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f + outlineOffset, null, clr * MathF.Pow(bladefx, 3) * 0.4f, swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, swooshFlipSprite); + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust + outlineOffset * 2 * bladefx, null, clr * 0.2f * bladefx, drawRotation, rotationPoint, Projectile.scale, flipSprite); + } + }, Enums.GeneralDrawLayer.AfterProjectiles, BlendState.AlphaBlend); + if (!CalamityClientConfig.Instance.Photosensitivity) + { + PixelationManager.AddPixelatedDrawer((_) => + { + Color clrCenter = Color.DodgerBlue; + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f, null, clrCenter * MathF.Pow(bladefx, 0.6f), swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, swooshFlipSprite); + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, clrCenter * bladefx, drawRotation, rotationPoint, Projectile.scale, flipSprite); + }, Enums.GeneralDrawLayer.AfterEverything, BlendState.Additive); + } - - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - Main.EntitySpriteDraw(glowTex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), glowTex.Frame(1, FrameCount, 0, Frame), Color.White, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(glowTex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + return false; } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + overPlayers.Add(index); + } } } diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index 51978ae71d..6ab245f9cd 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Melee armoredHits++; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 8, true); + target.MoveNPC(launchVel, 8, true, Owner); if (spawnBoom) { diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index 07c121065c..7a185698b5 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -390,18 +391,17 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, (chargedSwing ? 24 : 19), true); + target.MoveNPC(launchVel, (chargedSwing ? 24 : 19), true, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (chargedSwing) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? (2.9f + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 2.9f : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index de8e35f5aa..959a2e1553 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee AnimationProgress = Animation % (chargedSwing ? (int)(storedUseAnim * 1.2f) : storedUseAnim); DrawUnconditionally = false; - bool cantUse = (Owner.Calamity().mouseRight || Owner == null || !Owner.active || Owner.dead || Main.mouseLeftRelease || Owner.CCed || Owner.noItems); + bool cantUse = ( Owner == null || !Owner.active || Owner.dead || Main.mouseLeftRelease || Owner.CCed || Owner.noItems); if (CanHit || postSwing) mousePos = Owner.Center - aimVel; @@ -406,10 +406,10 @@ namespace CalamityMod.Projectiles.Melee SoundStyle hitSound = new("CalamityMod/Sounds/Item/HolyColliderSmallHit"); SoundEngine.PlaySound(hitSound with { Volume = 0.85f, PitchVariance = 0.25f }, Projectile.Center); - for (int i = 0; i < 8; i++) + for (int i = 0; i < 6; i++) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile fadedFire = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -11).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.05), Projectile.knockBack, Projectile.owner, 10, target.whoAmI); + Projectile fadedFire = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -11).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.01), Projectile.knockBack, Projectile.owner, 10, target.whoAmI); fadedFire.timeLeft = Main.rand.Next(40, 55 + 1); } } @@ -438,14 +438,14 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, (chargedSwing ? 35 : 23), true); + target.MoveNPC(launchVel, (chargedSwing ? 35 : 23), true, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? 1f : 0.5f) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 1f : 0.2f) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 0318c62d67..85a8a361da 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates; } - public override bool? CanDamage() => ((time > 10 && !isLaunched) || (isLaunched && !setStats)) ? null : false; + public override bool? CanDamage() => (Projectile.ai[0] == 10 && Projectile.numHits > 5) ? false : ((time > 10 && !isLaunched) || (isLaunched && !setStats)) ? null : false; public override void AI() { @@ -50,7 +50,8 @@ namespace CalamityMod.Projectiles.Melee isLaunched = true; else Projectile.ai[2] = 0; - + if (Projectile.ai[0] == 10) + Projectile.localNPCHitCooldown = 60 * Projectile.MaxUpdates; Projectile.scale = Utils.GetLerpValue(0, 40, Projectile.timeLeft, true); diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index d858ee8cdb..3d69d25e66 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.IceRod, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 30); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 30); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/LightspeedDashHitbox.cs b/Projectiles/Melee/LightspeedDashHitbox.cs index 198524c45c..546b3f3247 100644 --- a/Projectiles/Melee/LightspeedDashHitbox.cs +++ b/Projectiles/Melee/LightspeedDashHitbox.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 84; - Projectile.height = 64; + Projectile.width = 150; + Projectile.height = 75; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(CommonCalamitySounds.SwiftSliceSound with { Volume = CommonCalamitySounds.SwiftSliceSound.Volume * 0.33f }, Projectile.Center); var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); // Refund 30 energy if dash hits. Can get energy from multiple enemies. modPlayer.elementalMastery += 30; diff --git a/Projectiles/Melee/LightspeedHoldout.cs b/Projectiles/Melee/LightspeedHoldout.cs index e517fe64b4..074be3fa64 100644 --- a/Projectiles/Melee/LightspeedHoldout.cs +++ b/Projectiles/Melee/LightspeedHoldout.cs @@ -74,6 +74,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 94; Projectile.friendly = true; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; @@ -170,6 +171,9 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + var player = Main.player[Projectile.owner]; + var modPlayer = player.GetModPlayer(); + Projectile.scale = 0.6f; if (!Owner.channel && DashState == 0) @@ -186,7 +190,7 @@ namespace CalamityMod.Projectiles.Melee if (Owner.altFunctionUse == 2 && Owner.Calamity().mouseRight) { // Check if the player has enough EM - if (Owner.Calamity().elementalMastery < 100) + if (modPlayer.elementalMastery < 100) { Projectile.Kill(); return; @@ -195,7 +199,7 @@ namespace CalamityMod.Projectiles.Melee DashState = 1; DashTimer = DashPrepTime; Projectile.localAI[0] = Owner.direction; - Owner.Calamity().elementalMastery = 0; // Reset EM to zero + modPlayer.elementalMastery = 0; // Reset EM to zero } } diff --git a/Projectiles/Melee/LightspeedM1Hitbox.cs b/Projectiles/Melee/LightspeedM1Hitbox.cs index cf1c27cfa3..3e27b0a648 100644 --- a/Projectiles/Melee/LightspeedM1Hitbox.cs +++ b/Projectiles/Melee/LightspeedM1Hitbox.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee { gotEnergyThisSwing = true; var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); // +4 energy on hit modPlayer.elementalMastery += 4; diff --git a/Projectiles/Melee/LucreciaHoldout.cs b/Projectiles/Melee/LucreciaHoldout.cs index 7268276580..222b21699d 100644 --- a/Projectiles/Melee/LucreciaHoldout.cs +++ b/Projectiles/Melee/LucreciaHoldout.cs @@ -56,8 +56,7 @@ namespace CalamityMod.Projectiles.Melee public override void Spawn() { var player = Main.player[Projectile.owner]; - var modplayer = player.GetModPlayer(); - var calamityPlayer = player.Calamity(); + var lucreciaPlayer = player.GetModPlayer(); // Store the base use time from the item int baseUseTime = BaseItem.useTime; @@ -65,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee if (player.altFunctionUse == 2) { // Check for energy before the projectile exists - if (calamityPlayer.darklightEnergy < 100) + if (lucreciaPlayer.darklightEnergy < 100) { Projectile.Kill(); return; @@ -87,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee RotateInCooldown = 1f; Projectile.knockBack = 15f; - calamityPlayer.darklightEnergy = 0; // Remove energy for startup + lucreciaPlayer.darklightEnergy = 0; // Remove energy for startup } else { @@ -323,10 +322,10 @@ namespace CalamityMod.Projectiles.Melee gotEnergyThisSwing = true; var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); - // +25 energy on hit - modPlayer.darklightEnergy += 25; + // +20 energy on hit + modPlayer.darklightEnergy += 20; modPlayer.darklightEnergy = Math.Min(modPlayer.darklightEnergy, Lucrecia.MaxEnergy); // On-hit cut FX diff --git a/Projectiles/Melee/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index ddb54e5253..b10a3a2a49 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -197,7 +197,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 15, true); + target.MoveNPC(launchVel, 15, true, Owner); for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) { diff --git a/Projectiles/Melee/MawOfInfinityHoldout.cs b/Projectiles/Melee/MawOfInfinityHoldout.cs index cb0d2546cb..cf7bf97d01 100644 --- a/Projectiles/Melee/MawOfInfinityHoldout.cs +++ b/Projectiles/Melee/MawOfInfinityHoldout.cs @@ -155,9 +155,5 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.Draw(tex, DrawPos - Main.screenPosition, tex.Frame(2,1,0,0), modplayer.swingNum == 1 ? Color.Fuchsia : Color.Cyan, rotation + MathHelper.PiOver4, new Vector2(tex.Width * 0.25f,tex.Height * 0.5f), Projectile.scale * jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } } } diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 68bc6ca463..77f8da080b 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs b/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs index cbd57293bb..f36901be7a 100644 --- a/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs +++ b/Projectiles/Melee/MendedBiomeBlade_PurityProjectionSigil.cs @@ -45,10 +45,6 @@ namespace CalamityMod.Projectiles.Melee if (target.CanBeChasedBy(Projectile)) { Projectile.Center = target.Center; - - // TBB sigil marks the enemy with Armor Crunch - if (Projectile.ai[1] == 1f) - target.AddBuff(ModContent.BuffType(), 5); } else Projectile.active = false; diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs index 75f363454a..d2b0c7cb51 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs index b05763bebb..2d198d7b21 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Melee { base.OnHitNPC(target, hit, damageDone); if (SwingMode == 2) - target.AddBuff(BuffType(), 40); + target.AddBuff(BuffID.Frozen, 40); } public override void AI() diff --git a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs index 960e66f1fa..8d09ed4ea1 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TruePurityProjection.cs @@ -87,7 +87,5 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dustParticle].velocity = Projectile.oldVelocity; } } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffType(), 90); } } diff --git a/Projectiles/Melee/MonstrousKnife.cs b/Projectiles/Melee/MonstrousKnife.cs index 8f2abedb44..9ba7015b77 100644 --- a/Projectiles/Melee/MonstrousKnife.cs +++ b/Projectiles/Melee/MonstrousKnife.cs @@ -45,6 +45,6 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 4f); //4x cooldown = 23.3 HP bank, 2.25 hp/s refill + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 3f); //3x cooldown = 23.3 HP bank, 2 hp/s refill } } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index fea77fab78..62c19d5938 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 6; Projectile.frameCounter = 0; diff --git a/Projectiles/Melee/OldLordClaymoreHoldout.cs b/Projectiles/Melee/OldLordClaymoreHoldout.cs index e84665578a..cf3264b909 100644 --- a/Projectiles/Melee/OldLordClaymoreHoldout.cs +++ b/Projectiles/Melee/OldLordClaymoreHoldout.cs @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.OnFire3, 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 12, true); + CalamityUtils.MoveNPC(target, launchVel, 12, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) @@ -227,7 +227,7 @@ namespace CalamityMod.Projectiles.Melee float minMult = 0.3f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult * (Owner.Calamity().mouseRight ? 2.5f : 1); + modifiers.SourceDamage *= damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index 8e9ef1d4ae..e884f6f0ba 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 3; @@ -84,16 +85,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = newVelocity; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 300); - } - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 170); // Don't suffer from the same issues Murasama did in the past; encouraging people to kill their wrists for some extra DPS is bad lmao diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index 2fc3736a21..c184e5faaf 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -60,6 +60,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.numHits < 1) { Particle orb = new GlowSparkParticle(target.Center, Projectile.velocity.SafeNormalize(Vector2.UnitY), false, 12, 0.07f, mainColor, new Vector2(1.5f, 0.8f), true); diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 7df5d407e1..2208750278 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -36,6 +36,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; // No reason to ID-static the chainsaw -- multiple players can true melee simultaneously! Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/PrismaticBreakerHoldout.cs b/Projectiles/Melee/PrismaticBreakerHoldout.cs index f9b63480d5..8fb31ba0a0 100644 --- a/Projectiles/Melee/PrismaticBreakerHoldout.cs +++ b/Projectiles/Melee/PrismaticBreakerHoldout.cs @@ -25,6 +25,12 @@ namespace CalamityMod.Projectiles.Melee public float StarTimer = 0f; public float StarFrequency = 47f; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + } + public override void HoldoutAI() { if (Owner.CantUseHoldout()) diff --git a/Projectiles/Melee/PrismaticMagicCircle.cs b/Projectiles/Melee/PrismaticMagicCircle.cs index 108b2e440d..66d896bd66 100644 --- a/Projectiles/Melee/PrismaticMagicCircle.cs +++ b/Projectiles/Melee/PrismaticMagicCircle.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.width = Projectile.height = 512; Projectile.friendly = true; Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.tileCollide = false; Projectile.timeLeft = Lifetime; } diff --git a/Projectiles/Melee/PrismaticRay.cs b/Projectiles/Melee/PrismaticRay.cs index 9a7efa8c1a..df64d66a86 100644 --- a/Projectiles/Melee/PrismaticRay.cs +++ b/Projectiles/Melee/PrismaticRay.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.width = Projectile.height = 36; Projectile.friendly = true; Projectile.DamageType = MeleeRangedHybridDamageClass.Instance; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.timeLeft = 360; diff --git a/Projectiles/Melee/RespiteblockHoldout.cs b/Projectiles/Melee/RespiteblockHoldout.cs index 47bff0a112..14a4f95538 100644 --- a/Projectiles/Melee/RespiteblockHoldout.cs +++ b/Projectiles/Melee/RespiteblockHoldout.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ownerHitCheck = true; // No reason to ID-static the chainsaw -- multiple players can true melee simultaneously! Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs index 4ef4e0f9b3..4f12c74fe9 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs @@ -102,7 +102,11 @@ namespace CalamityMod.Projectiles.Melee.Shortswords } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Owner.Calamity().StratusStarburst++; + if (Projectile.numHits == 0) + Owner.Calamity().StratusStarburst++; + else + Owner.Calamity().StarburstSpawnFrameCounter += 0.25f; + } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs b/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs index ae618ec5b3..0c3d240adb 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs @@ -219,7 +219,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords Particle boostRing = new CustomSpark(position, velocity, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, lifetime, scale, color, stretch, shrinkSpeed: shrink); GeneralParticleHandler.SpawnParticle(boostRing); - if (stabbedNPC.CanBeMoved(true)) + if (stabbedNPC.CanBeMoved()) { stabbedNPC.velocity = -Owner.velocity; } diff --git a/Projectiles/Melee/SkytideDragoonHoldout.cs b/Projectiles/Melee/SkytideDragoonHoldout.cs index 946245b17b..686133e319 100644 --- a/Projectiles/Melee/SkytideDragoonHoldout.cs +++ b/Projectiles/Melee/SkytideDragoonHoldout.cs @@ -298,7 +298,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.65f, Pitch = 0.4f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 23, true); + target.MoveNPC(launchVel, 23, true, Owner); target.AddBuff(BuffID.Electrified, 230); } diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index b61bd6042b..5f67f8f6be 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -90,7 +91,10 @@ namespace CalamityMod.Projectiles.Melee.Spears else { if (timer == StartupTime - 1) - Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 75f)); //scales from 0x to 3x power + { + Projectile.originalDamage = (int)(Projectile.originalDamage * 0.75 * (channelCharge / 75f)); //scales from 0x to 3x power + Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 75f)); //Both are needed + } } //Make the sprite rotation look right in game Projectile.rotation -= (MathHelper.PiOver2) * (angle.X > 0 ? 1 : -1); @@ -260,15 +264,11 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 900); - Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015)); - if (Projectile.damage > 1) - Projectile.damage = (int)(Projectile.damage * 0.925f); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015), 0.5f); + Projectile.originalDamage = (int)(Projectile.originalDamage * 0.925f); + Projectile.damage = (int)(Projectile.damage * 0.925f); //Both are needed as it doesn't recalculate till next frame } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f; - modifiers.CritDamage += critDamage; - } + => modifiers.ApplyScalingForcedCrit(Projectile); } } diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index ddefad369a..86ec5b4408 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.height = 40; Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.ignoreWater = true; diff --git a/Projectiles/Melee/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index 5dfff076cc..d06ba14221 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -202,7 +202,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.55f, Pitch = 0.6f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 17, true); + target.MoveNPC(launchVel, 17, true, Owner); for (int i = 0; i < MathHelper.Clamp(10 - Projectile.numHits * 2, 2, 10); i++) { diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index b5ecb88747..6152096f2e 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -89,6 +89,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.timeLeft = Terratomere.SwingTime; Projectile.usesLocalNPCImmunity = true; Projectile.MaxUpdates = 2; @@ -284,7 +285,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), Terratomere.TrueMeleeGlacialStateTime); + target.AddBuff(BuffID.Frozen, Terratomere.TrueMeleeFrozenTime); Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.025), 0.75f); // Create a slash creator on top of the hit target. diff --git a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs index 13d64dee45..47ccb9bc7e 100644 --- a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs +++ b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Melee float spreadAmount = MathHelper.ToRadians(360); for (var i = 0; i < orbAmount; i++) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), target.Center, -angle.RotatedByRandom(spreadAmount) * 3.5f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), target.Center, -angle.RotatedByRandom(spreadAmount) * 3f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, player.whoAmI); } Particle bloodsplosion2 = new CustomPulse(target.Center, Vector2.Zero, (!ChildSafety.Disabled ? Color.CornflowerBlue : new Color(255, 32, 32)) * 0.75f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-15f, 15f), 0.03f, 0.155f, 40); diff --git a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs index 70f8077503..49f6e7f207 100644 --- a/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs +++ b/Projectiles/Melee/TrueBiomeBlade_ChainedMeatHook.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee } } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffType(), 100); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 100); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item105, Projectile.Center); diff --git a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs index da7aad8975..48137f78b4 100644 --- a/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_EarthenTides.cs @@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs index 1db4fff2ff..6da96fc3f6 100644 --- a/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs +++ b/Projectiles/Melee/TrueBiomeBlade_LamentationsOfTheChained.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs index efdf0451fa..c73df900ed 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 70; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index 95223e7aa4..a0445fe39e 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.width = Projectile.height = 74; Projectile.tileCollide = false; Projectile.friendly = true; diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index 96c173fec5..fe2ae8174c 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.height = 196; Projectile.Center = Projectile.position; Projectile.originalDamage = Projectile.damage; - Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 0.75f, chargeProgress)); + Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 1f, chargeProgress)); sawHit = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.aiStyle = -1; @@ -113,10 +113,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { if (sawHit) { + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.85f); Vector2 bloodpos = Projectile.Center + Projectile.DirectionTo(target.Center) * 84; - if (!spawnedBlood && Main.rand.NextBool() && chargeProgress > 0.2f && target.Hitbox.Contains(bloodpos.ToPoint())) + if (!spawnedBlood && chargeProgress > Main.rand.NextFloat() && target.Hitbox.Contains(bloodpos.ToPoint())) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 4, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 8, 0f, Projectile.owner); spawnedBlood = true; } return; diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 3f2b27e3c6..3c7a6de762 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -200,8 +200,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCHit/OtherworldlyHit") with { Pitch = -0.45f, Volume = 0.33f }, Projectile.Center); } - else - target.AddBuff(ModContent.BuffType(), 180); GFBCounter = 15; } } diff --git a/Projectiles/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index a52e6c2f5e..da98941b47 100644 --- a/Projectiles/Ranged/AnimosityBullet.cs +++ b/Projectiles/Ranged/AnimosityBullet.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); // Music easter egg in GFB, and more! if (Main.zenithWorld) diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index 8ae685bc7a..649136df35 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -108,7 +108,12 @@ namespace CalamityMod.Projectiles.Ranged LightPower = MathHelper.Lerp(LightPower, lightPowerBelow, 0.15f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + //Doze - Flamethrowers in vanilla are long debuff infliction tools (20 seconds of their debuff). + //I am applying this as the base for Cal flamethrowers, with shorter times being the exception instead of the rule + target.AddBuff(ModContent.BuffType(), 1200); + } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.SourceDamage *= damageMult; diff --git a/Projectiles/Ranged/ChickenCannonHeld.cs b/Projectiles/Ranged/ChickenCannonHeld.cs index a34cdee075..bcb02eccf2 100644 --- a/Projectiles/Ranged/ChickenCannonHeld.cs +++ b/Projectiles/Ranged/ChickenCannonHeld.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; } diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index e6261e8090..6717782c43 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 48d0f4c787..b014d84d92 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -1,74 +1,470 @@ -using CalamityMod.Particles; +using System; +using System.Linq; +using System.Runtime.InteropServices.Marshalling; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Build.Construction; +using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class DryadsTearMain : ModProjectile, ILocalizedModType + public class DryadsTearMain : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.localAI[1]; + public int turnDirection = 0; // Direction it will rotate + public int turnChange = 0; // Adds variance to multiple aspects of the bullet, including when it will change its turn direction + public float turnIntensity = 0; // Adds a bit more variance, this time to velocity + public float damageMult = 1; // Multiplier that updates instantly, used for most of the gameplay effects + public float visualMult = 0.75f;// Multiplier that updates over time, used for most of the visual effects + public Vector2 dropletPosition; // The position of the orbiting teardrop + public Vector2 lastDropletPosition; // The previous position of the orbiting teardroplet + public Vector2 dropletVel; // The velocity of the teardrop + public float orbitSine = 0; // A sine wave multiplier for the orbiting arc + public static int startingUpdates = 5; // The number of extra updates the projectile starts with + public bool dropletAttack = false; // If the bullet has begun sending it's droplet to attack + public float dropletAttackLerp = 1; // A lerp variable used for timing the droplet's attack + public int frameDelay = 0; // A few frames of delay after landing on the enemy before explosing, which improves the visuals + public bool detachEffects = true; // Used for the moment when the droplet detatched from the main bullet + public bool isMaxPower => damageMult >= 1; // If the bullet is at maximum power + public float finalEffectMult => Projectile.scale * visualMult; // Used for many but not all visual scaling effects + public NPC targeted; // The target being attacked by the droplet + public ref float trueLifetime => ref Projectile.ai[2]; // The lifetime of the projectile, used over vanilla lifetime because it can increment by decimals + + public int effectSpeedMod = 0; // Used to add variance to effects when firing rapidly + public int fadeLifetime => (int)(35 + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time in which the projectile fades out and can no longer hit anything + public int extendedLifetime => (int)(85 * Math.Min(damageMult, 1) + effectSpeedMod * Math.Max(1 - damageMult, 0)); // The time after lifetime reaches zero where the droplet does its attack + public bool fading => trueLifetime <= fadeLifetime; // If the projectile is fading away + + public float explosionDamageMult = 1.4f; + public float maxDamageMult = 1.65f; + public static Asset ShineTexture { get; private set; } + public static Asset BloomTexture { get; private set; } + public override void Load() + { + if (Main.dedServ) + return; + + ShineTexture = ModContent.Request("CalamityMod/Particles/GlowSpark"); + BloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle"); + } + public Player Owner => Main.player[Projectile.owner]; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailCacheLength[Type] = 35; ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; } - public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = 20; + Projectile.height = 20; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.extraUpdates = 5; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.timeLeft = 300; + Projectile.ArmorPenetration = 18; + Projectile.extraUpdates = startingUpdates; } public override void AI() { - Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.25f); - - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) + if (dropletAttack && targeted != null && (targeted.life <= 0 || !targeted.active || !targeted.CanBeChasedBy(Projectile))) // If the chosen target becomes invalid, target a near enemy instead + targeted = dropletPosition.ClosestNPCAt(1200); if (targeted == null) dropletAttack = false; // If that fails, cancel the teardrop effect + Projectile.timeLeft++; // Keep regular lifetime from going down, since it uses it's own lifetime timer + float mainBulletFadeTime = -extendedLifetime * 0.3f; + Projectile.scale = 1 - MathF.Pow(Utils.GetLerpValue(fadeLifetime, mainBulletFadeTime, trueLifetime, true), 1.3f); // fade out the bullet scale when lifetime is at its end + + if (turnDirection == 0) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 131 : 294, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f)); + trueLifetime = fadeLifetime * 1.5f; + turnDirection = Main.rand.NextBool() ? -1 : 1; + turnChange = Main.rand.Next(30, 190 + 1); + turnIntensity = Main.rand.NextFloat(0.2f, 1.6f); + effectSpeedMod = Main.rand.Next(5, 35); + } + if (time % turnChange == 0 && !fading) + turnDirection *= -1; + + visualMult = MathHelper.Lerp(visualMult, damageMult, 0.1f / Projectile.MaxUpdates); + + float speed = 8 * MathF.Pow(visualMult, 0.3f) * Math.Max(MathF.Pow(Utils.GetLerpValue(0, fadeLifetime, trueLifetime, true), 2), 0.15f); + bool chanceForDust = Main.rand.NextBool((int)Math.Clamp((fading ? 8 : 5) / finalEffectMult, 3, 60)); + if (time > 12 && chanceForDust && finalEffectMult > 0.1f) // Some dust effects + { + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5 + Main.rand.NextVector2CircularEdge(9, 9) * finalEffectMult, ModContent.DustType(), -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.4f)); dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.45f, 0.65f); - if (dust.type == 131) - dust.scale = Main.rand.NextFloat(0.35f, 0.55f); + dust.scale = Main.rand.NextFloat(0.85f, 1.0f) * finalEffectMult; + dust.color = Color.Aquamarine; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = 1; + } + + if (time > 0) // Reduce damage and visual intensity for every projectile of this type from the same player that are relativley close to each other + { + float damageReduction = 1; + int ownedProj = Owner.ownedProjectileCounts[Projectile.type]; + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.owner == Projectile.owner && projectile.active && projectile.type == Projectile.type && projectile != Projectile) + damageReduction++; + } + float newDamageMult = MathF.Pow(1 / damageReduction, 0.25f); + if (newDamageMult < damageMult && !fading) + damageMult = newDamageMult; + } + + if (isMaxPower) + damageMult = maxDamageMult; + + + float movement = Main.rand.NextFloat(0.009f, 0.0115f) * speed; + if (damageMult < 1) + Projectile.velocity += Vector2.Lerp(Projectile.velocity.RotatedBy(MathHelper.PiOver2 * turnDirection).SafeNormalize(Vector2.UnitX) * movement * turnIntensity, Projectile.velocity, MathF.Pow(Math.Min(damageMult + 0.15f, 1), 3.3f)); + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed; + + float startDropAttackTime = 0; + if (dropletAttack && trueLifetime <= startDropAttackTime) + { + if (detachEffects) + { + Projectile.Opacity = 0; + float scale = 0.7f * damageMult; + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.9f * damageMult, Pitch = 0.3f }, Projectile.Center); + for (int i = 0; i <= 2; i++) + { + CustomColorChangeSpark detach = new CustomColorChangeSpark(dropletPosition, Vector2.UnitY * 0.1f, "CalamityMod/Particles/BloomCircle", false, 15, 0.45f * scale, Color.Lime, Color.Turquoise, new Vector2(1f, 1f), true, true, colorFadeSpeed: 5, shrinkSpeed: -0.25f, extraRotation: MathHelper.PiOver2); + GeneralParticleHandler.SpawnParticle(detach, true); + } + for (int i = -1; i <= 1; i += 2) + { + CustomColorChangeSpark detachWave = new CustomColorChangeSpark(dropletPosition, Vector2.UnitX * 1.5f * i * scale, "CalamityMod/Particles/ArchSmear", false, 15, 0.35f * scale, Color.Turquoise, Color.Lime, new Vector2(0.8f, 1.1f), colorFadeSpeed: 5, shrinkSpeed: 0.45f); + GeneralParticleHandler.SpawnParticle(detachWave, true); + } + for (int i = -2; i <= 2; i += 1) // 4 + { + float angle = MathHelper.PiOver4 / 2; + Vector2 vel = Vector2.UnitX.RotatedBy(Math.Abs(i) == 1 ? angle : -angle) * 2.2f * Math.Sign(i) * scale; + for (int t = -1; t <= 1; t++) // 3 + { + Dust dust = Dust.NewDustPerfect(dropletPosition, ModContent.DustType(), vel.RotatedBy(0.25f * t) * (2.5f - Math.Abs(t))); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.45f, 1.55f) * scale; + dust.color = t == 0 ? Color.Aquamarine : Color.Lime; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = 1 * scale; + dust.customData = new Vector2(0.6f, 3.5f); + } + if (i == -1) + i++; + } + detachEffects = false; + } + dropletAttackLerp = (1 - MathF.Pow(Utils.GetLerpValue(startDropAttackTime, -extendedLifetime, trueLifetime, true), 4)) * damageMult; + float cappedReverseDamageMult = Math.Max(1 - damageMult, 0); + Vector2 Xoffset = Vector2.UnitX * (targeted.width * 0.5f * turnIntensity) * cappedReverseDamageMult * turnDirection; + Vector2 goalPosition = targeted.Center + Xoffset - (Vector2.UnitY * (targeted.height / 2 + (220 + turnChange * (0.25f + cappedReverseDamageMult)))) * dropletAttackLerp; + Vector2 goalVel = (goalPosition - dropletPosition) / ((1 + 6 * dropletAttackLerp) * Projectile.MaxUpdates); + dropletVel = goalVel; + lastDropletPosition = dropletPosition; + dropletPosition += dropletVel; + } + else + { + float sineTimer = time + turnChange; + float sine = MathF.Sin((sineTimer / 0.5f) / MathHelper.Pi / startingUpdates); + float sine2 = MathF.Sin((sineTimer / 1f) / MathHelper.Pi / startingUpdates); + orbitSine = MathHelper.Lerp(Math.Abs(sine2), 0.1f, 1 - Math.Abs(sine2)); + float xOrbit = 35f * finalEffectMult; + float yOrbit = 25f * finalEffectMult; + if (finalEffectMult > 0.35f) + dropletPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * xOrbit * sine + Projectile.velocity.SafeNormalize(Vector2.UnitX) * yOrbit * orbitSine; else - dust.fadeIn = 0.5f; + dropletPosition += (dropletVel * 3f + (Projectile.velocity.SafeNormalize(Vector2.UnitX) + dropletPosition.DirectionFrom(Projectile.Center)) * 0.75f) * finalEffectMult; + + } + + if (lastDropletPosition == Vector2.Zero) lastDropletPosition = dropletPosition; + bool lowLifetime = trueLifetime <= mainBulletFadeTime; + float dropletScaling = (dropletAttack ? (1 + (1 - dropletAttackLerp)) * damageMult : finalEffectMult); + if (time > 1 * Projectile.MaxUpdates && (!lowLifetime || dropletAttack)) + { + if (!lowLifetime) + { + CustomColorChangeSpark trail = new CustomColorChangeSpark(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * (20 - Math.Min(9f / finalEffectMult, 20)), -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 0.1f, "CalamityMod/Particles/BloomCircle", false, + (int)(18 * finalEffectMult), 0.2f * finalEffectMult, Color.Turquoise, Color.Lime, new Vector2(0.25f, 2.25f * Utils.Remap(speed, 7, 0.5f, 1, 0.1f)), noShrink: true, colorFadeSpeed: 5); + GeneralParticleHandler.SpawnParticle(trail, true); + } + + bool falling = trueLifetime < -extendedLifetime * 0.65f; + if (frameDelay < 2) + { + float dropLerp = MathF.Pow(Utils.GetLerpValue(startDropAttackTime, -extendedLifetime, trueLifetime, true), 2.5f); + if (lastDropletPosition != dropletPosition) + dropletVel = lastDropletPosition.DirectionTo(dropletPosition); + float speedMult = falling ? dropLerp * 0.5f : Utils.Remap(speed, 7, 0.5f, 1, 0.1f); + float colorMult = falling ? 1 - dropLerp * 0.35f : 1; + CustomColorChangeSpark dropTrail = new CustomColorChangeSpark(dropletPosition - dropletVel * 16.5f * speedMult * dropletScaling, falling ? dropletVel * 3 : dropletVel * 0.1f, "CalamityMod/Particles/BloomCircle", false, + falling ? (int)(10 * (1 - dropLerp * 0.6f)) : (int)(6 + 2 * dropletScaling), 0.135f * dropletScaling * (1 + dropLerp * 0.3f), Color.Turquoise * colorMult, falling ? Color.Lime * colorMult : Color.Teal * colorMult, new Vector2(0.15f * (falling ? 0.5f + dropLerp * 3 : 1) * damageMult, (Math.Max(0.15f * lastDropletPosition.Distance(dropletPosition), 0.25f) * (1 - dropLerp * 0.2f))), noShrink: true, colorFadeSpeed: 5, glowOpacity: colorMult, shrinkSpeed: falling ? 1.5f - dropLerp : 0); + GeneralParticleHandler.SpawnParticle(dropTrail, true); + + if (Main.rand.NextBool(3)) + { + Dust dust = Dust.NewDustPerfect(dropletPosition + Main.rand.NextVector2Circular(5 + 20 * (1 - dropletAttackLerp), 5 + 20 * (1 - dropletAttackLerp)), ModContent.DustType()); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.15f, 1.55f) * 0.5f * visualMult; + dust.velocity = dropletVel.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.3f, 0.9f); + dust.color = Main.rand.NextBool() ? Color.Aquamarine : Color.Teal; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = Math.Max((Main.rand.NextFloat(-0.2f, -0.4f) - (Main.rand.NextBool(5) ? 0.4f : 0)) * visualMult, -0.85f); + dust.customData = new Vector2(1, 1); + } + } + } + + Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.4f * finalEffectMult); + Lighting.AddLight(dropletPosition, Color.Turquoise.ToVector3() * 0.25f * dropletScaling); + + lastDropletPosition = dropletPosition; + if (trueLifetime <= 0 && (!dropletAttack || (frameDelay > 3 && trueLifetime <= -extendedLifetime))) + { + Splash(); + Projectile.Kill(); + return; + } + if (Projectile.FinalExtraUpdate()) + trueLifetime -= 1 / MathF.Pow(damageMult, 0.3f); + if (trueLifetime <= -extendedLifetime && Projectile.FinalExtraUpdate()) + frameDelay++; + time++; + } + public void Splash() + { + if (dropletAttack) + { + SoundStyle drop1 = new("CalamityMod/Sounds/Item/MittHit"); + SoundEngine.PlaySound(drop1 with { Volume = 0.8f * damageMult, Pitch = Main.rand.NextFloat(0.6f, 0.7f) }, dropletPosition); + SoundStyle drop2 = new("CalamityMod/Sounds/Item/WaterSplash", 2); + SoundEngine.PlaySound(drop2 with { Volume = 0.7f * damageMult, Pitch = Main.rand.NextFloat(1.4f, 1.5f) }, dropletPosition); + if (isMaxPower) + { + SoundStyle drop3 = new("CalamityMod/Sounds/Item/HolyFireBulletExplosion"); + SoundEngine.PlaySound(drop3 with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.5f, -0.6f) }, dropletPosition); + } + + float scale = (isMaxPower ? 2f : 1.5f) * damageMult; + bool reduceVisuals = damageMult < 0.5f; + for (int i = 0; i <= (reduceVisuals ? 1 : 2); i++) + { + CustomColorChangeSpark bloomHit = new CustomColorChangeSpark(dropletPosition, Vector2.UnitY * 0.1f, "CalamityMod/Particles/BloomCircle", false, 10, 0.45f * scale, Color.Lime, Color.Turquoise, new Vector2(1f, 2f), true, true, colorFadeSpeed: 5, shrinkSpeed: 0.45f, extraRotation: MathHelper.PiOver2); + GeneralParticleHandler.SpawnParticle(bloomHit, true); + } + for (int i = -1; i <= 1; i += 2) + { + CustomColorChangeSpark wave = new CustomColorChangeSpark(dropletPosition, Vector2.UnitX * 7.5f * i * scale, "CalamityMod/Particles/ArchSmear", false, 12, 0.35f * scale, Color.Turquoise, Color.Lime, new Vector2(1f, 1.1f), colorFadeSpeed: 5, shrinkSpeed: 0.45f); + GeneralParticleHandler.SpawnParticle(wave, true); + CustomColorChangeSpark wave2 = new CustomColorChangeSpark(dropletPosition, Vector2.UnitX * 10.5f * i * scale, "CalamityMod/Particles/ArchSmear", false, 8, 0.35f * scale, Color.Lime, Color.Turquoise, new Vector2(0.8f, 1.1f), colorFadeSpeed: 5, shrinkSpeed: 0.55f); + GeneralParticleHandler.SpawnParticle(wave2, true); + } + for (int i = -2; i <= 2; i += 1) // 4 + { + float angle = MathHelper.PiOver4 / 2.5f; + Vector2 vel = Vector2.UnitX.RotatedBy(Math.Abs(i) == 1 ? angle : -angle) * 2.2f * Math.Sign(i) * scale; + for (int t = (reduceVisuals ? 0 : -1); t <= (reduceVisuals ? 0 : 1); t++) // 3 + { + Dust dust = Dust.NewDustPerfect(dropletPosition, ModContent.DustType(), vel.RotatedBy(0.25f * t) * (2.5f - Math.Abs(t)) * scale); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.25f, 1.35f) * scale; + dust.color = t == 0 ? Color.Aquamarine : Color.Lime; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = 1.4f * scale; + dust.customData = new Vector2(0.6f, 3.5f); + } + if (i == -1) + i++; + } + int dusts = reduceVisuals ? 4 : 10; + for (int i = -dusts; i <= dusts; i++) + { + Dust dust = Dust.NewDustPerfect(dropletPosition + Main.rand.NextVector2CircularEdge(10 - Math.Abs(i), 10 - Math.Abs(i)), ModContent.DustType(), Vector2.UnitX * 2f * i * scale); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.85f, 0.95f) * scale; + dust.color = Main.rand.NextBool() ? Color.Aquamarine : Color.Lime; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = 0.45f * scale; + dust.customData = new Vector2(0.8f, 1.3f); + if (i == -1) + i++; + } + if (targeted != null) + { + float blastSize = 75 * scale; + float minMultiplier = 0.15f; + int hitsToMinMult = (int)(3 + 5 * damageMult); + int knockback = (int)(7 * damageMult * (isMaxPower ? -1 : 1)); // Give heavy knockback at full power + int damage = (int)(Projectile.damage * explosionDamageMult * damageMult); + Projectile blast = Projectile.NewProjectileDirect(Owner.GetSource_FromThis(), targeted.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Owner.whoAmI, blastSize, minMultiplier, hitsToMinMult); + blast.timeLeft = 8; + blast.DamageType = DamageClass.Ranged; + blast.ArmorPenetration = Projectile.ArmorPenetration; + } + if (damageMult >= 0.75f) + Owner.SetScreenshake(6f * damageMult); } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + Projectile.extraUpdates = 2; + int chanceReduction = (int)(2 / damageMult); + if (isMaxPower) + { + SoundStyle perfectHit = new("CalamityMod/Sounds/Item/LightMetal"); + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(perfectHit with { Volume = 0.85f, Pitch = Main.rand.NextFloat(-1.2f, -1.3f) + 0.6f * i, MaxInstances = 3 }, dropletPosition); + } + if (damageMult >= 0.75f) + { + Owner.SetScreenshake(4f * damageMult); + float angle = Main.rand.NextFloat(0, MathHelper.TwoPi); + for (int i = -6; i <= 6; i++) // 12 + { + float variance = Main.rand.NextFloat(-0.5f, 0.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(variance * 0.3f).RotatedByRandom(0.1f) * (Main.rand.NextFloat(5, 6) - Math.Abs(variance * 9)) * 5 * damageMult); + dust.noGravity = true; + dust.scale = (Main.rand.NextFloat(2.5f, 2.75f) - Math.Abs(variance)) * damageMult; + dust.color = Main.rand.NextBool() ? Color.Aquamarine : Color.Lime; + dust.noLight = true; + dust.noLightEmittence = true; + dust.fadeIn = 1.25f * damageMult; + dust.customData = new Vector2(0.3f, 1.7f); + if (i == -1) + i++; + } + float spining = Main.rand.NextFloat(-0.15f, 0.15f); + for (int i = 0; i < 2; i++) + { + CustomColorChangeSpark hit = new CustomColorChangeSpark(Projectile.Center, Vector2.UnitX.RotatedBy(angle + MathHelper.PiOver2 * i) * 0.01f, "CalamityMod/Particles/FullStar", false, 9, 3.55f * damageMult, Color.Lime, Color.Turquoise, new Vector2(1f, 1f), true, true, colorFadeSpeed: 5, shrinkSpeed: 1f, extraRotation: MathHelper.PiOver2, spin: spining); + GeneralParticleHandler.SpawnParticle(hit, true); + } + } + dropletAttack = true; + targeted = target; + trueLifetime = fadeLifetime; + modifiers.SourceDamage *= damageMult; + } + public override bool? CanHitNPC(NPC target) => time > 1 && Projectile.numHits == 0; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float hitboxSize = 20 * Projectile.scale * damageMult; + return CalamityUtils.CircularHitboxCollision(Projectile.Center, hitboxSize, targetHitbox); + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesFromEdge(Projectile, 0, lightColor); + Vector2 drawPosition = dropletPosition - Main.screenPosition; + + float dropletScaling = (dropletAttack ? (1 + (1 - dropletAttackLerp) * 0.7f) * damageMult : finalEffectMult); + PixelationManager.AddPixelatedDrawer((_) => + { + float dropLerp = MathF.Pow(Utils.GetLerpValue(0, -extendedLifetime, trueLifetime, true), 2.5f); ; + int draws = 3; + for (int i = 0; i < draws; i++) + { + float circlingScale = ((i == 0 ? 0.15f : 0.3f) - orbitSine * 0.1f); + Main.EntitySpriteDraw(BloomTexture.Value, drawPosition, null, i == 0 ? Color.White * 0.8f : Color.Turquoise, 0, BloomTexture.Value.Size() * 0.5f, dropletScaling * (circlingScale) * (0.8f + dropLerp * 0.2f), SpriteEffects.None); + } + + float fallTime = -extendedLifetime * 0.65f; + float shineMult = damageMult * MathF.Pow((trueLifetime > fallTime ? Utils.GetLerpValue(0, fallTime, trueLifetime, true) : Utils.GetLerpValue(-extendedLifetime, fallTime, trueLifetime, true)), 2); + for (int i = -1; i <= 1; i++) + { + if (i == 0) i++; + float rot = MathHelper.PiOver2 * (i > 0 ? -1 : 1); + for (int t = 0; t < 2; t++) + Main.EntitySpriteDraw(ShineTexture.Value, drawPosition, null, t == 0 ? Color.Teal : Color.White * 0.65f, rot, ShineTexture.Value.Size() * 0.5f, new Vector2((t == 0 ? 3 : 1) * 0.02f, (t == 0 ? 0.6f : 1) * (0.2f + shineMult * 0.4f)) * shineMult * 0.2f, SpriteEffects.None); + } + + }, ((orbitSine > 0.5f || trueLifetime <= 0) ? Enums.GeneralDrawLayer.AfterProjectiles : Enums.GeneralDrawLayer.BeforeProjectiles), BlendState.Additive); return false; } + public float WidthFunction(float completion, Vector2 _) + { + float width; + float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 9 - completion * 6); + float newSine = 0.7f - sine * 0.1f; + width = finalEffectMult * 25 * newSine * (completion < 0.4f ? 1 - MathF.Pow(Utils.GetLerpValue(0.4f, 0f, completion, true), 3) : Utils.GetLerpValue(1f, 0.4f, completion, true)) * (float)Math.Sin(Math.Acos(1 - Utils.GetLerpValue(0f, 0.08f, completion, true))); + + return width; + } + + public Color ColorFunction(float completion, Vector2 _) + { + Color clr = Color.Lerp(Color.Lime, Color.Turquoise, completion + 0.3f); + Color tipColor = Color.Lerp(clr, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(clr, tipColor, completion); + } + + public float CoreWidthFunction(float completion, Vector2 _) + { + float width; + + float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 9 - completion * 6); + float newSine = 0.7f - sine * 0.2f; + width = finalEffectMult * 20 * newSine * (completion < 0.4f ? 1 - MathF.Pow(Utils.GetLerpValue(0.4f, 0f, completion, true), 3) : Utils.GetLerpValue(1f, 0.4f, completion, true)) * (float)Math.Sin(Math.Acos(1 - Utils.GetLerpValue(0f, 0.08f, completion, true))); + + return width; + } + + public Color CoreColorFunction(float completion, Vector2 _) + { + Color tipColor = Color.Lerp(Color.Lerp(Color.White, Color.Turquoise, completion + 0.65f), Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(Color.White, tipColor, completion); + } + + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) + { + // Render the main trail + string shader = "CalamityMod:TrailStreak"; + Vector2[] length = Projectile.oldPos.Take((int)(Math.Max(40 * visualMult, 14))).ToArray(); + GameShaders.Misc[shader].SetShaderTexture(ModContent.Request("CalamityMod/Particles/BloomRing")); + PrimitiveRenderer.RenderTrail(length, new(WidthFunction, ColorFunction, (_, _) => Projectile.Size * 0.5f, true, true, GameShaders.Misc[shader]), length.Length * 2); + + // Render a smaller, pure white trail in the same position + Vector2[] length2 = Projectile.oldPos.Take((int)(Math.Max(18 * visualMult, 6))).ToArray(); + GameShaders.Misc[shader].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(length2, new(CoreWidthFunction, CoreColorFunction, (_, _) => Projectile.Size * 0.5f, true, true, GameShaders.Misc[shader]), length2.Length * 2); + } public override void OnKill(int timeLeft) { - if (Projectile.owner == Main.myPlayer) - { - for (int b = 0; b < 2; b++) - { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f); - } - for (int i = 0; i < 3; i++) - { - Vector2 velocity = new Vector2(4, 4).RotatedByRandom(100); - LineParticle spark2 = new LineParticle(Projectile.Center + velocity, velocity * Main.rand.NextFloat(0.5f, 1f), false, 11, 0.65f, Main.rand.NextBool(3) ? Color.MediumAquamarine : Color.Lime); - GeneralParticleHandler.SpawnParticle(spark2); - } - } - SoundEngine.PlaySound(SoundID.Item118 with { Pitch = 0.5f }, Projectile.Center); + } } } diff --git a/Projectiles/Ranged/DryadsTearMain.png b/Projectiles/Ranged/DryadsTearMain.png deleted file mode 100644 index c8e2d22eec..0000000000 Binary files a/Projectiles/Ranged/DryadsTearMain.png and /dev/null differ diff --git a/Projectiles/Ranged/DryadsTearSplit.cs b/Projectiles/Ranged/DryadsTearSplit.cs deleted file mode 100644 index 26ca02be87..0000000000 --- a/Projectiles/Ranged/DryadsTearSplit.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class DryadsTearSplit : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - private float speed = 0f; - public override void SetStaticDefaults() - { - ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.TrailCacheLength[Type] = 3; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; - Projectile.timeLeft = 210; - Projectile.extraUpdates = 1; - Projectile.tileCollide = false; - Projectile.ArmorPenetration = 10; - AIType = ProjectileID.Bullet; - } - - public override bool? CanHitNPC(NPC target) => Projectile.ai[2] >= 30 && target.CanBeChasedBy(Projectile); - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesFromEdge(Projectile, 0, lightColor); - return false; - } - - public override void AI() - { - Projectile.ai[2]++; - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.6f)); - dust.noGravity = true; - dust.scale = Main.rand.NextFloat(0.5f, 0.8f); - dust.color = Main.rand.NextBool(3) ? Color.MediumAquamarine : Color.Lime; - - if (speed == 0f) - speed = Projectile.velocity.Length(); - - if (Projectile.ai[2] >= 30) - { - CalamityUtils.HomeInOnNPC(Projectile, true, 500f, speed, 12f); - } - } - } -} diff --git a/Projectiles/Ranged/DryadsTearSplit.png b/Projectiles/Ranged/DryadsTearSplit.png deleted file mode 100644 index eccb062baa..0000000000 Binary files a/Projectiles/Ranged/DryadsTearSplit.png and /dev/null differ diff --git a/Projectiles/Ranged/FlashRoundFlash.cs b/Projectiles/Ranged/FlashRoundFlash.cs index 292698a737..6fb1571f0f 100644 --- a/Projectiles/Ranged/FlashRoundFlash.cs +++ b/Projectiles/Ranged/FlashRoundFlash.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Projectile.Center); - target.MoveNPC(launchVel, 5, false); + target.MoveNPC(launchVel, 5, false, Owner); Vector2 dustVel = Utils.DirectionTo(Projectile.Center, target.Center); for (int i = 0; i < 3; i++) diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 39b2db16d6..5b221afcc8 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/FlurrystormIceShard.cs b/Projectiles/Ranged/FlurrystormIceShard.cs index 343a0ebc35..977a176d83 100644 --- a/Projectiles/Ranged/FlurrystormIceShard.cs +++ b/Projectiles/Ranged/FlurrystormIceShard.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 7b111a00ae..4800aa818b 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center); if (!target.boss) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frozen, 120); int points = 6; float radians = MathHelper.TwoPi / points; diff --git a/Projectiles/Ranged/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs index 90705bfdf2..e53c485122 100644 --- a/Projectiles/Ranged/HellbornProj.cs +++ b/Projectiles/Ranged/HellbornProj.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged // Launch Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 6, true); + target.MoveNPC(launchVel, 6, true, Owner); MakeBlast(target.whoAmI, true); } diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index a95485dbed..0a84bc428e 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged dust2.color = Main.rand.NextBool(3) ? EffectsColor : StaticEffectsColor; } var projAmount = isClusterRocket ? 3f : 2f; - if (Main.player[Projectile.owner].strongBees && Main.rand.NextBool()) + if (Main.player[Projectile.owner].strongBees) projAmount++; for (int k = 0; k < projAmount; k++) { diff --git a/Projectiles/Ranged/HiveNuke.cs b/Projectiles/Ranged/HiveNuke.cs index 42d6a91781..af0b2be614 100644 --- a/Projectiles/Ranged/HiveNuke.cs +++ b/Projectiles/Ranged/HiveNuke.cs @@ -241,7 +241,7 @@ namespace CalamityMod.Projectiles.Ranged var projAmount = isClusterRocket ? 30f : 20f; if (Main.player[Projectile.owner].strongBees) - projAmount *= 1.15f; + projAmount *= 1.25f; for (int k = 0; k < projAmount; k++) { int BEES = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.8f), ModContent.ProjectileType(), (int)(Projectile.damage * (isClusterRocket ? 0.03f : 0.04f)), 0f, Projectile.owner, 0f, 0f, isClusterRocket ? 2f : 1f); diff --git a/Projectiles/Ranged/KingsbaneHoldout.cs b/Projectiles/Ranged/KingsbaneHoldout.cs index 23ea0c60bb..167c78065f 100644 --- a/Projectiles/Ranged/KingsbaneHoldout.cs +++ b/Projectiles/Ranged/KingsbaneHoldout.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.ignoreWater = true; Projectile.alpha = 255; } diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 30bacffc92..23b6229b73 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); } } } diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index 331e716686..d24165ad8d 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -45,6 +45,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.netImportant = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Projectiles/Ranged/NovaChargedShot.cs b/Projectiles/Ranged/NovaChargedShot.cs index 63bb4b40ca..36aaa3e5a1 100644 --- a/Projectiles/Ranged/NovaChargedShot.cs +++ b/Projectiles/Ranged/NovaChargedShot.cs @@ -2,6 +2,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -107,12 +108,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; - } + => modifiers.ApplyScalingForcedCrit(Projectile); public override bool? CanDamage() => base.CanDamage(); } } diff --git a/Projectiles/Ranged/NullFlash.cs b/Projectiles/Ranged/NullFlash.cs index 3654040cf2..3f728b5c57 100644 --- a/Projectiles/Ranged/NullFlash.cs +++ b/Projectiles/Ranged/NullFlash.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs index 8877b11310..f68087abfd 100644 --- a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs +++ b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -29,17 +30,16 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.45f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (damageMult + critDamage); + modifiers.SourceDamage *= (damageMult); Vector2 launchVel = Projectile.Center.DirectionTo(target.Center); float launchPower = 20; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 450, targetHitbox); } diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 7281333710..4232afc346 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Dusts; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -127,14 +128,11 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; - Vector2 launchVel = Projectile.velocity; float launchPower = 60; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? CanDamage() => Projectile.numHits < 1 ? null : false; public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index fe4aa1371d..7c3c00796b 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using CalamityMod.Dusts; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -200,12 +201,7 @@ namespace CalamityMod.Projectiles.Ranged return useColor; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; - } + => modifiers.ApplyScalingForcedCrit(Projectile); public override bool PreDraw(ref Color lightColor) { if (time < 2) diff --git a/Projectiles/Ranged/SlimeBolt.cs b/Projectiles/Ranged/SlimeBolt.cs index 576bcec82f..cad450e61d 100644 --- a/Projectiles/Ranged/SlimeBolt.cs +++ b/Projectiles/Ranged/SlimeBolt.cs @@ -107,7 +107,9 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Slimed, Empowered ? 480 : 180); + //Doze - Flamethrowers in vanilla are long debuff infliction tools (20 seconds of their debuff). + //I am applying this as the base for Cal flamethrowers, with shorter times being the exception instead of the rule + target.AddBuff(BuffID.Slimed, 1200); if (Empowered) { Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, SlimeColor, Vector2.One, 0f, 0f, 0.65f, 35); diff --git a/Projectiles/Ranged/TauCannonBeam.cs b/Projectiles/Ranged/TauCannonBeam.cs index 72ea9e7190..e4e98e00e8 100644 --- a/Projectiles/Ranged/TauCannonBeam.cs +++ b/Projectiles/Ranged/TauCannonBeam.cs @@ -46,6 +46,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.friendly = true; Projectile.usesLocalNPCImmunity = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index 60c5ea557c..49746ec717 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -127,19 +127,6 @@ namespace CalamityMod.Projectiles.Ranged // Play a sound with volume scaling with charge percent SoundEngine.PlaySound(SoundID.Item62 with { Volume = SoundID.Item62.Volume * ChargePercent }, Owner.MountedCenter); - // Summon Luxor's gift manually, as channeling tends to be.... unbalanced, to say the least, if you don't - if (Owner.Calamity().luxorsGift) - { - double rangedDamage = shotDamage * 0.15; - if (rangedDamage >= 1D) - { - float speed = 24f * ChargePercent; - int projectile = Projectile.NewProjectile(new EntitySource_ItemUse_WithAmmo(Owner, Owner.HeldItem, -1), Projectile.Center, direction * speed, ModContent.ProjectileType(), (int)rangedDamage, 0f, Projectile.owner); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - // Set the initial recoil, mark the projectile as fired, and set the target recoil Owner.itemRotation = initialRecoil; Charge = -1; diff --git a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs index ebdf68342e..7f049480b7 100644 --- a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs +++ b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs @@ -343,7 +343,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 launchDir = Utils.DirectionTo(Projectile.Center, target.Center); float launchPower = ((hasReachedFullCharge ? 9 : 0) + charge * 1.5f) * finalHitMult; - target.MoveNPC(launchDir, launchPower, true); + target.MoveNPC(launchDir, launchPower, true, Owner); float extraPitch = (Owner.Calamity().rogueStealthMax > 0 ? (0.25f * (Owner.Calamity().rogueStealth / Owner.Calamity().rogueStealthMax)) : 0); diff --git a/Projectiles/Rogue/ExorcismShockwave.cs b/Projectiles/Rogue/ExorcismShockwave.cs index 25e1abd09a..6257692b1c 100644 --- a/Projectiles/Rogue/ExorcismShockwave.cs +++ b/Projectiles/Rogue/ExorcismShockwave.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; float minMult = 0.35f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = (Projectile.Calamity().stealthStrike ? 4f : 1) * 10; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index 2f812635cf..910f00defe 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); Projectile.ai[0] = 1f; Projectile.ai[1] = target.whoAmI; Projectile.velocity = target.Center - Projectile.Center; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 09d88e9a77..a9abc5f43b 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); Projectile.ai[0] = 1f; Projectile.ai[1] = target.whoAmI; Projectile.velocity = target.Center - Projectile.Center; diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index 3ce8253f53..eb0ba1a84b 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -73,13 +73,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Frozen, 150); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index b62faae264..987c2786bd 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { for (int k = 0; k < 3; k++) diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index e079d036ad..4f835dfe1a 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue explosionCount++; } - int buffType = ModContent.BuffType(); + int buffType = BuffID.Frozen; float radius = 112f; // 7 blocks foreach (NPC nPC in Main.ActiveNPCs) diff --git a/Projectiles/Rogue/LanceofDestiny.cs b/Projectiles/Rogue/LanceofDestiny.cs index 12007830d2..34bfaacbfc 100644 --- a/Projectiles/Rogue/LanceofDestiny.cs +++ b/Projectiles/Rogue/LanceofDestiny.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue { public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak2") { Volume = 0.6f, PitchVariance = 0.3f }; public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public bool posthit = false; public int Time = 0; public int hitsDust = 7; diff --git a/Projectiles/Rogue/LeviathanToothStealth.cs b/Projectiles/Rogue/LeviathanToothStealth.cs index 24fdafda21..90da6945bf 100644 --- a/Projectiles/Rogue/LeviathanToothStealth.cs +++ b/Projectiles/Rogue/LeviathanToothStealth.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Rogue if (hitTimer == 0) hitTimer = Projectile.localNPCHitCooldown; - if (target.CanBeMoved(true)) + if (target.CanBeMoved()) target.velocity *= 0.05f; } public override bool? CanDamage() => canDamage ? null : false; diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs deleted file mode 100644 index 1e519983af..0000000000 --- a/Projectiles/Rogue/MoonSigil.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class MoonSigil : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 20; - Projectile.friendly = true; - Projectile.penetrate = 2; - Projectile.ignoreWater = true; - Projectile.timeLeft = 250; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override void AI() - { - if (Projectile.timeLeft < 52) - { - Projectile.alpha += 5; - Projectile.scale -= 0.013f; - } - if (Projectile.alpha >= 255) - { - Projectile.alpha = 255; - Projectile.Kill(); - return; - } - - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 8f, 20f); - } - - // Reduce damage of projectiles if more than the cap are active - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - int cap = 5; - float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; - modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); - } - - public override void OnKill(int timeLeft) - { - float dustSp = 0.2f; - int dustD = 0; - for (int i = 0; i < 4; i++) - { - for (int j = 0; j < 5; j++) - { - Vector2 dustspeed = new Vector2(dustSp, dustSp).RotatedBy(MathHelper.ToRadians(dustD)); - int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(213, 242, 232, 200), 1f); - Main.dust[d].noGravity = true; - Main.dust[d].position = Projectile.Center; - Main.dust[d].velocity = dustspeed; - dustSp += 0.2f; - } - dustD += 90; - dustSp = 0.2f; - } - } - - public override void PostDraw(Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Rogue/MoonSigil").Value; - Main.spriteBatch.Draw - ( - texture, - new Vector2 - ( - Projectile.position.X - Main.screenPosition.X + Projectile.width * 0.5f, - Projectile.position.Y - Main.screenPosition.Y + Projectile.height - 20 * 0.5f - ), - new Rectangle(0, 0, 20, 20), - Color.White, - Projectile.rotation, - new Vector2(10, 10), - Projectile.scale, - SpriteEffects.None, - 0f - ); - } - } -} diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 8dd4b9c786..6f39328766 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue Player player = Main.player[Projectile.owner]; int projAmt = Projectile.Calamity().stealthStrike ? 28 : 20; if (player.strongBees) - projAmt += Projectile.Calamity().stealthStrike ? 7 : 5; + projAmt = (int)(projAmt * 1.5f); for (int projIndex = 0; projIndex < projAmt; projIndex++) { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; diff --git a/Projectiles/Rogue/PumpkaboomBig.cs b/Projectiles/Rogue/PumpkaboomBig.cs index 7439fa10fd..310ecffa27 100644 --- a/Projectiles/Rogue/PumpkaboomBig.cs +++ b/Projectiles/Rogue/PumpkaboomBig.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.active && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < maxPullDistance) + if (target != null && target.active && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < maxPullDistance) { if (target.whoAmI == stuckNPC) continue; diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 5ef272e6b4..217ef9e6da 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue } if (target.life <= 0) - Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 10, 0f); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 5, 0f); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 54599b649a..a9584f036a 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ownerHitCheck = true; Projectile.hide = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; + Projectile.localNPCHitCooldown = -1; Projectile.alpha = 180; Projectile.scale = 1.25f; } @@ -64,12 +64,10 @@ namespace CalamityMod.Projectiles.Rogue public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - float f2 = Projectile.rotation - MathHelper.PiOver4 * - Math.Sign(Projectile.velocity.X) + (Projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + float spearLengthMult = 2.5f; float velocityMagnitude = 0f; - float scaleFactor = 18f; if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Main.player[Projectile.owner].Center, Projectile.Center + f2.ToRotationVector2() * scaleFactor, + Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) { return true; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 3a8948bad7..ceee3c72a8 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Projectiles.Rogue public class SpearofDestinyProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; public int framesInAir = 0; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.png b/Projectiles/Rogue/SpearofDestinyProjectile.png new file mode 100644 index 0000000000..8efaf3998f Binary files /dev/null and b/Projectiles/Rogue/SpearofDestinyProjectile.png differ diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs index 15bca9c5e9..25d93e1e7e 100644 --- a/Projectiles/Rogue/SpearofDestinyStealth.cs +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue { public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/BlazingCoreParry") { Volume = 0.7f, PitchVariance = 0.3f }; public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public bool posthit = false; public int Time = 0; public ref float Timer => ref Projectile.ai[0]; diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index 9d920c69f4..72676d8d23 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target.CanBeMoved(true) && target.CanBeChasedBy(Projectile, false)) + if (target.CanBeMoved() && target.CanBeChasedBy(Projectile, false)) { if (Vector2.Distance(target.Center, Projectile.Center) > 40 && Vector2.Distance(target.Center, Projectile.Center) < 600) { @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 30, true); + target.MoveNPC(launchVel, 30, true, Owner); target.AddBuff(ModContent.BuffType(), 90); } diff --git a/Projectiles/Rogue/SupernovaStealthBoom.cs b/Projectiles/Rogue/SupernovaStealthBoom.cs index 21f394d99a..291086f2d7 100644 --- a/Projectiles/Rogue/SupernovaStealthBoom.cs +++ b/Projectiles/Rogue/SupernovaStealthBoom.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target.CanBeMoved(true) && target.CanBeChasedBy(Projectile, false)) + if (target.CanBeMoved() && target.CanBeChasedBy(Projectile, false)) { if (target != null && !CalamityPlayer.areThereAnyDamnBosses) { @@ -284,7 +284,7 @@ namespace CalamityMod.Projectiles.Rogue } Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 60, true); + target.MoveNPC(launchVel, 60, true, Owner); } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) // Add to regular plz diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 40790b782c..f045cf6b42 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Rogue OnHitEffects(target); target.AddBuff(BuffID.Frostburn2, 120); if (Projectile.Calamity().stealthStrike) - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(BuffID.Frozen, 45); } diff --git a/Projectiles/Rogue/Valaricicle.png b/Projectiles/Rogue/Valaricicle.png index d2db05e4da..3e948e73dd 100644 Binary files a/Projectiles/Rogue/Valaricicle.png and b/Projectiles/Rogue/Valaricicle.png differ diff --git a/Projectiles/Rogue/Valaricicle2.png b/Projectiles/Rogue/Valaricicle2.png index e88b3b8d3f..3cfc5330f5 100644 Binary files a/Projectiles/Rogue/Valaricicle2.png and b/Projectiles/Rogue/Valaricicle2.png differ diff --git a/Projectiles/Rogue/WhitewaterAura.cs b/Projectiles/Rogue/WhitewaterAura.cs index 466840dfc2..a1a3c6b70c 100644 --- a/Projectiles/Rogue/WhitewaterAura.cs +++ b/Projectiles/Rogue/WhitewaterAura.cs @@ -65,11 +65,12 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + Player Owner = Main.player[Projectile.owner]; target.AddBuff(BuffID.Wet, 300); target.AddBuff(ModContent.BuffType(), 300); Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 9, true); + target.MoveNPC(launchVel, 9, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/WrathwingFireball.cs b/Projectiles/Rogue/WrathwingFireball.cs index b5996c3d83..b6b9471db2 100644 --- a/Projectiles/Rogue/WrathwingFireball.cs +++ b/Projectiles/Rogue/WrathwingFireball.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { Main.projFrames[Type] = 5; - ProjectileID.Sets.TrailCacheLength[Type] = 20; - ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -57,15 +55,6 @@ namespace CalamityMod.Projectiles.Rogue int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); - if (CalamityClientConfig.Instance.Afterimages) - { - for (int i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color2 = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), color2, Projectile.rotation, rectangle.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - } - } Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 1e27343593..8301c8146d 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Particles; @@ -6,6 +7,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -19,6 +21,9 @@ namespace CalamityMod.Projectiles.Rogue internal Color PrimColorMult = Color.White; public override string Texture => "CalamityMod/Items/Weapons/Rogue/WulfrumKnife"; + private bool beginStretchAnim = false; + private float progress = -1f; + public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 20; @@ -27,7 +32,6 @@ namespace CalamityMod.Projectiles.Rogue public static int Lifetime = 1440; public float LifetimeCompletion => MathHelper.Clamp((Lifetime - Projectile.timeLeft) / (float)Lifetime, 0f, 1f); - public float StealthEffectOpacity => MathHelper.Clamp(1 - LifetimeCompletion, 0f, 1f); public float StuckEnemyID { @@ -59,10 +63,23 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localNPCHitCooldown = 1; Projectile.stopsDealingDamageAfterPenetrateHits = true; } - + public override void OnSpawn(IEntitySource source) + { + for (int i = 0; i < Projectile.oldPos.Length; i++) + Projectile.oldPos[i] = Projectile.Center; + } public override void AI() { + if (Projectile.timeLeft >= 50) + Projectile.Opacity = MathHelper.Clamp(LifetimeCompletion * 90f, 0f, 1f); + else + Projectile.Opacity = Projectile.timeLeft / 50f; // Fade out over last 50 frames + + // Update squash and stretch animation + if (progress >= 0f && progress < 1f) + progress += 0.06f; + if (StuckEnemyID > 0) { Projectile.tileCollide = false; @@ -108,7 +125,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Projectile.Calamity().stealthStrike) { - if (Main.rand.NextBool(10)) + if (Main.rand.NextBool(12)) { Vector2 dustCenter = Projectile.Center + Projectile.velocity.RotatedBy(MathHelper.PiOver2).SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(-3f, 3f); @@ -122,13 +139,13 @@ namespace CalamityMod.Projectiles.Rogue else { - Lighting.AddLight(Projectile.Center, (Main.rand.NextBool() ? Color.GreenYellow : Color.DeepSkyBlue).ToVector3() * StealthEffectOpacity); + Lighting.AddLight(Projectile.Center, (Main.rand.NextBool() ? Color.GreenYellow : Color.DeepSkyBlue).ToVector3()); if (Main.rand.NextBool(7)) { Vector2 center = Projectile.Center + Projectile.velocity.RotatedBy(MathHelper.PiOver2).SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(-3f, 3f); Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.Pi / 6f) * Main.rand.NextFloat(4, 10); - GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(center, velocity, Main.rand.NextFloat(1f, 2f), Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247), 25, StealthEffectOpacity)); + GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(center, velocity, Main.rand.NextFloat(1f, 2f), Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247), 25, Projectile.Opacity)); } @@ -141,16 +158,24 @@ namespace CalamityMod.Projectiles.Rogue chust.noLightEmittence = true; } } + + if (Projectile.timeLeft < 120) + Projectile.Opacity -= 0.03f; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); - Projectile.timeLeft = Lifetime; + Projectile.timeLeft = Math.Max(Projectile.timeLeft, 300); StuckEnemyID = target.whoAmI+1; StuckEnemyDistance = Projectile.Distance(target.Center); StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + beginStretchAnim = true; + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); @@ -161,7 +186,7 @@ namespace CalamityMod.Projectiles.Rogue internal Color ColorFunction(float completionRatio, Vector2 vertexPos) { - float fadeOpacity = (float)Math.Pow(1 - completionRatio, 2) * StealthEffectOpacity; + float fadeOpacity = (float)MathHelper.Clamp(LifetimeCompletion * 30f, 0f, 1f); return Color.GreenYellow.MultiplyRGB(PrimColorMult) * fadeOpacity; } @@ -173,7 +198,41 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - float opacitey = StealthEffectOpacity; + + // Squash and Stretch Scale Logic + if (beginStretchAnim) + { + progress = 0f; + beginStretchAnim = false; + } + + float stretchFactorX = 1f; + float stretchFactorY = 1f; + + if (progress >= 0f) + { + if (progress < 0.5f) // Stretch phase + { + float completion = progress / 0.5f; + stretchFactorX = MathHelper.Lerp(1.6f, 0.7f, completion); + stretchFactorY = MathHelper.Lerp(0.7f, 1.6f, completion); + } + else // Squash phase + { + float completion = (progress - 0.5f) / 0.5f; + stretchFactorX = MathHelper.Lerp(0.7f, 1f, completion); + stretchFactorY = MathHelper.Lerp(1.6f, 1f, completion); + } + + if (progress >= 1f) + { + progress = -1f; + } + } + + Vector2 drawScale = new Vector2(stretchFactorX, stretchFactorY) * Projectile.scale; + Vector2 offset = Projectile.Size * 0.5f; + Vector2[] oldPosWithOffset = Projectile.oldPos.Select(p => p - offset).ToArray(); if (Projectile.Calamity().stealthStrike && StuckEnemyID == 0) { @@ -181,33 +240,26 @@ namespace CalamityMod.Projectiles.Rogue Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - + CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_,_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(oldPosWithOffset, new(WidthFunction, ColorFunction, (_,_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); - - CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 3f, delegate (Vector2 offset, Color colorMod) { - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + offset, null, Color.GreenYellow.MultiplyRGB(colorMod) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + offset, null, Color.GreenYellow.MultiplyRGB(colorMod) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); }); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - opacitey = MathHelper.Clamp(LifetimeCompletion * 8f, 0f, 1f); - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); } - else { - opacitey = MathHelper.Clamp(LifetimeCompletion * 15f, 0f, 1f); - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); } return false; } diff --git a/Projectiles/Summon/AquasScepterRaindrop.cs b/Projectiles/Summon/AquasScepterRaindrop.cs index 4df8cfb6ad..7f91e149a1 100644 --- a/Projectiles/Summon/AquasScepterRaindrop.cs +++ b/Projectiles/Summon/AquasScepterRaindrop.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -10,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon { // Sets the amount of frames this minion has on its spritesheet Main.projFrames[Type] = 1; + ProjectileID.Sets.SentryShot[Type] = true; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, just change the base damage of AquasScepter, the item. Note that this will affect the damage of AquasScepterTeslaAura as well, because the damage of said projectile is set as a multiple of the base damage at the bottom of AquasScepterCloud.cs diff --git a/Projectiles/Summon/AquasScepterTeslaAura.cs b/Projectiles/Summon/AquasScepterTeslaAura.cs index d82c9ac926..94ce5fc9a5 100644 --- a/Projectiles/Summon/AquasScepterTeslaAura.cs +++ b/Projectiles/Summon/AquasScepterTeslaAura.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -13,6 +14,7 @@ namespace CalamityMod.Projectiles.Summon { // Sets the amount of frames this minion has on its spritesheet Main.projFrames[Type] = 5; + ProjectileID.Sets.SentryShot[Type] = true; } public sealed override void SetDefaults() //If you want to change the damage of this projectile, look near the bottom of AquasScepterCloud.cs because this projectile's damage is set in Projectile.NewProjectile as a multiple of the AquasScepterCloud damage value diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index 59a7afc0be..5344a200dc 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Summon modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, (MinionBuffMode ? 5f : 0.5f), false); + target.MoveNPC(launchVel, (MinionBuffMode ? 5f : 0.5f), false, Owner); } public override bool MinionContactDamage() => !Reforming; } diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index ac5051de40..bfa59c1b17 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -130,6 +130,7 @@ namespace CalamityMod.Projectiles.Summon GeneralParticleHandler.SpawnParticle(spark); } } + justHit = false; } if (potentialTarget != null) diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 487ec89ec1..2e682efb19 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -355,7 +355,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 80b5efc46f..113c58e57b 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index ae049ace55..82e4fffb97 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index eb4dab939e..653b0cfecc 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 07093de895..837d00d743 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon if (!Main.dedServ) { // For the fucking love of any god you can think of, this sound sucks but I can't find another one that fits better. - SoundEngine.PlaySound(SoundID.Item28, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item28 with { Volume = 0.6f }, Projectile.Center); } TimerForShooting = 0f; diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index e1a38ea092..c7149d9a70 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon else Projectile.velocity = Projectile.SafeDirectionTo(destination) * Projectile.Distance(destination) / 36f; - int timeNeeded = (int)(MathHelper.Lerp(60f, 18f, MathHelper.Clamp(Projectile.localAI[1] / 320f, 0f, 1f)) * (player.strongBees ? 0.85f : 1f)); + int timeNeeded = (int)(MathHelper.Lerp(60f, 18f, MathHelper.Clamp(Projectile.localAI[1] / 320f, 0f, 1f)) * (player.strongBees ? 0.75f : 1f)); if (Projectile.ai[0] >= timeNeeded && Main.myPlayer == Projectile.owner) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index ffa626a95c..66667c4cdf 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] % 12 == 11) { int beeCount = Main.rand.Next(1, 3); - if (Owner.strongBees && Main.rand.NextBool(3)) + if (Owner.strongBees) ++beeCount; for (int i = 0; i < beeCount; i++) diff --git a/Projectiles/Summon/RustyBeaconPulse.cs b/Projectiles/Summon/RustyBeaconPulse.cs index daf22ad8c5..c8a403f834 100644 --- a/Projectiles/Summon/RustyBeaconPulse.cs +++ b/Projectiles/Summon/RustyBeaconPulse.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -13,6 +14,10 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public float LifetimeCompletion => 1f - Projectile.timeLeft / (float)RustyBeaconPrototype.PulseLifetime; + public override void SetStaticDefaults() + { + ProjectileID.Sets.SentryShot[Type] = true; + } public override void SetDefaults() { Projectile.width = 96; @@ -21,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Summon; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 30; Projectile.timeLeft = RustyBeaconPrototype.PulseLifetime; diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index 1de448a053..cb40b2194f 100644 --- a/Projectiles/Summon/SageNeedle.cs +++ b/Projectiles/Summon/SageNeedle.cs @@ -35,9 +35,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - int sagePoisonDamage = (int)(SagePoison.debuffData.EnemyLostRegen * Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()]); target.AddBuff(ModContent.BuffType(), 300); - target.Calamity().sagePoisonDamage = sagePoisonDamage; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index f78e7076b2..fc09709f37 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[1] += 1f; if ((Projectile.ai[1] % 10f) == 0f) { - int amount = Main.rand.Next(2, 4); + int amount = Main.rand.Next(1, 3); if (DownedBossSystem.downedProvidence && Main.zenithWorld) // spikecrag gfb buff { amount += 6; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 13b0cb3416..3c7ed0682c 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon if (spawnDust) { - Projectile.ai[1] = -1; + Projectile.ai[2] = -1; int dustAmt = 36; for (int d = 0; d < dustAmt; d++) { @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon { spawnDust = true; } - int npcIndex = (int)Projectile.ai[1]; + int npcIndex = (int)Projectile.ai[2]; if (Projectile.localAI[0] >= 600000f) //tryna make it stay on there "forever" without glitching { breakAway = true; @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Summon //let the projectile know it is sticking and the npc it is sticking too Projectile.ai[0] = 3f; - Projectile.ai[1] = npcIndex; + Projectile.ai[2] = npcIndex; //follow the NPC Projectile.velocity = (npc.Center - Projectile.Center) * 0.75f; @@ -203,12 +203,11 @@ namespace CalamityMod.Projectiles.Summon //Count how many projectiles are attached, delete as necessary Point[] array2 = new Point[10]; int projCount = 0; - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[projIndex]; - if (projIndex != Projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == Projectile.type && proj.ai[0] == 3f && proj.ai[1] == npcIndex) + if (p.whoAmI != Projectile.whoAmI && p.owner == Main.myPlayer && p.type == Projectile.type && p.ai[0] == 3f && p.ai[2] == npcIndex) { - array2[projCount++] = new Point(projIndex, proj.timeLeft); + array2[projCount++] = new Point(p.whoAmI, p.timeLeft); if (projCount >= array2.Length) { break; diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index 12833d3ce9..e2f58e969a 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -559,8 +559,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.Calamity().sagePoisonDamage = (int)(SagePoison.debuffData.EnemyLostRegen * SagePoison.ViridVanguardPoisonMultiplier * CurrentViridCount); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 300); if (ActiveAttacking) { Vector2 vel = new Vector2(0.1f, 0.1f).RotatedByRandom(100); diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs deleted file mode 100644 index 1d9f07ff49..0000000000 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.IO; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationAura : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public int timer = 0; - - public override void SetStaticDefaults() => Main.projPet[Type] = true; - - public override void SetDefaults() - { - Projectile.width = 46; - Projectile.height = 80; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 3f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.DamageType = DamageClass.Summon; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(timer); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - timer = reader.ReadInt32(); - } - - public override bool? CanCutTiles() - { - return true; - } - - public void HandleRightClick() - { - // 15NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Vector2 velocity = Main.MouseWorld - Main.player[Projectile.owner].Center; - velocity.Normalize(); - velocity *= 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.player[Projectile.owner].Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 5f), 0f, Projectile.owner); - - Projectile.Kill(); - } - - public override void AI() - { - Player owner = Main.player[Projectile.owner]; - CalamityPlayer mp = owner.Calamity(); - Projectile.Center = owner.Center; - mp.voidAuraDamage = true; - if (owner.dead) - mp.voidAuraDamage = false; - if (!mp.voidAuraDamage || !mp.voidConcentrationAura && Projectile.ai[0] == 1f) - { - mp.voidAura = false; - Projectile.Kill(); - } - if (owner.whoAmI == Main.myPlayer && owner.ownedProjectileCounts[Type] <= 25 && timer > 0 && timer % 4 == 0) - { - NPC target = CalamityUtils.MinionHoming(Projectile.Center, 1800f, owner); - if (target != null) - { - Vector2 correctedVelocity = target.Center - owner.Center; - correctedVelocity.Normalize(); - correctedVelocity *= 3f; - int perturbificator9000 = Main.rand.Next(-1, 2); - Vector2 perturbedspeed = new Vector2(correctedVelocity.X + perturbificator9000, correctedVelocity.Y + perturbificator9000).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 3))); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedspeed, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), 0f, owner.whoAmI); - } - timer = -1; - } - Projectile.ai[0] = 1f; - if (timer > 50 && timer % 4 == 0) - return; - timer++; - } - - public override bool MinionContactDamage() => true; - } -} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs deleted file mode 100644 index efed72d73c..0000000000 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.IO; -using CalamityMod.NPCs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationBlackhole : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - private int damage = 0; - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(damage); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - damage = reader.ReadInt32(); - } - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.MinionShot[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 80; //32 base, 2.5x the normal (for hitbox purposes) - Projectile.height = 85; //34 base, 2.5x the normal (for hitbox purposes) - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 1800; - Projectile.penetrate = -1; - - Projectile.tileCollide = false; - Projectile.scale = 0.01f; - Projectile.DamageType = DamageClass.Summon; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; - } - - private void ApplySucc(NPC npc) - { - float succStrength = 4f / Projectile.scale; - succStrength *= Projectile.scale; - Vector2 velocity = Projectile.Center - npc.Center; - velocity *= 2f; - velocity.SafeNormalize(Vector2.Zero); - float projSpeed = 5f * Projectile.scale; - Vector2 fireDirection = npc.Center; - float fireXVel = Projectile.Center.X - fireDirection.X; - float fireYVel = Projectile.Center.Y - fireDirection.Y; - float fireVelocity = (float)Math.Sqrt((double)(fireXVel * fireXVel + fireYVel * fireYVel)); - if (fireVelocity < 100f) - { - projSpeed = 28f; //14 - } - fireVelocity = projSpeed / fireVelocity; - fireXVel *= fireVelocity; - fireYVel *= fireVelocity; - npc.velocity.X = (velocity.X * 15f + fireXVel) / 16f; - npc.velocity.Y = (velocity.Y * 15f + fireYVel) / 16f; - npc.velocity = (velocity / succStrength); - } - - private void Death() - { - if (Projectile.scale >= 2.5f) //it's boom o' clock - { - Projectile.height *= 2; - Projectile.width *= 2; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage = damage; - Projectile.Damage(); - Projectile.friendly = false; - Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - Projectile.Kill(); - } - } - - public override void OnKill(int timeLeft) - { - for (int d = 0; d < 6; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 4f); - Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[shadow].scale = 0.5f; - Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 18; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 4f); - Main.dust[shadow].noGravity = true; - Main.dust[shadow].velocity *= 5f; - shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 3f); - Main.dust[shadow].velocity *= 2f; - } - } - - public override bool PreAI() - { - if (damage == 0) - { - damage = Projectile.damage; - Projectile.damage = 0; - Projectile.position = Main.player[Projectile.owner].position; - } - return true; - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int height = texture.Height / Main.projFrames[Type]; - int frameHeight = height * Projectile.frame; - Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); - Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); - Main.EntitySpriteDraw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void AI() - { - - Projectile.scale += 0.01f; - if (Projectile.scale % 0.02f == 0) - { - Projectile.scale += 0.01f; //speeds up the projectile's growth to prevent it being too long - } - int radius = (int)(Projectile.scale * 100f); //0.01f; to a max of 2.5f; so radius of 1 to 250 by default - if (Projectile.scale >= 2f) - radius *= 2; - - int baseWidth = 32; - int baseHeight = 34; - int newWidth = (int)(baseWidth * Projectile.scale); - int newHeight = (int)(baseHeight * Projectile.scale); - Projectile.ExpandHitboxBy(newWidth, newHeight); - - - - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type] - 1) - { - Projectile.frame = 0; - } - Projectile.frameCounter++; - - foreach (NPC n in Main.ActiveNPCs) - { - if (!n.friendly && CalamityGlobalNPC.ShouldAffectNPC(n)) - { - if (Vector2.Distance(Projectile.Center, n.Center) <= radius) - ApplySucc(n); - } - } - - - if (Projectile.scale >= 2.5f) //it's boom o' clock - { - Death(); - } - } - } -} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.png b/Projectiles/Summon/VoidConcentrationBlackhole.png deleted file mode 100644 index ab6fe62770..0000000000 Binary files a/Projectiles/Summon/VoidConcentrationBlackhole.png and /dev/null differ diff --git a/Projectiles/Summon/VoidConcentrationOrb.png b/Projectiles/Summon/VoidConcentrationMark.png similarity index 100% rename from Projectiles/Summon/VoidConcentrationOrb.png rename to Projectiles/Summon/VoidConcentrationMark.png diff --git a/Projectiles/Summon/VoidConcentrationOrb.cs b/Projectiles/Summon/VoidConcentrationOrb.cs deleted file mode 100644 index 7de9d93ea7..0000000000 --- a/Projectiles/Summon/VoidConcentrationOrb.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.MinionShot[Type] = true; - ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 54; - Projectile.height = 50; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 300; - Projectile.penetrate = 1; - - Projectile.tileCollide = false; - Projectile.scale = 0.01f; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool? CanHitNPC(NPC target) - { - if (Projectile.scale < 1f) - return false; - return null; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - for (int d = 0; d < 6; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 2f); - Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[shadow].scale = 0.5f; - Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 10; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 3f); - Main.dust[shadow].noGravity = true; - Main.dust[shadow].velocity *= 5f; - shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 2f); - Main.dust[shadow].velocity *= 2f; - } - } - - public override void AI() - { - Player owner = Main.player[Projectile.owner]; - NPC target = CalamityUtils.MinionHoming(Projectile.Center, 1800f, owner); - - if (Projectile.scale >= 1f) - { - if (target != null) - { - float projSpeed = 40f; - Vector2 fireDirection = Projectile.Center; - float fireXVel = target.Center.X - fireDirection.X; - float fireYVel = target.Center.Y - fireDirection.Y; - float fireVelocity = (float)Math.Sqrt((double)(fireXVel * fireXVel + fireYVel * fireYVel)); - if (fireVelocity < 100f) - { - projSpeed = 28f; //14 - } - fireVelocity = projSpeed / fireVelocity; - fireXVel *= fireVelocity; - fireYVel *= fireVelocity; - Projectile.velocity.X = (Projectile.velocity.X * 25f + fireXVel) / 26f; - Projectile.velocity.Y = (Projectile.velocity.Y * 25f + fireYVel) / 26f; - if (Main.rand.NextBool(5)) - Projectile.velocity *= 1.1f; - } - - } - else - { - Projectile.scale += 0.025f; - Projectile.velocity *= 1.03f; - } - - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type] - 1) - { - Projectile.frame = 0; - } - Projectile.frameCounter++; - - if (Projectile.timeLeft <= 60) - { - Projectile.alpha += 4; - } - } - } -} diff --git a/Projectiles/Turret/IceExplosion.cs b/Projectiles/Turret/IceExplosion.cs index ea15cffab2..edaa97a1d8 100644 --- a/Projectiles/Turret/IceExplosion.cs +++ b/Projectiles/Turret/IceExplosion.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn2, 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Turret/IceShot.cs b/Projectiles/Turret/IceShot.cs index 8f970f9d8e..3f8f9ced72 100644 --- a/Projectiles/Turret/IceShot.cs +++ b/Projectiles/Turret/IceShot.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn2, 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Typeless/AbaddonCrit.cs b/Projectiles/Typeless/AbaddonCrit.cs deleted file mode 100644 index d77d440a3c..0000000000 --- a/Projectiles/Typeless/AbaddonCrit.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class AbaddonCrit : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public Player Owner => Main.player[Projectile.owner]; - private static float ExplosionRadius = 300f; - - public override void SetDefaults() - { - //These shouldn't matter because its circular - Projectile.width = 300; - Projectile.height = 300; - Projectile.friendly = true; - Projectile.DamageType = AverageDamageClass.Instance; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 2; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - public override void AI() - { - Player player = Main.player[Projectile.owner]; - for (int i = 0; i <= 30; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 218 : ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(MathHelper.ToRadians(360)) * Main.rand.NextFloat(1.1f, 2.2f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cFace, player); - dust.noGravity = true; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 360); - SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.5f, PitchVariance = 0.4f }, Projectile.Center); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); - public override bool? CanDamage() => base.CanDamage(); - public override bool? CanCutTiles() => false; - } -} diff --git a/Projectiles/Typeless/BasicBurst.cs b/Projectiles/Typeless/BasicBurst.cs index df59243a41..0633d2b71e 100644 --- a/Projectiles/Typeless/BasicBurst.cs +++ b/Projectiles/Typeless/BasicBurst.cs @@ -64,15 +64,21 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff((int)(Projectile.localAI[2]), (int)(Projectile.localAI[1])); } - pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center) * customKnockback; + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); float minMult = Projectile.ai[1]; int hitsToMinMult = (int)Projectile.ai[2]; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; - if (customKnockback != 0 && target.CanBeMoved(hasStongDisplacement)) + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); + + if (Projectile.owner != -1) { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); + Player Owner = Main.player[Projectile.owner]; + bool crit = Main.rand.Next(0, 100 + 1) < Owner.GetTotalCritChance(Projectile.DamageType); + if (crit) + modifiers.SetCrit(); } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Typeless/BasicBurstExclusive.cs b/Projectiles/Typeless/BasicBurstExclusive.cs index b5297f95f8..3a75ed111f 100644 --- a/Projectiles/Typeless/BasicBurstExclusive.cs +++ b/Projectiles/Typeless/BasicBurstExclusive.cs @@ -62,16 +62,14 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff((int)(Projectile.localAI[1]), (int)(Projectile.localAI[2])); } - pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center) * customKnockback; + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); float minMult = Projectile.ai[1]; int hitsToMinMult = (int)Projectile.ai[2]; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; - if (customKnockback != 0 && target.CanBeMoved(hasStongDisplacement)) - { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); - } + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); } public override bool? CanHitNPC(NPC target) { diff --git a/Projectiles/Typeless/BatholithBangleProjectile.cs b/Projectiles/Typeless/BatholithBangleProjectile.cs index efd000c2c1..9b62683820 100644 --- a/Projectiles/Typeless/BatholithBangleProjectile.cs +++ b/Projectiles/Typeless/BatholithBangleProjectile.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -117,13 +118,11 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; + modifiers.ApplyScalingForcedCrit(Projectile); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) - Vector2.UnitY; float launchPower = 9; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f, targetHitbox); public override bool? CanDamage() diff --git a/Projectiles/Typeless/BlackGlassBandProjectile.cs b/Projectiles/Typeless/BlackGlassBandProjectile.cs index b48eb8ccb2..688c5d7524 100644 --- a/Projectiles/Typeless/BlackGlassBandProjectile.cs +++ b/Projectiles/Typeless/BlackGlassBandProjectile.cs @@ -2,6 +2,7 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Accessories; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -61,11 +62,7 @@ namespace CalamityMod.Projectiles.Typeless time++; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); - modifiers.SourceDamage *= (1 + critDamage); - } + => modifiers.ApplyScalingForcedCrit(Projectile); public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD); diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index c07289dd98..b3ee8b3aac 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Typeless if (!player.Calamity().CryoStoneVanity) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } } // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride diff --git a/Projectiles/Typeless/DarkIce.cs b/Projectiles/Typeless/DarkIce.cs index b601c92938..aae5d31743 100644 --- a/Projectiles/Typeless/DarkIce.cs +++ b/Projectiles/Typeless/DarkIce.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Typeless/DebuffSpreadEffect.cs b/Projectiles/Typeless/DebuffSpreadEffect.cs new file mode 100644 index 0000000000..8ab5c80f30 --- /dev/null +++ b/Projectiles/Typeless/DebuffSpreadEffect.cs @@ -0,0 +1,259 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class DebuffSpreadEffect : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + public List listNPCs = new List(); + public NPC lastNPC; + public int minCooldown = 48; + public static Color startingColor = Bane.baneColor2; + public Color mainColor = Color.White; + public Color subColor = startingColor; + public Color extraColor = Color.White; + public ref float spreadCount => ref Projectile.ai[2]; + public ref float time => ref Projectile.ai[0]; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 1; + Projectile.ignoreWater = true; + Projectile.timeLeft = 9000; + Projectile.tileCollide = false; + Projectile.friendly = true; + Projectile.penetrate = -1; + } + + public override void AI() + { + NPC npc = (lastNPC == null ? Main.npc[(int)Projectile.ai[1]] : lastNPC); + + if (npc != null && spreadCount != 0) + { + if (time % 9 == 0) + { + listNPCs.Add(npc.whoAmI); + Projectile.Center = npc.Center; + mainColor = Color.White; + + bool strong = npc.Calamity().apollyonEffected; + float areaOfEffect = (strong ? 1400 : 800); + int debuffTime = (strong ? 180 : 120); + int startDir = Main.rand.NextBool() ? 1 : -1; + + // Initial infliction lasts longer, hopefully reduces the power imbalance between this accessory with fast weapons vs slow weapons + npc.AddBuff(ModContent.BuffType(), debuffTime * 2); + + float distanceFromCenter = areaOfEffect; + NPC targeted = null; + // Get closest valid target + for (int index = 0; index < Main.npc.Length; index++) + { + NPC closestTarget = Main.npc[index]; + if (closestTarget.CanBeChasedBy(null, false) && closestTarget != npc && !listNPCs.Contains(closestTarget.whoAmI) && closestTarget.life > 0) + { + float extraDistance = (closestTarget.width / 2) + (closestTarget.height / 2); + if (Vector2.Distance(Projectile.Center, closestTarget.Center) < distanceFromCenter) + { + distanceFromCenter = Vector2.Distance(Projectile.Center, closestTarget.Center); + targeted = closestTarget; + } + } + } + + if (targeted != null) + { + targeted.Calamity().apollyonEffected = npc.Calamity().apollyonEffected; + targeted.Calamity().abaddonEffected = npc.Calamity().abaddonEffected; + + float bestDamage = Owner.Calamity().playerBaneDebuffDamage; + int heat = 0; + Color heatClr = Color.OrangeRed; + int sick = 0; + Color sickClr = Color.Lime; + int cold = 0; + Color coldClr = Color.RoyalBlue; + int shock = 0; + Color shockClr = Color.Gold; + int water = 0; + Color waterClr = Color.DarkTurquoise; + // Find all the debuffs on the enemy + int debuffNum = 0; + + for (int index = 0; index < npc.buffType.Length; index++) + { + int type = npc.buffType[index]; + var debuffData = BuffDatasets.DebuffDataset[type]; + + // Calculate the Bane damage to see if the debuffs can be transfered + int bDamage = Math.Max((int)(Bane.debuffData.EnemyLostRegen * bestDamage), (int)Bane.debuffData.EnemyLostRegen); + + if (CalamityBuffSets.IsDebuff[type]) + { + if (debuffData == null || debuffData.EnemyLostRegen <= bDamage) + { + debuffNum++; + float timeMult = (debuffData == null || (debuffData != null && debuffData == Bane.debuffData)) ? 1 : Utils.Remap(debuffData.EnemyLostRegen, 0, bDamage, 5, 1); + targeted.AddBuff(type, (int)(debuffTime * timeMult)); + } + if (debuffData != null) + { + if (debuffData.HeatDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, heatClr, 0.65f); heat++; } + if (debuffData.SicknessDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, sickClr, 0.65f); sick++; } + if (debuffData.ColdDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, coldClr, 0.65f); cold++; } + if (debuffData.ElectricDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, shockClr, 0.65f); shock++; } + if (debuffData.WaterDebuffScaling > 0) { mainColor = Color.Lerp(mainColor, waterClr, 0.65f); water++; } + if (new List { heat, sick, cold, shock, water }.Max() == 0) + { + mainColor = Bane.baneColor1; + } + } + } + // Edge case fixes for Shred and Demonic Flames + // Not ideal but not sure how else to do it + if (npc.Calamity().somaShredStacks > 0 && Shred.BaseDamage <= bDamage) + targeted.AddBuff(ModContent.BuffType(), debuffTime); + int demonicFlames = ModContent.GetModBuff(ModContent.BuffType()).Type; + if (npc.HasBuff(demonicFlames)) + targeted.Calamity().demonicFlamesBonusDamage = npc.Calamity().demonicFlamesBonusDamage; + } + if (debuffNum == 0) + { + KillSelf(); + return; + } + + List best = new List { heat, sick, cold, shock, water }; + int highest = best.Max(); + if (highest != 0) + { + // Ideally these lines would run in a random order, so that fire isn't prioritsed as an extra color, but I don't know how to do that! + if (heat == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = heatClr; } else { subColor = heatClr; } } + if (sick == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = sickClr; } else { subColor = sickClr; } } + if (cold == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = coldClr; } else { subColor = coldClr; } } + if (shock == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = shockClr; } else { subColor = shockClr; } } + if (water == highest && extraColor == Color.White) { if (subColor != startingColor) { extraColor = waterClr; } else { subColor = waterClr; } } + } + + VisualEffects(npc, targeted, startDir, 1 + (best.Sum() * 0.12f)); + + Projectile.ForceNetUpdate(); + targeted.ForceNetUpdate(); + lastNPC = targeted; + } + else + { + KillSelf(); + return; + } + + if (Owner.Calamity().abaddonCooldown <= 0) + Owner.Calamity().abaddonCooldown = minCooldown * 2; + spreadCount--; + } + } + else + { + KillSelf(); + return; + } + time++; + } + public void KillSelf() + { + if (Owner.Calamity().abaddonCooldown > minCooldown) + Owner.Calamity().abaddonCooldown = minCooldown; + if (Owner.Calamity().abaddonCooldown < 0) + Owner.Calamity().abaddonCooldown = 0; + Projectile.Kill(); + } + public void VisualEffects(NPC npc, NPC targeted, int startDirection, float effectPower) + { + Vector2 start = npc.Center; + Vector2 end = targeted.Center; + if (Owner.Calamity().abaddonEffectVisual) + { + // Spawn a single particle line between the first target and the new target + Vector2 lerpVel = Vector2.Lerp(start, end, 0.5f); + float scale = 0.015f; + Particle spark = new CustomSpark(lerpVel, npc.SafeDirectionTo(targeted.Center), "CalamityMod/Particles/BloomLineSoftEdge", false, 18, scale, mainColor, new Vector2(1.2f * effectPower, (Utils.Distance(start, end) * 0.038f)), true, true, shrinkSpeed: 0.25f, glowOpacity: 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int g = 0; g < 7; g++) + { + int DustID = ModContent.DustType(); + Dust dust2 = Dust.NewDustDirect(targeted.Center, targeted.width, targeted.height, DustID); + dust2.scale = Main.rand.NextFloat(0.6f, 0.75f); + dust2.velocity = new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 0.8f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? subColor : (extraColor != Color.White ? extraColor : mainColor); + } + + float distance = Vector2.Distance(targeted.Center, npc.Center); + + // This might look like a lot of dust for a thing that can happen to at few enemies in succession, but it + // does get reduced significantly based on distance and lasts only a few frames. + int averageDusts = (int)(65 * (float)Math.Pow(effectPower, 0.3f)); + int maxDusts = (int)((float)Math.Pow(Math.Max(distance, 1) / 1000, 0.65f) * averageDusts); + + Vector2 dustLineStart = start; + Vector2 dustLineEnd = end; + Vector2 currentDustPos = default; + Vector2 dustVel = start.DirectionTo(end); + int startingPoint = Main.rand.Next(0, 400 + 1); + Vector2 lastDustPos = default; + for (int i = 0; i < maxDusts; i++) + { + float sineSpeed = Utils.Remap(startingPoint, 0, 400, 1.6f, 0.7f); + float sine = (float)Math.Sin((i + startingPoint) * sineSpeed / MathHelper.Pi) * startDirection; + float endStartFade = Math.Min(Utils.GetLerpValue(maxDusts * 0.9f, maxDusts * 0.1f, i, true), Utils.GetLerpValue(maxDusts * 0.1f, maxDusts * 0.9f, i, true)); + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 6 * sine * endStartFade; + if (i == 0) + lastDustPos = currentDustPos; + + bool wildDust = Main.rand.NextBool(5); + currentDustPos = Vector2.Lerp(dustLineStart, dustLineEnd, i / (float)maxDusts) + dustVel.RotatedBy(MathHelper.PiOver2) * 55 * sine * endStartFade * effectPower; + Dust dustLinger = Dust.NewDustPerfect(currentDustPos, ModContent.DustType()); + dustLinger.position = currentDustPos; + dustLinger.velocity = currentDustPos.DirectionTo(lastDustPos) * (wildDust ? 6.5f : Main.rand.NextFloat(0.2f, 0.8f)); + dustLinger.noGravity = true; + dustLinger.scale = Main.rand.NextFloat(0.8f, 1f) * (wildDust ? 1.7f : 1.5f) * effectPower; + dustLinger.fadeIn = Main.rand.NextFloat(0.6f, 1f) * 4 * effectPower * (wildDust ? 0.35f : 1); + dustLinger.color = Color.Lerp((extraColor != Color.White ? extraColor : mainColor), subColor, Utils.GetLerpValue(0, maxDusts, i)); + if (wildDust) + dustLinger.color = !Main.rand.NextBool(4) ? subColor : (extraColor != Color.White ? extraColor : mainColor); + if (!wildDust) + { + dustLinger.noLightEmittence = true; + dustLinger.customData = new Vector2(0.8f, 3); + } + else + dustLinger.customData = new Vector2(0.6f, 1.5f); + + lastDustPos = currentDustPos; + } + } + for (int u = 0; u < 2; u++) + { + Vector2 pos = start; + if (u == 0) pos = end; + Particle spark3 = new CustomSpark(pos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 18, u != 0 ? 0.7f : 0.55f, (u == 0 ? subColor : mainColor) * (Owner.Calamity().abaddonEffectVisual ? 1 : 0.3f), Vector2.One, true, true, glowOpacity: 0.85f); + GeneralParticleHandler.SpawnParticle(spark3); + } + } + public override bool? CanDamage() => false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => false; + } +} diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs deleted file mode 100644 index 28a575a76d..0000000000 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class DemonshadeRedDevil : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public int dust = 3; - - public ref float State => ref Projectile.ai[0]; // 0 = attacking, 1 = returning, 2 = initial spawn - public ref float Timer => ref Projectile.ai[1]; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 5; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 48; - Projectile.height = 48; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - } - - public override void AI() - { - bool isMinion = Projectile.type == ModContent.ProjectileType(); - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.redDevil) - { - Projectile.active = false; - return; - } - if (isMinion) - { - if (player.dead) - { - modPlayer.rDevil = false; - } - if (modPlayer.rDevil) - { - Projectile.timeLeft = 2; - } - } - - dust--; - if (dust >= 0) - { - for (int i = 0; i < 50; i++) - { - int brimDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); - Main.dust[brimDust].velocity *= 2f; - Main.dust[brimDust].scale *= 1.15f; - } - } - - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frameCounter = 0; - Projectile.frame++; - if (Projectile.frame > 4) - Projectile.frame = 0; - } - - float lights = (float)Main.rand.Next(90, 111) * 0.01f; - lights *= Main.essScale; - Lighting.AddLight(Projectile.Center, 1f * lights, 0f * lights, 0.15f * lights); - - Projectile.rotation = Projectile.velocity.X * 0.04f; - if ((double)Math.Abs(Projectile.velocity.X) > 0.2) - { - Projectile.spriteDirection = -Projectile.direction; - } - - if (State == 2f) - { - Timer++; - if (Timer > 60f) - { - Timer = 1f; - State = 0f; - Projectile.netUpdate = true; - } - return; - } - - Vector2 attackPos = Projectile.position; - float attackRange = 2000f; - bool canAttack = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!canAttack && npcDist < attackRange) - { - attackRange = npcDist; - attackPos = npc.Center; - canAttack = true; - } - } - } - else - { - foreach (NPC nPC2 in Main.ActiveNPCs) - { - if (nPC2.CanBeChasedBy(Projectile, false)) - { - float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center); - if ((!canAttack && npcDist < attackRange) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - attackRange = npcDist; - attackPos = nPC2.Center; - canAttack = true; - } - } - } - } - - float separationAnxietyDist = canAttack ? 3000f: 2000f; - if (Vector2.Distance(player.Center, Projectile.Center) > separationAnxietyDist) - { - State = 1f; - Projectile.netUpdate = true; - } - if (canAttack && State == 0f) - { - Vector2 projDirection = attackPos - Projectile.Center; - float projDist = projDirection.Length(); - projDirection.Normalize(); - if (projDist > 200f) - { - projDirection *= 25f; - Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f; - } - else - { - projDirection *= -9f; - Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f; - } - } - else - { - bool isReturning = State == 1f; - float returnSpeed = isReturning ? 24f : 15f; - - Vector2 playerDirection = player.Center - Projectile.Center + new Vector2(0f, -30f); - float playerDist = playerDirection.Length(); - if (playerDist > 200f && returnSpeed < 10f) - { - returnSpeed = 18f; - } - if (playerDist < 150f && isReturning && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) - { - State = 0f; - Projectile.netUpdate = true; - } - if (playerDist > 2000f) - { - Projectile.Center = player.Center; - Projectile.netUpdate = true; - } - if (playerDist > 70f) - { - playerDirection.Normalize(); - playerDirection *= returnSpeed; - Projectile.velocity = (Projectile.velocity * 40f + playerDirection) / 41f; - } - else if (Projectile.velocity == Vector2.Zero) - { - Projectile.velocity = new Vector2(-0.2f, -0.1f); - } - } - if (Timer > 0f) - { - Timer += Main.rand.Next(1, 2 + 1); - } - if (Timer > 80f) - { - Timer = 0f; - Projectile.netUpdate = true; - } - if (State == 0f) - { - if (canAttack && Timer == 0f) - { - Timer += 1f; - if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, attackPos, 0, 0)) - { - Vector2 velocity = Vector2.Normalize(attackPos - Projectile.Center) * 24f; - int trident = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ProjectileID.UnholyTridentFriendly, Projectile.damage, 0f, Main.myPlayer); - if (trident.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[trident].timeLeft = 300; - Main.projectile[trident].usesLocalNPCImmunity = true; - Main.projectile[trident].localNPCHitCooldown = 10; - Main.projectile[trident].DamageType = DamageClass.Generic; //typeless - } - Projectile.netUpdate = true; - } - } - } - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/DemonshadeRedDevil.png b/Projectiles/Typeless/DemonshadeRedDevil.png deleted file mode 100644 index ab63c1a2c0..0000000000 Binary files a/Projectiles/Typeless/DemonshadeRedDevil.png and /dev/null differ diff --git a/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs index c8339673f9..8fa99e61c3 100644 --- a/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs +++ b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs @@ -446,7 +446,7 @@ namespace CalamityMod.Projectiles.Typeless // HADAL and VOID have knockback, GRAVEL has it's knockback on the explosion Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = 7f; - target.MoveNPC(launchVel, launchPower, false); + target.MoveNPC(launchVel, launchPower, false, Owner); if (visuals) { diff --git a/Projectiles/Typeless/DirectStrike.cs b/Projectiles/Typeless/DirectStrike.cs index b29d83d206..9436c4835d 100644 --- a/Projectiles/Typeless/DirectStrike.cs +++ b/Projectiles/Typeless/DirectStrike.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Typeless if (projHitbox.Intersects(targetHitbox)) { NPC target = Main.npc[(int)Projectile.ai[0]]; - if (pushVelocity != Vector2.Zero && pushVelocity.X < 255f && !invalidTarget && target.CanBeMoved(hasStongDisplacement)) + if (pushVelocity != Vector2.Zero && pushVelocity.X < 255f && !invalidTarget) { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); + target.MoveNPC(pushVelocity, pushVelocity.Length(), hasStongDisplacement, Main.player[Projectile.owner]); } return true; } diff --git a/Projectiles/Typeless/FriendlyLaserWallBeam.cs b/Projectiles/Typeless/FriendlyLaserWallBeam.cs index 95f8ae5d59..0227ecb343 100644 --- a/Projectiles/Typeless/FriendlyLaserWallBeam.cs +++ b/Projectiles/Typeless/FriendlyLaserWallBeam.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -130,6 +131,12 @@ namespace CalamityMod.Projectiles.Typeless return hitCheck; } } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.CountsAsClass(DamageClass.Ranged)) //Thread of Eradication + modifiers.ApplyScalingForcedCrit(Projectile); + } public override bool PreDraw(ref Color lightColor) { if (laserFX == 0) diff --git a/Projectiles/Typeless/FungalClumpMinion.cs b/Projectiles/Typeless/FungalClumpMinion.cs index 782a84cecd..a407317fbc 100644 --- a/Projectiles/Typeless/FungalClumpMinion.cs +++ b/Projectiles/Typeless/FungalClumpMinion.cs @@ -230,7 +230,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 2f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 3f); public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs deleted file mode 100644 index 1fda4b4a77..0000000000 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ /dev/null @@ -1,54 +0,0 @@ -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class HydrothermalSmoke : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 42; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 6; - } - - public override void AI() - { - - if (Projectile.timeLeft == 6) - Projectile.Center = Main.player[Projectile.owner].Center; - - if (Main.rand.NextBool(6)) - { - int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100, default, 0.7f); - if (Main.rand.NextBool(4)) - { - Main.dust[fieryDust].scale *= 0.35f; - } - Main.dust[fieryDust].velocity *= 0f; - } - - - if (Main.rand.NextBool(9) && !Main.dedServ) - { - float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); - MediumMistParticle mist = new MediumMistParticle(Projectile.position, -Projectile.velocity + new Vector2(0.5f, upwardVariation), // This velocity makes it slowly float upward - Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.SteelBlue, Color.LightSlateGray, Main.rand.NextFloat(0.4f, 0.65f), 130); - GeneralParticleHandler.SpawnParticle(mist); - } - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/LeviAmberDash.cs b/Projectiles/Typeless/LeviAmberDash.cs index a77ac9724f..40337949c0 100644 --- a/Projectiles/Typeless/LeviAmberDash.cs +++ b/Projectiles/Typeless/LeviAmberDash.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Typeless target.AddBuff(ModContent.BuffType(), 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); for (int i = 0; i <= 17; i++) { diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 2febbae82d..1cc60e6c2e 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -171,10 +172,10 @@ namespace CalamityMod.Projectiles.Typeless public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Owner.Calamity().omegaBlueAbyssalMadness) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.5f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.33f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Typeless/PauldronExplosion.cs b/Projectiles/Typeless/PauldronExplosion.cs index eddb8cb142..0dd79cde37 100644 --- a/Projectiles/Typeless/PauldronExplosion.cs +++ b/Projectiles/Typeless/PauldronExplosion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 15, true); + target.MoveNPC(launchVel, 15, true, Owner); } public override bool? CanCutTiles() => false; diff --git a/Projectiles/Typeless/ProtolithBangleProjectile.cs b/Projectiles/Typeless/ProtolithBangleProjectile.cs index f50a544547..eda80a8c8c 100644 --- a/Projectiles/Typeless/ProtolithBangleProjectile.cs +++ b/Projectiles/Typeless/ProtolithBangleProjectile.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using ReLogic.Utilities; using Terraria; @@ -101,17 +102,16 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); + modifiers.ApplyScalingForcedCrit(Projectile); float minMult = 0.1f; int hitsToMinMult = 5; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = 6; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); public override bool? CanDamage() diff --git a/Projectiles/Typeless/PuddleSplash.cs b/Projectiles/Typeless/PuddleSplash.cs index 0d8dff4a2c..56e251accc 100644 --- a/Projectiles/Typeless/PuddleSplash.cs +++ b/Projectiles/Typeless/PuddleSplash.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff(BuffID.Wet, 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) + Vector2.UnitY * -0.75f; - target.MoveNPC(launchVel, 12, false); + target.MoveNPC(launchVel, 12, false, Owner); } public override bool? CanCutTiles() => false; } diff --git a/Projectiles/Typeless/SandBall.cs b/Projectiles/Typeless/SandBall.cs index 218b99706d..1e56f608aa 100644 --- a/Projectiles/Typeless/SandBall.cs +++ b/Projectiles/Typeless/SandBall.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Typeless if (Projectile.ai[2] != 1) { for (var i = 0; i < 4; i++) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f,0.75f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner, ai2: 1); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f,0.75f), ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack, Projectile.owner, ai2: 1); } } @@ -242,7 +242,7 @@ namespace CalamityMod.Projectiles.Typeless public class VolcanicSandBallGun : SandBall { public override string Texture => "CalamityMod/Projectiles/Typeless/SandBallVolcanic"; - public override int TileType => ModContent.TileType(); + public override int TileType => ModContent.TileType(); public override int ItemType => ModContent.ItemType(); public override int DustType => -1; diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index 83fe0d5eb8..9b788095e1 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Typeless { public new string LocalizationCategory => "Projectiles.Typeless"; private const float Radius = 360f; - private const int Duration = 900; public override void SetDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.timeLeft = Duration; + Projectile.timeLeft = SandCloak.SandVeilDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.scale = 1.5f; @@ -52,7 +51,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.Center += Vector2.Normalize(Owner.Center - Projectile.Center) * (ownerDist > Radius * 0.5f ? 2.5f : 1.25f); // Kill the sand veil early if the owner dashes - if (Owner.dashDelay == -1 && Projectile.timeLeft < Duration - 45) + if (Owner.dashDelay == -1 && Projectile.timeLeft < SandCloak.SandVeilDuration - 45) { if (Projectile.timeLeft > 25) Projectile.timeLeft = 25; @@ -74,7 +73,7 @@ namespace CalamityMod.Projectiles.Typeless } // Add Sand Cloak cooldown after the sand veil dies - public override void OnKill(int timeLeft) => Main.player[Projectile.owner].AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(15)); + public override void OnKill(int timeLeft) => Main.player[Projectile.owner].AddCooldown(Cooldowns.SandCloak.ID, SandCloak.SandVeilCooldown); public override bool PreDraw(ref Color lightColor) { @@ -85,8 +84,8 @@ namespace CalamityMod.Projectiles.Typeless Color drawCol = Projectile.GetAlpha(Color.Lerp(lightColor, Color.White, 0.5f)); float drawTransparency = 0.1f; - if (Projectile.timeLeft > Duration - 10) - drawTransparency = (Duration - Projectile.timeLeft) * 0.01f; + if (Projectile.timeLeft > SandCloak.SandVeilDuration - 10) + drawTransparency = (SandCloak.SandVeilDuration - Projectile.timeLeft) * 0.01f; else if (Projectile.timeLeft < 25) drawTransparency = Projectile.timeLeft * 0.004f; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 58f6823a88..85f26a424f 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -50,6 +51,10 @@ namespace CalamityMod.Projectiles.Typeless return false; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + } public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14, Projectile.position); diff --git a/Projectiles/Typeless/SpringStoolFX.cs b/Projectiles/Typeless/SpringStoolFX.cs new file mode 100644 index 0000000000..43b814b8a1 --- /dev/null +++ b/Projectiles/Typeless/SpringStoolFX.cs @@ -0,0 +1,140 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using rail; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class SpringStoolFX : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + + float rotationFactor = 0.015f; + public static float EaseOutElastic(float x, float amplitude = 1f, float period = 0.3f) + { + if (x == 0f) return 0f; + if (x == 1f) return 1f; + + amplitude = Math.Max(1f, amplitude); + + float s = (float)(period / (2 * Math.PI) * Math.Asin(1f / amplitude)); + + return (float)( + amplitude * + Math.Pow(2, -10f * x) * + Math.Sin((x - s) * (2 * Math.PI) / period) + + 1f + ); + } + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } + + public override void SetDefaults() + { + Projectile.width = 78; + Projectile.height = 142; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.friendly = false; + Projectile.penetrate = -1; + Projectile.alpha = 0; + Projectile.timeLeft = 120; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + + if (Projectile.frame < 4) + { + Projectile.frameCounter++; + + if (Projectile.frameCounter >= 4) + { + Projectile.frameCounter = 0; + Projectile.frame++; + + if (Projectile.frame > 4) + { + { + Projectile.frame = 4; // clamp to last frame + } + } + } + } + + float progress = MathHelper.Clamp(Projectile.ai[0] / 70f, 0f, 1f); + + Projectile.ai[1] = EaseOutElastic(progress); + + + Projectile.ai[0]++; + + if (Projectile.ai[0] < 3f) // Stick to bottom of player initially + { + Projectile.Center = player.Bottom + new Vector2(0f, -25f); + } + + else + { + // Begin rotating after initial launch at an increasingly fast rate + rotationFactor *= 1.033f; + Projectile.rotation -= rotationFactor; + } + + if (Projectile.ai[0] == 4f) + { + { + SoundStyle boing = new("CalamityMod/Sounds/Item/Springy"); + SoundEngine.PlaySound(boing with { Volume = 1f, PitchVariance = 0.1f }); + } + } + + if (Projectile.ai[0] == 16) // About when the spring retracts into itself, spawn dusts and sparks + { + for (int k = 0; k < 6; k++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 7 : 8); + dust.scale = Main.rand.NextFloat(0.8f, 1.3f); + dust.velocity = new Vector2(8, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.25f, 1.2f); + dust.noGravity = false; + Particle spark = new AltLineParticle(Projectile.Center, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.9f), true, 15, 0.8f, Color.Lerp(Color.LightGray, Color.Brown, Main.rand.NextFloat(0.3f, 0.7f)) * 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + if (Projectile.ai[0] >= 28f) // Begin fading + { + Projectile.alpha += 10; + Projectile.scale *= 0.98f; + + } + + if (Projectile.alpha >= 255 || !player.active || player.dead) + Projectile.Kill(); + } + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; + Rectangle sourceRect = new Rectangle(0, frameHeight * Projectile.frame, texture.Width, frameHeight); + Vector2 drawOrigin = new Vector2(texture.Width * 0.5f, frameHeight * 0.5f); + Vector2 drawPos = Projectile.Center - Main.screenPosition; + + Vector2 scale = new Vector2(Projectile.scale, Projectile.scale * Projectile.ai[1]); + + Main.EntitySpriteDraw(texture, drawPos, sourceRect, Projectile.GetAlpha(lightColor), Projectile.rotation + (Main.player[Projectile.owner].gravDir == -1 ? MathHelper.Pi : 0), drawOrigin, scale, SpriteEffects.None, 0); + return false; + } + } +} diff --git a/Projectiles/Typeless/SpringStoolFX.png b/Projectiles/Typeless/SpringStoolFX.png new file mode 100644 index 0000000000..4d21337bde Binary files /dev/null and b/Projectiles/Typeless/SpringStoolFX.png differ diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index b692380ee6..a6fde03773 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -1,5 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -14,82 +14,43 @@ namespace CalamityMod.Projectiles.Typeless public override void SetDefaults() { - Projectile.width = 6; - Projectile.height = 12; + Projectile.width = 8; + Projectile.height = 8; Projectile.friendly = true; - Projectile.penetrate = -1; + Projectile.penetrate = 1; Projectile.timeLeft = 240; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 7; + Projectile.MaxUpdates = 4; + Projectile.tileCollide = false; + } public override void AI() { - if (Projectile.velocity.X != Projectile.velocity.X) + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 5.5f, 10f, true); + + if (Projectile.Calamity().HomingTarget < 0) { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; + Projectile.velocity.Y += 0.025f; } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; if (Projectile.ai[1] == 0f && Projectile.type >= ProjectileID.GreekFire1 && Projectile.type <= ProjectileID.GreekFire3) { Projectile.ai[1] = 1f; SoundEngine.PlaySound(SoundID.Item13, Projectile.position); } - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[brimDust]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int brimDusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dusty = Main.dust[brimDusty]; - dusty.position.X -= 2f; - dusty.position.Y += 2f; - dusty.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - dusty.noGravity = true; - dusty.velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; + + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + if (Projectile.velocity.Y > 16f) { Projectile.velocity.Y = 16f; } } - public override bool OnTileCollide(Vector2 oldVelocity) => false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); } } diff --git a/Projectiles/Typeless/StepStoolBonusFX.cs b/Projectiles/Typeless/StepStoolBonusFX.cs new file mode 100644 index 0000000000..6cd1a56d57 --- /dev/null +++ b/Projectiles/Typeless/StepStoolBonusFX.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class StepStoolBonusFX : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "Calamitymod/Projectiles/InvisibleProj"; + public float OpacityMultiplier = 1f; + public override void SetDefaults() + { + Projectile.width = 28; + Projectile.height = 28; + + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + Projectile.friendly = false; + Projectile.penetrate = -1; + + Projectile.timeLeft = 100; + Projectile.alpha = 0; + } + + public override void AI() + { + // Gravity! + Projectile.velocity.Y += 0.15f; + + Projectile.rotation += 0.12f; + Projectile.scale -= 0.0125f; + OpacityMultiplier -= 0.025f; + + if (Projectile.timeLeft > 99) + Projectile.alpha = 255; + else + Projectile.alpha = 0; + } + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Extra[102].Value; + Vector2 origin = texture.Size() / 2f; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White * ((1f - (Projectile.alpha / 255f)) * OpacityMultiplier), Projectile.rotation + (Main.player[Projectile.owner].gravDir == -1 ? MathHelper.Pi : 0), origin, Projectile.scale * 1.25f, SpriteEffects.None); + + return false; + } + } +} diff --git a/Projectiles/Typeless/StratusBlackHole.cs b/Projectiles/Typeless/StratusBlackHole.cs index b803f42dfa..9e0df11dc6 100644 --- a/Projectiles/Typeless/StratusBlackHole.cs +++ b/Projectiles/Typeless/StratusBlackHole.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.Opacity = 0; + Projectile.ContinuouslyUpdateDamageStats = true; } public override void AI() diff --git a/Projectiles/Typeless/TileSlamDamage.cs b/Projectiles/Typeless/TileSlamDamage.cs new file mode 100644 index 0000000000..b359b1b9ab --- /dev/null +++ b/Projectiles/Typeless/TileSlamDamage.cs @@ -0,0 +1,28 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class TileSlamDamage : DirectStrike, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public Player Owner => Main.player[Projectile.owner]; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetInstantKill(); + int damageLength = (int)Math.Pow(target.life.ToString().Length, target.boss ? 2.8f : 1); + string sevens = "7"; + for (int i = 0; i < damageLength; i++) + { + sevens = sevens + "7"; + } + + Rectangle location = new Rectangle((int)target.position.X, (int)target.position.Y - 16, target.width, target.height); + int text = CombatText.NewText(location, Color.DodgerBlue, Language.GetTextValue(sevens), true); + } + + } +} diff --git a/Projectiles/Typeless/TransformerBlob.cs b/Projectiles/Typeless/TransformerBlob.cs index a3fc1c1c55..c9fa8c8bdc 100644 --- a/Projectiles/Typeless/TransformerBlob.cs +++ b/Projectiles/Typeless/TransformerBlob.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Typeless else modifiers.SourceDamage *= 0.2f; - target.MoveNPC(Utils.DirectionTo(Owner.Center, target.Center), (poweredTimer == 0 ? 7 : 3)); + target.MoveNPC(Utils.DirectionTo(Owner.Center, target.Center), (poweredTimer == 0 ? 7 : 3), false, Owner); if (Projectile.numHits == 0 && poweredTimer == 0) { diff --git a/Projectiles/Typeless/V8000SoulVisual.cs b/Projectiles/Typeless/V8000SoulVisual.cs new file mode 100644 index 0000000000..76d526cd24 --- /dev/null +++ b/Projectiles/Typeless/V8000SoulVisual.cs @@ -0,0 +1,82 @@ +using System; +using System.Linq; +using CalamityMod.DataStructures; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Particles; +using CalamityMod.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class V8000SoulVisual : ModProjectile, IPixelatedPrimitiveRenderer + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 14; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.timeLeft = 50; + Projectile.Opacity = 1f; + } + + public override void AI() + { + if (Projectile.timeLeft % 10 == 0) + Projectile.ai[1] = Main.rand.NextFloat(-0.25f, 0.25f); + + Projectile.velocity = Projectile.velocity.RotatedBy(Projectile.ai[1]); + + Projectile.velocity *= 0.98f; + + if (Main.rand.NextBool(5)) + { + Vector2 smokeVelocity = Main.rand.NextVector2Circular(1f, 1f) * 0.5f; + HeavySmokeParticle ghastlySmoke = new(Projectile.Center, smokeVelocity, Color.DodgerBlue, Main.rand.Next(20, 35), Main.rand.NextFloat(0.15f, 0.25f), Projectile.Opacity * 0.8f, 0.0175f, true); + GeneralParticleHandler.SpawnParticle(ghastlySmoke); + } + } + + public override bool PreDraw(ref Color lightColor) => false; + + public float WidthFunction(float completion, Vector2 _) + { + float maxBodyWidth = Projectile.scale * 14f; + + if (completion < 0.2f) + return MathF.Sin(completion / 0.2f * MathHelper.PiOver2) * maxBodyWidth; + + return MathHelper.Lerp(maxBodyWidth, 0f, (completion - 0.2f) / 0.8f); + } + + public Color ColorFunction(float completion, Vector2 _) + { + Color baseColor = Color.DodgerBlue; + return baseColor * Projectile.Opacity * (1f - completion); + } + + public void RenderPixelatedPrimitives(SpriteBatch spriteBatch, GeneralDrawLayer layer) + { + var shader = GameShaders.Misc["CalamityMod:ImpFlameTrail"]; + + shader.SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_, _) => Projectile.Size * 0.5f, true, true, shader), Projectile.oldPos.Length * 2); + + Vector2[] corePos = Projectile.oldPos.Take(4).ToArray(); + shader.SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(corePos, new((c, _) => WidthFunction(c, _) * 0.6f, (c, _) => Color.White * Projectile.Opacity * (1f - c), (_, _) => Projectile.Size * 0.5f, true, true, shader), corePos.Length * 2); + } + } +} diff --git a/Projectiles/Typeless/VoidofExtinctionCrit.cs b/Projectiles/Typeless/VoidofExtinctionCrit.cs deleted file mode 100644 index 9f56c8349e..0000000000 --- a/Projectiles/Typeless/VoidofExtinctionCrit.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class VoidofExtinctionCrit : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public Player Owner => Main.player[Projectile.owner]; - private static float ExplosionRadius = 300f; - - public override void SetDefaults() - { - //These shouldn't matter because its circular - Projectile.width = 300; - Projectile.height = 300; - Projectile.friendly = true; - Projectile.DamageType = AverageDamageClass.Instance; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 2; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - public override void AI() - { - Player player = Main.player[Projectile.owner]; - for (int i = 0; i <= 30; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 218 : ModContent.DustType(), new Vector2(5, 5).RotatedByRandom(MathHelper.ToRadians(360)) * Main.rand.NextFloat(1.1f, 2.2f), 0, default, Main.rand.NextFloat(2.8f, 3.4f)); - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cFace, player); - dust.noGravity = true; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 360); - SoundEngine.PlaySound(SoundID.Item89 with { Volume = 0.5f, PitchVariance = 0.4f }, Projectile.Center); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); - public override bool? CanDamage() => base.CanDamage(); - public override bool? CanCutTiles() => false; - } -} diff --git a/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs b/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs index 5e43429685..92ab6e86f8 100644 --- a/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/RavenMinionAI.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides if (!Main.dedServ) { - if (Main.rand.NextBool(6000)) + if (Main.rand.NextBool(16000)) SoundEngine.PlaySound(CrowNoises, proj.Center); } diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 7ede28b514..0a38e2d428 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Rarities ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y) + new Vector2(pulsing, 0f).RotatedBy(f + time * 2f % MathHelper.TwoPi), textColor * 0.5f, rotation, origin, baseScale); } + if (Item.expert) + textColor = Main.DiscoColor; + textColor.A = 255; ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); diff --git a/Sounds/Item/FeatherBreak.ogg b/Sounds/Item/FeatherBreak.ogg new file mode 100644 index 0000000000..7f03b0062e Binary files /dev/null and b/Sounds/Item/FeatherBreak.ogg differ diff --git a/Sounds/Item/Springy.ogg b/Sounds/Item/Springy.ogg new file mode 100644 index 0000000000..09fa4c4f8d Binary files /dev/null and b/Sounds/Item/Springy.ogg differ diff --git a/Sounds/Item/V8000Boost.ogg b/Sounds/Item/V8000Boost.ogg new file mode 100644 index 0000000000..ea2fe8ff96 Binary files /dev/null and b/Sounds/Item/V8000Boost.ogg differ diff --git a/Sounds/Item/V8Boost.ogg b/Sounds/Item/V8Boost.ogg new file mode 100644 index 0000000000..cbcbcd3a3f Binary files /dev/null and b/Sounds/Item/V8Boost.ogg differ diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index afd3ba2ca8..54496b4e70 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -59,14 +59,15 @@ namespace CalamityMod.Systems.Collections /// public static bool[] IsDebuff = Factory.CreateBoolSet(BuffID.Poisoned, BuffID.Darkness, BuffID.Cursed, BuffID.OnFire, BuffID.Bleeding, BuffID.Confused, BuffID.Slow, BuffID.Weak, BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, BuffID.Frostburn, BuffID.Chilled, BuffID.Frozen, BuffID.Burning, BuffID.Suffocation, BuffID.Ichor, - BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, - BuffID.OgreSpit, BuffID.BetsysCurse, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffID.Venom, BuffID.Blackout, BuffID.Electrified, BuffID.Rabies, BuffID.Webbed, BuffID.Stoned, BuffID.Dazed, BuffID.VortexDebuff, BuffID.WitheredArmor, BuffID.WitheredWeapon, BuffID.ShadowFlame, + BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType()); + BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), BuffType(), + BuffType(), BuffType(), BuffType()); /// /// If for a buff type, then that buff is a whip tag buff on the player.
diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 5c01ead45c..7cd1742e0d 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -135,5 +135,10 @@ namespace CalamityMod.Systems.Collections ///
public static bool[] RogueSpikyBall = Factory.CreateBoolSet(ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType()); + + public static bool[] ShowScalingCritDamageTooltip = Factory + .CreateNamedSet("ShowScalingCritDamageTooltip") + .Description("Replaces Crit Chance tooltip line with Crit Damage, getting 2% crit dmg per 1% crit chance") + .RegisterBoolSet(); } } diff --git a/Systems/Collections/CalamityNPCSets.cs b/Systems/Collections/CalamityNPCSets.cs index 5a234bd2a8..b6d5a71376 100644 --- a/Systems/Collections/CalamityNPCSets.cs +++ b/Systems/Collections/CalamityNPCSets.cs @@ -177,11 +177,11 @@ namespace CalamityMod.Systems.Collections NPCID.MothronEgg, NPCID.MothronSpawn); /// - /// If for an NPC type, then the NPC will receive a 30 second global cooldown to slowing debuffs after being inflicted by one.
+ /// If for an NPC type, then the NPC will not be affected by slowing debuffs.
/// Also used to prevent weapon pulling effects and Anarchy Blade's ability to instantly kill enemies that are below 50% health.
/// Defaults to . ///
- public static bool[] ResistSlowingDebuffsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType(), + public static bool[] ImmuneToSlowsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType(), NPCID.EyeofCthulhu, NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.BrainofCthulhu, NPCID.Creeper, NPCID.QueenBee, NPCID.Deerclops, NPCID.SkeletronHead, NPCID.SkeletronHand, NPCID.WallofFlesh, NPCID.WallofFleshEye, NPCID.PirateShipCannon, NPCID.QueenSlimeBoss, NPCID.Probe, NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.Plantera, diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs index 8d0d52a1c7..bd3eb44325 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -102,7 +102,6 @@ namespace CalamityMod.Systems.Collections // North Pole ProjectileID.NorthPoleWeapon, ProjectileID.NorthPoleWeapon, ProjectileID.NorthPoleSpear, ProjectileID.NorthPoleWeapon, - ProjectileID.NorthPoleSnowflake, ProjectileID.NorthPoleWeapon, // Spore gas clouds ProjectileID.SporeTrap, ProjectileID.SporeTrap, ProjectileID.SporeTrap2, ProjectileID.SporeTrap, diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 391f0a3aa1..741a5fe91b 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -485,7 +485,7 @@ namespace CalamityMod.Systems // Life Crystal Recipe.Create(ItemID.LifeCrystal). - AddIngredient(ItemID.StoneBlock, 5). + AddRecipeGroup("AnyStoneBlock", 5). AddIngredient(ItemID.Ruby, 2). AddIngredient(ItemID.HealingPotion). AddTile(TileID.Anvils). @@ -756,8 +756,6 @@ namespace CalamityMod.Systems // Tier lock various items to a higher tier (sorted by progression) { Vanilla(ItemID.Trimarang), AddIngredient(ItemType(), 5) }, - { Vanilla(ItemID.BundleofBalloons), AddIngredient(ItemType(), 3) }, - { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ItemType(), 5) }, { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.FairyBell), RemoveIngredient(ItemID.SoulofSight) }, @@ -1436,7 +1434,7 @@ namespace CalamityMod.Systems // Encumbering Stone r = Recipe.Create(ItemID.EncumberingStone); - r.AddIngredient(ItemID.StoneBlock, 100); + r.AddRecipeGroup("AnyStoneBlock", 100); r.AddTile(TileID.Anvils); r.Register(); } @@ -1448,13 +1446,13 @@ namespace CalamityMod.Systems // Wooden Chest weapons // Wooden Boomerang Recipe r = Recipe.Create(ItemID.WoodenBoomerang); - r.AddIngredient(ItemID.Wood, 7); + r.AddRecipeGroup("Wood", 7); r.AddTile(TileID.WorkBenches); r.Register(); // Wand of Sparking r = Recipe.Create(ItemID.WandofSparking); - r.AddIngredient(ItemID.Wood, 5); + r.AddRecipeGroup("Wood", 5); r.AddIngredient(ItemID.Torch, 3); r.AddIngredient(ItemID.FallenStar); r.AddCondition(Condition.NotRemixWorld); @@ -1581,8 +1579,8 @@ namespace CalamityMod.Systems // Blizzard in a Bottle r = Recipe.Create(ItemID.BlizzardinaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); - r.AddRecipeGroup(AnySnowBlock, 5); + r.AddIngredient(ItemID.Cloud, 15); + r.AddRecipeGroup(AnySnowBlock, 30); r.AddIngredient(ItemID.Feather, 3); r.AddTile(TileID.Anvils); r.Register(); @@ -1590,7 +1588,7 @@ namespace CalamityMod.Systems // Cloud in a Bottle r = Recipe.Create(ItemID.CloudinaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); + r.AddIngredient(ItemID.Cloud, 30); r.AddIngredient(ItemID.Feather, 2); r.AddTile(TileID.Anvils); r.Register(); @@ -1598,9 +1596,8 @@ namespace CalamityMod.Systems // Sandstorm in a Bottle r = Recipe.Create(ItemID.SandstorminaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); - r.AddIngredient(ItemID.SandBlock, 5); - r.AddIngredient(3); + r.AddIngredient(ItemID.Cloud, 15); + r.AddRecipeGroup("Sand", 40); r.AddIngredient(ItemID.Feather, 3); r.AddTile(TileID.Anvils); r.Register(); @@ -1608,7 +1605,7 @@ namespace CalamityMod.Systems // Fledgling Wings r = Recipe.Create(ItemID.CreativeWings); - r.AddIngredient(ModContent.ItemType(), 2); + r.AddIngredient(2); r.AddIngredient(ItemID.Cloud, 5); r.AddIngredient(ItemID.Feather, 10); r.AddTile(TileID.Anvils); diff --git a/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index 8568bd4e69..81feca5779 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -619,7 +619,10 @@ namespace CalamityMod.Systems bool adultWyrmAlive = CalamityGlobalNPC.adultEidolonWyrmHead != -1 && Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active; if (!adultWyrmAlive) + { + CalamityUtils.BroadcastLocalizedText("Mods.CalamityMod.Status.Boss.PrimordialWyrmSpawn", Color.Cyan); NPC.SpawnOnPlayer(player.whoAmI, NPCType()); + } } #endregion } diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs index e122340eb9..aed63f0f69 100644 --- a/Tiles/Crags/Tree/SpineSapling.cs +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -10,6 +10,32 @@ namespace CalamityMod.Tiles.Crags.Tree { public class SpineSapling : ModTile { + public override void Load() + { + On_Player.TryReplantingTree += LetAxeofRegrowthReplant; + } + + private static void LetAxeofRegrowthReplant(On_Player.orig_TryReplantingTree orig, Player self, int x, int y) + { + if (Main.tile[x, y + 1].TileType == ModContent.TileType()) + { + // Destroy the Spine Tree tile above the base to give space for the Small Spine to place + WorldGen.KillTile(x, y - 1); + if (!TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, ModContent.TileType(), 0, self.direction, out var objectData)) + return; + bool placed = TileObject.Place(objectData); + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + if (placed) + { + TileObjectData.CallPostPlacementPlayerHook(Player.tileTargetX, Player.tileTargetY, ModContent.TileType(), 0, self.direction, objectData.alternate, objectData); + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendObjectPlacement(-1, Player.tileTargetX, Player.tileTargetY, objectData.type, objectData.style, objectData.alternate, objectData.random, self.direction); + } + } + else + orig(self, x, y); + } + public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index 06d6eaffc3..d58e40d647 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -171,14 +171,14 @@ namespace CalamityMod.Tiles.Crags.Tree public override void NearbyEffects(int i, int j, bool closer) { - //kill the tree tiles if there are no tiles below it - if (!Framing.GetTileSafely(i, j + 1).HasTile) + // Kill the tree tiles if there are no tiles below it or if a Sapling is below it + // The Sapling check exists for Axe of Regrowth sapling replanting + Tile belowTile = Framing.GetTileSafely(i, j + 1); + if (!belowTile.HasTile || belowTile.TileType == ModContent.TileType()) { - WorldGen.KillTile(i, j, false, false, false); + WorldGen.KillTile(i, j); if (Main.netMode == NetmodeID.MultiplayerClient) - { NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, i, j); - } } } diff --git a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs index 49fcd0d128..6c036b064e 100644 --- a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs +++ b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs @@ -111,11 +111,11 @@ namespace CalamityMod.Tiles.Furniture.Paintings DrawBorders(spriteBatch, pos - Main.screenPosition, new Point(i, j)); return false; } - public static void DrawBorders(SpriteBatch spriteBatch, Vector2 pos, Point cords) + public void DrawBorders(SpriteBatch spriteBatch, Vector2 pos, Point cords) { var texture = border.Value; var cornerTex = corner.Value; - var canvasID = (ushort)Main.LocalPlayer.Calamity().CurrentlyViewedCanvasType; + var canvasID = Type; var commonDim = 8; var finalCord = 72; var size = 80; diff --git a/Tiles/FurnitureWulfrum/WulfrumLabstation.cs b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs index e58e455dd4..5b7f227594 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLabstation.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void SetStaticDefaults() { + this.SetUpTable(ModContent.ItemType(), true); Main.tileFrameImportant[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 440d1cbc81..c015c371b2 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Tiles.SunkenSea { public override void SetStaticDefaults() { - TileID.Sets.GeneralPlacementTiles[Type] = false; - Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index b4243dd14c..0f702a8bbc 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -11,8 +11,6 @@ namespace CalamityMod.Tiles.SunkenSea { public override void SetStaticDefaults() { - TileID.Sets.GeneralPlacementTiles[Type] = false; - Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; diff --git a/UI/DialogueDisplay/DisplayEffects/AltarText.cs b/UI/DialogueDisplay/DisplayEffects/AltarText.cs new file mode 100644 index 0000000000..e04228bf16 --- /dev/null +++ b/UI/DialogueDisplay/DisplayEffects/AltarText.cs @@ -0,0 +1,43 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.UI.DialogueDisplay.DisplayEffects +{ + public class AltarText : DisplayEffect + { + public override bool FadeWhenTooFar => false; + + public override bool DespawnWithAttachedNPC => false; + + public override Vector2 TextOffsetFromStart(Vector2 startPos, Vector2 textSize) + { + Vector2 halfSize = textSize * 0.5f; + return startPos - halfSize + (Vector2.UnitY * (textSize.Y - 60)); + } + float OffsetDisappearTime(float time, float ratio) => MathHelper.Clamp((time - (ratio * TimeToDisappear / 2f)) / (TimeToDisappear / 2f), 0f, 1f); + + public override Vector2 DisappearPositioning(Vector2 startPos, float time, DialogueCharacterData charData) => Vector2.Lerp(startPos, startPos + (Vector2.unitXVector * 12 * charData.Scale), CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override float DisappearOpacity(float startOpacity, float time, DialogueCharacterData charData) => 1 - CalamityUtils.SineOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1); + + public override Vector2 DisappearScale(Vector2 startScale, float time, DialogueCharacterData charData) => Vector2.Lerp(startScale, startScale * 0.75f, CalamityUtils.ExpOutEasing(OffsetDisappearTime(time, charData.CompletionRatio), 1)); + + public override void PreDraw(SpriteBatch spriteBatch, Vector2 textStart, Vector2 textSize, int textTimer, int switchTimer) + { + if (textTimer < 0) + return; + + float Opacity = 1f; + if (textTimer < 30f) + Opacity = MathHelper.Lerp(0f, 1f, CalamityUtils.CircOutEasing(textTimer / 30f, 1)); + + if (switchTimer > 0) + Opacity *= 1 - CalamityUtils.CircOutEasing(switchTimer / 60f, 1); + + Texture2D tex = ModContent.Request("CalamityMod/Particles/SmallBloom").Value; + spriteBatch.Draw(tex, textStart + textSize * 0.5f - Main.screenPosition, null, Color.Black * 0.6f * Opacity, 0f, tex.Size() * 0.5f, new Vector2(textSize.X / 160f, textSize.Y / 120f), 0, 0); + } + } +} diff --git a/Utilities/HitModiferUtils.cs b/Utilities/HitModiferUtils.cs new file mode 100644 index 0000000000..99cf3df95b --- /dev/null +++ b/Utilities/HitModiferUtils.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.WorldBuilding; + +namespace CalamityMod.Utilities +{ + internal static class HitModiferUtils + { + extension(ref NPC.HitModifiers modifiers) + { + internal void ApplyScalingForcedCrit(Projectile Projectile) + { + modifiers.SetCrit(); + float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f; + modifiers.CritDamage += critDamage; + } + } + } +} diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 3c29818724..7ad793f3ad 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.DataStructures; using CalamityMod.UI.CalamitasEnchants; using Microsoft.Xna.Framework; @@ -127,8 +128,10 @@ namespace CalamityMod public static Color ElectricDebuffColor => new(255, 245, 0); public static Color BuffColor => new(255, 105, 237); public static Color TypelessDebuffColor => new(230, 202, 250); + public static Color GodSlayerInfernoColor => new(241, 107, 250); public static Color VulnHexDebuffColor => new(196, 35, 43); public static Color MiracleBlightDebuffColor => Main.DiscoColor; + public static Color SmashedEvilDebuffColor => Color.Lerp(new Color(162, 88, 231), new Color(221, 66, 97), MathHelper.SmoothStep(0, 1, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) * 0.5f)); private static readonly Dictionary> debuffColorWeightsCache = []; @@ -136,6 +139,7 @@ namespace CalamityMod { var color = TypelessDebuffColor; + // God Slayer Inferno, Vulnerability Hex, and Miracle Blight receive special colors if (debuffId == ModContent.BuffType() || debuffId == ModContent.BuffType()) { color = Color.Lerp(VulnHexDebuffColor, FireDebuffColor, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) / 4f); @@ -144,6 +148,18 @@ namespace CalamityMod { color = MiracleBlightDebuffColor; } + else if (debuffId == ModContent.BuffType()) + { + color = GodSlayerInfernoColor; + } + else if (debuffId == ModContent.BuffType() && CalamityClientConfig.Instance.TextEffects) + { + color = SmashedEvilDebuffColor; + } + + // Color debuffs based on their element type in the vulnerability and resistance system + // If a debuff has multiple types, the colors are mixed + // If a debuff is typeless, is gets the typeless color else if (BuffDatasets.DebuffDataset[debuffId] is not null) { if (!debuffColorWeightsCache.TryGetValue(debuffId, out var weights)) @@ -180,6 +196,9 @@ namespace CalamityMod color = new Color(normalColor); } } + // If this is actually a beneficial buff, color it as so + else if (!Main.debuff[debuffId]) + color = BuffColor; return color; } diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 10132d352e..f65c49f08d 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -91,12 +91,14 @@ namespace CalamityMod public static string ToMphps(this float velocity) => Round(velocity * 60f * 216000f / 42240f, "N2"); public static string ToTiles(this float pixel) => Round(pixel / 16f); - public static string ToRegenPerSecond(this int regen) => Round(regen * 0.5f, "N2"); + public static string ToRegenPerSecond(this float partialRegen) => Round(partialRegen * 0.5f, "N2"); + public static string ToRegenPerSecond(this int regen, float partialRegen = 0f) => Round((regen + partialRegen) * 0.5f, "N2"); public static string ToJumpSpeedPercent(this float boost) => Round(boost * 20f, "N2"); public static string ToStealth(this float stealth) => Round(stealth * 100f, "N0"); public static string GetChanceFromDenominator(this int denominator) => ToPercent(1 / (float)denominator); + public static string ToPercent(this int percent) => (percent * 100).ToString(); public static string ToPercent(this float percent, string precision = "N1") => Round(percent * 100f, precision); public static string ToPercent(this double percent, string precision = "N1") => Round(percent * 100D, precision); // Double-rounded for proper digit cutoffs diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index bc6f2278bd..aacef829b0 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -136,7 +136,7 @@ namespace CalamityMod #region Standard Enemy Immunity Sets private static readonly int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; - private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, ModContent.BuffType() }; + private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, BuffID.Frozen }; private static readonly int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; private static readonly int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; private static readonly int[] abyssEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index c360a2d7ea..9b41cd6be3 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,12 +1,18 @@ using System; +using System; +using System.Collections.Generic; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Reflection; +using CalamityMod.Balancing; using CalamityMod.Balancing; using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -16,17 +22,22 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.Yharon; using CalamityMod.Packets; using CalamityMod.Systems.Collections; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; using static Terraria.ModLoader.ModContent; namespace CalamityMod @@ -732,14 +743,11 @@ namespace CalamityMod ///
/// The NPC attacked. /// Whether or not the NPC can be moved around. - public static bool CanBeMoved(this NPC target, bool ignoreKBImmune = false) + public static bool CanBeMoved(this NPC target) { - // Ideally we can replace [!CalamityPlayer.areThereAnyDamnBosses] with a check for problematic boss minions so that you can knock back regular ones in bossfights. - // For now at least, when a boss is alive it will always fail to knockback enemies with 100% kb resist. - if (CalamityPlayer.areThereAnyDamnBosses) - ignoreKBImmune = false; - bool isAPillar = target.type == NPCID.LunarTowerSolar || target.type == NPCID.LunarTowerVortex || target.type == NPCID.LunarTowerNebula || target.type == NPCID.LunarTowerStardust; - if (!isAPillar && !target.boss && target.IsAnEnemy(true, true, false) && (ignoreKBImmune || target.knockBackResist > 0)) + bool whitelisted = CalamityHeavyKnockbackWhitelist.whitelistNPC.Contains(target.type); + + if ((target.knockBackResist != 0 || whitelisted) && target.IsAnEnemy(true, true, false)) return true; return false; } @@ -748,13 +756,14 @@ namespace CalamityMod ///
/// The NPC being moved. /// Whether or not NPC's that normally have knockback immunity can be moved around. - public static void MoveNPC(this NPC target, Vector2 direction, float strength, bool ignoreKBImmune = false) + public static void MoveNPC(this NPC target, Vector2 direction, float strength, bool heavyKnockback = false, Player attacker = null) { - if (target.CanBeMoved(ignoreKBImmune)) + if (target.CanBeMoved()) { Vector2 launchVel = direction.SafeNormalize(Vector2.UnitX) * strength; - float knockbackMult = Utils.Remap(target.knockBackResist, 0, 1, 0.5f, 1f, false); - target.velocity = launchVel * (knockbackMult > 1 ? (float)Math.Pow(knockbackMult, 10) : knockbackMult); + float playerKnockbackMult = 1; // Xyk 19MARCH2026: If we ever make knockback a real stat, it can go here. It's much too messy right now to work with, but at least the player is already supported. + float knockbackMult = playerKnockbackMult * (heavyKnockback ? Math.Max(target.knockBackResist, 1) : target.knockBackResist); // Heavy knockback ignores knockback resist (but not knockback weakness) + target.velocity = launchVel * knockbackMult; target.SyncMotionToServer(); } } diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 20c261a77e..0db89dd408 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -134,7 +134,26 @@ namespace CalamityMod ret += best - 1f; return ret; } + /// + /// Calculates and returns the player's total melee scale boosts. This is used mostly for melee holdouts. + /// + /// If the item scale of the players held item should be added to the calculation.
+ /// Should be disabled for anything that doesn't lock you into holding one item. + /// + public static float GetMeleeScale(this Player player, bool addHeldItemScale = true) + { + float baseScale = 1; + player.ApplyMeleeScale(ref baseScale); // Gets vanilla's glove scale boosts + // Xyk 3MARCH2026: Will be implemented better by Doze eventually + if (addHeldItemScale) + baseScale += (player.HeldItem.scale - 1); + if (player.HasBuff(BuffID.Tipsy)) + baseScale += 0.15f; + + + return baseScale; + } public static float GetAmmoCostReduction(this Player player) { // Tally up all possible vanilla effects. diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 083849c346..b4441f1453 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -338,35 +338,60 @@ namespace CalamityMod.World public static void PlaceSunkenSeaLab(out Point placementPoint, List workshopPoints, StructureMap structures) { + int tries = 0; string mapKey = SunkenSeaLabKey; PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction); SchematicMetaTile[,] schematic = TileMaps[mapKey]; int labWidth = schematic.GetLength(0); int labHeight = schematic.GetLength(1); - int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2; - int sunkenSeaY = Main.maxTilesY / 2; + do + { + // Pick a location based on the Underground Desert, because the Sunken Sea is based on the Underground Desert + Rectangle ugDesert = GenVars.UndergroundDesertLocation; + int placementPositionX = -1; - int placementPositionX = sunkenSeaX < Main.maxTilesX / 2 ? sunkenSeaX - 120 : sunkenSeaX + 120; - int placementPositionY = (sunkenSeaY + (Main.maxTilesY / 4) - 25) - labHeight; + // Desperation generation: if 75% of attempts failed, start generating literally anywhere in the Sunken Sea + if (tries >= 1500) + placementPositionX = WorldGen.genRand.Next(ugDesert.Left, ugDesert.Right - labWidth); + // 50% chance to be on either the left or the right. + // If it's on the right then shove it left because all schematics are placed based on their top left corner. + else if (WorldGen.genRand.NextBool()) + placementPositionX = WorldGen.genRand.Next(ugDesert.Left - 20, ugDesert.Left + 10); + else + placementPositionX = WorldGen.genRand.Next(ugDesert.Right - 10, ugDesert.Right + 20) - labWidth; - placementPoint = new Point(placementPositionX, placementPositionY); - Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1)); + int sunkenSeaY = 0; - /* - I do not think that this check needs to exist for now, no other structures exist in the sunken sea at the moment - Once other sunken sea structures are added, i will likely re-enable this and modify the generation so that it avoids protected areas again - This is just so i can have it generating in time for the patreon beta - */ + //copied the desert position code from the sunken sea's generation so the lab always generates within the sunken sea properly + for (int y = Main.maxTilesY - 200; y >= Main.worldSurface; y--) + { + if (Main.tile[placementPositionX, y].WallType == ModContent.WallType()) + { + sunkenSeaY = y - 80; //offset so it generates nicely + break; + } + } - //if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) - //{ - bool hasPlacedLogAndSchematic = false; - PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); - CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); - //Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays - CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; - //} + int placementPositionY = sunkenSeaY - labHeight; + + placementPoint = new Point(placementPositionX, placementPositionY); + Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1)); + + if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) + { + bool hasPlacedLogAndSchematic = false; + PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); + CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20); + //Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays + CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; + break; + } + //try again if the structure is colliding with a structure from another mod + else + tries++; + } + while (tries <= 2000); } #endregion diff --git a/World/ShimmerShrine.cs b/World/ShimmerShrine.cs index 7beb14fd6c..67220466ef 100644 --- a/World/ShimmerShrine.cs +++ b/World/ShimmerShrine.cs @@ -20,6 +20,23 @@ namespace CalamityMod.World int placementPositionY = (int)Main.worldSurface - 300; int offset = 28; + int width = schematic.GetLength(0); + int height = schematic.GetLength(1); + // If the point directly above the shimmer is blocked by something, try to move to the side a bit + if (!structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + { + int attempts = 0; + while (attempts < 1000) + { + attempts++; + placementPositionX = Main.rand.Next((int)GenVars.shimmerPosition.X - 100, (int)GenVars.shimmerPosition.X + 100); + if (structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + break; + } + // If still not good, just give up and place it directly above the shimmer regardless + placementPositionX = (int)GenVars.shimmerPosition.X; + } + while (!Main.tile[placementPositionX, placementPositionY].HasTile) placementPositionY++; diff --git a/build.txt b/build.txt index 047b87641a..96114a7dee 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.1.1 +version = 2.1.2 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://calamitymod.com