diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 23b231907c..29b8c5dd69 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -222,6 +222,9 @@ namespace CalamityMod.Balancing // 30% resist to Flak Kraken. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); + // 25% resist to Solar Eruption. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SolarWhipSword, ProjectileID.SolarWhipSwordExplosion)))); + // 20% resist to Ballistic Poison Bomb's clouds. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType())))); diff --git a/Buffs/Alcohol/AlcoholPoisoning.cs b/Buffs/Alcohol/AlcoholPoisoning.cs index c1736b0e64..1880e891a1 100644 --- a/Buffs/Alcohol/AlcoholPoisoning.cs +++ b/Buffs/Alcohol/AlcoholPoisoning.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -10,10 +11,8 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; - // The nurse technically cannot get rid of this debuff by herself, as it reapplies immediately after if you have alcohol left - // But she also cleanses excess alcohol if you have Alcohol Poisoning (see CalamityPlayer.PostNurseHeal) - // Removing this set means she costs 1 debuff worth of cost to remove excess alcohol - // BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + // The nurse can remove all alcohol debuffs individually, thus removing this by proxy. + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/BloodyMaryBuff.cs b/Buffs/Alcohol/BloodyMaryBuff.cs index af35461b47..266bcbf377 100644 --- a/Buffs/Alcohol/BloodyMaryBuff.cs +++ b/Buffs/Alcohol/BloodyMaryBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/CaribbeanRumBuff.cs b/Buffs/Alcohol/CaribbeanRumBuff.cs index fcdb6422b6..ad63c115e5 100644 --- a/Buffs/Alcohol/CaribbeanRumBuff.cs +++ b/Buffs/Alcohol/CaribbeanRumBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index bb724a3a52..6efc2c936e 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/EverclearBuff.cs b/Buffs/Alcohol/EverclearBuff.cs index 1629143a7f..fa5f3156fe 100644 --- a/Buffs/Alcohol/EverclearBuff.cs +++ b/Buffs/Alcohol/EverclearBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index 1821638bad..c3d27d74b9 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 99c877dc50..94ef554b0f 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index 83504af851..5ab4836351 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,14 +12,12 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) { var cplayer = player.Calamity(); cplayer.grapeBeer = true; - cplayer.critDamage -= GrapeBeer.CritLoss * 0.01f; } } } diff --git a/Buffs/Alcohol/ManhattanBuff.cs b/Buffs/Alcohol/ManhattanBuff.cs index e724375c25..71872b7153 100644 --- a/Buffs/Alcohol/ManhattanBuff.cs +++ b/Buffs/Alcohol/ManhattanBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index 37299b4fb8..d9f0855b5f 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MoonshineBuff.cs b/Buffs/Alcohol/MoonshineBuff.cs index 03faabe66d..32221e2e24 100644 --- a/Buffs/Alcohol/MoonshineBuff.cs +++ b/Buffs/Alcohol/MoonshineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/MoscowMuleBuff.cs b/Buffs/Alcohol/MoscowMuleBuff.cs index 21f7569480..33afd8c8a8 100644 --- a/Buffs/Alcohol/MoscowMuleBuff.cs +++ b/Buffs/Alcohol/MoscowMuleBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/OldFashionedBuff.cs b/Buffs/Alcohol/OldFashionedBuff.cs index 68820059d4..8a31d03b48 100644 --- a/Buffs/Alcohol/OldFashionedBuff.cs +++ b/Buffs/Alcohol/OldFashionedBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/PurpleHazeBuff.cs b/Buffs/Alcohol/PurpleHazeBuff.cs index 16aa30d53f..a786be25fb 100644 --- a/Buffs/Alcohol/PurpleHazeBuff.cs +++ b/Buffs/Alcohol/PurpleHazeBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/RedWineBuff.cs b/Buffs/Alcohol/RedWineBuff.cs index 087086ca68..86acc413e4 100644 --- a/Buffs/Alcohol/RedWineBuff.cs +++ b/Buffs/Alcohol/RedWineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/RumBuff.cs b/Buffs/Alcohol/RumBuff.cs index ab842e0649..9f98fe704c 100644 --- a/Buffs/Alcohol/RumBuff.cs +++ b/Buffs/Alcohol/RumBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/ScrewdriverBuff.cs b/Buffs/Alcohol/ScrewdriverBuff.cs index f8f97cd0fe..ae2ddec1cc 100644 --- a/Buffs/Alcohol/ScrewdriverBuff.cs +++ b/Buffs/Alcohol/ScrewdriverBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/StarBeamRyeBuff.cs b/Buffs/Alcohol/StarBeamRyeBuff.cs index 50d6ac0bc8..71d4d85c3b 100644 --- a/Buffs/Alcohol/StarBeamRyeBuff.cs +++ b/Buffs/Alcohol/StarBeamRyeBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index a2b307c605..1db0e76f6c 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/TequilaSunriseBuff.cs b/Buffs/Alcohol/TequilaSunriseBuff.cs index af5a5f174a..650b4478a4 100644 --- a/Buffs/Alcohol/TequilaSunriseBuff.cs +++ b/Buffs/Alcohol/TequilaSunriseBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index 46eaee8329..60676048bf 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Potions.Alcohol; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -13,7 +12,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/WhiskeyBuff.cs b/Buffs/Alcohol/WhiskeyBuff.cs index 66be5a8a0c..488758eb22 100644 --- a/Buffs/Alcohol/WhiskeyBuff.cs +++ b/Buffs/Alcohol/WhiskeyBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/Alcohol/WhiteWineBuff.cs b/Buffs/Alcohol/WhiteWineBuff.cs index eb47a1056f..f18f1f8cef 100644 --- a/Buffs/Alcohol/WhiteWineBuff.cs +++ b/Buffs/Alcohol/WhiteWineBuff.cs @@ -1,5 +1,4 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol @@ -12,7 +11,6 @@ namespace CalamityMod.Buffs.Alcohol Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; Main.persistentBuff[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) 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/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/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index beead70032..e7eb641700 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -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/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/Potions/BaguetteBuff.cs b/Buffs/Potions/BaguetteBuff.cs index 878bca7213..8e6e11aac2 100644 --- a/Buffs/Potions/BaguetteBuff.cs +++ b/Buffs/Potions/BaguetteBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Potions.Food; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions @@ -7,7 +8,7 @@ namespace CalamityMod.Buffs.Potions { public override void SetStaticDefaults() { - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; } @@ -15,6 +16,7 @@ namespace CalamityMod.Buffs.Potions public override void Update(Player player, ref int buffIndex) { player.Calamity().baguette = true; + player.lifeRegen -= Baguette.RedWineRegenLoss; } } } diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index 53a0e6b247..6400ba9f56 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class Mushy : ModBuff { - public static int DefenseBoost = 5; + public static int DefenseBoost = 3; public static int RegenBoost = 2; public override LocalizedText Description => base.Description.WithFormatArgs(DefenseBoost, RegenBoost.ToRegenPerSecond()); 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 204c4884d9..512476ef2d 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs 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/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9992307e78..8f9d1b241b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -187,11 +187,11 @@ namespace CalamityMod.CalPlayer public enum FishingMinigames { None, - ScrapBobber, - NavystoneBobber, - SkylineBobber, - PerennialBobber, - ScoriaBobber, + WulfrumBobber, + SunkenSinker, + AcrobaticBobber, + FeralBobber, + VolcanicSinker, DevourerofCods //Not a fishing minigame but uses the same code as the rest } public FishingMinigames SelectedFishingMinigame = FishingMinigames.None; @@ -948,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; @@ -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; @@ -1091,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; @@ -1106,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; @@ -2400,7 +2410,10 @@ namespace CalamityMod.CalPlayer amalgam = false; frostFlare = false; evolution = false; + v8Engine = false; + v8000Engine = false; nanotech = false; + nanotechHitCooldown = 0; deadshotBrooch = false; tesla = false; teslaVisuals = true; @@ -2436,6 +2449,8 @@ namespace CalamityMod.CalPlayer stressPills = false; laudanum = false; fleshTotem = false; + fleshTotemVisual = false; + fleshTotemMinion = false; bloodPact = false; bloodflareCore = false; chaliceOfTheBloodGod = false; @@ -2621,6 +2636,7 @@ namespace CalamityMod.CalPlayer eclipseMirror = false; featherCrown = false; moonCrown = false; + mageCrownVisibility = false; dragonScales = false; gloveOfPrecision = false; gloveOfRecklessness = false; @@ -2631,6 +2647,7 @@ namespace CalamityMod.CalPlayer sandCloak = false; spectralVeil = false; hasJetpack = false; + hasEngineDash = false; plaguedFuelPack = false; blunderBooster = false; blunderBoosterVisibility = true; @@ -3114,7 +3131,7 @@ namespace CalamityMod.CalPlayer andromedaCripple = 0; theBeeCooldown = 0; scuttlerCooldown = 0; - rogueCrownCooldown = 0; + mageCrownTimer = 0; wingProjectileCooldown = 0; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; @@ -4837,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() { @@ -5147,7 +5187,7 @@ namespace CalamityMod.CalPlayer ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + (laudanum && Player.HasBuff(BuffID.VortexDebuff) ? 0.15f : 0f) + - ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + + ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * FrostFlare.HealthRatioThreshold)) ? FrostFlare.AccelerationBoost : 0f) + (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + @@ -5167,7 +5207,7 @@ namespace CalamityMod.CalPlayer (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + - ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + + ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * FrostFlare.HealthRatioThreshold)) ? FrostFlare.AccelerationBoost : 0f) + (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + @@ -5880,32 +5920,6 @@ namespace CalamityMod.CalPlayer price /= vanillaPriceMult; } } - - public override void PostNurseHeal(NPC nurse, int health, bool removeDebuffs, int price) - { - // Remove excess alcohol - if (removeDebuffs && alcoholPoisonLevel > 3) - { - List Alcohol = new List(); - for (int i = 0; i < Player.MaxBuffs; i++) - { - int buff = Player.buffType[i]; - if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level)) - Alcohol.Insert(0, new int[] { i, level }); - } - - int poison = alcoholPoisonLevel; - do - { - // Obtain the index:level relationship - int[] relation = Alcohol[0]; - Player.DelBuff(relation[0]); // Remove the alcohol - poison -= relation[1]; // Cancel the poison level - Alcohol.RemoveAt(0); - } - while (poison > 3); - } - } #endregion #region Rogue Stealth @@ -6287,6 +6301,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..df08aeb84f 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; @@ -144,15 +149,11 @@ namespace CalamityMod.CalPlayer // Handle mid-dash effects. UsedDash.MidDashEffects(Player, ref dashSpeed, ref dashSpeedDecelerationFactor, ref runSpeedDecelerationFactor); - int VerticalOmnidashCap = DashID == GodslayerArmorDash.ID ? 75 : 25; - if (UsedDash.IsOmnidirectional && VerticalOmnidashTimer < VerticalOmnidashCap) + if (UsedDash.ForceEndAt > 0) { - VerticalOmnidashTimer++; - if (VerticalOmnidashTimer >= VerticalOmnidashCap) + if (UsedDash.dashTime >= UsedDash.ForceEndAt) { Player.dashDelay = dashDelayToApply; - // Stop the player from going flying - Player.velocity *= 0.2f; } } @@ -231,7 +232,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/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index c97adf9412..290e7e6d3e 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -41,6 +41,7 @@ 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; @@ -790,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); @@ -1083,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); @@ -2229,7 +2225,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item96, Player.Center); } - if (gShell) //3 seconds of no dash reduction and reduced defense + if (gShell) { if (giantShellPostHit == 0) { @@ -2246,10 +2242,10 @@ namespace CalamityMod.CalPlayer dust.scale = Main.rand.NextFloat(1.5f, 1.2f); } } - giantShellPostHit = 180; + giantShellPostHit = GiantShell.PostHitCancelDuration; } - if (tortShell) //3 seconds of no dash reduction and reduced defense + if (tortShell) { if (tortShellPostHit == 0) { @@ -2266,7 +2262,7 @@ namespace CalamityMod.CalPlayer dust.scale = Main.rand.NextFloat(1.6f, 2.2f); } } - tortShellPostHit = 180; + tortShellPostHit = GiantTortoiseShell.PostHitCancelDuration; } if (aquaticHeartIce) @@ -2326,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) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5e33e56b73..6f769e1c50 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -218,9 +218,8 @@ namespace CalamityMod.CalPlayer // Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning. Player.nebulaLevelLife = 0; - // This has to last over 60 frames for the nurse to count the debuff, so... if (Player.whoAmI == Main.myPlayer) - Player.AddBuff(ModContent.BuffType(), 61, false); + Player.AddBuff(ModContent.BuffType(), 2, false); if (Player.lifeRegen > 0) Player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index dc820327d1..c652d14afa 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -211,22 +211,22 @@ namespace CalamityMod.CalPlayer 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); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), 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); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), 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); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), 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); + Projectile.NewProjectile(Player.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } } @@ -305,17 +305,17 @@ 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) { lastDashWasTabi = false; - } - if (((gShell && giantShellPostHit == 0) || (tortShell && tortShellPostHit == 0)) && dashStart) - { - Player.velocity.X *= 0.9f; + if ((tortShell && tortShellPostHit == 0)) + Player.velocity.X *= GiantTortoiseShell.DashVelocityMult; + if ((gShell && giantShellPostHit == 0)) + Player.velocity.X *= GiantShell.DashVelocityMult; } // Tabi/Master Ninja Gear dash change @@ -350,9 +350,9 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 4 == 0) Player.HealPlayer(1, HealTextType.None); - if (Player.dashDelay > 0) // Reduced dash cooldown + if (Player.dashDelay > 1) // Reduced dash cooldown { - Player.dashDelay = 0; + Player.dashDelay = 1; } if (Player.dashDelay == -1) { @@ -367,9 +367,9 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 5 == 0) Player.HealPlayer(2, HealTextType.None); - if (Player.dashDelay > 0) // Reduced dash cooldown + if (Player.dashDelay > 1) // Reduced dash cooldown { - Player.dashDelay = 0; + Player.dashDelay = 1; } if (Player.dashDelay == -1) { @@ -458,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; @@ -529,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); } } @@ -1829,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) { @@ -2006,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) { @@ -2068,7 +2128,7 @@ namespace CalamityMod.CalPlayer if (whitewaterHeal > 0) { - if (whitewaterHeal % 15 == 0) + if (whitewaterHeal % 20 == 0) Player.HealPlayer(1); whitewaterHeal--; @@ -2194,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) @@ -2743,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) { @@ -3411,7 +3471,7 @@ namespace CalamityMod.CalPlayer if (giantShellPostHit > 0) { - Player.statDefense -= 3; + Player.statDefense -= GiantShell.DefenseBoost; giantShellPostHit--; } if (giantShellPostHit < 0) @@ -3427,11 +3487,11 @@ namespace CalamityMod.CalPlayer if (tortShellPostHit > 0) { - Player.statDefense -= 6; + Player.statDefense -= GiantTortoiseShell.DefenseBoost; tortShellPostHit--; } else - Player.endurance += 0.05f; + Player.endurance += GiantTortoiseShell.DamageReductionBoost; if (tortShellPostHit < 0) { @@ -3449,7 +3509,7 @@ namespace CalamityMod.CalPlayer if (gloveLevel > 0) { // Determine the glove the player benefits from in priority of latest in progression - float gloveAttackSpeed = (gloveLevel == 5 ? 0.15f : gloveLevel == 4 ? 0.14f : gloveLevel == 3 ? 0.12f : gloveLevel <= 2 ? 0.10f : 0); + float gloveAttackSpeed = (gloveLevel == 5 ? 0.15f : gloveLevel == 4 ? 0.14f : gloveLevel >= 2 ? 0.12f : gloveLevel == 1 ? 0.10f : 0); Player.GetAttackSpeed() += gloveAttackSpeed; // Give the player attack speed based on the glove they have } @@ -3739,10 +3799,10 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Chilled] = true; Player.buffImmune[BuffID.Frozen] = true; - if (Player.statLife > (int)(Player.statLifeMax2 * 0.5)) - Player.GetDamage() += 0.1f; - if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) - Player.statDefense += 15; + if (Player.statLife > (int)(Player.statLifeMax2 * FrostFlare.HealthRatioThreshold)) + Player.GetDamage() += FrostFlare.DamageBoost; + else + Player.statDefense += FrostFlare.DefenseBoost; } if (vexation) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 1f4a128a71..8d80405294 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -109,15 +109,6 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffID.Electrified, 300); break; - case ItemID.BeeKeeper: - case ItemID.BladeofGrass: - target.AddBuff(BuffID.Poisoned, 240); - break; - - case ItemID.FieryGreatsword: - target.AddBuff(BuffID.OnFire3, 90); - break; - case ItemID.IceSickle: case ItemID.Frostbrand: target.AddBuff(BuffID.Frostburn2, 300); @@ -126,11 +117,6 @@ namespace CalamityMod.CalPlayer case ItemID.IceBlade: target.AddBuff(BuffID.Frostburn, 120); break; - - case (>= ItemID.BluePhaseblade and <= ItemID.YellowPhaseblade) or ItemID.OrangePhaseblade: - case (>= ItemID.BluePhasesaber and <= ItemID.YellowPhasesaber) or ItemID.OrangePhasesaber: - // TODO: find an EPIC lightsaber sound - break; } if (flameWakerBoots) @@ -272,11 +258,11 @@ namespace CalamityMod.CalPlayer switch (proj.type) { + // Remove this in 1.4.5 port case ProjectileID.ObsidianSwordfish: target.AddBuff(BuffID.OnFire3, 180); break; - case ProjectileID.InfluxWaver: case ProjectileID.UFOLaser: case ProjectileID.Electrosphere: target.AddBuff(BuffID.Electrified, 180); @@ -288,11 +274,12 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 90); break; + // Replace with Broken Armor in 1.4.5 port case ProjectileID.GolemFist: target.AddBuff(BuffType(), 180); break; - case ProjectileID.ButchersChainsaw: + // Remove this in 1.4.5 port case ProjectileID.MechanicalPiranha: target.AddBuff(BuffType(), 180); break; @@ -301,25 +288,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 180); break; - case ProjectileID.Cascade: case ProjectileID.FlamingMace: target.AddBuff(BuffID.OnFire, 60); break; - case ProjectileID.Bee: - case ProjectileID.GiantBee: - case ProjectileID.BladeOfGrass: - target.AddBuff(BuffID.Poisoned, 120); - break; - - case ProjectileID.Wasp: - target.AddBuff(BuffID.Venom, 60); - break; - - case ProjectileID.BoneArrow: - target.AddBuff(BuffType(), 300); - break; - case ProjectileID.NorthPoleWeapon: target.AddBuff(BuffID.Frostburn, 300); break; @@ -762,7 +734,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); @@ -1058,10 +1030,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++) @@ -1072,41 +1043,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) @@ -1221,12 +1158,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); @@ -1320,19 +1270,19 @@ 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); + 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), 2); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 2f); } if (ataxiaMage && hydroHealTimer <= 0) diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index eb9c5f921a..20be36951d 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -27,7 +27,8 @@ namespace CalamityMod.CalPlayer.Dashes public override bool IsOmnidirectional => true; - public int Time = 0; + public override int ForceEndAt => 75; + public float Size = 2.2f; public bool SoundOnce = true; @@ -40,7 +41,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnDashEffects(Player player) { - Time = 0; + dashTime = 0; Size = 2.2f; GSDashSlot = SoundEngine.PlaySound(DevourerofGodsHead.DeathAnimationSound, player.Center); SoundOnce = true; @@ -60,24 +61,36 @@ namespace CalamityMod.CalPlayer.Dashes if (SoundEngine.TryGetActiveSound(GSDashSlot, out var Dashsound) && Dashsound.IsPlaying) Dashsound.Position = player.Center; - Time++; Size -= 0.01f; - const int totalDashTime = 75; - // Constantly update the player's velocity direction. - float progress = MathHelper.Clamp(Time / (float)totalDashTime, 0f, 1f); + float progress = MathHelper.Clamp(dashTime / (float)ForceEndAt, 0f, 1f); float ease = 1f - (float)Math.Pow(1f - progress, 0.2f); float finalSpeed = MathHelper.Lerp(32f, 11f, ease); Vector2 dashVel = Main.MouseWorld - player.Center; - Vector2 targetDirection = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2(); - player.velocity = targetDirection * finalSpeed; + + Vector2 direction = Vector2.Zero; + if (player.controlLeft) + direction.X -= 1; + if (player.controlRight) + direction.X += 1; + if (player.controlUp) + direction.Y -= 1; + if (player.controlDown) + direction.Y += 1; + + Vector2 targetDirection = direction == Vector2.Zero ? player.velocity.SafeNormalize(Vector2.Zero) : player.velocity.ToRotation().AngleTowards(direction.ToRotation(), 0.175f).ToRotationVector2(); + + if (targetDirection == Vector2.Zero) + targetDirection = new(player.direction, 0); + + player.velocity = ((dashTime == 1 && direction != Vector2.Zero) ? direction : targetDirection) * finalSpeed; // Fall way, way, faster than usual. player.maxFallSpeed = 50f; - if (Time < 75) + if (dashTime < ForceEndAt) { Particle jaws = new Jaws(player.Center + player.velocity * 0.5f, player.velocity, Color.Fuchsia, new Vector2(0.8f, 1f), player.velocity.ToRotation() + MathHelper.PiOver2, Size, Size, 2); GeneralParticleHandler.SpawnParticle(jaws); @@ -85,11 +98,11 @@ namespace CalamityMod.CalPlayer.Dashes GeneralParticleHandler.SpawnParticle(jaws2); } - float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, Time, true)); + float radiusFactor = MathHelper.Lerp(0f, 1f, Utils.GetLerpValue(2f, 2.5f, dashTime, true)); for (int i = 0; i < 3; i++) { - float offsetRotationAngle = player.velocity.ToRotation() + Time / 20f; - float radius = (30f + (float)Math.Cos(Time / 3f) * 24f) * radiusFactor; + float offsetRotationAngle = player.velocity.ToRotation() + dashTime / 20f; + float radius = (30f + (float)Math.Cos(dashTime / 3f) * 24f) * radiusFactor; Vector2 dustPosition = player.Center + player.velocity * 0.8f; dustPosition += offsetRotationAngle.ToRotationVector2().RotatedBy(i / 5f * MathHelper.TwoPi) * radius; Dust dust = Dust.NewDustPerfect(dustPosition, Main.rand.NextBool(5) ? 181 : 295); @@ -100,7 +113,7 @@ namespace CalamityMod.CalPlayer.Dashes dust2.noGravity = true; } - if (Time % 2 == 0) + if (dashTime % 2 == 0) { float sparkscale = Size * 1.3f; Vector2 SparkVelocity1 = player.velocity.RotatedBy(player.direction * -4, default) * 0.08f - player.velocity / 2f; @@ -111,14 +124,12 @@ namespace CalamityMod.CalPlayer.Dashes GeneralParticleHandler.SpawnParticle(spark2); } - if (Time > 75 && Time < 78) + if (dashTime >= ForceEndAt) { Particle pulse = new DirectionalPulseRing(player.Center - player.velocity * 0.52f, player.velocity / 1.5f, Color.Fuchsia, new Vector2(1f, 2f), player.velocity.ToRotation(), 0.82f, 0.32f, 60); GeneralParticleHandler.SpawnParticle(pulse); Particle pulse2 = new DirectionalPulseRing(player.Center - player.velocity * 0.40f, player.velocity / 1.5f * 0.9f, Color.Aqua, new Vector2(0.8f, 1.5f), player.velocity.ToRotation(), 0.58f, 0.28f, 50); GeneralParticleHandler.SpawnParticle(pulse2); - - Time = 95; } // Dash at a much, much faster speed than the default value. diff --git a/CalPlayer/Dashes/PlayerDashEffect.cs b/CalPlayer/Dashes/PlayerDashEffect.cs index 30e515cd7f..ef477f1cf2 100644 --- a/CalPlayer/Dashes/PlayerDashEffect.cs +++ b/CalPlayer/Dashes/PlayerDashEffect.cs @@ -20,6 +20,8 @@ namespace CalamityMod.CalPlayer.Dashes public abstract bool IsOmnidirectional { get; } + public virtual int ForceEndAt { get; } = -1; + public abstract float CalculateDashSpeed(Player player); /// /// Effects that happen once when the main dash starts 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/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/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs index 5f63ba48fb..b99db87773 100644 --- a/ChatTags/CustomColorEffectHandler.cs +++ b/ChatTags/CustomColorEffectHandler.cs @@ -1,4 +1,8 @@ using System; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.Rarities; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; @@ -12,11 +16,25 @@ namespace CalamityMod.ChatTags // i.e [ceffect/darksun:Hello World] would apply darksun effect to "Hello World". public sealed class CustomColorEffectHandler : AbstractTagHandler { - protected override string[] TagNames { get; } = ["ceffect"]; + protected override string[] TagNames { get; } = ["ceffect", "ce"]; public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) { + if (!CalamityClientConfig.Instance.TextEffects) + return new TextSnippet(text); if (options.Equals("darksun", StringComparison.OrdinalIgnoreCase)) return new DarksunTextSnippet(text); + if (options.Equals("drunk", StringComparison.OrdinalIgnoreCase)) + return new DrunkTextSnippet(text); + if (options.Equals("dog", StringComparison.OrdinalIgnoreCase)) + return new DoGTextSnippet(text); + if (options.Equals("cosmic", StringComparison.OrdinalIgnoreCase)) + return new CosmicPurple.CustomTextSnippet(text); + if (options.Equals("auric", StringComparison.OrdinalIgnoreCase)) + return new BurnishedAuric.CustomTextSnippet(text); + if (options.Equals("calamity", StringComparison.OrdinalIgnoreCase)) + return new CalamityRed.CustomTextSnippet(text); + if (options.Equals("exo", StringComparison.OrdinalIgnoreCase)) + return new ExoticRainbow.CustomTextSnippet(text); return new TextSnippet(text); } } @@ -41,7 +59,94 @@ namespace CalamityMod.ChatTags } return true; } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + public sealed class DrunkTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var matrix = spriteBatch.transformMatrix; + Main.spriteBatch.End(out var ss); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, matrix); + + for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. + { + float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f; + + float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f); + float radius = timer * (3f + i * 6f); + Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern + Vector2 pos = position + offset; + + color = CalamityUtils.MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White); + float opacity = 1f - (i * 0.2f); + float rotation = +(timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended + + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, pos, color * opacity, rotation, Vector2.Zero, new Vector2(scale)); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + + public sealed class DoGTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + string txt = ""; + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + foreach (var item in text) + { + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + float sin = MathHelper.SmoothStep(0, 1, (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f); + var c = Color.Lerp(Color.Cyan, Color.Fuchsia, sin); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos + new Vector2(0, -2 + sin * 4), c, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in ChatManager.ShadowDirections) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + Vector2.TransformNormal(item * 2,matrix), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } public override float GetStringLength(DynamicSpriteFont font) { float size = font.MeasureString(text).X; 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/Items/Accessories/SkylineBobber.cs b/Items/Accessories/AcrobaticBobber.cs similarity index 88% rename from Items/Accessories/SkylineBobber.cs rename to Items/Accessories/AcrobaticBobber.cs index 47a9fea7a3..ffd5b98001 100644 --- a/Items/Accessories/SkylineBobber.cs +++ b/Items/Accessories/AcrobaticBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Fishing { - internal class SkylineBobber : ModItem, ILocalizedModType + [LegacyName("SkylineBobber")] + internal class AcrobaticBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/HeronBobber"; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Fishing public override void UpdateAccessory(Player player, bool hideVisual) { player.accFishingBobber = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.SkylineBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.AcrobaticBobber; } public override void AddRecipes() { diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index 94f56a3c97..846392ae1d 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 42; - Item.defense = 3; + Item.defense = 2; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index f81bb96832..a57a2e73d0 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 12; Item.height = 15; - Item.defense = 3; + Item.defense = 2; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 14c7c7566f..9c76adf1a9 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 44; Item.height = 108; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.accessory = true; Item.expert = true; 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/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 66d5d7aa9a..e1b1e5d4fe 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.defense = 20; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.expert = true; } 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/PerennialBobber.cs b/Items/Accessories/FeralBobber.cs similarity index 89% rename from Items/Accessories/PerennialBobber.cs rename to Items/Accessories/FeralBobber.cs index 0705e28791..908249614a 100644 --- a/Items/Accessories/PerennialBobber.cs +++ b/Items/Accessories/FeralBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class PerennialBobber : ModItem, ILocalizedModType + [LegacyName("PerennialBobber")] + internal class FeralBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/FeralDoubleBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories { player.accFishingBobber = true; player.fishingSkill += (int)((player.statLifeMax2 - player.statLife) * 0.25f); - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.PerennialBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.FeralBobber; } 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/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 647d427878..93326a9153 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,13 @@ namespace CalamityMod.Items.Accessories public class FrostFlare : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float HealthRatioThreshold = 0.5f; + public static float DamageBoost = 0.1f; + public static int DefenseBoost = 10; + public static float AccelerationBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HealthRatioThreshold.ToPercent(), DamageBoost.ToPercent(), DefenseBoost, AccelerationBoost.ToPercent()); + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4)); diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index fe575c6fd1..07a4087a9e 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,11 +10,17 @@ namespace CalamityMod.Items.Accessories public class GiantShell : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoost = 4; + public static float DashVelocityMult = 0.9f; + public static int PostHitCancelDuration = CalamityUtils.SecondsToFrames(3); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f - DashVelocityMult).ToPercent(), PostHitCancelDuration.FramesToSeconds()); + public override void SetDefaults() { Item.width = 30; Item.height = 28; - Item.defense = 5; + Item.defense = DefenseBoost; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/GiantTortoiseShell.cs b/Items/Accessories/GiantTortoiseShell.cs index 9551ffbb81..95a335be53 100644 --- a/Items/Accessories/GiantTortoiseShell.cs +++ b/Items/Accessories/GiantTortoiseShell.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,18 @@ namespace CalamityMod.Items.Accessories public class GiantTortoiseShell : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoost = 6; + public static float DamageReductionBoost = 0.1f; + public static float DashVelocityMult = 0.9f; + public static int PostHitCancelDuration = CalamityUtils.SecondsToFrames(3); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageReductionBoost.ToPercent(), (1f - DashVelocityMult).ToPercent(), PostHitCancelDuration.FramesToSeconds()); + public override void SetDefaults() { Item.width = 46; Item.height = 30; - Item.defense = 10; + Item.defense = DefenseBoost; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; 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/PlanebreakersPouch.cs b/Items/Accessories/PlanebreakersPouch.cs index 11de8740a1..30445b7dcc 100644 --- a/Items/Accessories/PlanebreakersPouch.cs +++ b/Items/Accessories/PlanebreakersPouch.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.GetDamage() += 0.15f; - player.GetCritChance() += 5; + player.GetCritChance() += 7; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.deadshotBrooch = true; diff --git a/Items/Accessories/NavystoneBobber.cs b/Items/Accessories/SunkenSinker.cs similarity index 89% rename from Items/Accessories/NavystoneBobber.cs rename to Items/Accessories/SunkenSinker.cs index e78241dccd..0563341a47 100644 --- a/Items/Accessories/NavystoneBobber.cs +++ b/Items/Accessories/SunkenSinker.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class NavystoneBobber : ModItem, ILocalizedModType + [LegacyName("NavystoneBobber")] + internal class SunkenSinker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/NavyBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.accFishingBobber = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.NavystoneBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.SunkenSinker; } 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/Vanity/LucisSight.cs b/Items/Accessories/Vanity/LucisSight.cs index df711e8b14..0afdc9724c 100644 --- a/Items/Accessories/Vanity/LucisSight.cs +++ b/Items/Accessories/Vanity/LucisSight.cs @@ -1,18 +1,22 @@ -using CalamityMod.Items.BaseItems; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class LucisSight : TransformationAccessory, ILocalizedModType + [AutoloadEquip(EquipType.Face)] + public class LucisSight : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override (EquipType, string, string)[] EquipSlots => - [ - (EquipType.Face, "LucisSight", null), - ]; + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); + ArmorIDs.Face.Sets.DrawInFaceUnderHairLayer[equipSlot] = true; + } + } public override void SetDefaults() { 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/ScoriaBobber.cs b/Items/Accessories/VolcanicSinker.cs similarity index 89% rename from Items/Accessories/ScoriaBobber.cs rename to Items/Accessories/VolcanicSinker.cs index 7ad5e649d2..6843821e45 100644 --- a/Items/Accessories/ScoriaBobber.cs +++ b/Items/Accessories/VolcanicSinker.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class ScoriaBobber : ModItem, ILocalizedModType + [LegacyName("ScoriaBobber")] + internal class VolcanicSinker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/RiftReelerBobber"; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Accessories { player.accFishingBobber = true; player.accLavaFishing = true; - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.ScoriaBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.VolcanicSinker; } public override void AddRecipes() { 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/ScrapBobber.cs b/Items/Accessories/WulfrumBobber.cs similarity index 88% rename from Items/Accessories/ScrapBobber.cs rename to Items/Accessories/WulfrumBobber.cs index 81a7444885..1a6ee66728 100644 --- a/Items/Accessories/ScrapBobber.cs +++ b/Items/Accessories/WulfrumBobber.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - internal class ScrapBobber : ModItem, ILocalizedModType + [LegacyName("ScrapBobber")] + internal class WulfrumBobber : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Fishing"; public override string Texture => "CalamityMod/Projectiles/Typeless/WulfrumBobber"; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.ScrapBobber; + player.Calamity().SelectedFishingMinigame = CalamityPlayer.FishingMinigames.WulfrumBobber; } 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/GemTech/GemTechBodyArmor.cs b/Items/Armor/GemTech/GemTechBodyArmor.cs index 29e83fc015..4e5af57b08 100644 --- a/Items/Armor/GemTech/GemTechBodyArmor.cs +++ b/Items/Armor/GemTech/GemTechBodyArmor.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 31; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 2feef341da..cc96471327 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 14; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Armor/GemTech/GemTechSchynbaulds.cs b/Items/Armor/GemTech/GemTechSchynbaulds.cs index a7d5c0fa54..84ba7d24ea 100644 --- a/Items/Armor/GemTech/GemTechSchynbaulds.cs +++ b/Items/Armor/GemTech/GemTechSchynbaulds.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 26; Item.defense = 24; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Armor/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index 5230c288c0..cefd8ea258 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -12,16 +12,16 @@ namespace CalamityMod.Items.Armor.GodSlayer { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; - public static float DamageBoost = 0.15f; - public static int CritBoost = 11; + public static float DamageBoost => 0.15f; + public static int CritBoost => 11; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); // Common Set Bonus - public static int DashCooldown = CalamityUtils.SecondsToFrames(45); - public static int DashDamage = 3000; - public static float DashKnockback = 15f; - public static int DashIFrames = 12; - public static int DashGodSlayerInfernoDuration = CalamityUtils.SecondsToFrames(5); + public static int DashCooldown => CalamityUtils.SecondsToFrames(45); + public static int DashDamage => 3000; + public static float DashKnockback => 15f; + public static int DashIFrames => 12; + public static int DashGodSlayerInfernoDuration => CalamityUtils.SecondsToFrames(5); public override void SetDefaults() { diff --git a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs index 76d20bfa39..b43f8bf6f0 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.godSlayerDamage = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index 1c5617ac58..1eff59c595 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.godSlayerRanged = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs index b5d0b638f5..c89fbe2355 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.wearingRogueArmor = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); - player.setBonus = player.setBonus.Replace("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d28cad197b..228af0877c 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -615,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) { @@ -1142,16 +1153,12 @@ namespace CalamityMod.Items if (modPlayer.gloveLevel < 1) modPlayer.gloveLevel = 1; } - if (item.type == ItemID.PowerGlove) + if (item.type == ItemID.PowerGlove || item.type == ItemID.BerserkerGlove) { - player.GetAttackSpeed() -= 0.12f; // Power Glove 10% + player.GetAttackSpeed() -= 0.12f; // Power/Berserker Glove 12% if (modPlayer.gloveLevel < 2) modPlayer.gloveLevel = 2; } - if (item.type == ItemID.BerserkerGlove) - { - player.GetAttackSpeed() -= 0.12f; // Berserker Glove 0% - } if (item.type == ItemID.MechanicalGlove) { player.GetAttackSpeed() -= 0.12f; // Mechanical Glove 12% @@ -1461,7 +1468,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 c34384f019..6a8de021c9 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -163,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; @@ -768,11 +782,14 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); if (item.type == ItemID.PowerGlove) { - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerGlove")); + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerBerserkerGlove")); EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); } if (item.type == ItemID.BerserkerGlove) - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("BerserkerGlove")); + { + EditTooltipByNum(1, (line) => line.Text = EditedTooltip("PowerBerserkerGlove")); + EditTooltipByNum(0, (line) => line.Text += AddedTooltip("TitanGloveLine")); + } if (item.type == ItemID.MechanicalGlove) EditTooltipByNum(1, (line) => line.Text = EditedTooltip("MechanicalGlove") + AddedTooltip("TitanGloveLine")); if (item.type == ItemID.FireGauntlet) @@ -1641,35 +1658,6 @@ namespace CalamityMod.Items return false; } - // IV Drip tooltip FX - if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && line.Name == "Tooltip4") - { - Vector2 basePosition = new Vector2(line.X, line.Y); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); - - for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. - { - float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f; - - float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f); - float radius = timer * (3f + i * 6f); - Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern - Vector2 pos = basePosition + offset; - - Color color = MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White); - float opacity = 1f - (i * 0.2f); - float rotation = line.Rotation + (timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended - - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, pos, color * opacity, rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); - } - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); - - return false; - } if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7")) { Color rarityColor = Color.Black; @@ -1777,60 +1765,7 @@ namespace CalamityMod.Items // Might be used for Miracle stuff later or something idk /*if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) { - Color rarityColor = Color.White; - Vector2 basePosition = new Vector2(line.X, line.Y); - - float rate = Main.GlobalTimeWrappedHourly * 29; - List eColors = new List() - { - Color.PaleVioletRed, - Color.Coral, - Color.Khaki, - Color.PaleGreen, - Color.Turquoise, - Color.Violet - }; - - int colorIndex = (int)(rate / 2 % eColors.Count); - Color currentColor = eColors[colorIndex]; - Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; - Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); - - float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi); - sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); - Vector2 backScale = line.BaseScale; - Color backColor = usedColor; - Vector2 shake = Main.rand.NextVector2Circular(15, 15) * sine; - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); - - int draws = 20; - for (int i = 0; i < draws; i++) - { - shake = Main.rand.NextVector2Circular(15, 15) * sine; - Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (5 + 0.5f * sine); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake * 4 + backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread); - } - Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Vector2 drawPosition = basePosition; - Color drawColor = backColor; - Vector2 rotationPoint = texture.Size() * 0.5f; - for (int i = 0; i < 6; i++) - { - int length = line.Text.Length; - Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(1 - 0.05f * i * (1 + 0.2f * -sine), 1 + 0.75f * i * (1 + 0.2f * sine) * 1f) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None); - } - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); - - // Draw the front text as usual. - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake + basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); - - return false; }*/ return true; } diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 0bc4a75a80..14b50af115 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -30,370 +30,362 @@ 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(UseTimeExact(22), ShootSpeedExact(10f)) }, // VANILLA: 15 UT, 6 VEL + { ItemID.BeesKnees, Do(DamageExact(21), UseExact(35)) }, // 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(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.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(41)) }, // 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(1)) }, // Magma Skull - { ItemID.MoltenCharm, Do(DefenseExact(1)) }, //Magma Charm - { ItemID.MoltenSkullRose, Do(DefenseExact(3)) }, - { ItemID.ObsidianSkullRose, Do(DefenseExact(1)) }, - { 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)) }, + // 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(58), AxePower(90), TileBoostExact(+0)) }, // VANILLA: 33 DMG, 100 AXE, -1 TILE + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, DamageExact(33), 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, DamageExact(100), 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(88), UseTimeExact(3), AxePower(120), TileBoostExact(+1)) }, // VANILLA: 50 DMG, 4 SPD, 115 AXE, 0 TILE + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, DamageExact(45), TileBoostExact(+1)) }, // VANILLA: 35 DMG, 0 TILE + { ItemID.ChlorophyteGreataxe, Do(AxePower(165), TileBoostExact(+2)) }, // VANILLA: 115 AXE, +1 TILE + { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, DamageExact(58), 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(42), UseTimeExact(4)) }, // VANILLA: 23 DMG, 7 SPD + { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, DamageExact(13), 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(62), 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(50), 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(52), UseTimeExact(4), AxePower(80)) }, // VANILLA: 29 DMG, 6 SPD, 85 AXE + { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, DamageExact(20), 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(70), 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(54), UseTimeExact(4), AxePower(80)) }, // VANILLA: 31 DMG, 5 SPD, 90 AXE + { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, DamageExact(22), 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(44), UseTimeExact(4), AxePower(70)) }, // VANILLA: 26 DMG, 7 SPD, 75 AXE + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, DamageExact(15), 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(70), 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(70), 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(60), AxePower(90), TileBoostExact(+0)) }, // VANILLA: 34 DMG, 105 AXE, -1 TILE + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, DamageExact(35), 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(70), 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/Dyes/CalamitousDye.cs b/Items/Dyes/CalamitousDye.cs index 89c33691ea..35c48b9192 100644 --- a/Items/Dyes/CalamitousDye.cs +++ b/Items/Dyes/CalamitousDye.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = Item.sellPrice(gold: 2, silver: 50); } diff --git a/Items/Dyes/ExoDye.cs b/Items/Dyes/ExoDye.cs index 1080879443..e66edbfb7a 100644 --- a/Items/Dyes/ExoDye.cs +++ b/Items/Dyes/ExoDye.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Dyes public override void SafeSetDefaults() { - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = Item.sellPrice(gold: 2, silver: 50); } diff --git a/Items/Fishing/FishingRods/RiftReeler.cs b/Items/Fishing/FishingRods/RiftReeler.cs index da0bc6e2f1..7b74df80bf 100644 --- a/Items/Fishing/FishingRods/RiftReeler.cs +++ b/Items/Fishing/FishingRods/RiftReeler.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Items.Fishing.FishingRods { Item.width = 24; Item.height = 28; - Item.useAnimation = 8; - Item.useTime = 8; + Item.useAnimation = Item.useTime = 8; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.fishingPole = 45; diff --git a/Items/Materials/AshesofAnnihilation.cs b/Items/Materials/AshesofAnnihilation.cs index 38efcdd53a..0c52d2ae91 100644 --- a/Items/Materials/AshesofAnnihilation.cs +++ b/Items/Materials/AshesofAnnihilation.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Materials Item.height = 56; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(gold: 6, silver: 66, copper: 66); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawPulsingAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float baseScale) { diff --git a/Items/Materials/ExoPrism.cs b/Items/Materials/ExoPrism.cs index 5b8c11ad99..143248da98 100644 --- a/Items/Materials/ExoPrism.cs +++ b/Items/Materials/ExoPrism.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Materials Item.height = 52; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(gold: 7); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawBackAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float baseScale) { diff --git a/Items/Materials/MiracleMatter.cs b/Items/Materials/MiracleMatter.cs index 4f7392b898..39a7fa9695 100644 --- a/Items/Materials/MiracleMatter.cs +++ b/Items/Materials/MiracleMatter.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Materials Item.height = 80; Item.maxStack = Item.CommonMaxStack; Item.value = Item.sellPrice(platinum: 1); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public void DrawBackAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, Vector2 origin, float baseScale) diff --git a/Items/Pets/BrimstoneJewel.cs b/Items/Pets/BrimstoneJewel.cs index a6b9e00e61..2009e81afd 100644 --- a/Items/Pets/BrimstoneJewel.cs +++ b/Items/Pets/BrimstoneJewel.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Pets { Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); Item.value = Item.sellPrice(gold: 20); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 6c812e8cfd..a186b15911 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(platinum: 4); - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Placeables/FurnitureDriftwood/Driftwood.cs b/Items/Placeables/FurnitureDriftwood/Driftwood.cs index f041b00d8e..17363b5acd 100644 --- a/Items/Placeables/FurnitureDriftwood/Driftwood.cs +++ b/Items/Placeables/FurnitureDriftwood/Driftwood.cs @@ -22,10 +22,14 @@ namespace CalamityMod.Items.Placeables.FurnitureDriftwood public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - DisableDecraft(). - Register(); + AddIngredient(2). + DisableDecraft(). + Register(); + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 1fcd4d64cf..231f2c2d19 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Alcohol; +using System; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; @@ -11,9 +12,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class GrapeBeer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - - public static float CritLoss = 50; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritLoss); + public static float CloseRangeDistance = 80; + public static float LongRangeDistance = 1200; + public static float CloseRangeDamage = 0.75f; + public static float LongRangeDamage = 0.25f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(LongRangeDamage,LongRangeDistance/16f); public override void SetStaticDefaults() { diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 11496ee727..b184457a0b 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -50,18 +50,10 @@ namespace CalamityMod.Items.Potions public override void AddRecipes() { CreateRecipe(15). - AddIngredient(ItemID.BottledWater, 15). + AddIngredient(ItemID.SuperManaPotion, 15). AddIngredient(4). AddIngredient(). - AddTile(TileID.AlchemyTable). - AddConsumeIngredientCallback(Recipe.IngredientQuantityRules.Alchemy). - Register(); - - CreateRecipe(15). - AddIngredient(ItemID.BottledWater, 15). - AddIngredient(5). - AddIngredient(). - AddTile(TileID.AlchemyTable). + AddTile(TileID.Bottles). Register() .DisableDecraft(); } diff --git a/Items/Potions/Food/Baguette.cs b/Items/Potions/Food/Baguette.cs index 862d4a1da9..d245dca640 100644 --- a/Items/Potions/Food/Baguette.cs +++ b/Items/Potions/Food/Baguette.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Potions; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -12,9 +13,10 @@ namespace CalamityMod.Items.Potions.Food { public new string LocalizationCategory => "Items.Potions"; - public static int RedWineBuffedHealValue = 250; - public static int RedWineBuffedRegenLoss = 4; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RedWineBuffedHealValue, RedWineBuffedRegenLoss.ToRegenPerSecond()); + public static int RedWineHealValue = 200; + public static int RedWineRegenLoss = 4; + public static int RedWineRegenLossDuration = CalamityUtils.SecondsToFrames(15); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RedWineRegenLoss.ToRegenPerSecond()); public override void SetStaticDefaults() { @@ -28,6 +30,20 @@ namespace CalamityMod.Items.Potions.Food ItemID.Sets.IsFood[Type] = true; } + public override void UpdateInventory(Player player) + { + if (player.HasBuff()) + { + Item.healLife = RedWineHealValue; + Item.potion = true; + } + else + { + Item.healLife = 0; + Item.potion = false; + } + } + public override void SetDefaults() { Item.DefaultToFood(52, 38, BuffID.WellFed, CalamityUtils.MinutesToFrames(5)); @@ -45,7 +61,8 @@ namespace CalamityMod.Items.Potions.Food { // 5 minutes for both player.AddBuff(BuffID.WellFed, Item.buffTime); - player.AddBuff(ModContent.BuffType(), Item.buffTime); + if (player.HasBuff()) + player.AddBuff(ModContent.BuffType(), RedWineRegenLossDuration); } public override void AddRecipes() diff --git a/Items/SummonItems/CeremonialUrn.cs b/Items/SummonItems/CeremonialUrn.cs index d0e5bfa47e..6362c8f695 100644 --- a/Items/SummonItems/CeremonialUrn.cs +++ b/Items/SummonItems/CeremonialUrn.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.SummonItems { Item.width = 34; Item.height = 54; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 636fbc944a..4e8ffccdb8 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Tools public new string LocalizationCategory => "Items.Tools"; public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/MarniteObliteratorUse") { PitchVariance = 0.3f }; - public static int ArmorPenetration = 5; + public static int ArmorPenetration = 15; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration); public override void SetDefaults() diff --git a/Items/Tools/WulfrumDrill.cs b/Items/Tools/WulfrumDrill.cs index 99ac145eee..a7e47e03ea 100644 --- a/Items/Tools/WulfrumDrill.cs +++ b/Items/Tools/WulfrumDrill.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Tools @@ -10,12 +11,15 @@ namespace CalamityMod.Items.Tools public class WulfrumDrill : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Tools"; + public static int ArmorPenetration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration); public override void SetDefaults() { Item.width = 46; Item.height = 38; Item.damage = 5; Item.DamageType = DamageClass.Melee; + Item.ArmorPenetration = ArmorPenetration; Item.pick = 35; Item.tileBoost += 1; Item.useAnimation = 16; diff --git a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs index 6aa71e69b2..3e47eb756f 100644 --- a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs +++ b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal @@ -21,6 +22,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public static readonly SoundStyle Sound1 = new("CalamityMod/Sounds/Item/ShrimpSound1"); public static readonly SoundStyle Sound2 = new("CalamityMod/Sounds/Item/ShrimpSound2"); public static readonly SoundStyle Surprise = new("CalamityMod/Sounds/Item/ShrimpSurprise"); + + public static int ArmorPenetration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration); + public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); @@ -29,6 +34,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.height = 32; Item.shootSpeed = 10f; Item.damage = 24; + Item.ArmorPenetration = ArmorPenetration; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.HoldUp; 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/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/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 5b215872ec..659af3c9b6 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Magic/HyperdeathRiftScepter.cs b/Items/Weapons/Magic/HyperdeathRiftScepter.cs index f8978a184f..2a2bd2e163 100644 --- a/Items/Weapons/Magic/HyperdeathRiftScepter.cs +++ b/Items/Weapons/Magic/HyperdeathRiftScepter.cs @@ -16,11 +16,6 @@ namespace CalamityMod.Items.Weapons.Magic public class HyperdeathRiftScepter : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetStaticDefaults() { Item.staff[Type] = true; diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index 8126a4a72f..8ed8097342 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Magic public class IonBlaster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + + public static int ArmorPenetration = 40; + public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -20,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 68; Item.height = 38; Item.damage = 24; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.useAnimation = 7; diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index f0f2663dd6..40fa87bb55 100644 --- a/Items/Weapons/Magic/PrimordialEarth.cs +++ b/Items/Weapons/Magic/PrimordialEarth.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic { public new string LocalizationCategory => "Items.Weapons.Magic"; - public static int BuffDefenseBoost = 12; + public static int BuffDefenseBoost = 4; public static float BuffDamageBoost = 0.12f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDefenseBoost, BuffDamageBoost.ToPercent()); diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 0f21e8bc20..c6784b6a12 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item84; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 72df4ffb67..0e330fb229 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16.5f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index b4ea614361..25647e0b5a 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo projSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) 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/Basher.cs b/Items/Weapons/Melee/Basher.cs index 99890c2b25..17e7676ecb 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 85; + Item.damage = 77; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 928c535962..eb971fdb5b 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.shoot = ProjectileType(); Item.shootSpeed = 9f; - Item.rare = RarityType(); + Item.rare = RarityType(); } public override bool CanShoot(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/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/MawOfInfinity.cs b/Items/Weapons/Melee/MawOfInfinity.cs index 1cfcd0745f..32073b2d56 100644 --- a/Items/Weapons/Melee/MawOfInfinity.cs +++ b/Items/Weapons/Melee/MawOfInfinity.cs @@ -20,10 +20,6 @@ namespace CalamityMod.Items.Weapons.Melee { base.SetStaticDefaults(); } - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetDefaults() { Item.width = 78; diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index ca5701977f..568e60509b 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 1f; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs index aeeb946f60..f5c2304a8f 100644 --- a/Items/Weapons/Melee/SpineOfThanatos.cs +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = Item.height = 28; Item.damage = 128; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Melee/StygianShield.cs b/Items/Weapons/Melee/StygianShield.cs index 53f56777d9..ef54c26f90 100644 --- a/Items/Weapons/Melee/StygianShield.cs +++ b/Items/Weapons/Melee/StygianShield.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee public static readonly SoundStyle ShieldCatchSound = new("CalamityMod/Sounds/Item/StygianCatch"); // Held stats - public const int HeldDefense = 16; + public const int HeldDefense = 8; public const int DisableDashDuration = 90; public int ThrownShieldID = ModContent.ProjectileType(); 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/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 274426a673..25c24004a0 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -20,8 +20,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void ModifyTooltips(List tooltips) { tooltips.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); - if (!Main.zenithWorld) - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); } public override void SetStaticDefaults() diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 36b0850ef5..0082fe6841 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Melee public static float ColdAttunement_ThirdSwingBoost = 1.25f; public static float ColdAttunement_MistDamageReduction = 0.11f; - public static int HotAttunement_BaseDamage = 126; + public static int HotAttunement_BaseDamage = 115; public static int HotAttunement_PlayerShredIFrames = 8; public static float HotAttunement_ShotDamageBoost = 4.5f; public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3 - public static int HolyAttunement_BaseDamage = 84; + public static int HolyAttunement_BaseDamage = 88; public static float HolyAttunement_BaseSwingDamageMult = 0.5f; public static float HolyAttunement_FullSwingDamageMult = 1f; public static float HolyAttunement_ThrowDamageBoost = 3f; diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index 22c0b05054..50406f0118 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.channel = true; 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/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index 6c34e7b8ae..0bf1b87ca8 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -42,8 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // The holdout deals 1.5x base damage. - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), (int)(damage * 1.5), knockback, player.whoAmI); + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index b0a3d62c15..6782f1e87a 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 42c7c55d87..0c39c5de41 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; Item.useTurn = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 4c6c6151ff..c575c6c3e8 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -18,14 +18,16 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public int SineCounter = 0; + public static int ArmorPenetration = 20; public static int AmmoSavedPercent = 80; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration, AmmoSavedPercent); public override void SetDefaults() { Item.width = 56; Item.height = 24; Item.damage = 75; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; Item.useTime = 1; Item.useAnimation = 4; @@ -57,7 +59,7 @@ 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, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); + Projectile.NewProjectile(source, position, helixVel, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, 1); } } 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)); diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 27c689dd12..9762ad4903 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Rocket; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override Vector2? HoldoutOffset() => new Vector2(-30, -10); diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index 11a20c6147..8edfcfc403 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.noUseGraphic = true; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Ranged/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs index 331eec6798..fa94b9ccb1 100644 --- a/Items/Weapons/Ranged/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -20,6 +20,9 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/PolarisShot") { Volume = 0.6f }; public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f }; + + public static int ArmorPenetration = 15; + public override void SetStaticDefaults() { ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; @@ -31,11 +34,9 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 36; Item.height = 34; Item.damage = 35; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; - - Item.useTime = 9; - Item.useAnimation = 9; - + Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0.5f; @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; } - public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal")); + public override void ModifyTooltips(List list) => list.FindAndReplace("[GFB]", this.GetLocalization(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal").Format(ArmorPenetration)); public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -129,7 +130,7 @@ namespace CalamityMod.Items.Weapons.Ranged SoundEngine.PlaySound(Shot, player.Center); for (int i = 0; i < (Happy ? 3 : 1); i++) - Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ShotNumber); + Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), type, damage, knockback, player.whoAmI, 0f, ShotNumber); if (ShotNumber >= 2) // Cycle the shot color ShotNumber = 0; diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 69a4afb43a..e3e4ed312b 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -58,8 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 100; Item.DamageType = DamageClass.Ranged; Item.crit = 21; - Item.useTime = 10; - Item.useAnimation = 10; + Item.useTime = Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; @@ -124,8 +123,8 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - // The holdout deals 2x base damage. - Projectile.NewProjectile(source, position, velocity, Item.shoot, damage * 2, knockback, player.whoAmI); + // The holdout deals 1.5x base damage. + Projectile.NewProjectile(source, position, velocity, Item.shoot, (int)(damage * 1.5), knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 11784019ce..95bb662349 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.knockBack = 8f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index ae859ea8b6..4a698709e7 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -18,14 +18,16 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public int SineCounter = 0; + public static int ArmorPenetration = 200; public static int AmmoSavedPercent = 80; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ArmorPenetration, AmmoSavedPercent); public override void SetDefaults() { Item.width = 60; Item.height = 26; Item.damage = 232; + Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Ranged; Item.useTime = 1; Item.useAnimation = 4; @@ -61,9 +63,9 @@ 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, 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); + Projectile.NewProjectile(source, position, helixVel1, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 2f); + Projectile.NewProjectile(source, position, helixVel2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 4f); + Projectile.NewProjectile(source, position, helixVel3, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0, 3f); } 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); diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index fc33f30846..d3978f6ae7 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -12,6 +12,11 @@ namespace CalamityMod.Items.Weapons.Ranged public class TheJailor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public override void SetStaticDefaults() + { + ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + } public override void SetDefaults() { Item.width = 102; @@ -23,12 +28,11 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 8f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); 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/ThreadOfEradication.cs b/Items/Weapons/Ranged/ThreadOfEradication.cs index e7b0499bac..cde4b30f11 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,15 +17,16 @@ namespace CalamityMod.Items.Weapons.Ranged public class ThreadOfEradication : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void ModifyTooltips(List tooltips) + + public override void SetStaticDefaults() { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); + CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true; } public override void SetDefaults() { Item.width = 40; Item.height = 82; - Item.damage = 2570; + Item.damage = 1500; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; 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/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 2af3d2b3dc..7e37c4614f 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.autoReuse = true; Item.noMelee = true; diff --git a/Items/Weapons/Rogue/DimensionTearingDisk.cs b/Items/Weapons/Rogue/DimensionTearingDisk.cs index 4a4aeb869d..762b079e8d 100644 --- a/Items/Weapons/Rogue/DimensionTearingDisk.cs +++ b/Items/Weapons/Rogue/DimensionTearingDisk.cs @@ -35,11 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = Speed; } - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); 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/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index 6004817676..36c30b998f 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override float StealthDamageMultiplier => 0.3f; diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index cd5c882622..d2c1e803d4 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; } diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index abcaa7fee0..81900bf511 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.DamageType = RogueDamageClass.Instance; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override float StealthDamageMultiplier => 0.7f; diff --git a/Items/Weapons/Rogue/TheAtomSplitter.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs index 7372b085b7..7b43424195 100644 --- a/Items/Weapons/Rogue/TheAtomSplitter.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } 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/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index f8c8a5a9d7..309102e5a2 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item117; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs index 159b5cb614..c3d384a302 100644 --- a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs +++ b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 10f; Item.noUseGraphic = true; Item.DamageType = DamageClass.Summon; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.sentry = true; } diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 37ff1d6a4a..c2b8cc8f03 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 10; 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/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/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index d608c2d761..f9a539f18b 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.DD2_EtherianPortalOpen; } 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/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index ebd6932831..b49cbc32e8 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } 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/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 5ad1a5cec5..e71c91306d 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -93,11 +93,6 @@ namespace CalamityMod.Items.Weapons.Summon return false; } public override bool AltFunctionUse(Player player) => true; - - public override void ModifyTooltips(List tooltips) - { - tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback")+1,new(Mod,"Minions",CalamityUtils.GetText("Common.MinionSlotCost").Format(4))); - } } #endregion diff --git a/Items/Weapons/Summon/VoidEaterMarionette.cs b/Items/Weapons/Summon/VoidEaterMarionette.cs index 4bfb783090..cbcd6952e3 100644 --- a/Items/Weapons/Summon/VoidEaterMarionette.cs +++ b/Items/Weapons/Summon/VoidEaterMarionette.cs @@ -19,11 +19,6 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public bool FocusFetch = false; - - public override void ModifyTooltips(List tooltips) - { - tooltips.FindAndReplaceAll("ff00ff", Utils.Hex3(DevourerofGodsHead.SpecialMoveColor)); - } public override void SetDefaults() { Item.width = 68; 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 f2870cf583..afe87854fb 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -45,7 +45,7 @@ FireballBuff: { GrapeBeerBuff: { DisplayName: Grape Beer - Description: Ranged projectiles gain homing, reduced critical strike damage + Description: Ranged projectiles gain homing, reduced damage to distant foes } ManhattanBuff: { @@ -76,6 +76,7 @@ OldFashionedBuff: { RedWineBuff: { DisplayName: Red Wine Description: Increased vertical speed, reduced flight time + ItemTooltip: Causes Baguette to heal 200 HP, but reduce regeneration by 2 HP/s for 15 seconds } RumBuff: { @@ -674,7 +675,7 @@ AstralInjectionBuff: { BaguetteBuff: { DisplayName: Baguette - Description: Goes well with Red Wine + Description: Life regeneration reduced by 2 HP/s } BloodfinBoost: { @@ -1068,7 +1069,7 @@ Bane: { Description: An ancient curse envelops you ItemTooltipEnemy: ''' - Typeless - 45 DPS + Typeless - 20 DPS Does not scale with debuff multipliers Scales based on your critical strike chance ''' @@ -1126,12 +1127,6 @@ GalvanicCorrosion: { ItemTooltipEnemy: Slows enemies } -GlacialState: { - DisplayName: Glacial State - Description: Cannot move - ItemTooltipEnemy: Freezes enemies -} - IcarusFolly: { DisplayName: Icarus' Folly Description: @@ -1209,7 +1204,7 @@ WitherDebuff: { Withered... Defense decreased by {0} ''' - ItemTooltipPlayer: Decreases defense + ItemTooltipEnemy: Decreases defense } // Summons diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index 8b0a31d46e..9868158c52 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -12,6 +12,7 @@ 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 @@ -23,6 +24,7 @@ AbyssBreathLevel2: Moderately reduces breath loss in the abyss AbyssBreathLevel3: Greatly reduces breath loss in the abyss AlcoholWarning: Drinking more than 3 different alcohols might not end well with your liver ArmorPenetration: Ignores {0} points of enemy Defense +AverageDamageInfo: This weapon scales with the average of all your damage stats CanMineUelibloom: Can mine Uelibloom Ore NotConsumable: Not consumable SummonTagDamageFlat: "{0} summon tag damage" 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.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 2d1acc5e80..0304455274 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -189,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 ''' @@ -756,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.] ''' } @@ -783,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 ''' } @@ -803,8 +815,8 @@ FrostFlare: { ''' 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 + Being above {0}% life grants {1}% increased damage + Being below {0}% life grants {2} defense and {3}% increased max movement speed and acceleration Grants resistance against cold attacks ''' } @@ -843,8 +855,8 @@ GiantShell: { DisplayName: Giant Shell Tooltip: ''' - 10% reduced dash velocity - Taking a hit restores dash velocity and reduces defense for 3 seconds + {0}% reduced dash velocity + Taking a hit restores dash velocity and reduces defense for {1} seconds ''' } @@ -853,8 +865,8 @@ GiantTortoiseShell: { Tooltip: ''' {$Common.KnockbackImmunity} - 5% increased damage reduction and 10% reduced dash velocity - Taking a hit restores dash velocity and reduces defense and damage reduction for 3 seconds + {0}% increased damage reduction and {1}% reduced dash velocity + Taking a hit restores dash velocity and reduces defense and damage reduction for {2} seconds ''' } @@ -1020,7 +1032,7 @@ IVDripOnTheRocks: { Multiplies all weapon damage by {1}x Counts as an alcohol stack toward Alcohol Poisoning {$Common.AlcoholWarning} - '(drunken mumbling)' + [ceffect/drunk:'(drunken mumbling)'] ''' } @@ -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 ''' } @@ -1299,7 +1320,7 @@ PlanebreakersPouch: { DisplayName: Planebreaker's Pouch Tooltip: ''' - 15% increased ranged damage, 5% increased ranged critical strike chance and 20% reduced ammo usage + 15% increased ranged damage, 7% increased ranged critical strike chance and 20% reduced ammo usage Grants a 20% chance to not consume arrows Pressing [KEY] will automatically swap the ammos in your ammo slots The ammo type swapped depends on the ammo of the weapon you are holding @@ -1660,7 +1681,7 @@ SpringStool: { DisplayName: Spring Stool Tooltip: ''' - Hold Up to reach higher + 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 @@ -2013,6 +2034,21 @@ 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: @@ -2055,7 +2091,7 @@ VoidofCalamity: { Tooltip: ''' 12% increased damage - Brimstone fire rains down after getting hit + Calamitous flames rain down while invincible ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 0c6da2395a..26c714ad61 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -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: { @@ -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 is 20% more efficent + Releasing charge in this way is 20% more efficient ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index b55af2186e..7d07b1699f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -422,10 +422,10 @@ GodSlayerChestplate: { Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Press {0} to [c/ff00ff:Dimensional Drive] towards your cursor for 2 seconds + Press {0} to [ceffect/dog:Dimensional Drive] towards your cursor for 2 seconds Enemies you dash through take massive damage - During [c/ff00ff:Dimensional Drive] you are immune to damage and most debuffs - [c/ff00ff:Dimensional Drive] has a {1} second cooldown + During [ceffect/dog:Dimensional Drive] you are immune to damage and most debuffs + [ceffect/dog:Dimensional Drive] has a {1} second cooldown ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index ebc986797d..4070a1c761 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -1,4 +1,4 @@ -// Quest fish tooltips +// Quest fish tooltips CaughtInAstral: Caught in the Astral Infection CaughtInBrimstoneCrag: Caught in the Brimstone Crag CaughtInSnow: Caught in Tundra @@ -344,8 +344,8 @@ RiftReeler: { DisplayName: Rift Reeler Tooltip: ''' - Fires four lines at once - Can fish in lava + Fires four lines at once. Bobbers deal damage upon contact with enemies + Allows fishing in lava 'The battlefield is a scene of constant chaos. The winner will be the one who controls that chaos, both the pole and the fish.' ''' @@ -355,7 +355,7 @@ SlurperPole: { DisplayName: Slurper Pole Tooltip: ''' - Can fish in lava + Allows fishing in lava 'It is the burning lava of the soul that has a furnace within--a very volcano of grief and sorrow.' ''' } @@ -364,7 +364,7 @@ TheDevourerofCods: { DisplayName: The Devourer of Cods Tooltip: ''' - Fires ten lines at once. Line never snaps and can fish from lava + Fires ten lines at once. Line never breaks and allows fishing in lava Hooked items stay hooked forever Common fish are automatically consumed while fishing Consuming fish allows a bobber to hook a new item and feeds the user @@ -397,29 +397,7 @@ GrandMarquisBait: { } // Bobbers -ScrapBobber: { - DisplayName: Wulfrum Bobber - Tooltip: - ''' - Provides a fishing minigame - Hold movement inputs in the indicated directions while fishing to catch items - The rod empowers the longer you go without a mistake, speeding it up - 'There's supposed to be a fish finder installed, but it only beeps when you point it at yourself...' - ''' -} - -NavystoneBobber: { - DisplayName: Sunken Sinker - Tooltip: - ''' - {$ItemTooltip.FishingBobber} - Provides a fishing minigame - The bobber will float at your height underwater, allowing underwater fishing - Move in the indicated direction while fishing to catch items - ''' -} - -SkylineBobber: { +AcrobaticBobber: { DisplayName: Acrobatic Bobber Tooltip: ''' @@ -432,7 +410,7 @@ SkylineBobber: { ''' } -PerennialBobber: { +FeralBobber: { DisplayName: Feral Bobber Tooltip: ''' @@ -444,7 +422,18 @@ PerennialBobber: { ''' } -ScoriaBobber: { +SunkenSinker: { + DisplayName: Sunken Sinker + Tooltip: + ''' + {$ItemTooltip.FishingBobber} + Provides a fishing minigame + The bobber will float at your height underwater, allowing underwater fishing + Move in the indicated direction while fishing to catch items + ''' +} + +VolcanicSinker: { DisplayName: Volcanic Sinker Tooltip: ''' @@ -456,3 +445,14 @@ ScoriaBobber: { When bobbers touch a rift, they automatically reel in the item within ''' } + +WulfrumBobber: { + DisplayName: Wulfrum Bobber + Tooltip: + ''' + Provides a fishing minigame + Hold movement inputs in the indicated directions while fishing to catch items + The rod empowers the longer you go without a mistake, speeding it up + 'There's supposed to be a fish finder installed, but it only beeps when you point it at yourself...' + ''' +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index a4c20d91d5..f87aed0533 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -22,6 +22,7 @@ Baguette: { Tooltip: ''' {$CommonItemTooltip.MinorStats} + Goes well with [cbuff:CalamityMod/RedWineBuff] [c/FCE391:'je suis Monte'] ''' } @@ -241,7 +242,8 @@ GrapeBeer: { Tooltip: ''' Bullets, Arrows, Darts, and Rockets gain homing - {0}% reduced critical strike damage + Projectiles deal less damage the further the enemy is + This reaches a minimum of {0}x damage at {1} tiles away {$Common.AlcoholWarning} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 52b51c52c4..8423bc9f44 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -71,7 +71,7 @@ CosmicWorm: { ''' Summons the Devourer of Gods {$Common.NotConsumable} - 'The Nameless Serpent has set out for you.' + [ceffect/dog:'The Nameless Serpent has set out for you.'] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 0719eba5fb..935171ee91 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -390,7 +390,7 @@ WulfrumDiggingTurtle: { WulfrumDrill: { DisplayName: Wulfrum Drill - Tooltip: "" + Tooltip: "{$Common.ArmorPenetration}" } WulfrumScaffoldKit: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 0ab28aaaf8..2d89a62599 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -18,6 +18,7 @@ AqueousHunterDrone: { while holding any summon weapon to command the shrimp to launch a vertical missile barrage Vertical missiles aim towards your cursor and leave a lingering blast if they hit solid ground Each shrimp uses 4 minion slots + {$Common.ArmorPenetration} [c/1FFBFF:'When pursuing the adherents of gods, Yharim believed no stone should be left unturned.] [c/1FFBFF:Weaponry for underwater contingencies was an unusually heavy focus, but no models ever saw deployment.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 2081186560..ce22045fcb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -202,6 +202,7 @@ 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 the [cbuffplr:CalamityMod/CoralSymbiosis] buff @@ -436,7 +437,7 @@ Heresy: { HyperdeathRiftScepter: { DisplayName: Hyperdeath Rift Scepter - Tooltip: Tears space in two with [c/ff00ff:Hyperdeath Rift Ripper] + Tooltip: Tears space in two with [ceffect/dog:Hyperdeath Rift Ripper] } HyphaeRod: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index a461ca580e..1d68029706 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -849,8 +849,8 @@ MawOfInfinity: { ''' Swings a blade forged from the Devourer's maw in a 3-swing combo The first swing only hits close range - The second swing additionally launches [c/ff00ff:Faith Incinerator] - The third swing unleashes [c/ff00ff:Divinity Devourer] at your cursor, exploding for massive damage + The second swing additionally launches [ceffect/dog:Faith Incinerator] + The third swing unleashes [ceffect/dog:Divinity Devourer] at your cursor, exploding for massive damage ''' } @@ -878,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: { @@ -1380,7 +1380,7 @@ TheObliterator: { {$Common.YoyoStatsInfinite} [GFB] ''' - TooltipNormal: Occasionally performs a miniature [c/ff00ff:Dimensional Drive] at nearby foes + TooltipNormal: Occasionally performs a miniature [ceffect/dog:Dimensional Drive] at nearby foes TooltipGFB: just a slight bit of dust spam on this weapon im afraid } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 3afeaa551b..15068882bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -603,10 +603,10 @@ Hydra: { DisplayName: Hydra Tooltip: ''' - Fires a spread of 4 [cbuff:Venom] bullets + Fires a spread of 3 blood globs imbued with [cbuff:Venom] 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 + Press to launch the heads for powerful explosive damage, briefly inflicting [cbuff:CalamityMod/GalvanicCorrosion] [c/9D80B0:Fusion of heavy machinery and Lernaean blood] ''' } @@ -616,7 +616,8 @@ Infinity: { Tooltip: ''' Fires a twin stream of energy bolts that split - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'They say infinity is neverending, yet you hold it in your hands' ''' } @@ -925,12 +926,14 @@ PolarisParrotfish: { ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy + {$Common.ArmorPenetration} 'It carries the mark of the Northern Star' ''' TooltipGFB: ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy + {$Common.ArmorPenetration} to give the little girl some attention 'She is a happy girl' ''' @@ -1303,7 +1306,8 @@ Svantechnical: { Tooltip: ''' Fires a trinity of energy bolts that split into beams that track your cursor - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'The age old balance of trading damage for frames' ''' } @@ -1406,9 +1410,9 @@ ThreadOfEradication: { DisplayName: Thread of Eradication Tooltip: ''' - Charges up [c/ff00ff:God's Bane Doombeam] - Channelling the weapon causes it to charge up [c/ff00ff:Hyperdeath Rift] instead - While charging [c/ff00ff:Hyperdeath Rift], the bow's turning speed is slowed down + Charges up [ceffect/dog:God's Bane Doombeam] + Channelling the weapon causes it to charge up [ceffect/dog:Hyperdeath Rift] instead + While charging [ceffect/dog:Hyperdeath Rift], the bow's turning speed is slowed down ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 842ac26def..3896c3f79d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -308,7 +308,7 @@ DimensionTearingDisk: { Tooltip: ''' Throws a disk that tears space in the direction of the nearest enemy - Stealth strikes stick to enemies and unleash [c/ff00ff:God's Bane Doombeam Array] + Stealth strikes stick to enemies and unleash [ceffect/dog:God's Bane Doombeam Array] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index b1754ae9aa..d9d34f5463 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -902,7 +902,7 @@ VoidEaterMarionette: { ''' Contains the power to control a miniature Devourer Repeated summons increase the length and power of the Devourer - The Devourer attacks with [c/ff00ff:Divinity Devourer], [c/ff00ff:Faith Incinerator] and [c/ff00ff:Ultracosmic Maelstrom] + The Devourer attacks with [ceffect/dog:Divinity Devourer], [ceffect/dog:Faith Incinerator] and [ceffect/dog:Ultracosmic Maelstrom] Can play fetch with dropped items Shift- this item in your inventory when the Devourer has been spawned to prioritize fetching ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index a93cf238be..6f25f07e11 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -3,7 +3,7 @@ Aestheticus: { Tooltip: ''' Fires crystals that explode and inflict [cbuff:CalamityMod/Vaporfied] - This weapon scales with all your damage stats at once + {$Common.AverageDamageInfo} ''' } @@ -17,6 +17,7 @@ ClaretCannon: { 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 + {$Common.AverageDamageInfo} ''' } @@ -31,7 +32,7 @@ EyeofMagnus: { ''' Fires seeking cosmic masses that restore health and mana on hit Explodes into a nebula cloud which reduces enemy protection - This weapon scales with the average of all your damage stats + {$Common.AverageDamageInfo} ''' } @@ -40,7 +41,7 @@ LunicEye: { Tooltip: ''' Fires seeking energy bolts that reduce enemy protection - This weapon scales with the average of all your damage stats + {$Common.AverageDamageInfo} ''' } @@ -55,6 +56,7 @@ RelicOfDeliverance: { Being inside tiles for too long will warp you back to where you entered Press to dismount Holding out the spear heavily reduces the damage of all summons + {$Common.AverageDamageInfo} [c/FF8C00:Vengeance fueled me, I had no thought other than exactment.] [c/FF8C00:The dragon took everything from me, leaving my broken pieces strewn on the ground.] [c/FF8C00:But when I danced by Her side, I knew there was still something worth fighting for.] @@ -83,6 +85,7 @@ StratusSphere: { Influenced players gain Starbursts over time and will consume Starbursts to fly when out of flight time to cause Starbursts to form a barrier, causing you to lose Starbursts instead of health Launching the singularity deactivates the barrier, and creating a barrier deactivates the singularity + {$Common.AverageDamageInfo} 'Channeling souls into stars, an inane concept' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index da3390cf62..ac7691f508 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -190,7 +190,7 @@ Stormlion.DisplayName: Stormlion StormlionSentry.DisplayName: Stormlion Sentry Sunskater.DisplayName: Sunskater SuperDummyNPC.DisplayName: Super Dummy -WildBumblefuck.DisplayName: Draconic Swarmer +WildBumblebirb.DisplayName: Draconic Swarmer WulfrumAmplifier.DisplayName: Wulfrum Amplifier WulfrumDrone.DisplayName: Wulfrum Drone WulfrumGyrator.DisplayName: Wulfrum Gyrator @@ -561,7 +561,6 @@ SeaKing: { } } -WildBumblebirb.DisplayName: Wild Bumblebirb DraconicSwarmer.DisplayName: Draconic Swarmer Dragonfolly.DisplayName: Dragonfolly Shoreskipper.DisplayName: Shoreskipper diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index c394d0ba93..80ab9a0ac6 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -63,9 +63,9 @@ DoGBeam.DisplayName: Portal Laser DoGBeamPortal.DisplayName: Beam Portal DoGDeath.DisplayName: Death Beam DoGDeathBoom.DisplayName: Cosmic Explosion -DoGFire.DisplayName: Faith Incinerator -DoGLaserWalls.DisplayName: God's Bane Doombeam Array -DoGLaserWallsBigBeam.DisplayName: Hyperdeath Rift Ripper +DoGFire.DisplayName: "[ceffect/dog:Faith Incinerator]" +DoGLaserWalls.DisplayName: "[ceffect/dog:God's Bane Doombeam Array]" +DoGLaserWallsBigBeam.DisplayName: "[ceffect/dog:Hyperdeath Rift Ripper]" DoGP1EndPortal.DisplayName: Portal DoGRiftCrack.DisplayName: DoG Distortion Crack DoGTeleportRift.DisplayName: DoG Distortion Rift 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.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 0aee56e272..64cc2b8975 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -178,7 +178,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.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 3c03ba6f79..51297508f0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -136,7 +136,7 @@ SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye SpringStoolFX.DisplayName: Spring Stool -StandingFire.DisplayName: Flame +StandingFire.DisplayName: Calamitous Flame StarStruckWaterBottle.DisplayName: Bottle StepStoolBonusFX.DisplayName: Step Stool Bonus StickyFeatherAero.DisplayName: Feather @@ -153,6 +153,7 @@ TitanHeartBoom.DisplayName: Titan Heart Boom TransformerAura.DisplayName: Transformer Aura TransformerBlob.DisplayName: Transformer Shard UrsaSlash.DisplayName: Ursa Slash +V8000SoulVisual.DisplayName: V8000 Soul VerstaltiteBobber.DisplayName: Verstaltite Bobber VictideBarrier.DisplayName: Tidal Barrier VictideBobber.DisplayName: Snail Bobber diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 1e0d926ef4..dd505cfd52 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -61,10 +61,10 @@ Dragonfire1: "{0}'s ashes scatter in the wind." Dragonfire2: "{0}'s embers fade away in a warm glow." Dragonfire3: "{0} can no longer feel the heat of the dragonfire." Dragonfire4: This was a fight {0} could not win. -DimensionalDrive: "{0} was blasted apart into space dust by the Dimensional Drive." -DivinityDevourer1: "{0} fell victim to the Divinity Devourer." -DivinityDevourer2: "{0} was consumed by the Divinity Devourer." -DivinityDevourer3: "{0}'s essence was snuffed by the Divinity Devourer." +DimensionalDrive: "{0} was blasted apart into space dust by [ceffect/dog:Dimensional Drive]." +DivinityDevourer1: "{0} fell victim to [ceffect/dog:Divinity Devourer]." +DivinityDevourer2: "{0} was consumed by [ceffect/dog:Divinity Devourer]." +DivinityDevourer3: "{0}'s essence was snuffed by [ceffect/dog:Divinity Devourer]." ElementalMix1: "{0} was reduced to technicolor confetti." ElementalMix2: "{0} was blasted apart by a harmonized elemental onslaught." ElementalMix3: "{0} was overwhelmed by elemental turbulence." @@ -110,8 +110,8 @@ SulphuricPoisoning1: "{0} was melted by the toxic waste." SulphuricPoisoning2: "{0} ingested too many caustic chemicals." SulphuricPoisoning3: "{0} couldn't handle the industrial backwash." ThornBlossom: "{0} was violently pricked by a flower." -UltracosmicMaelstrom1: "{0} was sublimated by the Ultracosmic Maelstrom." -UltracosmicMaelstrom2: "{0} got cut down to size by the Ultracosmic Maelstrom." +UltracosmicMaelstrom1: "{0} was sublimated by [ceffect/dog:Ultracosmic Maelstrom]." +UltracosmicMaelstrom2: "{0} got cut down to size by [ceffect/dog:Ultracosmic Maelstrom]." Vaporfied: "{0} vaporized into thin air." VermillionFlux1: "{0} burst apart in a shower of scarlet sparks." VermillionFlux2: "{0} went deathly stiff, still crackling with crimson." diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 373a159249..592bd025bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -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 @@ -162,8 +158,7 @@ EditedTooltip: { */ SunMoonStones: critical strike chance, life regeneration, CelestialStoneShell: Minor increase to damage, - PowerGlove: 10% increased melee speed, does not stack with downgrades - BerserkerGlove: 10% increased true melee damage + PowerBerserkerGlove: 12% increased melee speed, does not stack with downgrades MechanicalGlove: ''' 12% increased melee damage diff --git a/Localization/en-US/Mods.Terraria.Buffs.hjson b/Localization/en-US/Mods.Terraria.Buffs.hjson index d3195fabe8..aaf2511da3 100644 --- a/Localization/en-US/Mods.Terraria.Buffs.hjson +++ b/Localization/en-US/Mods.Terraria.Buffs.hjson @@ -41,6 +41,7 @@ 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 diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 92368654ad..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; @@ -520,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/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/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 5b3052c3ce..e45bf95817 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -137,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 211798cb71..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; @@ -387,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; @@ -550,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; @@ -636,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; @@ -751,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; @@ -1217,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; @@ -1301,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); @@ -3324,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) @@ -3369,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) @@ -3389,7 +3375,7 @@ namespace CalamityMod.NPCs if (webbed) velocitySlownessFactor += 0.15f; - if (glacialState) + if (frozen) { float baseSlownessFactor = 0.1f; if (VulnerableToCold.HasValue) @@ -3568,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) @@ -4881,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) @@ -4986,7 +4970,6 @@ 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), @@ -5077,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) @@ -5487,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/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index 2ee5de4bbc..b6fedbc21d 100644 --- a/NPCs/CalamityPierceResistance.cs +++ b/NPCs/CalamityPierceResistance.cs @@ -50,19 +50,15 @@ namespace CalamityMod.NPCs pierceResistNPC.Add(NPCID.TheDestroyerTail); // Specific vanilla projectile exemptions - exemptProjectiles.Add(ProjectileID.Arkhalis); exemptProjectiles.Add(ProjectileID.ChargedBlasterLaser); exemptProjectiles.Add(ProjectileID.ClingerStaff); exemptProjectiles.Add(ProjectileID.FinalFractal); exemptProjectiles.Add(ProjectileID.FlyingKnife); - exemptProjectiles.Add(ProjectileID.HallowJoustingLance); + exemptProjectiles.Add(ProjectileID.HallowJoustingLance); // "Why not make jousting lances exempt via AI style?" Because they use spear AI. Thanks vanilla! exemptProjectiles.Add(ProjectileID.JoustingLance); exemptProjectiles.Add(ProjectileID.LastPrismLaser); exemptProjectiles.Add(ProjectileType()); // Included here as it does not have a projectile - exemptProjectiles.Add(ProjectileID.MonkStaffT3); - exemptProjectiles.Add(ProjectileID.PiercingStarlight); exemptProjectiles.Add(ProjectileID.ShadowJoustingLance); - exemptProjectiles.Add(ProjectileID.Terragrim); // Specific vanilla projectile single hitbox exemptions singleHitboxExemptProjectiles[ProjectileID.NettleBurstEnd] = true; @@ -134,6 +130,11 @@ namespace CalamityMod.NPCs if (singleHitboxExemptProjectiles.TryGetValue(projectile.type, out bool isSingleHitboxExempt) && isSingleHitboxExempt && singleHitboxNPC.Contains(npc.type)) return; + // Skip specific vanilla AI styles, or if the projectile sets heldProj (meaning it's a holdout). + if (projectile.aiStyle == ProjAIStyleID.Flail || projectile.aiStyle == ProjAIStyleID.MechanicalPiranha || projectile.aiStyle == ProjAIStyleID.Yoyo || + Main.player[projectile.owner].heldProj == projectile.whoAmI) + return; + PierceResistGlobal(projectile, npc, ref modifiers); } @@ -150,8 +151,7 @@ namespace CalamityMod.NPCs modifiers.FinalDamage *= 1f - damageReduction; - bool aiStyleExempt = projectile.aiStyle == ProjAIStyleID.Flail || projectile.aiStyle == ProjAIStyleID.MechanicalPiranha || projectile.aiStyle == ProjAIStyleID.Yoyo; - if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !projectile.CountsAsClass() && !aiStyleExempt) + if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !projectile.CountsAsClass()) projectile.Calamity().timesPierced++; } } 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/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 4b82f3e3e3..592183f14f 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -135,6 +135,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.spriteDirection = -NPC.direction; NPC.velocity.X = MathHelper.Lerp(NPC.velocity.X, MaxMovementSpeedX * NPC.direction, 0.0125f); + NPC.StepUpBlocks(); } public override float SpawnChance(NPCSpawnInfo spawnInfo) 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/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 5a988a1156..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); diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 32adbb354a..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; 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/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 70d85d9033..f8232470c8 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -63,11 +63,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.dontCountMe = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 9c34dbc2f2..b87f6185ca 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -116,11 +116,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.StormWeaver // Start calling down frost waves from the sky in sheets and stop firing lightning during the charge bool phase3 = lifeRatio < 0.55f; - // Lightning strike flash phase, stop charging and start summoning tornadoes + // Lightning strike flash phase, start summoning tornadoes bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings @@ -336,33 +336,21 @@ namespace CalamityMod.NPCs.StormWeaver // Start charging at the player when in phase 2 if (phase2) { - if (!phase4) - { - calamityGlobalNPC.newAI[0] += 1f; - } - else - { - NPC.localAI[1] = 0f; - if (NPC.localAI[3] > 0f) - NPC.localAI[3] -= 1f; - - calamityGlobalNPC.newAI[0] = 0f; - } - + calamityGlobalNPC.newAI[0] += 1f; calamityGlobalNPC.newAI[2] += 1f; // Only use tornadoes in phase 4 and swap between using them or the frost waves bool useTornadoes = calamityGlobalNPC.newAI[3] % 2f != 0f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; if (phase4 && expertMode) - chargePhaseGateValue *= 0.9f; + attackGateValue *= 0.9f; // Gate value for when Storm Weaver fires projectiles - float projectileGateValue = (int)(chargePhaseGateValue * 0.25f); + float resetGateValue = attackGateValue + 100f; // Call down frost waves from the sky if (phase3 && !useTornadoes) @@ -436,10 +424,8 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (calamityGlobalNPC.newAI[2] >= projectileGateValue) + if (calamityGlobalNPC.newAI[2] == attackGateValue) { - calamityGlobalNPC.newAI[2] = -projectileGateValue * 4f; - // Dictates whether Storm Weaver will use frost or tornadoes if (phase4) { @@ -471,14 +457,14 @@ namespace CalamityMod.NPCs.StormWeaver // Start fast at index 0, become slower as each projectile spawns and then become faster past the central wave int centralWave = totalWaves / 2; - float velocityY = 8f; + float velocityY = revenge ? 10f : expertMode ? 9f : 8f; int wavePatternType = revenge ? Main.rand.Next(3) : expertMode ? Main.rand.Next(2) + 1 : 2; - float delayBeforeFiring = -60f; + float delayBeforeFiring = -70f; // Note the actual delay is half of this number since frost waves have an extra update for (int x = 0; x < totalWaves; x++) { switch (wavePatternType) { - // Starts at 8, central point is 6 and the end is 8 + // Arrow shape case 0: if (x != 0) @@ -491,7 +477,7 @@ namespace CalamityMod.NPCs.StormWeaver break; - // Starts at 8 and alternates between 6 and 8 + // Alternating waves that arrive at different times case 1: if (x != 0) @@ -504,16 +490,13 @@ namespace CalamityMod.NPCs.StormWeaver break; - // Flat line of slower waves + // Flat line case 2: - - velocityY = 7f; - break; } // Telegraph is active for 60 frames - // Frost Waves start moving after 30 frames + // Frost Waves start moving after 35 frames // Frost Waves take 30 frames to reach full velocity Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.5f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, velocityY); Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, FrostWaveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); @@ -526,95 +509,98 @@ namespace CalamityMod.NPCs.StormWeaver // Summon tornadoes if (useTornadoes) { - if (calamityGlobalNPC.newAI[2] >= projectileGateValue) + if (calamityGlobalNPC.newAI[2] == attackGateValue) { - calamityGlobalNPC.newAI[2] = -projectileGateValue * 4f; - // Dictates whether Storm Weaver will use frost or tornadoes calamityGlobalNPC.newAI[3] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ModContent.ProjectileType(); - int totalTornadoes = revenge ? 7 : expertMode ? 5 : 3; - float spawnDistance = revenge ? 750f : expertMode ? 900f : 1050f; - for (int i = 0; i < totalTornadoes; i++) + int totalTornadoes = death ? 10 : revenge ? 6 : expertMode ? 4 : 2; + float spawnDistance = revenge ? 720f : expertMode ? 800f : 880f; // Distance to first tornado from the center point, so actual space is twice this number + for (int i = -totalTornadoes / 2; i <= totalTornadoes / 2; i++) { - Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * spawnDistance * (i - totalTornadoes / 2); + if (i == 0) + continue; + + Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * (spawnDistance * Math.Sign(i) + (i - Math.Sign(i)) * spawnDistance * 0.4f); Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, TornadoDamage, 1f); } } } } + if (calamityGlobalNPC.newAI[2] >= resetGateValue) + calamityGlobalNPC.newAI[2] = 0f; + // Charge - if (!phase4) + if (calamityGlobalNPC.newAI[0] == attackGateValue - 70) { - if (calamityGlobalNPC.newAI[0] == chargePhaseGateValue - 70) + Vector2 soundCenter = Main.player[NPC.target].Center; + SoundStyle lightning = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; + SoundEngine.PlaySound(lightning, soundCenter); + } + if (calamityGlobalNPC.newAI[0] >= attackGateValue) + { + NPC.localAI[3] = 60f; + + if (NPC.localAI[1] == 0f) + NPC.localAI[1] = 1f; + + if (calamityGlobalNPC.newAI[0] >= resetGateValue) { - Vector2 soundCenter = Main.player[NPC.target].Center; - SoundStyle lightning = new("CalamityMod/Sounds/Custom/LightningTelegraph") { Volume = 0.7f }; - SoundEngine.PlaySound(lightning, soundCenter); + NPC.TargetClosest(); + NPC.localAI[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; } - if (calamityGlobalNPC.newAI[0] >= chargePhaseGateValue) + + if (NPC.localAI[1] == 2f) { - NPC.localAI[3] = 60f; + velocity += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.01f * (1f - (lifeRatio / 0.8f)); + acceleration += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.0001f * (1f - (lifeRatio / 0.8f)); + velocity *= 2f; + acceleration *= 0.85f; - if (NPC.localAI[1] == 0f) - NPC.localAI[1] = 1f; - - if (calamityGlobalNPC.newAI[0] >= chargePhaseGateValue + 100f) + float stopChargeDistance = 800f * NPC.localAI[2]; + if (stopChargeDistance < 0) { - NPC.TargetClosest(); - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - - if (NPC.localAI[1] == 2f) - { - velocity += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.01f * (1f - (lifeRatio / 0.8f)); - acceleration += Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) * 0.0001f * (1f - (lifeRatio / 0.8f)); - velocity *= 2f; - acceleration *= 0.85f; - - float stopChargeDistance = 800f * NPC.localAI[2]; - if (stopChargeDistance < 0) + if (NPC.Center.X < Main.player[NPC.target].Center.X + stopChargeDistance) { - if (NPC.Center.X < Main.player[NPC.target].Center.X + stopChargeDistance) - { - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } - else - { - if (NPC.Center.X > Main.player[NPC.target].Center.X + stopChargeDistance) - { - NPC.localAI[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } + NPC.localAI[1] = 0f; + // Prevent the timers from desyncing + calamityGlobalNPC.newAI[0] = calamityGlobalNPC.newAI[2] - resetGateValue; } } - - int dustAmt = 5; - for (int k = 0; k < dustAmt; k++) + else { - Vector2 dustRotation = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; - dustRotation = dustRotation.RotatedBy((k - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + NPC.Center; - Vector2 randDustMovement = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int bluishDust = Dust.NewDust(dustRotation + randDustMovement, 0, 0, DustID.UnusedWhiteBluePurple, randDustMovement.X, randDustMovement.Y, 100, default, 3f); - Main.dust[bluishDust].noGravity = true; - Main.dust[bluishDust].noLight = true; - Main.dust[bluishDust].velocity /= 4f; - Main.dust[bluishDust].velocity -= NPC.velocity; + if (NPC.Center.X > Main.player[NPC.target].Center.X + stopChargeDistance) + { + NPC.localAI[1] = 0f; + // Prevent the timers from desyncing + calamityGlobalNPC.newAI[0] = calamityGlobalNPC.newAI[2] - resetGateValue; + } } } - else + + int dustAmt = 5; + for (int k = 0; k < dustAmt; k++) { - if (NPC.localAI[3] > 0f) - NPC.localAI[3] -= 1f; + Vector2 dustRotation = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; + dustRotation = dustRotation.RotatedBy((k - (dustAmt / 2 - 1)) * (double)MathHelper.Pi / (float)dustAmt) + NPC.Center; + Vector2 randDustMovement = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + int bluishDust = Dust.NewDust(dustRotation + randDustMovement, 0, 0, DustID.UnusedWhiteBluePurple, randDustMovement.X, randDustMovement.Y, 100, default, 3f); + Main.dust[bluishDust].noGravity = true; + Main.dust[bluishDust].noLight = true; + Main.dust[bluishDust].velocity /= 4f; + Main.dust[bluishDust].velocity -= NPC.velocity; } } + else + { + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + } } if (Main.getGoodWorld) @@ -640,7 +626,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (phase2 && !phase4) + if (phase2) { if (NPC.localAI[1] == 1f) { @@ -830,16 +816,19 @@ namespace CalamityMod.NPCs.StormWeaver bool phase2 = lifeRatio < 0.8f && !Main.zenithWorld; bool phase3 = lifeRatio < 0.55f; + bool phase4 = lifeRatio < 0.3f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; + if (phase4 && expertMode) + attackGateValue *= 0.9f; Texture2D texture = phase2 ? Phase2Texture.Value : TextureAssets.Npc[Type].Value; Vector2 halfSizeTexture = new Vector2(texture.Width / 2, texture.Height / 2); float chargeTelegraphTime = 120f; - float chargeTelegraphGateValue = chargePhaseGateValue - chargeTelegraphTime; + float chargeTelegraphGateValue = attackGateValue - chargeTelegraphTime; Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture.Width, texture.Height) * NPC.scale / 2f; @@ -865,13 +854,16 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; + bool phase4 = lifeRatio < 0.3f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float attackGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) - chargePhaseGateValue *= 0.5f; + attackGateValue *= 0.5f; + if (phase4 && expertMode) + attackGateValue *= 0.9f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 360 : 240; + int buffDuration = NPC.Calamity().newAI[0] >= attackGateValue ? 360 : 240; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 3608b9cc4d..c0f5aef107 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -62,11 +62,11 @@ namespace CalamityMod.NPCs.StormWeaver NPC.dontCountMe = true; if (CalamityWorld.death || BossRushEvent.BossRushActive) - NPC.scale *= 1.2f; - else if (CalamityWorld.revenge) NPC.scale *= 1.15f; - else if (Main.expertMode) + else if (CalamityWorld.revenge) NPC.scale *= 1.1f; + else if (Main.expertMode) + NPC.scale *= 1.05f; if (Main.getGoodWorld) NPC.scale *= 0.7f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index d27b72b1ba..a5fcdec89a 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -87,6 +87,25 @@ namespace CalamityMod.NPCs.SupremeCalamitas public const int ThirdBulletHellEndValue = BulletHellDuration * 3; public const int FourthBulletHellEndValue = BulletHellDuration * 4; public const int FifthBulletHellEndValue = BulletHellDuration * 5; + + public bool FinishedBH1 => bulletHellCounter2 >= BulletHellDuration; + public bool FinishedBH2 => bulletHellCounter2 >= SecondBulletHellEndValue; + public bool FinishedBH3 => bulletHellCounter2 >= ThirdBulletHellEndValue; + public bool FinishedBH4 => bulletHellCounter2 >= FourthBulletHellEndValue; + public bool FinishedBH5 => bulletHellCounter2 >= FifthBulletHellEndValue; + + public float lifeRatio = 1; + + public bool IsAtHp_BH2 => lifeRatio <= 0.75f; + public bool IsAtHp_BH3 => lifeRatio <= 0.5f; + public bool IsAtHp_BH4 => lifeRatio <= 0.3f; + public bool IsAtHp_BH5 => lifeRatio <= 0.1f; + public bool IsAtHp_Acceptance => NPC.life < 2; + + public bool IsAtBrothers => IsAtHp_BH3 && FinishedBH3; + public bool IsAtSeekers => IsAtHp_BH4 && FinishedBH4; + public bool IsAtSep2 => IsAtHp_BH5 && FinishedBH5; + public const int PermafrostAbsoluteZeroDamage = 3725; private const float PermafrostPhotonRipperDashVelocity = 6f; private const float PermafrostPhotonRipperMinDistanceFromTarget = 64f; @@ -478,7 +497,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas bool zenithAI = Main.zenithWorld && !permafrost; // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; + lifeRatio = NPC.life / (float)NPC.lifeMax; int bulletHellblast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); int barrage = ModContent.ProjectileType(); @@ -554,7 +573,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.ai[0] == 1f || NPC.ai[0] == 2f; // Make the shield and forcefield fade away in SCal's acceptance phase. - if (lifeRatio <= 0.01f && hasDoneDeathAnim) + if (IsAtHp_Acceptance && hasDoneDeathAnim) { shieldOpacity = MathHelper.Lerp(shieldOpacity, 0f, 0.08f); forcefieldScale = MathHelper.Lerp(forcefieldScale, 0f, 0.08f); @@ -665,9 +684,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (cataclysmAlive || catastropheAlive) baseSize *= new Vector4(0.85f, 1.33f, 0.85f, 1.33f); - if (lifeRatio <= 0.01f) + if (IsAtHp_Acceptance) baseSize = (Main.zenithWorld && !permafrost) ? new Vector4(22f, 22f, 22f, 22f) : new Vector4(400f, 500f, 73f, 500f); - else if (Main.zenithWorld && lifeRatio <= 0.08f && !wormAlive && !permafrost) // gfb + else if (Main.zenithWorld && IsAtHp_BH5 && !wormAlive && !permafrost && FinishedBH5) // gfb, only after Bh5 and sep both end baseSize *= MathHelper.Lerp(0.22f, 1f, lifeRatio * 12.5f); // Scale down the lower health scal has return baseSize; } @@ -686,12 +705,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas c = AcceptanceColor; oldColor = EpiphanyColor; } - else if (lifeRatio <= 0.3f) + else if (IsAtHp_BH4) { c = EpiphanyColor; oldColor = LamentColor; } - else if (lifeRatio <= 0.5f) + else if (IsAtHp_BH3) c = LamentColor; return c; } @@ -782,7 +801,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas }; ArenaWallSystem.ActiveBoxes.Add(ArenaBox); } - ArenaBox.NewDimensions = Vector4.Lerp(ArenaBox.boxDimensions, GetArenaSize(), lifeRatio <= 0.01f ? 0.02f : startFourthAttack ? 0.05f : 0.1f); + ArenaBox.NewDimensions = Vector4.Lerp(ArenaBox.boxDimensions, GetArenaSize(), IsAtHp_Acceptance ? 0.02f : startFourthAttack ? 0.05f : 0.1f); var color = GetArenaColor(out Color oldColor); if (colorCompletion > 1.1f && color != ArenaBox.borderColor) colorCompletion = 0; @@ -939,7 +958,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region FirstAttack - if (bulletHellCounter2 < BulletHellDuration) + if (!FinishedBH1) { despawnProj = true; bulletHellCounter2++; @@ -1020,7 +1039,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region SecondAttack - if (bulletHellCounter2 < SecondBulletHellEndValue && startSecondAttack) // Bullet hell lasts 1800 + if (!FinishedBH2 && startSecondAttack) // Bullet hell lasts 1800 { despawnProj = true; bulletHellCounter2++; @@ -1120,7 +1139,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } - if (!startSecondAttack && lifeRatio <= 0.75f) + if (!startSecondAttack && IsAtHp_BH2) { // Bouncy Boulders if (permafrost) @@ -1151,7 +1170,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region ThirdAttack - if (bulletHellCounter2 < ThirdBulletHellEndValue && startThirdAttack) + if (!FinishedBH3 && startThirdAttack) { despawnProj = true; bulletHellCounter2++; @@ -1245,7 +1264,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } - if (!startThirdAttack && lifeRatio <= 0.5f) + if (!startThirdAttack && IsAtHp_BH3) { // Bouncy Boulders if (permafrost) @@ -1276,7 +1295,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region FourthAttack - if (lifeRatio <= 0.3f && musicSyncCounter > -120) + if (IsAtHp_BH4 && musicSyncCounter > -120) musicSyncCounter--; if (musicSyncCounter <= 126 && musicSyncCounter > 0) { @@ -1305,7 +1324,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldPureVisualScale = 1.5f; postMusicHit = true; } - if (postMusicHit && lifeRatio > 0.01f && !canDespawn && NPC.ai[1] != 2f) + if (postMusicHit && !IsAtHp_Acceptance && !canDespawn && NPC.ai[1] != 2f) { forcefieldPureVisualScale = MathHelper.Lerp(forcefieldPureVisualScale, 1f, 0.095f); Vector2 velOffset = new Vector2(56, 56).RotatedByRandom(100) * forcefieldPureVisualScale; @@ -1327,7 +1346,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } - if (bulletHellCounter2 < FourthBulletHellEndValue && startFourthAttack) + if (!FinishedBH4 && startFourthAttack) { despawnProj = true; bulletHellCounter2++; @@ -1451,7 +1470,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } - if (!startFourthAttack && lifeRatio <= 0.3f) + if (!startFourthAttack && IsAtHp_BH4) { // Bouncy Boulders if (permafrost) @@ -1482,7 +1501,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region FifthAttack - if (bulletHellCounter2 < FifthBulletHellEndValue && startFifthAttack) + if (!FinishedBH5 && startFifthAttack) { despawnProj = true; bulletHellCounter2++; @@ -1598,7 +1617,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } - if (!startFifthAttack && lifeRatio <= 0.1f) + if (!startFifthAttack && IsAtHp_BH5) { // Bouncy Boulders if (permafrost) @@ -1891,7 +1910,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } - if (!gettingTired5 && lifeRatio <= 0.01f) + if (!gettingTired5 && IsAtHp_Acceptance) { for (int x = 0; x < Main.maxProjectiles; x++) { @@ -1978,7 +1997,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas gettingTired2 = true; return; } - else if (!gettingTired && lifeRatio <= 0.08f) + else if (!gettingTired && IsAtSep2) { attackCastDelay = sepulcherSpawnCastTime; for (int i = 0; i < 40; i++) @@ -2033,7 +2052,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region TransformSeekerandBrotherTriggers - if (!halfLife && lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) + if (!halfLife && IsAtBrothers && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { if (!BossRushEvent.BossRushActive) { @@ -2049,7 +2068,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas halfLife = true; } - if (lifeRatio <= 0.2f) + if (IsAtSeekers) { if (!secondStage) { @@ -2107,7 +2126,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (attackPause > 0) attackPause--; - if (lifeRatio < 0.45f && !enteredBrothersPhase) + if (IsAtBrothers && !enteredBrothersPhase) { attackPause = 5; if (preventionPause == 0) @@ -2652,8 +2671,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - // Previously the 40% health threshold transition - if (lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) + // Phase 2 + if (IsAtBrothers && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { NPC.ai[0] = 1f; NPC.ai[1] = 0f; @@ -3492,8 +3511,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public void HandleMusicVariables() { - float lifeRatio = NPC.life / (float)NPC.lifeMax; - CalamityGlobalNPC.SCalGrief = -1; CalamityGlobalNPC.SCalLament = -1; CalamityGlobalNPC.SCalEpiphany = -1; @@ -3501,9 +3518,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (startFifthAttack && gettingTired5 && (giveUpCounter < 1160 || hasDoneDeathAnim)) CalamityGlobalNPC.SCalAcceptance = NPC.whoAmI; - else if (lifeRatio <= 0.3f) + else if (IsAtHp_BH4) CalamityGlobalNPC.SCalEpiphany = NPC.whoAmI; - else if (lifeRatio <= 0.5f) + else if (IsAtHp_BH3) CalamityGlobalNPC.SCalLament = NPC.whoAmI; else CalamityGlobalNPC.SCalGrief = NPC.whoAmI; @@ -3757,7 +3774,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas //if (NPC.ai[0] >= 3f) //intensity *= 0.6f; - float lifeRatio = NPC.life / (float)NPC.lifeMax; if (lifeRatio < 0.05f) forcefieldOpacity = 0.75f; 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 e7c56ef885..b2f1cadca3 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -243,30 +243,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses attackType = 2; if (attackPatternLength % attackIncrement == phase1Attack2) - attackType = 6; - - if (attackPatternLength % attackIncrement == phase1Attack3) attackType = 8; + if (attackPatternLength % attackIncrement == phase1Attack3) + attackType = 6; + if (attackPatternLength % attackIncrement == phase1Attack4) - { - attackType = 4; - - // Adjust the upcoming Ethereal Lance attack depending on what random variable is chosen here. - calamityGlobalNPC.newAI[3] = Main.rand.Next(2); - - // Sync the Calamity AI variables. - NPC.SyncExtraAI(); - } + attackType = 8; if (attackPatternLength % attackIncrement == phase1Attack5) attackType = 5; if (attackPatternLength % attackIncrement == phase1Attack6) - attackType = 8; + attackType = 2; if (attackPatternLength % attackIncrement == phase1Attack7) - attackType = 2; + attackType = 8; if (attackPatternLength % attackIncrement == phase1Attack8) { @@ -319,28 +311,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackPatternLength % attackIncrement == phase2Attack3) attackType = 8; + if (attackPatternLength % attackIncrement == phase2Attack4) + attackType = 11; + if (attackPatternLength % attackIncrement == phase2Attack5) attackType = 5; if (attackPatternLength % attackIncrement == phase2Attack6) attackType = 2; - if (attackPatternLength % attackIncrement == phase2Attack7) - { - if (phase3) - { - attackType = 7; - - // Adjust the upcoming Ethereal Lance attack depending on what random variable is chosen here. - calamityGlobalNPC.newAI[2] = Main.rand.Next(2); - - // Sync the Calamity AI variables. - NPC.SyncExtraAI(); - } - else - attackType = 6; - } - if (attackPatternLength % attackIncrement == phase2Attack7) { if (phase3) @@ -371,9 +350,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackPatternLength % attackIncrement == phase2Attack9) attackType = 8; - if (attackPatternLength % attackIncrement == phase2Attack4) - attackType = 11; - if (attackPatternLength % attackIncrement == phase2Attack10) attackType = 12; } @@ -403,7 +379,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.ai[0] = attackType; NPC.ai[1] = 0f; - NPC.ai[2] += Main.rand.Next(2) + 1f; + NPC.ai[2] += 1f; NPC.netUpdate = true; break; @@ -744,8 +720,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 +736,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,16 +775,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.netMode != NetmodeID.MultiplayerClient) - { - 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; @@ -930,9 +849,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. @@ -1166,12 +1083,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/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/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/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index 8c9a1641a9..344bf53445 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -73,7 +73,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles } } - [PierceResistException] //Doze 24apr2025 - Not a child of BaseCustomUseStyleProjectile because this doesn't use any of it's functionality. Comes from my melee rework mod. public abstract class BaseSwordHoldoutProjectile : ModProjectile { 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/Boss/StormWeaverFrostWaveTelegraph.cs b/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs index 8682e81876..a9af58188f 100644 --- a/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs +++ b/Projectiles/Boss/StormWeaverFrostWaveTelegraph.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.tileCollide = false; - Projectile.extraUpdates = 4; + Projectile.extraUpdates = 3; Projectile.Opacity = 1f; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 3784e20d35..f7b234d338 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -201,6 +201,15 @@ namespace CalamityMod.Projectiles /// public bool grapeBeer = false; + /// + /// How strong grape beer homing is on this. It speeds up the longer the target is targeted. + /// + public float grapeBeerHomingPower = 0.01f; + /// + /// ID of last target from grapebeer + /// + public int grapeBeerHomingTarget = -1; + /// /// Variable used for storing the actual amount of extra updates a projectile has.
/// This is NOT set automatically, and must be set whenever it is needed. @@ -327,7 +336,7 @@ namespace CalamityMod.Projectiles void ApplyGrapeBeer() { grapeBeer = true; - conditionalHomingRange = 600; + conditionalHomingRange = 300; if (projectile.timeLeft > 300 * projectile.MaxUpdates) projectile.timeLeft = 300 * projectile.MaxUpdates; //Calamity adds a hybrid iframe system when both local and static are set to true, so this works fine for both global and static projectiles. @@ -420,6 +429,10 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.ZapinatorLaser) projectile.originalDamage = projectile.damage; + // Make Piranha Gun have dynamic stat tweaking + if (projectile.type == ProjectileID.MechanicalPiranha) + projectile.ContinuouslyUpdateDamageStats = true; + // Apply Calamity Global Projectile Tweaks. SetDefaults_ApplyTweaks(projectile); } @@ -3054,7 +3067,7 @@ namespace CalamityMod.Projectiles //If hooking an NPC, this is set to the NPC ID but negative. Still need to find how this gets treated upon reeling in. switch (owner.Calamity().SelectedFishingMinigame) { - case CalamityPlayer.FishingMinigames.ScrapBobber: + case CalamityPlayer.FishingMinigames.WulfrumBobber: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3174,7 +3187,7 @@ namespace CalamityMod.Projectiles } - case CalamityPlayer.FishingMinigames.ScoriaBobber: + case CalamityPlayer.FishingMinigames.VolcanicSinker: { if (PersistentFishingData == -1) { @@ -3299,7 +3312,7 @@ namespace CalamityMod.Projectiles } - case CalamityPlayer.FishingMinigames.PerennialBobber: + case CalamityPlayer.FishingMinigames.FeralBobber: if (projectile.ai[0] == 0) { if (projectile.wet) //Fishing in water @@ -3388,7 +3401,7 @@ namespace CalamityMod.Projectiles break; - case CalamityPlayer.FishingMinigames.NavystoneBobber: + case CalamityPlayer.FishingMinigames.SunkenSinker: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3558,7 +3571,7 @@ namespace CalamityMod.Projectiles return false; - case CalamityPlayer.FishingMinigames.SkylineBobber: + case CalamityPlayer.FishingMinigames.AcrobaticBobber: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3783,17 +3796,6 @@ namespace CalamityMod.Projectiles projectile.damage += 15; } - if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee) - { - if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 - { - if (player.HeldItem.type == ItemID.BeesKnees) - projectile.DamageType = DamageClass.Ranged; - } - } - else if (projectile.type == ProjectileID.SoulDrain) - projectile.DamageType = DamageClass.Magic; - frameOneHacksExecuted = true; } @@ -4095,20 +4097,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) { @@ -4305,166 +4293,189 @@ namespace CalamityMod.Projectiles // 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) { - NPC target = projectile.Center.ClosestNPCAt(conditionalHomingRange); + float npcDistCompare = 25000f; // Initializing the value to a large number so the first entry is basically guaranteed to replace it. + NPC target = null; + foreach (NPC n in Main.ActiveNPCs) + { + float extraDistance = (n.width / 2) + (n.height / 2); + if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, conditionalHomingRange + extraDistance) || ((projectile.localNPCImmunity[n.whoAmI] > 0 || projectile.localNPCImmunity[n.whoAmI] == -1 || n.immune[projectile.owner] > 0))) + continue; + + float currentNPCDist = Vector2.Distance(n.Center, projectile.Center); + if (Projectile.perIDStaticNPCImmunity[projectile.type][n.whoAmI] > Main.GameUpdateCount) + currentNPCDist += 1600; //Prioritize things that don't currently have iframes, but still home in on stuff that has static iframes if needed. + if ((currentNPCDist < npcDistCompare) && (!projectile.tileCollide || Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1))) + { + npcDistCompare = currentNPCDist; + target = n; + } + } + if (target is not null) { + if (grapeBeerHomingTarget == target.whoAmI) + { + grapeBeerHomingPower += 0.004f; + } else { + grapeBeerHomingPower = 0.015f; + } + + HomingTarget = grapeBeerHomingTarget = target.whoAmI; 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 + float trackingSpeed = grapeBeerHomingPower;// 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; + var currVelocity = projectile.velocity.Length(); + if (currVelocity < 8) + currVelocity += grapeBeerHomingPower; - projectile.velocity = projectile.velocity.ToRotation().AngleTowards(targetDirection.ToRotation(), trackingSpeed).ToRotationVector2() * currVelocity.Length(); + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(targetDirection.ToRotation(), trackingSpeed).ToRotationVector2() * currVelocity; } } - if (brimstoneBullets) + if (projectile.Opacity > 0 && projectile.scale > 0.01f) // Only apply bullet visuals if the bullet is visible { - PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f); - GeneralParticleHandler.SpawnParticle(spark); + 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); - } - if (fireBullet) - { - if (projectile.timeLeft > 200) + 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 @@ -4598,6 +4609,13 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + if (grapeBeer) + { + Vector2 pointToCheck = Vector2.Clamp(player.Center, target.TopLeft, target.BottomRight); + float remap = Utils.Remap(Utils.Distance(player.Center, pointToCheck), GrapeBeer.CloseRangeDistance, GrapeBeer.LongRangeDistance, GrapeBeer.CloseRangeDamage, GrapeBeer.LongRangeDamage); + modifiers.SourceDamage *= remap; + } + // Old Fashioned buffs (or debuffs) apply if the player has Old Fashioned // IV Drip on the Rocks inherits the same logic as Old Fashioned if (modPlayer.oldFashioned && buffedByOldFashioned.HasValue) @@ -4698,6 +4716,10 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage /= 1.5f; } + // Debuff infliction must be placed here as opposed to a more common hook like OnHitNPCWithProj because its on-hit logic breaks the loop before it reaches that hook + if (projectile.type == ProjectileID.InfluxWaver) + target.AddBuff(BuffID.Electrified, 180); + // Create sparks on hit to hammer in the defense shredding. if (deepcoreBullet) { diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 6f3860270f..2559da088c 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -123,9 +123,10 @@ namespace CalamityMod.Projectiles { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, { ProjectileID.Bullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.BulletHighVelocity, Do(ExtraUpdatesDelta(+2), LocalIFrames(-1)) }, - { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) }, + { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(10), 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 }, @@ -237,6 +237,7 @@ namespace CalamityMod.Projectiles { ProjectileID.ShadowJoustingLance, trueMelee }, { ProjectileID.SilverShortswordStab, trueMelee }, { ProjectileID.SolarFlareChainsaw, trueMeleeNoSpeed }, + { ProjectileID.Spark, trueMeleeNoSpeed }, { ProjectileID.Spear, trueMelee }, { ProjectileID.StardustChainsaw, trueMeleeNoSpeed }, { ProjectileID.Swordfish, trueMelee }, @@ -459,7 +460,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/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs index dfe7bc00b1..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; @@ -84,13 +85,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal 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/CountermeasureMittHoldout.cs b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs index aae9fd3773..22a4bd3c7a 100644 --- a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs +++ b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs @@ -17,7 +17,6 @@ using static Terraria.Player; namespace CalamityMod.Projectiles.DraedonsArsenal { - [PierceResistException] public class CountermeasureMittHoldout : BaseGunHoldoutProjectile { public new string LocalizationCategory => "Projectiles.Misc"; diff --git a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs index 07263d5cca..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; @@ -54,13 +55,13 @@ 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; diff --git a/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs b/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs index 7d14fdce6e..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,13 +79,13 @@ 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; diff --git a/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs index ff1bf55236..f9a5e01839 100644 --- a/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs +++ b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.timeLeft = 300; Projectile.extraUpdates = 3; Projectile.penetrate = -1; - Projectile.ArmorPenetration = 15; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index 002c255f37..128d8bb152 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Enemy public override void AI() { - float projTimer = Projectile.ai[1] == 1f ? 900f : 600f; + float projTimer = Projectile.ai[1] == 1f ? 795f : 600f; if (Projectile.soundDelay == 0) { Projectile.soundDelay = -1; @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Enemy { Projectile.Kill(); } - float expandSizeX = Projectile.ai[1] == 1f ? 90f : 15f; - float expandSizeY = Projectile.ai[1] == 1f ? 90f : 15f; + float expandSizeX = Projectile.ai[1] == 1f ? 150f : 15f; + float expandSizeY = Projectile.ai[1] == 1f ? 150f : 15f; Point projCenterTile = Projectile.Center.ToTileCoordinates(); int sizeMod; int sizeMod2; @@ -101,13 +101,13 @@ namespace CalamityMod.Projectiles.Enemy } } - public override bool CanHitPlayer(Player target) => Projectile.ai[0] >= 60f && Projectile.ai[0] <= (Projectile.ai[1] == 1f ? 840f : 540f); + public override bool CanHitPlayer(Player target) => Projectile.ai[0] >= 60f && Projectile.ai[0] <= (Projectile.ai[1] == 1f ? 735f : 540f); public override bool PreDraw(ref Color lightColor) { - float aiTrackCheck = Projectile.ai[1] == 1f ? 900f : 600f; - float expandSizeX2 = Projectile.ai[1] == 1f ? 90f : 15f; - float expandSizeY2 = Projectile.ai[1] == 1f ? 90f : 15f; + float aiTrackCheck = Projectile.ai[1] == 1f ? 795f : 600f; + float expandSizeX2 = Projectile.ai[1] == 1f ? 150f : 15f; + float expandSizeY2 = Projectile.ai[1] == 1f ? 150f : 15f; float aiTracker = Projectile.ai[0]; float trackerClamp = MathHelper.Clamp(aiTracker / 30f, 0f, 1f); if (aiTracker > aiTrackCheck - 60f) 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/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/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 821503dd27..e9319efd17 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -149,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/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/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/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index 9352beef41..ab93bc31bf 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.ArmorPenetration = 40; } public override void AI() @@ -105,7 +104,6 @@ namespace CalamityMod.Projectiles.Magic Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, blastSize, minMultiplier, hitsToMinMult); blast.timeLeft = 10; blast.DamageType = DamageClass.Magic; - blast.ArmorPenetration = 40; } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) 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/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/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/Teslabeam.cs b/Projectiles/Magic/Teslabeam.cs index 406697d659..e188baaf9b 100644 --- a/Projectiles/Magic/Teslabeam.cs +++ b/Projectiles/Magic/Teslabeam.cs @@ -16,7 +16,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - [PierceResistException] public class Teslabeam : BaseLaserbeamProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; 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/Melee/BasherHoldout.cs b/Projectiles/Melee/BasherHoldout.cs index 3428fbe1dc..c79686bd1b 100644 --- a/Projectiles/Melee/BasherHoldout.cs +++ b/Projectiles/Melee/BasherHoldout.cs @@ -16,7 +16,6 @@ using static Terraria.Player; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class BasherHoldout : ModProjectile, ILocalizedModType { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); 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/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/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 9fdf15536d..08a801efe8 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -12,7 +12,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class DevilsSunriseProj : ModProjectile { public static readonly SoundStyle HitSound = new SoundStyle("CalamityMod/Sounds/Item/MantisSwipe", 2) with { Pitch = 0.8f }; diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 5286f392d9..1d0d877dfa 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -14,7 +14,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class DragonRageStaff : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); 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/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index f2595cf48f..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; @@ -395,13 +396,12 @@ namespace CalamityMod.Projectiles.Melee 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/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/MaceFlails/UrchinMaceProj.cs b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs index 477271b0b2..e0215e4913 100644 --- a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs +++ b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs @@ -13,7 +13,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.MaceFlails { - [PierceResistException] public class UrchinMaceProj : BaseMaceFlailProjectile { // The entire chain is on the mace sprite, in which the player swings 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_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/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 62c19d5938..9db51e148c 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -11,7 +11,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class MurasamaSlash : ModProjectile, ILocalizedModType { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index e884f6f0ba..2e76546ddc 100644 --- a/Projectiles/Melee/OmnibladeSwing.cs +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -8,7 +8,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class OmnibladeSwing : ModProjectile, ILocalizedModType { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); 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/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/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 817f251d32..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),0.5f); - 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/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 7a8fd9c7e1..6152096f2e 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -285,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/TriactisHammerFlare.cs b/Projectiles/Melee/TriactisHammerFlare.cs index 70af4b6ee0..2fed916b9e 100644 --- a/Projectiles/Melee/TriactisHammerFlare.cs +++ b/Projectiles/Melee/TriactisHammerFlare.cs @@ -1,4 +1,5 @@ -using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -50,8 +51,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); return; } + // You may swap weapons and keep the flares, but only for a short time + if (Owner.HeldItem.type == ModContent.ItemType()) + Projectile.timeLeft = 180; - Projectile.timeLeft = 2; float rotation = Main.GlobalTimeWrappedHourly * 2f + MathHelper.ToRadians(120f) * FlareType; // Transform into smashy hammers @@ -95,6 +98,12 @@ namespace CalamityMod.Projectiles.Melee } } + public override void OnKill(int timeLeft) + { + Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, GetColor(FlareType), Vector2.One, 0f, 0.1f, 0.8f, 10); + GeneralParticleHandler.SpawnParticle(pulse); + } + // Hue-shifted version of the base colours public static Color GetColor(float type) { diff --git a/Projectiles/Melee/TriactisHammerProj.cs b/Projectiles/Melee/TriactisHammerProj.cs index e455e9aff9..1b314721e8 100644 --- a/Projectiles/Melee/TriactisHammerProj.cs +++ b/Projectiles/Melee/TriactisHammerProj.cs @@ -124,8 +124,6 @@ namespace CalamityMod.Projectiles.Melee Particle sparkle = new CritSpark(Projectile.Center, velocity, Color.White, currentColor, 1f * scale, 24, 0.1f, 2.5f * scale); GeneralParticleHandler.SpawnParticle(sparkle); } - Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, currentColor, Vector2.One, 0f, 0.1f, 0.8f, 10); - GeneralParticleHandler.SpawnParticle(pulse); } if (OrbitRadius > 792f) 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/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index 17cf90d7a2..e52c6e5d7f 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -11,7 +11,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - [PierceResistException] public class TyphonsGreedStaff : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); 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/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index a403ac043a..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/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index 63e38eac06..cd9a71eb7d 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged int sawLevel = (SawPower >= 1f).ToInt() + (SawPower >= 0.25f).ToInt(); if (Main.myPlayer == Projectile.owner) { - float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. + float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower); int sawPierce = (int)MathHelper.Lerp(2f, 6f, SawPower); Projectile buzzsaw = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * Owner.HeldItem.shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), (int)(Projectile.knockBack * (sawDamageMult / 2)), Main.myPlayer, sawLevel); @@ -179,13 +179,16 @@ namespace CalamityMod.Projectiles.Ranged } // The holdout can deal damage; you're literally spinning up a buzzsaw at the end, after all. - public override bool? CanDamage() => !NoSawOnHoldout; + public override bool? CanDamage() => !NoSawOnHoldout && Time % Projectile.localNPCHitCooldown == 0; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 240); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.7f }, GunTipPosition); + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.8f); + int SawLevel = (Time / ChargeupTime >= 1f).ToInt() + (Time / ChargeupTime >= 0.25f).ToInt(); int bloodCount = 4 + 3 * SawLevel; for (int p = 0; p < bloodCount; p++) diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 5913c8504c..34655082c4 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -52,10 +52,6 @@ namespace CalamityMod.Projectiles.Ranged baseColor = Color.MediumOrchid; } baseVel = Projectile.velocity; - if (Svant) - Projectile.ArmorPenetration = 200; - if (Infinity) - Projectile.ArmorPenetration = 20; } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; if (Projectile.timeLeft == 2) diff --git a/Projectiles/Ranged/ChargedBlastSplit.cs b/Projectiles/Ranged/ChargedBlastSplit.cs index 6aafc4fdff..a9f615012a 100644 --- a/Projectiles/Ranged/ChargedBlastSplit.cs +++ b/Projectiles/Ranged/ChargedBlastSplit.cs @@ -53,15 +53,9 @@ namespace CalamityMod.Projectiles.Ranged baseColor = Color.MediumOrchid; startVel = Projectile.velocity; if (Infinity) - { Projectile.timeLeft = 340; - Projectile.ArmorPenetration = 20; - } if (Svant) - { Projectile.timeLeft = 640; - Projectile.ArmorPenetration = 200; - } direction = Main.rand.NextBool(); homeSpeed = Main.rand.NextFloat(5, 8); } diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 48d0f4c787..7af0a84e3d 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(Projectile.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/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/HellbornHoldout.cs b/Projectiles/Ranged/HellbornHoldout.cs index e4380d6c83..a81a01cb47 100644 --- a/Projectiles/Ranged/HellbornHoldout.cs +++ b/Projectiles/Ranged/HellbornHoldout.cs @@ -13,7 +13,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - [PierceResistException] public class HellbornHoldout : BaseGunHoldoutProjectile { public override int AssociatedItemID => ModContent.ItemType(); diff --git a/Projectiles/Ranged/MechanicalBarracuda.cs b/Projectiles/Ranged/MechanicalBarracuda.cs index ca668b7d03..f4cdb22e3e 100644 --- a/Projectiles/Ranged/MechanicalBarracuda.cs +++ b/Projectiles/Ranged/MechanicalBarracuda.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.height = 22; Projectile.friendly = true; Projectile.aiStyle = ProjAIStyleID.MechanicalPiranha; + Projectile.ContinuouslyUpdateDamageStats = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; 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/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/OntoligicalDespoilerBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs index 58d4c289ed..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,13 +30,12 @@ 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; diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 9e8d5a9584..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,11 +128,8 @@ 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, Owner); 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/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 6490f6fa34..bf2fc16015 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.tileCollide = true; - Projectile.ArmorPenetration = 15; } public override void AI() 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/SuperradiantSlaughtererHoldout.cs b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs index 4d2b48ff8e..af5cd9e286 100644 --- a/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs +++ b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs @@ -81,12 +81,12 @@ namespace CalamityMod.Projectiles.Ranged Owner.AddCooldown(SuperradiantSawBoost.ID, SuperradiantSlaughterer.DashCooldown); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/MeatySlash"), GunTipPosition); - // Throws a lingering saw at the cursor that deals 3x damage (since the holdout already deals 2x) + // Throws a lingering saw at the cursor that deals 2x damage (since the holdout already deals 1.5x) if (Main.myPlayer == Projectile.owner) { float clampedMouseDist = MathHelper.Clamp(Vector2.Distance(GunTipPosition, Owner.Calamity().mouseWorld), 0f, 960f); float adjustedMouseDist = clampedMouseDist / 21f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * adjustedMouseDist, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * adjustedMouseDist, ModContent.ProjectileType(), (int)(Projectile.damage * 4f / 3f), Projectile.knockBack, Projectile.owner); } // End animation early @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle ShootSound = new("CalamityMod/Sounds/Item/SawShot", 2) { PitchVariance = 0.1f, Volume = 0.4f + SawPower * 0.5f }; SoundEngine.PlaySound(ShootSound, GunTipPosition); - float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 2f; // The damage must be divided by 2 to offset the holdout having 2x base damage. + float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. int sawPierce = (int)MathHelper.Lerp(2f, 7f, SawPower); int sawLevel = (SawPower >= 1f).ToInt() + (SawPower >= 0.25f).ToInt(); @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.Ranged } // The holdout can deal damage; you're literally spinning up a buzzsaw at the end, after all. - public override bool? CanDamage() => !NoSawOnHoldout; + public override bool? CanDamage() => !NoSawOnHoldout && Time % Projectile.localNPCHitCooldown == 0; public override void ModifyDamageHitbox(ref Rectangle hitbox) { @@ -258,6 +258,9 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(ModContent.BuffType(), 150); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.7f }, GunTipPosition); + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.8f); + // EPIC AND COOL RAINBOW PARTICLES WOOOO int SawLevel = (Time / ChargeupTime >= 1f).ToInt() + (Time / ChargeupTime >= 0.25f).ToInt(); int onHitSparkAmount = 4 + 4 * SawLevel; 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 20e1a7a0df..eb0ba1a84b 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -74,7 +74,7 @@ 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(BuffID.Frozen, 150); } public override void OnHitPlayer(Player target, Player.HurtInfo info) 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/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/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/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/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/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/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/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/BatholithBangleProjectile.cs b/Projectiles/Typeless/BatholithBangleProjectile.cs index 85919f69ec..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,9 +118,7 @@ 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; 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/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/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index e55fe098b7..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,7 +172,7 @@ 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.33f); diff --git a/Projectiles/Typeless/ProtolithBangleProjectile.cs b/Projectiles/Typeless/ProtolithBangleProjectile.cs index fae2961e9b..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,13 +102,12 @@ 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; 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/V8000SoulVisual.cs b/Projectiles/Typeless/V8000SoulVisual.cs new file mode 100644 index 0000000000..0507db89f3 --- /dev/null +++ b/Projectiles/Typeless/V8000SoulVisual.cs @@ -0,0 +1,83 @@ +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, ILocalizedModType, IPixelatedPrimitiveRenderer + { + public new string LocalizationCategory => "Projectiles.Typeless"; + 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/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/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index 50f86b9814..dfbc5c0a2c 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -1,12 +1,14 @@ using System; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using Terraria.ID; namespace CalamityMod.Rarities { @@ -17,9 +19,83 @@ namespace CalamityMod.Rarities public static float MaxY = 4.5f; public static Color BloomClr = new Color(48, 33, 4, 0); - public static Color TextClr = new Color(157, 110, 11, 50); + public static Color TextClr = new Color(157, 110, 11, 255); static float lastFlashTime = 0f; static bool isFlashing = false; + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var borderColor = color * 2f; + var coreColor = new Color(77, 0, 33); + var shineColor = new Color(254, 231, 117); + if (isFlashing) + { + shineColor = new Color(90, 207, 255); + position += Main.rand.NextVector2Circular(8f, 4.8f); + } + + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, text, pos, Color.White, 0, Vector2.Zero, new Vector2(scale)); + spriteBatch.End(); + } + + //Draw the base text + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.125f) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2, 0).RotatedBy(f), null, borderColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, coreColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + + //Draw the shine character-by-character + using (lease.Scope(clearColor: Color.Transparent)) + { + string txt = ""; + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in text) + { + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + float sin = (MathF.Sin(pos.X * 0.02f + Main.GlobalTimeWrappedHourly * -1.5f) + 1) * 0.5f; + var c = shineColor * MathF.Pow(sin, 120); + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos, c, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { @@ -38,26 +114,20 @@ namespace CalamityMod.Rarities isFlashing = false; } } - var fontSize = font.MeasureString(text); - var center = fontSize / 2.0f; + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } + } if (Item.expert) textColor = Main.DiscoColor; - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - - float pulsing = 1.5f + (float)Math.Sin(time * 5f); - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) - { - 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 (isFlashing && CalamityClientConfig.Instance.TextEffects) - origin += Main.rand.NextVector2Circular(2f, 1.2f); // Small shake - } - if (isFlashing) { textColor = new Color(0, 183, 241, 50); @@ -65,47 +135,8 @@ namespace CalamityMod.Rarities } textColor.A = 255; + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); - // Shadow - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - // Outline base - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), new Color(77, 0, 33), rotation, origin, baseScale); - - float shineWidth = 40f; //set to charSize - float shineSpeed = 80f; - - float shineDisp = time * shineSpeed; //predicted current location of the shine based on the time and speed - float shinePos = (shineDisp % (fontSize.X + shineWidth)); - - Vector2 basePos = new Vector2(X, Y); - if (isFlashing && CalamityClientConfig.Instance.TextEffects) - basePos += Main.rand.NextVector2Circular(3f, 10f); // Small shake - - float charOffsetX = 0f; - if (!renderTextSparkles) - return; - for (int i = 0; i < text.Length; i++) - { - string c = text[i].ToString(); - Vector2 charSize = font.MeasureString(c); - Vector2 charOrigin = charSize * 0.5f; - - Vector2 charPos = basePos + new Vector2(charOffsetX, 0f); - - float centerX = charPos.X + (charSize.X * baseScale.X) / 2f + 10.5f; - float dist = Math.Abs(centerX - (X + shinePos - shineWidth * 0.15f)); - float intensity = 1f - MathHelper.Clamp(dist / shineWidth, 0f, 1f); - - if (intensity > 0f) - { - Color shineColor = isFlashing ? new Color(90, 207, 255) * intensity * 2f : new Color(254, 231, 117) * intensity * 1f; - ChatManager.DrawColorCodedString( - spriteBatch, font, c, charPos, shineColor, rotation, origin, baseScale); - } - - charOffsetX += charSize.X - text.Length * 0.0085f; - } } public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index eb2f0d1920..9ea280216b 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -2,115 +2,136 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; -using Terraria.ID; namespace CalamityMod.Rarities { public class CalamityRed : ModRarity { // Calamity Red is Rarity 17 - // This rarity should never be assigned to any items. - // It is the equivalent of vanilla's Purple rarity (11): only used for positive reforges on top-rarity items. - //public override Color RarityColor => new Color(163, 25, 26); // #A3191A - // // (139, 0, 0) is the classic donator item color - public override Color RarityColor => TextClr * 2f; public static float MaxY = 4.5f; public static Color BloomClr = new Color(180, 20, 75, 0); public static Color TextClr = new Color(242, 27, 27, 255); + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + var time = Main.GlobalTimeWrappedHourly; + + var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; + var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; + var fontSize = ChatManager.GetStringSize(font, text, new Vector2(1)); + var center = fontSize / 2f; + + var glowPosition = position + new Vector2(size.X * 0.5f, size.Y * 0.5f);// new Vector2(X + center.X, Y + center.Y / 1.5f); + color.A = 0; + float pulsing = 10f + (float)Math.Sin(time * 20f); + float baseScalePulse = 1.03f; + float flameHeight = 5f; + float distortionAmount = 2f; + + + for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + { + float angle = f + (time * 2f % MathHelper.TwoPi); + + float distortion = (float)Math.Sin((position.Y + f * 100f + time * 20f) * 0.05f) * distortionAmount; + + Vector2 offset = new Vector2( + (float)Math.Cos(angle) * pulsing * 0.4f + distortion, + -(float)Math.Abs((float)Math.Sin(angle)) * flameHeight + ); + + float scaleVariation = 0.95f + 0.05f * (float)Math.Sin(time * 15f + f * 2f); + Vector2 vscale = new Vector2(baseScalePulse * scaleVariation) * scale; + + Color flameLayerColor = new Color( + (int)(color.R * 0.5f), + (int)(color.G * 0.5f), + (int)(color.B * 0.5f), + (int)(color.A * 0.5f) + ); + + ChatManager.DrawColorCodedString( + spriteBatch, + font, + text, + position + offset, + flameLayerColor, + 0, + Vector2.Zero, + vscale + ); + } + + // Draw crisp center text + ChatManager.DrawColorCodedString( + spriteBatch, + font, + text, + position, + color, + 0, + Vector2.Zero, + new Vector2(baseScalePulse) + ); + + color.A = 255; + + + var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); + + spriteBatch.Draw(crystalTextGlow, glowPosition, null, BloomClr, MathHelper.PiOver2, new Vector2(6f, 33f), + new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); + + ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, position, Color.Lerp(color,Color.White,0.67f), 0, Vector2.Zero, new(scale)); + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0, Vector2.Zero, new(scale)); + + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { - var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; - var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; - var fontSize = font.MeasureString(text); - var center = fontSize / 2f; + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } + } if (Item.expert) textColor = Main.DiscoColor; - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - float pulsing = 10f + (float)Math.Sin(time * 20f); - float baseScalePulse = 1.03f; - float flameHeight = 5f; - float distortionAmount = 2f; - - if (renderTextSparkles) - - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) - { - float angle = f + (time * 2f % MathHelper.TwoPi); - - float distortion = (float)Math.Sin((Y + f * 100f + time * 20f) * 0.05f) * distortionAmount; - - Vector2 offset = new Vector2( - (float)Math.Cos(angle) * pulsing * 0.4f + distortion, - -(float)Math.Abs((float)Math.Sin(angle)) * flameHeight - ); - - float scaleVariation = 0.95f + 0.05f * (float)Math.Sin(time * 15f + f * 2f); - Vector2 scale = new Vector2(baseScalePulse * scaleVariation); - - Color flameLayerColor = new Color( - (int)(textColor.R * 0.5f), - (int)(textColor.G * 0.5f), - (int)(textColor.B * 0.5f), - (int)(textColor.A * 0.5f) - ); - - ChatManager.DrawColorCodedString( - spriteBatch, - font, - text, - new Vector2(X, Y) + offset, - flameLayerColor, - rotation, - origin, - scale - ); - } - - // Draw crisp center text - ChatManager.DrawColorCodedString( - spriteBatch, - font, - text, - new Vector2(X, Y), - textColor, - rotation, - origin, - new Vector2(baseScalePulse) - ); - - textColor.A = 255; - - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); - - spriteBatch.Draw(crystalTextGlow, glowPosition, null, lightColor, rotation + MathHelper.PiOver2, new Vector2(6f, 33f), - new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); - - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), Color.Black, rotation, origin, baseScale); - - // Is this a scrapped visual feature of the rarity? - /*int sparkleCount = Main.rand.Next((int)fontSize.X / 7, (int)fontSize.X / 5) + 1; - var color2 = lightColor * 1.00f; - color2.A = 0; - var sparkleOrigin = new Vector2(15f, 15f); - for (int i = 0; i < sparkleCount; i++) - { - var v = new Vector2(Main.rand.NextFloat(fontSize.X), Main.rand.NextFloat(fontSize.Y * 0.6f) + 1f); - float lifeTime = Main.GlobalTimeWrappedHourly * 4f + Main.rand.NextFloat(MathHelper.TwoPi * 7f); - lifeTime %= MathHelper.TwoPi * 1f; - }*/ + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); return; } diff --git a/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index 77b3166b5a..45eb3a0820 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Rarities public static int RarityCosmicPurple => ModContent.GetInstance().Type; public static int RarityBurnishedAuric => ModContent.GetInstance().Type; public static int RarityCalamityRed => ModContent.GetInstance().Type; + public static int RarityExoticRainbow => ModContent.GetInstance().Type; public override bool PreDrawTooltipLine(Item Item, DrawableTooltipLine line, ref int yOffset) @@ -30,6 +31,12 @@ namespace CalamityMod.Rarities CalamityRed.Draw(Item, line); return false; } + + if (Item.rare == RarityExoticRainbow) + { + ExoticRainbow.Draw(Item, line); + return false; + } } return true; } diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 7ede28b514..1c3e382f4a 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -1,13 +1,14 @@ using System; +using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Graphics; -using Terraria.GameContent; using Terraria; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; using Terraria.Utilities; -using Terraria.ID; namespace CalamityMod.Rarities { @@ -19,56 +20,75 @@ namespace CalamityMod.Rarities public static float MaxY = 4.5f; public static Color BloomClr = new Color(65, 38, 87, 0); public static Color TextClr = new Color(103, 66, 138, 255); + public static UnifiedRandom rand = new UnifiedRandom(1); + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + color.A = 255; + float pulsing = 2.5f + (float)Math.Sin(Main.GlobalTimeWrappedHourly * 5f); + for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + { + ChatManager.DrawColorCodedString(spriteBatch, font, text, position + new Vector2(pulsing, 0f).RotatedBy(f + Main.GlobalTimeWrappedHourly * 2f % MathHelper.TwoPi), color with { A = 0 } * 0.5f, 0, Vector2.Zero, new(scale)); + } + ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, position, color * 2f, 0, Vector2.Zero, new(scale)); + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0, Vector2.Zero, new(scale)); + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + return size * Scale; + } + } public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) { var crystalTextGlow = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextGlow").Value; var sparkle = ModContent.Request("CalamityMod/ExtraTextures/UI/CrystalTextSparkle").Value; - var fontSize = font.MeasureString(text); + var fontSize = ChatManager.GetStringSize(font, text, new Vector2(1)); var center = fontSize / 2f; + if (Item.expert) textColor = Main.DiscoColor; - // this was intended behavior. i'm commenting it out for now because it seems like people do not like it. - /* - if (Item.expert) - textColor = Main.DiscoColor; - */ - - var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); - textColor.A = 0; - float pulsing = 2.5f + (float)Math.Sin(time * 5f); - for (float f = 0f; f < MathHelper.TwoPi; f += 0.79f) + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) { - 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); + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text); + } } - textColor.A = 255; - - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, text, new Vector2(X, Y), textColor * 2f, rotation, origin, baseScale); - - var bloomColor = ColorTool.Rainbowing(time * 4 - 0.9f); - + //Draw backglow + var glowPosition = new Vector2(X + center.X, Y + center.Y / 1.5f); spriteBatch.Draw(crystalTextGlow, glowPosition, null, lightColor, rotation + MathHelper.PiOver2, new Vector2(6f, 33f), new Vector2(1.6f, fontSize.X / crystalTextGlow.Height * 1.2f), SpriteEffects.None, 0f); - ChatManager.DrawColorCodedString(spriteBatch, font, text, new Vector2(X, Y), Color.Black, rotation, origin, baseScale); + //Draw text + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X,Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + //Draw sparkles if (!renderTextSparkles) return; - static int Hash(int x) - { - x ^= x >> 16; - x *= unchecked((int)0x7feb352d); - x ^= x >> 15; - x *= unchecked((int)0x846ca68b); - x ^= x >> 16; - return x; - } - - // why was this using a string hash previously?????? - var rand = new UnifiedRandom(Hash((int)(center.X + center.Y))); + rand.SetSeed(1); + int sparkleCount = rand.Next((int)fontSize.X / 7, (int)fontSize.X / 5) + 1; var color2 = lightColor; color2.A = 0; diff --git a/Rarities/ExoticRainbow.cs b/Rarities/ExoticRainbow.cs new file mode 100644 index 0000000000..cf065cc707 --- /dev/null +++ b/Rarities/ExoticRainbow.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +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.Rarities +{ + public class ExoticRainbow : ModRarity + { + // Exotic Rainbow is Rarity 17 (same as Calamity Red) + public override Color RarityColor => TextClr * 2f; + + public static float MaxY = 4.5f; + public static Color BloomClr = new Color(180, 20, 75, 0); + public static Color TextClr = new Color(242, 27, 27, 255); + + public sealed class CustomTextSnippet(string text) : TextSnippet + { + public bool IsExpert = false; + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * scale); + + if (color == default || color == Main.MouseTextColorReal) + { + color = Colors.AlphaDarken(TextClr); + } + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + var font = FontAssets.MouseText.Value; + var time = Main.GlobalTimeWrappedHourly; + + List eColors = new List() + { + new Color(255,107,107), //Ares + new Color(125,196,225), //Thanatos + new Color(211,235,108), //Apollo + //new Color(255,160,71), //Artemis + }; + + if (IsExpert) + eColors = new List() + { + new Color(255,70,70), + new Color(255,70,255), + new Color(70,70,255), + new Color(70,255,255), + new Color(70,255,90), + new Color(255,255,70) + }; + + + var pos = position; + using var lease = ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); + var matrix = spriteBatch.transformMatrix; + using (spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + string txt = ""; + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + foreach (var item in text) + { + + pos = position; + pos.X += FontAssets.MouseText.Value.MeasureString(txt).X; + + float rate = Main.GlobalTimeWrappedHourly * (IsExpert ? 2 : 1) + pos.X * (IsExpert ? 0.01f : 0.005f); + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : MathF.Round(rate % 1f)); + + ChatManager.DrawColorCodedString(spriteBatch, FontAssets.MouseText.Value, item.ToString(), pos, usedColor, 0, Vector2.Zero, new Vector2(scale)); + txt += item; + } + spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, matrix); + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2 / MathHelper.Pi); + sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); + int draws = 16; + for (int i = 0; i < draws; i++) + { + Vector2 backPosition = (MathHelper.TwoPi * i / (float)draws + Main.GlobalTimeWrappedHourly * 1.7f).ToRotationVector2() * (4 + 16 * sine); + spriteBatch.Draw(lease.Target, Vector2.Zero + backPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + + Main.spriteBatch.End(); + + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.125f) + { + spriteBatch.Draw(lease.Target, Vector2.Zero + new Vector2(2, 0).RotatedBy(f), null, Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.End(); + } + } + return true; + } + public override float GetStringLength(DynamicSpriteFont font) + { + float size = font.MeasureString(text).X; + + return size * Scale; + } + } + + public static void Draw(Item Item, SpriteBatch spriteBatch, string text, int X, int Y, Color textColor, Color lightColor, float rotation, + Vector2 origin, Vector2 baseScale, float time, bool renderTextSparkles, DynamicSpriteFont font) + { + // Get all snippets and convert all plain text snippets to the custom rarity snippet + TextSnippet[] snippets = ChatManager.ParseMessage(text, textColor).ToArray(); + for (int i = 0; i < snippets.Length; i++) + { + TextSnippet textSnippet = snippets[i]; + if (snippets[i].GetType() == typeof(TextSnippet)) + { + snippets[i] = new CustomTextSnippet(textSnippet.Text) { IsExpert = Item.expert }; + } + } + + + ChatManager.DrawColorCodedString(spriteBatch, font, snippets, new(X, Y), textColor, 0, Vector2.Zero, baseScale, out _, -1, true); + + return; + } + + public static void Draw(Item Item, string text, int X, int Y, float rotation, Vector2 origin, Vector2 baseScale, Color? textColor = null, Color? lightColor = null, bool? renderTextSparkles = null) + { + Draw(Item, Main.spriteBatch, text, X, Y, Colors.AlphaDarken(textColor ?? TextClr), lightColor ?? BloomClr, rotation, origin, baseScale, Main.GlobalTimeWrappedHourly, + renderTextSparkles ?? CalamityClientConfig.Instance.TextEffects, FontAssets.MouseText.Value); + } + + public static void Draw(Item Item, DrawableTooltipLine line) + { + Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); + } + + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + { + -2 => ModContent.RarityType(), + -1 => ModContent.RarityType(), + _ => Type, + };*/ + } +} 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/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 48c092ed60..54496b4e70 100644 --- a/Systems/Collections/CalamityBuffSets.cs +++ b/Systems/Collections/CalamityBuffSets.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Systems.Collections 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.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(), 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 741a5fe91b..78c5a9789f 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -794,9 +794,6 @@ namespace CalamityMod.Systems // Add 20 Souls of Flight to vanilla Luminite wings { VanillaEach(ItemID.WingsSolar, ItemID.WingsVortex, ItemID.WingsNebula, ItemID.WingsStardust), LunarWingsRecipeEdits }, - - // Berserker's Glove recipe change now that it doesn't provide melee speed - { Vanilla(ItemID.BerserkerGlove), ReplaceIngredient(ItemID.PowerGlove, ItemID.TitanGlove) }, }; // Apply all recipe changes. @@ -1616,7 +1613,7 @@ namespace CalamityMod.Systems r.AddIngredient(ItemID.Silk, 10); r.AddIngredient(ItemID.AntlionMandible, 2); r.AddIngredient(5); - r.AddTile(TileID.Anvils); + r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); 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/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/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/Waters/SulphuricWater.cs b/Waters/SulphuricWater.cs index 267115e3f5..358282396c 100644 --- a/Waters/SulphuricWater.cs +++ b/Waters/SulphuricWater.cs @@ -59,9 +59,9 @@ namespace CalamityMod.Waters { if (Main.dayTime && !Main.raining) { - float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); - if (j > 580) - brightness *= 1f - (j - 580) / 100f; + float brightness = MathHelper.Clamp(0.2f - (j / ((int)Main.worldSurface + 120)), 0f, 0.2f); + if (j > (int)Main.worldSurface + 20) + brightness *= 1f - (j - ((int)Main.worldSurface + 20)) / 100f; float time = Main.GameUpdateCount; float waveScale1 = time * 0.014f; @@ -83,9 +83,9 @@ namespace CalamityMod.Waters if (!Main.dayTime && !Main.raining) { - float brightness = MathHelper.Clamp(0.17f - (j / 680), 0f, 0.17f); - if (j > 580) - brightness *= 1f - (j - 580) / 100f; + float brightness = MathHelper.Clamp(0.17f - (j / ((int)Main.worldSurface + 120)), 0f, 0.17f); + if (j > ((int)Main.worldSurface + 20)) + brightness *= 1f - (j - ((int)Main.worldSurface + 20)) / 100f; float waveScale1 = Main.GameUpdateCount * 0.014f; float waveScale2 = Main.GameUpdateCount * 0.1f; @@ -106,9 +106,9 @@ namespace CalamityMod.Waters if (Main.raining) { - float brightness = MathHelper.Clamp(1f - (j / 680), 0f, 1f); - if (j > 580) - brightness *= 1f - (j - 580) / 100f; + float brightness = MathHelper.Clamp(1f - (j / ((int)Main.worldSurface + 120)), 0f, 1f); + if (j > ((int)Main.worldSurface + 20)) + brightness *= 1f - (j - ((int)Main.worldSurface + 20)) / 100f; outputColor = Vector3.Lerp(outputColor, Color.LightSeaGreen.ToVector3(), 0.41f); outputColor *= brightness;