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/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index e8d05be133..9135f782d7 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -126,11 +126,11 @@ internal static readonly float LifeStealRecoveryRate_Classic = 0.6f; internal static readonly float LifeStealRecoveryRate_Expert = 0.5f; - // Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s) - internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f; + // Nerfs the life steal recovery rate in Classic from 0.6 to 0.15 (36 HP/s to 9 HP/s) + internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.45f; - // Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s) - internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f; + // Nerfs the life steal recovery rate in Expert from 0.5 to 0.1 (30 HP/s to 6 HP/s) + internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.4f; #endregion #region Rogue Base Stats diff --git a/Buffs/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/Bane.cs b/Buffs/DamageOverTime/Bane.cs index a31e16ea46..c429af3dda 100644 --- a/Buffs/DamageOverTime/Bane.cs +++ b/Buffs/DamageOverTime/Bane.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.DamageOverTime public static Color baneColor2 = new Color(0, 232, 146); public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 90, + EnemyLostRegen = 40, NPCLifeRegenMethod = BaneNPCLifeRegen }; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs index 27cbd603f0..5065122406 100644 --- a/Buffs/DamageOverTime/SagePoison.cs +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -1,4 +1,5 @@ using CalamityMod.DataStructures; +using CalamityMod.Projectiles.Summon; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,8 +18,17 @@ namespace CalamityMod.Buffs.DamageOverTime public static float ViridVanguardPoisonMultiplier => 2; public static void SagePoisonPower(NPC npc, int buffType, ref int buffIndex, ref int damage) { - // The base DoT is multiplied by the amount of Viral Sprouts you have when applied - // See SageNeedle.cs for details + int viralCount = 0; + int viridCount = 0; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + viralCount++; + if (item.type == ModContent.ProjectileType()) + viridCount++; + } + if ((viralCount + viridCount) <= 0) + return; //Reduce power of weakness/resistances but leave sickness debuff boosters at full power //We first need to apply Irradiated as that isn't included in SicknessDebuffMultiplier due to needing to dynamically update if Irradiated is applied @@ -39,8 +49,9 @@ namespace CalamityMod.Buffs.DamageOverTime multiplier *= NewResistanceEffectiveness; //Apply the DOT - int baseSagePoisonDoTValue = (int)multiplier.ApplyTo(npc.Calamity().sagePoisonDamage); - npc.Calamity().ApplyDPSDebuff(baseSagePoisonDoTValue, baseSagePoisonDoTValue / 5, ref npc.lifeRegen, ref damage); + float SagePoisonRegen = (viralCount + ViridVanguardPoisonMultiplier * viridCount) * debuffData.EnemyLostRegen; + int totalDoT = (int)multiplier.ApplyTo(SagePoisonRegen); + npc.Calamity().ApplyDPSDebuff(totalDoT, totalDoT/(2*(viridCount+viralCount)), ref npc.lifeRegen, ref damage); } public override void SetStaticDefaults() { diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index cfeafcdb55..e7eb641700 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.DamageOverTime { public static DebuffData debuffData = new DebuffData() { - EnemyLostRegen = 3996, //6x the tick size + EnemyLostRegen = 2664, //4x the tick size HeatDebuffScaling = 1, MinimumDamageTickSize = 666, //Vhex should always have ticks of 666 MultiplierDamageTickSize = 0 @@ -41,9 +41,6 @@ namespace CalamityMod.Buffs.DamageOverTime cgn.trueVulnerabilityHex = true; if (cgn.VulnerabilityHexFireDrawer != null) cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex]; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0) - cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - } internal static void DrawEffects(NPC npc, ref Color drawColor) diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index e10223020b..87e8b8d1b7 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -34,8 +34,6 @@ namespace CalamityMod.Buffs.DamageOverTime public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().vaporfied = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/DamageOverTime/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/Pets/StarSwallowerPetBuff.cs b/Buffs/Pets/StarSwallowerPetBuff.cs new file mode 100644 index 0000000000..210bc1ebf6 --- /dev/null +++ b/Buffs/Pets/StarSwallowerPetBuff.cs @@ -0,0 +1,17 @@ +using CalamityMod.Projectiles.Pets; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class StarSwallowerPetBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) => player.BuffHandle_SpawnPetIfNeededAndSetTime(buffIndex, ref player.Calamity().starSwallowerPetFroge, ModContent.ProjectileType()); + } +} diff --git a/Buffs/Pets/StarSwallowerPetBuff.png b/Buffs/Pets/StarSwallowerPetBuff.png new file mode 100644 index 0000000000..7a12cb7a9a Binary files /dev/null and b/Buffs/Pets/StarSwallowerPetBuff.png differ 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/ChiBuff.cs b/Buffs/StatBuffs/ChiBuff.cs index d1c94aef0d..1465a83301 100644 --- a/Buffs/StatBuffs/ChiBuff.cs +++ b/Buffs/StatBuffs/ChiBuff.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Accessories; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs @@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.endurance += 0.08f; + player.endurance += TrinketofChi.ChiBuffDamageReductionBoost; } } } diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index 0ae91c9625..6400ba9f56 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -9,13 +9,12 @@ 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()); public override void SetStaticDefaults() { - Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; } diff --git a/Buffs/StatDebuffs/Eutrophication.cs b/Buffs/StatDebuffs/Eutrophication.cs index eca32f09f7..0074bd591e 100644 --- a/Buffs/StatDebuffs/Eutrophication.cs +++ b/Buffs/StatDebuffs/Eutrophication.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().eutrophication = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } internal static void DrawEffects(PlayerDrawSet drawInfo) diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 018e738c30..512476ef2d 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs; +using CalamityMod.DataStructures; +using CalamityMod.NPCs; using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; @@ -14,13 +15,17 @@ namespace CalamityMod.Buffs.StatDebuffs Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; BuffID.Sets.LongerExpertDebuff[Type] = true; + BuffDatasets.DebuffDataset[Type] = debuffData; } + // Purely to make it get electric color in tooltips + public static DebuffData debuffData = new DebuffData() + { + ElectricDebuffScaling = 1 + }; public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().galvanicCorrosion = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } public override void Update(Player player, ref int buffIndex) diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs deleted file mode 100644 index dc312681fa..0000000000 --- a/Buffs/StatDebuffs/GlacialState.cs +++ /dev/null @@ -1,28 +0,0 @@ -using CalamityMod.NPCs; -using CalamityMod.Systems.Collections; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatDebuffs -{ - public class GlacialState : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = true; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - BuffID.Sets.LongerExpertDebuff[Type] = true; - } - - public override void Update(NPC npc, ref int buffIndex) - { - npc.Calamity().glacialState = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; - } - } -} diff --git a/Buffs/StatDebuffs/GlacialState.png b/Buffs/StatDebuffs/GlacialState.png deleted file mode 100644 index 9513cc9d37..0000000000 Binary files a/Buffs/StatDebuffs/GlacialState.png and /dev/null differ diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index 943fefca48..cb132c8399 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -17,8 +17,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().temporalSadness = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/StatDebuffs/TimeDistortion.cs b/Buffs/StatDebuffs/TimeDistortion.cs index 3f84b4677e..bd6dd3e8a1 100644 --- a/Buffs/StatDebuffs/TimeDistortion.cs +++ b/Buffs/StatDebuffs/TimeDistortion.cs @@ -19,8 +19,6 @@ namespace CalamityMod.Buffs.StatDebuffs public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().timeDistortion = true; - if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } } } diff --git a/Buffs/Summon/DemonshadeSetDevilBuff.cs b/Buffs/Summon/DemonshadeSetDevilBuff.cs deleted file mode 100644 index b9c589fc3a..0000000000 --- a/Buffs/Summon/DemonshadeSetDevilBuff.cs +++ /dev/null @@ -1,12 +0,0 @@ -using CalamityMod.Projectiles.Typeless; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class DemonshadeSetDevilBuff : BaseSummonBuff - { - protected override int MinionProjectileType => ModContent.ProjectileType(); - - protected override ref bool MinionBool => ref BuffModdedOwner.rDevil; - } -} diff --git a/Buffs/Summon/DemonshadeSetDevilBuff.png b/Buffs/Summon/DemonshadeSetDevilBuff.png deleted file mode 100644 index 2bf486ac3e..0000000000 Binary files a/Buffs/Summon/DemonshadeSetDevilBuff.png and /dev/null differ diff --git a/Buffs/Summon/VoidConcentrationBuff.cs b/Buffs/Summon/VoidConcentrationBuff.cs index 21e2ca5ce2..4e1c27ecbf 100644 --- a/Buffs/Summon/VoidConcentrationBuff.cs +++ b/Buffs/Summon/VoidConcentrationBuff.cs @@ -1,34 +1,14 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class VoidConcentrationBuff : ModBuff + public class VoidConcentrationBuff : BaseSummonBuff { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - //Main.persistentBuff[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer mp = player.Calamity(); - int count = player.ownedProjectileCounts[ModContent.ProjectileType()]; - player.GetDamage() += 0.05f; //5% - mp.voidConcentrationAura = true; - if (!mp.voidAuraDamage && count == 0) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } + protected override ref bool MinionBool => ref BuffModdedOwner.VoidConcentrationStaff; + protected override int MinionProjectileType => ModContent.ProjectileType(); } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3b28f81093..5c8b19da0f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -132,6 +132,7 @@ namespace CalamityMod.CalPlayer /// If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. public bool noLifeRegen = false; public float ammoCost = 1f; + public float partialLifeRegen = 0f; public float healingPotionMultiplier = 1f; /// /// Tracks whether or not the player is currently holding Gael's Greatsword.
@@ -186,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; @@ -311,6 +312,7 @@ namespace CalamityMod.CalPlayer #endregion #region Timer and Counter + public float partialLifeRegenCounter = 0f; public int gaelSwipes = 0; public int arsenalCooldown = 0; public int killModeCooldown = 0; @@ -326,15 +328,6 @@ namespace CalamityMod.CalPlayer public int deadSunCounter = 6; public int DragonsBreathAudioCooldown = 0; public int DragonsBreathAudioCooldown2 = 0; - public int darklightEnergy = 0; - public int darklightEnergyTimer = 0; - public bool darklightEnergyPaused = false; - public bool darklightEnergyMaxFXPlayed = false; - private int lucreciaParticleTimer = 0; - public int elementalMastery = 0; - public int elementalMasteryTimer = 0; - public bool elementalMasteryPaused = false; - public bool elementalMasterySFXPlayed = false; public float unstableCastersGauntletVis = 0; public int unstableCastersGauntletVisTimer = 0; public int PhotoAudioCooldown = 0; @@ -343,11 +336,6 @@ namespace CalamityMod.CalPlayer public int arpeggioCooldown = 0; /// Cooldown variable which prevents using Burning Sea during its "burn-out" mechanic. public int burningSeaBurnOut = 0; - /// - /// How many stacks of Evil Smasher's boost the player has. This increases the weapon's damage, use speed, and knockback.
- /// Getting hit decreases this by 1. Switching to a different item resets this to 0. - ///
- public int evilSmasherBoost = 0; /// Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. public int plagueTaintedSMGDroneCooldown = 0; /// Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. @@ -375,6 +363,9 @@ namespace CalamityMod.CalPlayer public int amputatorBuff = 0; /// Variable used to track the current fuel amount for Pristine Fury's right-click. public int furyFuel = 1800; + /// Variable to track the healing over time gained from Grand Dad. + public int grandDadHealPool = 0; + public int grandDadHealTimer = 0; public const int FuryFuelMax = 1800; public float furyRefuelTimer = 0; /// Variable used to track if Auger can do its big slash attack. @@ -598,6 +589,7 @@ namespace CalamityMod.CalPlayer public bool lordePet = false; public bool frostyBat = false; public bool toastyBat = false; + public bool starSwallowerPetFroge = false; #endregion #region Rage @@ -914,12 +906,16 @@ namespace CalamityMod.CalPlayer public bool lAmbergrisVisual = false; public bool tortShell = false; public bool absorber = false; + /// + /// Used for detetcing life regen hindering debuffs + /// + bool _hasNoNaturalRegen = false; public bool hadLifeRegenHinderingDebuff = false; public bool alwaysHoneyRegen = false; public float alwaysHoneyRegenAmount = 0; public bool honeyTurboRegen = false; - public bool honeyDewHalveDebuffs = false; - public bool livingDewHalveDebuffs = false; + public bool honeyDew = false; + public bool livingDew = false; public int jewelBonusDefense = 0; /// /// Counter variable for spawning Toxic Heart's pulses.
@@ -933,8 +929,6 @@ namespace CalamityMod.CalPlayer public float pulseRate = 1; public bool aAmpoule = false; public bool rOoze = false; - public float radiantOozeRegen = 0; - public float purityRegen = 0; public bool fBarrier = false; public bool aBrain = false; public bool amalgam = false; @@ -955,8 +949,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; @@ -977,6 +975,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; @@ -994,7 +995,6 @@ namespace CalamityMod.CalPlayer public bool purity = false; /// If true, reduces the damage of electricity debuffs by 50%. public bool eleResist = false; - public int PurityHealSlowdownFrames = 0; public bool harpyRing = false; public bool angelTreads = false; /// Makes Flesh Knuckles and its upgrades increase the player's max health. @@ -1040,9 +1040,9 @@ namespace CalamityMod.CalPlayer public int fallingBootVelCheckTimer = 0; public bool voidOfCalamity = false; public bool apollyon = false; - public bool eArtifact = false; - public bool dArtifact = false; - public bool auricSArtifact = false; + public bool fragmentsOfAnotherWorld = false; + public bool crushingEgo = false; + public bool fadedIdolatry = false; public bool pSoulArtifact = false; public bool giantPearl = false; public bool shieldOfTheOcean = false; @@ -1099,7 +1099,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; @@ -1114,6 +1116,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; @@ -1283,6 +1286,7 @@ namespace CalamityMod.CalPlayer public bool plaguebringerPatronSet = false; public bool plaguebringerCarapace = false; public float ataxiaDmg; + public float hydroHealTimer = 0; public bool ataxiaMage = false; public bool ataxiaGeyser = false; public float xerocDmg; @@ -1314,8 +1318,6 @@ namespace CalamityMod.CalPlayer public bool daedalusCrystal = false; /// Hydrothermic armor's summoner set bonus minion. public bool chaosSpirit = false; - /// Demonshade armor's set bonus minion. - public bool redDevil = false; public bool GemTechSet = false; /// Calamity's Cobalt armor set bonus; increases damage and crit chance based on how fast the player is moving. public bool CobaltSet = false; @@ -1571,8 +1573,6 @@ namespace CalamityMod.CalPlayer /// Pearl of Enthrallment. public bool waterEleBuff = false; public bool fClump = false; - /// Demonshade armor's Red Devil. - public bool rDevil = false; /// Aerospec armor's Valkyrie. public bool aValkyrie = false; public bool apexShark = false; @@ -1599,9 +1599,7 @@ namespace CalamityMod.CalPlayer public bool plaguebringerMK2 = false; public bool igneousExaltation = false; public bool GlacialEmbrace = false; - public bool voidAura = false; - public bool voidAuraDamage = false; - public bool voidConcentrationAura = false; + public bool VoidConcentrationStaff = false; public bool MutatedTruffleBool = false; public bool virili = false; public bool frostBlossom = false; @@ -2290,6 +2288,7 @@ namespace CalamityMod.CalPlayer lordePet = false; frostyBat = false; toastyBat = false; + starSwallowerPetFroge = false; onyxExcavator = false; rimehound = false; @@ -2404,18 +2403,19 @@ namespace CalamityMod.CalPlayer lAmbergris = false; tortShell = false; absorber = false; - honeyDewHalveDebuffs = false; - livingDewHalveDebuffs = false; + honeyDew = false; + livingDew = false; aAmpoule = false; rOoze = false; - radiantOozeRegen = 0; - purityRegen = 0; fBarrier = false; aBrain = false; amalgam = false; frostFlare = false; evolution = false; + v8Engine = false; + v8000Engine = false; nanotech = false; + nanotechHitCooldown = 0; deadshotBrooch = false; tesla = false; teslaVisuals = true; @@ -2451,6 +2451,8 @@ namespace CalamityMod.CalPlayer stressPills = false; laudanum = false; fleshTotem = false; + fleshTotemVisual = false; + fleshTotemMinion = false; bloodPact = false; bloodflareCore = false; chaliceOfTheBloodGod = false; @@ -2468,9 +2470,9 @@ namespace CalamityMod.CalPlayer baroclaw = false; voidOfCalamity = false; apollyon = false; - eArtifact = false; - dArtifact = false; - auricSArtifact = false; + fragmentsOfAnotherWorld = false; + crushingEgo = false; + fadedIdolatry = false; pSoulArtifact = false; giantPearl = false; shieldOfTheOcean = false; @@ -2531,6 +2533,7 @@ namespace CalamityMod.CalPlayer lunicCorpsLegs = false; ammoCost = 1f; + partialLifeRegen = 0f; healingPotionMultiplier = 1f; avertorBonus = false; @@ -2635,6 +2638,7 @@ namespace CalamityMod.CalPlayer eclipseMirror = false; featherCrown = false; moonCrown = false; + mageCrownVisibility = false; dragonScales = false; gloveOfPrecision = false; gloveOfRecklessness = false; @@ -2645,6 +2649,7 @@ namespace CalamityMod.CalPlayer sandCloak = false; spectralVeil = false; hasJetpack = false; + hasEngineDash = false; plaguedFuelPack = false; blunderBooster = false; blunderBoosterVisibility = true; @@ -2828,7 +2833,6 @@ namespace CalamityMod.CalPlayer brimEleBuff = false; waterEleBuff = false; fClump = false; - rDevil = false; aValkyrie = false; sCrystal = false; sGod = false; @@ -2855,7 +2859,6 @@ namespace CalamityMod.CalPlayer fungalClumpVanity = false; howlsHeart = false; howlsHeartVanity = false; - redDevil = false; valkyrie = false; slimeGod = false; chaosSpirit = false; @@ -2870,9 +2873,7 @@ namespace CalamityMod.CalPlayer plaguebringerMK2 = false; igneousExaltation = false; GlacialEmbrace = false; - voidAura = false; - voidAuraDamage = false; - voidConcentrationAura = false; + VoidConcentrationStaff = false; saros = false; if (sarosEclipseBeamUsage > 300) sarosEclipseBeamUsage = 300; @@ -3070,6 +3071,7 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.IsAir || Player.HeldItem.fishingPole == 0) consecutiveCaughtFish = 0; heldGaelsLastFrame = false; + partialLifeRegenCounter = 0f; gaelSwipes = 0; whitewaterHeal = 0; luxorHit = false; @@ -3131,7 +3133,7 @@ namespace CalamityMod.CalPlayer andromedaCripple = 0; theBeeCooldown = 0; scuttlerCooldown = 0; - rogueCrownCooldown = 0; + mageCrownTimer = 0; wingProjectileCooldown = 0; hallowedRuneCooldown = 0; sulphurBubbleCooldown = 0; @@ -3189,7 +3191,6 @@ namespace CalamityMod.CalPlayer vaporfied = false; banishingFire = false; wither = false; - PurityHealSlowdownFrames = 0; ImmobilityDebuffImmunityTimer = 0; TypelessDebuffMultiplier = new(); HeatDebuffMultiplier = new(); @@ -3305,6 +3306,7 @@ namespace CalamityMod.CalPlayer healCounter = 300; danceOfLightCharge = 0; ammoCost = 1f; + partialLifeRegen = 0f; healingPotionMultiplier = 1f; avertorBonus = false; divineBless = false; @@ -3449,12 +3451,9 @@ namespace CalamityMod.CalPlayer CurrentlyViewedHologramText = string.Empty; #endregion - evilSmasherBoost = 0; burningSeaBurnOut = 0; flareGunOverheat = 0; hellbornShots = 0; - darklightEnergy = 0; - elementalMastery = 0; garandShots = 0; persecutedEnchantSummonTimer = 0; momentumCapacitorTime = 0; @@ -4857,6 +4856,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() { @@ -5039,6 +5061,9 @@ namespace CalamityMod.CalPlayer if (gSabaton && Player.whoAmI == Main.myPlayer) Player.jumpSpeedBoost += 2f; } + + //Update life regen that needs to happen before calculating debuffs + GeneralLifeRegen(); } #endregion @@ -5062,7 +5087,8 @@ namespace CalamityMod.CalPlayer //Flashlight //Due to being in postUpdate we need to adjust the mousepos for the player's movement that will have happened - var mouseworld = Main.MouseWorld + Player.position - Player.oldPosition; + mouseWorldListener = true; + var mouseworld = mouseWorld + Player.position - Player.oldPosition; EnhancedDarknessSystem.lights.Add(new(center: Player.Center + Player.DirectionTo(mouseworld) * 750f, rotation: Player.DirectionTo(mouseworld).ToRotation() - MathHelper.PiOver2, vectorScale: new Vector2(0.85f * abyssFlashlightWidthMultiplier, 0.75f), texture: Request("CalamityMod/Particles/BloomLineFade").Value)); } @@ -5163,11 +5189,11 @@ 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) + - (getSandCloakAccelBoost ? 0.75f : 0f) + + (getSandCloakAccelBoost ? Items.Accessories.SandCloak.SandVeilAccelerationBoost : 0f) + (ascendantInsignia ? (AscendantInsignia.AccelerationBoost - 0.25f) : 0f) + // Subtracted 0.25 provided by Soaring Insignia (statisNinjaBelt ? 0.6f : 0f) + (statisVoidSash ? 0.85f : 0f) + @@ -5183,7 +5209,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) + @@ -5521,6 +5547,8 @@ namespace CalamityMod.CalPlayer { Main.projectile[p].DamageType = DamageClass.Generic; //Makes it not proc shit like nanotech, extorter and other stuff Main.projectile[p].Calamity().LocketClone = true; //To not have clones trigger effects like Sacrifice's Lifesteal and Final Dawn's stealth generation + + Projectile.NewProjectile(LocketSource, Main.projectile[p].Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Player.whoAmI); // Spawn a little portal! } // Handle AI edge-cases. These are like overlapping projectiles and the projectile not spawning at all @@ -5896,32 +5924,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 @@ -6091,12 +6093,6 @@ namespace CalamityMod.CalPlayer stealthGenMoving += ShadowPotion.StealthRegenBoost; } - if (eArtifact) - { - stealthGenStandstill += 0.15f; - stealthGenMoving += 0.15f; - } - // Accessory modifiers can boost these stats stealthGenStandstill += accStealthGenBoost; stealthGenMoving += accStealthGenBoost; @@ -6303,6 +6299,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 38b829bd1e..696a0eaee5 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; @@ -594,7 +595,19 @@ namespace CalamityMod.CalPlayer { if (proj.npcProj || proj.trap) return; - + + //Add raider crit before hit + if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f) + { + if (nanotech) + proj.CritChance += Items.Accessories.Nanotech.RaiderBonus; + else if (vampiricTalisman) + proj.CritChance += VampiricTalisman.RaiderBonus; + else if (raiderTalisman) + proj.CritChance += RaidersTalisman.RaiderBonus; + } + + modifiers.CritDamage += critDamage; // All Calamity multipliers are added together to prevent insane exponential stacking @@ -790,10 +803,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 +1092,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); @@ -1628,7 +1636,7 @@ namespace CalamityMod.CalPlayer #region Player Incoming Damage Multiplier (Increases) double damageMult = 1D; - if (dArtifact) // Dimensional Soul Artifact increases incoming damage by 15%. + if (crushingEgo) // Dimensional Soul Artifact increases incoming damage by 15%. damageMult += 0.15; if (enraged) // Demonshade Enrage damageMult += DemonshadeHelm.MultDamageTakenBoost; @@ -2220,9 +2228,6 @@ namespace CalamityMod.CalPlayer LoseAdrenalineOnHurt(hurtInfo, false); } - if (evilSmasherBoost > 0) - evilSmasherBoost -= 1; - if (trinketOfChi) chiBuffTimer = 0; @@ -2232,7 +2237,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) { @@ -2249,10 +2254,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) { @@ -2269,7 +2274,7 @@ namespace CalamityMod.CalPlayer dust.scale = Main.rand.NextFloat(1.6f, 2.2f); } } - tortShellPostHit = 180; + tortShellPostHit = GiantTortoiseShell.PostHitCancelDuration; } if (aquaticHeartIce) @@ -2329,11 +2334,35 @@ 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 b181b14c72..6f769e1c50 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -48,22 +48,22 @@ namespace CalamityMod.CalPlayer { int totalVanillaDoT = 0; - if (Player.poisoned && !purity) + if (Player.poisoned) totalVanillaDoT += 4; - if (Player.onFire && !purity) + if (Player.onFire) totalVanillaDoT += 8; if (Player.tongued) totalVanillaDoT += 100; - if (Player.venom && !purity) + if (Player.venom) totalVanillaDoT += 12; - if (Player.onFrostBurn && !purity) + if (Player.onFrostBurn) totalVanillaDoT += 12; - if (Player.onFire2 && !purity) + if (Player.onFire2) totalVanillaDoT += 12; if (Player.burned) @@ -72,7 +72,7 @@ namespace CalamityMod.CalPlayer if (Player.suffocating) totalVanillaDoT += 40; - if (Player.electrified && !purity) + if (Player.electrified) { totalVanillaDoT += eleResist ? 4 : 8; if (Player.controlLeft || Player.controlRight) @@ -101,38 +101,38 @@ namespace CalamityMod.CalPlayer // Whispering Death sets positive regen to zero but doesn't actually deal any damage ApplyDoTDebuff(whisperingDeath, 0, laudanum); - ApplyDoTDebuff(irradiated, 4, purity); + ApplyDoTDebuff(irradiated, 4); int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0); - ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity); - ApplyDoTDebuff(riptide, 6, purity); + ApplyDoTDebuff(sulphurPoison, sulphurDoT); + ApplyDoTDebuff(riptide, 6); ApplyDoTDebuff(weakBrimstoneFlames, 7); - ApplyDoTDebuff(burningBlood, 8, purity); - ApplyDoTDebuff(brainRot, 8, purity); - ApplyDoTDebuff(vaporfied, 8, purity); + ApplyDoTDebuff(burningBlood, 8); + ApplyDoTDebuff(brainRot, 8); + ApplyDoTDebuff(vaporfied, 8); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); - ApplyDoTDebuff(staticDischarge, staticDoT, purity); - ApplyDoTDebuff(heavybleeding, 16, purity); - ApplyDoTDebuff(crushDepth, 18, purity); - ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); - ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(brimstoneFlames, 30, purity); - ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f)), purity); + ApplyDoTDebuff(staticDischarge, staticDoT); + ApplyDoTDebuff(heavybleeding, 16); + ApplyDoTDebuff(crushDepth, 18); + ApplyDoTDebuff(astralInfection, 24, hideOfDeus); + ApplyDoTDebuff(shadowflame, 30); + ApplyDoTDebuff(brimstoneFlames, 30); + ApplyDoTDebuff(plague, (int)MathF.Round(30 * (alchFlask ? (1f - AlchemicalDecanter.PlagueReduction) : 1f))); ApplyDoTDebuff(vHex, 30); // Has other effects ApplyDoTDebuff(searingLava, 30); - ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player - ApplyDoTDebuff(laceration, 36, purity); - ApplyDoTDebuff(daybroken, 40, purity); - ApplyDoTDebuff(bane, 40, purity); - ApplyDoTDebuff(nightwither, 40, purity); - ApplyDoTDebuff(holyFlames, 40, purity); - ApplyDoTDebuff(voidfrost, 40, purity); - ApplyDoTDebuff(hadopelagicPressure, 40, purity); + ApplyDoTDebuff(demonicFlames, 33); // Never inflicted on the player + ApplyDoTDebuff(laceration, 36); + ApplyDoTDebuff(daybroken, 40); + ApplyDoTDebuff(bane, 40); + ApplyDoTDebuff(nightwither, 40); + ApplyDoTDebuff(holyFlames, 40); + ApplyDoTDebuff(voidfrost, 40); + ApplyDoTDebuff(hadopelagicPressure, 40); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); - ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player + ApplyDoTDebuff(elementalMix, 50); // Never inflicted on the player ApplyDoTDebuff(trueVHex, 50); int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); @@ -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; @@ -276,25 +275,23 @@ namespace CalamityMod.CalPlayer bool hasLifeRegenHinderingDebuff = Player.lifeRegenTime == 0; - #region Life Regen That Works Even During DoT Debuffs - if (honeyDewHalveDebuffs) - { - // Tick down all sickness debuffs; this makes them expire 2x faster - // Upgrades increase the sets of debuffs which expire faster - for (int l = 0; l < Player.MaxBuffs; ++l) - { - int buffID = Player.buffType[l]; - if (Player.buffTime[l] <= 2 || BuffDatasets.DebuffDataset[buffID] is null) - continue; - bool shouldHalveDuration = BuffDatasets.DebuffDataset[buffID].SicknessDebuffScaling > 0; - if (livingDewHalveDebuffs) - shouldHalveDuration |= BuffDatasets.DebuffDataset[buffID].HeatDebuffScaling > 0; - if (purity) - shouldHalveDuration |= CalamityBuffSets.IsDebuff[buffID]; - if (shouldHalveDuration) - --Player.buffTime[l]; - } + #region Life Regen That Works Even During DoT Debuffs + + //Negation of debuffs. These all will not take life regen above 0 + if (Player.lifeRegen < 0) + { + if (crownJewel) + Player.lifeRegen += CrownJewel.ReducedDoTAmount; + + if (infectedJewel) + Player.lifeRegen += InfectedJewel.ReducedDoTAmount; + + if (purity) + Player.lifeRegen += Radiance.ReducedDoTAmount; + + if (Player.lifeRegen > 0) + Player.lifeRegen = 0; } if (divineBless) @@ -308,19 +305,6 @@ namespace CalamityMod.CalPlayer if (bloodfinBoost) { - if (Player.lifeRegen < 0) - { - if (Player.lifeRegenTime < Bloodfin.DebuffedRegenTimeFloor) - Player.lifeRegenTime = Bloodfin.DebuffedRegenTimeFloor; - - Player.lifeRegen += Bloodfin.DebuffedRegenBoost; - } - else - { - Player.lifeRegen += Bloodfin.RegenBoost; - Player.lifeRegenTime += Bloodfin.RegenTimeBoost; - } - if (bloodfinTimer > 0) bloodfinTimer--; @@ -328,124 +312,37 @@ namespace CalamityMod.CalPlayer { bloodfinTimer = Bloodfin.FramesForExtraRegen; - if (Player.statLife < (int)(Player.statLifeMax2 * Bloodfin.ExtraRegenHealthThreshold) && !noLifeRegen) + if (!noLifeRegen) Player.HealPlayer(1, HealTextType.None); } } // Permafrost's Concoction increases life regen while afflicted with a fire debuff if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0)) - { - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; - Player.lifeRegen += 6; - } - // Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity - if (rOoze || aAmpoule || purity) + if (grandDadHealTimer == 0 && grandDadHealPool >= 7) { - float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2; - //Ambrosial Ampule and ooze give between 2 and 5 hp/s - int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(RadiantOoze.MinRegenBoost, RadiantOoze.MaxRegenBoost, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. - Player.lifeRegen += lifeRegenToGive; - radiantOozeRegen += lifeRegenToGive / 2f; - purityRegen += lifeRegenToGive / 2f; + Player.HealPlayer(7, HealTextType.Broadcast); + grandDadHealPool -= 7; + grandDadHealTimer = (int)(30 * Utils.GetLerpValue(260, 60, grandDadHealPool, true)); } + else if (grandDadHealTimer > 0) + grandDadHealTimer--; - if (purity) + //Raising natural regen post-damaging-debuff + if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) { - int intendedPurityDefense = 0; - int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); - if (currentDebuffs > 0) - { - // Healing rate is normally 5 HP/s (+1 every 12 frames) - // However, that 12 frames can and will slowly increase if you try to abuse this accessory - int healFrameCadence = 12; + if (infectedJewel) + Player.lifeRegenTime += InfectedJewel.PostDebuffRegenTimeBoost; - // Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows - // The upper limit to how slow it can get is after 15 seconds (900 frames) - int punishmentFrames = PurityHealSlowdownFrames - 300; - //lowest punishment is a little under a second between the one health heal - if (healFrameCadence < 52) - healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15; + if (purity) + Player.lifeRegenTime += Radiance.PostDebuffRegenTimeBoost; - if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) - Player.Heal(1); - - intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; - if (jewelBonusDefense < intendedPurityDefense) - jewelBonusDefense = intendedPurityDefense; - - // Count up total frames spent healing for slowdown. - if (PurityHealSlowdownFrames < 900) - ++PurityHealSlowdownFrames; - purityRegen += (60 / (float)healFrameCadence); - } - - // If the defense should be ticking down to some lower value, do that. - // Purity loses 1 point of defense every second. - if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense) - --jewelBonusDefense; - - // If the player is clear of all debuffs then gradually reduce the slowdown frames - if (currentDebuffs <= 0) - { - --PurityHealSlowdownFrames; - if (PurityHealSlowdownFrames < 0) - PurityHealSlowdownFrames = 0; - } - - // Actually apply defense bonus - Player.statDefense += jewelBonusDefense; - } - - // Infected Jewel does not stack with Purity - else if (infectedJewel) - { - Player.lifeRegen += 2; - - // If the player has any debuffs, give the extra life regen and defense - // More defense is given for each additional debuff - int intendedJewelDefense = 0; - int currentDebuffs = Player.buffType.Count(i => CalamityBuffSets.IsDebuff[i]); - if (currentDebuffs > 0) - { - Player.lifeRegen += 4; - - intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; - if (jewelBonusDefense < intendedJewelDefense) - jewelBonusDefense = intendedJewelDefense; - } - - // If the defense should be ticking down to some lower value, do that. - // Infected Jewel loses 1 point of defense every 20 frames. - if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense) - --jewelBonusDefense; - - // Actually apply defense bonus - Player.statDefense += jewelBonusDefense; - } - - // Crown Jewel does not stack with Purity or Infected Jewel - else if (crownJewel) - { - Player.lifeRegen += 2; - - // If any debuff is detected, provide even more life regen - if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) - Player.lifeRegen += 3; - } - - //If a player had a life regen hindering debuff, add 30 seconds to their regen time when under Tequila Sunrise - //This stacks with all other post-debuff boosts due to Tequila Sunrise increasing DoT damage taken - if (tequilaSunrise) - { - if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff) - { + if (tequilaSunrise) Player.lifeRegenTime += 1800; - } } + #endregion // During Silva revive or God Slayer dash, all negative life regen is canceled @@ -520,24 +417,43 @@ namespace CalamityMod.CalPlayer // The bleedout is applied by directly reducing the player's health. It is not canceled by anything. ChaliceOfTheBloodGod.HandleBleedout(Player); - //Finally, update the state of hadLifeRegenHinderingDebuff for next frame. - hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff; + //Finally, update the state of hadLifeRegenHinderingDebuff for next frame. Needs to check for 2 frames of 0 regen time to be sure they had a debuff + hadLifeRegenHinderingDebuff = hasLifeRegenHinderingDebuff && _hasNoNaturalRegen; + _hasNoNaturalRegen = hasLifeRegenHinderingDebuff; } #endregion #region Update Life Regen - public override void UpdateLifeRegen() + //This method runs BEFORE UpdateBadLifeRegen. Put most effects here. Ran at the end of PostUpdateEquips + public void GeneralLifeRegen() { + // Apply partial life regeneration + // Regenerator applies partial life regen as a part of its damage conversion straight up, so it will avoid this function + if (regenerator) + partialLifeRegenCounter = 0f; + else + { + partialLifeRegenCounter += partialLifeRegen; + if (partialLifeRegenCounter >= 1f || partialLifeRegenCounter <= -1f) + { + int flooredRegenAdded = (int)MathF.Floor(partialLifeRegenCounter); + Player.lifeRegen += flooredRegenAdded; + partialLifeRegenCounter -= flooredRegenAdded; + } + } + + float lifeRatio = (Player.statLife) / (float)Player.statLifeMax2; + if (mushy) Player.lifeRegen += Mushy.RegenBoost; if (permafrostsConcoction) { - if (Player.statLife < actualMaxLife / 2) + if (lifeRatio <= 0.5f) Player.lifeRegen++; - if (Player.statLife < actualMaxLife / 4) + if (lifeRatio <= 0.25f) Player.lifeRegen++; - if (Player.statLife < actualMaxLife / 10) + if (lifeRatio <= 0.1f) Player.lifeRegen += 2; } @@ -553,6 +469,25 @@ namespace CalamityMod.CalPlayer if (PinkJellyRegen) Player.lifeRegen += LifeJelly.AuraRegenBoost; + if (rOoze) + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(RadiantOoze.MaxRegenBoost, RadiantOoze.MinRegenBoost, lifeRatio)); + + if (livingDew) + Player.lifeRegenTime += LivingDew.RegenTimeBoost; + + if (aAmpoule) + { + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(AmbrosialAmpoule.MaxRegenBoost, AmbrosialAmpoule.MinRegenBoost, lifeRatio)); + Player.lifeRegenTime += AmbrosialAmpoule.RegenTimeBoost; + } + + if (purity) + { + Player.lifeRegen += (int)Math.Round(MathHelper.Lerp(Radiance.MaxRegenBoost, Radiance.MinRegenBoost, lifeRatio)); + Player.lifeRegenTime += Radiance.RegenTimeBoost; + } + + if (GreenJellyRegen) Player.lifeRegen += Items.Accessories.GrandGelatin.AuraRegenBoost; @@ -566,7 +501,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += Affliction.RegenBoost; if (trinketOfChi || chiRegen) - Player.lifeRegen += 2; + Player.lifeRegen += TrinketofChi.RegenBoost; if (darkSunRing) { @@ -577,6 +512,12 @@ namespace CalamityMod.CalPlayer if (silvaSet) Player.lifeRegen += SilvaArmor.SetBonusRegenBoost; + if (angelicAlliance) + { + if (Player.wingTime < Player.wingTimeMax) + Player.lifeRegen += AngelicAlliance.RegenBoostDuringFlight; + } + if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000) { Player.lifeRegen += PhantomicArtifact.RegenBoost; @@ -592,6 +533,27 @@ namespace CalamityMod.CalPlayer regen.position = Player.Center - velocity; } } + if (fearmongerSet && fearmongerRegenFrames > 0) + { + if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor) + Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor; + + Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost; + Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost; + } + if (handWarmer && eskimoSet) + { + Player.lifeRegen += 2; + } + } + + //This method runs AFTER UpdateBadLifeRegen. Only put effects that should bypass debuff DoT canceling here. + public override void UpdateLifeRegen() + { + if (avertorBonus) + { + Player.lifeRegen += 4; + } if (community) { @@ -606,22 +568,10 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += lesserEffect ? 1 : regenBoost; } - if (handWarmer && eskimoSet) + if (manaOverloader) { - Player.lifeRegen += 2; - } - if (avertorBonus) - { - Player.lifeRegen += 4; - } - - if (fearmongerSet && fearmongerRegenFrames > 0) - { - if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor) - Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor; - - Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost; - Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost; + float manaRatio = Player.statMana / (float)Player.statManaMax2; + Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f)); } if (pinkCandle && !noLifeRegen) @@ -638,12 +588,6 @@ namespace CalamityMod.CalPlayer else pinkCandleHealFraction = 0D; - if (manaOverloader) - { - float manaRatio = Player.statMana / (float)Player.statManaMax2; - Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f)); - } - #region Standing Still Life Regen // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0 && (shadeRegen || cFreeze)) @@ -729,6 +673,16 @@ namespace CalamityMod.CalPlayer public override void NaturalLifeRegen(ref float regen) { + // Honey Dew and its upgrades make natural regen more powerful + if (purity) + regen *= Radiance.NaturalRegenPower; + else if (aAmpoule) + regen *= AmbrosialAmpoule.NaturalRegenPower; + else if (livingDew) + regen *= LivingDew.NaturalRegenPower; + else if (honeyDew) + regen *= HoneyDew.NaturalRegenPower; + // The Camper counteracts the regen loss while moving horizontally if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0)) { @@ -751,13 +705,13 @@ namespace CalamityMod.CalPlayer // Regenerator trades all positive regen for damage, and caps your health gain at 50% if (regenerator) { - int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); - finalRegen = (int)Math.Max(finalRegen, 0); + float finalRegen = Player.lifeRegen + partialLifeRegen + MathF.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); + finalRegen = MathF.Max(finalRegen, 0f); // Rapid Healing increments RegenCount directly so it needs to be manually added // It also works while debuffs are active so the same logic applies here if (Player.palladiumRegen) - finalRegen += 4; + finalRegen += 4f; regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio; Player.GetDamage() += regeneratorDamage; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 8bdb1af27c..1650cbdd85 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -45,6 +45,7 @@ using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; @@ -154,9 +155,6 @@ namespace CalamityMod.CalPlayer // Drawing parameters UpdateDrawingParameters(); - // Handle Lucrecia's passive energy effects - HandleLucreciaLineEffects(); - // Update all particle sets for items. // This must be done here instead of in the item logic because these sets are not properly instanced // in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items. @@ -213,17 +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.GetProjectileSource_Item_WithPotentialAmmo(Player.HeldItem, 0), Player.Center, Player.Center.DirectionTo(Player.Calamity().mouseWorld), ModContent.ProjectileType(), damage, Player.HeldItem.knockBack, Player.whoAmI); } } @@ -302,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 @@ -347,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) { @@ -364,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) { @@ -408,120 +411,6 @@ namespace CalamityMod.CalPlayer Player.wingTime++; } - if (Player.HeldItem.type == ModContent.ItemType() && darklightEnergy > 0) - { - if (darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyPaused) - { - darklightEnergyPaused = true; - darklightEnergyTimer = 0; - } - - darklightEnergyTimer++; - - // If the energy is at max, pause for 180 ticks - if (darklightEnergyPaused) - { - if (darklightEnergyTimer >= 1 && !darklightEnergyMaxFXPlayed) - { - SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); - SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); - - for (int i = 0; i < 10; i++) // Circular ring of particles burst from player - { - float angle = MathHelper.TwoPi * (i / 10f); - Vector2 spawnDirection = angle.ToRotationVector2(); - Vector2 velocity = spawnDirection * 14f; - - CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); - GeneralParticleHandler.SpawnParticle(spark); - } - darklightEnergyMaxFXPlayed = true; - } - - // If the pause is Done, resume decrementing. - if (darklightEnergyTimer >= 180) - { - darklightEnergyPaused = false; - darklightEnergyTimer = 0; - darklightEnergy--; - } - } - else // Decrementing - { - darklightEnergyMaxFXPlayed = false; - // Once every 20 ticks - if (darklightEnergyTimer >= 20) - { - darklightEnergy--; - darklightEnergyTimer = 0; - } - } - } - else - { - // Reset all energy variables when not holding the weapon - darklightEnergyTimer = 0; - darklightEnergyPaused = false; - darklightEnergy = 0; - } - - if (Player.HeldItem.type == ModContent.ItemType() && elementalMastery > 0) - { - if (elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryPaused) - { - elementalMasteryPaused = true; - elementalMasteryTimer = 0; - } - - elementalMasteryTimer++; - - // If the mastery is at max, pause for 180 ticks - if (elementalMasteryPaused) - { - if (elementalMasteryTimer >= 1 && !elementalMasterySFXPlayed) - { - SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); - SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); - - for (int i = 0; i < 10; i++) // Circular ring of particles burst from player - { - float angle = MathHelper.TwoPi * (i / 10f); - Vector2 spawnDirection = angle.ToRotationVector2(); - Vector2 velocity = spawnDirection * 14f; - - CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); - GeneralParticleHandler.SpawnParticle(spark); - } - elementalMasterySFXPlayed = true; - } - // If the pause is Done, resume decrementing. - if (elementalMasteryTimer >= 180) - { - elementalMasteryPaused = false; - elementalMasteryTimer = 0; - elementalMastery--; - } - } - else // Decrementing - { - elementalMasterySFXPlayed = false; - // Once every 30 ticks - if (elementalMasteryTimer >= 30) - { - elementalMastery--; - elementalMasteryTimer = 0; - } - } - } - else - { - // Reset all EM variables when not holding the weapon - elementalMasteryTimer = 0; - elementalMasteryPaused = false; - elementalMastery = 0; - } - - if (Player.HeldItem.type == ModContent.ItemType() && unstableCastersGauntletVis < 100) { @@ -569,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; @@ -640,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); } } @@ -683,17 +596,6 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - // Hallowed Armor nerf - if (Player.onHitDodge) - { - for (int l = 0; l < Player.MaxBuffs; l++) - { - int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge) - Player.buffTime[l] = 600; - } - } - // Immunity Frames nerf int immuneTimeLimit = 150; if (Player.immuneTime > immuneTimeLimit) @@ -1121,12 +1023,17 @@ namespace CalamityMod.CalPlayer // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. - int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType() : ModContent.BuffType(); - if (!target.HasBuff(buffToInflict)) - target.AddBuff(buffToInflict, 52); - target.buffTime[target.FindBuffIndex(buffToInflict)] += 8; - if (target.buffTime[target.FindBuffIndex(buffToInflict)] < VulnerabilityHex.CalamityDuration) - target.buffTime[target.FindBuffIndex(buffToInflict)] = VulnerabilityHex.CalamityDuration; + int buffToInflict = target.Calamity().trueVulnerabilityHex ? ModContent.BuffType() : ModContent.BuffType(); + if (!target.buffImmune[buffToInflict]) + { + if (!target.HasBuff(buffToInflict)) + target.AddBuff(buffToInflict, 52); + + int index = target.FindBuffIndex(buffToInflict); + + if (index != -1) + target.buffTime[index] = Math.Max(target.buffTime[index] + 8, VulnerabilityHex.CalamityDuration); + } // Make some fancy dust to indicate damage is being done. for (int j = 0; j < 12; j++) @@ -1342,7 +1249,7 @@ namespace CalamityMod.CalPlayer } if (brittleStar && brittleStarBuffMode) - Player.statDefense += 4 * Player.ownedProjectileCounts[ModContent.ProjectileType()]; + Player.statDefense += BrittleStarStaff.DefenseBoostPerBuffStar * Player.ownedProjectileCounts[ModContent.ProjectileType()]; // Reduce the rate of recovery of the Lifesteal variable // Classic Mode: 36 HP/s to 12 HP/s @@ -1463,19 +1370,31 @@ namespace CalamityMod.CalPlayer } } - // Hydrothermal blue smoke effects but it doesn't work epicccccc if (Player.whoAmI == Main.myPlayer) { - if (hydrothermalSmoke) + if (hydrothermalSmoke && !Main.dedServ) { + // Release effects when the player moves. if (Math.Abs(Player.velocity.X) > 0.1f || Math.Abs(Player.velocity.Y) > 0.1f) { - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(HydrothermicArmor.VanitySmokeEntitySourceContext); - Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + if (Main.rand.NextBool(6)) + { + int fieryDust = Dust.NewDust(Player.Top + Vector2.UnitY, 20, 42, DustID.Flare, 0f, 0f, 100, default, 0.7f); + if (Main.rand.NextBool(4)) + { + Main.dust[fieryDust].scale *= 0.35f; + } + Main.dust[fieryDust].velocity *= 0f; + } + + if (Main.rand.NextBool(2)) + { + float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); + MediumMistParticle mist = new MediumMistParticle(Player.Top + Vector2.UnitY, -Player.velocity + new Vector2(0.5f, upwardVariation), Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.Black, Color.Black, Main.rand.NextFloat(0.4f, 0.65f), 130); + GeneralParticleHandler.SpawnParticle(mist); + } } } - // Trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working if (!Player.armorEffectDrawOutlines) { hydrothermalSmoke = false; @@ -1686,7 +1605,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - Player.HealPlayer(15); + Player.HealPlayer(10); if (profanedCrystal) { @@ -1934,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) { @@ -2111,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) { @@ -2173,7 +2128,7 @@ namespace CalamityMod.CalPlayer if (whitewaterHeal > 0) { - if (whitewaterHeal % 15 == 0) + if (whitewaterHeal % 20 == 0) Player.HealPlayer(1); whitewaterHeal--; @@ -2297,10 +2252,8 @@ namespace CalamityMod.CalPlayer bloodflareMageCooldown--; if (silvaMageCooldown > 0) silvaMageCooldown--; - if (scuttlerCooldown > 0) - scuttlerCooldown--; - if (rogueCrownCooldown > 0) - rogueCrownCooldown--; + if (nanotechHitCooldown > 0) + nanotechHitCooldown--; if (spectralVeilImmunity > 0) spectralVeilImmunity--; if (jetPackDash > 0) @@ -2356,6 +2309,10 @@ namespace CalamityMod.CalPlayer ataxiaDmg -= 1.5f; if (ataxiaDmg < 0f) ataxiaDmg = 0f; + if (hydroHealTimer > 0f) + hydroHealTimer -= 0.05f; + if (ataxiaDmg < 0f) + ataxiaDmg = 0f; if (xerocDmg > 0f) xerocDmg -= 2f; if (xerocDmg < 0f) @@ -2748,12 +2705,6 @@ namespace CalamityMod.CalPlayer } } - // Raider Talisman bonus - if (raiderTalisman && !vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f) - Player.GetCritChance() += RaidersTalisman.RaiderBonus; - if (vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f) - Player.GetCritChance() += VampiricTalisman.RaiderBonus; - if (avertorBonus) Player.GetDamage() += 0.1f; @@ -2766,8 +2717,8 @@ namespace CalamityMod.CalPlayer { if (Player.isNearFairy()) { - Player.lifeRegen += 4; - Player.statDefense += 6; + Player.lifeRegen += 2; + Player.statDefense += 4; Player.moveSpeed += 0.1f; } } @@ -2825,7 +2776,7 @@ namespace CalamityMod.CalPlayer if (permafrostsConcoction) { Player.manaCost -= 0.15f; - Player.statManaMax2 += 50; + Player.statManaMax2 += 40; } if (encased) @@ -2844,10 +2795,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) { @@ -3461,14 +3412,13 @@ namespace CalamityMod.CalPlayer if (graxDefense) { Player.statDefense += Grax.DefenseBoost; - Player.endurance += Grax.DamageReductionBoost; Player.GetDamage() += Grax.DamageBoost; } // Trinket of Chi bonus if (trinketOfChi) { - if (chiBuffTimer < TrinketofChi.ChiBuffTimerMax) + if (chiBuffTimer < TrinketofChi.ChiBuffHitlessTime) chiBuffTimer++; else Player.AddBuff(ModContent.BuffType(), 6); @@ -3513,7 +3463,7 @@ namespace CalamityMod.CalPlayer if (giantShellPostHit > 0) { - Player.statDefense -= 3; + Player.statDefense -= GiantShell.DefenseBoost; giantShellPostHit--; } if (giantShellPostHit < 0) @@ -3529,11 +3479,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) { @@ -3551,7 +3501,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 } @@ -3660,11 +3610,6 @@ namespace CalamityMod.CalPlayer if (Player.HeldItem.type != ModContent.ItemType()) planarSpeedBoost = 0; } - if (evilSmasherBoost > 0) - { - if (Player.HeldItem.type != ModContent.ItemType()) - evilSmasherBoost = 0; - } // Flight time boosts double flightTimeMult = 1D + @@ -3748,24 +3693,24 @@ namespace CalamityMod.CalPlayer if (tarraSet) Player.lifeMagnet = true; - if (whisperingDeath && !laudanum && !purity) + if (whisperingDeath && !laudanum) Player.GetDamage() -= 0.2f; - if (armorCrunch && !laudanum && !purity) + if (armorCrunch && !laudanum) { Player.statDefense -= ArmorCrunch.DefenseReduction; Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer; } - if (wither && !purity) + if (wither) { Player.statDefense -= RemsRevenge.WitherDefenseReduction; } - if (eutrophication && !purity) + if (eutrophication) Player.velocity = Vector2.Zero; - if ((vaporfied && !purity) || galvanicCorrosion) + if (vaporfied || galvanicCorrosion) Player.velocity *= 0.98f; if (molluskHelmet) @@ -3775,7 +3720,7 @@ namespace CalamityMod.CalPlayer if (molluskLegs) Player.velocity.X *= 0.996f; - if ((warped) && !Player.slowFall && !Player.mount.Active) + if (warped && !Player.slowFall && !Player.mount.Active) { float velocityYMultiplier = 1.01f; Player.velocity.Y *= velocityYMultiplier; @@ -3846,10 +3791,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) @@ -4016,13 +3961,7 @@ namespace CalamityMod.CalPlayer Player.npcTypeNoAggro[ModContent.NPCType()] = true; } - if (eArtifact) - { - Player.manaCost -= 0.25f; - Player.maxMinions++; - } - - if (auricSArtifact && Player.FindBuffIndex(ModContent.BuffType()) != -1) + if (fadedIdolatry && Player.FindBuffIndex(ModContent.BuffType()) != -1) Player.maxMinions += Player.ownedProjectileCounts[ModContent.ProjectileType()]; if (pSoulArtifact) @@ -4457,7 +4396,7 @@ namespace CalamityMod.CalPlayer // Add any multiplicative damage bonuses here float multiplicativeDamage = 1; - if (dArtifact) + if (crushingEgo) multiplicativeDamage += 0.2f; if (WarbanneroftheRighteous) multiplicativeDamage += warbannerDamageMult; @@ -4466,82 +4405,6 @@ namespace CalamityMod.CalPlayer } #endregion - #region Lucrecia Line Effects - - public void HandleLucreciaLineEffects() - { - int lucreciaItemID = ModContent.ItemType(); - int lightspeedItemID = ModContent.ItemType(); - - if (Player.HeldItem.type == lucreciaItemID && darklightEnergy > 0) - { - lucreciaParticleTimer--; - - // If the timer is at or below zero, spawn a particle. - if (lucreciaParticleTimer <= 0) - { - // Reset the timer (spawn rate depends on energy) - lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60)); - - float radius = Main.rand.NextFloat(160f, 190f); // Distance from center - float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius - - Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; - - // Scale opacity with energy - float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy; - Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue; - color *= opacity * 0.5f; - - if (darklightEnergy >= 100) - { - color *= 2.4f; // Way brighter - } - - Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path - float rotationSpeed = 0.04f; - - var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); - GeneralParticleHandler.SpawnParticle(particle); - } - } - - if (Player.HeldItem.type == lightspeedItemID && elementalMastery > 0) - { - lucreciaParticleTimer--; - - // If the timer is at or below zero, spawn a particle. - if (lucreciaParticleTimer <= 0) - { - // Reset the timer (spawn rate depends on energy) - lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60)); - - float radius = Main.rand.NextFloat(160f, 190f); // Distance from center - float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius - - Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; - - // Scale opacity with energy - float opacity = elementalMastery / (float)Lightspeed.MaxEnergy; - Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed; - color *= opacity * 0.5f; - - if (elementalMastery >= 100) - { - color *= 2.4f; // Way brighter - } - - Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path - float rotationSpeed = 0.04f; - - var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); - GeneralParticleHandler.SpawnParticle(particle); - } - } - } - #endregion - - #region Energy Shields private void EnergyShields() { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 478ec02a8b..21b30df04d 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -54,7 +54,7 @@ namespace CalamityMod.CalPlayer if (AdamantiteSet) { - adamantiteSetDefenseBoostInterpolant += 1.75f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays; + adamantiteSetDefenseBoostInterpolant += 1f / AdamantiteArmorSetChange.TimeUntilBoostCompletelyDecays; adamantiteSetDefenseBoostInterpolant = MathHelper.Clamp(adamantiteSetDefenseBoostInterpolant, 0f, 1f); AdamantiteSetDecayDelay = AdamantiteArmorSetChange.TimeUntilDecayBeginsAfterAttacking; } @@ -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) @@ -226,6 +212,17 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI != Main.myPlayer) return; + //Undo raider crit after hit + if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f) + { + if (nanotech) + proj.CritChance -= Items.Accessories.Nanotech.RaiderBonus; + else if (vampiricTalisman) + proj.CritChance -= VampiricTalisman.RaiderBonus; + else if (raiderTalisman) + proj.CritChance -= RaidersTalisman.RaiderBonus; + } + // Apply this to player equippable sources ie. Orichalcum set bonus petal spawns // Do not apply if this effect is an extension of a weapon ie. Pearl God round effect as it will mess up Old Fashioned var source = Player.GetSource_OnHit(target); @@ -249,7 +246,7 @@ namespace CalamityMod.CalPlayer if (proj.IsMinionOrSentryRelated) center = proj.Center; Vector2 launchVel = Utils.DirectionTo(center, target.Center); - target.MoveNPC(launchVel, proj.knockBack, true); + target.MoveNPC(launchVel, proj.knockBack, true, Player); } if (moscowMule || bloodyMary) @@ -272,11 +269,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 +285,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 +299,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 +745,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); @@ -903,7 +886,7 @@ namespace CalamityMod.CalPlayer { if (Player.ownedProjectileCounts[ProjectileType()] < 3 && Main.rand.NextBool(4)) { - int damage = (int)Player.GetTotalDamage().ApplyTo(100); + int damage = (int)Player.GetTotalDamage().ApplyTo(PhantomicArtifact.DaggerDamage); Projectile.NewProjectile(source, Player.Center, new Vector2(Player.velocity.X,Player.velocity.Y-10).RotatedByRandom(0.3f), ProjectileType(), damage, 1f, Player.whoAmI); } } @@ -1058,10 +1041,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 +1054,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) @@ -1127,8 +1075,7 @@ namespace CalamityMod.CalPlayer if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); - // TO DO: Add nanotech here - Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default"); + Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, nanotech ? "Nanotech" : vampiricTalisman ? "Vampiric" : "default"); if (raiderSoundCooldown <= 0) { SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, Player.Center); @@ -1139,12 +1086,12 @@ namespace CalamityMod.CalPlayer if (npcCheck) { // Umbraphile cannot trigger off of itself. It is guaranteed on stealth strikes and 20% chance otherwise. - if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) || Main.rand.NextBool(5))) + if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) || Main.rand.NextBool(5)) && !modProj.CannotProc) { int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * UmbraphileHood.ExplosionDamageRatio, UmbraphileHood.ExplosionDamageSoftcap); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), umbraBlastDamage, 0f, Player.whoAmI); } - if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) + if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3 && !modProj.CannotProc) { for (int s = 0; s < 3; s++) { @@ -1221,12 +1168,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,28 +1280,27 @@ namespace CalamityMod.CalPlayer if (heal > 2) heal = 2; - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.2f : 1.5f); } - if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike && proj.numHits < 1) + if (bloodyGlove && proj.CountsAsClass() && (modProj.stealthStrike || (nanotech && raiderCritLifespan > 0)) && proj.numHits < 1) //Nanotech has the same heal as Electrician's glove - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f); - - if (bloodflareThrowing && proj.CountsAsClass() && crit) - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, 1.5f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, electricianGlove ? 2f : 3f); if (proj.CountsAsClass() && Player.HeldItem.CountsAsClass()) { if (manaOverloader) { double healMult = 0.1D - proj.numHits * 0.025D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.75f); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 2f); } - if (ataxiaMage) + if (ataxiaMage && hydroHealTimer <= 0) { double healMult = HydrothermicHeadMagic.OrbHealingRatio - proj.numHits * HydrothermicHeadMagic.OrbHealingRatioLossPerPierce; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), HydrothermicHeadMagic.OrbHealingCooldownMult); + var heal = (int)Math.Round(damage * healMult); + hydroHealTimer += heal; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), heal, HydrothermicHeadMagic.OrbHealingCooldownMult); } } } diff --git a/CalPlayer/Dashes/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/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs index 74ea062c1e..6907aada5b 100644 --- a/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs +++ b/CalPlayer/DrawLayers/ConcentratedVoidAuraLayer.cs @@ -14,7 +14,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { Player drawPlayer = drawInfo.drawPlayer; CalamityPlayer modPlayer = drawPlayer.Calamity(); - return drawInfo.shadow == 0f && !drawPlayer.dead && (modPlayer.voidAura || modPlayer.voidAuraDamage); + return drawInfo.shadow == 0f && !drawPlayer.dead && modPlayer.VoidConcentrationStaff; } protected override void Draw(ref PlayerDrawSet drawInfo) diff --git a/CalPlayer/DrawLayers/SpringStoolBottom.png b/CalPlayer/DrawLayers/SpringStoolBottom.png new file mode 100644 index 0000000000..9c11a5cf0d Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolBottom.png differ diff --git a/CalPlayer/DrawLayers/SpringStoolLayer.cs b/CalPlayer/DrawLayers/SpringStoolLayer.cs new file mode 100644 index 0000000000..5343d50ce5 --- /dev/null +++ b/CalPlayer/DrawLayers/SpringStoolLayer.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.ExtraJumps; +using CalamityMod.Items.Accessories; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; +using static Terraria.ModLoader.PlayerDrawLayer; + +namespace CalamityMod.CalPlayer.DrawLayers +{ + public class SpringStoolLayer : PlayerDrawLayer + { + private Asset stoolTexture; + private Asset springTexture; + private Asset topTexture; + + public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Leggings); + + public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) + { + // Only draw if the player is holding Up and still + return drawInfo.drawPlayer.GetModPlayer().springStool && + drawInfo.drawPlayer.portableStoolInfo.IsInUse; + } + + protected override void Draw(ref PlayerDrawSet drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + + // Load textures if null + stoolTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolBottom"); + springTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolSpring"); + topTexture ??= ModContent.Request("CalamityMod/CalPlayer/DrawLayers/SpringStoolTop"); + + Texture2D stoolTex = stoolTexture.Value; + Texture2D springTex = springTexture.Value; + Texture2D topTex = topTexture.Value; + + // Bottom Position + Vector2 bottomPosition = new Vector2( + (int)(drawInfo.Position.X - Main.screenPosition.X + drawPlayer.width / 2f), + (int)(drawInfo.Position.Y - Main.screenPosition.Y + drawPlayer.height + drawPlayer.portableStoolInfo.HeightBoost) + ); + Rectangle bottomSource = stoolTex.Frame(); + Vector2 bottomOrigin = new Vector2(bottomSource.Width / 2f, bottomSource.Height - 2); + + // Spring + Vector2 springPosition = bottomPosition - new Vector2(0, bottomSource.Height); + Rectangle springSource = springTex.Frame(); + Vector2 springOrigin = new Vector2(springSource.Width / 2f, springSource.Height - 2); + + // Top + Vector2 topPosition = springPosition - new Vector2(0, springSource.Height - 5); + Rectangle topSource = topTex.Frame(); + Vector2 topOrigin = new Vector2(topSource.Width / 2f, topSource.Height); + + // Add all to cache + DrawPart(ref drawInfo, stoolTex, bottomPosition, bottomSource, bottomOrigin); + DrawPart(ref drawInfo, springTex, springPosition, springSource, springOrigin); + DrawPart(ref drawInfo, topTex, topPosition, topSource, topOrigin); + } + + private void DrawPart(ref PlayerDrawSet drawInfo, Texture2D tex, Vector2 pos, Rectangle src, Vector2 origin) + { + drawInfo.DrawDataCache.Add(new DrawData(tex, pos, src, drawInfo.colorArmorLegs, drawInfo.drawPlayer.bodyRotation, origin, 1f, drawInfo.playerEffect, 0) + { shader = drawInfo.cPortableStool }); + } + } +} diff --git a/CalPlayer/DrawLayers/SpringStoolSpring.png b/CalPlayer/DrawLayers/SpringStoolSpring.png new file mode 100644 index 0000000000..82271ba49b Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolSpring.png differ diff --git a/CalPlayer/DrawLayers/SpringStoolTop.png b/CalPlayer/DrawLayers/SpringStoolTop.png new file mode 100644 index 0000000000..0cdc45e3ef Binary files /dev/null and b/CalPlayer/DrawLayers/SpringStoolTop.png differ diff --git a/CalamityConfig.cs b/CalamityConfig.cs index af43e1923a..7c72d2f83d 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -46,6 +46,10 @@ namespace CalamityMod [DefaultValue(false)] public bool Photosensitivity { get; set; } + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + public bool BoCSpriteChange { get; set; } + [BackgroundColor(192, 54, 64, 192)] [DefaultValue(true)] public bool EnableVanillaTextureEdits { get; set; } diff --git a/CalamityKeybinds.cs b/CalamityKeybinds.cs index 235da907f4..62b5f44039 100644 --- a/CalamityKeybinds.cs +++ b/CalamityKeybinds.cs @@ -18,6 +18,7 @@ namespace CalamityMod public static ModKeybind NormalityRelocatorHotKey { get; private set; } public static ModKeybind RageHotKey { get; private set; } public static ModKeybind SpectralVeilHotKey { get; private set; } + public static ModKeybind SpringStoolJumpHotKey { get; private set; } public static ModKeybind TransformerHotKey { get; private set; } public static ModKeybind SwitchGravityHotkey {get; private set;} public static ModKeybind ExpandDebuffInfo { get; private set; } @@ -40,6 +41,7 @@ namespace CalamityMod NormalityRelocatorHotKey = KeybindLoader.RegisterKeybind(Mod, "NormalityRelocator", "Z"); RageHotKey = KeybindLoader.RegisterKeybind(Mod, "RageMode", "V"); SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z"); + SpringStoolJumpHotKey = KeybindLoader.RegisterKeybind(Mod, "SpringStoolJumpHotKey", "U"); TransformerHotKey = KeybindLoader.RegisterKeybind(Mod, "TransformerHotKey", "K"); SwitchGravityHotkey = KeybindLoader.RegisterKeybind(Mod, "GravitySwapOverride", "T"); ExpandDebuffInfo = KeybindLoader.RegisterKeybind(Mod, "ExpandDebuffInfo", "LeftControl"); @@ -62,6 +64,7 @@ namespace CalamityMod NormalityRelocatorHotKey = null; RageHotKey = null; SpectralVeilHotKey = null; + SpringStoolJumpHotKey = null; TransformerHotKey = null; ExpandDebuffInfo = null; } diff --git a/ChatTags/CalamityBuffTagHandler.cs b/ChatTags/BuffTagEnemyEffectHandler.cs similarity index 97% rename from ChatTags/CalamityBuffTagHandler.cs rename to ChatTags/BuffTagEnemyEffectHandler.cs index d8f36a5862..c7f9735176 100644 --- a/ChatTags/CalamityBuffTagHandler.cs +++ b/ChatTags/BuffTagEnemyEffectHandler.cs @@ -11,7 +11,7 @@ using Terraria.UI.Chat; namespace CalamityMod.ChatTags { - public sealed class CalamityBuffTagHandler : AbstractTagHandler + public sealed class BuffTagEnemyEffectHandler : AbstractTagHandler { public sealed class Snippet(int buffId) : TextSnippet { diff --git a/ChatTags/BuffTagPlayerEffectHandler.cs b/ChatTags/BuffTagPlayerEffectHandler.cs new file mode 100644 index 0000000000..7a2c145c4f --- /dev/null +++ b/ChatTags/BuffTagPlayerEffectHandler.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; + +namespace CalamityMod.ChatTags +{ + public sealed class BuffTagPlayerEffectHandler : AbstractTagHandler + { + public sealed class Snippet(int buffId) : TextSnippet + { + private const float IconSize = 26f; + + public int BuffId => buffId; + + public bool DrawIcon => true; + + public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = default, Color color = default, float scale = 1) + { + size = new Vector2(GetStringLength(FontAssets.MouseText.Value), IconSize); + + if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0)) + { + // Avoid re-drawing the icon when drawing borders. + if (DrawIcon) + { + // Tomat: I would love to support + // BuffLoader.[Pre/Post]Draw here, but it's not vaible + // because: + // 1. Main.DrawBuffIcon relies on LocalPlayer's buffs, + // 2. we can't control the source or destination + // rectangles. + + if (Main.netMode != NetmodeID.Server && !Main.dedServ) + { + var texture = TextureAssets.Buff[BuffId]; + spriteBatch.Draw(texture.Value, new Rectangle((int)position.X, (int)position.Y - 2, (int)IconSize, (int)IconSize), null, Color.White); + } + + position.X += IconSize; + } + + var buffColor = CalamityUtils.GetDebuffTooltipNameColor(buffId); + var name = $"{(DrawIcon ? " " : "")}{Lang.GetBuffName(buffId)}"; + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, name, position, buffColor, 0f, Vector2.Zero, new Vector2(scale)); + } + return true; + } + + public override float GetStringLength(DynamicSpriteFont font) + { + float iconSize = !DrawIcon ? 0f : IconSize + font.MeasureString(" ").X; + float size = iconSize + font.MeasureString(Lang.GetBuffName(buffId)).X; + return size * Scale; + } + } + + protected override string[] TagNames { get; } = ["cbuffplr"]; + + public override TextSnippet Parse(string text, Color baseColor = new(), string options = null) + { + if (int.TryParse(text, out int buffId) && buffId >= 0 && buffId < BuffLoader.BuffCount) + { + return new Snippet(buffId); + } + + if (BuffID.Search.TryGetId(text, out buffId)) + { + return new Snippet(buffId); + } + + return new TextSnippet(text); + } + } +} diff --git a/ChatTags/CustomColorEffectHandler.cs b/ChatTags/CustomColorEffectHandler.cs new file mode 100644 index 0000000000..b99db87773 --- /dev/null +++ b/ChatTags/CustomColorEffectHandler.cs @@ -0,0 +1,156 @@ +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; +using Terraria; +using Terraria.GameContent; +using Terraria.UI.Chat; + +namespace CalamityMod.ChatTags +{ + // This is a tag handler for storing custom color effects for text all within the "ceffect" tag; the parameter determining the actual effect in use. + // i.e [ceffect/darksun:Hello World] would apply darksun effect to "Hello World". + public sealed class CustomColorEffectHandler : AbstractTagHandler + { + 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); + } + } + + public sealed class DarksunTextSnippet(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 font = FontAssets.MouseText.Value; + var BorderColor = new Color(255, 191, 73); + var HazeColor = new Color(238, 226, 153); + + for (float f = 0f; f < MathHelper.TwoPi; f += MathHelper.TwoPi * 0.05f) + { + ChatManager.DrawColorCodedString(spriteBatch, font, text, position + new Vector2(2, 0).RotatedBy(f + Main.GlobalTimeWrappedHourly), Color.Lerp(BorderColor, HazeColor, (Main.mouseTextColor - 190) / 65f * 0.1f), 0f, Vector2.Zero, new Vector2(scale)); + } + ChatManager.DrawColorCodedString(spriteBatch, font, text, position, Color.Black, 0f, Vector2.Zero, new Vector2(scale)); + } + 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; + return size * Scale; + } + } +} diff --git a/Cooldowns/FleshTotem.cs b/Cooldowns/FleshTotem.cs deleted file mode 100644 index 8b1fe7812f..0000000000 --- a/Cooldowns/FleshTotem.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria.Localization; - -namespace CalamityMod.Cooldowns -{ - public class FleshTotem : CooldownHandler - { - public static new string ID => "FleshTotem"; - - public override bool ShouldDisplay => true; - public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/FleshTotem"; - public override Color OutlineColor => new Color(157, 248, 234); - public override Color CooldownStartColor => new Color(111, 169, 241); - public override Color CooldownEndColor => new Color(111, 169, 241); - } -} diff --git a/Cooldowns/FleshTotem.png b/Cooldowns/FleshTotem.png deleted file mode 100644 index 02416e8b00..0000000000 Binary files a/Cooldowns/FleshTotem.png and /dev/null differ diff --git a/Cooldowns/FleshTotemOutline.png b/Cooldowns/FleshTotemOutline.png deleted file mode 100644 index 19a1f705eb..0000000000 Binary files a/Cooldowns/FleshTotemOutline.png and /dev/null differ diff --git a/Cooldowns/FleshTotemOverlay.png b/Cooldowns/FleshTotemOverlay.png deleted file mode 100644 index 7bb57aee77..0000000000 Binary files a/Cooldowns/FleshTotemOverlay.png and /dev/null differ diff --git a/Cooldowns/NanotechBoost.png b/Cooldowns/NanotechBoost.png new file mode 100644 index 0000000000..430bd3b98c Binary files /dev/null and b/Cooldowns/NanotechBoost.png differ diff --git a/Cooldowns/NanotechBoostOutline.png b/Cooldowns/NanotechBoostOutline.png new file mode 100644 index 0000000000..cdd0da28cc Binary files /dev/null and b/Cooldowns/NanotechBoostOutline.png differ diff --git a/Cooldowns/NanotechBoostOverlay.png b/Cooldowns/NanotechBoostOverlay.png new file mode 100644 index 0000000000..d1000ec9a4 Binary files /dev/null and b/Cooldowns/NanotechBoostOverlay.png differ diff --git a/Cooldowns/RaiderBoost.cs b/Cooldowns/RaiderBoost.cs index 79bb9ae02d..9ea22fb9fd 100644 --- a/Cooldowns/RaiderBoost.cs +++ b/Cooldowns/RaiderBoost.cs @@ -26,7 +26,14 @@ namespace CalamityMod.Cooldowns { switch (skin) { - case "Bloodfeast": + case "Nanotech": + skinTexture = "NanotechBoost"; + outlineColor = new Color(14, 103, 129); + cooldownColorStart = new Color(85, 252, 229); + cooldownColorEnd = new Color(52,255,171); + break; + + case "Vampiric": skinTexture = "VampiricTalismanBoost"; outlineColor = new Color(143, 27, 27); cooldownColorStart = new Color(133, 5, 5); diff --git a/Cooldowns/Stooldown.cs b/Cooldowns/Stooldown.cs new file mode 100644 index 0000000000..888044482c --- /dev/null +++ b/Cooldowns/Stooldown.cs @@ -0,0 +1,30 @@ +using System; +using CalamityMod.Items.Accessories; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Cooldowns +{ + public class Stooldown : CooldownHandler + { + public static new string ID => "Stooldown"; + public override bool ShouldDisplay => true; + public override bool CanTickDown => true; + public override void Tick() + { + base.Tick(); + } + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/Stooldown"; + public override Color OutlineColor => Color.SandyBrown; + public override Color CooldownStartColor => Color.Brown; + public override Color CooldownEndColor => Color.Khaki; + + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff"); + } +} diff --git a/Cooldowns/Stooldown.png b/Cooldowns/Stooldown.png new file mode 100644 index 0000000000..60913ece69 Binary files /dev/null and b/Cooldowns/Stooldown.png differ diff --git a/Cooldowns/StooldownOutline.png b/Cooldowns/StooldownOutline.png new file mode 100644 index 0000000000..93ce7852e0 Binary files /dev/null and b/Cooldowns/StooldownOutline.png differ diff --git a/Cooldowns/StooldownOverlay.png b/Cooldowns/StooldownOverlay.png new file mode 100644 index 0000000000..e9226d6904 Binary files /dev/null and b/Cooldowns/StooldownOverlay.png differ diff --git a/Dusts/SquashDust.cs b/Dusts/SquashDust.cs index a0d5160f88..425763512a 100644 --- a/Dusts/SquashDust.cs +++ b/Dusts/SquashDust.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { Vector2 baseSize = Vector2.One; - if (dust.customData != null) + if (dust.customData != null && dust.customData is Vector2) baseSize = (Vector2)dust.customData; Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); @@ -87,7 +87,7 @@ namespace CalamityMod.Dusts private static void DrawPixelated(Dust dust) { Vector2 baseSize = Vector2.One; - if (dust.customData != null) + if (dust.customData != null && dust.customData is Vector2) baseSize = (Vector2)dust.customData; Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), 2, 7, 1 * baseSize.Y, 2.5f * baseSize.Y)); diff --git a/Dusts/VoidDust.cs b/Dusts/VoidDust.cs index e66a8f3bf4..22eeafbd4c 100644 --- a/Dusts/VoidDust.cs +++ b/Dusts/VoidDust.cs @@ -31,30 +31,51 @@ namespace CalamityMod.Dusts public override bool Update(Dust dust) { - dust.rotation += MathF.Sign(dust.velocity.X); - dust.velocity *= 0.98f; + float fade = (1 + dust.fadeIn); + dust.velocity *= 0.96f; if (dust.noGravity) - dust.scale += 0.02f; + dust.scale -= 0.05f * fade; else - dust.scale -= 0.01f; + dust.scale -= 0.065f * fade; float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f); if (!dust.noLightEmittence) Lighting.AddLight(dust.position, dust.color.ToVector3() * light); + + if (dust.scale <= 0) + dust.active = false; - return true; + dust.position += dust.velocity; + return false; + } + public override bool MidUpdate(Dust dust) + { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; + return false; } public override bool PreDraw(Dust dust) { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; + Vector2 baseSize = Vector2.One; + bool useSquash = false; + float squashMaxSpeed = 0; + if (dust.customData != null && dust.customData is int) + { + useSquash = true; + squashMaxSpeed = (float)dust.customData; + } + + Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize; + if (!dust.noLight) { // Glow Orb - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); return false; } } @@ -65,20 +86,32 @@ namespace CalamityMod.Dusts public override bool PreDraw(Dust dust) { + dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2; PixelationManager.AddPixelatedDrawer((_) => DrawPixelated(dust), GeneralDrawLayer.AfterDusts); return false; } private static void DrawPixelated(Dust dust) { + Vector2 baseSize = Vector2.One; + bool useSquash = false; + float squashMaxSpeed = 0; + if (dust.customData != null && dust.customData is int) + { + useSquash = true; + squashMaxSpeed = (int)dust.customData; + } + + Vector2 squash = useSquash ? new Vector2(Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.X, 0.5f * baseSize.X), Utils.Remap(dust.velocity.Length(), squashMaxSpeed / 4, squashMaxSpeed, 1 * baseSize.Y, 2.5f * baseSize.Y)) : baseSize; + if (!dust.noLight) { // Glow Orb - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0); if (dust.alpha < 1) - Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, dust.scale * 0.04f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(BloomCircle.Value, dust.position - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, BloomCircle.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, dust.scale * 0.075f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(SolidCircle.Value, dust.position - Main.screenPosition, null, Color.Black * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, SolidCircle.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0); } } } diff --git a/Gores/AquaticScourgeGores/AquaticUrchin.png b/Gores/AquaticScourgeGores/AquaticUrchin.png index 356efb49f0..ce015fb455 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin.png and b/Gores/AquaticScourgeGores/AquaticUrchin.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin2.png b/Gores/AquaticScourgeGores/AquaticUrchin2.png index 44a021dbe4..93e0dba709 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin2.png and b/Gores/AquaticScourgeGores/AquaticUrchin2.png differ diff --git a/Gores/AquaticScourgeGores/AquaticUrchin3.png b/Gores/AquaticScourgeGores/AquaticUrchin3.png index 8d8532f288..4bf306fc2b 100644 Binary files a/Gores/AquaticScourgeGores/AquaticUrchin3.png and b/Gores/AquaticScourgeGores/AquaticUrchin3.png differ diff --git a/Graphics/Primitives/PrimitiveRenderer.cs b/Graphics/Primitives/PrimitiveRenderer.cs index 8c9a78f382..d962242faa 100644 --- a/Graphics/Primitives/PrimitiveRenderer.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -322,7 +322,7 @@ namespace CalamityMod.Graphics.Primitives } // Legacy behaviour: sample based on requested point count using Catmull-Rom style interpolation. - PositionsIndex = 1; + PositionsIndex = 0; float controlCountMinusOne = controlCount - 1f; PrimitiveSmoothingType legacyType = settings.SmoothingType; @@ -344,8 +344,6 @@ namespace CalamityMod.Graphics.Primitives MainPositions[PositionsIndex] = EvaluateCurve(legacyType, p0, p1, p2, p3, localSplineInterpolant, settings); PositionsIndex++; } - - MainPositions[0] = controlPoints[0]; MainPositions[PositionsIndex] = controlPoints[controlCount - 1]; PositionsIndex++; controlPoints.Clear(); diff --git a/Graphics/Primitives/PrimitiveSettings.cs b/Graphics/Primitives/PrimitiveSettings.cs index ebc4b51fcd..7996352e4e 100644 --- a/Graphics/Primitives/PrimitiveSettings.cs +++ b/Graphics/Primitives/PrimitiveSettings.cs @@ -309,7 +309,7 @@ namespace CalamityMod.Graphics.Primitives SmoothingTension = smoothingTension; FrameTransportMode = frameTransportMode; Topology = topology; - CapStyle = PrimitiveCapStyle.Flat; + CapStyle = capStyle; } } } diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index bb03985b48..79d59de031 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -401,6 +401,32 @@ namespace CalamityMod.ILEditing } #endregion + #region Flail Balance Changes + // Make flails be unaffected by player velocity + private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self) + { + orig(self); + if (self.ai[0] == 1f && self.ai[1] == 0f) + self.velocity -= Main.player[self.owner].velocity; + } + + // Increase Flower Pow's return speed + private static void IncreaseFlowerPowRetSpeed(ILContext il) + { + var cursor = new ILCursor(il); + // Move to where Flower Pow receives its specific flail stat changes. This moves it after num2 = 23f + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcR4(23f), i => i.MatchStloc(6))) + { + LogFailure("Flower Pow Buff", "Could not move to Flower Pow's specific flail stat changes."); + return; + } + + // Emit an instruction setting num5 (the return speed) to 21. Vanilla is 16 + cursor.Emit(OpCodes.Ldc_R4, 21f); + cursor.Emit(OpCodes.Stloc, 9); + } + #endregion + #region Terrarian Projectile Limitation for Extra Updates private static void LimitTerrarianProjectiles(ILContext il) { @@ -686,5 +712,67 @@ namespace CalamityMod.ILEditing return orig(self); } #endregion + + #region Adjust lifesteal costs + /// + /// Reimplemnts our own implementation of Spectre Healing so we can customize effects + /// Also means it will no longer reduce lifesteal cooldown when hitting with non-magic attacks, and not proc if every player is full HP + /// + /// + /// + /// + /// + /// + private static void AdjustSpectreHealing(On_Projectile.orig_ghostHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim) + { + float HealingMultiplier = 0.2f; + float LifestealCooldownMult = 0.66f; + + var owner = Main.player[self.owner]; + HealingMultiplier -= self.numHits * 0.05f; + int AmountToHeal = (int)Math.Round(dmg * HealingMultiplier); + if (!self.magic || AmountToHeal <= 0 || Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + float MissingLifeGoal = 0f; + int targetPlayer = self.owner; + foreach (var player in Main.ActivePlayers) + { + if (!player.dead && ((!self.hostile && !owner.hostile) || owner.team == player.team) && self.Distance(player.Center) <= 3000f) + { + int MissingLife = player.statLifeMax2 - player.statLife; + if ((float)MissingLife > MissingLifeGoal) + { + MissingLifeGoal = MissingLife; + targetPlayer = player.whoAmI; + } + } + } + AmountToHeal = (int)MathHelper.Min(AmountToHeal, MissingLifeGoal); + if (AmountToHeal <= 0) + return; + owner.lifeSteal -= AmountToHeal * LifestealCooldownMult; + Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.SetBonus_GhostHeal)), Position.X, Position.Y, 0f, 0f, ProjectileID.SpiritHeal, 0, 0f, self.owner, targetPlayer, AmountToHeal); + } + /// + /// Adjust Vampire Knives implementation, stopping them from trying to heal when at full HP + /// + /// + /// + /// + /// + /// + private static void AdjustVampireHealing(On_Projectile.orig_vampireHeal orig, Projectile self, int dmg, Vector2 Position, Entity victim) + { + int healAmount = (int)(dmg * 0.075f); + float LifestealCooldownMult = 1f; + if ((int)healAmount != 0 && !(Main.player[Main.myPlayer].lifeSteal <= 0f) && Main.player[Main.myPlayer].statLifeMax2 > Main.player[Main.myPlayer].statLife) + { + Main.player[Main.myPlayer].lifeSteal -= healAmount * LifestealCooldownMult; + Projectile.NewProjectile(self.GetSource_OnHit(victim, ProjectileSourceID.ToContextString(ProjectileSourceID.VampireKnives)), Position.X, Position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, self.owner, self.owner, healAmount); + } + } + #endregion } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 0e39b0ffa5..91b569a05b 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -3,7 +3,6 @@ using CalamityMod.Tiles.FurnitureExo; using Terraria; using Terraria.DataStructures; using Terraria.GameContent; -using Terraria.GameContent.Biomes; using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; using Terraria.GameContent.ItemDropRules; @@ -107,11 +106,15 @@ namespace CalamityMod.ILEditing IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; IL_Projectile.Damage += VanillaBossResistChanges; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; + On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity; + IL_Projectile.AI_015_Flails += IncreaseFlowerPowRetSpeed; IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs; On_Player.ConsumeSolarFlare += SolarWingsDashChange; On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable; IL_Player.UpdateBuffs += UpdateBuffsBalancingChanges; IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR; + On_Projectile.ghostHeal += AdjustSpectreHealing; + On_Projectile.vampireHeal += AdjustVampireHealing; // Movement speed balance IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; @@ -149,7 +152,6 @@ namespace CalamityMod.ILEditing IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements; On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements; - On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity; IL_Projectile.AI_061_FishingBobber += WhitelistVictideBobber; On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming; diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 8b11dcb9e3..3c04413d31 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -318,15 +318,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Remove Flail Throw Velocity Being Affected By Player Velocity - private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self) - { - orig(self); - if (self.ai[0] == 1f && self.ai[1] == 0f) - self.velocity -= Main.player[self.owner].velocity; - } - #endregion - #region Allow Victide Bobber to Exist private static void WhitelistVictideBobber(ILContext il) { diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 75eaac9461..cb9c3ab317 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static float BrimstoneFlamesReduction = 0.5f; - public static float critScaling = 3.5f; // How effective crit chance is at increasing debuff damage + public static float critScaling = 3f; // How effective crit chance is at increasing debuff damage public override void SetDefaults() { Item.width = 26; @@ -30,9 +30,9 @@ namespace CalamityMod.Items.Accessories } public override void ModifyTooltips(List list) { - Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().playerBaneDebuffDamage)).ToString()); + list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().abaddon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString()) + : this.GetLocalizedValue("Unequipped")); } } } diff --git a/Items/Accessories/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/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 8cd7145e58..7804ef5748 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -13,8 +14,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MaxLifeBoost = 50; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RadiantOoze.MinRegenBoost.ToRegenPerSecond(), RadiantOoze.MaxRegenBoost.ToRegenPerSecond()); + public static int MinRegenBoost => 2; + public static int MaxRegenBoost => 6; + public static float RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() { @@ -28,19 +32,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += MaxLifeBoost; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - - // Inherits all effects of Honey Dew and Living Dew - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; - - // Add light if the other accessories aren't equipped and visibility is turned on - if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual) + if (!modPlayer.purity && !hideVisual) Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f)); } @@ -49,7 +42,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", player.Calamity().radiantOozeRegen.ToString("0.##")); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index e0cc74a488..aca8d30b28 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -48,8 +48,6 @@ namespace CalamityMod.Items.Accessories player.GetDamage() += DamageBoost; player.GetDamage() += TotalSummonDamageBoost - DamageBoost; player.maxMinions += MinionSlotBoost; - if (player.wingTime < player.wingTimeMax) - player.lifeRegen += RegenBoostDuringFlight; } public override void AddRecipes() diff --git a/Items/Accessories/Apollyon.cs b/Items/Accessories/Apollyon.cs index 1003190c09..6a886f3eff 100644 --- a/Items/Accessories/Apollyon.cs +++ b/Items/Accessories/Apollyon.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static float critScaling = 7.5f; // How effective crit chance is at increasing debuff damage + public static float critScaling = 8f; // How effective crit chance is at increasing debuff damage public static float critDamageBoostPerDebuff = 0.03f; // 3% increased crit damage per debuff public override void SetDefaults() { @@ -42,9 +42,9 @@ namespace CalamityMod.Items.Accessories } public override void ModifyTooltips(List list) { - Player player = Main.LocalPlayer; if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", ((int)(Bane.debuffData.EnemyLostRegen / 2 * player.Calamity().playerBaneDebuffDamage)).ToString()); + list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().apollyon ? this.GetLocalization("Equipped").Format(((int)(Bane.debuffData.EnemyLostRegen / 2 * Main.LocalPlayer.Calamity().playerBaneDebuffDamage)).ToString()) + : this.GetLocalizedValue("Unequipped")); } } } diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index dbe9935d5d..c3106ab870 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MaxDefenseBoost = 20; + public static int MaxDefenseBoost = 15; public static float MaxMoveSpeedReduction = 0.1f; public static int TimeToReachMaxBoost = CalamityUtils.SecondsToFrames(10); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TimeToReachMaxBoost.FramesToSeconds(), MaxDefenseBoost, MaxMoveSpeedReduction.ToPercent()); diff --git a/Items/Accessories/BatholithBangle.cs b/Items/Accessories/BatholithBangle.cs index c244cd51d4..94f50319a8 100644 --- a/Items/Accessories/BatholithBangle.cs +++ b/Items/Accessories/BatholithBangle.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; public static int cooldown = 600; - public static int damage = 100; + public static int damage = 50; public override void SetDefaults() { Item.width = 36; 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/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 9c4b4cfca5..6eebae181d 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,11 +9,14 @@ namespace CalamityMod.Items.Accessories public class CrownJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 1; + public static int ReducedDoTAmount = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 26; Item.height = 26; - Item.defense = 1; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; @@ -22,6 +26,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.crownJewel = true; + player.lifeRegen += RegenBoost; } } } diff --git a/Items/Accessories/DimensionalSoulArtifact.cs b/Items/Accessories/CrushingEgo.cs similarity index 88% rename from Items/Accessories/DimensionalSoulArtifact.cs rename to Items/Accessories/CrushingEgo.cs index b8541a3f47..13c92cc9fb 100644 --- a/Items/Accessories/DimensionalSoulArtifact.cs +++ b/Items/Accessories/CrushingEgo.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class DimensionalSoulArtifact : ModItem, ILocalizedModType + [LegacyName("DimensionalSoulArtifact")] + public class CrushingEgo : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() @@ -24,7 +25,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dArtifact = true; + modPlayer.crushingEgo = true; } public override void AddRecipes() diff --git a/Items/Accessories/DimensionalSoulArtifact.png b/Items/Accessories/CrushingEgo.png similarity index 100% rename from Items/Accessories/DimensionalSoulArtifact.png rename to Items/Accessories/CrushingEgo.png diff --git a/Items/Accessories/DaawnlightSpiritOrigin.cs b/Items/Accessories/DaawnlightSpiritOrigin.cs index 2fbb970c79..45154ca3ab 100644 --- a/Items/Accessories/DaawnlightSpiritOrigin.cs +++ b/Items/Accessories/DaawnlightSpiritOrigin.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Accessories /// The amount of critical strike chance bonus where crit starts decaying faster.
/// When the crit bonus reaches this value, the decay rate increases by one tier. ///
- public static readonly int CritDecayThreshold = 60; + public static readonly int CritDecayThreshold = 50; /// /// When the critical strike chance bonus has exceeded , it continues to decay faster for every more. @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Accessories /// /// The maximum amount of extra critical strike chance you can get from this accessory. /// - public static readonly int CritHardCap = 100; + public static readonly int CritHardCap = 75; #endregion 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/EtherealExtorter.cs b/Items/Accessories/EtherealExtorter.cs index 98ee31e460..50d9ae909a 100644 --- a/Items/Accessories/EtherealExtorter.cs +++ b/Items/Accessories/EtherealExtorter.cs @@ -8,6 +8,8 @@ namespace CalamityMod.Items.Accessories public class EtherealExtorter : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int soulDamage => 15; public override void SetDefaults() { Item.width = 28; diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index b3c6331489..d6135d8c6c 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -7,6 +7,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; @@ -15,6 +16,13 @@ namespace CalamityMod.Items.Accessories public class EtherealTalisman : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MaxManaBoost = 60; + public static float ManaCostReduction = 0.08f; + public static float MagicDamageBoost = 0.15f; + public static int MagicCritBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + public override void SetDefaults() { Item.width = 28; @@ -72,10 +80,10 @@ namespace CalamityMod.Items.Accessories if (manaFlowerEnabled) player.manaFlower = true; - player.statManaMax2 += 150; - player.GetDamage() += 0.15f; - player.manaCost -= 0.1f; - player.GetCritChance() += 5; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Accessories/AuricSoulArtifact.cs b/Items/Accessories/FadedIdolatry.cs similarity index 87% rename from Items/Accessories/AuricSoulArtifact.cs rename to Items/Accessories/FadedIdolatry.cs index 9ff5405c94..72f213f81d 100644 --- a/Items/Accessories/AuricSoulArtifact.cs +++ b/Items/Accessories/FadedIdolatry.cs @@ -9,8 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - [LegacyName("GodlySoulArtifact")] - public class AuricSoulArtifact : ModItem, ILocalizedModType + [LegacyName("GodlySoulArtifact", "AuricSoulArtifact")] + public class FadedIdolatry : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.auricSArtifact = true; + modPlayer.fadedIdolatry = true; } public override void AddRecipes() diff --git a/Items/Accessories/AuricSoulArtifact.png b/Items/Accessories/FadedIdolatry.png similarity index 100% rename from Items/Accessories/AuricSoulArtifact.png rename to Items/Accessories/FadedIdolatry.png 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..c01e7ac7ec 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,12 @@ 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 static int MinDelay => 60; + public static int MaxDelay => 240; + public override void SetDefaults() { Item.width = 26; @@ -21,6 +29,22 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.fleshTotem = true; + modPlayer.fleshTotemMinion = true; + modPlayer.fleshTotemVisual = !hideVisual; + player.statManaMax2 += 20; + 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/EldritchSoulArtifact.cs b/Items/Accessories/FragmentsOfAnotherWorld.cs similarity index 55% rename from Items/Accessories/EldritchSoulArtifact.cs rename to Items/Accessories/FragmentsOfAnotherWorld.cs index 0e1299f0ed..046e44ba43 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/FragmentsOfAnotherWorld.cs @@ -5,12 +5,20 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Plates; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class EldritchSoulArtifact : ModItem, ILocalizedModType + [LegacyName("EldritchSoulArtifact")] + public class FragmentsOfAnotherWorld : ModItem, ILocalizedModType { + static float MeleeSpeedIncrease => 0.2f; + static float RangedSpecialistDmgMult => 1.15f; + static float ManaCostReduction => 0.25f; + static int MaxSentries => 2; + static float RogueSpeedIncrease => 0.1f; + public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { @@ -21,12 +29,19 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Purple; } + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeSpeedIncrease.ToPercent(), RangedSpecialistDmgMult, ManaCostReduction.ToPercent(), MaxSentries, RogueSpeedIncrease.ToPercent()); + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.eArtifact = true; + modPlayer.fragmentsOfAnotherWorld = true; + player.buffImmune[ModContent.BuffType()] = true; - player.GetAttackSpeed() += 0.1f; + player.GetAttackSpeed() += MeleeSpeedIncrease; + player.specialistDamage *= RangedSpecialistDmgMult; + player.manaCost -= ManaCostReduction; + player.maxTurrets += MaxSentries; + player.GetAttackSpeed() += RogueSpeedIncrease; } public override void AddRecipes() diff --git a/Items/Accessories/EldritchSoulArtifact.png b/Items/Accessories/FragmentsOfAnotherWorld.png similarity index 100% rename from Items/Accessories/EldritchSoulArtifact.png rename to Items/Accessories/FragmentsOfAnotherWorld.png 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/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 2630de753f..9bb739c49d 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,10 +9,10 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RegenBoost = 3; + public static int RegenBoost = 2; public static int DefenseBoost = 5; public static float SummonDamageBoost = 0.1f; - + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 26; diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index cedef67539..854d5f27b0 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,6 +9,9 @@ namespace CalamityMod.Items.Accessories public class HoneyDew : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent()); public override void SetDefaults() { Item.width = 20; @@ -19,11 +23,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 10; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.honeyDewHalveDebuffs = true; + modPlayer.honeyDew = true; } public override void AddRecipes() diff --git a/Items/Accessories/InfectedJewel.cs b/Items/Accessories/InfectedJewel.cs index 7746446c7f..c88977e5ba 100644 --- a/Items/Accessories/InfectedJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -11,11 +12,15 @@ namespace CalamityMod.Items.Accessories public class InfectedJewel : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenBoost = 2; + public static int ReducedDoTAmount = 8; + public static int PostDebuffRegenTimeBoost = CalamityUtils.SecondsToFrames(10); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), ReducedDoTAmount.ToRegenPerSecond(), PostDebuffRegenTimeBoost.FramesToSeconds()); public override void SetDefaults() { Item.width = 26; Item.height = 26; - Item.defense = 4; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; @@ -25,6 +30,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.infectedJewel = true; + player.lifeRegen += RegenBoost; } public override void AddRecipes() diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index ca84090d44..2ab98916c6 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Accessories public class LivingDew : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NaturalRegenPower - 1f).ToPercent(), RegenTimeBoost.ToPercent()); public override void SetDefaults() { Item.width = 34; @@ -20,14 +25,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 25; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // Inherits all effects of Honey Dew CalamityPlayer modPlayer = player.Calamity(); - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; + modPlayer.livingDew = true; } public override void AddRecipes() diff --git a/Items/Accessories/ManaPolarizer.cs b/Items/Accessories/ManaPolarizer.cs index 73fc472501..dbf71c47da 100644 --- a/Items/Accessories/ManaPolarizer.cs +++ b/Items/Accessories/ManaPolarizer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.manaOverloader = true; - player.statManaMax2 += 50; + player.statManaMax2 += 40; } } } diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index 094772ac70..13913e6373 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Blue; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.accessory = true; - Item.defense = 3; + Item.defense = 2; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 56872a2ae0..911e8cafbe 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 += 40; + 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..c327cbdd88 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Items.Accessories { //The stealth damage boost is handled in CalamityPlayer for some reason, maybe someone didn't want em to stack? public new string LocalizationCategory => "Items.Accessories"; + public static int RaiderBonus => 10; public override void SetDefaults() { Item.width = 46; @@ -27,6 +28,7 @@ namespace CalamityMod.Items.Accessories modPlayer.electricianGlove = true; modPlayer.filthyGlove = true; modPlayer.bloodyGlove = true; + modPlayer.raiderTalisman = true; player.GetDamage() += 0.15f; player.Calamity().rogueVelocity += 0.15f; } @@ -35,7 +37,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(4). AddTile(). diff --git a/Items/Accessories/PhantomicArtifact.cs b/Items/Accessories/PhantomicArtifact.cs index ab6f1b20eb..28a37b992d 100644 --- a/Items/Accessories/PhantomicArtifact.cs +++ b/Items/Accessories/PhantomicArtifact.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -16,10 +17,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RegenBoost = 2; - public static int DefenseBoost = 10; - public static float SummonDamageBoost = 0.1f; - + public static int RegenBoost => 2; + public static int DefenseBoost => 8; + public static float SummonDamageBoost => 0.1f; + public static float DaggerDamage => 300; + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); diff --git a/Items/Accessories/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/Radiance.cs b/Items/Accessories/Radiance.cs index 7fbffc9bb8..46823c36ed 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Rarities; @@ -7,14 +8,23 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [LegacyName("AstralArcanum", "Purity")] - public class Radiance : ModItem, ILocalizedModType, IHoldShiftTooltipItem + public class Radiance : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MinRegenBoost => 2; + public static int MaxRegenBoost => 8; + public static int ReducedDoTAmount => 20; + public static int PostDebuffRegenTimeBoost => CalamityUtils.SecondsToFrames(10); + public static float RegenTimeBoost => 1; + public static float NaturalRegenPower => 1.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(),MaxRegenBoost.ToRegenPerSecond(),ReducedDoTAmount.ToRegenPerSecond(), (NaturalRegenPower - 1f).ToPercent(),RegenTimeBoost.ToPercent()); public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7)); @@ -25,7 +35,6 @@ namespace CalamityMod.Items.Accessories { Item.width = 18; Item.height = 44; - Item.defense = 5; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); @@ -34,19 +43,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += 70; - if (!player.HasBuff(BuffID.Honey)) - player.AddBuff(BuffID.Honey, 2); - - // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving modPlayer.purity = true; - - // Inherits effects from Honey Dew and Living Dew - modPlayer.honeyDewHalveDebuffs = true; - modPlayer.livingDewHalveDebuffs = true; - - // Add light if the other accessories aren't equipped and visibility is turned on - if (!(modPlayer.rOoze || modPlayer.aAmpoule) && !hideVisual) + if (!hideVisual) Lighting.AddLight(player.Center, new Vector3(1.32f, 1.32f, 1.82f)); } @@ -56,8 +54,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", player.Calamity().purityRegen.ToString("0.##")); - list.FindAndReplace("[DEFENSE]", player.Calamity().jewelBonusDefense.ToString()); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 6c5173059b..e4f31b3ee8 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -13,8 +14,8 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int MinRegenBoost = 4; - public static int MaxRegenBoost = 10; + public static int MinRegenBoost => 1; + public static int MaxRegenBoost => 5; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinRegenBoost.ToRegenPerSecond(), MaxRegenBoost.ToRegenPerSecond()); public override void SetDefaults() @@ -29,11 +30,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - - // bool left in for abyss light purposes and life regen effects modPlayer.rOoze = true; - // Add light if the other accessories aren't equipped and visibility is turned on if (!(modPlayer.aAmpoule || modPlayer.purity) && !hideVisual) Lighting.AddLight(player.Center, new Vector3(1f, 1f, 0.6f)); } @@ -43,7 +41,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", (player.Calamity().radiantOozeRegen).ToString("0.##")); + list.FindAndReplace("[REGEN]", ((int)MathF.Round(MathHelper.Lerp(MaxRegenBoost, MinRegenBoost, (player.statLife / (float)player.statLifeMax2)))).ToRegenPerSecond()); } } diff --git a/Items/Accessories/RaidersTalisman.cs b/Items/Accessories/RaidersTalisman.cs index 775a842fa1..2e45d69df2 100644 --- a/Items/Accessories/RaidersTalisman.cs +++ b/Items/Accessories/RaidersTalisman.cs @@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories public class RaidersTalisman : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public const float RaiderBonus = 15f; - public const int RaiderCooldown = 10; //seconds + public static int RaiderBonus => 15; + public static int RaiderCooldown => 10; //seconds public static readonly SoundStyle StealthHitSound = new("CalamityMod/Sounds/Custom/RaidersTalismanStealthHit"); public override void SetDefaults() diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index bfe585034b..fad5af576a 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -8,8 +9,11 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int SandVeilDefenseBoost = 4; - + public static int SandVeilDuration = CalamityUtils.SecondsToFrames(15); + public static int SandVeilDefenseBoost = 3; + public static float SandVeilAccelerationBoost = 0.75f; + public static int SandVeilCooldown = CalamityUtils.SecondsToFrames(15); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SandVeilDuration.FramesToSeconds(), SandVeilDefenseBoost, SandVeilAccelerationBoost.ToPercent(), SandVeilCooldown.FramesToSeconds()); public override void SetDefaults() { Item.width = 30; diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index 02daf35a01..00ef2c412f 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -78,11 +78,11 @@ namespace CalamityMod.Items.Accessories // If the NPC can be moved, violently shove them away. Make them susceptible to fall damage on empowered parries. // Otherwise, simply deal a large amount of damage to them if empowered. - if (npc.CanBeMoved(true)) + if (npc.CanBeMoved()) { // The NPC has to actually have its velocity changed, because TileCollisionHarmNPC only changes its position. Not confusing at all! Vector2 shoveVelocity = Utils.DirectionTo(player.Center, npc.Center) * (Main.zenithWorld ? 35f : 12.5f) - Vector2.UnitY * 6f; - npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true); + npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true, player); int scaledFallDamage = CalamityUtils.ScaleWithDifficulty(ShoveFallBaseDamage); var flungNPC = npc.GetGlobalNPC(); diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index 94c5dd7487..a3dee2aa70 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.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,11 @@ namespace CalamityMod.Items.Accessories public class SigilofCalamitas : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int MaxManaBoost = 60; + public static float MagicDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 8)); @@ -27,9 +33,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.manaMagnet = true; - player.statManaMax2 += 100; - player.GetDamage() += 0.15f; - player.manaCost -= 0.1f; + player.statManaMax2 += MaxManaBoost; + player.GetDamage() += MagicDamageBoost; } public override void AddRecipes() diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index c190df2877..1816783be4 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -10,10 +11,10 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RegenBoost = 2; - public static int DefenseBoost = 3; + public static int RegenBoost = 1; + public static int DefenseBoost = 2; public static float SummonDamageBoost = 0.1f; - + public LocalizedText TooltipExtensionText => this.GetLocalization("HoldShiftTooltip").WithFormatArgs(SummonDamageBoost.ToPercent(), DefenseBoost, RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { Item.width = 24; diff --git a/Items/Accessories/SpringStool.cs b/Items/Accessories/SpringStool.cs new file mode 100644 index 0000000000..e68a6b1687 --- /dev/null +++ b/Items/Accessories/SpringStool.cs @@ -0,0 +1,226 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class SpringStool : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void ModifyTooltips(List list) => list.IntegrateHotkey(CalamityKeybinds.SpringStoolJumpHotKey); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((JumpCooldown).FramesToSeconds(), (CritRateBoostAboveTargets)); + + public static int JumpCooldown = CalamityUtils.SecondsToFrames(20); + public static int CritRateBoostAboveTargets = 5; + + public override void SetDefaults() + { + Item.width = 30; + Item.height = 46; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer().springStool = true; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.PortableStool). + AddRecipeGroup("AnyCopperBar", 3). + AddTile(TileID.Anvils). + Register(); + } + } + + + public class SpringStoolPlayer : ModPlayer + { + public bool springStool = false; + public int springStoolTimer = 0; + public bool hasGroundedSinceJump = true; + + public override void Load() + { + // Hook directly into vanilla's stool drawing + On_PlayerDrawLayers.DrawPlayer_03_PortableStool += HandleStoolStacking; + + // Used to apply the conditional crit chance boost + // Projectiles uses standard tML hooks + On_Player.ProcessHitAgainstNPC += HandleExtraMeleeHitboxCrit; + } + + public override void PostUpdate() + { + bool theCollisionCheck = Collision.TileCollision(Player.position + Vector2.UnitY, Vector2.Zero, Player.width, Player.height, fallThrough: false, fall2: false).Y == 0f; + + if ((Player.velocity.Y == 0 && theCollisionCheck) || Player.grappling[0] >= 0) + hasGroundedSinceJump = true; + } + + public override void PostUpdateEquips() + { + if (CalamityKeybinds.SpringStoolJumpHotKey.JustPressed && springStool && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Stooldown.ID) && !Player.mount.Active && hasGroundedSinceJump) + { + springStoolTimer = 12; + + Player.AddCooldown(Stooldown.ID, (int)SpringStool.JumpCooldown, true); + hasGroundedSinceJump = false; + + Vector2 spawnPos = Player.Bottom + new Vector2(0f, -60f); + + // Spawn stool with downward and randomly angled force + Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos, new Vector2(Main.rand.NextFloat(-1f, 1f), 1.2f), ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + SoundEngine.PlaySound(SoundID.Item61 with { Pitch = 0.3f, Volume = 0.7f }, Player.Center); + + if (IsVanillaStoolEquipped(Player)) + { + // Spawn a step stool copy with a random velocity. Only works if step stool is equipped as well as spring stool. + Projectile.NewProjectile(Player.GetSource_FromThis(), spawnPos + new Vector2(0f, -4f), new Vector2(Main.rand.NextBool() ? Main.rand.NextFloat(6f, 7f) : Main.rand.NextFloat(-6f, -7f), Main.rand.NextFloat(-8f, -10f)), ModContent.ProjectileType(), 0, 0f, Player.whoAmI); + } + } + + if (springStool) + { + bool holdingUp = Player.controlUp; + bool standingStill = Player.velocity.Y == 0 && Math.Abs(Player.velocity.X) < 0.1f; + + if (holdingUp && standingStill && !Player.mount.Active) + { + int boost = 61; + if (IsVanillaStoolEquipped(Player)) + boost += 24; + + Player.portableStoolInfo.HasAStool = true; + Player.portableStoolInfo.IsInUse = true; + Player.portableStoolInfo.HeightBoost = boost; + Player.portableStoolInfo.VisualYOffset = boost; + Player.portableStoolInfo.MapYOffset = boost; + + // Forces the player into the stool-standing frame + Player.UpdatePortableStoolUsage(); + } + + else + { + // Ensures the player can use the stool if they stop moving/hold up + Player.portableStoolInfo.HasAStool = true; + } + } + } + + private void HandleStoolStacking(On_PlayerDrawLayers.orig_DrawPlayer_03_PortableStool orig, ref PlayerDrawSet drawInfo) + { + bool isUsingStool = drawInfo.drawPlayer.portableStoolInfo.IsInUse; + var modPlayer = drawInfo.drawPlayer.GetModPlayer(); + bool hasSpring = modPlayer.springStool; + + if (!isUsingStool) + { + orig(ref drawInfo); + return; + } + + if (!hasSpring) + { + orig(ref drawInfo); + return; + } + + if (IsVanillaStoolEquipped(drawInfo.drawPlayer)) + { + orig(ref drawInfo); + return; + } + + return; + } + + private bool IsVanillaStoolEquipped(Player player) + { + for (int k = 3; k <= 12; k++) + { + if (player.armor[k].type == ItemID.PortableStool) + + return true; + } + return false; + } + + public override void PreUpdateMovement() + { + if (springStoolTimer > 0) + { + springStoolTimer--; + + if (Player.whoAmI == Main.myPlayer) + { + float launchPower = 20f * Utils.GetLerpValue(0, 10, springStoolTimer, true); + Player.velocity.Y = -launchPower * Player.gravDir; + + // Prevent vanilla jump logic from interfering + Player.jump = 0; + Player.fallStart = (int)(Player.position.Y / 16f); + } + } + } + + // Adds crit to melee hitboxes + private static void HandleExtraMeleeHitboxCrit(On_Player.orig_ProcessHitAgainstNPC orig, Player self, Item sItem, Rectangle itemRectangle, int originalDamage, float knockback, int npcIndex) + { + bool getBoost = self.GetModPlayer().springStool && self.Top.Y < Main.npc[npcIndex].Top.Y; + if (getBoost) + sItem.crit += SpringStool.CritRateBoostAboveTargets; + + orig(self, sItem, itemRectangle, originalDamage, knockback, npcIndex); + + if (getBoost) + sItem.crit -= SpringStool.CritRateBoostAboveTargets; + } + // Scuffed implementation to add crit to projectiles, using one hook to add it and then a later hook to remove it + // There are two return statements in between these hooks that I would normally be nervous of, however neither actually affect this at all: + // * The first is Electrosphere Launcher's rockets dying on hit, which kills the projectile anyways and can just have a manual check against + // * The second is Abigail's Flower hit cooldown logic, which does nothing since it's a minion that doesn't crit + public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers) + { + if (springStool && proj.type != ProjectileID.ElectrosphereMissile) + { + if (Player.Top.Y < target.Top.Y) + proj.CritChance += SpringStool.CritRateBoostAboveTargets; + } + } + public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone) + { + if (springStool && proj.type != ProjectileID.ElectrosphereMissile) + { + if (Player.Top.Y < target.Top.Y) + proj.CritChance -= SpringStool.CritRateBoostAboveTargets; + } + } + + public override void ResetEffects() + { + springStool = false; + springStoolTimer = 0; + } + + public override void UpdateDead() + { + springStool = false; + springStoolTimer = 0; + hasGroundedSinceJump = true; + } + } +} diff --git a/Items/Accessories/SpringStool.png b/Items/Accessories/SpringStool.png new file mode 100644 index 0000000000..1b7c3fd918 Binary files /dev/null and b/Items/Accessories/SpringStool.png differ diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index 40a8d86dd4..b7a3dd4452 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 4; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/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/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index fdea11a01a..4d4836af00 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Items.Accessories CreateRecipe(). AddIngredient(). AddIngredient(4). - AddIngredient(ItemID.LunarBar, 10). - AddIngredient(ItemID.FragmentSolar, 10). + AddIngredient(12). + AddIngredient(15). AddIngredient(15). AddIngredient(15). - AddIngredient(8). + AddIngredient(4). AddTile(). Register(); } diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index 0730b3c78a..5222c8b13a 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,7 +10,11 @@ namespace CalamityMod.Items.Accessories public class TrinketofChi : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - internal const int ChiBuffTimerMax = 600; + + public static float ChiBuffDamageReductionBoost = 0.2f; + public static int ChiBuffHitlessTime = CalamityUtils.SecondsToFrames(10); + public static int RegenBoost = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ChiBuffDamageReductionBoost.ToPercent(), ChiBuffHitlessTime.FramesToSeconds(), RegenBoost.ToRegenPerSecond()); public override void SetDefaults() { diff --git a/Items/Accessories/UnholyTonic.cs b/Items/Accessories/UnholyTonic.cs index bef8b0ba72..1f3fa71470 100644 --- a/Items/Accessories/UnholyTonic.cs +++ b/Items/Accessories/UnholyTonic.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,9 @@ namespace CalamityMod.Items.Accessories public class UnholyTonic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoostInCorruption = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostInCorruption); public override void SetDefaults() { Item.width = 20; @@ -22,10 +26,7 @@ namespace CalamityMod.Items.Accessories { player.buffImmune[ModContent.BuffType()] = true; if (player.ZoneCorrupt) - { - player.statDefense += 6; - player.endurance += 0.04f; - } + player.statDefense += DefenseBoostInCorruption; } public override void AddRecipes() diff --git a/Items/Accessories/V8000Engine.cs b/Items/Accessories/V8000Engine.cs new file mode 100644 index 0000000000..2c5b7238df --- /dev/null +++ b/Items/Accessories/V8000Engine.cs @@ -0,0 +1,54 @@ +using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class V8000Engine : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public static float DashDelayModifier = 3.5f; + public const int ShieldSlamDamage = 900; + public const float ShieldSlamKnockback = 0.4f; + public const int ShieldSlamIFrames = 14; // While this has more i-frames than Elysian's dash, the dash speed sets this one back comparitively + + public static SoundStyle DashSound = new("CalamityMod/Sounds/Item/V8000Boost"); + + public override void SetDefaults() + { + Item.width = 54; + Item.height = 50; + Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.rare = ModContent.RarityType(); + Item.accessory = true; + } + + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasEngineDash; + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.hasEngineDash = true; + modPlayer.v8000Engine = true; + modPlayer.DashID = V8000EngineDash.ID; + player.dashType = 0; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ModContent.ItemType()). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ItemID.Nanites, 200). + AddTile(TileID.LunarCraftingStation). + Register(); + } + } +} diff --git a/Items/Accessories/V8000Engine.png b/Items/Accessories/V8000Engine.png new file mode 100644 index 0000000000..d764be8b92 Binary files /dev/null and b/Items/Accessories/V8000Engine.png differ diff --git a/Items/Accessories/V8Engine.cs b/Items/Accessories/V8Engine.cs new file mode 100644 index 0000000000..83f8e825ca --- /dev/null +++ b/Items/Accessories/V8Engine.cs @@ -0,0 +1,51 @@ +using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer.Dashes; +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent.UI; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class V8Engine : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public static float DashDelayModifier = 4f; + + public static SoundStyle DashSound = new("CalamityMod/Sounds/Item/V8Boost"); + + public override void SetDefaults() + { + Item.width = 44; + Item.height = 42; + Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.rare = ItemRarityID.LightRed; + Item.accessory = true; + } + + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasEngineDash; + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.hasEngineDash = true; + modPlayer.v8Engine = true; + modPlayer.DashID = V8EngineDash.ID; + player.dashType = 0; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyAdamantiteBar", 5). + AddIngredient(ModContent.ItemType(), 4). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Accessories/V8Engine.png b/Items/Accessories/V8Engine.png new file mode 100644 index 0000000000..a795ce0c96 Binary files /dev/null and b/Items/Accessories/V8Engine.png differ diff --git a/Items/Accessories/VampiricTalisman.cs b/Items/Accessories/VampiricTalisman.cs index eb0800a9db..9967c7d23e 100644 --- a/Items/Accessories/VampiricTalisman.cs +++ b/Items/Accessories/VampiricTalisman.cs @@ -9,9 +9,9 @@ namespace CalamityMod.Items.Accessories { public class VampiricTalisman : ModItem, ILocalizedModType, IHoldShiftTooltipItem { - internal const int ArmorCrunchDebuffTime = 150; - internal const int HeavyBleedingDebuffTime = 300; - public const float RaiderBonus = 15f; + internal static int ArmorCrunchDebuffTime => 150; + internal static int HeavyBleedingDebuffTime => 300; + public static int RaiderBonus => 15; public bool ShowExtensionIndicator => false; 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/ViciousTonic.cs b/Items/Accessories/ViciousTonic.cs index 6df1a140cd..9cff8eb659 100644 --- a/Items/Accessories/ViciousTonic.cs +++ b/Items/Accessories/ViciousTonic.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -9,6 +10,9 @@ namespace CalamityMod.Items.Accessories public class ViciousTonic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int DefenseBoostInCrimson = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostInCrimson); public override void SetDefaults() { Item.width = 20; @@ -22,10 +26,7 @@ namespace CalamityMod.Items.Accessories { player.buffImmune[ModContent.BuffType()] = true; if (player.ZoneCrimson) - { - player.statDefense += 6; - player.endurance += 0.04f; - } + player.statDefense += DefenseBoostInCrimson; } public override void AddRecipes() diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index 7289ae6af2..17965e2300 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Accessories public class VoidofCalamity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int BrimstoneFlamesDmg => CalamityUtils.ScaleWithDifficulty(15); public override void SetDefaults() { Item.width = 20; @@ -19,6 +21,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.expert = true; } + int cooldown = 0; public override void UpdateAccessory(Player player, bool hideVisual) { @@ -28,14 +31,17 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.immune) + if (player.HasIFrames()) { - if (player.miscCounter % 10 == 0) + if (cooldown <= 0) { - int damage = (int)player.GetBestClassDamage().ApplyTo(30); - CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); + cooldown = 20; + int damage = (int)player.GetBestClassDamage().ApplyTo(BrimstoneFlamesDmg); + for (var i = 0; i < 2; i++) + CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 5.5f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); } } + cooldown--; } } } diff --git a/Items/Accessories/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/Wings/BaseWings.cs b/Items/Accessories/Wings/BaseWings.cs index 780b9224f3..ee58c30df0 100644 --- a/Items/Accessories/Wings/BaseWings.cs +++ b/Items/Accessories/Wings/BaseWings.cs @@ -2,10 +2,13 @@ using System.Linq; using System.Text; using CalamityMod.Balancing; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.CalamityUtils; namespace CalamityMod.Items.Accessories.Wings { @@ -86,26 +89,173 @@ namespace CalamityMod.Items.Accessories.Wings float baseJumpSpeed = (CalamityServerConfig.Instance.FasterJumpSpeed ? BalancingConstants.ConfigBoostedBaseJumpSpeed : 5.01f) + 1f; StringBuilder sb = new StringBuilder(512); sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (MaxAscentSpeed * baseJumpSpeed).ToMph())); - sb.Append('\n'); if (Main.keyState.PressingShift()) { - sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), BaseAscent.ToMphps(), + sb.Append(GetText($"Common.WingStatsFull").Format(time.FramesToSeconds(), + HorizontalSpeedText(run), run.ToMph(), + VerticalSpeedText(MaxAscentSpeed), (MaxAscentSpeed * baseJumpSpeed).ToMph(), + HorizontalAccelerationText(stats.AccRunAccelerationMult), rAcc.ToMphps(), + VerticalAccelerationText(BaseAscent), BaseAscent.ToMphps(), (BaseAscent + BonusAscentWhileRising).ToMphps(), (RisingSpeedThreshold * baseJumpSpeed).ToMph(), (BaseAscent + BonusAscentWhileFalling).ToMphps())); if (hover) { sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); + sb.Append(GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); } } else - sb.Append($"[c/B8B8B8:{CalamityUtils.GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + { + sb.Append(GetText($"Common.WingStats").Format(time.FramesToSeconds(), HorizontalSpeedText(run), VerticalSpeedText(MaxAscentSpeed), + HorizontalAccelerationText(stats.AccRunAccelerationMult), VerticalAccelerationText(BaseAscent))); + sb.Append('\n'); + sb.Append($"[c/B8B8B8:{GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + } // Add stats below the common "Allows flight" line - var wingTooltip = list.FirstOrDefault(x => x.Name == "Tooltip0" && x.Mod == "Terraria"); + TooltipLine wingTooltip = list.FirstOrDefault(x => x.Text == Language.GetTextValue("CommonItemTooltip.FlightAndSlowfall") && x.Mod == "Terraria"); if (wingTooltip != null) wingTooltip.Text += sb.ToString(); } + + public static string HorizontalSpeedText(float speed) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (speed > 9f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (speed >= 8f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (speed >= 7f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (speed <= 3f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (speed <= 6f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string VerticalSpeedText(float speed) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (speed > 2.5f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (speed >= 2f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (speed >= 1.65f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (speed <= 1f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (speed <= 1.35f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string HorizontalAccelerationText(float acc) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (acc > 2.5f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (acc >= 2f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (acc >= 1.25f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (acc <= 0.5f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (acc <= 0.75f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } + + public static string VerticalAccelerationText(float acc) + { + string key = "Average"; + Vector3 hsl = new Vector3(0.167f, 0.65f, 0.61f); + if (acc > 0.2f) + { + key = "Excellent"; + hsl.X = 0.334f; + hsl.Y = 1f; + } + else if (acc >= 0.135f) + { + key = "Great"; + hsl.X = 0.334f; + } + else if (acc >= 0.11f) + { + key = "Good"; + hsl.X = 0.334f; + hsl.Y = 0.35f; + } + else if (acc <= 0.05f) + { + key = "Awful"; + hsl.X = 0f; + } + else if (acc <= 0.09f) + { + key = "Poor"; + hsl.X = 0f; + hsl.Y = 0.35f; + } + return $"[c/{Main.hslToRgb(hsl).Hex3()}:{GetTextValue($"Common.Stats{key}")}]"; + } } } diff --git a/Items/Accessories/Wings/HadalMantle.cs b/Items/Accessories/Wings/HadalMantle.cs index 23778456c2..a0de1808f7 100644 --- a/Items/Accessories/Wings/HadalMantle.cs +++ b/Items/Accessories/Wings/HadalMantle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings public override float MaxAscentSpeed => 1.805f; public override float BaseAscent => 0.125f; - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(150, 8f, 2f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(130, 8f, 2f); public override void SetDefaults() { diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 310123dc78..1ee669e46a 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories.Wings Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 3)); ItemID.Sets.AnimatesAsSoul[Type] = true; ItemID.Sets.ItemNoGravity[Type] = true; - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(120, 6.25f, 1f); + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(160, 7.5f, 1f); } public override void SetDefaults() diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index b255d4609c..4f3b1fb1ec 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories.Wings [AutoloadEquip(EquipType.Wings)] public class StarlightWings : BaseWings { - public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(160, 7.5f, 1.5f); + public override void SetStaticDefaults() => ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(170, 7.5f, 1.5f); public override void SetDefaults() { diff --git a/Items/Accessories/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/Ammo/HailstormBullet.cs b/Items/Ammo/HailstormBullet.cs index 8571c98ecf..664f50c928 100644 --- a/Items/Ammo/HailstormBullet.cs +++ b/Items/Ammo/HailstormBullet.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,12 +22,21 @@ namespace CalamityMod.Items.Ammo Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2f; - Item.value = Item.buyPrice(copper: 80); // Sold by Archmage + Item.value = Item.sellPrice(copper: 16); Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 0.3f; Item.ammo = AmmoID.Bullet; Item.maxStack = Item.CommonMaxStack; } + public override void AddRecipes() + { + CreateRecipe(333). + AddIngredient(ItemID.MusketBall, 333). + AddIngredient(). + AddIngredient(ItemID.Ectoplasm). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Ammo/HyperiusBullet.cs b/Items/Ammo/HyperiusBullet.cs index 7d7083766f..850195e567 100644 --- a/Items/Ammo/HyperiusBullet.cs +++ b/Items/Ammo/HyperiusBullet.cs @@ -9,7 +9,8 @@ namespace CalamityMod.Items.Ammo { public class HyperiusBullet : ModItem, ILocalizedModType { - public static float overflowEfficency = 1.2f; // Multiplier applied to overflow damage done by other damage sources + public static float overflowEfficency = 0.8f; // Multiplier applied to hyperius stacks taken when enemies are damaged by other sources + public static float overflowAppliedMult = 0.9f; // The amount of damage from a hit taken into account when dealing overflow damage public static readonly SoundStyle hit = new("CalamityMod/Sounds/Item/HyperiusOverflow"); public new string LocalizationCategory => "Items.Ammo"; public override void SetStaticDefaults() diff --git a/Items/Ammo/IcicleArrow.cs b/Items/Ammo/IcicleArrow.cs index 4efafcd10a..9625571c1c 100644 --- a/Items/Ammo/IcicleArrow.cs +++ b/Items/Ammo/IcicleArrow.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,12 +22,21 @@ namespace CalamityMod.Items.Ammo Item.DamageType = DamageClass.Ranged; Item.consumable = true; Item.knockBack = 2.5f; - Item.value = Item.buyPrice(copper: 80); // Sold by Archmage + Item.value = Item.sellPrice(copper: 20); Item.rare = ItemRarityID.Yellow; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 0.2f; Item.ammo = AmmoID.Arrow; Item.maxStack = Item.CommonMaxStack; } + public override void AddRecipes() + { + CreateRecipe(250). + AddIngredient(ItemID.WoodenArrow, 250). + AddIngredient(). + AddIngredient(ItemID.Ectoplasm). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Armor/Aerospec/AerospecHeadMagic.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs index 5dda2d7b17..76456d1b89 100644 --- a/Items/Armor/Aerospec/AerospecHeadMagic.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Aerospec { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static int MaxManaBoost = 30; + public static int MaxManaBoost = 40; public static float MagicDamageBoost = 0.1f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent()); diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 39e9bb66d6..6458df3a5a 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -1,8 +1,13 @@ -using CalamityMod.Items.Materials; +using System.Collections.Generic; +using System.IO; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Terraria.ModLoader.IO; namespace CalamityMod.Items.Armor.Astral { @@ -30,6 +35,42 @@ namespace CalamityMod.Items.Armor.Astral Item.rare = ItemRarityID.Cyan; Item.defense = 17; //63 } + #region Toggleable Omniscience effect + + bool toggleEnabled = true; + + public override bool CanRightClick() => Main.keyState.PressingShift(); + public override void RightClick(Player player) + { + toggleEnabled = !toggleEnabled; + Item.NetStateChanged(); + } + public override bool ConsumeItem(Player player) => false; + public override void SaveData(TagCompound tag) + { + tag.Add("toggleEffect", toggleEnabled); + } + + public override void LoadData(TagCompound tag) + { + toggleEnabled = tag.GetBool("toggleEffect"); + } + + public override void NetSend(BinaryWriter writer) + { + writer.Write(toggleEnabled); + } + + public override void NetReceive(BinaryReader reader) + { + toggleEnabled = reader.ReadBoolean(); + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + CalamityUtils.DrawInventoryDot(spriteBatch, position, new Vector2(16, 16) * Main.inventoryScale, toggleEnabled); + } + #endregion public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -46,7 +87,6 @@ namespace CalamityMod.Items.Armor.Astral player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusDamageBoost.ToPercent(), StarRainCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.astralStarRain = true; - modPlayer.omniscience = true; player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusDamageBoost; player.GetCritChance() += SetBonusCritBoost; @@ -57,6 +97,14 @@ namespace CalamityMod.Items.Armor.Astral { player.GetDamage() += DamageBoost; player.GetCritChance() += CritBoost; + var modPlayer = player.Calamity(); + modPlayer.omniscience = toggleEnabled; + } + + public override void ModifyTooltips(List tooltips) + { + if (!toggleEnabled) + tooltips.RemoveAll(x => x.Name == "Tooltip1"); } public override void AddRecipes() diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index 85a854995b..4b2eae5319 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor.Auric //Alternatively, their ModifyTooltips could simply return early if the item ID doesn't match the helmet type. if (Main.LocalPlayer.Calamity().auricSet) { - Main.LocalPlayer.armor[0].ModItem.ModifyTooltips(tooltips); + Main.LocalPlayer.armor[0].ModItem?.ModifyTooltips(tooltips); } } diff --git a/Items/Armor/Auric/AuricTeslaCuisses.cs b/Items/Armor/Auric/AuricTeslaCuisses.cs index 82d63d49bb..1ff610bc08 100644 --- a/Items/Armor/Auric/AuricTeslaCuisses.cs +++ b/Items/Armor/Auric/AuricTeslaCuisses.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Armor.Auric //Alternatively, their ModifyTooltips could simply return early if the item ID doesn't match the helmet type. if (Main.LocalPlayer.Calamity().auricSet) { - Main.LocalPlayer.armor[0].ModItem.ModifyTooltips(tooltips); + Main.LocalPlayer.armor[0].ModItem?.ModifyTooltips(tooltips); } if (!toggleEnabled) diff --git a/Items/Armor/Auric/AuricTeslaHeadMagic.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs index 7231f09ff0..e4a908579e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMagic.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSet = true; modPlayer.silvaMage = true; modPlayer.auricSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare } public override void ModifyTooltips(List tooltips) diff --git a/Items/Armor/Auric/AuricTeslaHeadMelee.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs index 33839d713e..feb38df486 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMelee.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayerDamage = true; modPlayer.auricSet = true; modPlayer.auricSetMelee = true; - player.crimsonRegen = true; // Inherited from Bloodflare player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index fa54b263bd..acd69acec9 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; modPlayer.auricSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index 6e73e4e0cc..ffe8c73ddf 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.auricSet = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; diff --git a/Items/Armor/Auric/AuricTeslaHeadSummon.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs index afe538c9a8..206c06785e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadSummon.cs +++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSummon = true; modPlayer.auricSet = true; modPlayer.WearingPostMLSummonerSet = true; - player.crimsonRegen = true; // Inherited from Bloodflare player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index a61f3e79c9..c4f3fea04a 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSet = true; modPlayer.bloodflareMage = true; player.setBonus = this.GetLocalization("SetBonus").Format(GhostBoltCooldown.FramesToSeconds(), BloodsplosionCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index bf15e2dad8..ff42b9d5dd 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -47,7 +47,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareMelee = true; player.aggro += SetBonusAggroBoost; player.setBonus = this.GetLocalization("SetBonus").Format(HitsToActivateFrenzy, FrenzyDuration.FramesToSeconds(), FrenzyMeleeDamageBoost.ToPercent(), FrenzyContactDamageReduction.ToPercent(), FrenzyCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index 79d94d6d44..f4c1376e75 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -47,7 +47,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index 1eb93b9746..230ad7fed4 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.Armor.Bloodflare public static float RogueDamageBoost = 0.15f; public static int RogueCritBoost = 10; public static float MoveSpeedBoost = 0.05f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + public static int RegenBonus = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent(),RegenBonus.ToRegenPerSecond()); // Set Bonus public static float SetBonusRogueStealth = 1.2f; @@ -44,7 +45,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); - player.crimsonRegen = true; } public override void UpdateEquip(Player player) @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Armor.Bloodflare player.GetDamage() += RogueDamageBoost; player.GetCritChance() += RogueCritBoost; player.moveSpeed += MoveSpeedBoost; + player.lifeRegen += RegenBonus; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 22204e8e7c..2748a27213 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSummon = true; modPlayer.WearingPostMLSummonerSet = true; player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), DefenseBoostBelowHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); - player.crimsonRegen = true; player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index d169b687ba..b93e9b2d92 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 5; // 39 + Item.defense = 8; // 42 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadMelee.cs b/Items/Armor/Daedalus/DaedalusHeadMelee.cs index db0b4c87ef..09107dbbf4 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMelee.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMelee.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 21; // 55 + Item.defense = 22; // 56 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 5a62695eb4..b52bf0a10a 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 9; // 43 + Item.defense = 14; // 48 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Daedalus/DaedalusHeadRogue.cs b/Items/Armor/Daedalus/DaedalusHeadRogue.cs index 5b4c79a506..495458d722 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRogue.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRogue.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Armor.Daedalus Item.height = 18; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 7; // 41 + Item.defense = 10; // 44 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index ed2f083749..997c216a6f 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Armor.Demonshade // Set Bonus public static int SetBonusMinionSlotBoost = 8; public static float SetBonusSummonDamageBoost = 1f; - public static int DevilDamage = 1000; public static int BeamDamage => CalamityUtils.ScaleWithDifficulty(300); public static int ScytheDamage => CalamityUtils.ScaleWithDifficulty(500); public static int EnrageDuration = CalamityUtils.SecondsToFrames(10); @@ -59,22 +58,6 @@ namespace CalamityMod.Items.Armor.Demonshade modPlayer.dsSetBonus = true; modPlayer.wearingRogueArmor = true; modPlayer.WearingPostMLSummonerSet = true; - if (player.whoAmI == Main.myPlayer && !modPlayer.chibii) - { - modPlayer.redDevil = true; - var source = player.GetSource_ItemUse(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - int damage = (int)player.GetTotalDamage().ApplyTo(DevilDamage); - - var devil = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 2f, 0f); - devil.originalDamage = DevilDamage; - } - } player.maxMinions += SetBonusMinionSlotBoost; player.GetDamage() += SetBonusSummonDamageBoost; } diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index 18a2b1abd4..08759c2a23 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Armor.Empyrean var modPlayer = player.Calamity(); modPlayer.xerocSet = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), PermanentWrathHealthRatio.ToPercent()); if (player.statLife <= (int)(player.statLifeMax2 * PermanentWrathHealthRatio)) player.AddBuff(ModContent.BuffType(), 2); modPlayer.wearingRogueArmor = true; diff --git a/Items/Armor/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/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index a6a9ad4c88..1eb312a365 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public static float OrbDamageCooldownMult = 0.5f; public static double OrbHealingRatio = 0.1D; public static double OrbHealingRatioLossPerPierce = 0.05D; - public static float OrbHealingCooldownMult = 1.25f; + public static float OrbHealingCooldownMult = 1f; public override void SetDefaults() { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 62313a8039..c4ba2b06f9 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,6 +1,7 @@ using System; using System.IO; using CalamityMod.Balancing; +using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; @@ -21,7 +22,6 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; using CalamityMod.NPCs.TownNPCs; @@ -192,25 +192,25 @@ namespace CalamityMod.Items stats[(int)VanillaWingID.FrozenWings].AccRunAccelerationMult = 1.5f; // 160 -> 130 flight time stats[(int)VanillaWingID.FlameWings].FlyTime = 130; - // 160 -> 180 flight time, 7.5 -> 6.25 horizontal speed + // 160 -> 180 flight time, 7.5 -> 6.75 horizontal speed stats[(int)VanillaWingID.BatWings].FlyTime = 180; - stats[(int)VanillaWingID.BatWings].AccRunSpeedOverride = 6.25f; + stats[(int)VanillaWingID.BatWings].AccRunSpeedOverride = 6.75f; // 1 -> 1.5 acceleration multiplier stats[(int)VanillaWingID.ButterflyWings].AccRunAccelerationMult = 1.5f; // 170 -> 240 flight time stats[(int)VanillaWingID.BoneWings].FlyTime = 240; - // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 1.5 acceleration multiplier + // 160 -> 170 flight time, 7.5 -> 9 horizontal speed, 1 -> 2 acceleration multiplier stats[(int)VanillaWingID.LeafWings].FlyTime = 170; stats[(int)VanillaWingID.LeafWings].AccRunSpeedOverride = 9f; - stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 1.5f; - // (Spectre Wings) 1 -> 2 acceleration multiplier - stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 2f; + stats[(int)VanillaWingID.LeafWings].AccRunAccelerationMult = 2f; + // (Spectre Wings) 1 -> 1.5 acceleration multiplier + stats[(int)VanillaWingID.GhostWings].AccRunAccelerationMult = 1.5f; // 170 -> 210 flight time stats[(int)VanillaWingID.BeetleWings].FlyTime = 210; - // 180 -> 210 flight time - stats[(int)VanillaWingID.TatteredFairyWings].FlyTime = 210; + // 180 -> 300 flight time + stats[(int)VanillaWingID.TatteredFairyWings].FlyTime = 300; // (Empress Wings) 150 -> 120 flight time stats[(int)VanillaWingID.RainbowWings].FlyTime = 120; @@ -329,9 +329,6 @@ namespace CalamityMod.Items if (modPlayer.gloveOfRecklessness) velocity = velocity.RotatedByRandom(MathHelper.ToRadians(12f)); } - - if (modPlayer.eArtifact && item.CountsAsClass()) - velocity *= 1.25f; } public override bool Shoot(Item item, Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) @@ -562,13 +559,6 @@ namespace CalamityMod.Items #region Use Item Changes public override void HoldItem(Item item, Player player) { - // Clear Evil Smasher buffs if not holding Evil Smasher - if (player.Calamity().evilSmasherBoost > 0) - { - if (item.type != ItemType()) - player.Calamity().evilSmasherBoost = 0; - } - if (player.Calamity().ChaosStone && item.mana == 0 && !player.ItemTimeIsZero) { player.manaRegenDelay = player.maxRegenDelay; @@ -623,6 +613,17 @@ namespace CalamityMod.Items } } + //Mana Potion interactions + if (item.healMana > 0 || player.HasBuff(ModContent.BuffType())) + { + //If mana potion used, kill all active Crown projectiles + if ((modPlayer.moonCrown || modPlayer.featherCrown) && modPlayer.mageCrownCount > 0) + { + modPlayer.mageCrownTimer = 300; + modPlayer.mageCrownCount = 0; + } + } + // Staff/Axe of Regrowth growing Calamity grass if (item.type == ItemID.StaffofRegrowth || item.type == ItemID.AcornAxe) { @@ -644,7 +645,7 @@ namespace CalamityMod.Items return true; } } - + return base.UseItem(item, player); } @@ -654,21 +655,6 @@ namespace CalamityMod.Items { return false; } - if (player.HeldItem.type == ItemType() && player.ownedProjectileCounts[ProjectileType()] == 0) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.ModProjectile is VoidConcentrationAura) - { - if (p.owner == player.whoAmI) - { - p.ModProjectile().HandleRightClick(); - break; - } - } - } - return false; - } if (player.HeldItem.type == ItemType()) { bool canContinue = true; @@ -907,15 +893,13 @@ namespace CalamityMod.Items // Hyperius Overflow if (target.Calamity().hyperiusMarked) { - int damage = 0; - if (target.Calamity().hyperiusDamage < damageDone) - damage = damageDone - target.Calamity().hyperiusDamage; - else - damage = damageDone; - target.Calamity().hyperiusDamage -= damage; + int damageDealt = (int)(damageDone * HyperiusBullet.overflowAppliedMult); + int damage = (int)Math.Min(target.Calamity().hyperiusDamage / HyperiusBullet.overflowEfficency, damageDealt); + + target.Calamity().hyperiusDamage -= (int)(damage * HyperiusBullet.overflowEfficency); // Spawn overflow hit - Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, player.whoAmI, target.whoAmI); + Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), damage, 0, player.whoAmI, target.whoAmI); overflow.DamageType = item.DamageType; overflow.ArmorPenetration = item.ArmorPenetration; // Takes the armor pen from what did the hit @@ -978,7 +962,7 @@ namespace CalamityMod.Items } else if (set == "SpectreHealing") { - player.GetDamage() += 0.4f; + player.GetDamage() += 0.2f; player.setBonus = CalamityUtils.GetTextValue("Vanilla.Armor.SetBonus.SpectreHealing"); } else if (set == "SolarFlare") @@ -1102,14 +1086,9 @@ namespace CalamityMod.Items modPlayer.fairyBoots = true; // Mana Flower tinker buffs - if (item.type == ItemID.MagnetFlower) - player.manaCost -= 0.02f; - if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak) - player.manaCost -= 0.04f; if (item.type == ItemID.ArcaneFlower) player.GetDamage() += 0.05f; - if (item.type == ItemID.EyeoftheGolem) { player.Calamity().critDamage += 0.15f; @@ -1167,16 +1146,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% @@ -1229,12 +1204,12 @@ namespace CalamityMod.Items } if (item.type == ItemID.DemonWings && !player.mount.Active) - player.maxFallSpeed *= 1.3f; + player.maxFallSpeed *= 1.2f; if (item.type == ItemID.BeeWings && !player.mount.Active && !player.controlDown) { - player.gravity *= 0.6f; - player.maxFallSpeed *= 0.6f; + player.gravity *= 0.75f; + player.maxFallSpeed *= 0.75f; } if (item.type == ItemID.FinWings) @@ -1315,24 +1290,22 @@ namespace CalamityMod.Items switch (item.type) { case ItemID.AngelWings: - maxAscentMultiplier *= 1.3f; - constantAscend *= 1.5f; - break; - case ItemID.DemonWings: - ascentWhenFalling *= 2f; - ascentWhenRising *= 2f; - maxCanAscendMultiplier *= 2f; - break; - case ItemID.FlameWings: maxAscentMultiplier *= 1.2f; constantAscend *= 1.35f; break; + case ItemID.DemonWings: + ascentWhenFalling *= 2f; + break; + case ItemID.FlameWings: + maxAscentMultiplier *= 1.1067f; + constantAscend *= 1.25f; + break; case ItemID.ButterflyWings: - maxAscentMultiplier *= 0.9f; + maxAscentMultiplier *= 0.6667f; constantAscend *= 5f; break; case ItemID.GhostWings: - maxAscentMultiplier *= 0.904f; + maxAscentMultiplier *= 0.6025f; constantAscend *= 5f; break; default: @@ -1488,7 +1461,7 @@ namespace CalamityMod.Items return false; } - #endregion + #endregion #region On Create private static int cachedForgeID = -1; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e783511cf0..60d2b7438a 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -8,6 +8,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; @@ -162,6 +163,20 @@ namespace CalamityMod.Items } } + //Replace Crit Chance with Crit Damage on applicable tooltips + if (CalamityItemSets.ShowScalingCritDamageTooltip[item.type]) + { + float cdmg = 2f + Main.LocalPlayer.Calamity().critDamage + Main.LocalPlayer.GetTotalCritChance(item.DamageType) * 0.02f; + tooltips.FirstOrDefault(x => x.Name == "CritChance")!.Text = CalamityUtils.GetText("Common.CritDamageTootip").Format(cdmg.ToPercent()); + } + + //Add "Uses X Minion Slots right above "Uses X Mana" + if (ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 || ContentSamples.ProjectilesByType[item.shoot].minionSlots > 0) + { + tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback") + 1, new(Mod, "Minions", CalamityUtils.GetText(ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 ? "Common.MinionSlotCost" : "Common.MinionSlotCostSingle").Format(ItemID.Sets.StaffMinionSlotsRequired[item.type]))); + } + + // Everything below this line can only apply to modded items. If the item is vanilla, stop here for efficiency. if (item.type < ItemID.Count) return; @@ -187,7 +202,7 @@ namespace CalamityMod.Items // If holding SHIFT, actually display the extended tooltip. if (holdingShift && firstTooltipIndex != -1) { - string holdShiftText = item.ModItem.GetLocalizedValue(holdShiftItem.TooltipExtensionKey); + string holdShiftText = holdShiftItem.TooltipExtensionText == LocalizedText.Empty ? item.ModItem.GetLocalizedValue(holdShiftItem.TooltipExtensionKey) : holdShiftItem.TooltipExtensionText.ToString(); TooltipLine holdShiftLine = new TooltipLine(Mod, IHoldShiftTooltipItem.ExtensionTooltipID, holdShiftText); if (holdShiftItem.TooltipExtensionColor is not null) holdShiftLine.OverrideColor = holdShiftItem.TooltipExtensionColor; @@ -278,8 +293,9 @@ namespace CalamityMod.Items tooltips.Insert(++difficultyTooltipIndex, donorLine); } - var buffIdsInTooltip = new HashSet(); - + // The int is the buff ID + // The byte determines what information to show; 0 = enemy, 1 = player, 2 = both + var buffIdsInTooltip = new Dictionary(); foreach (var tooltip in tooltips) { // Parse the tags of each line of text to find our buff tags' @@ -287,9 +303,18 @@ namespace CalamityMod.Items var snippets = ChatManager.ParseMessage(tooltip.Text, Color.White); foreach (var snippet in snippets) { - if (snippet is CalamityBuffTagHandler.Snippet buffSnippet) + if (snippet is BuffTagEnemyEffectHandler.Snippet enemy) { - buffIdsInTooltip.Add(buffSnippet.BuffId); + if (!buffIdsInTooltip.ContainsKey(enemy.BuffId)) + buffIdsInTooltip.Add(enemy.BuffId, 0); + } + else if (snippet is BuffTagPlayerEffectHandler.Snippet player) + { + if (!buffIdsInTooltip.TryAdd(player.BuffId, 1)) + { + buffIdsInTooltip.Remove(player.BuffId); + buffIdsInTooltip.Add(player.BuffId, 2); + } } } } @@ -298,26 +323,36 @@ namespace CalamityMod.Items { bool showTheTip = false; bool foundDebuff = false; - foreach (int buffId in buffIdsInTooltip) + foreach (var buffInfo in buffIdsInTooltip) { string tooltipKey = ""; - if (buffId < BuffID.Count) + string secondTooltipKey = ""; + // Change the localization based on whether it should display player or enemy info, or both + string locKey = buffInfo.Value == 1 ? "ItemTooltipPlayer" : "ItemTooltipEnemy"; + string secondLocKey = buffInfo.Value == 2 ? "ItemTooltipPlayer" : ""; + + if (buffInfo.Key < BuffID.Count) { - tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffId)}.ItemTooltip"; + tooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{locKey}"; + if (buffInfo.Value == 2) + secondTooltipKey = $"Mods.Terraria.Buffs.{BuffID.Search.GetName(buffInfo.Key)}.{secondLocKey}"; } else { - var modBuff = BuffLoader.GetBuff(buffId); - tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.ItemTooltip"; + var modBuff = BuffLoader.GetBuff(buffInfo.Key); + tooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{locKey}"; + if (buffInfo.Value == 2) + secondTooltipKey = $"Mods.{modBuff.Mod.Name}.Buffs.{modBuff.Name}.{secondLocKey}"; } - if (!Language.Exists(tooltipKey)) - { - continue; - } + var text = ""; + var secondText = ""; + if (Language.Exists(tooltipKey)) + text = Language.GetTextValue(tooltipKey); + if (Language.Exists(secondTooltipKey)) + secondText = Language.GetTextValue(secondTooltipKey); - var text = Language.GetTextValue(tooltipKey); - if (string.IsNullOrWhiteSpace(text)) + if (string.IsNullOrWhiteSpace(text) && string.IsNullOrWhiteSpace(secondText)) { continue; } @@ -329,7 +364,11 @@ namespace CalamityMod.Items break; } - tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffId, $"[cbuff:{buffId}]\n{text}")); + string extraLoc = GetTextValue(buffInfo.Value == 1 ? "Buffs.OnPlayer" : "Buffs.OnEnemy"); + if (!string.IsNullOrWhiteSpace(text)) + tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {extraLoc}\n{text}")); + if (buffInfo.Value == 2 && !string.IsNullOrWhiteSpace(secondText)) + tooltips.Insert(++lastTooltipIndex, new TooltipLine(Mod, "CalamityMod:AltExpandTooltip" + buffInfo.Key, $"[cbuff:{buffInfo.Key}] {GetTextValue("Buffs.OnPlayer")}\n{secondText}")); } if (showTheTip) @@ -743,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) @@ -784,10 +826,6 @@ namespace CalamityMod.Items } // Mana Flower tinker buffs. - if (item.type == ItemID.MagnetFlower) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("8%", "10%")); - if (item.type == ItemID.ArcaneFlower || item.type == ItemID.ManaCloak) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("8%", "12%")); if (item.type == ItemID.ArcaneFlower) EditTooltipByNum(2, (line) => line.Text += AddedTooltip("ArcaneFlower")); @@ -859,10 +897,7 @@ namespace CalamityMod.Items // Crimson if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves) - { - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", "6%")); EditTooltipByNum(0, (line) => line.Text += AddedTooltip("CrimsonArmorPieces")); - } // Magic Hat nerf if (item.type == ItemID.MagicHat) @@ -897,28 +932,6 @@ namespace CalamityMod.Items #endregion #region Hardmode Armor - // Cobalt - if (item.type == ItemID.CobaltHat) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); - - // Palladium - if (item.type == ItemID.PalladiumBreastplate) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("3%", $"{PalladiumArmorSetChange.ChestplateDamagePercentageBoost + 3}%")); - if (item.type == ItemID.PalladiumLeggings) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("2%", $"{PalladiumArmorSetChange.LeggingsDamagePercentageBoost + 2}%")); - - // Mythril - if (item.type == ItemID.MythrilHood) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("60", $"{MythrilArmorSetChange.MaxManaBoost + 60}")); - - // Orichalcum - if (item.type == ItemID.OrichalcumBreastplate) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("6%", $"{OrichalcumArmorSetChange.ChestplateCritChanceBoost + 6}%")); - - // Adamantite - if (item.type == ItemID.AdamantiteHeadgear) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("80", $"{AdamantiteArmorSetChange.MaxManaBoost + 80}")); - // Titanium if (item.type == ItemID.TitaniumMask) EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("9%", "14%")); @@ -1093,45 +1106,59 @@ namespace CalamityMod.Items float baseJumpSpeed = (CalamityServerConfig.Instance.FasterJumpSpeed ? BalancingConstants.ConfigBoostedBaseJumpSpeed : 5.01f) + 1f; StringBuilder sb = new StringBuilder(512); sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (tMax * baseJumpSpeed).ToMph())); - sb.Append('\n'); if (Main.keyState.PressingShift()) { - sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), asc.ToMphps(), (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), (asc + fall).ToMphps())); + sb.Append(GetText($"Common.WingStatsFull").Format(time.FramesToSeconds(), + BaseWings.HorizontalSpeedText(run), run.ToMph(), + BaseWings.VerticalSpeedText(tMax), (tMax * baseJumpSpeed).ToMph(), + BaseWings.HorizontalAccelerationText(stats.AccRunAccelerationMult), rAcc.ToMphps(), + BaseWings.VerticalAccelerationText(asc), asc.ToMphps(), + (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), + (asc + fall).ToMphps())); if (hover) { sb.Append('\n'); - sb.Append(CalamityUtils.GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); + sb.Append(GetText($"Common.WingStatsHover").Format(hSpeed.ToMph(), hAcc.ToMphps())); } } else - sb.Append($"[c/B8B8B8:{CalamityUtils.GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + { + sb.Append(GetText($"Common.WingStats").Format(time.FramesToSeconds(), BaseWings.HorizontalSpeedText(run), BaseWings.VerticalSpeedText(tMax), + BaseWings.HorizontalAccelerationText(stats.AccRunAccelerationMult), BaseWings.VerticalAccelerationText(asc))); + sb.Append('\n'); + sb.Append($"[c/B8B8B8:{GetTextValue("UI.HoldShiftTooltipExtensionIndicator")}]"); + } if (extraKey != null) { sb.Append('\n'); - sb.Append(CalamityUtils.GetTextValue($"Vanilla.Wings.{extraKey}")); + sb.Append(GetTextValue($"Vanilla.Wings.{extraKey}")); } return sb.ToString(); } // This function is shorthand for appending a stat sheet to a pair of wings. - void AddWingStats(int slot, float fall, float rise, float rMax, float tMax, float asc, string extraKey = null) => EditTooltipByNum(0, (line) => line.Text += WingStatsTooltip(ArmorIDs.Wing.Sets.Stats[slot], fall, rise, rMax, tMax, asc, extraKey)); + void AddWingStats(int slot, float fall, float rise, float rMax, float tMax, float asc, string extraKey = null) + { + TooltipLine commonWingTooltipLine = tooltips.FirstOrDefault(x => x.Text == Language.GetTextValue("CommonItemTooltip.FlightAndSlowfall") && x.Mod == "Terraria"); + if (commonWingTooltipLine != null) + commonWingTooltipLine.Text += WingStatsTooltip(ArmorIDs.Wing.Sets.Stats[slot], fall, rise, rMax, tMax, asc, extraKey); + } if (item.type == ItemID.CreativeWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.AngelWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.95f, 0.15f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.8f, 0.135f); if (item.type == ItemID.DemonWings) - AddWingStats(item.wingSlot, 1f, 0.2f, 1f, 1.5f, 0.1f, "DemonWings"); + AddWingStats(item.wingSlot, 1f, 0.1f, 0.5f, 1.5f, 0.1f, "DemonWings"); if (item.type == ItemID.Jetpack) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.ButterflyWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.35f, 0.5f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1f, 0.5f); if (item.type == ItemID.FairyWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); @@ -1146,13 +1173,13 @@ namespace CalamityMod.Items AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f, "BoneWings"); if (item.type == ItemID.FlameWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.8f, 0.135f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.125f); if (item.type == ItemID.FrozenWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.1f); if (item.type == ItemID.GhostWings) - AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.5f, 0.5f); + AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1f, 0.5f); if (item.type == ItemID.BeetleWings) AddWingStats(item.wingSlot, 0.5f, 0.1f, 0.5f, 1.66f, 0.1f); @@ -1615,35 +1642,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; @@ -1751,60 +1749,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 94410c1bc9..a9f8fbccc5 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -30,372 +30,359 @@ 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(60)) }, // VANILLA: 45 DMG + { 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)) }, // VANILLA: 9 DMG + { 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)) }, // VANILLA: 58 DMG + { 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.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)) }, // Aerial Bane. 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)) }, // VANILLA: 32 DMG + { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL + { ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed + { ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130) + { 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)) }, // VANILLA: 29 DMG + { ItemID.LastPrism, Do(DamageExact(57)) }, // VANILLA: 100 DMG + { 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)) }, // VANILLA: 35 DMG, 22 UT/UA + { ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG + { ItemID.MedusaHead, Do(DamageExact(75)) }, // VANILLA: 40 DMG + { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG + { 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)) }, // VANILLA: 35 DMG + { 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)) }, // VANILLA: 45 DMG + { ItemID.RainbowRod, Do(DamageExact(40), KnockbackExact(8f)) }, // VANILLA: 50 DMG, 6 KB + { 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), ShootSpeedExact(2f)) }, // VANILLA: 22 UT, 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)) }, // VANILLA: 52 DMG, 45 UT + { 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)) }, // VANILLA: 88 DMG. 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.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(3)) }, // Magma Skull - { ItemID.MoltenCharm, Do(DefenseExact(3)) }, //Magma Charm - { ItemID.MoltenSkullRose, Do(DefenseExact(4)) }, - { ItemID.ObsidianSkull, Do(DefenseExact(2)) }, - { ItemID.ObsidianSkullRose, Do(DefenseExact(3)) }, - { ItemID.Shackle, Do(DefenseExact(3)) }, - { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, // Valhalla Knight set - { ItemID.SquireAltPants, Do(DefenseDelta(-3)) }, - { ItemID.SquireAltShirt, Do(DefenseDelta(-3)) }, - { ItemID.SquireGreatHelm, Do(DefenseDelta(-1)) }, - { ItemID.SquireGreaves, Do(DefenseDelta(-2)) }, - { ItemID.SquirePlating, Do(DefenseDelta(-4)) }, + // 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/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 07e7f4cb50..384384a467 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,18 +11,11 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; - public static int RegenBoost = 4; - public static int RegenTimeBoost = 4; - - public static int DebuffedRegenBoost = 10; // Does not stack with above - public static int DebuffedRegenTimeFloor = 900; - - public static double ExtraRegenHealthThreshold = 0.75D; - public static int FramesForExtraRegen = 30; + public static int FramesForExtraRegen = 15; public static int BuffType = ModContent.BuffType(); public static int BuffDuration = 10; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), DebuffedRegenBoost.ToRegenPerSecond(), FramesForExtraRegen.FramesToSeconds(), ExtraRegenHealthThreshold.ToPercent(), BuffDuration); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FramesForExtraRegen.FramesToSeconds(), BuffDuration); public override void SetStaticDefaults() { diff --git a/Items/Fishing/EnchantedStarfish.cs b/Items/Fishing/EnchantedStarfish.cs index f34ae22667..24a8edd2b5 100644 --- a/Items/Fishing/EnchantedStarfish.cs +++ b/Items/Fishing/EnchantedStarfish.cs @@ -48,5 +48,7 @@ namespace CalamityMod.Items.Fishing } return true; } + + public override bool ConsumeItem(Player player) => player.ConsumedManaCrystals < Player.ManaCrystalMax; } } diff --git a/Items/Fishing/FishingRods/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/IHoldShiftTooltipItem.cs b/Items/IHoldShiftTooltipItem.cs index 28938b7a60..69df795e2a 100644 --- a/Items/IHoldShiftTooltipItem.cs +++ b/Items/IHoldShiftTooltipItem.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Terraria.Localization; namespace CalamityMod.Items { @@ -75,6 +76,11 @@ namespace CalamityMod.Items #endregion #region Tooltip Extension Properties + /// + /// The localization text object itself. Override to allow text to be formatted. + /// + public virtual LocalizedText TooltipExtensionText => LocalizedText.Empty; + /// /// The lang/localization key which this item uses for its tooltip extension. /// diff --git a/Items/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/CosmiliteBar.cs b/Items/Materials/CosmiliteBar.cs index 3bc6ddbe7c..80133e73e6 100644 --- a/Items/Materials/CosmiliteBar.cs +++ b/Items/Materials/CosmiliteBar.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Materials Item.ResearchUnlockCount = 25; ItemID.Sets.SortingPriorityMaterials[Type] = 114; ItemID.Sets.AnimatesAsSoul[Type] = true; - Main.RegisterItemAnimation(Type, new DrawAnimationVertical(6, 10)); + Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 13)); } public override void SetDefaults() diff --git a/Items/Materials/CosmiliteBar.png b/Items/Materials/CosmiliteBar.png index 7c8f6ed134..2c84750b35 100644 Binary files a/Items/Materials/CosmiliteBar.png and b/Items/Materials/CosmiliteBar.png differ diff --git a/Items/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/PermanentBoosters/CometShard.cs b/Items/PermanentBoosters/CometShard.cs index 3511bc45e1..84aa0dd540 100644 --- a/Items/PermanentBoosters/CometShard.cs +++ b/Items/PermanentBoosters/CometShard.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.PermanentBoosters { public new string LocalizationCategory => "Items.Misc"; public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/CometShardUse"); - public const int ManaBoost = 50; + public const int ManaBoost = 60; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaBoost); public override void SetStaticDefaults() diff --git a/Items/PermanentBoosters/EtherealCore.cs b/Items/PermanentBoosters/EtherealCore.cs index 4f5d4438ce..ca91374064 100644 --- a/Items/PermanentBoosters/EtherealCore.cs +++ b/Items/PermanentBoosters/EtherealCore.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.PermanentBoosters { public new string LocalizationCategory => "Items.Misc"; public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/EtherealCoreUse"); - public const int ManaBoost = 50; + public const int ManaBoost = 60; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaBoost); public override void SetStaticDefaults() diff --git a/Items/PermanentBoosters/PhantomHeart.cs b/Items/PermanentBoosters/PhantomHeart.cs index bfa46677c1..bfc1d8f6c5 100644 --- a/Items/PermanentBoosters/PhantomHeart.cs +++ b/Items/PermanentBoosters/PhantomHeart.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.PermanentBoosters { public new string LocalizationCategory => "Items.Misc"; public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/PhantomHeartUse"); - public const int ManaBoost = 50; + public const int ManaBoost = 60; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaBoost); public override void SetStaticDefaults() 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/Pets/StarSwallowerUnit.cs b/Items/Pets/StarSwallowerUnit.cs new file mode 100644 index 0000000000..85fededc2a --- /dev/null +++ b/Items/Pets/StarSwallowerUnit.cs @@ -0,0 +1,41 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Pets; +using CalamityMod.Rarities; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class StarSwallowerUnit : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Pets"; + public override void SetDefaults() + { + Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); + Item.value = Item.sellPrice(gold: 1); + Item.rare = ModContent.RarityType(); + Item.useStyle = ItemUseStyleID.HoldUp; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(Item.buffType, 15, true); + } + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Frog). + AddIngredient(8). + AddIngredient(4). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Pets/StarSwallowerUnit.png b/Items/Pets/StarSwallowerUnit.png new file mode 100644 index 0000000000..9c51f4ae86 Binary files /dev/null and b/Items/Pets/StarSwallowerUnit.png differ diff --git a/Items/Placeables/Furniture/CorruptionEffigy.cs b/Items/Placeables/Furniture/CorruptionEffigy.cs index f4518459b6..a8a1a05932 100644 --- a/Items/Placeables/Furniture/CorruptionEffigy.cs +++ b/Items/Placeables/Furniture/CorruptionEffigy.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Placeables.Furniture public static float MoveSpeedBoost = 0.1f; public static int CritBoost = 10; // Both 10% so we only need just one in the tooltip - public static float DamageReductionLoss = 0.05f; + public static float DamageReductionLoss = 0.1f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost, DamageReductionLoss.ToPercent()); public override void SetDefaults() diff --git a/Items/Placeables/Furniture/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/Furniture/CrimsonEffigy.cs b/Items/Placeables/Furniture/CrimsonEffigy.cs index 3a69a53431..1662948a74 100644 --- a/Items/Placeables/Furniture/CrimsonEffigy.cs +++ b/Items/Placeables/Furniture/CrimsonEffigy.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Placeables.Furniture public new string LocalizationCategory => "Items.Placeables"; public static float DamageBoost = 0.15f; - public static int DefenseBoost = 10; + public static int DefenseBoost = 6; public static float MaxHealthLossPercent = 0.1f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, MaxHealthLossPercent.ToPercent()); diff --git a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs index f50c787909..99b52e7168 100644 --- a/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/Paintings/ThankYouPainting.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings { "Altixal", "apotofkoolaid", + "ArchonSystem", "Atalya", "Ben-TK", "Big E", @@ -60,18 +61,17 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Cooper", "CosmaticMango", "CrabBar", + "Critaquil", "Dandy", "Dia", "Done", "dozezoze", - "ENNWAY", "Flowaria", "Fluffy", "fryzahh", - "HaguriHat", + "Gpscorpion", "jasper", "LordMetarex", - "math2", "Moonburn", "Ozzatron", "Piky", @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "_tofu", "Tomat", "Triangle", - "TYESKI (Universe)", + "TYESKI", "Xyk", "YuH", // Former devs @@ -120,6 +120,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Ein", "enamoured", "Enreden", + "ENNWAY", "Epsilon", "Fargowilta", "Frous", @@ -147,6 +148,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings "Lompl Allimath", "Lucille Karma", "MarieArk", + "math2", "Mercutio 'Merkalto' Takle", "Mihaii", "Minecat", 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..4cbbc4eaf7 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -13,9 +13,8 @@ namespace CalamityMod.Items.Potions { public new string LocalizationCategory => "Items.Potions"; - public static int ManaPerFrame = 2; - public static int SelfDamage = 5; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaPerFrame * 60, SelfDamage); + public static int ManaPerFrame = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaPerFrame * 60); public override void SetStaticDefaults() { @@ -28,40 +27,20 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(14, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(5), true); + Item.DefaultToFood(14, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(6), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Lime; } - public override void OnConsumeItem(Player player) - { - player.AddBuff(BuffID.ManaSickness, Player.manaSickTime / 2, true); - player.statLife -= SelfDamage; - if (Main.myPlayer == player.whoAmI) - { - player.HealEffect(-SelfDamage, true); - } - if (player.statLife <= 0) - { - player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInjection" + Main.rand.Next(1, 2 + 1)).ToNetworkText(player.name)), 1000.0, 0, false); - } - } + public override void OnConsumeItem(Player player) => player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); 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/AureusCell.cs b/Items/Potions/AureusCell.cs index 5878710f40..3297737fec 100644 --- a/Items/Potions/AureusCell.cs +++ b/Items/Potions/AureusCell.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Potions { // Eating animation but gulp sound? Sure Item.DefaultToFood(22, 38, BuffID.MagicPower, CalamityUtils.MinutesToFrames(8)); - Item.healMana = 200; Item.UseSound = SoundID.Item3; Item.value = Item.sellPrice(silver: 50); // Based on material cost rather than potion cost Item.rare = ItemRarityID.Lime; @@ -32,19 +31,6 @@ namespace CalamityMod.Items.Potions public override void OnConsumeItem(Player player) { - if (PlayerInput.Triggers.JustPressed.QuickBuff) - { - player.statMana += Item.healMana; - if (player.statMana > player.statManaMax2) - { - player.statMana = player.statManaMax2; - } - player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); - if (Main.myPlayer == player.whoAmI) - { - player.ManaEffect(Item.healMana); - } - } player.AddBuff(BuffID.MagicPower, Item.buffTime); player.AddBuff(BuffID.ManaRegeneration, Item.buffTime); } 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/Grax.cs b/Items/Tools/Grax.cs index 1cd4cc87d7..73deccfbe7 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Tools @@ -14,9 +15,9 @@ namespace CalamityMod.Items.Tools private const int AxePower = 180 / 5; public static float DamageBoost = 0.15f; - public static int DefenseBoost = 30; - public static float DamageReductionBoost = 0.1f; - + public static int DefenseBoost = 15; + public static int GraxBoostDuration = CalamityUtils.SecondsToFrames(10); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseBoost, GraxBoostDuration.FramesToSeconds()); public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; @@ -72,7 +73,7 @@ namespace CalamityMod.Items.Tools public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 600); + player.AddBuff(ModContent.BuffType(), GraxBoostDuration); } } } diff --git a/Items/Tools/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/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index c0f2e9952f..690d11d151 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -67,7 +67,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, new int[] { ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 43c6867f92..e37abd0f63 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -17,16 +17,10 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Adamantite"; - public const int MaxManaBoost = 20; public const int DefenseBoostMax = 10; public const int TimeUntilDecayBeginsAfterAttacking = 60; - public const int TimeUntilBoostCompletelyDecays = 210; - - public override void ApplyHeadPieceEffect(Player player) - { - if (player.armor[0].type == ItemID.AdamantiteHeadgear) - player.statManaMax2 += MaxManaBoost; - } + public const int TimeUntilBoostCompletelyDecays = 210; // Unlisted use: this is also the amount of hits to max out defense. + public const int CritToDRConversionPercent = 25; public override void UpdateSetBonusText(ref string setBonusText) { @@ -36,12 +30,12 @@ namespace CalamityMod.Items.VanillaArmorChanges setBonusText = CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}.Melee"); } - setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(DefenseBoostMax)}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(CritToDRConversionPercent, DefenseBoostMax, TimeUntilBoostCompletelyDecays.FramesToSeconds())}"; } public override void ApplyArmorSetBonus(Player player) { - int critBoost = (int)(MathHelper.Clamp(player.endurance, 0f, 1f) * 50f); + int critBoost = (int)(MathHelper.Clamp(player.endurance, 0f, 1f) * CritToDRConversionPercent); switch (player.armor[0].type) { case ItemID.AdamantiteHeadgear: diff --git a/Items/VanillaArmorChanges/CobaltArmorSetChange.cs b/Items/VanillaArmorChanges/CobaltArmorSetChange.cs index d8cd7c5c0f..b4441ddbcd 100644 --- a/Items/VanillaArmorChanges/CobaltArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CobaltArmorSetChange.cs @@ -18,16 +18,9 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Cobalt"; public const int SpeedBoostSetBonusPercentage = 10; - public const int MaxManaBoost = 20; public const int MovementSpeedBoostPercentageMax = 10; public const int MovementSpeedBoostMphThreshold = 80; - public override void ApplyHeadPieceEffect(Player player) - { - if (player.armor[0].type == ItemID.CobaltHat) - player.statManaMax2 += MaxManaBoost; - } - public override void UpdateSetBonusText(ref string setBonusText) { Player player = Main.LocalPlayer; diff --git a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs index 3ba4856861..233e6dcee9 100644 --- a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Crimson"; - public const float ArmorPieceDamage = 0.06f; public const int ArmorPieceLifeRegen = 1; // Set bonus clarification @@ -25,9 +24,6 @@ namespace CalamityMod.Items.VanillaArmorChanges private static void ApplyAnyPieceEffect(Player player) { - // Remove the vanilla +3% damage and add the new damage value at the same time - player.GetDamage() += ArmorPieceDamage - 0.03f; - // Give life regen player.lifeRegen += ArmorPieceLifeRegen; } diff --git a/Items/VanillaArmorChanges/FrostArmorSetChange.cs b/Items/VanillaArmorChanges/FrostArmorSetChange.cs index f84f8b0fa0..f98bfee7ba 100644 --- a/Items/VanillaArmorChanges/FrostArmorSetChange.cs +++ b/Items/VanillaArmorChanges/FrostArmorSetChange.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Frost"; - public const float ProximityBoost = 0.2f; - public const float MinDistance = 160f; - public const float MaxDistance = 800f; + public const float ProximityBoost = 0.25f; + public const float MinDistance = 80f; + public const float MaxDistance = 720f; public override void UpdateSetBonusText(ref string setBonusText) { diff --git a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs index 5ed1269dab..ac878db015 100644 --- a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Mythril"; - public const int MaxManaBoost = 20; public const int FlareFrameSpawnDelay = 12; public const int FlareDamageSoftcap = 40; @@ -27,12 +26,6 @@ namespace CalamityMod.Items.VanillaArmorChanges setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(FlareFrameSpawnDelay)}"; } - public override void ApplyHeadPieceEffect(Player player) - { - if (player.armor[0].type == ItemID.MythrilHood) - player.statManaMax2 += MaxManaBoost; - } - public override void ApplyArmorSetBonus(Player player) { player.Calamity().MythrilSet = true; diff --git a/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs b/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs deleted file mode 100644 index ec3cb749c2..0000000000 --- a/Items/VanillaArmorChanges/OrichalcumArmorSetChange.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.VanillaArmorChanges -{ - public class OrichalcumArmorSetChange : VanillaArmorChange - { - public override int? HeadPieceID => ItemID.OrichalcumHelmet; - - public override int? BodyPieceID => ItemID.OrichalcumBreastplate; - - public override int? LegPieceID => ItemID.OrichalcumLeggings; - - public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.OrichalcumHeadgear, ItemID.OrichalcumMask }; - - public override string ArmorSetName => "Orichalcum"; - - public const int ChestplateCritChanceBoost = 4; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestplateCritChanceBoost; - } -} diff --git a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs index 064aa47036..53913379ff 100644 --- a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs @@ -16,19 +16,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Palladium"; - public const int ChestplateDamagePercentageBoost = 2; - public const int LeggingsDamagePercentageBoost = 3; - - public override void ApplyBodyPieceEffect(Player player) - { - player.GetDamage() += ChestplateDamagePercentageBoost * 0.01f; - } - - public override void ApplyLegPieceEffect(Player player) - { - player.GetDamage() += LeggingsDamagePercentageBoost * 0.01f; - } - public override void UpdateSetBonusText(ref string setBonusText) { setBonusText = $"{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; diff --git a/Items/VanillaArmorChanges/RainArmorSetChange.cs b/Items/VanillaArmorChanges/RainArmorSetChange.cs index d777dc2c4a..cd67076673 100644 --- a/Items/VanillaArmorChanges/RainArmorSetChange.cs +++ b/Items/VanillaArmorChanges/RainArmorSetChange.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public static void SpawnRainArmorJump(Player Player) { bool rainBoost = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining; - int damage = (int)Player.GetBestClassDamage().ApplyTo(30 * (rainBoost ? 2f : 1)); + int damage = (int)Player.GetBestClassDamage().ApplyTo(30 * (rainBoost ? 1.5f : 1)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Vector2.UnitY * 26, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer); } } diff --git a/Items/Weapons/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/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 7520d358ee..a7d095df89 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -33,10 +33,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.DamageType = DamageClass.Magic; Item.damage = 705; Item.knockBack = 7f; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useAnimation = Item.useTime = 45; Item.autoReuse = true; - Item.mana = 24; + Item.mana = 36; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = FireSound; diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 45033681b3..73226ea694 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -24,10 +24,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.DamageType = DamageClass.Magic; Item.damage = 42; Item.knockBack = 3f; - Item.useTime = 64; - Item.useAnimation = 64; + Item.useAnimation = Item.useTime = 64; Item.autoReuse = true; - Item.mana = 15; + Item.mana = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = PulseRifle.FireSound with { Pitch = 0.3f, Volume = 0.7f }; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 4abbc9858a..6745f8807d 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.knockBack = 10f; Item.useTime = Item.useAnimation = 90; Item.autoReuse = true; - Item.mana = 60; + Item.mana = 120; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = FireSound; diff --git a/Items/Weapons/Magic/AbyssShocker.cs b/Items/Weapons/Magic/AbyssShocker.cs index bc02df607b..e168061648 100644 --- a/Items/Weapons/Magic/AbyssShocker.cs +++ b/Items/Weapons/Magic/AbyssShocker.cs @@ -14,9 +14,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 86; Item.height = 32; - Item.damage = 27; + Item.damage = 30; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 14; Item.useAnimation = Item.useTime = 19; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 7223d35dbe..5bd42780b5 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 94; Item.height = 54; - Item.damage = 355; + Item.damage = 315; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useAnimation = Item.useTime = UseTime; diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs index e6b56a57c7..48329f3ad6 100644 --- a/Items/Weapons/Magic/AethersWhisper.cs +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 134; Item.height = 44; - Item.damage = 504; + Item.damage = 600; Item.knockBack = 5.5f; Item.useAnimation = Item.useTime = 24; Item.shootSpeed = 12f; diff --git a/Items/Weapons/Magic/AlphaDraconis.cs b/Items/Weapons/Magic/AlphaDraconis.cs index ee0ed26f78..9789aa3161 100644 --- a/Items/Weapons/Magic/AlphaDraconis.cs +++ b/Items/Weapons/Magic/AlphaDraconis.cs @@ -28,9 +28,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 74; Item.damage = 150; Item.DamageType = DamageClass.Magic; - Item.mana = 12; - Item.useTime = 12; - Item.useAnimation = 12; + Item.mana = 16; + Item.useAnimation = Item.useTime = 12; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.2f; diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index 2bf63f0bd7..7f6cb2cda0 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -20,9 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 52; Item.damage = 65; Item.DamageType = DamageClass.Magic; - Item.mana = 8; - Item.useTime = 17; - Item.useAnimation = 17; + Item.mana = 15; + Item.useAnimation = Item.useTime = 17; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/Apathanull.cs b/Items/Weapons/Magic/Apathanull.cs index 799f6e63bc..be57d1a227 100644 --- a/Items/Weapons/Magic/Apathanull.cs +++ b/Items/Weapons/Magic/Apathanull.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 63; Item.DamageType = DamageClass.Magic; Item.crit = 12; - Item.mana = 20; + Item.mana = 26; Item.useTime = 8; Item.useAnimation = 20; Item.reuseDelay = 8; diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index db3036dc29..2052a2ec6f 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 40; Item.DamageType = DamageClass.Magic; Item.mana = 14; - Item.useAnimation = 5; - Item.useTime = 5; + Item.useAnimation = Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 6f; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index 278a72e01e..dbfc18e573 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 34; Item.damage = 222; Item.DamageType = DamageClass.Magic; - Item.mana = 42; + Item.mana = 277; Item.useAnimation = Item.useTime = 167; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index a5eab40668..a933cc1bdf 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 84; Item.damage = 17; Item.DamageType = DamageClass.Magic; - Item.mana = 3; - Item.useTime = 22; - Item.useAnimation = 22; + Item.mana = 10; + Item.useAnimation = Item.useTime = 22; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.5f; diff --git a/Items/Weapons/Magic/ArchAmaryllis.cs b/Items/Weapons/Magic/ArchAmaryllis.cs index 654f269409..60dcbb5cbb 100644 --- a/Items/Weapons/Magic/ArchAmaryllis.cs +++ b/Items/Weapons/Magic/ArchAmaryllis.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 68; Item.damage = 58; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 23; - Item.useAnimation = 23; + Item.mana = 23; + Item.useAnimation = Item.useTime = 23; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7.5f; diff --git a/Items/Weapons/Magic/ArtAttack.cs b/Items/Weapons/Magic/ArtAttack.cs index b16f045350..48eedfc601 100644 --- a/Items/Weapons/Magic/ArtAttack.cs +++ b/Items/Weapons/Magic/ArtAttack.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -16,9 +17,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 70; Item.height = 70; - Item.damage = 80; + Item.damage = 120; Item.DamageType = DamageClass.Magic; - Item.mana = 20; + Item.mana = 60; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -34,6 +35,13 @@ namespace CalamityMod.Items.Weapons.Magic Item.Calamity().donorItem = true; } + // Cancels out the mana used to summon the holdout + public override void OnConsumeMana(Player player, int manaConsumed) + { + if (player.ownedProjectileCounts[Item.shoot] <= 0) + player.statMana += manaConsumed; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index a4338c8a20..ed1cac00a0 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -21,9 +21,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 52; Item.damage = 55; Item.DamageType = DamageClass.Magic; - Item.mana = 19; - Item.useTime = 21; - Item.useAnimation = 21; + Item.mana = 16; + Item.useAnimation = Item.useTime = 21; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index 9aaf1df0bd..4a6587427b 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -24,9 +24,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 81; Item.DamageType = DamageClass.Magic; - Item.mana = 12; - Item.useTime = 25; - Item.useAnimation = 25; + Item.mana = 15; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index f9e5d70960..37e6ec4379 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 22; Item.damage = BaseDamage; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 16; Item.useTime = 12; Item.useAnimation = 24; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/BlackAnurian.cs b/Items/Weapons/Magic/BlackAnurian.cs index 3c40c780a5..366922308f 100644 --- a/Items/Weapons/Magic/BlackAnurian.cs +++ b/Items/Weapons/Magic/BlackAnurian.cs @@ -14,11 +14,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 58; Item.height = 38; - Item.damage = 21; + Item.damage = 24; Item.DamageType = DamageClass.Magic; - Item.mana = 9; - Item.useTime = 18; - Item.useAnimation = 18; + Item.mana = 13; + Item.useAnimation = Item.useTime = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.75f; diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index 53bf0748d8..3485e92f94 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 50; Item.damage = 24; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 12; Item.useTime = 15; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/BrimroseStaff.cs b/Items/Weapons/Magic/BrimroseStaff.cs index 3baf578096..a451948664 100644 --- a/Items/Weapons/Magic/BrimroseStaff.cs +++ b/Items/Weapons/Magic/BrimroseStaff.cs @@ -20,9 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 34; Item.damage = 45; Item.DamageType = DamageClass.Magic; - Item.mana = 6; - Item.useTime = 16; - Item.useAnimation = 16; + Item.mana = 12; + Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7f; diff --git a/Items/Weapons/Magic/BurningSea.cs b/Items/Weapons/Magic/BurningSea.cs index 91257ae1d1..606e5db6e8 100644 --- a/Items/Weapons/Magic/BurningSea.cs +++ b/Items/Weapons/Magic/BurningSea.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 30; - Item.damage = 69; + Item.damage = 56; Item.DamageType = DamageClass.Magic; Item.mana = 8; Item.useTime = 20; diff --git a/Items/Weapons/Magic/ChronomancersScythe.cs b/Items/Weapons/Magic/ChronomancersScythe.cs index 7785365ef0..33b9019373 100644 --- a/Items/Weapons/Magic/ChronomancersScythe.cs +++ b/Items/Weapons/Magic/ChronomancersScythe.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = false; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item71; - Item.mana = 10; + Item.mana = 30; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; diff --git a/Items/Weapons/Magic/CoralSpout.cs b/Items/Weapons/Magic/CoralSpout.cs index f0df8bd95b..495e00f293 100644 --- a/Items/Weapons/Magic/CoralSpout.cs +++ b/Items/Weapons/Magic/CoralSpout.cs @@ -23,11 +23,10 @@ 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; - Item.useAnimation = 26; + Item.mana = 30; + Item.useAnimation = Item.useTime = 26; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.channel = true; @@ -38,6 +37,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/Cryophobia.cs b/Items/Weapons/Magic/Cryophobia.cs index cb6f719579..646bddac01 100644 --- a/Items/Weapons/Magic/Cryophobia.cs +++ b/Items/Weapons/Magic/Cryophobia.cs @@ -14,9 +14,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 34; Item.damage = 96; Item.DamageType = DamageClass.Magic; - Item.mana = 18; - Item.useTime = 40; - Item.useAnimation = 40; + Item.mana = 22; + Item.useAnimation = Item.useTime = 40; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index ed3956944a..a7bd4d6d42 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 16; Item.damage = 60; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 12; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/EidolicWail.cs b/Items/Weapons/Magic/EidolicWail.cs index 6eb2576e61..15de8c3c0b 100644 --- a/Items/Weapons/Magic/EidolicWail.cs +++ b/Items/Weapons/Magic/EidolicWail.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 60; Item.damage = 943; Item.DamageType = DamageClass.Magic; - Item.mana = 30; + Item.mana = 90; Item.useTime = 10; Item.useAnimation = 30; Item.reuseDelay = 40; diff --git a/Items/Weapons/Magic/EidolonStaff.cs b/Items/Weapons/Magic/EidolonStaff.cs index f3c14ab5b0..cbd9a58959 100644 --- a/Items/Weapons/Magic/EidolonStaff.cs +++ b/Items/Weapons/Magic/EidolonStaff.cs @@ -24,9 +24,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 56; Item.damage = 180; Item.DamageType = DamageClass.Magic; - Item.mana = 20; - Item.useTime = 18; - Item.useAnimation = 18; + Item.mana = 24; + Item.useAnimation = Item.useTime = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index db855f0b79..fefa3f26ea 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 32; Item.DamageType = DamageClass.Magic; Item.crit = 5; - Item.mana = 7; + Item.mana = 13; Item.useTime = 7; Item.useAnimation = 21; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 39d89390ce..913475841f 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 40; Item.damage = BaseDamage; Item.DamageType = DamageClass.Magic; - Item.mana = 30; + Item.mana = 300; Item.useAnimation = Item.useTime = 120; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index 70401af4c4..a84120af62 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -16,11 +16,11 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 46; - Item.damage = 70; + Item.damage = 77; Item.knockBack = 3.5f; Item.noMelee = true; Item.DamageType = DamageClass.Magic; - Item.mana = 12; + Item.mana = 32; Item.useAnimation = Item.useTime = 32; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index bff3fc20e7..a2182c7753 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 50; Item.damage = 130; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 14; Item.useTime = 5; Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index 26f28c4056..b89d9b77dd 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -25,8 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 120; Item.DamageType = DamageClass.Magic; Item.mana = 20; - Item.useTime = 16; - Item.useAnimation = 16; + Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; diff --git a/Items/Weapons/Magic/FlareBolt.cs b/Items/Weapons/Magic/FlareBolt.cs index 2dfac6fc97..8f3e2f1489 100644 --- a/Items/Weapons/Magic/FlareBolt.cs +++ b/Items/Weapons/Magic/FlareBolt.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 38; Item.damage = 40; Item.DamageType = DamageClass.Magic; - Item.mana = 22; - Item.useTime = 80; - Item.useAnimation = 80; + Item.mana = 40; + Item.useAnimation = Item.useTime = 80; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/FrigidflashBolt.cs b/Items/Weapons/Magic/FrigidflashBolt.cs index c88eaef054..65e04f2664 100644 --- a/Items/Weapons/Magic/FrigidflashBolt.cs +++ b/Items/Weapons/Magic/FrigidflashBolt.cs @@ -27,9 +27,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 42; Item.damage = 95; Item.DamageType = DamageClass.Magic; - Item.mana = 13; - Item.useTime = 20; - Item.useAnimation = 20; + Item.mana = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index 1e24726a97..cfa6466d6a 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -22,9 +22,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; - Item.mana = 20; - Item.useTime = 27; - Item.useAnimation = 27; + Item.mana = 36; + Item.useAnimation = Item.useTime = 27; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/GleamingMagnolia.cs b/Items/Weapons/Magic/GleamingMagnolia.cs index f3806aa889..56a4cd3c5b 100644 --- a/Items/Weapons/Magic/GleamingMagnolia.cs +++ b/Items/Weapons/Magic/GleamingMagnolia.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 54; Item.damage = 53; Item.DamageType = DamageClass.Magic; - Item.mana = 11; - Item.useTime = 27; - Item.useAnimation = 27; + Item.mana = 15; + Item.useAnimation = Item.useTime = 27; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; diff --git a/Items/Weapons/Magic/GloriousEnd.cs b/Items/Weapons/Magic/GloriousEnd.cs index fa31df187f..899d39a098 100644 --- a/Items/Weapons/Magic/GloriousEnd.cs +++ b/Items/Weapons/Magic/GloriousEnd.cs @@ -9,16 +9,18 @@ namespace CalamityMod.Items.Weapons.Magic public class GloriousEnd : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - public static int PlayerExplosionDmgMin = 60; - public static int PlayerExplosionDmgMax = 80; + + // Scales with difficulty (Expert: 60-80) + public static int PlayerExplosionDmgMin = 30; + public static int PlayerExplosionDmgMax = 40; public override void SetDefaults() { Item.width = 30; Item.height = 58; - Item.damage = 100; + Item.damage = 60; Item.knockBack = 10f; Item.useAnimation = Item.useTime = 30; - Item.mana = 20; + Item.mana = 60; Item.DamageType = DamageClass.Magic; Item.channel = true; Item.shootSpeed = 7f; diff --git a/Items/Weapons/Magic/GruesomeEminence.cs b/Items/Weapons/Magic/GruesomeEminence.cs index 2e56c3fd15..1ee7f0c77f 100644 --- a/Items/Weapons/Magic/GruesomeEminence.cs +++ b/Items/Weapons/Magic/GruesomeEminence.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.noUseGraphic = true; Item.channel = true; - Item.mana = 400; - Item.useTime = 27; - Item.useAnimation = 27; + Item.mana = 30; + Item.useAnimation = Item.useTime = 27; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index 356a140f32..e141d3dc43 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -23,14 +24,20 @@ namespace CalamityMod.Items.Weapons.Magic public static int AftershotCooldownFrames = 17; public static int FullChargeFrames = 88; + public override void SetStaticDefaults() + { + base.SetStaticDefaults(); + CalamityItemSets.ShowScalingCritDamageTooltip[Type] = true; + } + public override void SetDefaults() { Item.width = 112; Item.height = 112; Item.DamageType = DamageClass.Magic; - Item.damage = 5100; + Item.damage = 2700; Item.knockBack = 9.5f; - Item.mana = 80; + Item.mana = 120; Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.autoReuse = true; Item.noMelee = true; 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/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index 1a4654ad88..8d9e965715 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -21,9 +21,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 34; Item.damage = 22; Item.DamageType = DamageClass.Magic; - Item.mana = 7; - Item.useTime = 24; - Item.useAnimation = 24; + Item.mana = 10; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index 6b23620bef..258c342866 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 60; Item.useStyle = ItemUseStyleID.HoldUp; Item.DamageType = DamageClass.Magic; - Item.mana = 180; + Item.mana = 300; Item.noMelee = true; Item.UseSound = CastSound; diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index 5b4f710290..773ea06d41 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 50; Item.DamageType = DamageClass.Magic; Item.crit = 25; - Item.mana = 15; + Item.mana = 25; Item.useTime = 2; Item.useAnimation = 30; Item.reuseDelay = Item.useAnimation + 6; 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/LashesofChaos.cs b/Items/Weapons/Magic/LashesofChaos.cs index 7da3eaaf27..542b049cc2 100644 --- a/Items/Weapons/Magic/LashesofChaos.cs +++ b/Items/Weapons/Magic/LashesofChaos.cs @@ -21,11 +21,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 30; - Item.damage = 111; + Item.damage = 130; Item.DamageType = DamageClass.Magic; - Item.mana = 20; - Item.useTime = 46; - Item.useAnimation = 46; + Item.mana = 28; + Item.useAnimation = Item.useTime = 46; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 7.5f; @@ -33,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.rare = ItemRarityID.Lime; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 11f; + Item.shootSpeed = 14f; } // Shoots twice as fast (and uses half as much mana to compensate) during hellblasts diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index c3a329728b..f08a786564 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 78; Item.damage = 200; Item.DamageType = DamageClass.Magic; - Item.mana = 32; - Item.useTime = 37; - Item.useAnimation = 37; + Item.mana = 45; + Item.useAnimation = Item.useTime = 37; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Magic/ManaRose.cs b/Items/Weapons/Magic/ManaRose.cs index 79a5e5bdbf..09233ac96a 100644 --- a/Items/Weapons/Magic/ManaRose.cs +++ b/Items/Weapons/Magic/ManaRose.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 38; Item.damage = 20; Item.DamageType = DamageClass.Magic; - Item.mana = 8; - Item.useTime = 38; - Item.useAnimation = 38; + Item.mana = 15; + Item.useAnimation = Item.useTime = 38; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.25f; diff --git a/Items/Weapons/Magic/Miasma.cs b/Items/Weapons/Magic/Miasma.cs index e2d1fb0d40..9adc8327e4 100644 --- a/Items/Weapons/Magic/Miasma.cs +++ b/Items/Weapons/Magic/Miasma.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 64; Item.damage = 40; Item.DamageType = DamageClass.Magic; - Item.mana = 16; + Item.mana = 22; Item.useAnimation = Item.useTime = 27; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index 426c3841ea..f9fd80822b 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -20,11 +20,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 48; Item.height = 48; - Item.damage = 54; + Item.damage = 59; Item.DamageType = DamageClass.Magic; - Item.mana = 5; - Item.useTime = 6; - Item.useAnimation = 6; + Item.mana = 7; + Item.useAnimation = Item.useTime = 6; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Magic/NebulousCataclysm.cs b/Items/Weapons/Magic/NebulousCataclysm.cs index 00b99ac405..b83032ebf9 100644 --- a/Items/Weapons/Magic/NebulousCataclysm.cs +++ b/Items/Weapons/Magic/NebulousCataclysm.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 124; Item.damage = 530; Item.DamageType = DamageClass.Magic; - Item.mana = 70; + Item.mana = 120; Item.useTime = Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = null; diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 7cdb460325..89b098e73e 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -20,9 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 54; Item.damage = 20; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 20; - Item.useAnimation = 20; + Item.mana = 15; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.25f; diff --git a/Items/Weapons/Magic/NuclearFury.cs b/Items/Weapons/Magic/NuclearFury.cs index 8dddf82b8d..53f67402a2 100644 --- a/Items/Weapons/Magic/NuclearFury.cs +++ b/Items/Weapons/Magic/NuclearFury.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 40; Item.damage = 108; Item.DamageType = DamageClass.Magic; - Item.mana = 22; - Item.useTime = 25; - Item.useAnimation = 25; + Item.mana = 30; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/Nucleosynthesis.cs b/Items/Weapons/Magic/Nucleosynthesis.cs index 76e953984c..9e1bfad48f 100644 --- a/Items/Weapons/Magic/Nucleosynthesis.cs +++ b/Items/Weapons/Magic/Nucleosynthesis.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 116; Item.damage = 70; Item.DamageType = DamageClass.Magic; - Item.mana = 18; + Item.mana = 30; Item.useTime = 4; Item.useAnimation = 16; Item.reuseDelay = 14; diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index 551aecb37b..d84b25394f 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 54; Item.damage = 80; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 15; Item.useAnimation = Item.useTime = 4; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index ecae376a81..5a87c385ae 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = Item.height = 52; Item.damage = 12; Item.knockBack = 3f; - Item.mana = 10; + Item.mana = 12; Item.useAnimation = Item.useTime = 35; Item.autoReuse = true; Item.DamageType = DamageClass.Magic; diff --git a/Items/Weapons/Magic/PhantasmalFury.cs b/Items/Weapons/Magic/PhantasmalFury.cs index 3c3c0b7f3f..bb4bbb35b7 100644 --- a/Items/Weapons/Magic/PhantasmalFury.cs +++ b/Items/Weapons/Magic/PhantasmalFury.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 60; Item.damage = 190; Item.DamageType = DamageClass.Magic; - Item.mana = 80; + Item.mana = 120; Item.useTime = 3; Item.useAnimation = 45; Item.reuseDelay = 75; diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 1d915a0feb..2bfd0561cf 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 140; Item.damage = 140; Item.DamageType = DamageClass.Magic; - Item.mana = 35; + Item.mana = 40; Item.useTime = 15; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/Poseidon.cs b/Items/Weapons/Magic/Poseidon.cs index c1bb33dcf2..d6192eacb9 100644 --- a/Items/Weapons/Magic/Poseidon.cs +++ b/Items/Weapons/Magic/Poseidon.cs @@ -13,9 +13,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 32; Item.damage = 52; Item.DamageType = DamageClass.Magic; - Item.mana = 12; - Item.useTime = 49; - Item.useAnimation = 49; + Item.mana = 30; + Item.useAnimation = Item.useTime = 49; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6f; diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 016e0e5e2a..883e202d33 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -17,18 +17,17 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public static float BuffDamageReductionBoost = 0.08f; - public static float BuffDamageBoost = 0.18f; + public static float BuffDamageBoost = 0.15f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDamageReductionBoost.ToPercent(), BuffDamageBoost.ToPercent()); public override void SetDefaults() { Item.width = 40; Item.height = 56; - Item.damage = 4350; + Item.damage = 3825; Item.DamageType = DamageClass.Magic; - Item.mana = 95; - Item.useTime = 78; - Item.useAnimation = 78; + Item.mana = 104; + Item.useTime = Item.useAnimation = 72; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 14; 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/PurgeGuzzler.cs b/Items/Weapons/Magic/PurgeGuzzler.cs index e75ae3fdfe..6745b62828 100644 --- a/Items/Weapons/Magic/PurgeGuzzler.cs +++ b/Items/Weapons/Magic/PurgeGuzzler.cs @@ -19,9 +19,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 48; Item.damage = 152; Item.DamageType = DamageClass.Magic; - Item.mana = 50; - Item.useTime = 38; - Item.useAnimation = 38; + Item.mana = 14; + Item.useAnimation = Item.useTime = 38; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; @@ -34,6 +33,14 @@ namespace CalamityMod.Items.Weapons.Magic Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); } + + // Cancels out the mana used to summon the holdout + public override void OnConsumeMana(Player player, int manaConsumed) + { + if (player.ownedProjectileCounts[Item.shoot] <= 0) + player.statMana += manaConsumed; + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 49abe53755..bb50e67103 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 170; Item.DamageType = DamageClass.Magic; - Item.mana = 25; + Item.mana = 60; Item.crit += 4; Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 96af4794a6..171a1c539b 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 54; Item.damage = 60; Item.crit = 20; - Item.mana = 17; + Item.mana = 22; Item.noMelee = true; - Item.useAnimation = 22; + Item.useAnimation = Item.useTime = 22; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 22; Item.knockBack = 8.5f; Item.UseSound = SoundID.Item8; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index f7fa8e662f..3c886885ef 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 52; Item.damage = 117; Item.DamageType = DamageClass.Magic; - Item.mana = 15; + Item.mana = 30; Item.useAnimation = Item.useTime = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/SandstreamScepter.cs b/Items/Weapons/Magic/SandstreamScepter.cs index f4cb2ed872..fcd7ce5a95 100644 --- a/Items/Weapons/Magic/SandstreamScepter.cs +++ b/Items/Weapons/Magic/SandstreamScepter.cs @@ -22,9 +22,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 56; Item.damage = 16; Item.DamageType = DamageClass.Magic; - Item.mana = 4; - Item.useTime = 20; - Item.useAnimation = 20; + Item.mana = 7; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Magic/SanguineFlare.cs b/Items/Weapons/Magic/SanguineFlare.cs index 90da4ae001..b2cb6a3820 100644 --- a/Items/Weapons/Magic/SanguineFlare.cs +++ b/Items/Weapons/Magic/SanguineFlare.cs @@ -24,8 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 1050; Item.DamageType = DamageClass.Magic; Item.mana = 36; - Item.useTime = 25; - Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.channel = true; Item.noMelee = true; diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index 45cd4e9c0e..7ed607b5d1 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -20,9 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 32; Item.damage = 40; Item.DamageType = DamageClass.Magic; - Item.mana = 20; - Item.useTime = 60; - Item.useAnimation = 60; + Item.mana = 30; + Item.useAnimation = Item.useTime = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6.75f; diff --git a/Items/Weapons/Magic/Serpentine.cs b/Items/Weapons/Magic/Serpentine.cs index 2a9e1ff387..24722773df 100644 --- a/Items/Weapons/Magic/Serpentine.cs +++ b/Items/Weapons/Magic/Serpentine.cs @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 10; Item.ArmorPenetration = ArmorPenetration; Item.DamageType = DamageClass.Magic; - Item.mana = 20; - Item.useTime = 35; - Item.useAnimation = 35; + Item.mana = 22; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/ShadecrystalBarrage.cs b/Items/Weapons/Magic/ShadecrystalBarrage.cs index 1858eb3dc1..007414071b 100644 --- a/Items/Weapons/Magic/ShadecrystalBarrage.cs +++ b/Items/Weapons/Magic/ShadecrystalBarrage.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 24; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 40; Item.useTime = 7; Item.useAnimation = 14; Item.reuseDelay = 49; diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index 8fc506cf8e..883a3f8033 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = Item.height = 42; Item.damage = 19; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 14; Item.useAnimation = Item.useTime = 34; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index f5639d3e79..d5699749e6 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 56; Item.damage = 285; Item.DamageType = DamageClass.Magic; - Item.mana = 15; + Item.mana = 72; Item.useTime = 8; Item.useAnimation = 24; Item.reuseDelay = 30; diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index cc5d6061da..05e3a9466b 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -20,11 +20,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 52; Item.height = 74; - Item.damage = 8; + Item.damage = 11; Item.DamageType = DamageClass.Magic; - Item.mana = 8; - Item.useTime = 25; - Item.useAnimation = 25; + Item.mana = 9; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Magic/SlitheringEels.cs b/Items/Weapons/Magic/SlitheringEels.cs index 64ddf0ec5d..ac30f155d5 100644 --- a/Items/Weapons/Magic/SlitheringEels.cs +++ b/Items/Weapons/Magic/SlitheringEels.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 40; Item.damage = 50; Item.DamageType = DamageClass.Magic; - Item.mana = 11; + Item.mana = 20; Item.useAnimation = Item.useTime = 40; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/SnowstormStaff.cs b/Items/Weapons/Magic/SnowstormStaff.cs index 674b3ffb97..62f3485b23 100644 --- a/Items/Weapons/Magic/SnowstormStaff.cs +++ b/Items/Weapons/Magic/SnowstormStaff.cs @@ -15,9 +15,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 39; Item.DamageType = DamageClass.Magic; Item.channel = true; - Item.mana = 18; - Item.useTime = 70; - Item.useAnimation = 70; + Item.mana = 40; + Item.useAnimation = Item.useTime = 70; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 5; diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 52b15901ca..93525a8476 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 64; Item.damage = 235; Item.DamageType = DamageClass.Magic; - Item.mana = 19; + Item.mana = 30; Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 0f21e8bc20..d01f95d050 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -51,13 +51,13 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.useAnimation = Item.useTime = 20; Item.shootSpeed = 7f; - Item.mana = 22; + Item.mana = 28; Item.knockBack = 5f; 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/TheCauldron.cs b/Items/Weapons/Magic/TheCauldron.cs index 065b00b449..7ba64395a2 100644 --- a/Items/Weapons/Magic/TheCauldron.cs +++ b/Items/Weapons/Magic/TheCauldron.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Swing; Item.useTime = Item.useAnimation = 60; Item.knockBack = 8f; - Item.mana = 18; + Item.mana = 30; Item.UseSound = SoundID.DD2_MonkStaffSwing; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; diff --git a/Items/Weapons/Magic/TheDanceofLight.cs b/Items/Weapons/Magic/TheDanceofLight.cs index 9f50835ece..620409269f 100644 --- a/Items/Weapons/Magic/TheDanceofLight.cs +++ b/Items/Weapons/Magic/TheDanceofLight.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 515; Item.DamageType = DamageClass.Magic; Item.crit = 20; - Item.mana = 6; + Item.mana = 26; Item.knockBack = 4f; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/ThePrince.cs b/Items/Weapons/Magic/ThePrince.cs index 7aec53e0f5..ce8e78ee62 100644 --- a/Items/Weapons/Magic/ThePrince.cs +++ b/Items/Weapons/Magic/ThePrince.cs @@ -22,12 +22,12 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 102; Item.height = 112; - Item.damage = 166; + Item.damage = 180; Item.knockBack = 4.25f; Item.shootSpeed = 23.5f; Item.DamageType = DamageClass.Magic; Item.noMelee = true; - Item.mana = 12; + Item.mana = 16; Item.useAnimation = Item.useTime = 21; Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index 4a02a8674c..66469c5d15 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 40; Item.height = 36; Item.damage = 14; // same as 1.4 Wand of Sparking - Item.mana = 150; + Item.mana = 200; Item.DamageType = DamageClass.Magic; Item.noMelee = true; Item.useAnimation = 19; diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index d948d7f944..0b35898e83 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 68; Item.damage = 120; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 23; - Item.useAnimation = 23; + Item.mana = 27; + Item.useAnimation = Item.useTime = 23; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Magic/Tradewinds.cs b/Items/Weapons/Magic/Tradewinds.cs index 7a665800ad..1b3f482bb5 100644 --- a/Items/Weapons/Magic/Tradewinds.cs +++ b/Items/Weapons/Magic/Tradewinds.cs @@ -14,9 +14,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 30; Item.damage = 23; Item.DamageType = DamageClass.Magic; - Item.mana = 5; - Item.useTime = 15; - Item.useAnimation = 15; + Item.mana = 6; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5; diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 3dfcc3b6cd..10aff81ac9 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.Magic public class ValkyrieRay : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - // The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames. + // The base use time of the weapon is 36: 24 charge frames + 12 cooldown frames. // The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges. // This math is handled in its holdout projectile, ValkyrieRayStaff. - public const int ChargeFrames = 18; - public const int CooldownFrames = 10; + public const int ChargeFrames = 24; + public const int CooldownFrames = 12; public const float GemDistance = 18f; public static readonly Color LightColor = new Color(235, 40, 121); @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 54; Item.height = 52; - Item.damage = 115; + Item.damage = 90; Item.knockBack = 8.5f; Item.DamageType = DamageClass.Magic; Item.crit = 11; diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 72df4ffb67..05bffd9f68 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 44; Item.damage = 6666; Item.DamageType = DamageClass.Magic; - Item.mana = 41; + Item.mana = 120; Item.useAnimation = Item.useTime = 43; Item.noUseGraphic = true; Item.channel = true; @@ -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/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index ea4d77de37..0c75f97dde 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -23,9 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 68; Item.damage = 2800; Item.DamageType = DamageClass.Magic; - Item.mana = 40; - Item.useTime = 65; - Item.useAnimation = 65; + Item.mana = 90; + Item.useAnimation = Item.useTime = 65; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 9f; diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index c5095b7d93..6b9d38be46 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 62; Item.height = 62; Item.damage = 50; - Item.mana = 7; + Item.mana = 8; Item.DamageType = DamageClass.Magic; Item.useAnimation = Item.useTime = 15; Item.noMelee = true; diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index a384441b9a..00845c8521 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 62; Item.damage = 2626; //Some kind of... brainstorm Item.DamageType = DamageClass.Magic; - Item.mana = 45; + Item.mana = 60; Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index b4ea614361..f1d67cd0e7 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 140; Item.height = 140; - Item.damage = 133; + Item.damage = 162; Item.DamageType = DamageClass.Magic; - Item.mana = 42; + Item.mana = 54; Item.useTime = 4; Item.useAnimation = 20; Item.reuseDelay = Item.useAnimation; @@ -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/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 8c0e9cfa2a..e929c61010 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 130; Item.damage = 210; Item.DamageType = DamageClass.Magic; - Item.mana = 60; + Item.mana = 70; Item.useAnimation = Item.useTime = 49; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/VoltaicClimax.cs b/Items/Weapons/Magic/VoltaicClimax.cs index 2f20bd1f80..055cd4f965 100644 --- a/Items/Weapons/Magic/VoltaicClimax.cs +++ b/Items/Weapons/Magic/VoltaicClimax.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 78; Item.damage = 215; Item.DamageType = DamageClass.Magic; - Item.mana = 32; + Item.mana = 45; Item.useTime = Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Magic/Volterion.cs b/Items/Weapons/Magic/Volterion.cs index 8ce8aee871..e212d83ebb 100644 --- a/Items/Weapons/Magic/Volterion.cs +++ b/Items/Weapons/Magic/Volterion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 60; Item.damage = 890; Item.DamageType = DamageClass.Magic; - Item.mana = 50; + Item.mana = 90; Item.useAnimation = Item.useTime = 80; // 42 frames of firing animation Item.knockBack = 2f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/Wingman.cs b/Items/Weapons/Magic/Wingman.cs index b083e19c88..e5e24a1386 100644 --- a/Items/Weapons/Magic/Wingman.cs +++ b/Items/Weapons/Magic/Wingman.cs @@ -16,9 +16,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 42; Item.damage = 82; Item.DamageType = DamageClass.Magic; - Item.mana = 5; - Item.useTime = 15; - Item.useAnimation = 15; + Item.mana = 8; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/WulfrumProsthesis.cs b/Items/Weapons/Magic/WulfrumProsthesis.cs index 1028f4af5a..adbbc94821 100644 --- a/Items/Weapons/Magic/WulfrumProsthesis.cs +++ b/Items/Weapons/Magic/WulfrumProsthesis.cs @@ -32,9 +32,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 42; Item.damage = 18; Item.DamageType = DamageClass.Magic; - Item.mana = 5; - Item.useTime = 24; - Item.useAnimation = 24; + Item.mana = 10; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3; diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 67b618de61..a60e099d50 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -22,9 +22,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 74; Item.damage = 65; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 23; - Item.useAnimation = 23; + Item.mana = 14; + Item.useAnimation = Item.useTime = 23; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.75f; diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index d2173baeb2..b49a1b5680 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 16; Item.damage = 65; Item.DamageType = DamageClass.Magic; - Item.mana = 10; + Item.mana = 15; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); 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/CrescentMoon.cs b/Items/Weapons/Melee/CrescentMoon.cs index de1086891f..f09743e25f 100644 --- a/Items/Weapons/Melee/CrescentMoon.cs +++ b/Items/Weapons/Melee/CrescentMoon.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(ItemID.BlueMoon). AddIngredient(8). AddIngredient(3). AddIngredient(16). diff --git a/Items/Weapons/Melee/EntropicClaymore.cs b/Items/Weapons/Melee/EntropicClaymore.cs index 8316a87785..d1978f29e1 100644 --- a/Items/Weapons/Melee/EntropicClaymore.cs +++ b/Items/Weapons/Melee/EntropicClaymore.cs @@ -90,8 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee Particle spark3 = new AltSparkParticle(partPos, partVel, false, 24, partScale, Color.Black); GeneralParticleHandler.SpawnParticle(spark3); Particle spark2 = new SparkParticle(partPos, partVel, false, 24, partScale * 0.6f, Color.LightGreen); - GeneralParticleHandler.SpawnParticle(spark2); - spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(spark2, false, GeneralDrawLayer.AfterEverything); } Vector2 dustVel2 = new Vector2(5 * swordDirection, -5).RotatedBy(swingRotation - 1.7f * swordDirection); 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/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index fab3876b27..c22652b727 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 2407; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( + Item.damage = 3777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 77; Item.useTime = 77; @@ -56,14 +56,6 @@ namespace CalamityMod.Items.Weapons.Melee { list.FindAndReplace("[GFB]", Lang.SupportGlyphs(this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"))); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(3). - AddTile(TileID.MythrilAnvil). - Register(); - } public override void OnSpawn(IEntitySource source) { time = 0; @@ -95,11 +87,21 @@ namespace CalamityMod.Items.Weapons.Melee int particleNumber = (int)Math.Max(15 * power, 2); for (int i = -particleNumber; i <= particleNumber; i++) { - Particle sparks = new AltSparkParticle(place, (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, false, Main.rand.Next(17, 30 + 1), Main.rand.NextFloat(0.2f, 0.8f), Main.rand.NextBool() ? Color.Lerp(Color.Blue, Color.DodgerBlue, 0.3f) : Color.Gold); - GeneralParticleHandler.SpawnParticle(sparks); - Dust dust = Dust.NewDustPerfect(place, ModContent.DustType(), (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, 0, default, Main.rand.NextFloat(0.85f, 1.2f) * power); + if (i % 2 == 0) + { + Vector2 vel = (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power; + Dust dust2 = Dust.NewDustPerfect(place + vel * 13, ModContent.DustType(), + vel, 0, default, Main.rand.NextFloat(1.3f, 1.2f)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + } + + Dust dust = Dust.NewDustPerfect(place, ModContent.DustType(), (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, 0, default, Main.rand.NextFloat(0.85f, 1.2f) * power); dust.noGravity = true; dust.color = Main.rand.NextBool() ? Color.Blue : Color.DodgerBlue; + dust.customData = 7; } SoundStyle sound = new("CalamityMod/Sounds/NPCHit/ExoHit3"); @@ -130,10 +132,11 @@ namespace CalamityMod.Items.Weapons.Melee maxFallSpeed = 75; oldVel = Item.velocity; } - public override void OnCreated(ItemCreationContext context) + public override bool OnPickup(Player player) { if (Main.zenithWorld) SoundEngine.PlaySound(GrandDadEasterEggSound, Main.LocalPlayer.MountedCenter); + return true; } } } diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index 53d2f6cc00..27700e8c12 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 26; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 115; + Item.damage = 222; Item.knockBack = 7f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/Lightspeed.cs b/Items/Weapons/Melee/Lightspeed.cs index 4c0551e7cb..28e525dd29 100644 --- a/Items/Weapons/Melee/Lightspeed.cs +++ b/Items/Weapons/Melee/Lightspeed.cs @@ -1,7 +1,10 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 74; Item.height = 94; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 220; + Item.damage = 200; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 20; Item.shootSpeed = 10f; @@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee } // You can only use the right-click if you have sufficient Elemental Mastery - public override bool AltFunctionUse(Player player) => player.Calamity().elementalMastery >= 100; + public override bool AltFunctionUse(Player player) => player.GetModPlayer().elementalMastery >= MaxEnergy; public override void HoldItem(Player player) { if (player.Calamity().cooldowns.TryGetValue(ElementalMastery.ID, out var cooldown)) { - cooldown.timeLeft = player.Calamity().elementalMastery; + cooldown.timeLeft = player.GetModPlayer().elementalMastery; } else { @@ -62,4 +65,125 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } + + public class LightspeedPlayer : ModPlayer + { + public int elementalMastery = 0; + public int elementalMasteryPrevious = 0; + public int elementalMasteryTimer = 0; + public bool elementalMasteryPaused = false; + public bool elementalMasteryMaxFXPlayed = false; + private int lucreciaParticleTimer = 0; + + public override void PostUpdateMiscEffects() + { + if (Player.HeldItem.type == ModContent.ItemType() && elementalMastery > 0) + { + lucreciaParticleTimer--; + + // If the timer is at or below zero, spawn a particle. + if (lucreciaParticleTimer <= 0) + { + // Reset the timer (spawn rate depends on energy) + lucreciaParticleTimer = (int)(20 - 15 * (elementalMastery / 60)); + + float radius = Main.rand.NextFloat(160f, 190f); // Distance from center + float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius + + Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; + + // Scale opacity with energy + float opacity = elementalMastery / (float)Lightspeed.MaxEnergy; + Color color = Main.rand.NextBool() ? Color.Aqua : Color.OrangeRed; + color *= opacity * 0.5f; + + if (elementalMastery >= 100) + { + color *= 2.4f; // Way brighter + } + + Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path + float rotationSpeed = 0.04f; + + var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); + GeneralParticleHandler.SpawnParticle(particle); + } + } + + + if (Player.HeldItem.type == ModContent.ItemType()) + { + if (elementalMastery == 0) + elementalMasteryPrevious = 0; + + if (elementalMastery > 0) + { + if (elementalMastery > elementalMasteryPrevious) + { + elementalMasteryPaused = true; + elementalMasteryTimer = 0; + } + + elementalMasteryTimer++; + + // Pause for 180 ticks + if (elementalMasteryPaused) + { + if (elementalMasteryTimer >= 1 && elementalMastery == Lightspeed.MaxEnergy && !elementalMasteryMaxFXPlayed) + { + SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); + SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); + + for (int i = 0; i < 10; i++) // Circular ring of particles burst from player + { + float angle = MathHelper.TwoPi * (i / 10f); + Vector2 spawnDirection = angle.ToRotationVector2(); + Vector2 velocity = spawnDirection * 14f; + + CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + elementalMasteryMaxFXPlayed = true; + } + + // If the pause is Done, resume decrementing. + if (elementalMasteryTimer >= 180) + { + elementalMasteryTimer = 0; + elementalMastery--; + } + } + else // Decrementing + { + // Once every 30 ticks + if (elementalMasteryTimer >= 30) + { + elementalMastery--; + elementalMasteryTimer = 0; + } + } + + if (elementalMastery != Lightspeed.MaxEnergy) + elementalMasteryMaxFXPlayed = false; + } + + // Update for next loop. + elementalMasteryPrevious = elementalMastery; + + } + else + { + // Reset all EM variables when not holding the weapon + elementalMasteryTimer = 0; + elementalMasteryPaused = false; + elementalMastery = 0; + } + } + + public override void UpdateDead() + { + elementalMastery = 0; + elementalMasteryPrevious = 0; + } + } } diff --git a/Items/Weapons/Melee/Lucrecia.cs b/Items/Weapons/Melee/Lucrecia.cs index 6fd7a2d0d9..e2160af239 100644 --- a/Items/Weapons/Melee/Lucrecia.cs +++ b/Items/Weapons/Melee/Lucrecia.cs @@ -1,8 +1,11 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 54; Item.height = 54; Item.useStyle = ItemUseStyleID.Shoot; - Item.damage = 150; + Item.damage = 132; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 34; Item.shootSpeed = 10f; @@ -37,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Melee } - public override bool AltFunctionUse(Player player) => player.Calamity().darklightEnergy >= MaxEnergy; + public override bool AltFunctionUse(Player player) => player.GetModPlayer().darklightEnergy >= MaxEnergy; public override void HoldItem(Player player) { if (player.Calamity().cooldowns.TryGetValue(DarklightEnergy.ID, out var cooldown)) { - cooldown.timeLeft = player.Calamity().darklightEnergy; + cooldown.timeLeft = player.GetModPlayer().darklightEnergy; } else { @@ -64,4 +67,129 @@ namespace CalamityMod.Items.Weapons.Melee Register(); } } + + public class LucreciaPlayer : ModPlayer + { + private int lucreciaParticleTimer = 0; + public int darklightEnergy = 0; + public int darklightEnergyPrevious = 0; + public int darklightEnergyTimer = 0; + public bool darklightEnergyPaused = false; + public bool darklightEnergyMaxFXPlayed = false; + + + public override void PostUpdateMiscEffects() + { + if (Player.HeldItem.type == ModContent.ItemType()) + { + if (darklightEnergy == 0) + darklightEnergyPrevious = 0; + + if (darklightEnergy > 0) + { + // If the player's energy has increased since last tick + if (darklightEnergy > darklightEnergyPrevious) + { + darklightEnergyPaused = true; + darklightEnergyTimer = 0; + } + + darklightEnergyTimer++; + + // Pause for 180 ticks + if (darklightEnergyPaused) + { + if (darklightEnergyTimer >= 1 && darklightEnergy == Lucrecia.MaxEnergy && !darklightEnergyMaxFXPlayed) + { + SoundStyle maxEnergyReached = new("CalamityMod/Sounds/Custom/AbilitySounds/DarklightEnergyCharged"); + SoundEngine.PlaySound(maxEnergyReached with { Volume = 0.9f }, Player.Center); + + for (int i = 0; i < 10; i++) // Circular ring of particles burst from player + { + float angle = MathHelper.TwoPi * (i / 10f); + Vector2 spawnDirection = angle.ToRotationVector2(); + Vector2 velocity = spawnDirection * 14f; + + CritSpark spark = new CritSpark(Player.Center + spawnDirection * 3f, velocity, Color.Lerp(Color.CornflowerBlue, Color.MediumPurple, Main.rand.NextFloat(1f)), Color.White * 0.33f, 1.2f, 12, 0.3f, 1.2f); + GeneralParticleHandler.SpawnParticle(spark); + } + darklightEnergyMaxFXPlayed = true; + } + + // If the pause is Done, resume decrementing. + if (darklightEnergyTimer >= 180) + { + darklightEnergyPaused = false; + darklightEnergyTimer = 0; + darklightEnergy--; + } + } + else // Decrementing + { + darklightEnergyMaxFXPlayed = false; + // Once every 20 ticks + if (darklightEnergyTimer >= 20) + { + darklightEnergy--; + darklightEnergyTimer = 0; + } + } + } + + if (darklightEnergy != Lucrecia.MaxEnergy) + darklightEnergyMaxFXPlayed = false; + + // Update for next loop. + darklightEnergyPrevious = darklightEnergy; + + } + else + { + // Reset all energy variables when not holding the weapon + darklightEnergyTimer = 0; + darklightEnergyPaused = false; + darklightEnergy = 0; + } + + + if (Player.HeldItem.type == ModContent.ItemType() && darklightEnergy > 0) + { + lucreciaParticleTimer--; + + // If the timer is at or below zero, spawn a particle. + if (lucreciaParticleTimer <= 0) + { + // Reset the timer (spawn rate depends on energy) + lucreciaParticleTimer = (int)(20 - 15 * (darklightEnergy / 60)); + + float radius = Main.rand.NextFloat(160f, 190f); // Distance from center + float spawnAngle = Main.rand.NextFloat(MathHelper.TwoPi); // Random angle along the whole radius + + Vector2 spawnPosition = Player.Center + spawnAngle.ToRotationVector2() * radius; + + // Scale opacity with energy + float opacity = darklightEnergy / (float)Lucrecia.MaxEnergy; + Color color = Main.rand.NextBool() ? Color.MediumPurple : Color.CornflowerBlue; + color *= opacity * 0.5f; + + if (darklightEnergy >= 100) + { + color *= 2.4f; // Way brighter + } + + Vector2 dummyVelocity = Vector2.Zero; // We dont want the argument where this is used to have influence on the actual path + float rotationSpeed = 0.04f; + + var particle = new RoundedStarParticle(spawnPosition, dummyVelocity, color with { A = 0 }, Main.rand.NextFloat(0.05f, 0.065f), Main.rand.Next(30, 60), rotationSpeed, 1f, true, Player.Center, Player.whoAmI); + GeneralParticleHandler.SpawnParticle(particle); + } + } + } + + public override void UpdateDead() + { + darklightEnergy = 0; + darklightEnergyPrevious = 0; + } + } } diff --git a/Items/Weapons/Melee/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/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index 72d7cdd46c..aeb2820dcd 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee xDist *= speedMult; yDist *= speedMult; - int knifeAmt = Main.rand.Next(4, 7); + int knifeAmt = Main.rand.Next(3, 5); for (int i = 0; i < knifeAmt; i++) { float xVec = xDist; diff --git a/Items/Weapons/Melee/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/Melee/VoidEdge.cs b/Items/Weapons/Melee/VoidEdge.cs index 7ac33fbcb3..f7134929dd 100644 --- a/Items/Weapons/Melee/VoidEdge.cs +++ b/Items/Weapons/Melee/VoidEdge.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -104,5 +105,14 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center + new Vector2(0, 1300f), velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), soulDamage, 0f, player.whoAmI, 0f, ai1); Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center + new Vector2(0, 1300f), velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), soulDamage, 0f, player.whoAmI, 0f, ai1); } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(15). + AddIngredient(3). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index fdb7e08c9b..2866542d6e 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 39; Item.DamageType = DamageClass.Ranged; Item.scale = 0.85f; - Item.useTime = Item.useAnimation = 33; + Item.useTime = Item.useAnimation = 31; Item.reuseDelay = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/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..73dddcb0f8 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -14,11 +14,6 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public static int MaxLoadedArrows = 9; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - public override void SetDefaults() { Item.width = 130; @@ -31,7 +26,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; @@ -40,26 +35,15 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-50f, 0f); - public override bool AltFunctionUse(Player player) => true; - public override void HoldItem(Player player) { var calPlayer = player.Calamity(); if (Main.myPlayer == player.whoAmI) { - calPlayer.rightClickListener = true; calPlayer.mouseRotationListener = true; } - - if (calPlayer.mouseRight && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) - { - Item.noUseGraphic = false; - } - else - { - Item.noUseGraphic = true; - } + Item.noUseGraphic = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; @@ -71,17 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Vector2 shootVelocity = velocity; Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); - - // Single arrow firing. - if (player.Calamity().mouseRight) - { - Vector2 tipPosition = position + shootDirection * 110f; - Projectile.NewProjectile(source, tipPosition, shootVelocity, Item.shoot, damage, knockback, player.whoAmI); - } - - // Charge-up. Done via a holdout projectile. - else - Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType(), 0, 0f, player.whoAmI); return false; } } 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 4eb04468eb..c575c6c3e8 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -18,19 +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 void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } + 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; @@ -49,11 +46,9 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = player.altFunctionUse == 2 ? type : ModContent.ProjectileType(); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction position = position + (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.UnitX) * 65; @@ -64,19 +59,11 @@ namespace CalamityMod.Items.Weapons.Ranged for (int i = -1; i <= 1; i += 2) { Vector2 helixVel = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(i * sine)); - Projectile.NewProjectile(source, position, helixVel, shotType, damage, knockback, player.whoAmI, 0, 0, player.altFunctionUse != 2 ? 1 : 0); + Projectile.NewProjectile(source, position, helixVel, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, 1); } } - else if (player.altFunctionUse != 2) - { - Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), new Color(229, 49, 39)); - GeneralParticleHandler.SpawnParticle(spark2); - } - - // Reset altFunctionUse to zero to prevent blank frame appear between shots on Alt-fire - if (player.itemAnimation <= 1) - player.altFunctionUse = 0; - + Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), new Color(229, 49, 39)); + GeneralParticleHandler.SpawnParticle(spark2); return false; } diff --git a/Items/Weapons/Ranged/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/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 7657926ed4..d9768ef6a9 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -11,11 +11,6 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - public override void SetDefaults() { Item.width = 56; @@ -41,22 +36,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = (player.altFunctionUse == 2 ? type : ModContent.ProjectileType()); int bulletAmt = 3; Vector2 newPosition = position + velocity.SafeNormalize(Vector2.UnitY) * 50f; for (int index = 0; index < bulletAmt; index++) { - Projectile.NewProjectile(source, newPosition, (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedByRandom(0.2f), shotType, damage, knockback, player.whoAmI); + Projectile.NewProjectile(source, newPosition, (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedByRandom(0.2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); } - - // Reset altFunctionUse to zero to prevent blank frame appear between shots on Alt-fire - if (player.itemAnimation <= 1) - player.altFunctionUse = 0; - return false; } diff --git a/Items/Weapons/Ranged/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 d10a646a8a..4a698709e7 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -18,18 +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 SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } 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; @@ -51,11 +49,9 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - public override bool AltFunctionUse(Player player) => true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int shotType = (player.altFunctionUse == 2 ? type : ModContent.ProjectileType()); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction position = position + (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.UnitX) * 65; @@ -67,15 +63,12 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); - Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); - } - else if (player.altFunctionUse != 2) - { - Particle spark2 = new LineParticle(position + Main.rand.NextVector2Circular(6, 6), (velocity * 4).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.8f, 1.2f), false, Main.rand.Next(15, 25 + 1), Main.rand.NextFloat(1.5f, 2f), Main.rand.NextBool() ? Color.MediumOrchid : Color.DarkViolet); - GeneralParticleHandler.SpawnParticle(spark2); + Projectile.NewProjectile(source, position, 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); return false; } diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index e6f4359eeb..11f3c56554 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -59,6 +60,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(7). + AddIngredient(12). + AddTile(TileID.MythrilAnvil). + Register(); + } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request(Texture + "_Glow").Value); } diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index fc33f30846..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/TheSevensStriker.cs b/Items/Weapons/Ranged/TheSevensStriker.cs index fc2338f5fe..97516ab4c9 100644 --- a/Items/Weapons/Ranged/TheSevensStriker.cs +++ b/Items/Weapons/Ranged/TheSevensStriker.cs @@ -25,13 +25,6 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle JackpotGFB = new("CalamityMod/Sounds/Item/SevensStrikerJackpotGFB"); public static readonly SoundStyle CoinSound = new("CalamityMod/Sounds/Item/SevensStrikerCoinShot") { MaxInstances = 0, PitchVariance = 0.5f }; - public static int ShotCoin = 0; // projectile ID to use for right click, affects damage multiplier - public static readonly float RightClickCopperMultiplier = 0.04f; - public static readonly float RightClickSilverMultiplier = 0.08f; - public static readonly float RightClickGoldMultiplier = 0.16f; - public static int RightClickAmmoSavedPercent = 80; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RightClickAmmoSavedPercent); - public static readonly float DoublesMultiplier = 1f; // Unfortunately doubles can't be doubles. Balancing! public static readonly float TriplesCherryMultiplier = 1f; public static readonly float TriplesCherrySplitMultiplier = 0.333f; @@ -39,11 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly float JackpotMultiplier = 0.5f; // Jackpot fires 49 shots total and thus needs to be reduced somehow... public static readonly float JackpotMultiplierGFB = 7f; // ...Unless you simply cannot stop winning - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - public override void SetDefaults() { Item.width = 170; @@ -57,114 +45,25 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.useTurn = true; Item.autoReuse = true; + Item.UseSound = null; + Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Shoot; Item.useAmmo = AmmoID.Coin; + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 24f; Item.shoot = ProjectileID.PlatinumCoin; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } - - public override bool AltFunctionUse(Player player) => true; - - public override bool? UseItem(Player player) - { - // Right click has a chance to save money - if (player.altFunctionUse == 2) - { - bool consumeCoin = Main.rand.Next(100) >= RightClickAmmoSavedPercent; - long coinCount = Utils.CoinsCount(out bool overflow, player.inventory); - int price; - - if (overflow || coinCount > 10000) - { - price = 10000; - ShotCoin = ProjectileID.GoldCoin; - } - else if (coinCount > 100) - { - price = 100; - ShotCoin = ProjectileID.SilverCoin; - } - else - { - price = 1; - ShotCoin = ProjectileID.CopperCoin; - } - - if (consumeCoin) - player.BuyItem(price); - } - - // Left click does nothing, it just spawns the holdout - else - Item.shoot = ModContent.ProjectileType(); - - return base.UseItem(player); - } - public override Vector2? HoldoutOffset() => new Vector2(-30, -11); - - // Left click spawns a holdout, so the item must not appear normally. - // Right click uses the item like a standard gun, so draw it normally. - public override void UseAnimation(Player player) - { - if (player.altFunctionUse == 2) - { - Item.UseSound = CoinSound; - Item.noUseGraphic = false; - } - else - { - Item.UseSound = null; - Item.noUseGraphic = true; - } - } - - // Right click fires coins extremely rapidly (3 use time) - public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.1f : 1f; - - // Right click consumes coins manually instead of using Terraria's ammo system - // (otherwise it could shoot Platinum Coins) - public override bool CanConsumeAmmo(Item ammo, Player player) => player.altFunctionUse == 2 ? false : true; - - public override bool CanUseItem(Player player) - { - if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) - return true; - - if (player.altFunctionUse == 2) - { - Utils.CoinsCount(out bool overflow, player.inventory); - return overflow; - } - return true; - } - + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Right click damage multiplier varies by coin type - if (player.altFunctionUse == 2) - { - Vector2 shootDirection = velocity.SafeNormalize(Vector2.UnitX * player.direction); - Vector2 gunTip = position + shootDirection * Item.scale * 90f; - gunTip.Y -= 20f; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - // spread copied from Onyxia, angular conic spread instead of Terraria's square spread - float randAngle = Main.rand.NextFloat(-0.05f, 0.05f); - float randVelMultiplier = Main.rand.NextFloat(0.92f, 1.08f); - Vector2 finalVelocity = velocity.RotatedBy(randAngle) * randVelMultiplier; - float damageMult = ShotCoin == ProjectileID.GoldCoin - ? RightClickGoldMultiplier : ShotCoin == ProjectileID.SilverCoin - ? RightClickSilverMultiplier : RightClickCopperMultiplier; - int finalDamage = (int)(damage * damageMult); - Projectile.NewProjectile(source, gunTip, finalVelocity, ShotCoin, finalDamage, knockback, player.whoAmI); - } - - // Left click just spawns the holdout - else - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, type, 0f); + // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } diff --git a/Items/Weapons/Ranged/ThreadOfEradication.cs b/Items/Weapons/Ranged/ThreadOfEradication.cs index 2e959a2428..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,18 +17,18 @@ 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 = 4375; + Item.damage = 1500; Item.DamageType = DamageClass.Ranged; - Item.useTime = 45; - Item.useAnimation = 45; + Item.useTime = Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; @@ -74,7 +75,9 @@ namespace CalamityMod.Items.Weapons.Ranged Main.LocalPlayer.SetScreenshake(2f); if (Main.myPlayer == player.whoAmI) { - Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG, storedKB, player.whoAmI, -1, 1); + int p = Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG, storedKB, player.whoAmI, -1, 1); + if (Main.projectile.IndexInRange(p)) + Main.projectile[p].DamageType = DamageClass.Ranged; } } } @@ -89,9 +92,10 @@ namespace CalamityMod.Items.Weapons.Ranged Main.LocalPlayer.SetScreenshake(5f); if (Main.myPlayer == player.whoAmI) { - int p = Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG*4, storedKB, player.whoAmI,-0.25f,1); + int p = Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 2016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType(), storedDMG*4, storedKB, player.whoAmI,-0.25f,1); if (Main.projectile.IndexInRange(p)) { + Main.projectile[p].DamageType = DamageClass.Ranged; Main.projectile[p].scale = 4; } } diff --git a/Items/Weapons/Ranged/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/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 073d54b200..3e6437c8e5 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -1,60 +1,837 @@ -using CalamityMod.Items.Materials; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.DataStructures; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs; +using CalamityMod.Particles; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Chat; +#region Item namespace CalamityMod.Items.Weapons.Rogue { public class EclipsesFall : RogueWeapon { + /// + /// Base damage of the spear, dynamically updated to match rogue stats. + /// This is reduced if the spear has less fragments than MaxFragmentCount + /// + public static int EclipseSpearBaseDmg => 1250; + /// + /// How much damage fragments and sparks should do + /// + public static float FragmentDmgMult => 0.33f; + /// + /// How many fragments are spawned per spear hit + /// + public static int FragmentCount => 2; + /// + /// How many fragments can exist before they start homing in. + /// Also the required amount of fragments for 100% base dmg on Eclipse Spear + /// + public static int MaxFragmentCount => 20; + public override void SetDefaults() { Item.width = 82; Item.height = 88; - Item.damage = 500; + Item.damage = 1000; Item.knockBack = 3.5f; Item.useAnimation = Item.useTime = 24; Item.autoReuse = true; Item.DamageType = RogueDamageClass.Instance; - Item.shootSpeed = 15f; - Item.shoot = ModContent.ProjectileType(); - + Item.shootSpeed = 32f; + Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - 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) { - if (player.Calamity().StealthStrikeAvailable()) - type = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request(Texture + "Glow").Value); public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(8). - AddIngredient(8). - AddIngredient(12). + AddIngredient(5). + AddIngredient(15). AddTile(). Register(); } } } +#endregion + +namespace CalamityMod.Projectiles.Rogue +{ + #region Main Javelin + public class EclipsesFall_Javelin : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; + private int SplitProjDamage => (int)(Projectile.damage * EclipsesFall.FragmentDmgMult); + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 50; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 2; + Projectile.penetrate = 1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; + Projectile.timeLeft = 150 * Projectile.MaxUpdates; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(5)) + { + Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); + float trailScale = Main.rand.NextFloat(0.8f, 1.2f); + Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; + Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); + GeneralParticleHandler.SpawnParticle(eclipseTrail); + } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + int onHitCount = EclipsesFall.FragmentCount + 4; + float spread = 20f; + int projectileDamage = SplitProjDamage; + float kb = 5f; + int sparkID = ModContent.ProjectileType(); + int starID = ModContent.ProjectileType(); + for (int i = 0; i < onHitCount; i++) + { + int projID = i < EclipsesFall.FragmentCount ? starID : sparkID; + Vector2 velocity = Projectile.oldVelocity.RotateRandom(MathHelper.ToRadians(spread)) * 0.5f; + float speed = Main.rand.NextFloat(1.5f, 2f); + float moveDuration = Main.rand.Next(5, 15); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * speed, projID, projectileDamage, kb, Projectile.owner, 0f, moveDuration, 20); + } + + SoundEngine.PlaySound(SoundID.Item62 with { Volume = SoundID.Item62.Volume * 0.6f }, Projectile.position); + SoundEngine.PlaySound(SoundID.Item68 with { Volume = SoundID.Item68.Volume * 0.2f }, Projectile.position); + SoundEngine.PlaySound(SoundID.Item122 with { Volume = SoundID.Item122.Volume * 0.4f }, Projectile.position); + + + List frags = new(); + var p = -2; + foreach (var item in Main.ActiveProjectiles) + { + + if (item.type == ModContent.ProjectileType() && item.owner == Projectile.owner && item.Opacity > 0.1f) + { + if (Projectile.Calamity().stealthStrike && item.timeLeft > 600 * item.MaxUpdates) + { + if (item.timeLeft < 1120 * item.MaxUpdates) + { + item.timeLeft = 60 * item.MaxUpdates; + item.ai[0] = target.whoAmI; + continue; + } + item.timeLeft = 1200 * item.MaxUpdates; + p = item.whoAmI; + } + item.ai[0] = target.whoAmI; + } + if (item.type == ModContent.ProjectileType() && item.owner == Projectile.owner && item.ai[0] > -2) + { + frags.Add(item); + } + } + if (Projectile.Calamity().stealthStrike && p < 0) + for (int i = 0; i < 1; i++) + { + int projID = ModContent.ProjectileType(); + Vector2 velocity = Vector2.Zero; + var proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.SafeNormalize(default) * 64f, projID, Projectile.damage, kb, Projectile.owner, target.whoAmI, 0, Math.Min(20, frags.Count(x => x.ai[0] == 0))); + proj.rotation = Projectile.rotation; + p = proj.whoAmI; + } + + + frags = frags.OrderBy(x => x.timeLeft).ToList(); + int toRemove = frags.Count(x => x.ai[0] == 0) - EclipsesFall.MaxFragmentCount; + foreach (var item in frags) + { + if (toRemove > 0 && item.ai[0] == 0) + { + item.ai[0] = -2; + item.timeLeft = EclipsesFall_LightFragment.lifetime; + toRemove--; + continue; + } + if (Projectile.Calamity().stealthStrike) + { + if (item.ai[0] == 0) + { + item.ai[1] = Main.rand.Next(5, 15); + item.ai[2] = 20; + } + item.ai[0] = p + 1; + item.timeLeft = EclipsesFall_LightFragment.lifetime; + item.damage = 0; + item.netUpdate = true; + } + } + + + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } + #endregion + + #region Stealth Projectiles + + [PierceResistException] + public class EclipsesFall_StealthSpear : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + bool initialized = false; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 0; + } + + (Vector2 start, Vector2 end) LinePos = (new(), new()); + float LineWidth = 0; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 48; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.MaxUpdates = 1; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 1; + Projectile.timeLeft = 1200 * Projectile.MaxUpdates; + Projectile.ContinuouslyUpdateDamageStats = true; + } + public override void AI() + { + if (!initialized) + { + Projectile.ai[0] = -1; + Projectile.localAI[0] = Projectile.ai[2]; + Projectile.ai[2] = 0; + initialized = true; + } + + Projectile.originalDamage = (int)(EclipsesFall.EclipseSpearBaseDmg * (Projectile.ai[2] / (float)EclipsesFall.MaxFragmentCount)); + if (Projectile.ai[0] >= 0 && Projectile.ai[2] >= Projectile.localAI[0] && Projectile.Opacity > 0) + { + LinePos.end = Projectile.position; + Projectile.velocity = Projectile.DirectionTo(Main.npc[(int)Projectile.ai[0]].Center) * 64; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center + Projectile.velocity; + Projectile.Damage(); + Projectile.ai[0] = -1; + LineWidth = 1f; + LinePos.start = Projectile.Center; + Projectile.localAI[1] = 0; + } + + + LineWidth -= 0.05f; + Projectile.localAI[1]++; + if (Projectile.localAI[1] > 60) + { + var dis = Projectile.Distance(Main.player[Projectile.owner].Center); + Projectile.velocity += Projectile.DirectionTo(Main.player[Projectile.owner].Center) * dis / 320f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + + } + Projectile.velocity *= 0.9f; + } + public override bool PreDraw(ref Color lightColor) + { + + if (LineWidth > 0) + { + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + + using (Main.spriteBatch.Scope()) + { + using (lease.Scope(clearColor: Color.Transparent)) + { + + List posList = []; + //For the prim to render properly I need to divide the distance between the positions into a couple points. Just using start and end doesn't render. + for (var i = 0; i <= 2; i++) + { + posList.Add(Vector2.Lerp(Projectile.position, LinePos.end, i / 2f)); + } + var pos = posList.ToArray(); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(pos, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), pos.Length); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(pos, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), pos.Length); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + } + } + var tex = TextureAssets.Item[ModContent.ItemType()]; + if (Projectile.Opacity > 0.5f) + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, 0); + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(default, BlendState.NonPremultiplied, null, null, null, null, Main.Transform); + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, Color.White * Projectile.Opacity * (Projectile.localAI[0] > 0 ? Projectile.ai[2] / Projectile.localAI[0] : 1), Projectile.rotation, TextureAssets.Projectile[Type].Size() * 0.5f, Projectile.scale, 0); + Main.spriteBatch.End(); + } + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float _ = 0; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.oldPosition + new Vector2(Projectile.width, Projectile.height) * 0.5f, Projectile.Center, 48f, ref _)) + { + return true; + } + + return base.Colliding(projHitbox, targetHitbox); + } + + public override bool? CanHitNPC(NPC target) + { + if (Projectile.ai[0] < 0) + return false; + return null; + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + //Half damage to any NPC that isn't the primary target + if (Projectile.ai[0] != target.whoAmI) + modifiers.SourceDamage *= 0.5f; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + + if (Projectile.timeLeft < 600 * Projectile.MaxUpdates && Projectile.ai[0] == target.whoAmI) + { + Projectile.Opacity = 0; + Projectile.Center = target.Center; + Projectile.timeLeft = 60 * Projectile.MaxUpdates; + Projectile.velocity = new(0, 1E-05f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner); + } + Projectile.netUpdate = true; + if (Projectile.ai[0] == target.whoAmI) + SoundEngine.PlaySound(SarosPossession.FiringSound with { Pitch = -1f, Volume = 0.75f, }, Projectile.Center); + } + + public override void OnKill(int timeLeft) + { + if (Projectile.Opacity > 0) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner); + return; + } + + public float FireWidthFunction(float completion, Vector2 vertexPos) + { + return 96 * LineWidth * MathHelper.Clamp((Projectile.ai[2] / 20f), 0.25f, 1f); + } + + public Color FireColorFunction(float completion, Vector2 vertexPos) + { + Color mainColor = Color.Lerp(new Color(238, 226, 153), new Color(255, 191, 73), (MathF.Sin(completion * MathHelper.TwoPi + Main.GlobalTimeWrappedHourly * 5) + 1) * 0.5f); + return mainColor * MathF.Pow(1 - completion * 1.1f, 0.5f); + } + + public float FireCoreWidthFunction(float completion, Vector2 vertexPos) + { + return 32 * LineWidth * MathHelper.Clamp((Projectile.ai[2] / 20f), 0.25f, 1f); + } + + public Color FireCoreColorFunction(float completion, Vector2 vertexPos) + { + return Color.Black * MathF.Pow(1 - completion * 1.1f, 0.5f); + } + } + public class EclipsesFall_StealthSpearExplosion : ModProjectile, IAdditiveDrawer, ILocalizedModType + { + //Based on Terratomere explosion + public new string LocalizationCategory => "Projectiles.Rogue"; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 520; + Projectile.friendly = true; + Projectile.ignoreWater = false; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.timeLeft = 150; + Projectile.MaxUpdates = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.scale = 0.2f; + Projectile.hide = true; + } + + public override void AI() + { + // Play an explosion sound on the first frame of this projectile's existence. + if (Projectile.localAI[0] == 0f) + { + SoundEngine.PlaySound(SubsumingVortex.ExplosionSound with { Volume = 0.6f }, Projectile.Center); + Projectile.localAI[0] = 1f; + } + + // Emit a strong white light. + Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 1.5f); + + // Determine frames. Once the maximum frame is reached the projectile dies. + Projectile.frameCounter++; + if (Projectile.frameCounter % 5 == 4) + Projectile.frame++; + if (Projectile.frame >= 17) + Projectile.Kill(); + + // Exponentially accelerate. + Projectile.scale *= 1.013f; + Projectile.Opacity = Utils.GetLerpValue(5f, 36f, Projectile.timeLeft, true); + } + + public override bool PreDraw(ref Color lightColor) + { + return base.PreDraw(ref lightColor); + } + + public void AdditiveDraw(SpriteBatch spriteBatch) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Texture2D lightTexture = ModContent.Request("CalamityMod/Skies/XerocLight").Value; + Rectangle frame = texture.Frame(3, 6, Projectile.frame / 6, Projectile.frame % 6); + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 origin = frame.Size() * 0.5f; + + for (int i = 0; i < 2; i++) + { + Vector2 lightDrawPosition = drawPosition + (MathHelper.TwoPi * i / 36f + Main.GlobalTimeWrappedHourly * 5f).ToRotationVector2() * Projectile.scale * 12f; + Color lightBurstColor = CalamityUtils.MulticolorLerp(Projectile.timeLeft / 144f, Terratomere.TerraColor1, Terratomere.TerraColor2); + lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * Projectile.Opacity * 0.24f; + Main.spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, Projectile.scale * 1.32f, SpriteEffects.None, 0); + } + if (Projectile.timeLeft < 149) + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(default, BlendState.NonPremultiplied, null, null, null, null, Main.Transform); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, 1.6f, 0); + Main.spriteBatch.End(); + } + } + } + #endregion + + #region Shatter Projectiles + public class EclipsesFall_LightFragment : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public static int lifetime => 1200; + Color? color = null; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 32; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() + { + Projectile.width = 40; + Projectile.height = 40; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 3; + Projectile.timeLeft = lifetime; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + Projectile.MaxUpdates = 2; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + Projectile.tileCollide = false; + } + + public override void AI() + { + Projectile.rotation += Projectile.direction * 0.02f; + if (Projectile.ai[0] < -1) + { + Projectile.penetrate = 1; + Projectile.damage = Projectile.originalDamage; + Projectile.stopsDealingDamageAfterPenetrateHits = false; + var target = Projectile.FindTargetWithinRange(4000); + if (target is not null) + { + Projectile.velocity += Projectile.DirectionTo(target.Center) * 2; + Projectile.velocity *= 0.95f; + } + } + + if (Projectile.ai[0] == 0f || Projectile.ai[2] > 0) + { + if (Projectile.timeLeft < (lifetime - Projectile.ai[1]) && Projectile.ai[2] >= 0) + { + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.Zero); + Projectile.velocity *= Projectile.ai[2]; + Projectile.ai[2]--; + } + } + else + { + if (Main.projectile.IndexInRange((int)Projectile.ai[0] - 1) && Main.projectile[(int)Projectile.ai[0] - 1].active) + { + var proj = Main.projectile[(int)Projectile.ai[0] - 1]; + if (Projectile.timeLeft > 100) + Projectile.timeLeft = 100; + Projectile.Center = Vector2.Lerp(Projectile.Center, proj.Center, (1 - (Projectile.timeLeft / 100f))); + Projectile.velocity = new(0, 1E-05f); + if (Projectile.Distance(proj.Center) < 16) + { + proj.ai[2]++; + proj.netUpdate = true; + if (proj.ai[2] == proj.localAI[0]) + SoundEngine.PlaySound(SarosPossession.SpawnSound with { Pitch = 1f, Volume = 1f, }, Projectile.Center); + Projectile.active = false; + + } + } + } + } + public override bool? CanHitNPC(NPC target) + { + if (Projectile.ai[0] < -1 && target.Calamity().IsArmored()) + return false; + return null; + } + + public override void OnKill(int timeLeft) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(Projectile.GetSource_Death(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + public override bool PreDraw(ref Color lightColor) + { + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(16).ToArray(); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), 32); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), 32); + } + float dis = Projectile.position.Distance(Projectile.oldPos.Last()) / 32; + if (dis > 1) + { + dis = 1f; + } + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White * dis, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + + using (Main.spriteBatch.Scope()) + { + Main.spriteBatch.Begin(default, BlendState.NonPremultiplied, null, null, null, null, Main.Transform); + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, TextureAssets.Projectile[Type].Size() * 0.5f, Projectile.scale, 0); + Main.spriteBatch.End(); + } + return false; + } + + // Matches Saros Possesion sunfire with slight edits + public float FireWidthFunction(float completion, Vector2 vertexPos) + { + float width; + float maxBodyWidth = 24f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 vertexPos) + { + Color mainColor = new Color(238, 226, 153); + return Color.Lerp(mainColor, Color.Transparent, completion); + } + + public float FireCoreWidthFunction(float completion, Vector2 vertexPos) + { + float width; + float maxBodyWidth = Projectile.scale * 16; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 vertexPos) + { + Color mainColor = new Color(255, 191, 73); + return mainColor; + } + } + public class EclipsesFall_LightExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + + public const int Lifetime = 35; // 7 animation frames, 12 FPS + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 102; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.timeLeft = Lifetime; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 5; + + if (Projectile.frameCounter > Lifetime) + Projectile.Kill(); + } + + public override void PostDraw(Color lightColor) + { + Texture2D glow = ModContent.Request(Texture + "Glow").Value; + Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } + public class EclipsesFall_LightSpark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public static int lifetime = 150; + Color? color = null; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 32; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 6; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 3; + Projectile.timeLeft = lifetime; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.localAI[0] = 20f; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; + } + + public override void AI() + { + Projectile.rotation += Projectile.direction * Projectile.ai[0]; + + if (Projectile.timeLeft < (lifetime - Projectile.ai[1]) && Projectile.localAI[0] >= 0) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Projectile.localAI[0]; + Projectile.localAI[0]--; + Projectile.timeLeft++; + } + + if (Projectile.localAI[0] == 0) + { + Projectile.velocity = new(0, 1E-05f); + Projectile.damage = 0; + float dis = Projectile.position.Distance(Projectile.oldPos.Take(16).Last()); + if (dis < 0.1f) + Projectile.Kill(); + } + } + + public override bool PreDraw(ref Color lightColor) + { + color ??= Color.Lerp(Color.OrangeRed, new Color(255, 191, 73), Main.rand.NextFloat(0.25f, 0.5f)); + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(16); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), 32); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), 32); + } + float dis = Projectile.position.Distance(Projectile.oldPos.Take(16).Last()) / 128f - 0.1f; + if (dis > 1) + { + dis = 1f; + } + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White * dis, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + + return false; + } + + public float FireWidthFunction(float completion, Vector2 vertexPos) + { + float width; + float maxBodyWidth = 24f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 vertexPos) + { + Color mainColor = new Color(255, 191, 73); + return Color.Lerp(mainColor, Color.Transparent, completion); + } + + public float FireCoreWidthFunction(float completion, Vector2 vertexPos) + { + float width; + float maxBodyWidth = Projectile.scale * 16; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 vertexPos) + { + Color mainColor = color.Value; + return mainColor; + } + } + #endregion +} 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/MoltenAmputator.cs b/Items/Weapons/Rogue/MoltenAmputator.cs index 5c21deb49e..7b108c5096 100644 --- a/Items/Weapons/Rogue/MoltenAmputator.cs +++ b/Items/Weapons/Rogue/MoltenAmputator.cs @@ -1,5 +1,4 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -7,6 +6,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue @@ -14,6 +14,8 @@ namespace CalamityMod.Items.Weapons.Rogue public class MoltenAmputator : RogueWeapon { public float speed = 16; + + public static int FlurryCount => 30; public override void SetDefaults() { Item.width = 92; @@ -36,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue player.Calamity().mouseWorldListener = true; if (player.Calamity().mouseRight) { - if (player.Calamity().StealthStrikeAvailable()) + if (player.Calamity().StealthStrikeAvailable() && player.Calamity().focusFlurryAttackCount < FlurryCount) { - player.Calamity().focusFlurryAttackCount = 30; + player.Calamity().focusFlurryAttackCount = FlurryCount; player.Calamity().ConsumeStealthByAttacking(); SoundStyle buff = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRay"); SoundEngine.PlaySound(buff with { Volume = 1f, Pitch = Main.rand.NextFloat(0.2f, 0.3f) }, player.Center); @@ -72,7 +74,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool fastToss = player.Calamity().focusFlurryAttackCount > 0; - + SoundStyle fire = new("CalamityMod/Sounds/Item/SpearofDestiny"); SoundEngine.PlaySound(fire with { Volume = 0.5f, Pitch = (player.Calamity().focusFlurryAttackCount > 0 ? -0.4f + (player.Calamity().focusFlurryAttackCount * 0.02f) : Main.rand.NextFloat(-0.4f, -0.65f)) }, position); // Since the positioning of the scythe is important, its velocity is based on your mouse position @@ -87,8 +89,10 @@ namespace CalamityMod.Items.Weapons.Rogue player.Calamity().focusFlurryAttackCount--; } player.Calamity().ConsumeStealthByAttacking(); - + return false; } + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlurryCount); } } diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 5814d9db9d..ae93270b57 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -11,19 +11,21 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ProfanedPartisan : RogueWeapon { + public static int SpearBaseDamage => 125; + public static int StarBaseDamage => 80; public override void SetDefaults() { Item.width = 68; Item.height = 68; - Item.damage = 222; + Item.damage = 300; Item.crit = 15; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 18; - Item.useAnimation = 18; + Item.useTime = 21; + Item.useAnimation = 21; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); 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/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index 17823595ac..5bd53ebda4 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Weapons.Rogue private bool BigSpear = false; public override void SetDefaults() { - Item.width = 52; - Item.height = 52; + Item.width = 100; + Item.height = 100; Item.damage = 70; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/SpearofDestiny.png b/Items/Weapons/Rogue/SpearofDestiny.png index 4e198d9042..0fb7e725de 100644 Binary files a/Items/Weapons/Rogue/SpearofDestiny.png and b/Items/Weapons/Rogue/SpearofDestiny.png differ diff --git a/Items/Weapons/Rogue/SpearofPaleolith.cs b/Items/Weapons/Rogue/SpearofPaleolith.cs index 519c1c8cb2..bad85a5962 100644 --- a/Items/Weapons/Rogue/SpearofPaleolith.cs +++ b/Items/Weapons/Rogue/SpearofPaleolith.cs @@ -9,11 +9,15 @@ namespace CalamityMod.Items.Weapons.Rogue { public class SpearofPaleolith : RogueWeapon { + public static int ShardBaseDamage => 40; + + public static int NormalShardCount => 3; + public static int ImpaledShardCount => 5; public override void SetDefaults() { Item.width = 54; Item.height = 54; - Item.damage = 65; + Item.damage = 90; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 27; @@ -25,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 35f; + Item.shootSpeed = 6f; Item.DamageType = RogueDamageClass.Instance; } diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index 0f67b61514..03fd321fe6 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -40,7 +40,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(); Item.channel = true; } 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/Rogue/UrchinStinger.cs b/Items/Weapons/Rogue/UrchinStinger.cs index 606271f7d4..01fe4cb223 100644 --- a/Items/Weapons/Rogue/UrchinStinger.cs +++ b/Items/Weapons/Rogue/UrchinStinger.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 10; - Item.height = 26; + Item.height = 32; Item.damage = 13; Item.DamageType = RogueDamageClass.Instance; Item.useAnimation = Item.useTime = 17; diff --git a/Items/Weapons/Rogue/UrchinStinger.png b/Items/Weapons/Rogue/UrchinStinger.png index a5c38c11b9..9b6087ce19 100644 Binary files a/Items/Weapons/Rogue/UrchinStinger.png and b/Items/Weapons/Rogue/UrchinStinger.png differ diff --git a/Items/Weapons/Summon/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/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 7eb8ef10a1..647b17cfac 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon @@ -14,6 +15,8 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; public float Knockback = 2f; + public static int DefenseBoostPerBuffStar = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoostPerBuffStar); public override void SetDefaults() { Item.width = 44; diff --git a/Items/Weapons/Summon/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/RustyBeaconPrototype.cs b/Items/Weapons/Summon/RustyBeaconPrototype.cs index b70e451dc8..992fcc965a 100644 --- a/Items/Weapons/Summon/RustyBeaconPrototype.cs +++ b/Items/Weapons/Summon/RustyBeaconPrototype.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 28; Item.height = 20; Item.mana = 10; - Item.damage = 8; + Item.damage = 7; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; 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 5fa54ffc7a..e71c91306d 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -1,22 +1,50 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.Items.Weapons.Melee; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; +using CalamityMod.Systems.Collections; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { + #region Item public class VoidConcentrationStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public static SummonTag summonTag = new SummonTag() + { + MultiplicativeTagDamage = 0.3f, //Percentage of damage dealt added by the void. This is doubled by summons. This was tested - 1.5x was too weak to be worth 4 slots. + AllowsWhipStacking = true, + TagOnHit = tagOnHit, + TagModifyHitEffects = SummonTag.BlankTagModifyHit, + AutoDrawTooltip = false + }; + public static void tagOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone) => npc.GetGlobalNPC().StoredDamage += (int)(damageDone); public override void SetStaticDefaults() { - ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.StaffMinionSlotsRequired[Type] = 4f; + summonTag.TagItem = Type; + CalamityBuffSets.SummonTagDebuff.Add(ModContent.BuffType(), summonTag); } public override void SetDefaults() @@ -28,34 +56,573 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.DD2_EtherianPortalOpen; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.damage = 105; + Item.damage = 200; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 24; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse != 2) - return player.ownedProjectileCounts[ModContent.ProjectileType()] == 0; - return base.CanUseItem(player); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse != 2) { - player.AddBuff(Item.buffType, 2); - var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - minion.originalDamage = Item.damage; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + item.Kill(); + } + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + } + else + { + player.MinionNPCTargetAim(true); + if (player.MinionAttackTargetNPC >= 0) + { + var target = Main.npc[player.MinionAttackTargetNPC]; + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType()) + item.Kill(); + } + Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, target.whoAmI); + } } return false; } - - // TODO -- should be strictly unnecessary as per API design - public override bool AltFunctionUse(Player player) => base.AltFunctionUse(player); + public override bool AltFunctionUse(Player player) => true; } + + #endregion +} + +namespace CalamityMod.Projectiles.Summon +{ + + #region Left Click + public class VoidConcentrationMinion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() + { + Projectile.width = 46; + Projectile.height = 80; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.minionSlots = 4f; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.minion = true; + Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + } + public override bool? CanHitNPC(NPC target) => false; + public override void AI() + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + + if (player.dead) + { + modPlayer.VoidConcentrationStaff = false; + } + if (modPlayer.VoidConcentrationStaff) + { + Projectile.timeLeft = 2; + } + + Projectile.Center = player.Center; + + //Spawn proj code taken from Ceaseless Void + int numPerRing = 7; + int numRings = 3; + int spacing = 360 / numPerRing; + int distance2 = 10; + if (Main.netMode != NetmodeID.MultiplayerClient && player.ownedProjectileCounts[ModContent.ProjectileType()] + player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + for (int i = 0; i < numPerRing; i++) + { + for (int j = 0; j < numRings; j++) + Projectile.NewProjectile(Projectile.GetSource_FromAI(), new Vector2((Projectile.Center.X + (MathF.Sin(i * spacing) * distance2)), (int)(Projectile.Center.Y + (MathF.Cos(i * spacing) * distance2))), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, i * spacing, j); + } + } + + } + } + public class VoidConcentrationDarkEnergy : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Summon"; + private double minDistance => 10; + private double distance { get; set; } = 10; + private double maxDistance => 400; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 8; + ProjectileID.Sets.MinionShot[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 32; + Projectile.height = 32; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 10; + Projectile.penetrate = -1; + Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = DamageClass.Summon; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + texture = TextureAssets.Npc[ModContent.NPCType()].Value; + var gt = DarkEnergy.GlowTexture.Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + var frame = texture.Frame(1, 8, 0, Projectile.frame); + Main.EntitySpriteDraw(texture, drawPos, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(gt, drawPos, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + return false; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] - player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + { + for (int k = 0; k < 20; k++) + { + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.PurpleCosmilite, 0, -1f, 0, default, 1f); + Main.dust[dust].noGravity = true; + } + Projectile.Kill(); + return; + } + else + { + Projectile.timeLeft++; + } + + + if (Projectile.FinalExtraUpdate()) + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + if (Projectile.frame == 1) + Projectile.frame++; + + #region Movement Code (Taken from Ceaseless Void) + + Projectile.velocity = Vector2.Zero; + double rateOfChangeIncrease = (maxDistance / 80) - 1D; + double rateOfChange = ((Projectile.ai[1] * 0.5f) + 3.2D) * (maxDistance / 960); + if (Projectile.ai[2] == 0f) + { + distance += rateOfChange; + if (distance >= maxDistance) + { + distance = maxDistance; + Projectile.ai[2] = 1f; + } + } + else + { + distance -= rateOfChange; + if (distance <= minDistance) + { + distance = minDistance; + Projectile.ai[2] = 0f; + } + } + + // Rotation velocity + float minRotationVelocity = 0.5f; + float rotationVelocityIncrease = 0.15f; + rotationVelocityIncrease += rotationVelocityIncrease * (Projectile.ai[1] * 0.5f); + + // Rotate around Ceaseless Void + double degrees = Projectile.ai[0]; + double radians = degrees * (Math.PI / 180); + Projectile.position.X = player.Center.X - (int)(Math.Cos(radians) * distance) - Projectile.width / 2; + Projectile.position.Y = player.Center.Y - (int)(Math.Sin(radians) * distance) - Projectile.height / 2; + Projectile.ai[0] += minRotationVelocity + rotationVelocityIncrease; + #endregion + } + } + + #endregion + + #region Right Click + public class VoidConcentrationMark : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.MinionShot[Type] = true; + } + public override void SetDefaults() + { + Projectile.width = 54; + Projectile.height = 50; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 600; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = DamageClass.Summon; + } + public override bool? CanHitNPC(NPC target) => false; + public override void AI() + { + if (!Main.npc[(int)Projectile.ai[0]].active) + { + Projectile.Kill(); + return; + } + Player owner = Main.player[Projectile.owner]; + + Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center; + Main.npc[(int)Projectile.ai[0]].AddBuff(ModContent.BuffType(), 5); + if (Projectile.timeLeft % 60 == 0) + { + var w = Main.npc[(int)Projectile.ai[0]].width + 200; + var v1 = Main.rand.NextVector2CircularEdge(1, 1); + for (var i = 0; i < 3; i++) + { + var v = v1.RotatedBy(MathHelper.TwoPi * (i / 3f)); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + 200 * v, v.RotatedBy(-MathHelper.PiOver2) * 10, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner,1); + } + } + } + + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame >= Main.projFrames[Type] - 1) + { + Projectile.frame = 0; + } + Projectile.frameCounter++; + + if (Projectile.timeLeft <= 60) + { + Projectile.alpha += 4; + } + } + } + public class VoidConcentrationBeam : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.MinionShot[Type] = true; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 24; + Projectile.height = 24; + Projectile.friendly = true; + Projectile.timeLeft = 600; + Projectile.DamageType = DamageClass.Summon; + Projectile.MaxUpdates = 3; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; + Projectile.penetrate = 1; + } + public override void AI() + { + if (Projectile.timeLeft == 600 && Projectile.ai[0] == 0) + { + GeneralParticleHandler.SpawnParticle(new CustomSprite(Projectile.Center, Vector2.Zero, 30, TextureAssets.Projectile[ModContent.ProjectileType()].Value, 1, Color.White, AddativeBlend: false, frameCount: 5)); + + } + NPC target = Projectile.Center.MinionHoming(5000f, Main.player[Projectile.owner]); + // Move towards the target. + if (target != null && Projectile.localNPCImmunity[target.whoAmI] <= 0) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, (target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * (Projectile.timeLeft < 300 ? 24f : 10f), 0.05f); + Projectile.netUpdate = true; + Projectile.Calamity().HomingTarget = target.whoAmI; + } + Projectile.rotation = Projectile.velocity.ToRotation(); + + if (Projectile.damage <= 0) + { + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.Zero) * 4; + Projectile.timeLeft = (int)MathHelper.Min(8, Projectile.timeLeft); + } + + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + for (int i = 0; i < 12; i++) + { + Vector2 dustVelocity = Main.rand.NextVector2Circular(1f, 1f) * 6f; + float dustScale = Main.rand.NextFloat(3f, 5f); + Color dustColor = Color.Lerp(Color.Yellow, Color.Gold, Main.rand.NextFloat(0.5f, 1f)); + + Dust dust = Dust.NewDustDirect(Projectile.Center, 1, 1, DustID.TintableDustLighted, dustVelocity.X, dustVelocity.Y, 0, dustColor, dustScale); + dust.noGravity = true; + dust.noLight = false; + dust.noLightEmittence = false; + } + } + + public override bool PreDraw(ref Color lightColor) + { + Main.spriteBatch.End(out var ss); + + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + + using (lease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + + Vector2[] fireCoreLength = Projectile.oldPos.Take(8).ToArray(); + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); + PrimitiveRenderer.RenderTrail(fireCoreLength, new(FireCoreWidthFunction, FireCoreColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), fireCoreLength.Length + 24); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + + return false; + } + + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = Color.DarkSlateBlue * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 16; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = Color.SkyBlue; + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } + } + + #endregion + + #region Summon Tag + public class VoidTagDmgType : DamageClass //Custom damage class used to prevent the voids from activating themselves + { + public static VoidTagDmgType getInstance => ModContent.GetInstance(); + public override bool UseStandardCritCalcs => false; + } + public class VoidTagNPC : GlobalNPC + { + public override bool InstancePerEntity => true; + + public int StoredDamage = 0; + int voidTimer = 0; + float rot = 0; + + public override void PostAI(NPC npc) + { + voidTimer++; + if (StoredDamage > 0) + { + if (voidTimer > 10) + { + voidTimer = 0; + var dmg = (int)Math.Max(1, (StoredDamage)); + StoredDamage -= dmg; + rot += 0.15f; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(npc.GetSource_OnHurt(null), npc.Center, Vector2.UnitX.RotatedBy(rot), ModContent.ProjectileType(), (int)Math.Max((dmg * VoidConcentrationStaff.summonTag.MultiplicativeTagDamage), 1), 0, -1, npc.whoAmI); + } + } + } + base.PostAI(npc); + } + } + public class VoidTagPlayer : ModPlayer + { + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (hit.DamageType != VoidTagDmgType.getInstance && target.HasBuff()) + target.GetGlobalNPC().StoredDamage += damageDone; + } + + public override void ModifyHurt(ref Player.HurtModifiers modifiers) + { + if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modifiers.FinalDamage *= 0.85f; //15% less dmg taken, multipicative. This is not meant to be additive to avoid needing DR scaling. + } + } + public class VoidConcentrationSummonTagProj : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public new string LocalizationCategory => "Projectiles.Summon"; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 8; + } + + public override void SetDefaults() + { + Projectile.width = 32; + Projectile.height = 32; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 60; + Projectile.penetrate = 1; + Projectile.MaxUpdates = 2; + Projectile.tileCollide = false; + Projectile.scale = 1f; + Projectile.DamageType = ModContent.GetInstance(); + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 1000; + } + + NPC target => Main.npc[(int)Projectile.ai[0]]; + + public override bool? CanHitNPC(NPC target) + { + if (Projectile.timeLeft < 5) + return null; + return false; + } + public override bool PreDraw(ref Color lightColor) + { + for (float i = 0; i < MathHelper.TwoPi; i += MathHelper.TwoPi / 3f) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + texture = TextureAssets.Npc[ModContent.NPCType()].Value; + var gt = DarkEnergy.GlowTexture.Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + Projectile.velocity.RotatedBy(i); + var frame = texture.Frame(1, 8, 0, Projectile.frame); + Main.EntitySpriteDraw(texture, drawPos, frame, lightColor, 0, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(gt, drawPos, frame, Color.White, 0, frame.Size() * 0.5f, Projectile.scale * 0.5f, SpriteEffects.None, 0); + } + return false; + } + public override void AI() + { + if (target == null || !target.active) + { + Projectile.Kill(); + return; + } + var w = target.width + 200; + Projectile.Center = target.Center; + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.velocity = Projectile.rotation.ToRotationVector2() * w * Projectile.timeLeft / 60f; + + if (Projectile.FinalExtraUpdate()) + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + if (Projectile.frame == 1) + Projectile.frame++; + } + + public override bool ShouldUpdatePosition() => false; + } + + public class VoidConcentrationSummonTagBuff : ModBuff + { + public override string Texture => "CalamityMod/Buffs/Summon/Whips/SentinalLash"; //Shared placeholder by all summon tag buffs. This is never seen in game. + + public override void SetStaticDefaults() + { + BuffID.Sets.IsATagBuff[Type] = true; + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + } + } + + #endregion } diff --git a/Items/Weapons/Summon/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/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 5d433d0621..6352a8efc2 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon @@ -13,6 +14,9 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; + public static float PartialRegenBoostPerBuffDroid = 0.5f; + public static int DefenseBoostPerBuffDroid = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PartialRegenBoostPerBuffDroid.ToRegenPerSecond(), DefenseBoostPerBuffDroid); public override void SetDefaults() { Item.width = 28; @@ -68,15 +72,13 @@ namespace CalamityMod.Items.Weapons.Summon buffingDrones = 0; } - public override void UpdateLifeRegen() + // This needs to be a fair bit earlier for partial life regen to work + public override void PostUpdateBuffs() { if (buffingDrones > 0) { - // 1 life regen per drone. - Player.lifeRegen += (int)(buffingDrones); - - // 3 defense per drone. - Player.statDefense += buffingDrones * 3; + Player.Calamity().partialLifeRegen += buffingDrones * WulfrumController.PartialRegenBoostPerBuffDroid; + Player.statDefense += buffingDrones * WulfrumController.DefenseBoostPerBuffDroid; buffingDrones = 0; } diff --git a/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 6a544156d4..dcccac4abe 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1,3 +1,7 @@ +// General (Player) and (Enemy) indicators for buff tags +OnPlayer: (Player) +OnEnemy: (Enemy) + // Alcohols (including Odd Mushroom) AlcoholPoisoning: { DisplayName: Alcohol Poisoning @@ -41,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: { @@ -72,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: { @@ -129,85 +134,104 @@ Withered: { AstralInfectionDebuff: { DisplayName: Astral Infection Description: Your flesh is melting off - ItemTooltip: Sickness - 37.5 DPS + ItemTooltipPlayer: Sickness - 12 DPS + ItemTooltipEnemy: Sickness - 37.5 DPS } AuricRebuke: { DisplayName: Auric Rebuke Description: Your cells are violently bouncing off each other - ItemTooltip: Electric - 100 DPS. Deals 4x damage against moving targets + ItemTooltipPlayer: Electric - 8 DPS. Deals 5x damage against moving players + ItemTooltipEnemy: Electric - 100 DPS. Deals 4x damage against moving targets } BanishingFire: { DisplayName: Banishing Fire Description: You shall not be forgiven for your sins - ItemTooltip: Heat - Deals DPS equal to 0.1% of max HP or 2000, whichever is greater + ItemTooltipEnemy: Heat - Deals DPS equal to 0.1% of max HP or 2000, whichever is greater } BrimstoneFlames: { DisplayName: Brimstone Flames Description: Incinerating both body and mind - ItemTooltip: Heat - 30 DPS + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: Heat - 30 DPS } BurningBlood: { DisplayName: Burning Blood Description: Your blood is on fire - ItemTooltip: Sickness - 20 DPS + ItemTooltipPlayer: Sickness - 4 DPS + ItemTooltipEnemy: Sickness - 20 DPS } BrainRot: { DisplayName: Brain Rot Description: Your neurons are popping like corn kernels - ItemTooltip: Sickness - 20 DPS + ItemTooltipPlayer: Sickness - 4 DPS + ItemTooltipEnemy: Sickness - 20 DPS } DemonicFlames: { DisplayName: Demonic Flames Description: Immolating flames sear your soul - ItemTooltip: Heat - DPS depends on inflicting item + ItemTooltipEnemy: Heat - DPS depends on inflicting item } ElementalMix: { DisplayName: Elemental Mix Description: A beautiful elemental symphony is flaying you alive - ItemTooltip: Typeless - 200 DPS + ItemTooltipEnemy: Typeless - 200 DPS } CrushDepth: { DisplayName: Crush Depth Description: Crushed by aquatic pressure - ItemTooltip: Water - 50 DPS -} - -RiptideDebuff: { - DisplayName: Riptide - Description: Lashed at by powerful waters - ItemTooltip: Water - 15 DPS + ItemTooltipPlayer: + ''' + Water - 9 DPS + Increases breath loss rate in the Abyss + ''' + ItemTooltipEnemy: Water - 50 DPS } Dragonfire: { DisplayName: Dragonfire Description: Engulfed by roaring flames - ItemTooltip: Heat - 480 DPS + ItemTooltipPlayer: Heat - 25 DPS + ItemTooltipEnemy: Heat - 480 DPS } GodSlayerInferno: { DisplayName: God Slayer Inferno Description: Your flesh is burning off - ItemTooltip: Heat - 250 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 250 DPS +} + +HadopelagicPressure: { + DisplayName: Hadopelagic Pressure + Description: Rapidly sinking to a watery grave + ItemTooltipPlayer: + ''' + Water - 20 DPS + Increases breath loss rate in the Abyss + ''' + ItemTooltipEnemy: Water - 175 DPS } HeavyBleeding: { DisplayName: Heavy Bleeding Description: That's gonna need stitches - ItemTooltip: Typeless - 40 DPS + ItemTooltipPlayer: Typeless - 8 DPS + ItemTooltipEnemy: Typeless - 40 DPS } HolyFlames: { DisplayName: Holy Flames Description: Dissolving from holy light - ItemTooltip: Heat - 150 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 150 DPS } HolyInferno: { @@ -218,41 +242,52 @@ HolyInferno: { Laceration: { DisplayName: Laceration Description: You're a bloody mess - ItemTooltip: Typeless - 200 DPS + ItemTooltipPlayer: Typeless - 18 DPS + ItemTooltipEnemy: Typeless - 200 DPS } ManaBurn: { DisplayName: Mana Burn Description: The excess of mana sears your body and mind - ItemTooltip: + ItemTooltipEnemy: ''' Typeless - Every 100 negative mana reduces your life regen by 4 HP/s, but burns enemies for 3% of dealt damage + Every 100 negative mana reduces your life regen by 4 HP/s, but burns enemies for 5% of dealt damage ''' } MiracleBlight: { DisplayName: Miracle Blight Description: Exotic resonance shreds your corporeal form - ItemTooltip: Typeless - 1500 DPS + ItemTooltipPlayer: Typeless - 30 DPS + ItemTooltipEnemy: Typeless - 1500 DPS } Nightwither: { DisplayName: Nightwither Description: Incinerated by lunar rays - ItemTooltip: Cold - 100 DPS + ItemTooltipPlayer: Cold - 20 DPS + ItemTooltipEnemy: Cold - 100 DPS } Plague: { DisplayName: Plague Description: Rotting from the inside - ItemTooltip: Sickness - 50 DPS + ItemTooltipPlayer: Sickness - 15 DPS + ItemTooltipEnemy: Sickness - 50 DPS +} + +RiptideDebuff: { + DisplayName: Riptide + Description: Lashed at by powerful waters + ItemTooltipPlayer: Water - 3 DPS + ItemTooltipEnemy: Water - 15 DPS } SagePoison: { DisplayName: Sage Poison Description: Poisoned - ItemTooltip: + ItemTooltipEnemy: ''' Sickness - 25 DPS per Viral Sprout / 50 DPS per Virid Vanguard Ignores 75% of enemy sickness weaknesses and resistances @@ -262,7 +297,8 @@ SagePoison: { SearingLava: { DisplayName: Searing Lava Description: The brimstone lava sears your flesh - ItemTooltip: + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: ''' Heat - 20 DPS Ignores enemy heat weaknesses and resistances @@ -273,37 +309,46 @@ SearingLava: { ShellfishClaps: { DisplayName: Shellfish Claps Description: Clamfest + ItemTooltipEnemy: Typeless - 75 DPS for each Shellfish minion } Shred: { DisplayName: Shred Description: Someone built ten Tri-Tip Daggers... - ItemTooltip: "" + ItemTooltipEnemy: "" } SnapClamDebuff: { DisplayName: Clammed Description: Clapped by Snap Clams + ItemTooltipEnemy: Typeless - 7.5 DPS for each latched clam } StaticDischarge: { DisplayName: Static Discharge Description: Shocked by static electricity - ItemTooltip: Electric - 2.5 DPS. 4x damage to moving targets + ItemTooltipPlayer: Electric - 1.5 DPS. 4x damage to moving players + ItemTooltipEnemy: Electric - 2.5 DPS. 4x damage to moving targets } SulphuricPoisoning: { DisplayName: Sulphuric Poisoning Description: The acidic water burns away your flesh - ItemTooltip: Sickness - 120 DPS + ItemTooltipPlayer: Sickness - 3 DPS + ItemTooltipEnemy: Sickness - 175 DPS } TrueVulnerabilityHex: { DisplayName: True Vulnerability Hex Description: The end has come - ItemTooltip: + ItemTooltipPlayer: ''' - Heat - 1998 DPS + Heat - 25 DPS + Increases damage taken from all sources + ''' + ItemTooltipEnemy: + ''' + Heat - 1332 DPS Increases damage taken from all sources Slows enemies ''' @@ -312,7 +357,7 @@ TrueVulnerabilityHex: { Vaporfied: { DisplayName: Vaporfied Description: Vape - ItemTooltip: + ItemTooltipEnemy: ''' Typeless - 15 DPS Slows enemies @@ -322,19 +367,26 @@ Vaporfied: { VermillionFlux: { DisplayName: Vermillion Flux Description: Sharp arcs of scarlet course through you - ItemTooltip: Electric - 50 DPS. Deals 4x damage against moving targets + ItemTooltipPlayer: Electric - 5 DPS. 5x damage to moving players + ItemTooltipEnemy: Electric - 37.5 DPS. 4x damage to moving targets } Voidfrost: { DisplayName: Voidfrost Description: The emptiness of space devours all warmth and life - ItemTooltip: Cold - 200 DPS + ItemTooltipPlayer: Cold - 20 DPS + ItemTooltipEnemy: Cold - 250 DPS } VulnerabilityHex: { DisplayName: Vulnerability Hex Description: Your mental fortitude is fading - ItemTooltip: + ItemTooltipPlayer: + ''' + Heat - 15 DPS + Reduces defense and damage reduction + ''' + ItemTooltipEnemy: ''' Heat - 1332 DPS Slows enemies @@ -549,6 +601,11 @@ SparksBuff: { Description: Eats butterflies } +StarSwallowerPetBuff: { + DisplayName: Star Swallower + Description: Mmmm myes +} + ThirdSageBuff: { DisplayName: Third Sage Description: Eh? No way it's an oni @@ -623,7 +680,7 @@ AstralInjectionBuff: { BaguetteBuff: { DisplayName: Baguette - Description: Goes well with Red Wine + Description: Life regeneration reduced by 2 HP/s } BloodfinBoost: { @@ -713,7 +770,7 @@ AbsorberRegen: { You are blessed by the culmimation of nature's powers Life regen increased by {0} HP/s, damage increased by {1}%, damage reduction increased by {2}% ''' - ItemTooltip: Increases life regeneration, damage, and damage reduction + ItemTooltipPlayer: Increases life regeneration, damage, and damage reduction } AbyssalDivingSuitBuff: { @@ -738,6 +795,7 @@ AeolianEarthBuff: { You are strengthened by primordial powers Damage reduction increased by {0}%, damage increased by {1}%, and massively buffed mana regen ''' + ItemTooltipPlayer: Increases damage, damage reduction, and mana regeneration } Afflicted: { @@ -804,12 +862,13 @@ ChiRegenBuff: { CoralSymbiosis: { DisplayName: Coral Symbiosis Description: Coral Spout charges up faster and deals {0} extra damage + ItemTooltipPlayer: Increases Coral Spout's charge rate and damage } CosmicFreeze: { DisplayName: Cosmic Freeze Description: You feel as cold as the empty expanse of outer space - ItemTooltip: Increases regeneration, especially when standing still, and freezes nearby enemies + ItemTooltipPlayer: Increases regeneration, especially when standing still, and freezes nearby enemies } DivineBless: { @@ -820,6 +879,7 @@ DivineBless: { EmpyreanWrath: { DisplayName: Empyrean Wrath Description: Wrath of the cosmos + ItemTooltipPlayer: Increases damage and critical strike chance } Encased: { @@ -870,7 +930,7 @@ IceShieldBuff: { Mushy: { DisplayName: Mushy Description: Increased defense by {0} and life regen by {1} HP/s - ItemTooltip: Increases defense and life regeneration + ItemTooltipPlayer: Increases defense and life regeneration } PhantomicEmpowerment: { @@ -941,7 +1001,7 @@ ReaverRage: { Rage of the earth Defense increased by {0} and damage increased by {1}% ''' - ItemTooltip: Increased defense and damage + ItemTooltipPlayer: Increased defense and damage } SandsWindBuff: { @@ -951,6 +1011,7 @@ SandsWindBuff: { You are strengthened by the powers of sand Defense increased by {0}, damage increased by {1}%, and greatly buffed mana regen ''' + ItemTooltipPlayer: Increases damage, defense, and mana regeneration } SilvaRevival: { @@ -986,14 +1047,14 @@ TarragonImmunity: { TarraLifeRegen: { DisplayName: Tarra Life Description: Rapid healing - ItemTooltip: "" + ItemTooltipPlayer: "" } // Stat debuffs AbsorberAffliction: { DisplayName: Absorber Affliction Description: Damn nature, you scary! - ItemTooltip: Sickness - 200 DPS + ItemTooltipEnemy: Sickness - 200 DPS } AndromedaCripple: { @@ -1004,23 +1065,25 @@ AndromedaCripple: { ArmorCrunch: { DisplayName: Armor Crunch Description: Your armor is shredded - ItemTooltip: Damage Reduction is 15% less effective + ItemTooltipPlayer: Reduces defense and damage reduction + ItemTooltipEnemy: Damage Reduction is 15% less effective } Bane: { DisplayName: Bane Description: An ancient curse envelops you - ItemTooltip: + ItemTooltipEnemy: ''' - Typeless - Variable DPS + Typeless - 20 DPS Does not scale with debuff multipliers + Scales based on your critical strike chance ''' } Crumbling: { DisplayName: Crumbling Description: Your armor is damaged - ItemTooltip: Damage Reduction is 8% less effective + ItemTooltipEnemy: Damage Reduction is 8% less effective } Clamity: { @@ -1045,7 +1108,7 @@ Enraged: { Eutrophication: { DisplayName: Eutrophication Description: Excessive nutrients restrict your movement - ItemTooltip: Slows enemies + ItemTooltipEnemy: Slows enemies } ExoFreeze: { @@ -1066,19 +1129,7 @@ FrozenLungs: { GalvanicCorrosion: { DisplayName: Galvanic Corrosion Description: Your limbs have begun to corrode - ItemTooltip: Slows enemies -} - -GlacialState: { - DisplayName: Glacial State - Description: Cannot move - ItemTooltip: Freezes enemies -} - -HadopelagicPressure: { - DisplayName: Hadopelagic Pressure - Description: Rapidly sinking to a watery grave - ItemTooltip: Water - 200 DPS + ItemTooltipEnemy: Slows enemies } IcarusFolly: { @@ -1093,7 +1144,12 @@ IcarusFolly: { Irradiated: { DisplayName: Irradiated Description: Your skin is burning off - ItemTooltip: + ItemTooltipPlayer: + ''' + Typeless - 2 DPS + Reduces defense and damage reduction + ''' + ItemTooltipEnemy: ''' Typeless - 10 DPS Increases damage taken from Sickness debuffs @@ -1103,12 +1159,13 @@ Irradiated: { MarkedforDeath: { DisplayName: Marked for Death Description: Damage reduction reduced - ItemTooltip: Damage reduction is 50% less effective + ItemTooltipEnemy: Damage reduction is 50% less effective } PearlAura: { DisplayName: Pearl Aura Description: Slowed down + ItemTooltipEnemy: Slows enemies } ProfanedWeakness: { @@ -1119,13 +1176,13 @@ ProfanedWeakness: { TemporalSadness: { DisplayName: Temporal Sadness Description: You are crying - ItemTooltip: Freezes enemies + ItemTooltipEnemy: Slows enemies } TimeDistortion: { DisplayName: Time Distortion Description: Time is slowed - ItemTooltip: Slows enemies + ItemTooltipEnemy: Slows enemies } Warped: { @@ -1141,7 +1198,8 @@ WeakPetrification: { WhisperingDeath: { DisplayName: Whispering Death Description: Death approaches; attack power and life regen reduced - ItemTooltip: Reduced contact damage + ItemTooltipPlayer: Negates life regen, reduces damage + ItemTooltipEnemy: Reduced contact damage } WitherDebuff: { @@ -1151,6 +1209,7 @@ WitherDebuff: { Withered... Defense decreased by {0} ''' + ItemTooltipEnemy: Decreases defense } // Summons @@ -1299,11 +1358,6 @@ DazzlingStabberBuff: { Description: En garde! } -DemonshadeSetDevilBuff: { - DisplayName: Red Devil - Description: The red devil will protect you -} - EnchantedKnifeStaffBuff: { DisplayName: Enchanted Knife Description: Junk knives not included @@ -1689,12 +1743,14 @@ PopoNoselessBuff: { Daybroken: { DisplayName: Daybroken - ItemTooltip: Heat - 100 DPS + ItemTooltipPlayer: Heat - 20 DPS + ItemTooltipEnemy: Heat - 100 DPS } Shadowflame: { DisplayName: Shadowflame - ItemTooltip: Heat - 30 DPS + ItemTooltipPlayer: Heat - 15 DPS + ItemTooltipEnemy: Heat - 30 DPS } ForbiddenStealthSummonTagBuff: { @@ -1715,14 +1771,20 @@ CnidarianSummonTagBuff: { SmashedEvil: { DisplayName: Smashed Evil Description: Increased damage, movement speed, and regeneration - ItemTooltip: + ItemTooltipEnemy: ''' - - On Enemies - - All Types - 20 DPS + All types - 20 DPS +5 damage taken - - On Players - + ''' + ItemTooltipPlayer: + ''' Regen returns to full strength 200% faster 10% increased damage 20% increased movement speed ''' } + +VoidConcentrationSummonTagBuff: { + DisplayName: Void Concentration Summon Tag Buff + Description: You should never see this. +} diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index 186125b51b..9868158c52 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -11,6 +11,8 @@ NoArmorSetBonusKey: Press the Armor Set Bonus key ArmorSetBonusKey: Press {0} DoubleTapDown: Double tap {0} // Miscellaneous stats/info +MinionSlotCost: Uses {0} minion slots +MinionSlotCostSingle: Uses {0} minion slot AggroBoost: Enemies are more likely to target you AggroReduction: Enemies are less likely to target you KnockbackImmunity: Grants immunity to knockback @@ -22,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" @@ -47,19 +50,30 @@ GrappleStats: Reelback Velocity: {2} Pull Velocity: {3} ''' +StatsAwful: Awful +StatsPoor: Poor +StatsAverage: Average +StatsGood: Good +StatsGreat: Great +StatsExcellent: Excellent WingStats: ''' Flight time: {0} seconds - Max horizontal speed: {1} mph - Max vertical speed: {2} mph + Max horizontal speed: {1} + Max vertical speed: {2} + Horizontal acceleration: {3} + Vertical acceleration: {4} ''' -WingStatsAcceleration: +WingStatsFull: ''' - Horizontal acceleration: {0} mph/s - Vertical acceleration: - {1} mph/s - {2} mph/s if ascending slower than {3} mph - {4} mph/s if ascending while falling + Flight time: {0} seconds + Max horizontal speed: {1} ({2} mph) + Max vertical speed: {3} ({4} mph) + Horizontal acceleration: {5} ({6} mph/s) + Vertical acceleration: {7} + - {8} mph/s + - {9} mph/s if ascending slower than {10} mph + - {11} mph/s if ascending while falling ''' WingStatsHover: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index e4eb0c04ad..d4d7fac81b 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -208,6 +208,15 @@ CalamityClientConfig: { ''' } + BoCSpriteChange: { + Label: "[i:BrainOfConfusion] Remove Potentially Disturbing Imagery" + Tooltip: + ''' + Replaces some boss sprites to remove potentially upsetting imagery that could trigger phobias. + Highly recommended if you are uncomfortable with body horror or have trypophobia. + ''' + } + RageMeterPosX: { Label: "[i:LaserRuler] Rage Meter X Position" Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson index b261db6100..4b00ee161b 100644 --- a/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson +++ b/Localization/en-US/Mods.CalamityMod.DamageClasses.hjson @@ -4,3 +4,4 @@ RogueDamageClass.DisplayName: rogue damage StealthDamageClass.DisplayName: stealth damage TrueMeleeDamageClass.DisplayName: true melee damage TrueMeleeNoSpeedDamageClass.DisplayName: true melee damage +VoidTagDmgType.DisplayName: void tag damage diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 100e290574..367ad5e519 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -22,7 +22,7 @@ ExodusWings: { Tooltip: ''' {$CommonItemTooltip.FlightAndSlowfall} - Grants permanent Empyrean Wrath while wearing the Empyrean armor + Grants permanent [cbuffplr:CalamityMod/EmpyreanWrath] while wearing the Empyrean armor Pulsing with an alien heartbeat ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 9e57c91d83..be97b0875c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -4,8 +4,10 @@ Abaddon: { ''' Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that scales off of your critical strike chance When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies - Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS + [DAMAGELINE] ''' + Equipped: Current [cbuff:CalamityMod/Bane] damage: {0} DPS + Unequipped: Equip this accessory to view your current [cbuff:CalamityMod/Bane] damage } AbyssalDivingGear: { @@ -28,8 +30,8 @@ AbyssalDivingSuit: { Grants the ability to swim, extends underwater breathing, emits light underwater, and improves mobility on ice Provides a moderate amount of light, reduces breath loss, and reduces damage caused by drowning in the abyss Abyss creatures are less likely to see you, mitigates the abyss' defense reduction, and lets you sink faster in liquids - Grants immunity to the sulphurous waters and [cbuff:CalamityMod/CrushDepth]'s increased breath loss - Grants resistance to the increased breath loss caused by [cbuff:CalamityMod/HadopelagicPressure] + Grants immunity to the sulphurous waters and [cbuffplr:CalamityMod/CrushDepth]'s increased breath loss + Grants resistance to the increased breath loss caused by [cbuffplr:CalamityMod/HadopelagicPressure] ''' } @@ -65,9 +67,9 @@ AlchemicalDecanter: { DisplayName: Alchemical Decanter Tooltip: ''' - All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuff:CalamityMod/Plague] by {0}% + All attacks inflict the [cbuff:CalamityMod/Plague] and reduces damage taken from the [cbuffplr:CalamityMod/Plague] by {0}% Projectiles spawn plague seekers on enemy hits - Releases plague bees and douses you in [cbuff:Honey] when damaged + Releases plague bees and douses you in [cbuffplr:Honey] when damaged ''' } @@ -96,11 +98,8 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - +{0} max life - Grants +{1} to +{2} HP/s life regen based on missing health - Grants the [cbuff:Honey] buff - Current boost: +[REGEN] HP/s - Fire and sickness debuff durations are halved + +{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)] + Natural life regen is {2}% more potent and returns {3}% faster You emit yellow light if visibility is enabled ''' } @@ -159,8 +158,10 @@ Apollyon: { Critical strikes curse enemies with [cbuff:CalamityMod/Bane] that greatly scales off of your critical strike chance When critically hit, enemies spread all debuffs they are afflicted with that are weaker than your [cbuff:CalamityMod/Bane] to nearby enemies Critical strikes deal an additional 3% damage per debuff on the enemy - Current [cbuff:CalamityMod/Bane] damage: [DAMAGE] DPS + [DAMAGELINE] ''' + Equipped: Current [cbuff:CalamityMod/Bane] damage: {0} DPS + Unequipped: Equip this accessory to view your current [cbuff:CalamityMod/Bane] damage } AquaticEmblem: { @@ -188,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 ''' @@ -231,8 +232,8 @@ AsgardianAegis: { Tooltip: ''' {$Common.KnockbackImmunity} - Allows the ability to dash, empowered by a cosmic inferno - This dash can ram through enemies without taking damage + Allows the ability to ram dash, empowered by a cosmic inferno + This dash can ram through enemies without taking damage, inflicting [cbuff:CalamityMod/GodSlayerInferno] ''' } @@ -246,12 +247,12 @@ AsgardsValor: { ''' } -AuricSoulArtifact: { - DisplayName: Auric Soul Artifact +FadedIdolatry: { + DisplayName: Faded Idolatry Tooltip: ''' For each Fiery Draconid you have summoned, you gain 1 minion slot - Loyalty + [c/ffe100:'Once everything has crumbled to dust, what will be left of the world you created?'] ''' } @@ -269,7 +270,7 @@ Baroclaw: { Tooltip: ''' 10% increased damage and 5% increased damage reduction - Attackers take high damage and are inflicted with Armor Crunch and Crush Depth + Attackers take high damage and are inflicted with [cbuff:CalamityMod/ArmorCrunch] and [cbuff:CalamityMod/CrushDepth] ''' } @@ -362,7 +363,7 @@ BlunderBooster: { ''' 12% increased rogue damage and 15% increased rogue projectile velocity Stealth generates 10% faster - Summons a red lightning aura around the player that electrifies nearby enemies + Summons a red lightning aura around the player that electrifies nearby enemies with [cbuff:CalamityMod/VermillionFlux] The aura has reduced opacity if visibility is disabled Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards diagonal dash This dash leaves a trail of red lightning bolts @@ -375,9 +376,9 @@ Calamity: { Tooltip: ''' Lights your cursor ablaze with the Witch's flames, engulfing it in a blazing aura - Enemies touching the blaze take immense damage and are inflicted with Vulnerability Hex + Enemies touching the blaze take immense damage and are inflicted with [cbuff:CalamityMod/VulnerabilityHex] Focusing an enemy for 2.5 seconds curses them, ascending Vulnerability Hex to its True form - Foes afflicted with True Vulnerability Hex take 1.15x damage from all sources + Foes afflicted with [cbuff:CalamityMod/TrueVulnerabilityHex] take 1.15x damage from all sources This effect is increased to 2.5x for the blazing cursor itself Equip in a vanity slot to change the cursor without dealing damage These changes work in conjunction with the Rainbow Cursor @@ -436,7 +437,7 @@ CorrosiveSpine: { ''' 5% increased movement speed 25% increased Sickness and Water debuff damage - All attacks irradiate enemies and reduces the severity of the sulphuric waters + All attacks inflict [cbuff:CalamityMod/Irradiated] and reduces the severity of the sulphuric waters You burst into radioactive clouds when struck ''' } @@ -455,7 +456,7 @@ CrawCarapace: { Tooltip: ''' 7% increased damage - Attackers take damage and are inflicted with Crumbling + Attackers take damage and are inflicted with [cbuff:CalamityMod/Crumbling] ''' } @@ -463,8 +464,8 @@ CrownJewel: { DisplayName: Crown Jewel Tooltip: ''' - +1 HP/s life regen - You gain an additional +1.5 HP/s life regen while afflicted with any debuff + +{0} HP/s life regen + Reduces damage over time taken by {1} HP/s ''' } @@ -555,7 +556,7 @@ DeificAmulet: { DisplayName: Deific Amulet Tooltip: ''' - Releases a burst of homing star-bees[TOGGLE] and drenches you in [cbuff:Honey] after taking damage + Releases a burst of homing star-bees[TOGGLE] and drenches you in [cbuffplr:Honey] after taking damage Increases the length of invincibility, with it increasing even more when at low health [c/aaaaaa:Shift- this item in your inventory to toggle] [i:PanicNecklace] [c/aaaaaa:Panic Necklace's effect] ''' @@ -567,7 +568,7 @@ DepthCharm: { Tooltip: ''' Reduces the damage caused by drowning in the abyss - Removes the increased breath loss of Crush Depth + Removes the increased breath loss of [cbuffplr:CalamityMod/CrushDepth] ''' } @@ -580,19 +581,19 @@ DiamondOfTheDeep: { Dash to disperse the spirits and have them attack enemies When dispersed [c/CB7AD7:below 50% life], the spirits support you instead The spirits appear in order and have different effects based on color: - [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] - [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 10 temporarily] - [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] + [c/3CB371: Explodes on impact and inflicts] [cbuff:CalamityMod/CrushDepth] / [c/CB7AD7:Heals for 8 HP] + [c/FF4500: Pierces enemies and inflicts] [cbuff:OnFire3] / [c/CB7AD7:Increases defense by 10 temporarily] + [c/1E90FF: Hits multiple times and inflicts] [cbuff:CalamityMod/HadopelagicPressure] / [c/CB7AD7:Heals 5% of max HP] Spirits are transparent and silent when visibility is toggled off ''' } -DimensionalSoulArtifact: { - DisplayName: Dimensional Soul Artifact +CrushingEgo: { + DisplayName: Crushing Ego Tooltip: ''' Multiplies all damage by 1.2x, but at the cost of taking 15% increased damage - Power + [c/ff00ff:'Don the mask of arrogance, and dance by your lonesome. Once the ball has gone quiet, you'll be the last man standing.'] ''' } @@ -626,7 +627,7 @@ DragonScales: { Rogue projectiles spawn slow fireballs as they travel Stealth strikes create infernados where they hit +10% max run speed and acceleration - Grants immunity to Dragonfire + Grants immunity to [cbuffplr:CalamityMod/Dragonfire] 'Only a living dragon holds true treasure' ''' } @@ -637,7 +638,7 @@ DynamoStemCells: { ''' 10% increased ranged damage and movement speed Ranged weapons fire a powerful mini swarmer every 3 seconds - Reduces damage taken from Dragonfire + Reduces damage taken from [cbuffplr:CalamityMod/Dragonfire] ''' } @@ -657,13 +658,17 @@ EclipseMirror: { FlavorTooltip: "'Its reflection shows naught but darkness'" } -EldritchSoulArtifact: { - DisplayName: Eldritch Soul Artifact +FragmentsOfAnotherWorld: { + DisplayName: Fragments of Another World Tooltip: ''' - Boosts melee speed by 10%, ranged velocity by 25%, rogue stealth regen by 15%, max minions by 1 and reduces mana cost by 25% - Grants immunity to Whispering Death - Knowledge + Grants immunity to [cbuffplr:CalamityMod/WhisperingDeath] + {0}% increased melee speed + {1}x specialist ranged damage + {2}% reduced mana usage + +{3} maximum sentries + {4}% increased rogue attack speed + [c/ff0000:'Don't speak of your desires to the shadows, they listen.'] ''' } @@ -680,7 +685,7 @@ ElementalGauntlet: { DisplayName: Elemental Gauntlet Tooltip: ''' - Melee attacks and projectiles inflict Elemental Mix + Melee attacks and projectiles inflict [cbuff:CalamityMod/ElementalMix] 15% increased melee damage and melee speed 5% increased melee critical strike chance 20% increased true melee damage and increased melee knockback @@ -700,7 +705,7 @@ ElysianAegis: { ''' {$Common.KnockbackImmunity} Allows the ability to dash, empowered by holy fire - This dash can ram through enemies without taking damage + This dash can ram through enemies without taking damage, inflicting [cbuff:CalamityMod/HolyFlames] 'Blessed by the Profaned Flame' ''' } @@ -728,8 +733,8 @@ EtherealTalisman: { DisplayName: Ethereal Talisman Tooltip: ''' - 15% increased magic damage, 5% increased magic critical strike chance - +150 max mana and 10% decreased mana usage + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} Increases pickup range for mana stars You automatically use mana potions when needed [c/aaaaaa:Shift- in your inventory to toggle] [i:ManaFlower] [c/aaaaaa:Mana Flower's effect] @@ -755,8 +760,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.] ''' } @@ -782,8 +795,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 + +20 max mana + Summons an effigy above your head that stores mana as you use it, up to 600 mana + The effigy occasionally pulses, restoring 25 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 ''' } @@ -800,10 +817,10 @@ FrostFlare: { DisplayName: Frost Flare Tooltip: ''' - All attacks and projectiles inflict Frostbite + All attacks and projectiles inflict [cbuff:Frostburn2] Grants immunity to Frostburn, Chilled and Frozen - Being above 50% life grants 10% increased damage - Being below 50% life grants 15 defense and 15% increased max movement speed and acceleration + 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 ''' } @@ -822,8 +839,8 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, granting 5 defense and +1 HP/s life regen - 10% increased damage while you have the Mushy buff + Consuming mushrooms provides [cbuffplr:CalamityMod/Mushy], granting 5 defense and +1 HP/s life regen + 10% increased damage while you have [cbuffplr:CalamityMod/Mushy] ''' } @@ -832,7 +849,7 @@ GiantPearl: { Tooltip: ''' You have a light aura around you - Enemies within the aura are slowed down + Enemies within the aura are afflicted with [cbuff:CalamityMod/PearlAura] and slowed down Enemies that remain within the aura are bombarded by homing prism shards {$Common.AbyssGlow} ''' @@ -842,8 +859,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 ''' } @@ -852,8 +869,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 ''' } @@ -904,9 +921,9 @@ HallowedRune: { ''' HoldShiftTooltip: ''' - [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants 10% increased summon damage and rains stars on enemies] - [c/d08aff: Hallowed Defense] [c/eed4ff: grants 5 defense] - [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +1.5 HP/s life regen] + [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants {0}% increased summon damage and rains stars on enemies] + [c/d08aff: Hallowed Defense] [c/eed4ff: grants {1} defense] + [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +{2} HP/s life regen] ''' } @@ -936,18 +953,13 @@ HideofAstrumDeus: { True melee strikes drops astral stars from the sky Releases an explosion and temporarily increases true melee damage by 30% when damaged Boost duration scales with the amount of damage you took, up to 10 seconds - Nullifies the Astral Infection debuff + Nullifies the [cbuffplr:CalamityMod/AstralInfectionDebuff] ''' } HoneyDew: { DisplayName: Honey Dew - Tooltip: - ''' - +10 max life - Grants the Honey buff - Sickness debuff durations are halved - ''' + Tooltip: Natural life regen is {0}% more potent } HowlsHeart: { @@ -963,7 +975,7 @@ IlmerisSpark: { DisplayName: Ilmeris' Spark Tooltip: ''' - Attacks inflict Static Discharge while underwater + Attacks inflict [cbuff:CalamityMod/StaticDischarge] while underwater Taking damage causes the enemy to be shocked Shocked enemies constantly release sparks ''' @@ -973,11 +985,9 @@ InfectedJewel: { DisplayName: Infected Jewel Tooltip: ''' - Passively grants +1 HP/s life regen - Grants 12 defense and +2 HP/s life regen while afflicted with any debuff - Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 4 additional defense - Nullifies the Astral Infection debuff + +{0} HP/s life regen + Reduces damage over time taken by {1} HP/s + Jump-starts regeneration after a damaging debuff ends 'A beautiful gemstone tarnished by spaceborne rot' ''' } @@ -1026,7 +1036,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)'] ''' } @@ -1035,7 +1045,7 @@ JellyChargedBattery: { Tooltip: ''' Increases your max number of minions by 1, and summon damage by 7% - Minion attacks create orbs of static discharge + Minion attacks create orbs of [cbuff:CalamityMod/StaticDischarge] ''' } @@ -1058,7 +1068,7 @@ LeviathanAmbergris: { Tooltip: ''' 120% increased initial dash velocity, 33% faster dash cooldown, and greatly increased dash deceleration - Your dashes are empowered by water, knocking back and damaging nearby enemies with viscous currents + Your dashes are empowered by water, knocking back and damaging enemies with vicious currents that inflict [cbuff:CalamityMod/RiptideDebuff] Visual effects are reduced if visibility is disabled ''' } @@ -1074,12 +1084,7 @@ LifeJelly: { LivingDew: { DisplayName: Living Dew - Tooltip: - ''' - +25 max life - Grants the Honey buff - Fire and sickness debuff durations are halved - ''' + Tooltip: Natural life regen is {0}% more potent and returns {1}% faster } LuxorsGift: { @@ -1097,7 +1102,7 @@ ManaPolarizer: { DisplayName: Mana Polarizer Tooltip: ''' - Increases max mana by 50 + Increases max mana by 40 Provides life regeneration and magic damage that scales based on how much mana you have Lower mana means more life regeneration, but less magic damage These scale from -2 to +2 HP/s, and 15% to 5% damage @@ -1129,9 +1134,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 + +40 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.] ''' } @@ -1141,9 +1155,9 @@ Nanotech: { ''' Rogue projectiles create nanoblades as they travel Stealth strikes summon nanobeams and sparks on enemy hits - Stealth strikes have +15 armor penetration, deal 5% more damage, and heal for 2 HP + Stealth strikes have lifesteal, +15 armor penetration, deal 5% more damage 15% increased rogue damage and 15% increased rogue velocity - Stealth strikes grant 10% critical strike chance to non-stealth strikes for 5 seconds + Stealth strikes grant lifesteal and 10% critical strike chance to non-stealth strikes for 10 seconds ''' } @@ -1164,7 +1178,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 ''' } @@ -1174,8 +1188,8 @@ NuclearFuelRod: { Tooltip: ''' Increases your max number of minions by 1 - Minions release an irradiated aura on enemy hits - Grants immunity to Irradiated + Minions release an [cbuff:CalamityMod/Irradiated] aura on enemy hits + Grants immunity to [cbuffplr:CalamityMod/Irradiated] ''' } @@ -1184,7 +1198,7 @@ Nucleogenesis: { Tooltip: ''' Increases your max number of minions by 4 - Grants immunity to Shadowflame and Irradiated + Grants immunity to [cbuffplr:CalamityMod/Shadowflame] and [cbuffplr:CalamityMod/Irradiated] 15% increased summon damage, and increased minion knockback Minions inflict a variety of debuffs Minions spawn damaging sparks on enemy hits @@ -1254,7 +1268,7 @@ OrnateShield: { Tooltip: ''' Allows the ability to dash - This dash can ram through enemies without taking damage + This dash can ram through enemies without taking damage, inflicting [cbuff:Frostburn2] ''' } @@ -1271,7 +1285,7 @@ PermafrostsConcoction: { DisplayName: Permafrost's Concoction Tooltip: ''' - Increases maximum mana by 50 and reduces mana cost by 15% + Increases maximum mana by 40 and reduces mana cost by 15% +0.5 HP/s life regen below half health, +1 HP/s when below 25% health and +2 HP/s when below 10% health +3 HP/s life regen while afflicted with any fire debuff You will survive fatal damage and revive with 30% life on a 3 minute cooldown @@ -1288,9 +1302,9 @@ PhantomicArtifact: { ''' HoldShiftTooltip: ''' - [c/8ce0ff: Phantomic Empowerment] [c/ccf1ff: grants 10% increased summon damage and throws knives at enemies] - [c/d08aff: Phantomic Shield] [c/eed4ff: grants 10 defense and a 20% damage reduction bulwark] - [c/ff8cb5: Phantomic Regen] [c/ffccde: grants 1 HP/s life regen and occasionally drops phantom hearts which grant an additional 1 HP/s life regen] + [c/8ce0ff: Phantomic Empowerment] [c/ccf1ff: grants {0}% increased summon damage and throws knives at enemies] + [c/d08aff: Phantomic Shield] [c/eed4ff: grants {1} defense and a 20% damage reduction bulwark] + [c/ff8cb5: Phantomic Regen] [c/ffccde: grants {2} HP/s life regen and occasionally drops phantom hearts which grant an additional 1 HP/s life regen] ''' } @@ -1310,7 +1324,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 @@ -1327,7 +1341,7 @@ ProfanedSoulArtifact: { [ADREN] Once depleted, the rocks are flung outward and will regenerate 5 seconds after being hit Taking damage resets the timer - The healer guardian restores 15 health every few seconds + The healer guardian restores 10 health every few seconds Purity ''' ShieldAdren: Halved Adrenaline loss if all damage is absorbed @@ -1349,7 +1363,7 @@ ProfanedSoulCrystal: { ''' Provides passive buffs depending on the time of day Greatly boosts the power of the Guardian's relics - Grants additional effects if you have {0} minion slots + Grants additional effects if you have {0} unused minion slots Summons your own personal Guardians to fight alongside you All non-summon attacks are transformed, and are empowered if no minions are active [c/ffa680:Melee] [c/ffd2bf:attacks become a barrage of spears] @@ -1388,32 +1402,21 @@ Radiance: { DisplayName: Radiance Tooltip: ''' - +70 max life - Provides greatly improved life regen, increasing with lost health - Gain increased defense from debuffs inflicted on you, and greatly reduces their effectiveness - Current boosts: +[REGEN] HP/s and [DEFENSE] defense. + +{0} to +{1} HP/s life regen based on missing health [c/999999:(Current: +[REGEN] HP/s)] + Reduces damage over time taken by {2} HP/s and jump-starts regeneration after a damaging debuff ends + Natural life regen is {3}% more potent and returns {4}% faster You emit shining blue light if visibility is enabled 'A once putrid crystal, now glimmering with immaculate purity' ''' - HoldShiftTooltip: - ''' - [c/CDF69C:Grants +2 to +5 HP/s life regen based on missing health] - [c/CDF69C:Recover an additional 6 HP/s while inflicted with a debuff] - [c/CDF69C:This eventually slows to 1.33 HP/s when debuffed for an extended time period] - [c/CDF69C:Grants the Honey buff] - [c/CDF69C:Grants 15 defense while afflicted with any debuff] - [c/CDF69C:Each additional debuff grants 5 defense, which slowly decays while not debuffed] - [c/CDF69C:Weak damaging debuffs are harmless and halves the duration of most other debuffs] - ''' } RadiantOoze: { DisplayName: Radiant Ooze Tooltip: ''' - Grants +{0} to +{1} HP/s life regen based on missing health - Current boost: +[REGEN] HP/s + +{0} to +{1} HP/s life regen based on missing health You emit yellow light if visibility is enabled + [c/999999:(Current regen: +[REGEN] HP/s)] ''' } @@ -1427,7 +1430,7 @@ RampartofDeities: { Tooltip: ''' {$Common.KnockbackImmunity} - Releases a blast of homing star-bees[TOGGLE] and drenches you in [cbuff:Honey] after taking damage + Releases a blast of homing star-bees[TOGGLE] and drenches you in [cbuffplr:Honey] after taking damage Increases the length of invincibility, with it increasing even more when at low health or taking high damage attacks Reduces damage taken by 25% when below 50% life Absorbs 25% of damage done to players on your team when you are above 25% life @@ -1488,7 +1491,7 @@ RottenBrain: { RottenDogtooth: { DisplayName: Rotten Dogtooth - Tooltip: Stealth strikes inflict Crumbling for 2.5 seconds and deal 8% more damage + Tooltip: Stealth strikes inflict [cbuff:CalamityMod/Crumbling] and deal 8% more damage } RoverDrive: { @@ -1518,9 +1521,9 @@ SandCloak: { Tooltip: ''' Dashing creates a large protective sand veil which damages enemies inside it - The sand veil lasts 15 seconds, but dissipates early if you dash again - The veil slowly follows you, and any player inside it gains 4 defense and 1.75x acceleration - After dissipating, the sand veil has a 15 second cooldown before it can be used again + The sand veil lasts {0} seconds, but dissipates early if you dash again + The veil slowly follows you, and any player inside it gains {1} defense and {2}% acceleration + After dissipating, the sand veil has a {3} second cooldown before it can be used again ''' } @@ -1628,8 +1631,8 @@ SigilofCalamitas: { DisplayName: Sigil of Calamitas Tooltip: ''' - 15% increased magic damage and 10% decreased mana usage - +100 max mana + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedMagicDamage@1} Increases pickup range for mana stars ''' } @@ -1643,9 +1646,9 @@ SlagsplitterPauldron: { DisplayName: Slagsplitter Pauldron Tooltip: ''' - Your dashes become empowered by flame, erupting on contact with enemies + Your dashes become empowered by [cbuff:OnFire3], erupting on contact with enemies Grants immunity to knockback and 10% damage reduction while dashing - Enemies hit by your dashes have their armor crushed + Enemies hit by your dashes are afflicted with [cbuff:CalamityMod/ArmorCrunch] Visual effects are reduced if visibility is disabled ''' } @@ -1672,9 +1675,20 @@ SpiritGlyph: { Tooltip: Minion attacks provide various buffs HoldShiftTooltip: ''' - [c/8ce0ff: Spirit Power] [c/ccf1ff:grants 10% increased summon damage] - [c/d08aff: Spirit Defense] [c/eed4ff:grants 3 defense] - [c/ff8cb5: Spirit Regen] [c/ffccde:grants +1 HP/s life regeneration] + [c/8ce0ff: Spirit Power] [c/ccf1ff:grants {0}% increased summon damage] + [c/d08aff: Spirit Defense] [c/eed4ff:grants {1} defense] + [c/ff8cb5: Spirit Regen] [c/ffccde:grants +{2} HP/s life regeneration] + ''' +} + +SpringStool: { + DisplayName: Spring Stool + Tooltip: + ''' + Hold {$Key.UP} to reach higher + Press [KEY] to jump super high + Super jumps can only be performed once every {0} seconds and after landing + +{1}% critical strike chance when striking enemies below you ''' } @@ -1683,7 +1697,7 @@ StarbusterCore: { Tooltip: ''' Increases your max number of minions by 1 - Summons release an astral explosion on enemy hits + Summons release an [cbuff:CalamityMod/AstralInfectionDebuff] explosion on enemy hits ''' } @@ -1693,7 +1707,7 @@ StarTaintedGenerator: { ''' Increases your max number of minions by 2, and summon damage by 7% Minion attacks spawn astral explosions and inflict several debuffs - Grants immunity to Irradiated + Grants immunity to [cbuffplr:CalamityMod/Irradiated] Does not stack with downgrades ''' } @@ -1713,7 +1727,7 @@ StatisCurse: { ''' Increases your max number of minions by 3, and summon damage by 12% Increased minion knockback - Minion attacks inflict Shadowflame, and grants immunity to Shadowflame + Minion attacks inflict [cbuff:CalamityMod/Shadowflame], and grants immunity to [cbuffplr:CalamityMod/Shadowflame] Does not stack with downgrades ''' } @@ -1844,9 +1858,10 @@ TeslasAmulet: { DisplayName: Tesla's Amulet Tooltip: ''' - Generates an electrifying field that slows enemies + Generates an electrifying field around you + The field inflicts [cbuff:CalamityMod/StaticDischarge] and [cbuff:CalamityMod/GalvanicCorrosion] The field has reduced opacity if visibility is disabled - Reduces the duration of the Static Discharge debuff + Reduces the duration of [cbuffplr:CalamityMod/StaticDischarge] ''' } @@ -1856,7 +1871,7 @@ TheAbsorber: { ''' {$Common.KnockbackImmunity} {0}% increased movement and jump speed - Attackers take immense damage and are afflicted with a crippling sickness debuff + Attackers take immense damage and are afflicted with [cbuff:CalamityMod/AbsorberAffliction] Using a healing potion will spawn a green aura that lasts for {1} seconds Walking into the aura removes all debuffs once and grants {2} HP/s regen, {3}% damage, and {4}% damage reduction {5}% of the damage from enemy attacks is converted into healing @@ -1934,7 +1949,7 @@ TheFirstShadowflame: { Tooltip: ''' Increases your max number of minions by 1 - Minion attacks inflict Shadowflame, and grants immunity to Shadowflame + Minion attacks inflict [cbuff:CalamityMod/Shadowflame], and grants immunity to [cbuffplr:CalamityMod/Shadowflame] ''' } @@ -1988,7 +2003,7 @@ ToxicHeart: { DisplayName: Toxic Heart Tooltip: ''' - Your heart beats with the plague, pulsing outside of your body + Your heart beats with the [cbuff:CalamityMod/Plague], pulsing outside of your body Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you 50% increased Sickness debuff damage Effects are transparent and silent if visibility is disabled @@ -1999,9 +2014,9 @@ TrinketofChi: { DisplayName: Trinket of Chi Tooltip: ''' - Increases damage reduction by 8% if you avoid taking damage for 10 seconds + Increases damage reduction by {0}% if you avoid taking damage for {1} seconds This buff expires on hit - +1 HP/s life regen for you and your teammates + +{2} HP/s life regen for you and your teammates ''' } @@ -2009,8 +2024,8 @@ UnholyTonic: { DisplayName: Unholy Tonic Tooltip: ''' - Increases damage reduction by 4% and defense by 6 while in the corruption - Grants immunity to Brain Rot + Increases defense by {0} while in the corruption + Grants immunity to [cbuffplr:CalamityMod/BrainRot] ''' } @@ -2023,13 +2038,28 @@ UnstableGraniteCore: { ''' } +V8Engine: { + DisplayName: V8 Engine + Tooltip: Grants a short dash with a long cooldown that works while mounted +} + +V8000Engine: { + DisplayName: V8000 Engine + Tooltip: + ''' + Grants a dash with a long cooldown that works while mounted + This dash can ram through enemies without taking damage + 'Are soul-powered engines eco-friendly?' + ''' +} + VampiricTalisman: { DisplayName: Vampiric Talisman Tooltip: ''' Rogue critical strikes steal enemy life Stealth strikes grant 15% critical strike chance and increased lifesteal to non-stealth strikes for 10 seconds - Stealth strikes inflict Heavy Bleeding and Armor Crunch, and deal 8% more damage + Stealth strikes inflict [cbuff:CalamityMod/HeavyBleeding] and [cbuff:CalamityMod/ArmorCrunch], and deal 8% more damage 'Possessing the talisman makes you yearn for blood' ''' YearningForBlood: THIS ENDLESS HUNGER WON'T END @@ -2050,8 +2080,8 @@ ViciousTonic: { DisplayName: Vicious Tonic Tooltip: ''' - Increases damage reduction by 4% and defense by 6 while in the crimson - Grants immunity to Burning Blood + Increases defense by {0} while in the crimson + Grants immunity to [cbuffplr:CalamityMod/BurningBlood] ''' } @@ -2065,7 +2095,7 @@ VoidofCalamity: { Tooltip: ''' 12% increased damage - Brimstone fire rains down after getting hit + Calamitous flames rain down while invincible ''' } @@ -2074,7 +2104,7 @@ VoltaicJelly: { Tooltip: ''' Increases your max number of minions by 1 - Minion attacks inflict Static Discharge + Minion attacks inflict [cbuff:CalamityMod/StaticDischarge] ''' } @@ -2084,7 +2114,7 @@ WarbanneroftheRighteous: { ''' Multiplies all damage based on how close you are to enemies Maximum damage boost is 15%, minimum damage boost is -15% - Emit a blazing aura that burns and repels nearby enemies + Emit a blazing aura that burns and repels nearby enemies with [cbuff:CalamityMod/HolyFlames] Enemies take increasing damage the closer they are to you and the longer they are near you Effects are transparent and silent if visibility is disabled ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 3ba3ea1a9b..26c714ad61 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -38,7 +38,7 @@ BloodRune: { BubonicRound: { DisplayName: Bubonic Round - Tooltip: Spreads the plague on hit and ignores 10% of enemy defense + Tooltip: Spreads the [cbuff:CalamityMod/Plague] on hit and ignores 10% of enemy defense } CinderArrow: { @@ -48,7 +48,13 @@ CinderArrow: { DryadsTear: { DisplayName: Dryad's Tear - Tooltip: Splits into homing shards on impact which ignore 10 points of enemy defense + Tooltip: + ''' + An extremely powerful magic bullet blessed with nature's essence that becomes unstable when multiple are nearby + Carries a teardrop along with it which on impact will detach and crash down upon the hit enemy and burst + All bullet and teardrop hits have 18 armor penetration + [c/40E091:'Focus. Breathe. Just one more shot, and the violence will fade away...'] + ''' } ElysianArrow: { @@ -96,7 +102,7 @@ HolyFireBullet: { DisplayName: Holy Fire Bullet Tooltip: ''' - Profaned bullets that deal 1.15x damage and explode on impact + Profaned bullets that deal 1.15x damage and explode on impact, inflicting [cbuff:CalamityMod/HolyFlames] The explosion is larger and the bullet deals increased damage if impact occurs immediately after firing The extra damage bonus caps at 1.15x ''' @@ -110,7 +116,7 @@ HyperiusBullet: { Damage that would be dealt from the bullets is instead stored on the target As more damage is stored, it will begin to overflow, slowly releasing and damaging the enemy Attacks from sources other than Hyperius Bullets will release some of the charge - Releasing charge in this way deals 20% more damage + Releasing charge in this way is 20% more efficient ''' } @@ -165,7 +171,7 @@ VanquisherArrow: { DisplayName: Vanquisher Arrow Tooltip: ''' - Pierces through tiles and homes in on enemies + Pierces through tiles and homes in on enemies, inflicting [cbuff:CalamityMod/GodSlayerInferno] Tears a rift in space on enemy hits ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 35c60fa863..7cd148e6f7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -10,12 +10,16 @@ AstralBreastplate: { AstralHelm: { DisplayName: Astral Helm - Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + Detects nearby creatures, enemy projectiles, danger sources, and treasure + [c/aaaaaa:Shift- in your inventory to toggle the] [cbuffplr:CalamityMod/Omniscience] [c/aaaaaa:effect] + ''' SetBonus: ''' {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} - Detects nearby creatures, enemy projectiles, danger sources, and treasure Whenever you crit an enemy, a barrage of stars will rain down This effect has a {2} {^2:second;seconds} cooldown before it can trigger again ''' @@ -45,7 +49,7 @@ BrimflameCowl: { ''' {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} {$CommonItemTooltip.PercentIncreasedMagicDamageCritChance@2} - Immunity to [cbuff:OnFire], [cbuff:CalamityMod/BrimstoneFlames] and [cbuff:Frostburn] + Immunity to [cbuffplr:OnFire], [cbuffplr:CalamityMod/BrimstoneFlames] and [cbuffplr:Frostburn] ''' SetBonus: ''' @@ -197,7 +201,7 @@ HydrothermicArmor: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedDamage} - Grants immunity to lava and [cbuff:OnFire] + Grants immunity to lava and [cbuffplr:OnFire] ''' CommonSetBonus: ''' @@ -346,7 +350,7 @@ MolluskShellmet: { SetBonus: ''' {0}% increased damage reduction - Two shellfishes aid you in combat + Two shellfishes aid you in combat, inflicting [cbuff:CalamityMod/ShellfishClaps] ''' } @@ -365,7 +369,7 @@ PlaguebringerCarapace: { ''' {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} - Grants immunity to [cbuff:CalamityMod/Plague] + Grants immunity to [cbuffplr:CalamityMod/Plague] ''' } @@ -425,7 +429,7 @@ PlagueReaperVest: { Tooltip: ''' {$CommonItemTooltip.PercentIncreasedRangedDamage} - Grants immunity to the Plague + Grants immunity to [cbuffplr:CalamityMod/Plague] ''' } @@ -472,7 +476,7 @@ ReaverHeadTank: { {$Common.AggroBoost} Reduces the life regen lost from damage over time debuffs by {0}% {1}% decreased movement speed and flight time - Grants [cbuff:CalamityMod/ReaverRage] for {2} {^2:second;seconds} after taking damage + Grants [cbuffplr:CalamityMod/ReaverRage] for {2} {^2:second;seconds} after taking damage ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 10cdedab20..7d07b1699f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -168,7 +168,6 @@ BloodflareBodyArmor: { Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Greatly increased life regen, equivalent to Crimson armor Enemies below 50% life drop a heart when struck This effect has a 5 second cooldown ''' @@ -243,6 +242,7 @@ BloodflareHeadRogue: { ''' {$Common.RogueDamage} and {$Common.RogueCrit@1} {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} + Increases regeneration by {3} HP/s ''' SetBonus: ''' @@ -252,7 +252,6 @@ BloodflareHeadRogue: { SetBonusEffect: ''' Grants {0} defense when above {1}% life - Rogue critical strikes have lifesteal {$BloodflareBodyArmor.CommonSetBonus} ''' } @@ -307,7 +306,6 @@ DemonshadeHelm: { {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Shadowbeams and demon scythes will fire down when you are hit - A friendly red devil follows you around {2} to enrage nearby enemies with a dark magic spell for {3} seconds This makes them take {4}x total damage, but they will deal {5}x damage to you ''' @@ -338,7 +336,7 @@ EmpyreanMask: { ''' {$Common.RogueStealth} Rogue projectiles have special effects on enemy hits - Imbued with cosmic wrath when you are damaged + Imbued with [cbuffplr:CalamityMod/EmpyreanWrath] when you are damaged or while below {1}% life ''' } @@ -424,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 ''' } @@ -500,7 +498,7 @@ OmegaBlueChestplate: { ''' {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} {$CommonItemTooltip.PercentChanceToSaveAmmo@2} - Your attacks inflict Hadopelagic Pressure + Your attacks inflict [cbuff:CalamityMod/HadopelagicPressure] No positive life regen ''' } @@ -669,7 +667,7 @@ TarragonHeadMelee: { ''' SetBonusEffect: ''' - Taking damage gives [cbuff:CalamityMod/TarraLifeRegen], which grants +{0} HP/s life regen + Taking damage gives [cbuffplr:CalamityMod/TarraLifeRegen], which grants +{0} HP/s life regen {1} to cloak yourself in life energy that heavily reduces enemy contact damage for {2} seconds This has a {3} second cooldown {$TarragonBreastplate.CommonSetBonus} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index 040f049fb8..a3bcceedcc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -91,7 +91,7 @@ DesertProwlerPants: { Tooltip: ''' {$Common.RogueCrit} - Grants immunity to {$BuffName.WindPushed} + Grants immunity to [cbuffplr:WindPushed] ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 44d944cf2c..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 @@ -46,8 +46,8 @@ UrsaSergeant: { DisplayName: Ursa Sergeant Tooltip: ''' - Attacks maul enemies with astral claw swipes - Taking damage reduces the cooldown, but inflicts you with {$Buffs.AstralInfectionDebuff.DisplayName} + Attacks maul enemies with astral claw swipes that inflict [cbuff:CalamityMod/AstralInfectionDebuff] + Taking damage reduces the cooldown, but inflicts you with [cbuffplr:CalamityMod/AstralInfectionDebuff] Enemy kills also reduce the cooldown Swipes will be translucent and silent if visibility is disabled ''' @@ -58,10 +58,8 @@ Bloodfin: { DisplayName: Bloodfin Tooltip: ''' - Grants a buff that massively boosts natural life regen and grants +{0} HP/s life regen - This increases to +{1} HP/s while suffering from damage over time debuffs - This buff also directly restores HP every {2} seconds if below {3}% health - {$CommonItemTooltip.SecondDuration@4} + Grants a buff that restores 1 HP every {0} seconds + {$CommonItemTooltip.SecondDuration@1} 'The wonders of angiogenesis' ''' } @@ -336,7 +334,7 @@ NavyFishingRod: { DisplayName: Navy Fishing Rod Tooltip: ''' - Fires bobbers that inflict Static Discharge on nearby enemies + Fires bobbers that inflict [cbuff:CalamityMod/StaticDischarge] on nearby enemies 'The sea is a city. Just below are highways, boulevards, streets, and roundabouts bustling with submarine traffic.' ''' @@ -346,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.' ''' @@ -357,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.' ''' } @@ -366,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 @@ -399,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: ''' @@ -434,7 +410,7 @@ SkylineBobber: { ''' } -PerennialBobber: { +FeralBobber: { DisplayName: Feral Bobber Tooltip: ''' @@ -446,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: ''' @@ -458,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.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index d8d310e8b3..36ea72fa67 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -54,7 +54,6 @@ CosmicPlushie: { Tooltip: ''' Summons the devourer of the cosmos...? - Suppresses friendly red devils 'Sharp objects possibly included' ''' } @@ -166,6 +165,11 @@ RottingEyeball: { Tooltip: Summons a corrupted conglomeration } +StarSwallowerUnit: { + DisplayName: Star Swallower Unit + Tooltip: Summons a biomechanical frog +} + StrangeOrb: { DisplayName: Strange Orb Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index a4c20d91d5..61bc96f190 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -8,7 +8,7 @@ AstralInjection: { Tooltip: ''' Restores {0} mana per second - Lower your health by {1} and inflicts {$BuffName.ManaSickness} when used + Inflicts [cbuff:ManaSickness] when used ''' } @@ -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 75bc1378a2..935171ee91 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -195,7 +195,7 @@ Grax: { DisplayName: Grax Tooltip: ''' - Hitting an enemy will greatly boost your damage, defense, and damage reduction for a short time + Hitting an enemy increases your damage by {0}% and defense by {1} for {2} seconds Press to use without hammering down walls or chopping down trees ''' } @@ -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..4b3a6a68e5 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.'] ''' @@ -65,7 +66,6 @@ HolofibreImmolator: { Holding quickly charges the bow, firing a high-speed plasma arrow Plasma arrows will detonate after impact, creating stronger explosions if stuck into tiles Holding will repeatedly fire uncharged shots - Holding and will automatically fire charged arrows at a slightly slower rate [c/1FFBFF:'The elegance of holofibre is unmatched.] [c/1FFBFF:However, mechanical tension may have produced more consistent results.'] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 432d733ff1..ce22045fcb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -22,7 +22,7 @@ AethersWhisper: { DisplayName: Aether's Whisper Tooltip: ''' - Inflicts long-lasting shadowflame and splits on tile hits + Inflicts long-lasting [cbuff:CalamityMod/Shadowflame] and splits on tile hits Projectiles gain damage as they travel ''' } @@ -161,21 +161,21 @@ BlackAnurian: { BloodBath: { DisplayName: Blood Bath - Tooltip: Drenches your foes in blood + Tooltip: Drenches your foes in blood that inflicts [cbuff:CalamityMod/BurningBlood] } BrimroseStaff: { DisplayName: Brimrose Staff - Tooltip: Fires a spread of brimstone beams + Tooltip: Fires a spread of splitting beams of [cbuff:CalamityMod/BrimstoneFlames] } BurningSea: { DisplayName: Burning Sea Tooltip: ''' - Conjures a massive brimstone fireball that hovers near you and incinerates foes + Conjures a massive fireball that hovers near you and incinerates foes with [cbuff:CalamityMod/BrimstoneFlames] Holding the fireball for too long causes it to burn out - This burns you with Brimstone Flames and gives a long delay before another can be cast + This burns you with [cbuffplr:CalamityMod/BrimstoneFlames] and gives a long delay before another can be cast ''' } @@ -202,9 +202,10 @@ CoralSpout: { ''' Casts a shotgun-like blast of coral shards Keep the attack button held down to narrow the spread + Coral shards ignore 5 points of enemy defense Fully charging the attack releases a single, bigger chunk of coral that sticks to enemies Grabbing the chunk of coral after it falls from the enemy replenishes 150 mana - The mana-charged coral also provides a buff that increases the coral's damage and the convergence speed + The mana-charged coral also provides the [cbuffplr:CalamityMod/CoralSymbiosis] buff [c/5C95A1:'Knowledge is important, and the Old Sea Kingdom's many scribes knew it had to be preserved at any cost.] [c/5C95A1:Their libraries were much larger than most, because of the water-proof stone tablets occupying them.'] ''' @@ -238,8 +239,8 @@ DeathValleyDuster: { Tooltip: ''' Casts an enchanted blast of sand that passes through enemies and tiles - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the Sand's Wind Buff - The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/SandsWindBuff] buff + [cbuffplr:CalamityMod/SandsWindBuff] increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' } @@ -298,7 +299,7 @@ EventHorizon: { EvergladeSpray: { DisplayName: Everglade Spray - Tooltip: Fires a stream of burning green ichor + Tooltip: Fires a stream of [cbuff:CursedInferno] and [cbuff:Ichor] } FaceMelter: { @@ -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: { @@ -511,7 +512,7 @@ MadAlchemistsCocktailGlove: { Tooltip: ''' Fires a variety of high-velocity flasks - Press to throw a prismatic flask that inflicts Elemental Mix + Press to throw a prismatic flask that inflicts [cbuff:CalamityMod/ElementalMix] Red flasks explode violently Blue flasks contain poison gas Green flasks summon lunar flares @@ -592,7 +593,11 @@ Omicron: { ParasiticSceptor: { DisplayName: Parasitic Scepter - Tooltip: Fires a spread of radioactive water leeches that latch onto enemies, increasing damage over time per leech + Tooltip: + ''' + Fires a spread of radioactive water leeches that latch onto enemies + Deals stacking [cbuff:CalamityMod/Irradiated] damage over time per leech + ''' } PhantasmalFury: { @@ -604,7 +609,7 @@ PhoenixFlameBarrage: { DisplayName: Phoenix Flame Barrage Tooltip: ''' - Casts a barrage of fire from the sky + Casts a barrage of [cbuff:CalamityMod/Dragonfire] from the sky 'Baptism by draconic fire' ''' } @@ -616,7 +621,7 @@ Photosynthesis: { PlagueStaff: { DisplayName: Plague Staff - Tooltip: Fires a tight spread of 4 plague fangs + Tooltip: Fires a tight spread of 4 plague fangs that inflict [cbuff:CalamityMod/Plague] } PlasmaRifle: { @@ -634,7 +639,7 @@ PlasmaRod: { ''' Casts a low-damage plasma bolt Shooting a tile will cause several bolts with increased damage to fire - Shooting an enemy will inflict shadowflame + Shooting an enemy will inflict [cbuff:CalamityMod/Shadowflame] ''' } @@ -648,8 +653,8 @@ PrimordialAncient: { Tooltip: ''' Casts five primordial sand blasts that converge at your cursor after a moment and create a giant explosion - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.AeolianEarthBuff.DisplayName} buff - The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/AeolianEarthBuff] buff + [cbuffplr:CalamityMod/AeolianEarthBuff] increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen ''' } @@ -658,8 +663,8 @@ PrimordialEarth: { Tooltip: ''' Casts two enchanted blasts of sand that converge with each other and explode - Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.SandsWindBuff.DisplayName} buff - The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen + Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the [cbuffplr:CalamityMod/SandsWindBuff] buff + [cbuffplr:CalamityMod/SandsWindBuff] increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' } @@ -709,7 +714,7 @@ RelicofRuin: { RougeSlash: { DisplayName: Rouge Slash - Tooltip: Fires a wave of 3 rouge air slashes + Tooltip: Fires a wave of 3 rouge air slashes that inflict [cbuff:CalamityMod/VermillionFlux] } SandstreamScepter: { @@ -727,7 +732,7 @@ SanguineFlare: { ''' Charges up a sanguine flare that gains power over time When striking an enemy, this flare causes a bloodsplosion and splits into blood orbs - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -781,7 +786,7 @@ SHPC: { {0} Press to use the machine as a vacuum, pulling in lingering souls Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in - Shift-Right Click this item in your inventory to eject the currently loaded Soul + Shift- this item in your inventory to eject the currently loaded Soul ''' // These are the soul effect descriptions, the number is the item ID of the soul NoSoul: "[c/808080:There is currently no soul type injected into the weapon]" @@ -822,7 +827,11 @@ SnowstormStaff: { SoulPiercer: { DisplayName: Soul Piercer - Tooltip: Casts a powerful ray that summons extra rays on its first hit + Tooltip: + ''' + Casts a powerful ray that summons extra rays on its first hit + Inflicts [cbuff:CalamityMod/GodSlayerInferno] + ''' } StaffofBlushie: { @@ -832,7 +841,7 @@ StaffofBlushie: { StarShower: { DisplayName: Star Shower - Tooltip: Casts a spread of astral stars from the sky that converge at the cursor + Tooltip: Casts a spread of astral stars from the sky that converge at the cursor and inflict [cbuff:CalamityMod/AstralInfectionDebuff] } SubsumingVortex: { @@ -844,6 +853,7 @@ SubsumingVortex: { When enemies are near the vortex, it sends multiple fast-moving smaller vortices towards them Releasing fires the vortex towards the mouse if enough time has passed Damage scales based on how long the vortex was held out + Inflicts [cbuff:CalamityMod/MiracleBlight] ''' } @@ -860,7 +870,7 @@ TacticiansTrumpCard: { DisplayName: Tactician's Trump Card Tooltip: ''' - Fires a sword beam that electrifies enemies on hit + Fires a sword beam that inflicts [cbuff:Electrified] on hit 'Faint memories of a Princess from the future cross your mind...' ''' } @@ -962,8 +972,8 @@ UnstableCastersGauntlet: { ''' [c/DBD7CA:Ordo] sigils always land critical strikes [c/ABB6D4:Perdito] sigils ignore 25 points of enemy defense - [c/E89B8E:Ignis] sigils inflict Daybroken - [c/8ECBE8:Aqua] sigils inflict Crush Depth + [c/E89B8E:Ignis] sigils inflict [cbuff:CalamityMod/Daybroken] + [c/8ECBE8:Aqua] sigils inflict [cbuff:CalamityMod/CrushDepth] [c/E1E88E:Aer] sigils boast substantial knockback [c/ACCF9F:Terra] sigils split into sharp rocks ''' @@ -1008,7 +1018,7 @@ Viscera: { ''' Fires a rapid barrage of piercing blood beams The first enemy struck by each beam will burst into blood orbs - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Each successive beam in the barrage deals more damage The last beam of the barrage instead explodes upon hitting an enemy ''' @@ -1018,8 +1028,8 @@ VitriolicViper: { DisplayName: Vitriolic Viper Tooltip: ''' - Charges up and fires a slithering beam of radiation - If fully charged, instead fires a huge spread of short range fangs which quickly vanish + Charges up and fires a slithering [cbuff:CalamityMod/Irradiated] beam + If fully charged, instead fires a huge spread of short range fangs which inflict [cbuff:CalamityMod/SulphuricPoisoning] ''' } @@ -1028,8 +1038,8 @@ VividClarity: { Tooltip: ''' Fires five randomized rays of exo-energy towards the cursor - On enemy and tile hits, beams either explode into a big flash, - summon an additional laser from the sky, or split into energy orbs + Enemy and tile hits either cause a big flash explosion, an additional laser from the sky, or split into energy orbs + Inflicts [cbuff:CalamityMod/MiracleBlight] 'Its majesty inspires a stroke of unparalleled genius' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index d0043441be..410a5c6147 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -166,7 +166,7 @@ BansheeHook: { Basher: { DisplayName: Basher - Tooltip: Swings a rotten club that irradiates enemies on hit while knocking you back in the process + Tooltip: Swings a rotten club that inflicts [cbuff:CalamityMod/Irradiated] while knocking you back in the process } BladecrestOathsword: { @@ -191,7 +191,11 @@ BlightedCleaver: { Bonebreaker: { DisplayName: Bonebreaker - Tooltip: Fires javelins that stick to enemies before bursting into shrapnel + Tooltip: + ''' + Fires javelins that stick to enemies before bursting into shrapnel + Javelins cause [cbuff:CalamityMod/HeavyBleeding], [cbuff:Venom], and [cbuff:CalamityMod/ArmorCrunch] + ''' } BotanicPiercer: { @@ -266,7 +270,7 @@ Carnage: { CelestialClaymore: { DisplayName: Celestial Claymore - Tooltip: Spawns cosmic energy stars near the cursor that inflict several debuffs + Tooltip: Spawns cosmic energy stars near the cursor that inflict [cbuff:Frostburn2], [cbuff:OnFire3], or [cbuff:Ichor] } ClamCrusher: { @@ -287,8 +291,8 @@ CosmicDischarge: { DisplayName: Cosmic Discharge Tooltip: ''' - Striking an enemy with the whip causes glacial explosions and grants the player the cosmic freeze buff - This buff gives the player +2 HP/s life regen while standing still and freezes enemies near the player + Striking an enemy with the whip causes glacial explosions and grants the player the [cbuffplr:CalamityMod/CosmicFreeze] buff + [cbuffplr:CalamityMod/CosmicFreeze] gives the player +2 HP/s life regen while standing still and freezes enemies near the player ''' } @@ -400,7 +404,7 @@ DragonRage: { DisplayName: Dragon Rage Tooltip: ''' - Twirls a baton that causes explosions on enemy hits + Twirls a baton that causes explosions of [cbuff:CalamityMod/Dragonfire] on enemy hits Every ten hits will summon a ring of fireballs ''' } @@ -416,7 +420,7 @@ Earth: { ''' A beautiful prismatic blade with unrivaled close combat proficiency Heals you greatly on hit - Every other swing will summon three Gaia meteors to fall upon nearby enemies + Every other swing will summon three Gaia meteors to annihilate nearby enemies with [cbuff:CalamityMod/MiracleBlight] 'All Its spawn shall know the beauty and wrath of their creator' ''' } @@ -426,7 +430,7 @@ EarthenPike: { Tooltip: ''' Sprays fossil shards on swing - Crushes enemy defenses + Inflicts [cbuff:CalamityMod/ArmorCrunch] ''' } @@ -457,7 +461,7 @@ EvilSmasher: { Channels a powerful hammer strike with the capability to crush all evil Striking a tile with the hammer strike will cause an explosion and push you back Striking enemies inflicts [cbuff:CalamityMod/SmashedEvil] on both the user and target - Charging strikes increases damage, explosion radius, and [cbuff:CalamityMod/SmashedEvil] duration + Charging strikes increases damage, explosion radius, and [cbuffplr:CalamityMod/SmashedEvil] duration 'EViL! sMaSH eVIl! SmAsh... ER!' ''' //All damage and kill dialogue has the capitalization randomized when said @@ -498,6 +502,7 @@ Exoblade: { Enemy hits from the blade during the dash result in massive damage and a rebound Press immediately after a rebound to perform a powerful slash Powerful slashes are larger, heal you, and create a large explosion + Inflicts [cbuff:CalamityMod/MiracleBlight] ''' } @@ -664,18 +669,16 @@ GrandDad: { TooltipNormal: ''' An unfathomably heavy blade that rips through enemies using its sheer mass - Heals you on hit - Striking weaker enemies will launch them with incredible force - Launched enemies take immense damage when colliding with walls and floors - Holding while swinging will heavily reduce the damage of the blade and increase its launch damage and velocity + Provides healing over time to you and all nearby allies on hit + Striking low health enemies will launch them with incredible force + Launched enemies are killed instantly on impact with walls and floors [c/00B8DF:'How are you swinging something that has half the mass of a star?'] ''' TooltipGFB: ''' A high quality blade that rips through enemies - Striking weaker enemies will yeet them with incredible force, often leaving them Stuck Inside tiles + Striking low health enemies will yeet them with incredible force, nice >:] Yeeted enemies will turn to JAM when SLAMMED into walls and floors - Holding while swinging will heavily reduce the damage of the blade and increase its yeet damage and velocity, nice >:] [c/00B8DF:'Please read the weapon description.'] ''' } @@ -762,7 +765,7 @@ InsidiousImpaler: { DisplayName: Insidious Impaler Tooltip: ''' - Throws self-propelling radioactive harpoons which chase foes + Throws self-propelling radioactive harpoons which chase foes and cause [cbuff:CalamityMod/SulphuricPoisoning] Harpoons ricochet at close range for additional hits ''' } @@ -775,7 +778,7 @@ Lacerator: { Striking enemies conjures a bloody saw to shred them The saw does more damage the more often the yoyo hits, and fades away when not striking enemies Enemies touching the edge of the sawblade get blood orbs torn out of them - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] The direction of the saw's spin depends on which direction you originally threw the yoyo [GFB] ''' @@ -793,7 +796,7 @@ Lightspeed: { Tooltip: ''' [c/c7f5ff:Unleash a flurry of stabs which build Elemental Mastery on hit] - [c/c2fff2:Elemental Mastery is lost over time but briefly stops depleting after reaching its maximum] + [c/c2fff2:Elemental Mastery is lost over time if it has not been gained for a few seconds] [c/ffdfba:Press with maximum Elemental Mastery to dash toward your cursor] [c/ffc7c7:Hitting an enemy during the dash refunds some Elemental Mastery] ''' @@ -815,7 +818,7 @@ Lucrecia: { ''' [c/9370db:Fires a spiraling darklight shard when swung] [c/837ce4:Hits with the blade itself build Darklight Energy] - [c/7489ee:Darklight Energy is lost over time but briefly stops depleting after reaching its maximum] + [c/7489ee:Darklight Energy is lost over time if it has not been gained for a few seconds] [c/6495f7:Press with maximum energy to fire a double helix comet] ''' } @@ -846,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 ''' } @@ -875,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: { @@ -896,14 +899,14 @@ Murasama: { MycelialClaws: { DisplayName: Mycelial Claws - Tooltip: Grants the Mushy buff for 6 seconds on enemy hits + Tooltip: Grants the [cbuffplr:CalamityMod/Mushy] buff for 6 seconds on enemy hits } Nadir: { DisplayName: Nadir Tooltip: ''' - Fires void essences which flay nearby enemies with tentacles + Fires void essences which flay nearby enemies with [cbuff:CalamityMod/Voidfrost] tentacles 'The abyss has stared back at you long enough. It now speaks, and it does not speak softly' ''' } @@ -933,7 +936,7 @@ Oblivion: { OldLordClaymore: { DisplayName: Old Lord Claymore - Tooltip: A slow but powerful blade that sets enemies ablaze and has substantial knockback + Tooltip: A slow but powerful blade that lights enemies with [cbuff:OnFire3] and has substantial knockback HoldShiftTooltip: ''' [c/df4420:A gift to outstanding Demons, a replica of the sword used by the greatest of all Demon Lords.] @@ -1014,7 +1017,7 @@ PhotonRipper: { DisplayName: Photon Ripper Tooltip: ''' - Projects a directed stream of hardlight teeth at ultra high velocity + Projects a directed stream of hardlight teeth at ultra high velocity which cause [cbuff:CalamityMod/MiracleBlight] This weapon and its projectiles function as a chainsaw Press to use without chopping down trees ''' @@ -1062,7 +1065,8 @@ RemsRevenge: { DisplayName: Rem's Revenge Tooltip: ''' - Summons blood explosions and lowers enemy defense by {0} on hit + Summons blood explosions and inflicts [cbuff:CalamityMod/WitherDebuff] on hit + [cbuff:CalamityMod/WitherDebuff] lowers enemy defense by {0} 'A deadly morning star befitting its demonic owner' ''' } @@ -1112,7 +1116,7 @@ SaharaSlicers: { SausageMaker: { DisplayName: Sausage Maker - Tooltip: Sprays homing blood on hit + Tooltip: Sprays homing blood and causes [cbuff:CalamityMod/BurningBlood] on hit } ScourgeoftheCosmos: { @@ -1165,7 +1169,7 @@ SolsticeClaymore: { Tooltip: ''' Changes projectile color based on the time of year - Inflicts daybroken during the day and nightwither during the night + Inflicts [cbuff:CalamityMod/Daybroken] during the day and [cbuff:CalamityMod/Nightwither] during the night ''' } @@ -1174,7 +1178,7 @@ SoulHarvester: { Tooltip: ''' Shoots a soul scythe - Enemies explode when on low health, spreading the plague + Enemies explode when on low health, spreading the [cbuff:CalamityMod/Plague] ''' } @@ -1274,12 +1278,12 @@ Swordsplosion: { TaintedBlade: { DisplayName: Tainted Blade - Tooltip: Inflicts poison on enemy hits + Tooltip: Inflicts [cbuff:Poisoned] on enemy hits } TeardropCleaver: { DisplayName: Teardrop Cleaver - Tooltip: Makes your enemies cry + Tooltip: Gives your enemies [cbuff:CalamityMod/TemporalSadness] } TenebreusTides: { @@ -1316,7 +1320,7 @@ TheBurningSky: { DisplayName: The Burning Sky Tooltip: ''' - Rains down a stream of draconic fire at the cursor + Rains down a stream of [cbuff:CalamityMod/Dragonfire] at the cursor 'Hold the blade to the sky, and witness Armageddon' ''' } @@ -1365,7 +1369,7 @@ TheMutilator: { ''' Striking enemies empowers The Mutilator, increasing its damage At full charge, striking enemies causes a blood orb explosion - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -1376,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 } @@ -1385,7 +1389,7 @@ TheOracle: { Tooltip: ''' {$Common.YoyoStatsInfinite} - Emits an aura of lightning which charges up when hitting enemies + Emits an aura of [cbuff:CalamityMod/AuricRebuke] lightning which charges up when hitting enemies Fires auric orbs when supercharged 'Gaze into the past, the present, the future... and the circumstances of your inevitable demise' ''' @@ -1450,7 +1454,7 @@ TrueCausticEdge: { Tooltip: ''' Fires a bouncing caustic beam - Inflicts acid venom and slows down on enemy hits + Inflicts [cbuff:Venom] and slows down on enemy hits ''' } @@ -1514,13 +1518,13 @@ Violence: { ''' A demonic pitchfork, cursed to cause endless bloodshed commands the trident to follow your cursor and shred enemies with devastating speed - throws the trident, violently tearing through enemies with immense power and inflicting Vulnerability Hex + throws the trident, violently tearing through enemies with immense power and inflicting [cbuff:CalamityMod/VulnerabilityHex] ''' } Virulence: { DisplayName: Virulence - Tooltip: Fires a plague cloud + Tooltip: Fires a [cbuff:CalamityMod/Plague] cloud } VoidEdge: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 5a5f9f648a..ea08fee912 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -33,7 +33,7 @@ AngelicShotgun: { DisplayName: Angelic Shotgun Tooltip: ''' - Each shot casts a radiant beam of holy light from the sky + Each shot casts a radiant beam of [cbuff:CalamityMod/HolyFlames] from the sky Musket balls convert into hallow-point rounds which also empower the beam 'Fighting 'til the war's won' ''' @@ -45,8 +45,8 @@ Animosity: { Tooltip: "[GFB]" TooltipNormal: ''' - Fires a shotgun blast with a tight spread which is imbued with Brimstone Flames - Press to fire a powerful brimstone round that inflicts Whispering Death + Fires a shotgun blast with a tight spread which is imbued with [cbuff:CalamityMod/BrimstoneFlames] + Press to fire a powerful brimstone round that causes enemies to become [cbuff:CalamityMod/MarkedforDeath] ''' TooltipGFB: ''' @@ -109,7 +109,7 @@ ArterialAssault: { ''' Fires a group of 5 homing blood arrows These blood arrows burst into blood orbs upon striking an enemy - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] ''' } @@ -127,7 +127,7 @@ Auralis: { DisplayName: Auralis Tooltip: ''' - Fires a high speed glowing bullet that reduces enemy protection + Fires a high speed glowing bullet that inflicts [cbuff:CalamityMod/MarkedforDeath] Press to zoom out Standing still provides increasing damage bonuses up to 25% Standing still for 5 or more seconds while using the scope ability will summon an aurora @@ -171,7 +171,7 @@ BlightSpewer: { DisplayName: Blight Spewer Tooltip: ''' - Fires clouds of plague nanomachines that stick to tiles + Fires clouds of [cbuff:CalamityMod/Plague] nanomachines that stick to tiles Nanomachines aggressively lock onto nearby enemies {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -182,7 +182,7 @@ BlissfulBombardier: { Tooltip: ''' Launches a crystalline missile high into the sky, raining holy fire on the cursor - The missile relentlessly seeks out a target before bursting into a massive explosion + The missile relentlessly seeks out a target before bursting into a massive [cbuff:CalamityMod/HolyFlames] explosion ''' } @@ -191,7 +191,7 @@ BloodBoiler: { Tooltip: ''' Fires twin streams of bloodfire that returns to you - Returning bloodfire reduces [cbuff:PotionSickness] if it struck an enemy + Returning bloodfire reduces [cbuffplr:PotionSickness] if it struck an enemy Uses your health as ammo 20% chance to save health ''' @@ -236,7 +236,7 @@ Buzzkill: { Tooltip: ''' Hold to rev up a buzzsaw that deals close-range damage - Release to fire the buzzsaw, which bounces off tiles and lacerates foes + Release to fire the buzzsaw, which bounces off tiles and causes [cbuff:CalamityMod/HeavyBleeding] in foes Revving up the saws increases their damage and allows them to pierce more enemies 'Not to be confused with the Sawed-On Shotgun' ''' @@ -244,7 +244,7 @@ Buzzkill: { ChickenCannon: { DisplayName: Chicken Cannon - Tooltip: Fires chicken flares which create enormous incendiary explosions + Tooltip: Fires chicken flares which create enormous incendiary explosions of [cbuff:CalamityMod/Dragonfire] } ChromaticEruption: { @@ -266,7 +266,7 @@ CleansingBlaze: { DisplayName: Cleansing Blaze Tooltip: ''' - Unleashes a torrent of flames which can pass through tiles + Unleashes a torrent of [cbuff:CalamityMod/GodSlayerInferno] flames which can pass through tiles Uses gel for ammo ''' } @@ -286,7 +286,6 @@ Condemnation: { ''' Fires powerful scarlet bolts suffused with hateful magics Hold to load up to nine bolts for powerful burst fire - Hold to use the repeater full auto ''' } @@ -328,7 +327,7 @@ CorinthPrime: { CorrodedCaustibow: { DisplayName: Corroded Caustibow - Tooltip: Converts wooden arrows into slow, powerful shells that trail an irradiated aura + Tooltip: Converts wooden arrows into slow, powerful shells that trail an [cbuff:CalamityMod/Irradiated] aura } CrackshotColt: { @@ -384,9 +383,9 @@ DragonsBreath: { DisplayName: Dragon's Breath Tooltip: ''' - Fires dragon fireballs at an accelerating pace + Fires [cbuff:CalamityMod/Dragonfire] fireballs at an accelerating pace Upon firing for long enough, you will begin using a cartridge of energy - While using a cartridge you will shoot a draconic beam of fire that doesn't consume ammo + While using a cartridge you will shoot a draconic beam of [cbuff:CalamityMod/Dragonfire] that doesn't consume ammo Once a cartridge has been ejected you will return to the original fire rate {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -416,7 +415,7 @@ EternalBlizzard: { Eviscerator: { DisplayName: Eviscerator - Tooltip: Converts musket balls into fast-moving blood clots + Tooltip: Converts musket balls into fast-moving blood clots that cause [cbuff:CalamityMod/BurningBlood] } FetidEmesis: { @@ -426,7 +425,6 @@ FetidEmesis: { Fires an accelerating stream of bullets until the barrel overheats When the barrel overheats, a spread of fetid chunks is vomited out After firing, the gun must cool back down before it can be used again - Pressing while firing will instantly launch the chunks {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -554,7 +552,7 @@ HavocsBreath: { DisplayName: Havoc's Breath Tooltip: ''' - Projects cone-shaped blasts of scorching brimstone fire + Projects cone-shaped blasts of scorching [cbuff:CalamityMod/BrimstoneFlames] Uses gel for ammo ''' } @@ -563,7 +561,7 @@ HeavenlyGale: { DisplayName: Heavenly Gale Tooltip: ''' - Fires a rapid stream of supercharged exo-crystals + Fires a rapid stream of supercharged exo-crystals that inflict [cbuff:CalamityMod/MiracleBlight] Holding the bow and waiting for some time before firing causes the crystals to become more powerful If the crystals are sufficiently powerful enough they will summon torrents of exo-lightning above whatever target they hit ''' @@ -603,10 +601,10 @@ Hydra: { DisplayName: Hydra Tooltip: ''' - Fires a spread of 4 toxic 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,8 +614,8 @@ Infinity: { Tooltip: ''' Fires a twin stream of energy bolts that split - Press to fire a barrage of normal bullets - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'They say infinity is neverending, yet you hold it in your hands' ''' } @@ -633,7 +631,7 @@ Kingsbane: { ''' After revving up, rapidly fire bullets When you stop firing you will release a barrage of auric bullets - Auric bullets aggressively home in on enemies and ignore 50 points of defense + Auric bullets aggressively home in on enemies, ignore 50 points of defense, and inflict [cbuff:CalamityMod/AuricRebuke] Constantly consumes ammo while in use {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -644,7 +642,7 @@ Leviatitan: { Tooltip: ''' Fires high velocity aqua blasts - Releases homing aberrations that shred enemy defense every six shots + Releases homing aberrations that cause [cbuff:CalamityMod/ArmorCrunch] every six shots to vomit a meteor that explodes on hit 'The L in LMG stands for Leviathan' ''' @@ -684,7 +682,7 @@ MagnomalyCannon: { DisplayName: Magnomaly Cannon Tooltip: ''' - Launches a powerful exo rocket to nuke anything and everything + Launches a powerful exo rocket to nuke anything and everything with [cbuff:CalamityMod/MiracleBlight] Rockets are surrounded by an invisible damaging aura and split into damaging beams on hit {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -695,7 +693,7 @@ Malevolence: { Tooltip: ''' Fires two arrows at once - Converts wooden arrows into plague arrows that explode into bees + Converts wooden arrows into [cbuff:CalamityMod/Plague] arrows that explode into bees ''' } @@ -885,14 +883,14 @@ PearlGod: { PestilentDefiler: { DisplayName: Pestilent Defiler - Tooltip: Converts musket balls into plague rounds that explode and split apart on hit + Tooltip: Converts musket balls into [cbuff:CalamityMod/Plague] rounds that explode and split apart on hit } Photoviscerator: { DisplayName: Photoviscerator Tooltip: ''' - Emits a continuous beam of exo radiation that disintegrates everything + Emits a continuous beam of [cbuff:CalamityMod/MiracleBlight] radiation that disintegrates everything Press to fire homing exo flares which stick to and incinerate enemies Uses gel for ammo The beam has a {0}% chance to save ammo @@ -903,7 +901,7 @@ PlagueTaintedSMG: { DisplayName: Plague Tainted SMG Tooltip: ''' - Shoots plague bullets that spawn drones on critical hits + Shoots [cbuff:CalamityMod/Plague] bullets that spawn drones on critical hits Bullets deal more damage and knockback the closer the enemy is Drones have a much higher crit chance upon hitting a plagued enemy Press to fire a drone swarm @@ -926,12 +924,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' ''' @@ -942,7 +942,7 @@ PridefulHuntersPlanarRipper: { Tooltip: ''' Every fourth shot deals 135% damage - Converts musket balls into lightning bolts + Converts musket balls into [cbuff:Electrified] lightning bolts Lightning bolts travel extremely fast and explode on enemy kills Lightning bolt crits grant a stacking speed boost to the player This stacks up to 20 percent bonus movement speed and acceleration @@ -955,7 +955,7 @@ PristineFury: { DisplayName: Pristine Fury Tooltip: ''' - Fires an intense helix of flames that burst into a column of smoke + Fires an intense helix of [cbuff:CalamityMod/HolyFlames] that burst into a column of smoke to disperse a limited supply of flammable crystalline powder that restores over time Powder can be ignited, causing it to explode for extra damage Both helix flames and other nearby explosions can ignite the powder @@ -1078,7 +1078,7 @@ SepticSkewer: { Tooltip: ''' Launches a vile chained harpoon infested with toxins - Harpoons stick into enemies and inflict Sulphuric Poisoning for a long time + Harpoons stick into enemies and inflict [cbuff:CalamityMod/SulphuricPoisoning] for a long time After being impaled for one second, harpoons rip themselves back out and spray damaging gores Press to manually rip out all harpoons, dealing bonus damage Enemies close to death are dragged back with returning harpoons and executed when they reach you @@ -1090,7 +1090,7 @@ Shadethrower: { DisplayName: Shadethrower Tooltip: ''' - Spits clouds of shade which afflict enemies with brain rot + Spits clouds of shade which afflict enemies with [cbuff:CalamityMod/BrainRot] Uses gel for ammo ''' } @@ -1121,7 +1121,6 @@ Shredder: { Tooltip: ''' Fires a barrage of energy bolts that split and bounce - Press to fire a barrage of normal bullets instead 'The myth, the legend, the weapon that drops more frames than any other' ''' } @@ -1151,10 +1150,10 @@ SomaPrime: { Tooltip: ''' This weapon can supercrit if its crit chance is over 100% - All bullets fired have a 5% chance to inflict Shred, a stacking bleed debuff - Critical strikes deal 3x damage instead of 2x by default and have a 30% chance to inflict Shred - Shred deals 600 DPS per stack and scales with your ranged stats - Damage ticks of Shred can critically strike for 3x damage and can supercrit + All bullets fired have a 5% chance to inflict [cbuff:CalamityMod/Shred], a stacking bleed debuff + Critical strikes deal 3x damage instead of 2x by default and have a 30% chance to inflict [cbuff:CalamityMod/Shred] + [cbuff:CalamityMod/Shred] deals 600 DPS per stack and scales with your ranged stats + Damage ticks of [cbuff:CalamityMod/Shred] can critically strike for 3x damage and can supercrit Replaces musket balls with enhanced High Velocity Bullets {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' @@ -1264,7 +1263,7 @@ SulphuricAcidCannon: { Tooltip: ''' Fires homing Acid Rockets - Acid Rockets stick to enemies and explode into toxic mist after a short delay + Acid Rockets stick to enemies and explode into [cbuff:CalamityMod/SulphuricPoisoning] mist after a short delay ''' } @@ -1280,6 +1279,7 @@ SuperradiantSlaughterer: { ''' Hold to rev up an elemental buzzsaw that deals close-range damage Release to fire the buzzsaw which bounces off tiles, releasing homing bolts when returning depending on hits + Buzzsaws inflict [cbuff:CalamityMod/ElementalMix] and [cbuff:CalamityMod/Laceration] Revving up the saw increases its damage and allows it to pierce more enemies ''' AltInfo: @@ -1304,8 +1304,8 @@ Svantechnical: { Tooltip: ''' Fires a trinity of energy bolts that split into beams that track your cursor - Press to fire a barrage of normal bullets - {$CommonItemTooltip.PercentChanceToSaveAmmo} + {$Common.ArmorPenetration} + {$CommonItemTooltip.PercentChanceToSaveAmmo@1} 'The age old balance of trading damage for frames' ''' } @@ -1335,7 +1335,7 @@ TelluricGlare: { TheBallista: { DisplayName: The Ballista - Tooltip: Converts wooden arrows into greatarrows that crush enemy armor and break into shards + Tooltip: Converts wooden arrows into greatarrows that cause [cbuff:CalamityMod/ArmorCrunch] and break into shards } TheBlunderbass: { @@ -1351,9 +1351,9 @@ TheHive: { DisplayName: The Hive Tooltip: ''' - Launches a wide spread of 4 missiles that explode on contact with enemies and tiles + Launches a wide spread of 4 [cbuff:CalamityMod/Plague] missiles that explode on contact with enemies and tiles Charging the launcher decreases the spread and increases the velocity of the missile barrage - Fully charging the launcher will cause it to fire a nuke to decimate a massive area on impact + Fully charging the launcher will cause it to fire a [cbuff:CalamityMod/Plague] nuke to decimate a massive area on impact ''' } @@ -1364,7 +1364,7 @@ TheJailor: { TheMaelstrom: { DisplayName: The Maelstrom - Tooltip: Fires charged Reaper Sharks that explode into water + Tooltip: Fires charged Reaper Sharks that cause [cbuff:CalamityMod/HadopelagicPressure] water explosions } ThePack: { @@ -1376,7 +1376,7 @@ ThermoclineBlaster: { DisplayName: Thermocline Blaster Tooltip: ''' - Alternates between firing bullets imbued with fire and ice + Alternates between firing bullets imbued with [cbuff:OnFire3] and [cbuff:Frostburn2] Any bullet type can be imbued when fired from this gun ''' } @@ -1387,8 +1387,6 @@ TheSevensStriker: { ''' Press to consume 1 coin and play a slot machine The quality of the outcome depends on the coin used - Press to rapidly fire a barrage of coins - The coin barrage has an {0}% chance to save ammo and will not fire platinum coins 'A gun given to a great gunslinger Forged by the arms of a man given no name' ''' @@ -1408,9 +1406,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 ''' } @@ -1426,7 +1424,7 @@ TitaniumRailgun: { Toxibow: { DisplayName: Toxibow - Tooltip: Converts wooden arrows into slow arrows that inflict irradiated + Tooltip: Converts wooden arrows into slow arrows that inflict [cbuff:CalamityMod/Irradiated] } TyrannysEnd: { @@ -1434,7 +1432,7 @@ TyrannysEnd: { Tooltip: ''' Converts musket balls into .70 caliber sniper rounds that deal devastating damage - Inflicts Marked for Death on enemy hits and bypasses defense + Inflicts [cbuff:CalamityMod/MarkedforDeath] on enemy hits and bypasses defense Critical hits summon a swarm of 6 additional bullets 'Pierce the heart of even the most heavily-armored foe' ''' @@ -1445,8 +1443,7 @@ Ultima: { Tooltip: ''' Casts a continuous stream of plasma bolts - Over time the bolts are replaced with powerful lasers - Bolts power up into solid beams as you continue shooting + Over time bolts power up into solid beams that inflict [cbuff:CalamityMod/ElementalMix] as you continue shooting {$CommonItemTooltip.PercentChanceToSaveAmmo} ''' } @@ -1474,7 +1471,7 @@ Voidragon: { DisplayName: Voidragon Tooltip: ''' - Fires void blasts that explode every other shot + Fires [cbuff:CalamityMod/Voidfrost] blasts that explode every other shot Shoots demon flame tentacles alongside every shot Void blasts consume no ammo and bullets have a {0}% chance to save ammo ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 2f8e923e30..cb3588e998 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -47,8 +47,8 @@ BallisticPoisonBomb: { DisplayName: Ballistic Poison Bomb Tooltip: ''' - Throws a sticky bomb that explodes into spikes and venomous clouds - Stealth strikes erupt into more clouds with a longer lasting venom + Throws a sticky bomb that explodes into spikes and [cbuff:Venom] clouds + Stealth strikes erupt into more clouds with a longer lasting [cbuff:Venom] ''' } @@ -79,7 +79,7 @@ BloodsoakedCrasher: { Throws a bloody axe that is affected by gravity and can bounce twice The axe speeds up over time, but will slow down upon hitting an enemy Spews blood orbs upon enemy hits - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Stealth strikes spawn homing blood bolts on hit ''' } @@ -107,7 +107,7 @@ BurningStrife: { DisplayName: Burning Strife Tooltip: ''' - Throws a shadowflame spiky ball that explodes into flames + Throws a [cbuff:CalamityMod/Shadowflame] spiky ball that explodes into flames Stealth strikes make the ball erupt into tentacles on hit 'Definitely not pocket safe' ''' @@ -157,7 +157,7 @@ ContaminatedBile: { DisplayName: Contaminated Bile Tooltip: ''' - Throws a flask of irradiated bile which shatters and lingers in a cloud + Throws a flask of [cbuff:CalamityMod/Irradiated] bile which shatters and lingers in a cloud Stealth strikes cause sulphuric bubbles to quickly rise from the cloud ''' } @@ -259,8 +259,8 @@ CursedDagger: { DisplayName: Cursed Dagger Tooltip: ''' - Throws a fast cursed dagger and two inaccurate weaker daggers - Stealth strikes throw a single dagger that bursts into a vortex of cursed flames + Throws a fast cursed dagger and two inaccurate weaker daggers that inflict [cbuff:CursedInferno] + Stealth strikes throw a single dagger that bursts into a [cbuff:CursedInferno] vortex ''' } @@ -278,7 +278,7 @@ DeepWounder: { DisplayName: Deep Wounder Tooltip: ''' - Throws an abyssal hatchet that inflicts Heavy Bleeding and Crush Depth to the enemies it hits + Throws an abyssal hatchet that inflicts [cbuff:CalamityMod/HeavyBleeding] and [cbuff:CalamityMod/CrushDepth] to the enemies it hits Stealth strikes cause the hatchet to stick to struck enemies, releasing a barrage of water projectiles Water projectiles launch at the closest enemy after a brief delay ''' @@ -299,7 +299,7 @@ DesecratedWater: { Tooltip: ''' Throws an unholy flask of water that explodes into an explosion of evil bubbles - Stealth strikes spawn additional bubbles that inflict Ichor and Cursed Inferno + Stealth strikes spawn additional bubbles that inflict [cbuff:Ichor] and [cbuff:CursedInferno] ''' } @@ -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] ''' } @@ -360,9 +360,11 @@ EclipsesFall: { DisplayName: Eclipse's Fall Tooltip: ''' - Summons spears from the sky on hit - Stealth strikes impale enemies and summon a constant barrage of spears over time - 'When the sun goes dark, you will know judgement' + Throws a javelin that shatters into fragments of primordial light upon enemy hits + If more than 20 fragments exist, the oldest fragments will seek out enemies to attack + Stealth strikes coalesce fragments into [ceffect/darksun:Spear of Obscuration], gaining power based on the number of fragments + [ceffect/darksun:Spear of Obscuration] will pierce though any enemy hit by Eclipse's Fall + [ceffect/darksun:'When the sun goes dark, all will know terror'] ''' } @@ -380,7 +382,7 @@ EpidemicShredder: { DisplayName: Epidemic Shredder Tooltip: ''' - Throws a plagued boomerang that releases plague seekers when it hits tiles or enemies + Throws a [cbuff:CalamityMod/Plague] boomerang that releases plague seekers when it hits tiles or enemies Stealth strikes cause the boomerang to release plague seekers constantly as it travels Contrary to its name, it will probably cause an epidemic if used incorrectly ''' @@ -390,7 +392,7 @@ Equanimity: { DisplayName: Equanimity Tooltip: ''' - Throws a confusing boomerang that ricochets between enemies + Throws a boomerang that ricochets between enemies and makes them [cbuff:Confused] Enemy hits alternate summoning homing light shards or piercing dark shards Stealth strikes cause an alternating explosion of light or dark on every ricochet, empowering the opposite color of shard ''' @@ -400,7 +402,7 @@ ExecutionersBlade: { DisplayName: Executioner's Blade Tooltip: ''' - Throws a stream of homing blades + Throws a stream of homing blades that inflict [cbuff:CalamityMod/GodSlayerInferno] Stealth strikes summon a guillotine of blades on hit ''' } @@ -479,7 +481,7 @@ GelDart: { DisplayName: Gel Dart Tooltip: ''' - Throws bouncing gel darts that cover struck enemies in slime + Throws bouncing gel darts that cover enemies in [cbuff:Slimed] Stealth strikes ignore gravity, bounce more vigorously, and constantly leak slime ''' } @@ -539,7 +541,7 @@ GraveGrimreaver: { Hurls a cursed scythe which homes in The scythe summons skulls as it flies and explodes into bats on hit Stealth strikes spawn a flood of bats and falling skulls when destroyed - Inflicts cursed flames and confusion + Inflicts [cbuff:CursedInferno] and [cbuff:Confused] 'A dapper skeleton's weapon of choice' ''' } @@ -595,7 +597,7 @@ IchorSpear: { DisplayName: Ichor Spear Tooltip: ''' - Throws a high-velocity ichor tipped javelin that pierces through enemies + Throws a high-velocity [cbuff:Ichor] tipped javelin that pierces through enemies Stealth strikes impale enemies and deal repeated damage ''' } @@ -614,7 +616,7 @@ InfestedClawmerang: { Tooltip: ''' Fires a slow, long-ranged boomerang - Stealth strikes grant the Mushy buff to the user on enemy hits and summon homing spores + Stealth strikes grant the [cbuffplr:CalamityMod/Mushy] buff to the user on enemy hits and summon homing spores ''' } @@ -631,9 +633,9 @@ JawsOfOblivion: { DisplayName: Jaws of Oblivion Tooltip: ''' - Throws a tight spread of six venomous reaper teeth that stick in enemies - This venom can stack when more teeth are stuck in an enemy - Stealth strikes cause the teeth to emit a crushing shockwave on impact + Throws a tight spread of six reaper teeth with [cbuff:Venom] that stick in enemies + The [cbuff:Venom] can stack when more teeth are stuck in an enemy + Stealth strikes cause the teeth to emit a crushing [cbuff:CalamityMod/HadopelagicPressure] shockwave on impact 'You're gonna need a bigger boat' ''' } @@ -690,8 +692,8 @@ Lionfish: { DisplayName: Lionfish Tooltip: ''' - Sticks to enemies and injects a potent venom - This venom can stack when more lionfish are stuck in an enemy + Sticks to enemies and injects a potent [cbuff:Venom] + The [cbuff:Venom] can stack when more lionfish are stuck in an enemy Stealth strikes spawn homing urchin spikes as they travel ''' } @@ -700,7 +702,7 @@ LunarKunai: { DisplayName: Lunar Kunai Tooltip: ''' - Throws out a set of three kunai that ignore gravity and slightly home in on enemies + Throws out a set of three kunai that ignore gravity and slightly home in on enemies, inflicting [cbuff:CalamityMod/Nightwither] After traveling enough distance, the kunai supercharge with lunar energy, homing in far more aggressively and exploding on impact Stealth strikes instantly throw ten supercharged Kunai ''' @@ -710,7 +712,7 @@ Malachite: { DisplayName: Malachite Tooltip: ''' - Throws a stream of kunai that stick to enemies and explode + Throws a stream of kunai that stick to enemies and explode into [cbuff:CalamityMod/Plague] Press to throw a single kunai that pierces, after piercing an enemy it emits a massive explosion on the next enemy hit Stealth strikes fire three kunai that home in, stick to enemies, and explode ''' @@ -764,7 +766,7 @@ MoltenAmputator: { Throw a spinning scythe that lingers at your cursor to recall all existing scythes Recalling a scythe while it's on an enemy rends them for massive damage - with sufficient stealth to empower yourself, greatly increasing attack speed for a short time + with sufficient stealth to empower the next {0} scythes and greatly increase attack speed You cannot recall scythes thrown while empowered ''' } @@ -775,13 +777,13 @@ Mycoroot: { ''' Fires a stream of short-range fungal roots Stealth strikes spawn an explosion of fungi spores - This grants you and nearby players on your team the Mushy buff for 15 seconds + This grants you and nearby players on your team the [cbuffplr:CalamityMod/Mushy] buff for 15 seconds ''' } MythrilKnife: { DisplayName: Mythril Knife - Tooltip: Stealth strikes are coated in deadly toxins, inflicting irradiated, poison, and acid venom + Tooltip: Stealth strikes are coated in deadly toxins, inflicting [cbuff:CalamityMod/Irradiated], [cbuff:Poisoned], and [cbuff:Venom] } NanoblackReaper: { @@ -849,7 +851,7 @@ Plaguenade: { DisplayName: Plaguenade Tooltip: ''' - Releases a swarm of angry plague bees + Releases a swarm of angry [cbuff:CalamityMod/Plague] bees Stealth strikes spawn more bees and generate a larger explosion ''' } @@ -867,8 +869,10 @@ ProfanedPartisan: { DisplayName: Profaned Partisan Tooltip: ''' - Fires an unholy spear that explodes on enemy hits - Stealth strikes spawn smaller spears to fly along side it + Throws a profaned spear that splits into miniature spears upon hitting an enemy + Stealth strikes remain impaled in an enemy for 10 seconds + While an enemy is impaled, all spears that strike them instead shatter into exploding stars + Inflicts [cbuff:CalamityMod/HolyFlames] ''' } @@ -977,8 +981,8 @@ ScourgeoftheSeas: { DisplayName: Scourge of the Seas Tooltip: ''' - Snaps apart into irradiated clouds upon striking an enemy - Stealth strikes irradiate for longer and are additionally coated with venomous toxins + Snaps apart into [cbuff:CalamityMod/Irradiated] clouds upon striking an enemy + Stealth strikes cause a longer [cbuff:CalamityMod/Irradiated] and are additionally coated with [cbuff:Venom] ''' } @@ -1073,8 +1077,8 @@ SnapClam: { DisplayName: Snap Clam Tooltip: ''' - Can latch on enemies and deal damage over time - Stealth strikes throw five clams at once that cause increased damage over time + Can latch on enemies and inflict [cbuff:CalamityMod/SnapClamDebuff] + Stealth strikes throw five clams at once ''' } @@ -1091,9 +1095,10 @@ SpearofPaleolith: { DisplayName: Spear of Paleolith Tooltip: ''' - Throws an ancient spear that shatters enemy armor - Spears rain fossil shards as they travel - Stealth strikes travel slower but further, raining more fossil shards + Throws an ancient spear that shatters into fossil shards upon hitting an enemy + Stealth strikes remain impaled in the enemy for 10 seconds + While an enemy is impaled, all spears that strike them erupt into even more fossil shards + Inflicts [cbuff:CalamityMod/ArmorCrunch] ''' } @@ -1103,7 +1108,7 @@ SpentFuelContainer: { ''' Throws a fuel container with trace amounts of plutonium that causes a nuclear explosion The explosion does not occur if there are no tiles below it - Stealth strikes leave a lingering irradiated zone after the explosion dissipates + Stealth strikes leave a lingering [cbuff:CalamityMod/Irradiated] zone after the explosion dissipates 'War Never Changes' ''' } @@ -1112,7 +1117,7 @@ SporeKnife: { DisplayName: Spore Knife Tooltip: ''' - Throws an overgrown dagger that bursts into a cloud of poisonous spores + Throws an overgrown dagger that bursts into a cloud of [cbuff:Poisoned] spores Stealth strikes erupt into hungry homing buds that stick to enemies and gnaw them ''' } @@ -1142,7 +1147,7 @@ StormfrontRazor: { DisplayName: Stormfront Razor Tooltip: ''' - Throws a knife that summons lightning on hit + Throws a knife that summons [cbuff:CalamityMod/StaticDischarge] lightning on hit Stealth strikes cause the knife to be faster and summon multiple lightning bolts on hit [c/24C7F0:'Strike and stem the flow'] ''' @@ -1165,7 +1170,7 @@ Supernova: { Hold to generate stealth, or hold to toss the bomb without generating stealth Tosses a smart bomb that locks onto and tracks targets If no target is found it will return to you - Each bomb creates a miniature supernova that drags in weak enemies and chases strong enemies + Each bomb creates a miniature [cbuff:CalamityMod/MiracleBlight] supernova that drags in weak enemies and chases strong enemies Stealth strikes create a blast that shakes the foundations of reality itself ''' } @@ -1213,10 +1218,10 @@ TheOldReaper: { DisplayName: The Old Reaper Tooltip: ''' - Throws an irradiated scythe that cuts through enemies + Throws a [cbuff:CalamityMod/SulphuricPoisoning] scythe that cuts through enemies Deposits unstable isotopes on hit, which create delayed nuclear explosions when they decay Stealth strikes are thrown into the sky and fall upon enemies a few seconds later - On hit, stealth strikes create a focused deluge of acid rain + On hit, stealth strikes create a focused deluge of [cbuff:CalamityMod/SulphuricPoisoning] acid rain ''' } @@ -1225,8 +1230,8 @@ TheSyringe: { Tooltip: ''' Throws a high velocity syringe that increases damage as it travels - Shatters into glass and plague cinders on impact - Stealth strikes also shatter into plague bees + Shatters into glass and [cbuff:CalamityMod/Plague] cinders on impact + Stealth strikes also shatter into [cbuff:CalamityMod/Plague] bees 'I'm pretty sure this isn't healthy' ''' } @@ -1244,7 +1249,7 @@ TimeBolt: { DisplayName: Time Bolt Tooltip: ''' - Throws a temporal knife that distorts time around enemies + Throws a temporal knife that causes [cbuff:CalamityMod/TimeDistortion] around enemies Stealth strikes can hit more enemies and create a larger time field 'There should be no boundary to human endeavor' ''' @@ -1265,7 +1270,7 @@ TotalityBreakers: { Tooltip: ''' Explodes into highly flammable black tar - Black tar oils enemies and sets them alight + Black tar makes enemies [cbuff:Oiled] and lights them with [cbuff:OnFire3] Stealth strikes leak black tar as they fly 'I need a bigger breaker' ''' @@ -1275,8 +1280,8 @@ ToxicantTwister: { DisplayName: Toxicant Twister Tooltip: ''' - Throws a fan of four spinning disks that swirl around your cursor - Stealth strikes swirl in a wider range and create a vortex of toxic raindrops that home in on enemies + Throws a fan of four spinning disks that swirl around your cursor and inflict [cbuff:CalamityMod/SulphuricPoisoning] + Stealth strikes swirl in a wider range and create a vortex of [cbuff:CalamityMod/SulphuricPoisoning] raindrops that home in on enemies ''' } @@ -1294,7 +1299,7 @@ TwistingThunder: { DisplayName: Twisting Thunder Tooltip: ''' - Fires a lightning bolt to electrocute enemies + Fires an [cbuff:Electrified] lightning bolt to electrocute enemies The lightning bolt travels faster while it is raining Summons lightning from the sky on impact Stealth strikes summon more lightning and travel faster @@ -1305,9 +1310,9 @@ UrchinStinger: { DisplayName: Urchin Stinger Tooltip: ''' - Sticks into enemies and injects an extremely potent poison - Stealth strikes stick into and poison enemies for longer - Sticking seven stingers in an enemy with a stealth strike stuck in it spawns an irradiated blast + Sticks into enemies and injects an extremely potent [cbuff:Poisoned] effect + Stealth strikes stick into and make enemies [cbuff:Poisoned] for longer + Sticking seven stingers in an enemy with a stealth strike stuck in it spawns an [cbuff:CalamityMod/Irradiated] blast ''' } @@ -1315,8 +1320,8 @@ UtensilPoker: { DisplayName: Utensil Poker Tooltip: ''' - Fires utensils in bursts of three - Stealth strikes replace any utensil with a powerful butcher knife + Fires utensils in bursts of three that cause [cbuff:CalamityMod/HeavyBleeding] + Stealth strikes replace any utensil with a powerful butcher knife that causes [cbuff:CalamityMod/Laceration] 'Space chickens, that is all' ''' } @@ -1356,7 +1361,7 @@ WebBall: { DisplayName: Web Ball Tooltip: ''' - Throws a web-covered ball that covers enemies in cobwebs to slow them down + Throws a web-covered ball that gets enemies [cbuff:Webbed] and slows them down Stealth strikes slow enemies down longer ''' } @@ -1377,7 +1382,7 @@ Wrathwing: { DisplayName: Wrathwing Tooltip: ''' - Throws an agile, homing winged spear that constantly spits fire + Throws an agile, homing winged spear of [cbuff:CalamityMod/Dragonfire] that constantly spits fire Stealth strikes create an eruption of cinders on hit ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 2459dfcc26..d9d34f5463 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -73,7 +73,7 @@ AtlasMunitionsBeacon: { BelladonnaSpiritStaff: { DisplayName: Belladonna Spirit Staff - Tooltip: Summons a cute forest spirit that flings magical toxic petals + Tooltip: Summons a cute forest spirit that flings magical [cbuff:Poisoned] petals } BlackHawkRemote: { @@ -91,7 +91,7 @@ BorealisBomber: { Tooltip: ''' Summons aureus bombers to chase down your enemies - Aureus bombers explode violently on enemy impact + Aureus bombers explode violently on enemy impact, inflicting [cbuff:CalamityMod/AstralInfectionDebuff] Does not consume minion slots ''' } @@ -103,7 +103,7 @@ BrittleStarStaff: { Summons a small brittle starfish that will dash through enemies until it shatters Starfish will quickly regenerate after shattering Holding will swap starfish between dashing and circling you - When the starfish are circling, each one provides you with 4 defense + When the starfish are circling, each one provides you with {0} defense ''' } @@ -205,7 +205,7 @@ CosmicImmaterializer: { Tooltip: ''' Summons a cosmic energy spiral to fight for you - The orb will fire swarms of homing energy bolts when enemies are detected by it + The orb will fire swarms of homing energy bolts that cause [cbuff:CalamityMod/MiracleBlight] Requires 10 minion slots to use and there can only be one energy spiral ''' } @@ -292,7 +292,7 @@ DormantBrimseeker: { ''' Summons a brimseeker to keep you company Firing another brimseeker when all minion slots are filled summons a brimstone aura - The aura empowers your brimseeker summons and produces damaging fireballs + The aura empowers your brimseeker summons and produces damaging [cbuff:CalamityMod/BrimstoneFlames] fireballs Only one aura can persist at a time You could've sworn that they turned even scarier when you looked at their reflections in a mirror ''' @@ -304,7 +304,7 @@ DragonbloodDisgorger: { ''' Summons a skeletal dragon and her two children Baby spits burst into blood orbs upon hitting an enemy - Picking up these blood orbs reduces the duration of [cbuff:PotionSickness] + Picking up these blood orbs reduces the duration of [cbuffplr:PotionSickness] Requires 6 minion slots to be summoned There can only be one family at a time ''' @@ -401,7 +401,7 @@ FlowersOfMortality: { DisplayName: Flowers of Mortality Tooltip: ''' - Summons five rainbow flowers over your head + Summons five rainbow flowers over your head that inflict [cbuff:CalamityMod/ElementalMix] The combined flowers consume three minion slots ''' } @@ -514,7 +514,7 @@ InfectedRemote: { Summons a humanoid-hybrid Plaguebringer, codenamed 'Virili', to aid you in battle Virili requires 3 minion slots to summon, and can only be summoned once Virili uses a variety of attacks which she cycles through on a timer - All attacks spread the plague, as was her original design intention + All attacks spread the [cbuff:CalamityMod/Plague], as was her original design intention 'There's a single label on the back: [c/1FFBFF:WARNING: Subject is extremely corrosive and contagious. Avoid direct contact.'] ''' @@ -599,7 +599,7 @@ OrthoceraShell: { Tooltip: ''' {$CommonItemTooltip.Sentry} - Summons a flying orthocera to spit acid streams at your enemies + Summons a flying orthocera to spit [cbuff:CalamityMod/Irradiated] and [cbuff:Venom] streams at your enemies ''' } @@ -652,7 +652,7 @@ RustyBeaconPrototype: { Tooltip: ''' {$CommonItemTooltip.Sentry} - Summons a long-abandoned drone that passively emits irradiated waves + Summons a long-abandoned drone that passively emits [cbuff:CalamityMod/Irradiated] waves ''' } @@ -662,7 +662,7 @@ SanctifiedSpark: { ''' {$CommonItemTooltip.Sentry} Summons a friendly immolator that will float towards you - Immolators rapidly fire homing flares at nearby enemies, before continuing to float near you again + Immolators rapidly fire homing flares of [cbuff:CalamityMod/HolyFlames] at nearby enemies, before continuing to float near you again After firing, Immolators will fire one healing bolt at you for every 4 summon slots you have 'They might be a bit clingy, but at least they're warm' ''' @@ -679,8 +679,9 @@ SarosPossession: { ''' Summons a radiant aura harnessing the power of primordial light Repeated summons increase the power of the aura - with full summon slots to channel an eclipse beam that decays over time - This beam recharges when not in use + with full summon slots to channel [ceffect/darksun:Totality Ray] + [ceffect/darksun:Totality Ray] decays while in use and recharges when not in use + [ceffect/darksun:'A ballet of light and shadow, torn from the sky'] ''' } @@ -704,7 +705,7 @@ ShellfishStaff: { DisplayName: Shellfish Staff Tooltip: ''' - Summons a shellfish to fight for you + Summons a shellfish to latch onto enemies and inflict [cbuff:CalamityMod/ShellfishClaps] Each shellfish takes 2 minion slots ''' } @@ -887,11 +888,11 @@ VoidConcentrationStaff: { DisplayName: Void Concentration Staff Tooltip: ''' - Summons a foreboding aura that attacks by firing void orbs - Minion damage is increased by 5% while the aura is active - Requires three minion slots to use - There can only be one aura at a time - to launch a black hole that grows in size + Surrounds you with dark energy, which makes all attacks deal 15% less damage + to condense the energy onto a target, focusing your minions on them and creating homing beams + When the focused enemy takes damage from any source, they will be struck by additional dark energies + These dark energy are twice as strong when the strike was from a minion or sentry + After 10 seconds, the dark energy will resume orbiting you ''' } @@ -901,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 ''' @@ -920,7 +921,7 @@ WitherBlossomsStaff: { DisplayName: Wither Blossoms Staff Tooltip: ''' - Summons four decaying flowers over your head + Summons four decaying [cbuff:CalamityMod/Plague] flowers over your head The combined flowers consume two minion slots ''' } @@ -932,7 +933,7 @@ WulfrumController: { Summons a wulfrum droid to fight for you Hold while holding the remote to switch all of your drones between regular and supercharge mode Supercharged droids will stop attacking and focus wulfrum energy onto you - Supercharged droids provide +0.5 HP/s life regen and 3 defense per droid + Supercharged droids provide +{0} HP/s life regen and {1} defense per droid Can also be used to heal other players by keeping your mouse cursor close enough to them ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson index 9a4e9142f1..6f25f07e11 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Typeless.hjson @@ -2,8 +2,8 @@ Aestheticus: { DisplayName: Aestheticus Tooltip: ''' - Fires crystals that explode and slow enemies down - This weapon scales with all your damage stats at once + Fires crystals that explode and inflict [cbuff:CalamityMod/Vaporfied] + {$Common.AverageDamageInfo} ''' } @@ -14,9 +14,10 @@ ClaretCannon: { Fires a hypercondensed claret round The round explodes upon striking an enemy and releases blood orbs The explosion shreds enemies, inflicting [cbuff:CalamityMod/Laceration] and dramatically reducing their defense - Picking up the blood orbs will reduce [cbuff:PotionSickness] when possible - If you do not have [cbuff:PotionSickness], your natural regeneration will be enhanced + Picking up the blood orbs will reduce [cbuffplr:PotionSickness] when possible + If you do not have [cbuffplr:PotionSickness], your natural regeneration will be enhanced Can only fire once every 10 seconds + {$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.Keybinds.hjson b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson index 8c950f3fd4..b139893fdb 100644 --- a/Localization/en-US/Mods.CalamityMod.Keybinds.hjson +++ b/Localization/en-US/Mods.CalamityMod.Keybinds.hjson @@ -16,3 +16,4 @@ TransformerHotKey.DisplayName: Transformer Hot Key GravitySwapOverride.DisplayName: Gravity Swap Override ExpandDebuffInfo.DisplayName: See Debuff Information ThePointerLock.DisplayName: The Pointer Lock On +SpringStoolJumpHotKey.DisplayName: Spring Stool Jump Hotkey diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 12a58c2e4b..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 @@ -514,7 +514,7 @@ SeaKing: { DoGDefeated3: The Devourer of Gods is truly an enigma. Some say it's not even from this world at all. What is known is that he is a being that can devour the essence of gods entirely, leaving absolutely nothing left. It's no wonder Yharim recruited that monster. PolterghastDefeated1: The Abyss holds many secrets revealed with time. Checking it out again may not be a bad idea. PolterghastDefeated2: Ah... I can sense a powerful change in the weather. You may want to venture to the Sulphurous Seas once more during the rain to experience it. - ProvidenceDefeated1: The Rune of Kos holds a significant portion of Providence's brand of magic, easily distinguishable from all others. Activating it in certain places would have some... risky consequences. + ProvidenceDefeated1: The Mark of Providence holds a significant portion of her brand of magic, easily distinguishable from all others. Activating it in certain places would have some... risky consequences. ProvidenceDefeated2: I do wonder what has happened to Braelor and Statis. I have heard or seen very little of either. In my days, both were great heroes to those who worshiped the gods. Have they been killed, captured, or are they simply in hiding? MoonLordDefeated1: Your adventure focuses to the jungle it seems. The Dragonfolly and its swarming offspring should be eliminated before their numbers spiral out of control. MoonLordDefeated2: Profaned creatures now lurk in the Hallow and in Hell. If you destroy enough and gather their essence together you shall be able to capture the attention of the Profaned Guardians. @@ -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..927a547bf4 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 @@ -87,6 +87,7 @@ HellfireExplosion.DisplayName: Brimstone Hellfire Explosion HiveBombGoliath.DisplayName: Hive Bomb HolyAura.DisplayName: Holy Aura HolyBlast.DisplayName: Holy Blast +HolyBlastFrags.DisplayName: Holy Blast Fragment HolyBomb.DisplayName: Holy Bomb HolyBurnOrb.DisplayName: Holy Orb HolyExplosionBoom.DisplayName: Holy Explosion 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.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson index 1578f2adc3..1add4e568b 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson @@ -28,6 +28,7 @@ RadiatorPet.DisplayName: Radiator RotomPet.DisplayName: Rotom SCalPet.DisplayName: Supreme Calamitas Sparks.DisplayName: Sparks +StarSwallowerPet.DisplayName: G30RG3 II ThirdSage.DisplayName: Third Sage ToastyBatPet.DisplayName: Toasty Bat Friend YharonSonPet.DisplayName: Son of Yharon 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 069e84ecc4..f69845ce21 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -86,10 +86,12 @@ DynamicPursuerElectricity.DisplayName: Dynamic Electricity DynamicPursuerLaser.DisplayName: Dynamic Laser DynamicPursuerProjectile.DisplayName: Dynamic Pursuer EclipseMirrorBurst.DisplayName: Eclipse Mirror Flash -EclipsesFallMain.DisplayName: Eclipse's Fall -EclipsesSmol.DisplayName: Eclipse's Small -EclipsesStealth.DisplayName: Eclipse's Fall -EclipseStealthBoom.DisplayName: Eclipse Blast +EclipsesFall_Javelin.DisplayName: Eclipse's Fall +EclipsesFall_LightFragment.DisplayName: Fragment of Primordial Light +EclipsesFall_LightExplosion.DisplayName: Baily's Beads +EclipsesFall_LightSpark.DisplayName: Spark of Primodial Light +EclipsesFall_StealthSpear.DisplayName: Spear of Obscuration +EclipsesFall_StealthSpearExplosion.DisplayName: Third Contact EGloveSpark.DisplayName: Electrician's Spark EnchantedAxe2.DisplayName: Enchanted Axe EnchantedAxeProj.DisplayName: Enchanted Axe @@ -177,7 +179,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 @@ -209,7 +210,8 @@ PrismallineProj.DisplayName: Prismalline PrismRocket.DisplayName: Prism Rocket PrismShurikenBlade.DisplayName: Refraction Blade ProfanedPartisanProj.DisplayName: Profaned Partisan -ProfanedPartisanSpear.DisplayName: Profaned Spear +ProfanedPartisanSpear.DisplayName: Holy Spear +ProfanedPartisanFlare.DisplayName: Holy Light PumpkaboomSmall.DisplayName: Small Pumpkaboom PumpkaboomBoomSmall.DisplayName: Pump-kaboom! PumpkaboomBig.DisplayName: Big Pumpkaboom @@ -273,6 +275,7 @@ SpearofDestinyProjectile.DisplayName: Destiny Spear SpearofDestinyStealth.DisplayName: Empowered Holy Lance SpearofDestinyStealthExplosion.DisplayName: Strong Burst SpearofPaleolithProj.DisplayName: Paleolith Spear +PaleoShatterExplosion.DisplayName: Paleo Shatter Explosion SpentFuelContainerProjectile.DisplayName: Spent Fuel Container SphereBladed.DisplayName: Bladed Sphere SphereBlue.DisplayName: Blue Thruster Sphere diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index 6877f85cf9..cb32d297b4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -246,7 +246,7 @@ SandnadoMinion.DisplayName: Sandnado SandTornado.DisplayName: Tornado SarosAura.DisplayName: Saros Aura SarosSunfire.DisplayName: Saros Sunfire -SarosEclipseBeam.DisplayName: Eclipse Beam +SarosEclipseBeam.DisplayName: Totality Ray SeashineSwordProj.DisplayName: Seashine Sword SeekerSummonProj.DisplayName: Soul Seeker SepulcherMinion.DisplayName: Sepulcher @@ -315,9 +315,11 @@ VengefulSunSpiritMinion.DisplayName: Vengeful Sun Spirit VileFeederProjectile.DisplayName: Eater of Souls Mini VileFeederSummon.DisplayName: Baby Eater ViridVanguardBlade.DisplayName: Vanguard Blade -VoidConcentrationAura.DisplayName: Concentrated Void Aura -VoidConcentrationBlackhole.DisplayName: Black Hole -VoidConcentrationOrb.DisplayName: Void Orb +VoidConcentrationSummonTagProj.DisplayName: Dark Energy Vortex +VoidConcentrationBeam.DisplayName: Concentrated Beam +VoidConcentrationDarkEnergy.DisplayName: Orbiting Dark Energy +VoidConcentrationMinion.DisplayName: Void Concentration Minion +VoidConcentrationMark.DisplayName: Void Concentration Mark VoidEaterMarionetteProjectile.DisplayName: Void Eater Marionette VolcanicFireballSummon.DisplayName: Volcanic Fireball WaterElementalMinion.DisplayName: Anahita diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index fd7feb6519..51297508f0 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -42,7 +42,6 @@ CursorProjSplit.DisplayName: Aestheticus Crystal CyanLabSeeker.DisplayName: Seeking Mechanism DarkIce.DisplayName: Dark Ice DeepseaBlaze.DisplayName: Deepsea Blaze -DemonshadeRedDevil.DisplayName: Red Devil DevourerofCodsBobber.DisplayName: Devourer of Cods Bobber DiamondOfTheDeepProjectile.DisplayName: Abyss Spirit DirectStrike.DisplayName: Nondescript Damaging Entity @@ -136,8 +135,10 @@ SkyFlareFriendly.DisplayName: Flare SlimeStream.DisplayName: Slime Stream SlurperBobber.DisplayName: Slurper Bobber SpiritOriginBullseye.DisplayName: Spirit Origin Bullseye -StandingFire.DisplayName: Flame +SpringStoolFX.DisplayName: Spring Stool +StandingFire.DisplayName: Calamitous Flame StarStruckWaterBottle.DisplayName: Bottle +StepStoolBonusFX.DisplayName: Step Stool Bonus StickyFeatherAero.DisplayName: Feather StomperSlam.DisplayName: Stomper Slam SuicideBomberDemon.DisplayName: Demon @@ -147,10 +148,12 @@ TarraEnergy.DisplayName: Tarra Energy TarragonAura.DisplayName: Tarragon Aura TatteredFairyDust.DisplayName: Tattered Fairy Dust TeslaAura.DisplayName: Tesla's Electricity +TileSlamDamage.DisplayName: Grand Damage TitanHeartBoom.DisplayName: Titan Heart Boom TransformerAura.DisplayName: Transformer Aura TransformerBlob.DisplayName: Transformer Shard 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.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index 3b293f65f6..e9a1183133 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -130,6 +130,8 @@ PermafrostSecondBirbSwarmText: I must say, those birds earlier were rather cute! PermafrostNonchalantText: I must say, I am not the mage I used to be. This is starting to tire my old body... PermafrostBruhText: Ha! Just kidding! Watch what happens when I cast a spell I know! PermafrostGiveUpText: Gah, I think I pulled a muscle! Ah, well. I seems that I must concede. Well fought! +// Primordial Wyrm +PrimordialWyrmSpawn: The chaotic teleportation energy enrages an abyssal behemoth... // April Fools AprilFools: The LORDE is approaching... AprilFoolsGFB: La Ruga is approaching... diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 1e0d926ef4..a5f4d7807f 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -7,8 +7,6 @@ Armageddon: "{0} failed the challenge at hand." AstralInfection1: "{0}'s infection spread too far." AstralInfection2: "{0}'s skin was replaced by the astral virus." AstralInfection3: "{0} succumbed to their spaceborne pustules." -AstralInjection1: "{0}'s blood vessels burst from drug overdose." -AstralInjection2: "{0} couldn't handle another cosmic mana transfer." AuricRebuke1: "{0}'s vital fluids violently vibrated out of their flesh." AuricRebuke2: "{0} did not survive their brief time as a supercapacitor." AuricRebuke3: "{0} could not contain the power overwhelming." @@ -61,10 +59,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 +108,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.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index c912701a81..92531f5615 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -151,9 +151,11 @@ Cooldowns: { SpongeDurability: Sponge Barrier Durability SpongeRecharge: Sponge Barrier Recharge Starburst: Stratus Starbursts + Stooldown: Stooldown SuperradiantSawBoost: Superradiant Saw Boost TarragonCloak: Tarragon Cloak Cooldown TarragonImmunity: Tarragon Immunity Cooldown + TransformerCooldown: The Transformer Cooldown UniverseSplitter: Universe Splitter Cooldown WarbanneroftheRighteousBuff: Warbanner Strength WardingWave: Warding Wave Cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 4fe4d6f239..bcc871f221 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -2,9 +2,9 @@ SetBonus: { Adamantite: { $parentVal: ''' - Half of your current DR is added to your critical strike chance - Continuously doing damage makes you gradually gain more and more defense, up to a maximum of {0} - When not doing damage, this bonus gradually decays + {0}% of your current damage reduction is added to your critical strike chance + Continuously doing damage makes you gradually gain more and more defense, up to a maximum of {1} + When not doing damage, this bonus gradually decays over {2} seconds This added defense can be broken by defense damage ''' Melee: 15% increased melee speed and 20% increased movement speed @@ -121,7 +121,7 @@ SetBonus: { ''' SpectreHealing: ''' - Converts magic damage to healing force + Reduces Magic damage by 20% and converts it to healing force Magic damage done to enemies heals the player with lowest health ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson index 2a9963a8f4..e88ac0d6e1 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Wings.hjson @@ -1,6 +1,6 @@ BeeWings: Decreases fall speed while not pressing {$Key.DOWN} BoneWings: Halves flight time when taking a hit -DemonWings: Increases fall speed +DemonWings: Increases fall speed and accelerates up faster while falling FestiveWings: Spawns ornaments which restore flight time FinWings: Allows quick travel in water TatteredFairyWings: Leaves a trail of flight draining fairy dust diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 6d3948119d..592bd025bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -23,7 +23,7 @@ AddedTooltip: { FairyBoots: ''' Fairies can spawn at any time on the surface and spawn far more frequently - Nearby fairies grant +2 HP/s life regen, 6 defense and 10% movement speed + Nearby fairies grant +1 HP/s life regen, 4 defense and 10% movement speed Fairies are immune to damage and will no longer flee ''' FleshKnucklesLine: Max life increased by 25 @@ -142,11 +142,7 @@ EditedTooltip: { /* OOA armors */ - ApprenticeHat: Increases your max number of sentries by 1, 10% reduced mana cost - ApprenticeRobe: 15% increased summon damage and magic damage - ApprenticeTrousers: 10% increased summon damage, 15% increased magic critical strike chance, 20% increased movement speed SquireGreatHelm: Increases your max number of sentries by 1 and grants +2 HP/s life regen - SquireGreaves: 10% increased summon damage, 15% increased melee critical strike chance and movement speed MonkBrows: Increases your max number of sentries by 1 and increases rogue velocity by 20% MonkShirt: 20% increased summon and rogue damage MonkPants: 15% increased rogue critical strike chance and 20% increased movement speed @@ -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 ea70752e4b..aaf2511da3 100644 --- a/Localization/en-US/Mods.Terraria.Buffs.hjson +++ b/Localization/en-US/Mods.Terraria.Buffs.hjson @@ -1,22 +1,54 @@ -Venom.ItemTooltip: Sickness - 30 DPS +Venom: { + ItemTooltipPlayer: Sickness - 15 DPS + ItemTooltipEnemy: Sickness - 30 DPS +} + BetsysCurse.ItemTooltip: -40 defense -CursedInferno.ItemTooltip: Heat - 24 DPS -Frostburn2.ItemTooltip: Cold - 50 DPS -Frostburn.ItemTooltip: Cold - 8 DPS -OnFire3.ItemTooltip: Heat - 15 DPS -OnFire.ItemTooltip: Heat - 6 DPS -Ichor.ItemTooltip: -10 defense -Oiled.ItemTooltip: + +CursedInferno: { + ItemTooltipPlayer: Heat - 12 DPS + ItemTooltipEnemy: Heat - 24 DPS +} + +Frostburn2: { + ItemTooltipPlayer: Cold - 8 DPS + ItemTooltipEnemy: Cold - 25 DPS +} + +// Frostburn deals the same damage to players and enemies +Frostburn: { + ItemTooltipPlayer: Cold - 8 DPS + ItemTooltipEnemy: Cold - 8 DPS +} + +OnFire3.ItemTooltipEnemy: Heat - 15 DPS + +// On Fire deals the same damage to players and enemies +OnFire: { + ItemTooltipPlayer: Heat - 6 DPS + ItemTooltipEnemy: Heat - 6 DPS +} + +Ichor.ItemTooltipEnemy: -10 defense +Oiled.ItemTooltipEnemy: ''' Heat - 25 DPS. Recieves 2x the effect from Heat multipliers Only does damage when paired with another Heat debuff ''' -Poisoned.ItemTooltip: Sickness - 6 DPS -PotionSickness.ItemTooltip: "" -Slimed.ItemTooltip: Enhances Heat debuff damage -Wet.ItemTooltip: Enhances Electric debuff damage -Electrified.ItemTooltip: Electric - 10.5 DPS. Deals 4x damage to moving targets -Honey.ItemTooltip: +Poisoned.ItemTooltipEnemy: Sickness - 6 DPS +PotionSickness.ItemTooltipPlayer: "" +Slimed.ItemTooltipEnemy: Enhances Heat debuff damage +Wet.ItemTooltipEnemy: Enhances Electric debuff damage +Confused.ItemTooltipEnemy: Reverses movement +Webbed.ItemTooltipEnemy: Slows enemies +Frozen.ItemTooltipEnemy: Freezes enemies + +Electrified: { + ItemTooltipPlayer: Electric - 4 DPS. Deals 5x damage to moving players + ItemTooltipEnemy: Electric - 15 DPS. Deals 4x damage to moving targets +} + +Honey.ItemTooltipPlayer: ''' Increases health regeneration by 1 HP/s Increases natural regeneration acceleration by 300% diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 0fcbeb04a1..8a5b7692f8 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1203,7 +1203,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 4ac27bd126..f24782ec3c 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -17,6 +17,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class CannonballJellyfish : ModNPC { public bool hasBeenHit = false; diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 2ef44a8f59..407135ec7b 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ChaoticPuffer : ModNPC { public bool puffedUp = false; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 951075b079..dfe2e0cab1 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ColossalSquid : ModNPC { public bool hasBeenHit = false; diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 52c405524e..dae263984c 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -26,6 +26,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class EidolonWyrmHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; @@ -462,9 +463,9 @@ namespace CalamityMod.NPCs.Abyss // Post-Polterghast: Soul Edge, Eidolic Wail, Stardust Staff LeadingConditionRule postPolter = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedPolterghast)); aewMinionCondition.Add(postPolter); - postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); + postPolter.Add(ModContent.ItemType(), 3); // Post-Leviathan: 6-8 Lumenyl (8-11 on Expert) LeadingConditionRule postLevi = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedLeviathan)); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index b3db09830a..24d56ebdb6 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -17,6 +17,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class GulperEelHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 13dcc29c85..963c4580e0 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class MirageJelly : ModNPC { private bool teleporting = false; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index fec514fc15..3a49ef77ef 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { [LongDistanceNetSync] + [HeavyKnockbackWhitelisted] public class OarfishHead : ModNPC { private Vector2 patrolSpot = Vector2.Zero; diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index cce3312e48..ceee4b8ef8 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -20,6 +20,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class ReaperShark : ModNPC { public static Asset ManTexture; diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 99d5a112fe..55b402b4df 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.Abyss { + [HeavyKnockbackWhitelisted] public class SlabCrab : ModNPC { enum AIState diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index a91b3a9793..e79dc4ba06 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -14,7 +14,6 @@ using Terraria; using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities; @@ -23,6 +22,7 @@ using Terraria.WorldBuilding; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class CragmawMire : ModNPC { public enum CragmawAttackState @@ -519,13 +519,8 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { - // If post-Polter, the drop rates are 10%. Otherwise they're 100%. - // This is accomplished by adding rules if the CONDITION "Post-Polter" fails. - LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); - postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); - postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); - postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); - postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); + npcLoot.Add(ModContent.ItemType()); + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index a2f6a64262..cf6b88cc32 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class FlakCrab : ModNPC { public Player Target => Main.player[NPC.target]; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index c3bae2cc77..55f41a9b93 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class GammaSlime : ModNPC { public float DustAngleMultiplier1; diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 51ed39b3da..fb3fe345bf 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -21,6 +21,7 @@ using Terraria.WorldBuilding; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class Mauler : ModNPC { // TODO -- Potentially add another attack in higher difficulty modes at some point? diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 7d6d04049f..a5bf709271 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class NuclearTerror : ModNPC { public enum SpecialAttackState diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 51a9914263..e34dfe714d 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { + [HeavyKnockbackWhitelisted] public class SulphurousSkater : ModNPC { public bool Flying = false; diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index b9f91cbcc0..6204ae467e 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -155,16 +155,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Fire teeth if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4)) { diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 56a6c7432c..cec29d817c 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -151,16 +151,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Kill body and tail bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 28db71c293..9b0e5564aa 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -291,16 +291,6 @@ namespace CalamityMod.NPCs.AquaticScourge } } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = doSpiral || getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Spawn segments if (calamityGlobalNPC.newAI[2] == 0f && NPC.ai[0] == 0f) { diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 75935256b7..66538d7824 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -150,16 +150,6 @@ namespace CalamityMod.NPCs.AquaticScourge enrageScale += 2f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = getFuckedAI; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Kill body and tail bool shouldDespawn = true; for (int i = 0; i < Main.maxNPCs; i++) diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 9f9a0c9703..60823673ec 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Astral { + [HeavyKnockbackWhitelisted] public class AstralachneaWall : ModNPC { public static Asset glowmask; diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index d3c9e0f44a..acb2a97565 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Astral { + [HeavyKnockbackWhitelisted] public class SightseerSpitter : ModNPC { public static Asset glowmask; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 9d20520ac4..e45bf95817 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.AstrumAureus { + [HeavyKnockbackWhitelisted] public class AureusSpawn : ModNPC { public static Asset GlowTexture; @@ -136,7 +137,7 @@ namespace CalamityMod.NPCs.AstrumAureus float lifeRatio = NPC.life / (float)NPC.lifeMax; // Phase 2 check - bool phase2 = lifeRatio <= 0.5f || Main.IsItDay(); + bool phase2 = lifeRatio <= 0.5f; // Charge towards the target and explode after some time int inertia = 30; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index fe6991d43f..cb1e741b72 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.AstrumDeus } } - SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center); + SoundEngine.PlaySound(SplitSound, player.Center); } return; } @@ -401,10 +401,18 @@ namespace CalamityMod.NPCs.AstrumDeus for (int segments = 0; segments < maxLength; segments++) { int lol; + + // Spawn offsets prevent the body segments from spawning bunched on top of each other, which is exploitable if (segments >= 0 && segments < maxLength - 1) - lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, bodyType, NPC.whoAmI); + { + Vector2 bodySpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * (segments + 1) / 2; + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - bodySpawnOffset.X), (int)(NPC.Center.Y - bodySpawnOffset.Y), bodyType, NPC.whoAmI); + } else - lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, tailType, NPC.whoAmI); + { + Vector2 tailSpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * maxLength / 2; + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - tailSpawnOffset.X), (int)(NPC.Center.Y - tailSpawnOffset.Y), tailType, NPC.whoAmI); + } if (segments % 2 == 0) Main.npc[lol].localAI[3] = 1f; @@ -761,13 +769,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; - // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer - if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) - { - SoundEngine.PlaySound(SpawnSound, NPC.Center); - calamityGlobalNPC.newAI[1] = 1f; - } - // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) calamityGlobalNPC.newAI[1] += 1f; diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index 51810443f1..db966cd60c 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -139,16 +139,6 @@ namespace CalamityMod.NPCs.Bumblebirb bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 3f || NPC.ai[0] == 3.1f || NPC.ai[0] == 3.2f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // If target is outside the jungle for more than 5 seconds, enrage if (!player.ZoneJungle && !BossRushEvent.BossRushActive) { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 729cf87c18..ea1ed3a49e 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; @@ -334,8 +329,8 @@ namespace CalamityMod.NPCs public int hyperiusDamage = 0; public static int hyperiusOverflowTime = 100; public int hyperiusOverflowTimer = hyperiusOverflowTime; - /// Constant variable representing the % of max health Hyperius Bullet's damage stacks must reach before they start to overflow. - public const float HyperiusLifePercentThreshold = 0.07f; + /// Constant variable representing the % of max health Hyperius Bullet's damage stacks must reach before they start to bleed. + public const float HyperiusLifePercentThreshold = 0.10f; public int hyperiusFxTimer = 0; public int glaiveShredTimer = 0; @@ -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; @@ -1017,6 +1005,7 @@ namespace CalamityMod.NPCs dmg += 480; // 240 DPS blazingStarShredTimer--; } + dmg = (int)ActiveTypelessDebuffMultiplier.ApplyTo(dmg); npc.lifeRegenCount -= dmg; if (damage < dmg / 12) // 1/6th of the DPS dealt by Glaive Shred shows up as the indicator, unless another debuff does more per tick damage = dmg / 12; @@ -1216,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; @@ -1300,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); @@ -3181,7 +3172,7 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(fullPower with { Volume = 0.7f, Pitch = 0.7f }, npc.Center); warbannerBurnStacks++; } - if (warbannerBurnIntensity > 2.5f && npc.CanBeMoved(true)) + if (warbannerBurnIntensity > 2.5f && npc.CanBeMoved()) { npc.velocity *= 1f - 0.25f * Utils.GetLerpValue(2.5f, 3, warbannerBurnIntensity); if (npc.velocity.Length() > 5 && warbannerBurnIntensity > 2.85f) // Repel leaping enemies @@ -3323,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) @@ -3357,7 +3344,7 @@ namespace CalamityMod.NPCs pearlAuraOwner = -1; } - if (demonSwordImpales > 0 && npc.CanBeMoved(true)) + if (demonSwordImpales > 0 && npc.CanBeMoved()) { npc.velocity *= Utils.Remap(demonSwordImpales, 1, 5, 0.95f, 0.3f, true); if (impalePacketTimer > 30) // There's probably a better solution, but this is the best for now @@ -3368,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) @@ -3388,7 +3375,7 @@ namespace CalamityMod.NPCs if (webbed) velocitySlownessFactor += 0.15f; - if (glacialState) + if (frozen) { float baseSlownessFactor = 0.1f; if (VulnerableToCold.HasValue) @@ -3567,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) @@ -3760,7 +3745,8 @@ namespace CalamityMod.NPCs // Hitbox criteria were changed to allow long one dimensional projectiles so that Condemnation would work. bool acceptableVelocity = projectile.velocity != Vector2.Zero; bool acceptableHitbox = (projectile.width <= 36) || (projectile.height <= 36); - if (bullseye != null && acceptableVelocity && acceptableHitbox) + + if (bullseye != null && acceptableVelocity && acceptableHitbox && !CalamityProjectileSets.DaawnlightBlacklist[projectile.type]) { // Bullseyes are visually different on bosses and thus have larger hitboxes. float bullseyeRadius = npc.IsABoss() ? DaawnlightSpiritOrigin.BossBullseyeRadius : DaawnlightSpiritOrigin.RegularEnemyBullseyeRadius; @@ -4880,7 +4866,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) @@ -4985,7 +4971,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), @@ -5076,6 +5061,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) @@ -5486,7 +5473,7 @@ namespace CalamityMod.NPCs if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.Creeper && target.type != NPCType() && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCID.GolemFistLeft && target.type != NPCID.GolemFistRight && - target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ImmuneToSlowsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 8576c9b207..5fa1266546 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -497,36 +497,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 4)); npcLoot.Add(ItemID.HallowedKey, 10); break; - - // World Feeder - // 6-15 Cursed Flame INSTEAD OF 2-5 in Death Mode - // 4-8 Souls of Night in Death Mode - // Also let World Feeders drop their other loot in Death Mode, as only the Head contains loot normally but it may not be killed last - // Monster Meat is already dropped by all 3 segments - case NPCID.SeekerHead: - npcLoot.RemoveWhere( - // The following expression returns true if the following conditions are met: - rule => rule is CommonDrop drop // If the rule is an CommonDrop instance - && drop.itemId == ItemID.CursedFlame // And that instance drops a Cursed Flame - ); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => !CalamityWorld.death, () => !CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 2, 5); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 6, 15); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death, CalamityUtils.GetTextValue("Condition.Drops.IsDeath"))).Add(ItemID.SoulofNight, 1, 4, 8); - break; - case NPCID.SeekerBody: - case NPCID.SeekerTail: - npcLoot.RemoveWhere( - // The following expression returns true if the following conditions are met: - rule => rule is CommonDrop drop // If the rule is an CommonDrop instance - && drop.itemId == ItemID.CursedFlame // And that instance drops a Cursed Flame - ); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => !CalamityWorld.death, () => !CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 2, 5); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death)).Add(ItemID.CursedFlame, 1, 6, 15); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, () => CalamityWorld.death, CalamityUtils.GetTextValue("Condition.Drops.IsDeath"))).Add(ItemID.SoulofNight, 1, 4, 8); - - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death, false)).Add(ItemID.MeatGrinder, 200); - npcLoot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.death && Main.WindyEnoughForKiteDrops, false)).Add(ItemID.KiteWorldFeeder, 25); - break; #endregion #region Jungle diff --git a/NPCs/CalamityHeavyKnockbackWhitelist.cs b/NPCs/CalamityHeavyKnockbackWhitelist.cs new file mode 100644 index 0000000000..3a579641bf --- /dev/null +++ b/NPCs/CalamityHeavyKnockbackWhitelist.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using CalamityMod.Balancing; +using CalamityMod.Items.Accessories; +using CalamityMod.Systems.Collections; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.NPCs +{ + public sealed class CalamityHeavyKnockbackWhitelist : GlobalNPC + { + // General rule of thumb I used for this is to not put it on anything that is a stationary entity (EX: Tesla Turrets, Antlions, Hive Cysts) + // No putting it on any bosses, though boss minions are fair game when applicable (no stuff like Scal hearts obviously, sending them into the void would be bad) + internal static HashSet whitelistNPC; + public override void Load() + { + whitelistNPC = new(); + } + public override void Unload() + { + whitelistNPC?.Clear(); + whitelistNPC = null; + } + public override void SetStaticDefaults() + { + // Add vanilla enemies to the whitelist + whitelistNPC.Add(NPCID.AncientCultistSquidhead); + whitelistNPC.Add(NPCID.DesertDjinn); + whitelistNPC.Add(NPCID.DD2DrakinT2); + whitelistNPC.Add(NPCID.DD2DrakinT3); + whitelistNPC.Add(NPCID.GrayGrunt); + whitelistNPC.Add(NPCID.HeadlessHorseman); + whitelistNPC.Add(NPCID.LihzahrdCrawler); + whitelistNPC.Add(NPCID.MartianProbe); + whitelistNPC.Add(NPCID.MartianWalker); + whitelistNPC.Add(NPCID.Paladin); + whitelistNPC.Add(NPCID.PirateCaptain); + whitelistNPC.Add(NPCID.ShadowFlameApparition); + whitelistNPC.Add(NPCID.ThePossessed); + whitelistNPC.Add(NPCID.EyeballFlyingFish); + whitelistNPC.Add(NPCID.Yeti); + whitelistNPC.Add(NPCID.ZombieMerman); + whitelistNPC.Add(NPCID.FungiBulb); + whitelistNPC.Add(NPCID.GiantFungiBulb); + whitelistNPC.Add(NPCID.ManEater); + whitelistNPC.Add(NPCID.Snatcher); + whitelistNPC.Add(NPCID.BloodEelHead); + whitelistNPC.Add(NPCID.BoneSerpentHead); + whitelistNPC.Add(NPCID.DevourerHead); + whitelistNPC.Add(NPCID.DiggerHead); + whitelistNPC.Add(NPCID.DuneSplicerHead); + whitelistNPC.Add(NPCID.GiantWormHead); + whitelistNPC.Add(NPCID.LeechHead); + whitelistNPC.Add(NPCID.StardustWormHead); + whitelistNPC.Add(NPCID.CultistDragonHead); + whitelistNPC.Add(NPCID.TombCrawlerHead); + whitelistNPC.Add(NPCID.SeekerHead); + whitelistNPC.Add(NPCID.WyvernHead); + whitelistNPC.Add(NPCID.Creeper); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.TheHungry); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.TheHungryII); // Here because they gain KB immunity in multiplayer + whitelistNPC.Add(NPCID.DD2DarkMageT1); + whitelistNPC.Add(NPCID.DD2DarkMageT3); + whitelistNPC.Add(NPCID.DD2OgreT2); + whitelistNPC.Add(NPCID.DD2OgreT3); + whitelistNPC.Add(NPCID.MourningWood); + whitelistNPC.Add(NPCID.Pumpking); + whitelistNPC.Add(NPCID.Everscream); + whitelistNPC.Add(NPCID.SantaNK1); + whitelistNPC.Add(NPCID.IceQueen); + whitelistNPC.Add(NPCID.MartianSaucerCore); + whitelistNPC.Add(NPCID.Sharkron); + whitelistNPC.Add(NPCID.Sharkron2); + // Below are enemies Calamity gives KB immunity, but that aren't KB immune in vanilla + whitelistNPC.Add(NPCID.Mothron); + whitelistNPC.Add(NPCID.BigMimicCorruption); + whitelistNPC.Add(NPCID.BigMimicCrimson); + whitelistNPC.Add(NPCID.BigMimicHallow); + whitelistNPC.Add(NPCID.BigMimicJungle); + whitelistNPC.Add(NPCID.SolarCorite); + whitelistNPC.Add(NPCID.CrimsonAxe); + whitelistNPC.Add(NPCID.CursedHammer); + whitelistNPC.Add(NPCID.EnchantedSword); + whitelistNPC.Add(NPCID.GiantTortoise); + whitelistNPC.Add(NPCID.IceTortoise); + whitelistNPC.Add(NPCID.GoblinSummoner); + whitelistNPC.Add(NPCID.Butcher); + + var npcs = GetContent(); + foreach (var npc in npcs) + { + try + { + var type = npc.GetType(); + var whitelisted = type.GetCustomAttribute(); + if (whitelisted != null) + { + int npcType = npc.Type; + whitelistNPC.Add(npcType); + } + } + catch (Exception e) + { + CalamityMod.Log.Error($"Exception thrown while evaluating type \"{npc.FullName}\": {e}"); + } + } + } + } +} diff --git a/NPCs/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/CalamityTileCollisionHarmNPC.cs b/NPCs/CalamityTileCollisionHarmNPC.cs index e8c8ce2d34..9b18e6fe5d 100644 --- a/NPCs/CalamityTileCollisionHarmNPC.cs +++ b/NPCs/CalamityTileCollisionHarmNPC.cs @@ -1,7 +1,13 @@ using System; +using System.Collections.Generic; +using CalamityMod.Dusts; +using CalamityMod.Enums; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.ModLoader; namespace CalamityMod.NPCs @@ -30,6 +36,7 @@ namespace CalamityMod.NPCs private bool hitVoid = false; private Player attacker; private int packetTimer = 0; + private bool GrandDad = false; public int PotentialEnergyDamage { @@ -76,12 +83,8 @@ namespace CalamityMod.NPCs /// The maximum fall damage taken by the npc once they hit the ground /// The downwards velocity necessary to recieve the full fall damage. By default 10, the npc max fall speed /// Will check for tiles in the collision instead of velocity - public void ApplyCollisionDamage(NPC npc, Player player, int potentialDamage, Vector2 forcedVel, float terminalVelocityForFullDamage = 10f, bool checkTiles = false) + public void ApplyCollisionDamage(NPC npc, Player player, int potentialDamage, Vector2 forcedVel, float terminalVelocityForFullDamage = 10f, bool checkTiles = false, bool grandDad = false) { - //NPCs that don't collide with tiles simply don't get fall damage, lol. - if (npc.noTileCollide) - return; - PotentialEnergyDamage = potentialDamage; OldVelocity = npc.velocity; OlderVelocity = npc.velocity; @@ -89,6 +92,7 @@ namespace CalamityMod.NPCs CheckTiles = checkTiles; ForcedVel = forcedVel; attacker = player; + GrandDad = grandDad; } /// @@ -100,10 +104,6 @@ namespace CalamityMod.NPCs /// Will check for tiles in the collision instead of velocity public void ApplyForcedVelocity(NPC npc, Player player, Vector2 forcedVel, bool checkTiles = false) { - // NPCs that don't collide with tiles simply don't get velocity, lol. - if (npc.noTileCollide) - return; - OldVelocity = npc.velocity; OlderVelocity = npc.velocity; CheckTiles = checkTiles; @@ -118,17 +118,69 @@ namespace CalamityMod.NPCs { if (CheckTiles) { - float oldVelocity = OldVelocity.Length(); - npc.Center += ForcedVel; ForcedVel *= 0.995f; + Vector2 safeVel = ForcedVel.SafeNormalize(Vector2.UnitX); - if (Collision.SolidCollision(npc.Center, (int)(npc.width * 0.5f), (int)(npc.height * 0.5f)) || !WorldGen.InWorld(npc.Center.ToTileCoordinates().X, npc.Center.ToTileCoordinates().Y, 40)) + if (npc.velocity == Vector2.Zero || ForcedVel.Length() < 2 || Collision.SolidCollision(npc.Center, (int)(npc.width * 0.5f), (int)(npc.height * 0.5f)) || !WorldGen.InWorld(npc.Center.ToTileCoordinates().X, npc.Center.ToTileCoordinates().Y, 40)) { - if (!ForceVelocityOnly) + if (!ForceVelocityOnly && potentialEnergyDamage > 0) { + float oldVelocity = OldVelocity.Length(); + if (GrandDad) + { + float scale = (npc.boss ? 1.35f : 1) + Utils.GetLerpValue(20, 800, Math.Max(npc.width, npc.height)); + + attacker.SetScreenshake(7f * scale); + if (!CalamityClientConfig.Instance.Photosensitivity) + { + Vector2 pulseVel = -safeVel; + Particle pulse1 = new CustomSpark(npc.Center, pulseVel * 2, "CalamityMod/Particles/BloomCircle", false, (int)(23 * MathF.Pow(scale, 2)), 0.6f * MathF.Pow(scale, 2), Color.DodgerBlue, new Vector2(2f, 1f), shrinkSpeed: -0.1f / scale, noShrink: true, glowCenter: true, glowOpacity: 0.8f); + GeneralParticleHandler.SpawnParticle(pulse1, true); + Particle pulse2 = new CustomSpark(npc.Center, pulseVel, "CalamityMod/Particles/BloomRing", false, (int)(18 * MathF.Pow(scale, 2)), 0.5f * MathF.Pow(scale, 2), Color.Blue, new Vector2(4f, 0.7f), shrinkSpeed: -0.3f / scale, noShrink: true); + GeneralParticleHandler.SpawnParticle(pulse2, true); + } + + + for (int i = 0; i < 2; i++) + { + SoundStyle die = new("CalamityMod/Sounds/Item/HolyFireBulletExplosion"); + SoundEngine.PlaySound(die with { Pitch = 0.5f, Volume = Math.Min(0.6f * scale, 1f), MaxInstances = 2 }, npc.Center); + if (npc.boss) + { + SoundStyle dieHard = new("CalamityMod/Sounds/Item/HellkiteSmallHit3"); + SoundEngine.PlaySound(dieHard with { Pitch = -1f, Volume = Math.Min(0.5f * scale, 1f), MaxInstances = 2 }, npc.Center); + } + SoundStyle dieHarder = new("CalamityMod/Sounds/Item/HeliumFlashCoreImpact"); + SoundEngine.PlaySound(dieHarder with { Pitch = -1.8f, Volume = Math.Min(0.6f * scale, 1f), MaxInstances = 2 }, npc.Center); + } + for (int i = 0; i < 30; i++) + { + float variance = Main.rand.NextFloat(-0.8f, 0.8f); + Dust dust = Dust.NewDustPerfect(npc.Center, ModContent.DustType(), + -safeVel.RotatedBy(variance * 2).RotatedByRandom(MathF.Abs(variance) / 3) * scale * Main.rand.NextFloat(30.0f, 33.0f) * MathF.Pow((1 - MathF.Abs(variance)), 2), 0, default, scale * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 2; + dust.fadeIn = 0.5f * scale; + } + for (int i = 0; i < 15; i++) + { + float variance = Main.rand.NextFloat(-0.8f, 0.8f); + Vector2 vel = -safeVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(20.0f, 23.0f) * MathF.Pow((1 - MathF.Abs(variance)), 2); + Dust dust2 = Dust.NewDustPerfect(npc.Center + vel * 13, ModContent.DustType(), + vel, 0, default, 2 * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + + } + } + + bool instakill = (GrandDad && potentialEnergyDamage != 1); int wallImpactDamage = (int)(PotentialEnergyDamage * Math.Clamp(oldVelocity / terminalVelocityForFullFallDamage, (ForcedVel.Length() > 0 ? 1f : 0f), 1f)); - Projectile wallImpact = Projectile.NewProjectileDirect(attacker.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), wallImpactDamage, 0f, attacker.whoAmI, npc.whoAmI); + Projectile wallImpact = Projectile.NewProjectileDirect(attacker.GetSource_FromThis(), npc.Center, Vector2.Zero, instakill ? ModContent.ProjectileType() : ModContent.ProjectileType(), wallImpactDamage, 0f, attacker.whoAmI, npc.whoAmI); wallImpact.DamageType = DamageClass.Melee; wallImpact.CritChance = (int)attacker.GetCritChance(DamageClass.Melee) + attacker.HeldItem.crit; } diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index cfc7c0469f..6b1b8c374d 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags { + [HeavyKnockbackWhitelisted] public class HeatSpirit : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index a2befaa003..fc2faaee99 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.Cryogen NPC.width = 216; NPC.height = 216; NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f; - NPC.DR_NERD(0.4f); - NPC.LifeMaxNERB(2800, 3360, 33600); + NPC.DR_NERD(0.25f); + NPC.LifeMaxNERB(2500, 3000, 30000); NPC.Opacity = 0f; NPC.HitSound = Cryogen.HitSound; NPC.DeathSound = BreakSound; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 96898e2192..052bd98c2d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -83,6 +83,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.boss = true; NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; + NPC.Calamity().canBreakPlayerDefense = true; if (Main.zenithWorld) NPC.scale *= 1.5f; diff --git a/NPCs/DraedonLabThings/Androomba.cs b/NPCs/DraedonLabThings/Androomba.cs index fc60264b5f..09230077a7 100644 --- a/NPCs/DraedonLabThings/Androomba.cs +++ b/NPCs/DraedonLabThings/Androomba.cs @@ -13,6 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.DraedonLabThings { + [HeavyKnockbackWhitelisted] public class Androomba : ModNPC { diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 4aebb02ae2..a3c7bcb9c1 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.DraedonLabThings { + [HeavyKnockbackWhitelisted] public class RepairUnitCritter : ModNPC { public enum BehaviorState diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 42af41cb27..42d7441b6c 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -20,6 +20,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.GreatSandShark { [AutoloadBossHead] + [HeavyKnockbackWhitelisted] public class GreatSandShark : ModNPC { private bool resetAI = false; diff --git a/NPCs/HeavyKnockbackWhitelistedAttribute.cs b/NPCs/HeavyKnockbackWhitelistedAttribute.cs new file mode 100644 index 0000000000..0bc40aa705 --- /dev/null +++ b/NPCs/HeavyKnockbackWhitelistedAttribute.cs @@ -0,0 +1,13 @@ +using System; + +namespace CalamityMod.NPCs +{ + /// + /// This attribute puts an NPC into the heavy knockback whitelist + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] + public sealed class HeavyKnockbackWhitelistedAttribute : Attribute + { + + } +} diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index e25f31ae91..8f7a674da0 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -218,16 +218,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.dontTakeDamage = spawnAnimation; - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 2f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Despawn if (!player.active || player.dead || Vector2.Distance(player.Center, npcCenter) > 5600f) { diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 19205bd748..415325546d 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -64,6 +64,9 @@ namespace CalamityMod.NPCs.Leviathan public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { + int associatedNPCType = ModContent.NPCType(); + bestiaryEntry.UIInfoProvider = new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[associatedNPCType], quickUnlock: true); + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean, diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 95e4beec0b..d013f9f032 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class AuroraSpirit : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index c4fa0d8395..07040968de 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class PlanterasFreeTentacle : ModNPC { public override string Texture => $"Terraria/Images/NPC_{NPCID.PlanterasTentacle}"; diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 2891aa5e74..dffd4e8a18 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -12,6 +12,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.NormalNPCs { + [HeavyKnockbackWhitelisted] public class ScornEater : ModNPC { diff --git a/NPCs/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/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index dc51b1a0f1..4592d3b4b4 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -15,6 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.OldDuke { + [HeavyKnockbackWhitelisted] public class SulphurousSharkron : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 4494237d73..c7411a4d2a 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 40; NPC.defense = 6; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 9b872ecaba..b35bc6f9c9 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Perforator if (!TailSpawned) { int Previous = NPC.whoAmI; - int maxLength = death ? 27 : revenge ? 24 : expertMode ? 21 : 15; + int maxLength = death ? 27 : expertMode ? 21 : 15; for (int segments = 0; segments < maxLength; segments++) { int lol; @@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 033cd052fa..2d80c05878 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 68; NPC.defense = 2; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; @@ -465,7 +465,7 @@ namespace CalamityMod.NPCs.Perforator public static int GetMediumPerforatorSegmentsCount() { - return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; + return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : Main.expertMode ? 12 : 10; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 8b6fbc6406..bd7536b1d2 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Perforator if (!TailSpawned) { int Previous = NPC.whoAmI; - int maxLength = death ? 9 : revenge ? 8 : expertMode ? 7 : 5; + int maxLength = death ? 9 : expertMode ? 7 : 5; for (int segments = 0; segments < maxLength; segments++) { int lol; @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator } } - if (NPC.Distance(player.Center) > 1280f) + if (NPC.Distance(player.Center) > 1120f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index b7401df0b0..9419c0346b 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 50; NPC.defense = 10; - NPC.LifeMaxNERB(130, 170, 7000); + NPC.LifeMaxNERB(120, 150, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 8cd56e8f01..e9c9606af2 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -14,6 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.PlaguebringerGoliath { + [HeavyKnockbackWhitelisted] public class PlagueHomingMissile : ModNPC { public static Asset GlowTexture; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 47724c6a71..0b9018bce2 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -180,16 +180,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath nukeBarrageChallengeAmt *= 1.5f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[0] == 0f || NPC.ai[0] == 4f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Light Lighting.AddLight((int)(NPC.Center.X / 16f), (int)(NPC.Center.Y / 16f), 0.3f, 0.7f, 0f); @@ -1337,7 +1327,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath int[] weapons = new int[] { ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 2bc598ef88..0b932099d2 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -341,16 +341,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm iceMistDuration *= 0.5f; } - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = AIState == (float)Phase.FinalPhase || AIState == (float)Phase.ShadowFireballSpin; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - // Adjust opacity bool invisiblePartOfChargePhase = calamityGlobalNPC.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC.newAI[2] <= chargePhaseGateValue + 1f && (AIState == (float)Phase.ChargeOne || AIState == (float)Phase.ChargeTwo || AIState == (float)Phase.FastCharge); bool invisiblePartOfLightningChargePhase = calamityGlobalNPC.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC.newAI[2] <= lightningChargePhaseGateValue + 1f && AIState == (float)Phase.LightningCharge; @@ -1492,7 +1482,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType()); - npcLoot.Add(ModContent.ItemType()); + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 1, 80, 100); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 5005f77496..39a7dc5f10 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -32,6 +32,7 @@ using CalamityMod.Systems.Graphic; using CalamityMod.Tiles.Ores; using CalamityMod.Utilities; using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -98,6 +99,9 @@ namespace CalamityMod.NPCs.Providence public bool Dying = false; public int DeathAnimationTimer; public static float borderRadius = 3000f; + int spearDir = 1; + int starDir = 1; + public Vector2? borderPosition = null; // Sounds public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/Providence/ProvidenceSpawn") { Volume = 1.2f }; @@ -324,6 +328,7 @@ namespace CalamityMod.NPCs.Providence writer.Write((Half)SoundWarningLevel); writer.Write(DeathAnimationTimer); writer.Write(borderRadius); + writer.WriteVector2(borderPosition ?? Vector2.Zero); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } @@ -353,6 +358,9 @@ namespace CalamityMod.NPCs.Providence SoundWarningLevel = (float)reader.ReadHalf(); DeathAnimationTimer = reader.ReadInt32(); borderRadius = reader.ReadSingle(); + borderPosition = reader.ReadVector2(); + if (borderPosition == Vector2.Zero) + borderPosition = null; for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); @@ -364,6 +372,10 @@ namespace CalamityMod.NPCs.Providence public override void AI() { + //ensure projectiles all despawn when she does + if (NPC.timeLeft == 1) + DespawnSpecificProjectiles(true); + // Set the border drawing to true if it isn't set to true // Can happen when another mod sets to false for a difficulty and that difficulty is then toggled off. shouldDrawInfernoBorder = true; @@ -1246,6 +1258,8 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.FlameCocoon: + borderPosition ??= NPC.Center; + borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30); if (!targetDead && !getFuckedAI) { @@ -1279,7 +1293,7 @@ namespace CalamityMod.NPCs.Providence Vector2 spinningPoint = normalSpread ? new Vector2(0f, -cocoonProjVelocity) : new Vector2(-velocityX, -cocoonProjVelocity); for (int i = 0; i < chains; i++) { - Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2])); + Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2]) * starDir); if (Main.rand.NextBool(healingStarChance) && !death) { @@ -1419,6 +1433,7 @@ namespace CalamityMod.NPCs.Providence } text = false; + starDir *= -1; AIState = (int)Phase.PhaseChange; NPC.localAI[2] = attackDelayAfterCocoon; NPC.TargetClosest(); @@ -1515,6 +1530,10 @@ namespace CalamityMod.NPCs.Providence case (int)Phase.SpearCocoon: + + borderPosition ??= NPC.Center; + borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f); + if (!targetDead && !getFuckedAI) { if (NPC.velocity.Length() <= 2f) @@ -1570,7 +1589,7 @@ namespace CalamityMod.NPCs.Providence spearRateIncrease = 1f; float radialOffset = MathHelper.Lerp(0.2f, 0.4f, spearRateIncrease); - calamityGlobalNPC.newAI[1] += radialOffset; + calamityGlobalNPC.newAI[1] += radialOffset * spearDir; } calamityGlobalNPC.newAI[2] += 1f; @@ -1596,7 +1615,9 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; if (NPC.ai[3] >= phaseTime) { + AIState = (int)Phase.PhaseChange; + spearDir *= -1; NPC.localAI[2] = attackDelayAfterCocoon; NPC.TargetClosest(); } @@ -1875,7 +1896,7 @@ namespace CalamityMod.NPCs.Providence public float CalculateBurnIntensity(float attackDelayAfterCocoon = 1f) { - float distanceToTarget = Vector2.Distance(Main.player[NPC.target].Center, NPC.Center); + float distanceToTarget = Vector2.Distance(Main.player[NPC.target].Center, borderPosition ?? NPC.Center); float aiTimer = NPC.ai[3]; // This bool is only relevant for non-Zenith enraged AI @@ -1884,7 +1905,7 @@ namespace CalamityMod.NPCs.Providence float baseDistance = 2800f; float shorterFlameCocoonDistance = (CalamityWorld.death || fullPower) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterSpearCocoonDistance = (CalamityWorld.death || fullPower) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f; - float shorterDistance = AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; + float shorterDistance = baseDistance - (AIState == (int)Phase.FlameCocoon ? shorterFlameCocoonDistance : shorterSpearCocoonDistance); bool guardianAlive = false; if (CalamityGlobalNPC.holyBossAttacker != -1 && Main.npc[CalamityGlobalNPC.holyBossAttacker].active) @@ -1907,11 +1928,10 @@ namespace CalamityMod.NPCs.Providence // Distance does not get shorter if in GFB / Guardians are alive if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Rainbow) { - maxDistance = baseDistance; if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon) - maxDistance -= shorterDistance * shorterDistanceFade; + maxDistance = MathHelper.Lerp(baseDistance, shorterDistance, shorterDistanceFade); else if (attackDelayAfterCocoon > 1f) - maxDistance -= shorterDistance * (NPC.localAI[2] / attackDelayAfterCocoon); + maxDistance = MathHelper.Lerp(baseDistance, shorterDistance, (NPC.localAI[2] / attackDelayAfterCocoon)); } float drawFireDistanceStart = maxDistance - 800f; @@ -2566,10 +2586,10 @@ namespace CalamityMod.NPCs.Providence shader.Parameters["colorMult"].SetValue(prov.hasBeenGivenFullPower ? 7.65f : 7.35f); //I want you to know it took considerable restraint to deliberately misspell colour. shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly); shader.Parameters["radius"].SetValue(borderDistance); - shader.Parameters["anchorPoint"].SetValue(npc.Center); + shader.Parameters["anchorPoint"].SetValue(prov.borderPosition ?? npc.Center); shader.Parameters["screenPosition"].SetValue(Main.screenPosition); shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2()); - shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity); + shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity*0.5f + 0.5f); shader.Parameters["playerPosition"].SetValue(target.Center); shader.Parameters["maxOpacity"].SetValue(maxOpacity); shader.Parameters["day"].SetValue(!prov.hasBeenGivenFullPower); @@ -2866,6 +2886,14 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { + /// + /// This lease should be used to draw all of a projectile's effects onto directly, then be drawn onto the screen as one. This is for opacity reasons + /// + public static RenderTargetLease PrimaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } + /// + /// This should be used for secondary effects like trails, then drawn to PrimaryLease. This is for opacity reasons. + /// + public static RenderTargetLease SecondaryLease { get => field ??= ScreenspaceTargetPool.Shared.Rent(Main.instance.GraphicsDevice); set; } public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; public static int CalculateProvidenceDamage(this int damage) diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 33d6c79feb..4bcda5bc2f 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Signus { + [HeavyKnockbackWhitelisted] public class CosmicLantern : ModNPC { public static Asset GlowTexture; diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 8a2a83f901..4b7e8cb2fd 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -19,6 +19,7 @@ namespace CalamityMod.NPCs.Signus public override void SetStaticDefaults() { NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.BossBestiaryPriority.Add(Type); } public override void SetDefaults() @@ -42,6 +43,9 @@ namespace CalamityMod.NPCs.Signus public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) { + int associatedNPCType = ModContent.NPCType(); + bestiaryEntry.UIInfoProvider = new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[associatedNPCType], quickUnlock: true); + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] { BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld, diff --git a/NPCs/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/TownNPCs/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index d9f67f8926..e5f9ec3ef8 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -165,8 +165,6 @@ namespace CalamityMod.NPCs.TownNPCs .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) - .Add(Condition.DownedEverscream, Condition.DownedSantaNK1, Condition.DownedIceQueen) .Add() .Add(ItemID.SuperManaPotion) .Add() diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs index 35fc92c954..f011ff78bd 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs @@ -352,6 +352,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride NPC.defense = NPC.defDefense; NPC.chaseable = (AIState != BrainAIState.IllusionDash && AIState != BrainAIState.IllusionTrick); + if (Main.getGoodWorld && AIState >= BrainAIState.Phase2TransitionOpen) + NPC.brainOfGravity = NPC.whoAmI; } else NPC.defense = (int)(NPC.defDefense * Phase1DefenseMultiplier); @@ -569,7 +571,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 +690,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride AttackCounter++; if (SummonedViaItem || BossRushEvent.BossRushActive) - SpawnDelay = 2; + SpawnDelay = 1; else SpawnDelay = AttackCounter switch { @@ -3096,7 +3100,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride return false; } - public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 30 : 21; + public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 27 : 18; public static List GetAllValidTargets(Vector2 brainPosition) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs index 8ad34c50b4..72043d55fa 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/CreeperAI.cs @@ -177,7 +177,8 @@ public class CreeperAI : VanillaAIOverride if (bocAI.SpawnTime != 0 && Time >= 0) //Brain has appeared { - float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime); + float spawnAnimTimeReduction = (SummonedViaItem || BossRushEvent.BossRushActive) ? 120 : 0; + float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime) + spawnAnimTimeReduction; if (brainTime < 180) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs index c69afe955c..86a7aa7f8c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/FalseBrain.cs @@ -166,7 +166,7 @@ public class FalseBrain : ModNPC, ILocalizedModType float endLerp = AttackTime / 60f; float startLerp = SpawnTime / 60f; - if (BrainOfCthulhuSystem.IsBrainOfCthulhuTextureVanilla) + if (BrainOfCthulhuSystem.IsBrainOfCthulhuTextureVanilla && !CalamityClientConfig.Instance.BoCSpriteChange) { tex = TextureAssets.Npc[Type].Value; frame = tex.Frame(7, 4, Variant, (int)NPC.frameCounter); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index 3f33e6802b..711da670b0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -24,9 +24,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Variables bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool phase2 = lifeRatio < (death ? 0.6f : 0.7f); - bool phase3 = lifeRatio < (death ? 0.3f : 0.4f); - bool phase4 = lifeRatio < (death ? 0.1f : 0.2f); + bool phase2 = lifeRatio < 0.7f; + bool phase3 = lifeRatio < 0.4f; + bool phase4 = lifeRatio < 0.2f; bool phase2AI = NPC.ai[0] > 4f; bool phase3AI = NPC.ai[0] > 9f; bool charging = NPC.ai[3] < 10f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 71945eabe4..9af1bd482c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -243,7 +243,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int whoAmI = NPC.whoAmI; float ai0Holdover = NPC.ai[0]; float newAI1Holdover = calamityGlobalNPC.newAI[1]; - int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer; // Actually transform the body segment into a head segment. NPC.SetDefaultsKeepPlayerInteraction(NPC.type); @@ -253,7 +252,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Heads spawned mid fight by splitting do not get reset spawn invincibility. CalamityGlobalNPC newCGN = NPC.Calamity(); newCGN.newAI[1] = newAI1Holdover; - newCGN.debuffResistanceTimer = slowingDebuffResistTimer; CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); @@ -268,14 +266,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float segmentLifeRatio = MathHelper.Lerp(0.5f, 1f, NPC.life / (float)NPC.lifeMax); int whoAmI = NPC.whoAmI; float ai1Holdover = NPC.ai[1]; - int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer; // Actually transform the body segment into a tail segment. NPC.SetDefaultsKeepPlayerInteraction(NPC.type); NPC.life = (int)(NPC.lifeMax * segmentLifeRatio); NPC.whoAmI = whoAmI; NPC.ai[1] = ai1Holdover; - NPC.Calamity().debuffResistanceTimer = slowingDebuffResistTimer; CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index b553015d05..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,13 +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.rand.NextBool(5 - ((int)calamityGlobalNPC.newAI[1] - 2)) && calamityGlobalNPC.newAI[1] >= 2f) - { - NPC.ai[1] = lanceWallPhaseTime; - NPC.netUpdate = true; - } } NPC.ai[1] += 1f; @@ -927,9 +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. @@ -1163,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..972bc16f13 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 @@ -165,18 +155,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Start other phases; if arms are dead, start with spin phase if (phase2 || Main.getGoodWorld || allArmsDead) { - // Start spin phase after 1.5 seconds + // Start spin phase after 1.5 seconds if close enough; forced after 4.5 seconds NPC.ai[2] += phase3 ? 1.5f : 1f; if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f))) { - bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[NPC.target].position.Y - 320f && - Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 400f; + bool shouldSpinAround = NPC.ai[1] == 4f && ((NPC.position.Y < Main.player[NPC.target].position.Y - 320f && + Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 400f) || + NPC.ai[2] >= (270f - (death ? 15f * (1f - lifeRatio) : 0f))); if (shouldSpinAround || NPC.ai[1] != 4f) { if (shouldSpinAround) { - NPC.localAI[3] = 300f; + NPC.localAI[3] = 200f; NPC.localAI[1] = 0; NPC.SyncVanillaLocalAI(); } @@ -319,7 +310,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); NPC.ai[2] = 0f; - NPC.ai[1] = 4f; + // Fly overhead and spit missiles if on low health + NPC.ai[1] = phase3 ? 6f : 4f; NPC.localAI[0] = 0f; } @@ -485,7 +477,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin for about 3 seconds // Decreasing this number will INCREASE how fast he moves while spinning - float spinVelocity = 30f; + float spinVelocity = 25f; if (NPC.ai[2] == 2f) { // Play angry noise @@ -550,8 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); - // Fly overhead and spit missiles if on low health - NPC.ai[1] = phase3 ? 6f : 1f; + NPC.ai[1] = 1f; NPC.ai[2] = 0f; NPC.localAI[3] = 0f; NPC.localAI[0] = 0f; @@ -600,8 +591,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.localAI[0] >= totalMissiles) { - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; + NPC.ai[1] = 4f; + NPC.ai[2] = -60f; NPC.localAI[3] = 0f; calamityGlobalNPC.newAI[0] = 0f; NPC.localAI[0] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index f30880b7a5..227077741e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - float delayBeforeChargingAgain = death ? 48f : 56f; + float delayBeforeChargingAgain = death ? 50f : 60f; if (NPC.ai[2] >= delayBeforeChargingAgain) { NPC.ai[3] += 1f; @@ -314,21 +314,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.rotation += NPC.ai[2]; NPC.ai[1] += 1f; - if (death && NPC.ai[2] >= 0.2f) - { - if (NPC.ai[1] % 10f == 0f) - { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ProjectileID.DeathLaser; - - Vector2 projectileVelocity = NPC.rotation.ToRotationVector2() * 7f; - float offset = 90f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projectileVelocity) * offset, projectileVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); - } - } - } if (NPC.ai[1] == 100f) { @@ -620,7 +605,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (NPC.ai[1] == 4f) { float chargeLineUpDistance = spazAlive ? 600f : 500f; - float chargeSpeed = (death ? 20f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeSpeed = death ? 5f : 3f; float chargeAcceleration = death ? 0.495f : 0.45f; if (spazAlive) @@ -844,7 +829,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Rotation and velocity NPC.rotation = hoverRotation; - float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f; + float chargeSpeed = 16f; + if (death) + chargeSpeed += (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))); if (Main.getGoodWorld) chargeSpeed *= 1.2f; @@ -935,20 +922,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.rotation += NPC.ai[2]; NPC.ai[1] += 1f; - if (death && NPC.ai[2] >= 0.2f) - { - if (NPC.ai[1] % 10f == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = NPC.ai[1] % 20f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, 1f); - Main.projectile[proj].tileCollide = false; - } - } - } if (NPC.ai[1] == 100f) { @@ -1025,10 +998,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!NPC.IsMechQueenUp) { - // Boost speed if too far from target - if (distanceFromDestination > distanceFromTarget) - maxVelocity += MathHelper.Lerp(0f, 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - if (Main.getGoodWorld) { maxVelocity *= 1.15f; diff --git a/Particles/CircularSmearLarge.png b/Particles/CircularSmearLarge.png new file mode 100644 index 0000000000..d9d51baaef Binary files /dev/null and b/Particles/CircularSmearLarge.png differ diff --git a/Particles/CustomColorChangeSpark.cs b/Particles/CustomColorChangeSpark.cs new file mode 100644 index 0000000000..d17c5d92ce --- /dev/null +++ b/Particles/CustomColorChangeSpark.cs @@ -0,0 +1,141 @@ +using System; +using CalamityMod.Systems.Graphic.PixelationSystem; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class CustomColorChangeSpark : Particle + { + public Color InitialColor; + public Color EndColor; + public bool AffectedByGravity; + public bool FadeIn = false; + public float FadeInScale = 0f; + public bool GlowCenter = false; + public float GlowCenterScale = 1; + public float GlowOpacity = 1; + public string NewTexture; + public float ExtraRotation; + public Vector2 Stretch = new Vector2(0.5f, 1.6f); + public float ShrinkSpeed = 0; + public bool FlipHorizontal = false; + public bool NoShrink = false; + public float Spin = 0; + public float ColorFadeSpeed = 0; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public bool AltVisual = true; + public override bool UseAdditiveBlend => AltVisual; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public CustomColorChangeSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color startColor, Color endColor, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0, float colorFadeSpeed = 3) + { + Position = relativePosition; + Velocity = velocity; + NewTexture = texture; + ExtraRotation = extraRotation; + AffectedByGravity = affectedByGravity; + AffectedByLight = affectedByLight; + Scale = scale; + Stretch = stretch; + FadeInScale = scale; + Lifetime = lifetime; + Color = InitialColor = startColor; + EndColor = endColor; + ShrinkSpeed = shrinkSpeed; + + AltVisual = useAddativeBlend; + GlowCenter = glowCenter; + GlowCenterScale = glowCenterScale; + GlowOpacity = glowOpacity; + FlipHorizontal = flipHorizontal; + NoShrink = noShrink; + + FadeIn = fadeIn; + + if (FadeIn) + Scale = 0f; + Spin = spin; + ColorFadeSpeed = colorFadeSpeed; + } + + public override void Update() + { + if (!FadeIn) + { + if (!NoShrink) + Scale *= 0.95f; + Color = Color.Lerp(InitialColor, EndColor, LifetimeCompletion); + } + else + { + if ((float)Time / (float)Lifetime < 0.5f) + { + Scale = MathHelper.Lerp(Scale, FadeInScale, 0.2f); + } + else + { + Scale = MathHelper.Lerp(Scale, FadeInScale, -0.21f); + } + } + Velocity *= 0.95f; + if (Velocity.Length() < 12f && AffectedByGravity) + { + Velocity.X *= 0.94f; + Velocity.Y += 0.25f; + } + ExtraRotation += Spin; + Rotation = Velocity.ToRotation() + MathHelper.PiOver2 + ExtraRotation; + + Stretch.X *= (1 - 0.2f * ShrinkSpeed); + Stretch.Y *= (1 + 0.2f * ShrinkSpeed); + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Vector2 scale = Stretch * Scale; + Texture2D texture = ModContent.Request(NewTexture).Value; + + float scaleMult = 1; + if (Main.zenithWorld) + { + DateTime day = DateTime.Now; + if (day.DayOfWeek == DayOfWeek.Tuesday) + { + Texture2D joke = ModContent.Request("CalamityMod/Particles/MammothParticle").Value; + scaleMult = (MathHelper.Lerp(texture.Size().X / joke.Size().X, texture.Size().Y / joke.Size().Y, 0.5f)); + texture = joke; + AltVisual = true; + } + } + + Color col = Color; + + if (AffectedByLight) + { + col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); + } + + if (Pixelate) + { + PixelationManager.AddPixelatedDrawer((_) => + { + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, col * fadeOut, Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.White, 0.8f) * fadeOut * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + }, Enums.GeneralDrawLayer.AfterProjectiles, UseAdditiveBlend ? BlendState.Additive : null); + } + else + { + float fadeOut = (1 - (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, col * fadeOut, Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.White, 0.8f) * fadeOut * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + } + } + } +} diff --git a/Particles/CustomSpark.cs b/Particles/CustomSpark.cs index 72087bb46b..295709d63d 100644 --- a/Particles/CustomSpark.cs +++ b/Particles/CustomSpark.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -22,13 +23,14 @@ namespace CalamityMod.Particles public bool FlipHorizontal = false; public bool NoShrink = false; public float Spin = 0; + public float ColorFadeSpeed = 0; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public bool AltVisual = true; public override bool UseAdditiveBlend => AltVisual; public override bool SetLifetime => true; public override bool UseCustomDraw => true; - public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0) + public CustomSpark(Vector2 relativePosition, Vector2 velocity, string texture, bool affectedByGravity, int lifetime, float scale, Color color, Vector2 stretch, bool useAddativeBlend = true, bool glowCenter = false, float extraRotation = 0, bool fadeIn = false, bool affectedByLight = false, float shrinkSpeed = 0, float glowCenterScale = 1, float glowOpacity = 1, bool flipHorizontal = false, bool noShrink = false, float spin = 0, float colorFadeSpeed = 3) { Position = relativePosition; Velocity = velocity; @@ -55,6 +57,7 @@ namespace CalamityMod.Particles if (FadeIn) Scale = 0f; Spin = spin; + ColorFadeSpeed = colorFadeSpeed; } public override void Update() @@ -63,7 +66,7 @@ namespace CalamityMod.Particles { if (!NoShrink) Scale *= 0.95f; - Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)); + Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, ColorFadeSpeed)); } else { @@ -114,9 +117,21 @@ namespace CalamityMod.Particles col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGB(Color); } - spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); - if (GlowCenter) - spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + if (Pixelate) + { + PixelationManager.AddPixelatedDrawer((_) => + { + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + }, Enums.GeneralDrawLayer.AfterProjectiles, UseAdditiveBlend ? BlendState.Additive : null); + } + else + { + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(col, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)), Rotation, texture.Size() * 0.5f, scale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f); + if (GlowCenter) + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.Lerp(Color.Lerp(col, Color.White, 0.8f), Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D)) * GlowOpacity, Rotation, texture.Size() * 0.5f, scale * 0.8f * GlowCenterScale * scaleMult, FlipHorizontal ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + } } } } diff --git a/Particles/ThrusterParticle.cs b/Particles/ThrusterParticle.cs new file mode 100644 index 0000000000..92179e0b8e --- /dev/null +++ b/Particles/ThrusterParticle.cs @@ -0,0 +1,219 @@ +using System; +using CalamityMod.Enums; +using CalamityMod.Items.Accessories; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using rail; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class ThrusterParticle : Particle + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override bool SetLifetime => true; + public override bool UseCustomDraw => true; + + public Vector2[] Path = new Vector2[2]; + public Vector2 DashDirection; + private VertexPositionColorTexture[] vertices; + private BasicEffect effect; + + private Vector2 lastPlayerCenter; + private Vector2[] pos = new Vector2[20]; + public float length; + private int time; + private Player Owner; + private int ColorSelection; + + private static readonly Color[] V8Colors = + { + Color.White, + Color.Yellow, + Color.OrangeRed, + Color.Red, + Color.Transparent + }; + + private static readonly Color[] V8000Colors = +{ + Color.White, + Color.LightBlue, + Color.LightCyan, + Color.Cyan, + Color.Transparent + }; + Vector2 GetPlayerDrawCenter(Player p) + { + return p.Center + new Vector2(0f, p.gfxOffY); + } + + public ThrusterParticle(Player player, Vector2 direction, int lifetime, float scale, int colors) + { + Owner = player; + + Position = player.Center; + Velocity = direction; + Scale = scale; + Lifetime = lifetime; + ColorSelection = colors; + + Vector2 start = GetPlayerDrawCenter(player); + Vector2 dir = direction; + + if (dir == Vector2.Zero) + dir = Vector2.UnitX; + + dir.Normalize(); + + length = scale; + Vector2 tip = start + dir * length; + + for (int i = 0; i < pos.Length; i++) + { + float t = i / (float)(pos.Length - 1); + pos[i] = Vector2.Lerp(start, tip, t); + } + + lastPlayerCenter = start; + } + + public override void Update() + { + Path[0] = GetPlayerDrawCenter(Owner); + Path[^1] = Position; + + float lifeProgress = 1f - (time / (float)Lifetime); + if (lifeProgress < 0f) + lifeProgress = 0f; + if (lifeProgress > 1f) + lifeProgress = 1f; + + time++; + + } + + private Color SampleGradient(float t) + { + Color[] ThrusterGradient = ColorSelection == 1 ? V8000Colors : V8Colors; + + t = MathHelper.Clamp(t, 0, 1); + float scaled = t * (ThrusterGradient.Length - 1); + + int index = (int)scaled; + int next = Math.Min(index + 1, ThrusterGradient.Length - 1); + + float interp = scaled - index; + + return Color.Lerp(ThrusterGradient[index], ThrusterGradient[next], interp); + } + + private void BuildPrimitive() + { + int count = pos.Length - 1; + + if (vertices == null || vertices.Length != count * 2) + vertices = new VertexPositionColorTexture[count * 2]; + + float width = 18f; + float lifeProgress = 1f - (time / (float)Lifetime); + + float widthFactor = MathF.Sin(lifeProgress); + + for (int i = 0; i < count; i++) + { + Vector2 current = pos[i]; + + Vector2 direction; + + if (i == count - 1) + direction = pos[i] - pos[i - 1]; + else + direction = pos[i + 1] - pos[i]; + + if (direction == Vector2.Zero) + direction = Vector2.UnitX; + + direction.Normalize(); + + Vector2 normal = direction.RotatedBy(MathHelper.PiOver2); + + float progress = i / (float)(count - 1); + float profile = 0; + if (length < 100) + profile = (float)Math.Sinh(progress * MathHelper.PiOver2) * 1.8f + 0.2f; + else + profile = (float)Math.Sin(progress * Math.PI) * 0.8f + 0.2f; + + float scaledWidth = width * profile * widthFactor; + + Vector2 left = current - normal * scaledWidth; + Vector2 right = current + normal * scaledWidth; + + Color color = SampleGradient(progress); + + vertices[i * 2] = new VertexPositionColorTexture( + new Vector3(left - Main.screenPosition, 0), + color, + new Vector2(progress, 0)); + + vertices[i * 2 + 1] = new VertexPositionColorTexture( + new Vector3(right - Main.screenPosition, 0), + color, + new Vector2(progress, 1)); + } + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + if (pos == null || pos.Length < 2) + return; + + Vector2 drawCenter = GetPlayerDrawCenter(Owner); + Vector2 delta = drawCenter - lastPlayerCenter; + + for (int i = 0; i < pos.Length; i++) + pos[i] += delta; + + lastPlayerCenter = drawCenter; + BuildPrimitive(); + + GraphicsDevice device = Main.graphics.GraphicsDevice; + + RasterizerState rasterizer = new RasterizerState { CullMode = CullMode.None, FillMode = FillMode.Solid }; + + effect ??= new BasicEffect(device) + { + VertexColorEnabled = true, + TextureEnabled = false, + Projection = Matrix.CreateOrthographicOffCenter( + 0, + Main.screenWidth, + Main.screenHeight, + 0, + -1, + 1) + }; + effect.World = Matrix.Identity; + effect.View = Main.GameViewMatrix.ZoomMatrix; + + device.RasterizerState = rasterizer; + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointWrap, default, device.RasterizerState, null, Main.GameViewMatrix.TransformationMatrix); + foreach (EffectPass pass in effect.CurrentTechnique.Passes) + { + pass.Apply(); + + device.DrawUserPrimitives( + PrimitiveType.TriangleStrip, + vertices, + 0, + vertices.Length - 2); + } + } + } +} diff --git a/Prefixes/AccessoryPrefix.cs b/Prefixes/AccessoryPrefix.cs index 389f304da9..5a2128f08a 100644 --- a/Prefixes/AccessoryPrefix.cs +++ b/Prefixes/AccessoryPrefix.cs @@ -11,9 +11,10 @@ namespace CalamityMod.Prefixes public new string LocalizationCategory => "Prefixes.Accessory"; public override PrefixCategory Category => PrefixCategory.Accessory; + public static float GetPartialLifeRegenAmount = 0.5f; public override void ApplyAccessoryEffects(Player player) { - player.lifeRegen += GetLifeRegenAmount(); + player.Calamity().partialLifeRegen += GetPartialLifeRegenAmount; } public override void ModifyValue(ref float valueMult) @@ -24,17 +25,11 @@ namespace CalamityMod.Prefixes public LocalizedText LifeRegenTooltip => CalamityUtils.GetText($"{LocalizationCategory}.LifeRegenTooltip"); public override IEnumerable GetTooltipLines(Item item) { - var perSecHP = (GetLifeRegenAmount() / 2.0f).ToString("0.#"); - yield return new TooltipLine(Mod, "CalamityMod:PrefixLifeRegenBoost", LifeRegenTooltip.Format(perSecHP)) + yield return new TooltipLine(Mod, "CalamityMod:PrefixLifeRegenBoost", LifeRegenTooltip.Format(GetPartialLifeRegenAmount.ToRegenPerSecond())) { IsModifier = true }; } - - public static int GetLifeRegenAmount() - { - return 1; - } } public class Dauntless : ModPrefix, ILocalizedModType @@ -63,7 +58,7 @@ namespace CalamityMod.Prefixes public static int GetHealthBoostAmount() { - return 15; + return 20; } } } diff --git a/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs b/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs index 8d7d538926..88bec366ee 100644 --- a/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs +++ b/Prefixes/VanillaPrefixChanges/DefensePrefixChanges.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Prefixes.VanillaPrefixChanges public override IEnumerator PopulateStats() { - yield return new PrefixDefenseStat(5); + yield return new PrefixDRStat(0.03f); } } @@ -47,7 +47,6 @@ namespace CalamityMod.Prefixes.VanillaPrefixChanges public override IEnumerator PopulateStats() { yield return new PrefixDefenseStat(4); - yield return new PrefixDRStat(0.01f); } } } diff --git a/Projectiles/BaseProjectiles/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/BrainOfCthulhu/BloodBomb.cs b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs index 686fb8adac..9caa3a9e92 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodBomb.cs @@ -29,6 +29,7 @@ public class BloodBomb : ModNPC, ILocalizedModType { NPCID.Sets.ProjectileNPC[Type] = true; BloodBombYellow = ModContent.Request("CalamityMod/Projectiles/Boss/BrainOfCthulhu/BloodBomb2"); + this.HideFromBestiary(); } internal static Texture2D GetBombGlow() diff --git a/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs b/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs index c956e3bf77..083822adac 100644 --- a/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs +++ b/Projectiles/Boss/BrainOfCthulhu/BloodScythe.cs @@ -44,6 +44,7 @@ public class BloodScythe : ModProjectile, ILocalizedModType Projectile.damage = 10; Projectile.scale = 0.1f; Projectile.hostile = true; + Projectile.Calamity().DealsDefenseDamage = true; } public override void OnSpawn(IEntitySource source) @@ -90,12 +91,9 @@ public class BloodScythe : ModProjectile, ILocalizedModType public override bool PreDraw(ref Color lightColor) { - Main.spriteBatch.SetBlendState(BlendState.Additive); Texture2D tex = TextureAssets.Projectile[Type].Value; Vector2 drawPos = Projectile.Center - Main.screenPosition; - Color drawColor = Color.Red; - if (!ChildSafety.Disabled) - drawColor = Main.DiscoColor; + Color drawColor = (ChildSafety.Disabled ? Color.Red : Main.DiscoColor) with { A = 0 }; for (int i = 0; i < (CalamityClientConfig.Instance.Afterimages ? Projectile.oldPos.Length : 1); ++i) { @@ -106,11 +104,9 @@ public class BloodScythe : ModProjectile, ILocalizedModType // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES. float interpolant = ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(tex, drawPos, null, drawColor, afterimageRot, tex.Size() * 0.5f, Projectile.scale * interpolant, SpriteEffects.None, 0f); + Main.EntitySpriteDraw(tex, drawPos, null, drawColor, afterimageRot, tex.Size() * 0.5f, Projectile.scale * interpolant, SpriteEffects.None); } - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - return false; } } diff --git a/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs b/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs index 8e6996e16b..961f091fb3 100644 --- a/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs +++ b/Projectiles/Boss/BrainOfCthulhu/TelekineticEnemyGrab.cs @@ -46,6 +46,7 @@ public class TelekineticEnemyGrab : ModProjectile, ILocalizedModType Projectile.hostile = true; if(NPC.crimsonBoss != -1) MyTarget = Main.npc[NPC.crimsonBoss].target; + Projectile.Calamity().DealsDefenseDamage = true; } public override void OnSpawn(IEntitySource source) diff --git a/Projectiles/Boss/DeusRitualDrama.cs b/Projectiles/Boss/DeusRitualDrama.cs index 95812d46ba..9c2a1b7d4a 100644 --- a/Projectiles/Boss/DeusRitualDrama.cs +++ b/Projectiles/Boss/DeusRitualDrama.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss public const int TotalSinePeriods = 6; public const int PulseTime = 45; public const int TotalRitualTime = 420; - public const float MaxUpwardRise = 540f; + public const float MaxUpwardRise = 900f; public static readonly Point PulseSize = new(300, 300); public override void SetDefaults() { @@ -42,11 +42,17 @@ namespace CalamityMod.Projectiles.Boss Time++; if (Time == TotalRitualTime - PulseTime) { + SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, Projectile.Center); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType(), 1); + int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)(MaxUpwardRise * 3f), ModContent.NPCType(), 1); if (idx != -1) + { CalamityUtils.BossAwakenMessage(idx); + Main.npc[idx].velocity = Vector2.UnitY * 20f; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx); + } } } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index e1190825cb..3abbfc578f 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = TimeLeft; CooldownSlot = ImmunityCooldownID.Bosses; + Projectile.scale = 0; } public override void OnSpawn(IEntitySource source) @@ -66,6 +67,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (Projectile.scale < 1) + Projectile.scale += 0.05f; ProvUtils.ApplyGFBDamage(Projectile, 180, 20); Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f); @@ -162,7 +165,7 @@ namespace CalamityMod.Projectiles.Boss totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = ModContent.ProjectileType(); float velocity = 5f; Vector2 spinningPoint = new Vector2(0f, -velocity); Vector2 additionalVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f; diff --git a/Projectiles/Boss/HolyBlastFrags.cs b/Projectiles/Boss/HolyBlastFrags.cs new file mode 100644 index 0000000000..16c01fc3a1 --- /dev/null +++ b/Projectiles/Boss/HolyBlastFrags.cs @@ -0,0 +1,187 @@ +using System; +using System.Linq; +using CalamityMod.Graphics.Primitives; +using CalamityMod.NPCs.Providence; +using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class HolyBlastFrags : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire2"; + + public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; + Main.projFrames[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.width = 26; + Projectile.height = 26; + Projectile.hostile = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = 600; + CooldownSlot = ImmunityCooldownID.Bosses; + } + + public override void AI() + { + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); + + Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); + + Projectile.frameCounter++; + if (Projectile.frameCounter > 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 3) + Projectile.frame = 0; + + float maxVelocity = Projectile.ai[0] == 0f ? 7f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; + if (Math.Abs(Projectile.velocity.X) < maxVelocity) + Projectile.velocity.X *= 1.05f; + + int playerTracker = Player.FindClosest(Projectile.Center, 1, 1); + + Projectile.ai[1] += 1f; + if (Projectile.ai[1] < 180f && Projectile.ai[1] > 60f) + { + float projVelocityMult = Projectile.velocity.Length(); + Vector2 playerDirection = Main.player[playerTracker].Center - Projectile.Center; + playerDirection.Normalize(); + playerDirection *= projVelocityMult; + float inertia = !ProvUtils.StandardAI() ? 20f : 25f; + Projectile.velocity = (Projectile.velocity * (inertia - 1f) + playerDirection) / inertia; + Projectile.velocity.Normalize(); + Projectile.velocity *= projVelocityMult; + } + + float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f); + + if (Projectile.timeLeft % 3 == 0) + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); + + if (Main.rand.NextBool()) + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); + + Projectile.rotation = MathHelper.Lerp(0f, MathHelper.WrapAngle(Vector2.Zero.AngleTo(Projectile.velocity) + MathHelper.ToRadians(-90f)), Math.Clamp(vel, 0f, 1f)); + } + + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(lightColor); + + public override bool PreDraw(ref Color lightColor) + { + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(12).ToList(); + + list.Insert(0, Projectile.position + (Projectile.rotation+MathHelper.PiOver2 * Projectile.spriteDirection).ToRotationVector2() * 16f); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); + Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; + int framing = texture.Height / Main.projFrames[Type]; + int y6 = framing * Projectile.frame; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); + return false; + } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 38f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + Projectile.position.X = Projectile.position.X + (Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y + (Projectile.height / 2); + Projectile.width = 40; + Projectile.height = 40; + Projectile.position.X = Projectile.position.X - (Projectile.width / 2); + Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2); + int dustType = ProvUtils.GetDustID(); + for (int i = 0; i < 5; i++) + { + int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[holyDust].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[holyDust].scale = 0.5f; + Main.dust[holyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int j = 0; j < 10; j++) + { + int holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 3f); + Main.dust[holyDust2].noGravity = true; + holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); + Main.dust[holyDust2].noGravity = true; + } + } + + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + // If the player is dodging, don't apply debuffs + if (info.Damage <= 0 || target.creativeGodMode) + return; + + ProvUtils.ApplyDebuffs(target, 120); + } + } +} diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 33bbb2ddf3..8222ad36d4 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.tileCollide = false; CooldownSlot = ImmunityCooldownID.Bosses; + Projectile.scale = 0; } public override void OnSpawn(IEntitySource source) @@ -46,6 +47,8 @@ namespace CalamityMod.Projectiles.Boss } public override void AI() { + if (Projectile.scale < 1) + Projectile.scale += 0.1f; ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index cddfda4371..1b5bd9cb67 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -1,11 +1,16 @@ using System; +using System.Linq; using CalamityMod.Dusts; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -17,6 +22,11 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 32; + ProjectileID.Sets.TrailingMode[Type] = 2; + } public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -24,11 +34,11 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.alpha = 255; CooldownSlot = ImmunityCooldownID.Bosses; Projectile.penetrate = 1; Projectile.timeLeft = 200; Projectile.Calamity().DealsDefenseDamage = true; + Projectile.MaxUpdates = 4; } public override void AI() @@ -44,74 +54,168 @@ namespace CalamityMod.Projectiles.Boss started = true; } - if (Projectile.ai[0] < 240f) + if (Projectile.FinalExtraUpdate()) { - Projectile.ai[0] += 1f; + if (Projectile.ai[0] < 240f) + { + Projectile.ai[0] += 1f; - if (Projectile.timeLeft < 160) - Projectile.timeLeft = 160; + if (Projectile.timeLeft < 160) + Projectile.timeLeft = 160; + } + + if (Main.getGoodWorld) + { + if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) + { + Projectile.velocity *= 1.02f; + } + else + { + Projectile.ai[1] += 0.05f; + Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); + } + } + else if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; + + Projectile.localAI[1] += (Projectile.velocity.Length() / 20); } - if (Main.getGoodWorld) - { - if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) - { - Projectile.velocity *= 1.02f; - } - else - { - Projectile.ai[1] += 0.05f; - Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1]))); - } - } - else if (Projectile.velocity.Length() < 16f) - Projectile.velocity *= 1.01f; - - Projectile.localAI[1] += (Projectile.velocity.Length() / 20); - - Color col = ProvUtils.GetProjectileColor(255); - float vel = MathHelper.Clamp(Projectile.velocity.Length() / 5, 0, 1.5f); - GlowOrbParticle p = new GlowOrbParticle(Projectile.Center, Projectile.velocity + new Vector2(Main.rand.NextFloat(vel * 2), 0).RotatedByRandom(MathHelper.TwoPi), false, 4, 1f, col); - GeneralParticleHandler.SpawnParticle(p); - //Trail for visibilty - GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center + Projectile.velocity, Vector2.Zero, col, "CalamityMod/Particles/BlastCone", new Vector2(3f, 2f), Vector2.Zero.AngleFrom(Projectile.velocity), 1f, 0f, 3)); + Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); } public override bool PreDraw(ref Color lightColor) { - float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; - Color baseColor2 = ProvUtils.GetProjectileColor(255); - baseColor.A = 0; - baseColor *= lerpMult; - baseColor2 *= lerpMult; - Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult-1)*0.5f + 1f); + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + using (Main.spriteBatch.Scope()) + { + using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) + { - Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); + var len = Math.Min(Projectile.oldPos.Length, 32); + for (var i = 0; i < len; i++) + { + Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size*0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color color = FireColorFunction(i / (float)len, Projectile.oldPos[i]); + var color2 = ProvUtils.GetProjectileColor(255,true); + float width = FireWidthFunction(i / (float)len, Projectile.oldPos[i]); + Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0}) * (1- i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) /tex.Width * 0.25f, SpriteEffects.None, 0f); + } + Main.spriteBatch.End(); + } + } - float upRight = MathHelper.PiOver4; - float up = MathHelper.PiOver2; - float upLeft = 3f * MathHelper.PiOver4; - float left = MathHelper.Pi; - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4; + Color baseColor2 = ProvUtils.GetProjectileColor(255); + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + + scale = new Vector2(1f, 1f); + texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, baseColor2, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * Projectile.Opacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 32f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 24; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 8cfcd2206d..ca2de7a011 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -1,11 +1,16 @@ using System; +using System.Linq; +using CalamityMod.Graphics.Primitives; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -30,10 +35,16 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = 600; CooldownSlot = ImmunityCooldownID.Bosses; + + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void AI() { + + ProjectileID.Sets.TrailCacheLength[Type] = 15; + ProjectileID.Sets.TrailingMode[Type] = 2; ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -68,7 +79,8 @@ namespace CalamityMod.Projectiles.Boss float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f); - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); + if (Projectile.timeLeft % 3 == 0) + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); if (Main.rand.NextBool()) GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); @@ -80,6 +92,30 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { + + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var lease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + using (lease.Scope(clearColor: Color.Transparent)) + { + var list = Projectile.oldPos.Take(8).ToList(); + + list.Insert(0, Projectile.position + (Projectile.rotation + MathHelper.PiOver2 * Projectile.spriteDirection).ToRotationVector2() * 16f); + + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(list.ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(lease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + + Main.spriteBatch.Begin(ss); Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyFire2Night").Value; int framing = texture.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; @@ -87,6 +123,31 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 16f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = ProvUtils.GetProjectileColor(255); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index d59abcff35..7981939956 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,7 +1,11 @@ using System; +using System.Linq; using CalamityMod.Dusts; using CalamityMod.Enums; +using CalamityMod.NPCs.Providence; using CalamityMod.Particles; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -16,7 +20,11 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public override string Texture => "CalamityMod/Projectiles/StarProj"; - + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 32; + ProjectileID.Sets.TrailingMode[Type] = 2; + } public override void SetDefaults() { Projectile.localAI[1] = Main.rand.NextFloat(30f); @@ -25,9 +33,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.alpha = 255; Projectile.penetrate = 1; Projectile.timeLeft = 200; + Projectile.MaxUpdates = 4; } public override void OnSpawn(IEntitySource source) @@ -46,17 +54,21 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Lighting.AddLight(Projectile.Center, 0f, 0.6f, 0f); - - if (Projectile.ai[0] < 240f) + if (Projectile.FinalExtraUpdate()) { - Projectile.ai[0] += 1f; + if (Projectile.ai[0] < 240f) + { + Projectile.ai[0] += 1f; - if (Projectile.timeLeft < 160) - Projectile.timeLeft = 160; + if (Projectile.timeLeft < 160) + Projectile.timeLeft = 160; + } + + if (Projectile.velocity.Length() < 16f) + Projectile.velocity *= 1.01f; } - if (Projectile.velocity.Length() < 16f) - Projectile.velocity *= 1.01f; + Projectile.position -= (Projectile.velocity / Projectile.MaxUpdates) * (Projectile.MaxUpdates - 1); int index = Player.FindClosest(Projectile.position, Projectile.width, Projectile.height); Player player = Main.player[index]; @@ -71,54 +83,141 @@ namespace CalamityMod.Projectiles.Boss NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, index, healAmt); Projectile.Kill(); } - - Color col = new Color(54, 209, 54); - Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.8f, false, 5, 0.06f, col * 0.85f, new Vector2(1, 0.3f), true, false, 1.5f); - GeneralParticleHandler.SpawnParticle(spark); } public override bool PreDraw(ref Color lightColor) { - float vel = Projectile.velocity.Length() / 8; - Projectile.localAI[1] += vel; + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; - Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Color brightGreen = new Color(54, 209, 54, 0); - Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Vector2 halfTextureSize = drawTexture.Size() / 2f; - Color halfBrightGreen = brightGreen * 0.5f; - float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); - Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); - Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; - Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; - brightGreen *= timeLeftColorScale; - halfBrightGreen *= timeLeftColorScale; + using (ProvUtils.SecondaryLease.Scope(clearColor: Color.Transparent)) + { + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + var tex = GeneralParticleHandler.GetTexture(GeneralParticleHandler.particleIDsByTypes[typeof(BloomParticle)]); + var len = Math.Min(Projectile.oldPos.Length, 32); + for (var i = 0; i < len; i++) + { + Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color color = FireCoreColorFunction(i / (float)len, Projectile.oldPos[i]); + var color2 = new Color(0, 25, 0); + float width = FireWidthFunction(i / (float)len, Projectile.oldPos[i]); + Main.spriteBatch.Draw(tex, drawPos, null, (color2 with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(tex, drawPos, null, (color with { A = 0 }) * (1 - i / (float)len), 0f, tex.Size() * 0.5f, new Vector2(width) / tex.Width * 0.25f, SpriteEffects.None, 0f); + } + Main.spriteBatch.End(); + } - Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + using (ProvUtils.PrimaryLease.Scope(clearColor: Color.Transparent)) + { - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(ProvUtils.SecondaryLease.Target, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); - Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + float vel = Projectile.velocity.Length() / 8; + Projectile.localAI[1] += vel; + Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Color brightGreen = new Color(54, 209, 54, 0); + Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Vector2 halfTextureSize = drawTexture.Size() / 2f; + Color halfBrightGreen = brightGreen * 0.5f; + float timeLeftColorScale = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + Projectile.rotation += MathHelper.ToRadians(timeLeftColorScale * 2f); + Vector2 timeLeftDrawEffect = new Vector2(0.5f, 1f) * timeLeftColorScale; + Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale; + brightGreen *= timeLeftColorScale; + halfBrightGreen *= timeLeftColorScale; + + Vector2 position3 = projDirection + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver2 - Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, 0f - Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, brightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 + Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(drawTexture, position3, null, halfBrightGreen, MathHelper.PiOver4 * 3f + Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.36f, spriteEffects, 0); + var scale = new Vector2(1f, 1f); + var texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, new Color(54, 209, 54), 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(ProvUtils.PrimaryLease.Target, Vector2.Zero, null, Color.White * Projectile.Opacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); return false; } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 32f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = new Color(54, 209, 54) * 1.3f; + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, endColor, completion) * Projectile.Opacity; + } + + public float FireCoreWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = Projectile.scale * 24; + float curveRatio = 0.25f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + + if (completion < curveRatio) + width = MathF.Sin(completion / curveRatio * MathHelper.PiOver2) * maxBodyWidth + curveRatio; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + return width * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireCoreColorFunction(float completion, Vector2 pos) + { + Color mainColor = new Color(54, 209, 54); + Color tipColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + Color fullBodyColor = Color.Lerp(mainColor, tipColor, completion); + return Color.Lerp(fullBodyColor, Color.White, 0.175f) * Projectile.Opacity; + } public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item14 with { Pitch = -0.3f, Volume = 0.7f }, Projectile.Center); SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/PlantyMushMine", 3); SoundEngine.PlaySound(fireHeal with { Volume = 0.5f, Pitch = 0.3f }, Projectile.Center); - Color particleColor = new Color(54, 209, 54); + Color particleColor = new Color(54, 209, 54); Color smokeColor = Color.Lerp(particleColor, Color.DarkSlateGray, 0.5f); Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0f, 0.06f, 18); GeneralParticleHandler.SpawnParticle(pulse); diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 3ba0c09874..c5a137939a 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -161,10 +161,11 @@ namespace CalamityMod.Projectiles.Boss int blobAmt = !ProvUtils.StandardAI() ? 9 : 6; if (Projectile.owner == Main.myPlayer) { - Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X * 0.1f, Projectile.velocity.Y); + Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X, Projectile.velocity.Y); for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; + velocity.Y = -Math.Abs(velocity.Y); if (Main.getGoodWorld) velocity *= 2f; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index e74a89430b..8a3f8a176c 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.height = 12; Projectile.hostile = true; Projectile.penetrate = -1; - Projectile.timeLeft = 900; + Projectile.timeLeft = 120; Projectile.scale = 1.5f; CooldownSlot = ImmunityCooldownID.Bosses; } @@ -65,9 +65,6 @@ namespace CalamityMod.Projectiles.Boss { if (!inLava) { - if (Projectile.velocity.Y < 0f) - Projectile.velocity.Y = 0f; - Projectile.velocity.Y += 0.15f; } } 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 30b2834719..f69127303d 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. @@ -251,6 +260,10 @@ namespace CalamityMod.Projectiles /// If true, this projectile is from a rogue stealth strike. The primary variable responsible for triggering stealth strike effects. public bool stealthStrike = false; /// + /// If true, this projectile is spawned from a stealth strike, but is not a primary projectile. Used to avoid proccing things like Raiders Talisman. + /// + public bool stealthStrikeSubProjectile = false; + /// /// Number of times this stealth strike projectile has pierced an enemy.
/// Used to limit the number of times a projectile can proc certain effects from rogue accessories. ///
@@ -327,7 +340,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. @@ -398,6 +411,13 @@ namespace CalamityMod.Projectiles if (e.Context == "SetBonus_GhostHurt") projectile.damage /= 2; } + + if (source is EntitySource_Parent { Entity: Projectile proj }) + { + if (proj.Calamity().stealthStrike || proj.Calamity().stealthStrikeSubProjectile) + stealthStrikeSubProjectile = true; + } + } public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) => binaryWriter.Write(ParentNPCIndex); public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) => ParentNPCIndex = binaryReader.ReadInt32(); @@ -420,6 +440,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); } @@ -776,6 +800,12 @@ namespace CalamityMod.Projectiles return false; } + // This has extra updates but increments lifespan through AI slots, so we need to offset that + else if (projectile.type == ProjectileID.WeatherPainShot) + { + if (!projectile.FinalExtraUpdate()) + projectile.ai[1]--; + } else if (projectile.type == ProjectileID.BloodShot) { @@ -3054,7 +3084,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 +3204,7 @@ namespace CalamityMod.Projectiles } - case CalamityPlayer.FishingMinigames.ScoriaBobber: + case CalamityPlayer.FishingMinigames.VolcanicSinker: { if (PersistentFishingData == -1) { @@ -3299,7 +3329,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 +3418,7 @@ namespace CalamityMod.Projectiles break; - case CalamityPlayer.FishingMinigames.NavystoneBobber: + case CalamityPlayer.FishingMinigames.SunkenSinker: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3558,7 +3588,7 @@ namespace CalamityMod.Projectiles return false; - case CalamityPlayer.FishingMinigames.SkylineBobber: + case CalamityPlayer.FishingMinigames.AcrobaticBobber: { if (CatchTime < 0 || (isReelingIn == 1 && CaughtItemID > 0)) { @@ -3783,17 +3813,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; } @@ -3868,20 +3887,14 @@ namespace CalamityMod.Projectiles } #region Flail Extendo Hacks - // Very hacky solution for making Dao of Pow's flail throw travel farther and faster + // Very hacky solution for making Dao of Pow's flail throw travel faster if (projectile.type == ProjectileID.TheDaoofPow) { // Guide to ai[0]: // 0: Spinning. 1: Being thrown. 2: Return after throw. 6: Dropped on ground. 4: Return after being dropped. if (projectile.ai[0] == 1f) { - if (projectile.ai[1] > 0f) - { - projectile.ai[2]++; - if (projectile.ai[2] <= 11f) // When ai[1] reaches 14, it starts returning, so this makes it take an extra 11 frames to return - projectile.ai[1]--; - } - else + if (projectile.ai[1] == 0f) projectile.velocity *= 1.33f; } } @@ -3903,15 +3916,10 @@ namespace CalamityMod.Projectiles { if (projectile.ai[0] == 1f) { - if (projectile.ai[1] > 0f) - { - projectile.ai[2]++; - if (projectile.ai[2] <= 5f) // When ai[1] reaches 12, it starts returning, so this makes it take an extra 5 frames to return - projectile.ai[1]--; - } - else - projectile.velocity *= 1.33f; + if (projectile.ai[1] == 0f) + projectile.velocity *= 1.25f; } + // Return speed is also increased using an IL edit, because why does it have a slower return speed than Dao of Pow??? } #endregion @@ -4095,20 +4103,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 +4299,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 +4615,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) @@ -4665,9 +4689,7 @@ namespace CalamityMod.Projectiles else if (modPlayer.vampiricTalisman && projectile.Calamity().stealthStrike) { target.AddBuff(BuffType(), VampiricTalisman.ArmorCrunchDebuffTime); - - if (!modPlayer.nanotech) - target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); + target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); } if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash) @@ -4698,6 +4720,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) { @@ -4717,17 +4743,34 @@ namespace CalamityMod.Projectiles } // Scuttler's Jewel projectiles can spawn either on-hit or on-kill, but only spawn once per projectile. - if (projectile.owner == Main.myPlayer && !projectile.npcProj && !projectile.trap && projectile.CountsAsClass() && modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0 && !JewelSpikeSpawned) + if (projectile.owner == Main.myPlayer && !projectile.npcProj && !projectile.trap && projectile.CountsAsClass() && !CannotProc) { - int damage = (int)player.GetTotalDamage().ApplyTo(16); + if (modPlayer.scuttlersJewel && stealthStrike && !JewelSpikeSpawned) + { + int damage = (int)player.GetTotalDamage().ApplyTo(16); - int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); - Main.projectile[spike].frame = 4; - if (spike.WithinBounds(Main.maxProjectiles)) - Main.projectile[spike].DamageType = DamageClass.Generic; - modPlayer.scuttlerCooldown = 30; - JewelSpikeSpawned = true; + int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); + Main.projectile[spike].frame = 4; + JewelSpikeSpawned = true; + } + if (modPlayer.etherealExtorter && extorterBoost && Main.player[projectile.owner].ownedProjectileCounts[ProjectileType()] < 5) + { + for (int i = 0; i < 2; i++) + { + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + + int damage = (int)player.GetTotalDamage().ApplyTo(EtherealExtorter.soulDamage); + + int soul = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileType(), damage, 0f, projectile.owner); + Main.projectile[soul].tileCollide = false; + if (soul.WithinBounds(Main.maxProjectiles)) + Main.projectile[soul].DamageType = DamageClass.Generic; + } + extorterBoost = false; + } } + + } #endregion @@ -4763,16 +4806,13 @@ namespace CalamityMod.Projectiles // Hyperius Overflow if (projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType() && target.Calamity().hyperiusMarked) { - int damage = 0; - if (target.Calamity().hyperiusDamage < damageDone) - damage = damageDone - target.Calamity().hyperiusDamage; - else - damage = damageDone; + int damageDealt = (int)(damageDone * HyperiusBullet.overflowAppliedMult); + int damage = (int)MathF.Min(target.Calamity().hyperiusDamage / HyperiusBullet.overflowEfficency, damageDealt); - target.Calamity().hyperiusDamage -= damage; + target.Calamity().hyperiusDamage -= (int)(damage * HyperiusBullet.overflowEfficency); // Spawn overflow hit - Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, projectile.owner, target.whoAmI); + Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), damage, 0, projectile.owner, target.whoAmI); overflow.DamageType = projectile.DamageType; overflow.ArmorPenetration = projectile.ArmorPenetration; // Takes the armor pen from what did the hit @@ -5206,17 +5246,18 @@ namespace CalamityMod.Projectiles { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int damage = (int)player.GetTotalDamage().ApplyTo(20); + int damage = (int)player.GetTotalDamage().ApplyTo(EtherealExtorter.soulDamage); int soul = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileType(), damage, 0f, projectile.owner); Main.projectile[soul].tileCollide = false; if (soul.WithinBounds(Main.maxProjectiles)) Main.projectile[soul].DamageType = DamageClass.Generic; } + extorterBoost = false; } // Make sure the spike doesn't spawn again if it's already been spawned by on-hit. - if (modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0 && !JewelSpikeSpawned) + if (modPlayer.scuttlersJewel && stealthStrike && !JewelSpikeSpawned && !CannotProc) { int damage = (int)player.GetTotalDamage().ApplyTo(16); @@ -5224,7 +5265,6 @@ namespace CalamityMod.Projectiles Main.projectile[spike].frame = 4; if (spike.WithinBounds(Main.maxProjectiles)) Main.projectile[spike].DamageType = DamageClass.Generic; - modPlayer.scuttlerCooldown = 30; } } } diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index e906bedf4b..0b25818a53 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) }, @@ -187,6 +188,7 @@ namespace CalamityMod.Projectiles { ProjectileID.PalladiumDrill, standardDrillTweaks }, { ProjectileID.PartyBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.PurpleCounterweight, counterweightTweaks }, + { ProjectileID.PurpleLaser, Do(LocalIFrames(10 * 5)) }, // Laser Rifle, accounting for extra updates { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, { ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) }, { ProjectileID.RedCounterweight, counterweightTweaks }, @@ -212,12 +214,11 @@ namespace CalamityMod.Projectiles { ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(90)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders. { ProjectileID.VortexDrill, standardDrillTweaks }, { ProjectileID.Wasp, Do(PiercingExact(2)) }, - { ProjectileID.WeatherPainShot, Do(ExtraUpdatesExact(3), TimeLeftExact(1920)) }, + { ProjectileID.WeatherPainShot, Do(ExtraUpdatesExact(3)) }, { ProjectileID.YellowCounterweight, counterweightTweaks }, #endregion #region CATEGORY 3: True Melee support - { ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed }, { ProjectileID.CopperShortswordStab, trueMelee }, { ProjectileID.DarkLance, trueMelee }, { ProjectileID.GoldShortswordStab, trueMelee }, @@ -237,6 +238,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 }, @@ -249,18 +251,30 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 4: Defense Damage support - { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados + { ProjectileID.BombSkeletronPrime, defenseDamage }, + { ProjectileID.CannonballHostile, defenseDamage }, + { ProjectileID.Cthulunado, defenseDamage }, + { ProjectileID.CultistBossFireBall, defenseDamage }, + { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, // Also used by Storm Weaver { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, - { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance - { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes - { ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions - { ProjectileID.PaladinsHammerHostile, defenseDamage }, + { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, + { ProjectileID.FairyQueenLance, defenseDamage }, // EoL lance + { ProjectileID.FairyQueenSunDance, defenseDamage }, // EoL sun dance + { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking scythes + { ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves, reused by Storm Weaver + { ProjectileID.HallowBossRainbowStreak, defenseDamage }, // EoL rainbow bolt + { ProjectileID.HallowBossLastingRainbow, defenseDamage }, // EoL everlasting rainbow { ProjectileID.PhantasmalDeathray, defenseDamage }, { ProjectileID.PhantasmalSphere, defenseDamage }, + { ProjectileID.Present, defenseDamage }, // Santa-NK1 presents + { ProjectileID.QueenSlimeSmash, defenseDamage }, + { ProjectileID.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets, reused by Rev+ Skeletron Prime { ProjectileID.SaucerDeathray, defenseDamage }, + { ProjectileID.SaucerMissile, defenseDamage }, { ProjectileID.Sharknado, defenseDamage }, - { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls + { ProjectileID.Spike, defenseDamage }, // Santa-NK1 spike balls + { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, #endregion #region CATEGORY 5: ID-Static Immunity Frame changes @@ -447,7 +461,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 }, @@ -479,7 +492,6 @@ namespace CalamityMod.Projectiles { ProjectileID.PulseBolt, defaultIFrames }, { ProjectileID.PureSpray, defaultIFrames }, { ProjectileID.PurificationPowder, defaultIFrames }, - { ProjectileID.PurpleLaser, defaultIFrames }, { ProjectileID.PygmySpear, defaultIFrames }, { ProjectileID.QuarterNote, defaultIFrames }, { ProjectileID.RainbowFlare, defaultIFrames }, diff --git a/Projectiles/DraedonsArsenal/AugerPull.cs b/Projectiles/DraedonsArsenal/AugerPull.cs index ce365ce951..4abb72e134 100644 --- a/Projectiles/DraedonsArsenal/AugerPull.cs +++ b/Projectiles/DraedonsArsenal/AugerPull.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) + if (target != null && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) { Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); target.velocity = moveDir; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) + if (target != null && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) { if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 300) { diff --git a/Projectiles/DraedonsArsenal/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs index ac72757579..8d57ef5c26 100644 --- a/Projectiles/DraedonsArsenal/AugerSlash.cs +++ b/Projectiles/DraedonsArsenal/AugerSlash.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -81,16 +82,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = (Projectile.ai[2] == 5 ? 35 : 14); - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); if (Projectile.ai[2] == 5) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.3f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (Projectile.ai[2] == 5 ? (1f + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= damageMult; if (Projectile.numHits == 0) { diff --git a/Projectiles/DraedonsArsenal/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 295d12422c..b94a6f39b0 100644 --- a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs +++ b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 25; - targeted.MoveNPC(launchVel, launchPower, true); + targeted.MoveNPC(launchVel, launchPower, true, Owner); } time++; } @@ -54,17 +55,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); + Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 40; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs index a8a735cb03..73f63de8c1 100644 --- a/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs +++ b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs @@ -62,8 +62,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal spamDelay--; // Fire if the owner stops channeling or otherwise cannot use the weapon. bool autoSpam = (Owner.Calamity().mouseRight && !Main.mouseLeft); - bool chargeSpam = (Owner.Calamity().mouseRight && Main.mouseLeft && ChargeLV1 && spamDelay == 0); - if ((!Main.mouseLeft || autoSpam || chargeSpam) && downtime == 0 && time >= 1) + if ((!Main.mouseLeft || autoSpam) && downtime == 0 && time >= 1) { KeepRefreshingLifetime = false; diff --git a/Projectiles/DraedonsArsenal/NidhoggExplosion.cs b/Projectiles/DraedonsArsenal/NidhoggExplosion.cs index 428ab220d0..dcbec391c1 100644 --- a/Projectiles/DraedonsArsenal/NidhoggExplosion.cs +++ b/Projectiles/DraedonsArsenal/NidhoggExplosion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.CanBeMoved(true)) + if (target != null && target.CanBeMoved()) { if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 500) { diff --git a/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs b/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs index a05b781b79..d3805014a1 100644 --- a/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs +++ b/Projectiles/DraedonsArsenal/NidhoggRailgunBigShot.cs @@ -1,8 +1,9 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; @@ -78,17 +79,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (onKill && Projectile.numHits > 0) Projectile.numHits--; - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); + Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 7; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 20; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs b/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs index ba71ef2c53..bcb44deb3c 100644 --- a/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs +++ b/Projectiles/DraedonsArsenal/NidhoggRailgunBlast.cs @@ -52,6 +52,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity, false, 8, MathHelper.Clamp(0.06f - Projectile.numHits * 0.01f, 0f, 0.06f), Effects.ArsenalEffects.ArsenalGaussColor * 0.9f, new Vector2(1f, 0.5f), true, true, 0.9f); GeneralParticleHandler.SpawnParticle(spark); @@ -74,7 +75,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 6; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs b/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs index 8fcacbe4d0..6e597a6e2b 100644 --- a/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs +++ b/Projectiles/DraedonsArsenal/PhalanxSurgeLance.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Player Owner = Main.player[Projectile.owner]; float distMult = Utils.GetLerpValue(400, 10, Utils.Distance(target.Center, Projectile.Center), true); Vector2 launchVel = startVel; - target.MoveNPC(launchVel, 10 + 35 * distMult, true); + target.MoveNPC(launchVel, 10 + 35 * distMult, true, Owner); if (Projectile.numHits == 0) { diff --git a/Projectiles/DraedonsArsenal/PulseGrenadeOrb.cs b/Projectiles/DraedonsArsenal/PulseGrenadeOrb.cs index 2bebbdd2fb..9453efdd6d 100644 --- a/Projectiles/DraedonsArsenal/PulseGrenadeOrb.cs +++ b/Projectiles/DraedonsArsenal/PulseGrenadeOrb.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.ArmorPenetration = 15; + Projectile.Calamity().CannotProc = true; } public override bool ShouldUpdatePosition() => (time < 120); public override void AI() @@ -79,12 +80,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (time == 250 || Utils.Distance(Projectile.Center, Owner.Center) < 10) { - if (Projectile.ai[2] == 0 && Owner.HeldItem.type == ModContent.ItemType()) + if (Projectile.ai[2] == 0 && Owner.HeldItem.type == ModContent.ItemType() && Owner.controlUseItem) { - Projectile reformGrenade = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), goal, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Owner.whoAmI, 0); + Projectile reformGrenade = Projectile.NewProjectileDirect(Owner.GetSource_ItemUse(Owner.HeldItem), goal, Vector2.Zero, ModContent.ProjectileType(), (int)Owner.GetTotalDamage().ApplyTo(Owner.HeldItem.damage), 0f, Owner.whoAmI, 0); reformGrenade.ai[1] = 5; reformGrenade.ai[0] = Owner.HeldItem.useTime * 0.7f; reformGrenade.Opacity = 0; + //Doze Apr 15 2026 - Because this isn't being spawnwed from the shoot, these bools break. Manually fixing here. + reformGrenade.Calamity().extorterBoost = true; + reformGrenade.Calamity().stealthStrikeSubProjectile = false; SoundStyle grab = new("CalamityMod/Sounds/Item/LightCatch"); SoundEngine.PlaySound(grab with { Volume = 1f, Pitch = 0 }, Projectile.Center); diff --git a/Projectiles/DraedonsArsenal/PulseGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PulseGrenadeProjectile.cs index 2349a8ebe1..66bc8fecce 100644 --- a/Projectiles/DraedonsArsenal/PulseGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PulseGrenadeProjectile.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.Center = Owner.Center; Projectile.extraUpdates = (Projectile.Calamity().stealthStrike ? 22 : 5); Projectile.rotation += Main.rand.NextFloat(-4, 4); - Vector2 velocity = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 9; + Vector2 velocity = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 9 * Owner.Calamity().rogueVelocity; Projectile.velocity = velocity; if (Projectile.Calamity().stealthStrike) @@ -300,11 +300,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // Do NOT change the damage of these here, do it on the on hit Projectile orb = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (vel * 7f).RotatedBy(MathHelper.PiOver4 / 2), ModContent.ProjectileType(), Projectile.damage, 0f, Owner.whoAmI, 0, spin, i); - orb.Calamity().stealthStrike = Projectile.Calamity().stealthStrike; if (Projectile.Calamity().stealthStrike) { Projectile orb2 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (vel * 10f), ModContent.ProjectileType(), Projectile.damage, 0f, Owner.whoAmI, 0, -spin, i + 1); - orb2.Calamity().stealthStrike = Projectile.Calamity().stealthStrike; } } diff --git a/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs b/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs index e931f7966f..f9740376b1 100644 --- a/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs +++ b/Projectiles/DraedonsArsenal/ShortCircuitExplosion.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 12, true); + target.MoveNPC(launchVel, 12, true, Owner); } public override void AI() diff --git a/Projectiles/DraedonsArsenal/ShortCircuitShot.cs b/Projectiles/DraedonsArsenal/ShortCircuitShot.cs index 95c1b5dc0d..ac88bcf212 100644 --- a/Projectiles/DraedonsArsenal/ShortCircuitShot.cs +++ b/Projectiles/DraedonsArsenal/ShortCircuitShot.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal target.AddBuff(ModContent.BuffType(), 40); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 8, false); + target.MoveNPC(launchVel, 8, false, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { diff --git a/Projectiles/DraedonsArsenal/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/DraedonsArsenal/VulcanProjectile.cs b/Projectiles/DraedonsArsenal/VulcanProjectile.cs index 8f805e1a94..915998cce8 100644 --- a/Projectiles/DraedonsArsenal/VulcanProjectile.cs +++ b/Projectiles/DraedonsArsenal/VulcanProjectile.cs @@ -60,11 +60,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; impactDust(); Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 4; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.cs b/Projectiles/DraedonsArsenal/VulcanSpear.cs index 55707121f9..c921a059c7 100644 --- a/Projectiles/DraedonsArsenal/VulcanSpear.cs +++ b/Projectiles/DraedonsArsenal/VulcanSpear.cs @@ -128,11 +128,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; impactDust(); Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); float launchPower = 12; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/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/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 2d2b200bac..3fd943a129 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -258,7 +258,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300, true); - target.AddBuff(ModContent.BuffType(), 300, true); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/ArcticBearPawProj.cs b/Projectiles/Magic/ArcticBearPawProj.cs index 900684983b..0caa6c9a1b 100644 --- a/Projectiles/Magic/ArcticBearPawProj.cs +++ b/Projectiles/Magic/ArcticBearPawProj.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/ArtAttackHoldout.cs b/Projectiles/Magic/ArtAttackHoldout.cs index 88b9ed5af2..ca54e8abe0 100644 --- a/Projectiles/Magic/ArtAttackHoldout.cs +++ b/Projectiles/Magic/ArtAttackHoldout.cs @@ -41,12 +41,12 @@ namespace CalamityMod.Projectiles.Magic int attackType = ModContent.ProjectileType(); if (Owner.ownedProjectileCounts[attackType] == 0) { - if (Projectile.ai[0] >= 0f && Owner.CheckMana(Owner.HeldItem, -1, true, false)) + if (Projectile.ai[0] >= 1f && Owner.CheckMana(Owner.HeldItem, -1, true, false)) { SoundEngine.PlaySound(ArtAttack.UseSound, Owner.Center); Vector2 initialStarVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), initialStarVelocity, attackType, Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.ai[0] = -24f; + Projectile.ai[0] -= Owner.HeldItem.useAnimation; } else Projectile.ai[0]++; diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs index a69ca4e9c8..0d87884419 100644 --- a/Projectiles/Magic/ArtAttackStar.cs +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = end - 1; i >= start; i--) { float distanceFromStar = Vector2.Distance(Projectile.position, Projectile.oldPos[i]); - if (distanceFromStar < (distanceTraveled * 0.7f + 30f)) + if (distanceFromStar < (distanceTraveled * 0.7f + 20f)) { shapeIsComplete = true; @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Magic averageDistanceFromStar /= end - start; // Cancel out intersection "completions" if the velocity is slow enough to be rebounding or the shape is relatively small. - if (averageDistanceFromStar < distanceTraveled + 70f) + if (averageDistanceFromStar < distanceTraveled + 100f) shapeIsComplete = false; } @@ -182,6 +182,10 @@ namespace CalamityMod.Projectiles.Magic if (Main.myPlayer == Projectile.owner) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Projectile.owner, n.whoAmI); + + damage /= 2; + if (damage < 1) + damage = 1; } } } diff --git a/Projectiles/Magic/AuroraAustralis.cs b/Projectiles/Magic/AuroraAustralis.cs index 9381f68bf7..de69370f2b 100644 --- a/Projectiles/Magic/AuroraAustralis.cs +++ b/Projectiles/Magic/AuroraAustralis.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 180; + Projectile.timeLeft = 144; Projectile.DamageType = DamageClass.Magic; Projectile.alpha = 255; @@ -77,8 +77,9 @@ namespace CalamityMod.Projectiles.Magic if (Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 30) { float dmgKBMult = Main.rand.NextFloat(0.25f, 0.75f); - Projectile star = CalamityUtils.ProjectileRain(source, Projectile.Center, Projectile.velocity.X, 100f, 500f, 800f, Main.rand.NextFloat(10f, 20f), ModContent.ProjectileType(), (int)(Projectile.damage * dmgKBMult), Projectile.knockBack * dmgKBMult, Projectile.owner); - star.timeLeft = 120; + Projectile star = CalamityUtils.ProjectileRain(source, Projectile.Center, Projectile.velocity.X, 100f, 500f, 640f, Main.rand.NextFloat(16f, 20f), ModContent.ProjectileType(), (int)(Projectile.damage * dmgKBMult), Projectile.knockBack * dmgKBMult, Projectile.owner); + star.extraUpdates += Main.rand.Next(1, 3); + star.timeLeft = 90; star.ai[0] = 1f; } } diff --git a/Projectiles/Magic/BloodBeam.cs b/Projectiles/Magic/BloodBeam.cs index 80d7385459..6fdecf2031 100644 --- a/Projectiles/Magic/BloodBeam.cs +++ b/Projectiles/Magic/BloodBeam.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = -1; + Projectile.penetrate = 2; Projectile.extraUpdates = 3; Projectile.timeLeft = 120; Projectile.usesIDStaticNPCImmunity = true; 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/CosmicTentacle.cs b/Projectiles/Magic/CosmicTentacle.cs index f1edf2171f..d129b88402 100644 --- a/Projectiles/Magic/CosmicTentacle.cs +++ b/Projectiles/Magic/CosmicTentacle.cs @@ -58,8 +58,7 @@ namespace CalamityMod.Projectiles.Magic Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.6f * scaler, 0f, 4, false); GeneralParticleHandler.SpawnParticle(blastRing); Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor * 0.6f, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.48f * scaler, 0f, 4, true); - GeneralParticleHandler.SpawnParticle(blastRing2); - blastRing2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(blastRing2, false, GeneralDrawLayer.AfterEverything); } Projectile.velocity *= 0.96f; if (time == 3) @@ -90,8 +89,7 @@ namespace CalamityMod.Projectiles.Magic Particle spark = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 12, 0.07f * scaling, Color.Black * 0.85f, new Vector2(1.7f - (1 - sharpScaling), 0.9f + (1 - sharpScaling) * 2), false); GeneralParticleHandler.SpawnParticle(spark); Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 12, 0.035f * scaling, Color.LightGreen * 0.75f, new Vector2(1.7f - (1 - sharpScaling), 0.9f + (1 - sharpScaling) * 2)); - GeneralParticleHandler.SpawnParticle(spark2); - spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(spark2, false, GeneralDrawLayer.AfterEverything); } if (Main.rand.NextBool(6)) { @@ -113,8 +111,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 2; i++) { Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.36f, 0f, scalingTimerMax / 2, true); - GeneralParticleHandler.SpawnParticle(blastRing2); - blastRing2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(blastRing2, false, GeneralDrawLayer.AfterEverything); } Projectile.velocity = Vector2.Zero; } 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/FireImplosion.cs b/Projectiles/Magic/FireImplosion.cs index b053d51ba6..aedb225937 100644 --- a/Projectiles/Magic/FireImplosion.cs +++ b/Projectiles/Magic/FireImplosion.cs @@ -98,6 +98,7 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; if (frigidFlash) { target.AddBuff(BuffID.OnFire3, 30); @@ -112,7 +113,7 @@ namespace CalamityMod.Projectiles.Magic modifiers.SourceDamage *= damageMult * (frigidFlash ? 0.5f : 1); // Frigidflash explosion are spawned at full power, so their damage is reduced here // The vortex sucks in enemies - target.MoveNPC(-pushVelocity, customKnockback, frigidFlash); + target.MoveNPC(-pushVelocity, customKnockback, frigidFlash, Owner); } public override void OnKill(int timeLeft) { diff --git a/Projectiles/Magic/FleshTotemEyes.png b/Projectiles/Magic/FleshTotemEyes.png new file mode 100644 index 0000000000..22d855200d Binary files /dev/null and b/Projectiles/Magic/FleshTotemEyes.png differ diff --git a/Projectiles/Magic/FleshTotemMinion.cs b/Projectiles/Magic/FleshTotemMinion.cs new file mode 100644 index 0000000000..392cdbc545 --- /dev/null +++ b/Projectiles/Magic/FleshTotemMinion.cs @@ -0,0 +1,175 @@ +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 4 seconds, divided by how much mana the totem has stored + float pulseMax = Utils.Remap(modPlayer.fleshTotemManaStorage, 0, FleshTotem.manaStorageMax, FleshTotem.MaxDelay, FleshTotem.MinDelay); + //Ensure the pulse timer can never go below 1 second + if (pulseMax < 60) + { + pulseMax = 60; + } + //When the timer reaches max, pulse and restore 25 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 = 25; + 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/HeliumFlashBlast.cs b/Projectiles/Magic/HeliumFlashBlast.cs index d0d7bb0ca4..551012e2a7 100644 --- a/Projectiles/Magic/HeliumFlashBlast.cs +++ b/Projectiles/Magic/HeliumFlashBlast.cs @@ -1,4 +1,5 @@ using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -130,6 +131,7 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + modifiers.ApplyScalingForcedCrit(Projectile); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.85f); if (Projectile.damage < 1) diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index b0bdd946ac..2337b0b96e 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -132,6 +132,6 @@ namespace CalamityMod.Projectiles.Magic } public override bool? CanDamage() => Timer == 140f ? null : false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 60); } } diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index 4ce8847842..860cb394ed 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); if (Projectile.damage > 10) { diff --git a/Projectiles/Magic/IncineratingFireball.cs b/Projectiles/Magic/IncineratingFireball.cs index eee796c453..30bdd882b4 100644 --- a/Projectiles/Magic/IncineratingFireball.cs +++ b/Projectiles/Magic/IncineratingFireball.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 12; + Projectile.localNPCHitCooldown = 10; Projectile.hide = true; } @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Magic } // Can only deal damage while not fizzling out. - public override bool? CanDamage() => !Released; + public override bool? CanDamage() => !Released && Timer % Projectile.localNPCHitCooldown == 0; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -160,6 +160,9 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(Burn, target.Center); target.AddBuff(ModContent.BuffType(), 180); + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.7f); + // Whoa buddy no smoking allowed for (int i = 0; i < 4; i++) { 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/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index 4640f39b2c..45f7cc3bf3 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Magic Owner.RemoveAllGrapplingHooks(); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile.velocity = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld) * 14f; + Projectile.velocity = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld) * 12f; Owner.velocity = Projectile.velocity; Owner.ChangeDir(Math.Sign(Projectile.velocity.X) <= 0 ? -1 : 1); diff --git a/Projectiles/Magic/MeteorStarExplosion.cs b/Projectiles/Magic/MeteorStarExplosion.cs index 200e4d1f14..970630819f 100644 --- a/Projectiles/Magic/MeteorStarExplosion.cs +++ b/Projectiles/Magic/MeteorStarExplosion.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic int intendedDamage = Main.rand.Next(GloriousEnd.PlayerExplosionDmgMin, GloriousEnd.PlayerExplosionDmgMax + 1); modifiers.SourceDamage *= 0f; - modifiers.SourceDamage.Flat += intendedDamage * (Main.masterMode ? 2.4f : Main.expertMode ? 1.6f : 1f); + modifiers.SourceDamage.Flat += intendedDamage.ScaleWithDifficulty(); if (Projectile.ai[0] == 1f) modifiers.SourceDamage.Flat /= 2; } @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic int intendedDamage = Main.rand.Next(GloriousEnd.PlayerExplosionDmgMin, GloriousEnd.PlayerExplosionDmgMax + 1); modifiers.SourceDamage *= 0f; - modifiers.SourceDamage.Flat += intendedDamage * (Main.masterMode ? 2.4f : Main.expertMode ? 1.6f : 1f); + modifiers.SourceDamage.Flat += intendedDamage.ScaleWithDifficulty(); if (Projectile.ai[0] == 1f) modifiers.SourceDamage.Flat /= 2; } 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/PhantasmalFuryProj.cs b/Projectiles/Magic/PhantasmalFuryProj.cs index ac35739eca..9c79b761b0 100644 --- a/Projectiles/Magic/PhantasmalFuryProj.cs +++ b/Projectiles/Magic/PhantasmalFuryProj.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = (Owner.Center - target.Center).SafeNormalize(Vector2.UnitY) * -10 * (launched ? 0.5f : 1); - target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true); + target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true, Owner); } public override bool? CanHitNPC(NPC target) { diff --git a/Projectiles/Magic/Phantom.cs b/Projectiles/Magic/Phantom.cs index eb3af39916..1b12a7f910 100644 --- a/Projectiles/Magic/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true); + target.MoveNPC(launchVel, 10 * (launched ? 0.5f : 1), true, Owner); } public override bool? CanHitNPC(NPC target) diff --git a/Projectiles/Magic/PrimordialAncientExplosion.cs b/Projectiles/Magic/PrimordialAncientExplosion.cs index f5783774a8..371b6cb0a1 100644 --- a/Projectiles/Magic/PrimordialAncientExplosion.cs +++ b/Projectiles/Magic/PrimordialAncientExplosion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 40, true); + target.MoveNPC(launchVel, 40, true, Owner); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.95f); diff --git a/Projectiles/Magic/PrimordialEarthExplosion.cs b/Projectiles/Magic/PrimordialEarthExplosion.cs index d35a7323a5..95ffc29e30 100644 --- a/Projectiles/Magic/PrimordialEarthExplosion.cs +++ b/Projectiles/Magic/PrimordialEarthExplosion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.9f); diff --git a/Projectiles/Magic/PurgeGuzzlerHoldout.cs b/Projectiles/Magic/PurgeGuzzlerHoldout.cs index a465def812..1a04bce268 100644 --- a/Projectiles/Magic/PurgeGuzzlerHoldout.cs +++ b/Projectiles/Magic/PurgeGuzzlerHoldout.cs @@ -58,6 +58,15 @@ namespace CalamityMod.Projectiles.Magic return; } + if ((shootingTimer >= 10 && revFrames < 150) || (revFrames >= 150 && !isOnCooldown)) + { + if (!Owner.CheckMana(Owner.HeldItem, -1, true)) + { + Projectile.Kill(); + return; + } + } + revSpeed = Utils.Remap(revFrames, 0, 150, 1, 3, true); if (shootingTimer >= 10 && revFrames < 150) { diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index 0183bcdc66..9f2231225d 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -266,11 +266,11 @@ namespace CalamityMod.Projectiles.Magic } // Might launches enemies - if (GetSoulEffects((int)Projectile.ai[0]) == SoulType.Might && target.CanBeMoved(false)) + if (GetSoulEffects((int)Projectile.ai[0]) == SoulType.Might && target.CanBeMoved()) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Vector2 launchVel = Utils.DirectionTo(owner.Center, owner.Calamity().mouseWorld) - Vector2.UnitY * 5f; - target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false); + target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false, owner); } } diff --git a/Projectiles/Magic/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs index 4b0bda748a..04fec18c74 100644 --- a/Projectiles/Magic/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -75,13 +75,13 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // Might launches enemies - if (SHPB.GetSoulEffects((int)Projectile.ai[0]) == SHPB.SoulType.Might && target.CanBeMoved(false)) + if (SHPB.GetSoulEffects((int)Projectile.ai[0]) == SHPB.SoulType.Might && target.CanBeMoved()) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Player owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(owner.Center, owner.Calamity().mouseWorld) - Vector2.UnitY * 5f; - target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false); + target.MoveNPC(launchVel, SHPC.MightKnockbackStrength, false, owner); } } diff --git a/Projectiles/Magic/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/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 2858155357..caf48208a1 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -133,6 +133,16 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.FinalExtraUpdate()) Time++; + if (Time % 12f == 11f) + { + if (!Owner.CheckMana(Owner.HeldItem, -1, true)) + { + DeathCounter = 1f; + Projectile.netUpdate = true; + return; + } + } + // Set the hover offset to a zero vector after enough time has passed and the projectile is powerful/tame enough. bool tame = CurrentPower > 0.97f; if (tame) 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/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index 61bf80969b..8c6f71bd4a 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; + Projectile.localNPCHitCooldown = Lifetime / 2; // The beam lasts for only some frames and fades out over that time. Projectile.timeLeft = Lifetime; diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index 64143f3e25..dfc485f8d0 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -13,6 +14,9 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Items/Weapons/Magic/ValkyrieRay"; private const float AimResponsiveness = 0.66f; + public ref float Timer => ref Projectile.ai[0]; + public ref float Fired => ref Projectile.ai[1]; + public ref float TimeRate => ref Projectile.ai[2]; public override void SetDefaults() { @@ -25,8 +29,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.timeLeft = 900; } - // ai[0] is a time-dilated frame counter. ai[1] is whether the beam has already fired. - // localAI[0] is the rate at which the "frame" counter increases. public override void AI() { Player player = Main.player[Projectile.owner]; @@ -34,20 +36,19 @@ namespace CalamityMod.Projectiles.Magic // Calculate how quickly the staff should charge. Charge increases by some number close to 1 every frame. // Speed increasing reforges make this number greater than 1. Slowing reforges make it smaller than 1. - if (Projectile.localAI[0] == 0f) - Projectile.localAI[0] = (ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.HeldItem.useTime; + if (TimeRate == 0f) + TimeRate = MathF.Round((float)(ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.HeldItem.useTime, 3); // Increment the timer for the staff. If the timer has passed the total time, destroy it. - Projectile.ai[0] += Projectile.localAI[0]; + Timer += TimeRate; int maxTime = ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames; - if (Projectile.ai[0] > maxTime) + if (Timer > maxTime) { Projectile.Kill(); return; } - // Compute the weapon's charge. - float chargeLevel = MathHelper.Clamp(Projectile.ai[0] / ValkyrieRay.ChargeFrames, 0f, 1f); + float chargeLevel = MathHelper.Clamp(Timer / ValkyrieRay.ChargeFrames, 0f, 1f); // Common code among holdouts to keep the holdout projectile directly in the player's hand UpdatePlayerVisuals(player, rrp); @@ -58,9 +59,9 @@ namespace CalamityMod.Projectiles.Magic Vector2 gemPos = Projectile.Center + gemOffset.RotatedBy(angle); // Firing or charging? - if (chargeLevel >= 1f && Projectile.ai[1] == 0f) + if (chargeLevel >= 1f && Fired == 0f) { - Projectile.ai[1] = 1f; // so it never fires again + Fired = 1f; // so it never fires again FiringEffects(gemPos); if (Projectile.owner == Main.myPlayer) { @@ -68,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic laser.Center = gemPos; } } - else if (Projectile.ai[1] == 0f) + else if (Fired == 0f) { // The player can constantly re-aim the staff while it's charging, but once it fires it is locked in place. UpdateAim(rrp, Projectile.velocity.Length()); diff --git a/Projectiles/Magic/VeeringWindFrostWave.cs b/Projectiles/Magic/VeeringWindFrostWave.cs index 5a0b2b5596..ee7a6c11d8 100644 --- a/Projectiles/Magic/VeeringWindFrostWave.cs +++ b/Projectiles/Magic/VeeringWindFrostWave.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } } } diff --git a/Projectiles/Magic/VolatileStarcore.cs b/Projectiles/Magic/VolatileStarcore.cs index 8a061d7cf4..a37f329c4f 100644 --- a/Projectiles/Magic/VolatileStarcore.cs +++ b/Projectiles/Magic/VolatileStarcore.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -109,6 +110,11 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(BuffID.Daybreak, 180); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.ApplyScalingForcedCrit(Projectile); + } + public override void OnKill(int timeLeft) { if (Projectile.owner != Main.myPlayer) diff --git a/Projectiles/Melee/BasherHoldout.cs b/Projectiles/Melee/BasherHoldout.cs index 1658497495..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(); @@ -56,6 +55,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.noEnchantmentVisuals = true; + Projectile.scale = 0; } public void OnSpawn() { @@ -63,6 +64,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.knockBack = 0; attackTimer = cooldown; + swingCount = 1; } } public void ResetVariables() // After a swing, reset/adjust many stats @@ -82,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee float angleVariation = (float)Math.Sin(time * 0.06f / Projectile.MaxUpdates) * 0.1f; - float outwardDistance = 5 * Projectile.scale; + float outwardDistance = 5; Owner.ChangeDir(Math.Sign(toMouse.X)); Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + (bladeRot + angleVariation) * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * outwardDistance; @@ -98,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee if (!Owner.CantUseHoldout(false)) Projectile.timeLeft = 5; - Projectile.scale = Owner.GetMeleeScale() + 0.1f; + Projectile.scale = MathHelper.Lerp(Projectile.scale, Owner.GetMeleeScale() + 0.1f, 0.3f / Projectile.MaxUpdates); toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); Positioning(toMouse); @@ -124,6 +126,7 @@ namespace CalamityMod.Projectiles.Melee } else Owner.itemTime = Owner.itemAnimation = 5; + #region Not Swinging if (attackTimer < 0) // When the sword isn't swinging { @@ -235,7 +238,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(ModContent.BuffType(), 300); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 14f, true); + target.MoveNPC(launchVel, 14f, true, Owner); for (int i = 0; i < MathHelper.Clamp(15 - Projectile.numHits * 3, 2, 15); i++) { @@ -267,8 +270,8 @@ namespace CalamityMod.Projectiles.Melee float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4); Vector2 rotationPoint = (Owner.direction == -1) ? new Vector2(texture.Width, texture.Height) : new Vector2(0, texture.Height); SpriteEffects flipSprite = (Owner.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f + ((swingCount % 2 == 0 ? new Vector2(-6, 0) : new Vector2(-2, 0)).RotatedBy(drawRotation) * Owner.direction); - Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f; Color clr = Color.Tan; int swingCountFlip = (swingCount % 2 == 0 ? 1 : 3) + Owner.direction == 0 ? 2 : 0; Vector2 vel2 = Projectile.velocity.RotatedBy(MathHelper.PiOver2); diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index f8d4d6935c..eb67acd237 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee { base.OnHitNPC(target, hit, damageDone); if (SwingMode == 2) - target.AddBuff(BuffType(), 20); + target.AddBuff(BuffID.Frozen, 20); } public override void AI() diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 4f6706afe6..a8da7a3b52 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.25f); //Idk if its too much or what but at the same time its close range as fuck + Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.5f); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs index 02c71828d9..3b6a91704e 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_PurityProjection.cs @@ -63,7 +63,5 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dustParticle].velocity = Projectile.oldVelocity; } } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffType(), 90); } } diff --git a/Projectiles/Melee/CometQuasherHoldout.cs b/Projectiles/Melee/CometQuasherHoldout.cs index fb612dd221..08ff873084 100644 --- a/Projectiles/Melee/CometQuasherHoldout.cs +++ b/Projectiles/Melee/CometQuasherHoldout.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.55f, Pitch = 0.7f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 7, true); + target.MoveNPC(launchVel, 7, true, Owner); for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) { diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index 5eaf0a592f..40d16b3e2b 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee { Player player = Main.player[Projectile.owner]; target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer) { Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, 10f, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); diff --git a/Projectiles/Melee/DarkIceZero.cs b/Projectiles/Melee/DarkIceZero.cs index 4c06f168f6..267c30d1d3 100644 --- a/Projectiles/Melee/DarkIceZero.cs +++ b/Projectiles/Melee/DarkIceZero.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Melee/DevilsDevastationHoldout.cs b/Projectiles/Melee/DevilsDevastationHoldout.cs index 501bccd737..093afc45b2 100644 --- a/Projectiles/Melee/DevilsDevastationHoldout.cs +++ b/Projectiles/Melee/DevilsDevastationHoldout.cs @@ -392,7 +392,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 40, true); + CalamityUtils.MoveNPC(target, launchVel, 40, true, Owner); if (target.Calamity().demonSwordImpales != 0 || Projectile.numHits == 0) { diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 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/DragoonBigBolt.cs b/Projectiles/Melee/DragoonBigBolt.cs index 828cbe7972..baf5c2aef5 100644 --- a/Projectiles/Melee/DragoonBigBolt.cs +++ b/Projectiles/Melee/DragoonBigBolt.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 2a230edb90..c51b91ec44 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.Melee armoredHits++; Vector2 launchVel = (Projectile.ai[1] != 1 ? Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) : Utils.DirectionTo(Owner.Center, target.Center)); - target.MoveNPC(launchVel, 37, true); + target.MoveNPC(launchVel, 37, true, Owner); if (spawnBoom) { diff --git a/Projectiles/Melee/EvilSmasherProjectile.cs b/Projectiles/Melee/EvilSmasherProjectile.cs index f7182884f2..93f0a4c02a 100644 --- a/Projectiles/Melee/EvilSmasherProjectile.cs +++ b/Projectiles/Melee/EvilSmasherProjectile.cs @@ -1,18 +1,12 @@ using System; -using System.Collections.Generic; -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Sounds; -using Humanizer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -76,8 +70,10 @@ namespace CalamityMod.Projectiles.Melee { Projectile.timeLeft++; timer--; - if (!playedChargeSound) { - SoundEngine.PlaySound(SoundID.Item178,Projectile.Center); + if (!playedChargeSound) + { + SoundEngine.PlaySound(SoundID.DeerclopsStep with { Volume = 2f, Pitch = 0.5f }, Projectile.Center); + SoundEngine.PlaySound(Murasama.InorganicHit with { Pitch = -0.5f }, Projectile.Center); playedChargeSound = true; for (int i = 0; i < 5; i++) { diff --git a/Projectiles/Melee/ExaltedOathbladeHoldout.cs b/Projectiles/Melee/ExaltedOathbladeHoldout.cs index c4db13d8e4..279b825edd 100644 --- a/Projectiles/Melee/ExaltedOathbladeHoldout.cs +++ b/Projectiles/Melee/ExaltedOathbladeHoldout.cs @@ -251,7 +251,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 23, true); + CalamityUtils.MoveNPC(target, launchVel, 23, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 0c11323fc6..4eeb944925 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -616,7 +616,7 @@ namespace CalamityMod.Projectiles.Melee } // Freeze the target briefly, to allow the player to more easily perform a powerful slash. - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.Frozen, 60); } if (State == SwingState.Swinging && PerformingPowerfulSlash && Owner.ownedProjectileCounts[ModContent.ProjectileType()] < 1) diff --git a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs index b4088066bc..ba2800c800 100644 --- a/Projectiles/Melee/ForbiddenOathbladeHoldout.cs +++ b/Projectiles/Melee/ForbiddenOathbladeHoldout.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Cooldowns; @@ -307,7 +307,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 17, true); + CalamityUtils.MoveNPC(target, launchVel, 17, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index cd7d39d564..e1f52ba954 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -1,223 +1,270 @@ -using CalamityMod.Dusts; +using System; +using System.Collections.Generic; +using CalamityMod.Dusts; +using CalamityMod.Enums; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.Particles; -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems.Graphic.PixelationSystem; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +using static Terraria.Player; namespace CalamityMod.Projectiles.Melee { [PierceResistException] - public class GrandDadHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + public class GrandDadHoldout : ModProjectile, ILocalizedModType { - public override int AssignedItemID => ModContent.ItemType(); - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/GrandDad"; - public override float HitboxOutset => 125; - public override Vector2 HitboxSize => new Vector2(190, 190); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(0, 124); - public Vector2 mousePos; - public Vector2 aimVel; - public bool doSwing = true; - public bool postSwing = false; - public float fadeIn = 0; - public int useAnim; - public int swingCount; - public bool finalFlip = false; - public bool swingSound = true; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public int fireRate => (int)((Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates) / 2.75f); + public int time = 0; + public Vector2 toMouse = Vector2.Zero; + public int cooldown => (int)(-Owner.HeldItem.useAnimation * Owner.inverseMeleeSpeed * Projectile.MaxUpdates); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Visual effects of the blade + // Checks to make sure sounds only happen once per swing + public bool makeSound = true; + public bool performSwing = false; + public float enabledHitbox = 0; // Deals damage when above 0, ticks down quickly + public float angledHold = 0; // Adds some angle based on swing direction + public float angleArmHold = 0; + public static int hitboxFramesMax = 11; + public bool canReleaseHoldout = false; public int armoredHits = 0; - private NPC target => Main.npc[(int)Projectile.ai[0]]; - + public float startAngle = MathHelper.Pi * 0.9f; + public float endAngle = -MathHelper.PiOver4 * 3 * 0.9f; + public override bool? CanDamage() => enabledHitbox > 0 ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float outset = 40 * Projectile.scale; + Vector2 hitboxPosition = Owner.Center + toMouse * outset; + float hitboxSize = 155 * Projectile.scale; + return CalamityUtils.CircularHitboxCollision(hitboxPosition, hitboxSize, targetHitbox); + } public override void SetDefaults() { - base.SetDefaults(); + Projectile.width = Projectile.height = 124; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.extraUpdates = 8; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.noEnchantmentVisuals = true; + Projectile.scale = 0; } - - public override void WhenSpawned() + public void OnSpawn() { - Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; - Projectile.knockBack = 0; - Projectile.scale = 1; - Projectile.ai[1] = -1; - - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, as Grand Dad has no projectiles - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - useAnim = Owner.itemAnimationMax; - - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - - FlipAsSword = Owner.direction == -1; - } - - public override void UseStyle() - { - AnimationProgress = Animation % useAnim; - DrawUnconditionally = false; - - if (CanHit || postSwing) - mousePos = Owner.Center - aimVel; - else + if (time == 0) { - mousePos = Owner.Calamity().mouseWorld; + Projectile.knockBack = 0; + attackTimer = cooldown; + swingCount = 1; } + } + public void ResetVariables() // After a swing, reset/adjust many stats + { + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; + Projectile.numHits = 0; + swingCount++; + makeSound = true; + enabledHitbox = 0; + canReleaseHoldout = false; + armoredHits = 0; + Projectile.ForceNetUpdate(); + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); - if (CanHit) - fadeIn = MathHelper.Lerp(fadeIn, 1, 0.3f); - else - fadeIn = MathHelper.Lerp(fadeIn, 0, 0.35f); + angleArmHold = MathHelper.Lerp(angleArmHold, angledHold * MathF.Pow(Utils.GetLerpValue(cooldown, cooldown * 0.35f, attackTimer, true), 5), 0.12f / Projectile.MaxUpdates * Owner.meleeSpeed); + float angleVariation = (float)Math.Sin(time * 0.04f / Projectile.MaxUpdates) * 0.05f; + float outwardDistance = 5; + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + (bladeRot + angleArmHold + angleVariation) * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * outwardDistance; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); - if (!doSwing) + Projectile.velocity = toMouse.RotatedBy((bladeRot + angledHold + angleVariation) * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Projectile.scale = MathHelper.Lerp(Projectile.scale, Owner.GetMeleeScale(), 0.3f / Projectile.MaxUpdates); + toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + OnSpawn(); + + bool fadeInFX = enabledHitbox > (int)(hitboxFramesMax / 3f); + if (enabledHitbox > 0) { - for (int i = 0; i < Main.maxNPCs; i++) - Projectile.localNPCImmunity[i] = 0; + if (Projectile.FinalExtraUpdate()) + enabledHitbox--; + } + if (fadeInFX) + bladefx = MathHelper.Lerp(bladefx, 1, 0.25f / Projectile.MaxUpdates * Owner.meleeSpeed); + else + bladefx = MathHelper.Lerp(bladefx, 0, 0.15f / Projectile.MaxUpdates * Owner.meleeSpeed); - Projectile.numHits = 0; - mousePos = Owner.Calamity().mouseWorld; - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - FlipAsSword = Owner.direction == -1; - - doSwing = true; - swingCount++; - finalFlip = false; - swingSound = true; - armoredHits = 0; + if (canReleaseHoldout || time < 25) + { + if (Owner.HeldItem.type != ItemType() || Main.mapFullscreen || Owner.mouseInterface || Owner.dead) + { + Projectile.Kill(); + return; + } } else + Owner.itemTime = Owner.itemAnimation = 5; + + + float lerpSpeed = 0.1f / Projectile.MaxUpdates * Owner.meleeSpeed; + float maxAngle = MathHelper.PiOver4 * 0.8f; + if (swingCount % 2 == 0) + angledHold = MathHelper.Lerp(angledHold, maxAngle, lerpSpeed); + else + angledHold = MathHelper.Lerp(angledHold, -maxAngle, lerpSpeed); + + + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging { - if (!CanHit && !postSwing) + Timers(); + + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + + if (attackTimer == 0) // Reset a few things in prep for the next swing + ResetVariables(); + else // Wind up animation in prep for the next swing { - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - } - else - { - if ((Owner.Center - aimVel).X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - } + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp2 = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + float start = -startAngle * swingDir; + float end = endAngle * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp2, 2f, 2f)); - - Projectile.rotation = Projectile.rotation.AngleLerp(Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f), 0.1f); - - if (AnimationProgress < (useAnim / 1.5f)) - { - aimVel = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitX) * 65; - CanHit = false; - postSwing = false; - if (AnimationProgress == 0) + if (lerp >= 0.85f) { - doSwing = false; - Projectile.ai[1] = -Projectile.ai[1]; - } - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction * (1 + (Utils.GetLerpValue(useAnim * 0.8f, useAnim, Animation, true)) * 0.35f)), 0.2f); - } - else - { - if (!finalFlip) - { - FlipAsSword = Owner.direction < 0; - } - - float time = (AnimationProgress) - (useAnim / 3); - float timeMax = useAnim - (useAnim / 3); - - if (time >= (int)(timeMax * 0.4f) && swingSound) - { - SoundStyle fire = new("CalamityMod/Sounds/Item/HeavySwing"); - SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.32f) }, Projectile.Center); - swingSound = false; - } - if (time > (int)(timeMax * 0.4f) && time < (int)(timeMax * 0.7f)) - { - CanHit = true; - - for (int i = 0; i < 3; i++) + if (Owner.controlUseItem || performSwing) + performSwing = true; + else { - Vector2 particleVel = new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)); - Vector2 particlePos = Owner.Center + (new Vector2(Main.rand.Next(30, 165), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))); - GeneralParticleHandler.SpawnParticle(new LineParticle(particlePos, -particleVel.RotatedByRandom(0.2f) * 2, false, 19, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue)); - GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(particlePos, -particleVel.RotatedByRandom(0.2f) * 2, Main.rand.NextBool(4) ? Color.Black : Color.DarkBlue, 23, Main.rand.NextFloat(0.5f, 1f), 0.65f)); - } - } - else - CanHit = false; - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), - 0.2f); - - if (time >= timeMax) - doSwing = false; - if (time < (int)(timeMax * 0.7f)) - postSwing = true; - - if (CanHit) - { - for (int i = 0; i < 6; i++) - { - if (Main.rand.NextBool(3)) - { - Dust dust = Dust.NewDustPerfect(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), ModContent.DustType(), Vector2.Zero, 0, default, Main.rand.NextFloat(1.15f, 1.5f)); - dust.noGravity = true; - dust.color = Color.DodgerBlue; - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Color.Black, false, false, false)); - } - else - { - Dust dust = Dust.NewDustPerfect(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), ModContent.DustType(), Vector2.Zero, 0, default, Main.rand.NextFloat(1.15f, 1.5f)); - dust.noGravity = true; - dust.color = Color.Blue; - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue)); - } - } - for (int i = 0; i < 3; i++) - { - float randRot = Main.rand.NextFloat(-30, -60); - Vector2 dustVel = (new Vector2(0, 15 * -Projectile.ai[1] * Owner.direction)).RotatedBy(FinalRotation + MathHelper.ToRadians(randRot)); - Dust dust2 = Dust.NewDustPerfect(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), DustID.FireworksRGB, dustVel * Main.rand.NextFloat(0.1f, 0.5f)); - dust2.scale = Main.rand.NextFloat(0.55f, 1.05f); - dust2.noGravity = true; - dust2.color = Main.rand.NextBool(3) ? Color.Goldenrod : Color.Gold; + canReleaseHoldout = true; + attackTimer--; + lerp = 0.85f; } } } + if (lerp > 0.85f) + { + angledHold = MathHelper.Lerp(angledHold, maxAngle * 3.5f * (swingCount % 2 == 0 ? 1 : -1), lerpSpeed * 1.5f); + } + + return; } + #endregion - ArmRotationOffset = MathHelper.ToRadians(-140f); - ArmRotationOffsetBack = MathHelper.ToRadians(-140f); + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown; + performSwing = false; + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float start = endAngle * swingDir; + float end = startAngle * swingDir; + bladeRot = MathHelper.Lerp(start, end, CalamityUtils.EaseInOutExp(lerp, 11f, 11f)); + + if (lerp > 0.3f && lerp < 0.8f && Main.rand.NextBool((int)(1 + 4 * Projectile.MaxUpdates * Math.Abs(Utils.GetLerpValue(0.5f, 1.2f, lerp))))) + { + Vector2 dustPosition = Projectile.Center + Projectile.velocity * 170 * Projectile.scale; + Vector2 dustPosition2 = Projectile.Center + Projectile.velocity.RotatedByRandom(0.3f) * 170 * Projectile.scale; + Vector2 swingVel = Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (swingCount % 2 == 0 ? 1 : -1) * Owner.direction); + + Dust dust = Dust.NewDustPerfect(dustPosition, ModContent.DustType(), + swingVel.RotatedByRandom(0.1f) * Main.rand.NextFloat(9.5f, 15.5f), 0, default, Main.rand.NextFloat(1.55f, 2.2f)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 7; + + if (Main.rand.NextBool(3, 4)) + { + Vector2 vel = swingVel.RotatedByRandom(0.1f) * Main.rand.NextFloat(9.5f, 15.5f); + Dust dust2 = Dust.NewDustPerfect(dustPosition2, ModContent.DustType(), + vel, 0, default, 2 * Main.rand.NextFloat(1.0f, 1.3f)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.0f); + dust2.fadeIn = 0.2f; + } + + } + if (lerp > 0.4f) // Partway through make the hitbox and sound + { + if (makeSound) + { + enabledHitbox = hitboxFramesMax; + SoundStyle swing1 = new("CalamityMod/Sounds/Item/HeavySwing"); + SoundEngine.PlaySound(swing1 with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.32f) }, Projectile.Center); + makeSound = false; + } + } + #endregion + } + Timers(); } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public void Timers() { - if ((target.life <= 0 && target.realLife == -1) && Projectile.numHits > 0) - Projectile.numHits -= 1; - if (damageDone <= 2) + time++; + // Only increment the attack animation when on cooldown or when allowed to swing + if ((attackTimer < fireRate && performSwing) || attackTimer < -1) + attackTimer++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + // Dont increment numHits on armored targets or kills + if (((target.life <= 0 && target.realLife == -1) || target.Calamity().IsArmored())) armoredHits++; - if (Main.zenithWorld && Projectile.numHits == 0 && target.type != ModContent.NPCType() && Main.rand.NextBool(5)) + float distanceToTiles = -100; + bool canBeLaunched = false; + bool lowEnoughToExecute = target.life <= Projectile.damage * 15; + bool jared = target.type == ModContent.NPCType(); + Vector2 toMouse = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); + Vector2 launchVel = lowEnoughToExecute ? toMouse : Utils.DirectionTo(Owner.Center, target.Center); + + if (lowEnoughToExecute || jared) { - SoundStyle fire3 = new("CalamityMod/Sounds/Item/GFBScreams/Scream", 8); - SoundEngine.PlaySound(fire3 with { Volume = 0.8f }, Projectile.Center); + distanceToTiles = CalamityUtils.DistanceToTileCollisionHit(target.Center, launchVel, 200) ?? -100; + canBeLaunched = jared || ((distanceToTiles == -100 ? false : distanceToTiles < 200 ? true : false) && target.realLife == -1); } if (Projectile.numHits == 0) { @@ -227,60 +274,78 @@ namespace CalamityMod.Projectiles.Melee SoundStyle fire2 = new("CalamityMod/Sounds/Item/FinalDawnSlash"); SoundEngine.PlaySound(fire2 with { Volume = 0.65f, Pitch = Main.rand.NextFloat(-0.2f, -0.3f) }, Projectile.Center); } - - int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 12, 1, 20)); + int heal = (int)(MathHelper.Clamp(18 - Projectile.numHits * 13, 1, 20)); if (Projectile.numHits < 10) { - Owner.DoLifestealDirect(target, heal, 0.5f); + Owner.Calamity().grandDadHealPool += heal; + // Give partial Grand Dad healing to all nearby players + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + Player player = Main.player[playerIndex]; + float targetDist = player.Center.DistanceSQ(Owner.Center); + + if (targetDist < 500f && player.team == Owner.team && player != Owner) + { + player.Calamity().grandDadHealPool += (int)(heal / 2); + } + } } - if (target.CanBeMoved(true) || Main.zenithWorld || target.type == ModContent.NPCType() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) + // Regular knockback + float launchPower = 60; + target.MoveNPC(toMouse, launchPower * (canBeLaunched ? 0.5f : 0.25f), true, Owner); + if (canBeLaunched) // launches/executes enemies { - if (target.type == ModContent.NPCType()) + if (jared) { CombatText.NewText(target.Hitbox, Color.Aqua, CalamityUtils.GetTextValue("Misc.HecBoop")); SoundStyle boop = new("CalamityMod/Sounds/Item/SnootBooped"); SoundEngine.PlaySound(boop with { Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, Projectile.Center); } - bool rightClicked = Owner.Calamity().mouseRight; + target.Calamity().pacified = true; - // Make all hit enemies able to hit tiles, so you can dunk them - target.noTileCollide = false; - - // Launch the suckers - Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - float launchPower = 30 * (rightClicked ? 2 : 1); - target.MoveNPC(launchVel, launchPower * 0.5f, true); - - // Remove knockback resist, just like it used to - target.knockBackResist = 1; - - // Apply tile collison damage (is boosted even further if both final bosses are gone) - float damageMults = ((DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) ? 5 : 1) * (rightClicked ? 3 : 1); - int damage = (int)(Projectile.damage * damageMults); - target.GetGlobalNPC().ApplyCollisionDamage(target, Owner, damage, launchVel * launchPower, 5f, true); + // Apply tile collison damage and forced velocity to launch the suckers + // This always kills (unless it's Jared) + int damage = (int)(Projectile.damage); + target.GetGlobalNPC().ApplyCollisionDamage(target, Owner, (jared && !lowEnoughToExecute) ? 1 : damage, launchVel * launchPower, 5f, true, true); } if (Projectile.numHits < 3) { - Particle spark = new VoidSparkParticle(target.Center, (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * (-45 + Projectile.numHits * 5), false, (int)(16 - Projectile.numHits * 3), 0.6f - Projectile.numHits * 0.15f, Color.DodgerBlue, 0.45f); - GeneralParticleHandler.SpawnParticle(spark); + for (int i = 0; i < 2; i++) + { + Particle spark = new CustomSpark(target.Center, launchVel * 65, "CalamityMod/Particles/GlowSpark2", false, (int)(16 - Projectile.numHits * 3), 0.145f - Projectile.numHits * 0.015f, Color.Black, new Vector2(2f, 1f), false, shrinkSpeed: 1f, colorFadeSpeed: 10); + GeneralParticleHandler.SpawnParticle(spark, true); + Particle spark2 = new CustomSpark(target.Center, launchVel * 65, "CalamityMod/Particles/GlowSpark", false, (int)(16 - Projectile.numHits * 3), 0.105f - Projectile.numHits * 0.015f, Color.Lerp(Color.Blue, Color.DodgerBlue, 0.65f), new Vector2(2f, 1f), true, false, shrinkSpeed: 1f, colorFadeSpeed: 10); + GeneralParticleHandler.SpawnParticle(spark2, true, GeneralDrawLayer.AfterEverything); + } + + for (int i = 0; i < 25 - Projectile.numHits * 3; i++) + { + float hitMult = 1 - 0.15f * Projectile.numHits; + float variance = Main.rand.NextFloat(-0.6f, 0.6f); + Dust dust = Dust.NewDustPerfect(target.Center, ModContent.DustType(), + launchVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(30.0f, 33.0f) * hitMult * MathF.Pow((1 - MathF.Abs(variance)), 2), 0, default, 3 * hitMult * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust.noGravity = true; + dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; + dust.customData = 3; + dust.fadeIn = 2.1f; + + if (i % 2 == 0) + { + Vector2 vel = launchVel.RotatedBy(variance / 2).RotatedByRandom(MathF.Abs(variance) / 3) * Main.rand.NextFloat(20.0f, 23.0f) * hitMult * MathF.Pow((1 - MathF.Abs(variance)), 2); + Dust dust2 = Dust.NewDustPerfect(target.Center + vel * 13, ModContent.DustType(), + vel, 0, default, 2 * hitMult * Main.rand.NextFloat(2.3f, 3.2f) - MathF.Abs(variance)); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool() ? Color.Gold : Color.Goldenrod; + dust2.customData = new Vector2(0.2f, 1.6f); + dust2.fadeIn = 2.5f; + } + } } - for (int i = 0; i < MathHelper.Clamp(10 - Projectile.numHits * 2, 2, 10); i++) - { - Particle spark2 = new SparkParticle(target.Center, ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -35).RotatedByRandom(0.7) * Main.rand.NextFloat(0.2f, 1f), false, 55, Main.rand.NextFloat(0.4f, 1.5f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dust = Dust.NewDustPerfect(target.Center, ModContent.DustType(), ((Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -35).RotatedByRandom(0.7) * Main.rand.NextFloat(0.2f, 1f), 0, default, Main.rand.NextFloat(1.55f, 2.2f)); - dust.noGravity = true; - dust.color = Main.rand.NextBool() ? Color.DodgerBlue : Color.Blue; - } - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Owner.Calamity().mouseRight) + if (canBeLaunched) { modifiers.SourceDamage *= 0; modifiers.FinalDamage.Flat = 0.1f; @@ -293,34 +358,61 @@ namespace CalamityMod.Projectiles.Melee modifiers.SourceDamage *= damageMult; } } - public override bool PreDraw(ref Color lightColor) { - // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. - if ((useAnim > 0 || DrawUnconditionally) && Owner.ItemAnimationActive) + if (time < 3) + return false; + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D swoosh = ModContent.Request("CalamityMod/Particles/CircularSmearLarge").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + ((Owner.direction == -1) ? MathHelper.Pi - MathHelper.PiOver4 : MathHelper.PiOver4); + Vector2 rotationPoint = (Owner.direction == -1) ? new Vector2(texture.Width, texture.Height) : new Vector2(0, texture.Height); + SpriteEffects flipSprite = (Owner.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 handLatchingAdjustments = (swingCount % 2 == 0 ? new Vector2(-6, 0) : new Vector2(-2, 0)); + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f + (handLatchingAdjustments.RotatedBy(drawRotation) * Owner.direction); + + float lerp = 1 - bladefx; + int swingCountFlip = (swingCount % 2 == 0 ? 1 : 3) + Owner.direction == 0 ? 2 : 0; + Vector2 vel2 = Vector2.Lerp(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Owner.Center.DirectionTo(Owner.ClampedMouseWorld()).RotatedBy(-MathHelper.PiOver2), 0f); + float extraRot = MathHelper.PiOver4 * MathHelper.Lerp(3, 1.9f, lerp) * (swingCount % 2 == 0 ? (Owner.direction == -1 ? 1 : -1) : (Owner.direction == -1 ? -1 : 1)); + float swooshDrawRotation = vel2.ToRotation() + extraRot; + SpriteEffects swooshFlipSprite = (swingCount % 2 == 0 ? (Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (Owner.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally)); + if (bladefx > 0.02f) { - Asset tex = ModContent.Request(Texture); - Asset glowTex = ModContent.Request("CalamityMod/Items/Weapons/Melee/GrandDadGlow"); - - float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; - - Asset swoosh = ModContent.Request("CalamityMod/Particles/VerticalSmearLarge"); - if (Animation > useAnim * 0.2f) - Main.EntitySpriteDraw(swoosh.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), null, Color.DodgerBlue with { A = 0 } * fadeIn * 0.65f, (FinalRotation + MathHelper.ToRadians(45)) + MathHelper.ToRadians(Projectile.ai[1] == 1 ? -90 : 90) * -Owner.direction, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, SpriteEffects.None); - - for (int i = 0; i < 25; i++) + PixelationManager.AddPixelatedDrawer((_) => { - Texture2D centerTexture = ModContent.Request("CalamityMod/Projectiles/Melee/GrandDadGhost").Value; - Color auraColor = Color.Gold with { A = 0 } * 0.15f * fadeIn; - Vector2 drawOffset = (MathHelper.TwoPi * i / 25f).ToRotationVector2() * 6 * fadeIn; - Main.EntitySpriteDraw(centerTexture, Projectile.Center - Main.screenPosition + drawOffset + new Vector2(0, Owner.gfxOffY), centerTexture.Frame(1, FrameCount, 0, Frame), auraColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); + int draws = 15; + for (int i = 0; i < draws; i++) + { + Color clr = Color.Black; + Vector2 outlineOffset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 3.5f; + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f + outlineOffset, null, clr * MathF.Pow(bladefx, 3) * 0.4f, swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, swooshFlipSprite); + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust + outlineOffset * 2 * bladefx, null, clr * 0.2f * bladefx, drawRotation, rotationPoint, Projectile.scale, flipSprite); + } + }, Enums.GeneralDrawLayer.AfterProjectiles, BlendState.AlphaBlend); + if (!CalamityClientConfig.Instance.Photosensitivity) + { + PixelationManager.AddPixelatedDrawer((_) => + { + Color clrCenter = Color.DodgerBlue; + Main.EntitySpriteDraw(swoosh, drawPosition + Projectile.velocity.RotatedBy(extraRot) * 12.5f, null, clrCenter * MathF.Pow(bladefx, 0.6f), swooshDrawRotation, swoosh.Size() * 0.5f, Projectile.scale * 0.6f, swooshFlipSprite); + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, clrCenter * bladefx, drawRotation, rotationPoint, Projectile.scale, flipSprite); + }, Enums.GeneralDrawLayer.AfterEverything, BlendState.Additive); + } - - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - Main.EntitySpriteDraw(glowTex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), glowTex.Frame(1, FrameCount, 0, Frame), Color.White, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(glowTex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, spriteEffects != SpriteEffects.None ? spriteEffects : (FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None)); - } + + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + return false; } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + overPlayers.Add(index); + } } } diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index 51978ae71d..6ab245f9cd 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Melee armoredHits++; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 8, true); + target.MoveNPC(launchVel, 8, true, Owner); if (spawnBoom) { diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index 07c121065c..7a185698b5 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -390,18 +391,17 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, (chargedSwing ? 24 : 19), true); + target.MoveNPC(launchVel, (chargedSwing ? 24 : 19), true, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (chargedSwing) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? (2.9f + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? 2.9f : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index 923f3e19c5..959a2e1553 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -438,7 +438,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, (chargedSwing ? 35 : 23), true); + target.MoveNPC(launchVel, (chargedSwing ? 35 : 23), true, Owner); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 46e0e0485c..85a8a361da 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -144,7 +144,6 @@ namespace CalamityMod.Projectiles.Melee } if (Projectile.frame > 3) Projectile.frame = 0; - Main.NewText(Projectile.timeLeft); time++; } diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index d858ee8cdb..3d69d25e66 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.IceRod, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 30); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 30); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/LightspeedDashHitbox.cs b/Projectiles/Melee/LightspeedDashHitbox.cs index 198524c45c..546b3f3247 100644 --- a/Projectiles/Melee/LightspeedDashHitbox.cs +++ b/Projectiles/Melee/LightspeedDashHitbox.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 84; - Projectile.height = 64; + Projectile.width = 150; + Projectile.height = 75; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(CommonCalamitySounds.SwiftSliceSound with { Volume = CommonCalamitySounds.SwiftSliceSound.Volume * 0.33f }, Projectile.Center); var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); // Refund 30 energy if dash hits. Can get energy from multiple enemies. modPlayer.elementalMastery += 30; diff --git a/Projectiles/Melee/LightspeedHoldout.cs b/Projectiles/Melee/LightspeedHoldout.cs index 26e85a1eed..074be3fa64 100644 --- a/Projectiles/Melee/LightspeedHoldout.cs +++ b/Projectiles/Melee/LightspeedHoldout.cs @@ -171,6 +171,9 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + var player = Main.player[Projectile.owner]; + var modPlayer = player.GetModPlayer(); + Projectile.scale = 0.6f; if (!Owner.channel && DashState == 0) @@ -187,7 +190,7 @@ namespace CalamityMod.Projectiles.Melee if (Owner.altFunctionUse == 2 && Owner.Calamity().mouseRight) { // Check if the player has enough EM - if (Owner.Calamity().elementalMastery < 100) + if (modPlayer.elementalMastery < 100) { Projectile.Kill(); return; @@ -196,7 +199,7 @@ namespace CalamityMod.Projectiles.Melee DashState = 1; DashTimer = DashPrepTime; Projectile.localAI[0] = Owner.direction; - Owner.Calamity().elementalMastery = 0; // Reset EM to zero + modPlayer.elementalMastery = 0; // Reset EM to zero } } diff --git a/Projectiles/Melee/LightspeedM1Hitbox.cs b/Projectiles/Melee/LightspeedM1Hitbox.cs index cf1c27cfa3..3e27b0a648 100644 --- a/Projectiles/Melee/LightspeedM1Hitbox.cs +++ b/Projectiles/Melee/LightspeedM1Hitbox.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee { gotEnergyThisSwing = true; var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); // +4 energy on hit modPlayer.elementalMastery += 4; diff --git a/Projectiles/Melee/LucreciaHoldout.cs b/Projectiles/Melee/LucreciaHoldout.cs index 7268276580..222b21699d 100644 --- a/Projectiles/Melee/LucreciaHoldout.cs +++ b/Projectiles/Melee/LucreciaHoldout.cs @@ -56,8 +56,7 @@ namespace CalamityMod.Projectiles.Melee public override void Spawn() { var player = Main.player[Projectile.owner]; - var modplayer = player.GetModPlayer(); - var calamityPlayer = player.Calamity(); + var lucreciaPlayer = player.GetModPlayer(); // Store the base use time from the item int baseUseTime = BaseItem.useTime; @@ -65,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee if (player.altFunctionUse == 2) { // Check for energy before the projectile exists - if (calamityPlayer.darklightEnergy < 100) + if (lucreciaPlayer.darklightEnergy < 100) { Projectile.Kill(); return; @@ -87,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee RotateInCooldown = 1f; Projectile.knockBack = 15f; - calamityPlayer.darklightEnergy = 0; // Remove energy for startup + lucreciaPlayer.darklightEnergy = 0; // Remove energy for startup } else { @@ -323,10 +322,10 @@ namespace CalamityMod.Projectiles.Melee gotEnergyThisSwing = true; var player = Main.player[Projectile.owner]; - var modPlayer = player.Calamity(); + var modPlayer = player.GetModPlayer(); - // +25 energy on hit - modPlayer.darklightEnergy += 25; + // +20 energy on hit + modPlayer.darklightEnergy += 20; modPlayer.darklightEnergy = Math.Min(modPlayer.darklightEnergy, Lucrecia.MaxEnergy); // On-hit cut FX diff --git a/Projectiles/Melee/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/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index ddb54e5253..b10a3a2a49 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -197,7 +197,7 @@ namespace CalamityMod.Projectiles.Melee } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 15, true); + target.MoveNPC(launchVel, 15, true, Owner); for (int i = 0; i < MathHelper.Clamp(6 - Projectile.numHits * 2, 2, 6); i++) { diff --git a/Projectiles/Melee/MawOfInfinityHoldout.cs b/Projectiles/Melee/MawOfInfinityHoldout.cs index cb0d2546cb..cf7bf97d01 100644 --- a/Projectiles/Melee/MawOfInfinityHoldout.cs +++ b/Projectiles/Melee/MawOfInfinityHoldout.cs @@ -155,9 +155,5 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.Draw(tex, DrawPos - Main.screenPosition, tex.Frame(2,1,0,0), modplayer.swingNum == 1 ? Color.Fuchsia : Color.Cyan, rotation + MathHelper.PiOver4, new Vector2(tex.Width * 0.25f,tex.Height * 0.5f), Projectile.scale * jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 240); - } } } diff --git a/Projectiles/Melee/MendedBiomeBlade_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/MonstrousKnife.cs b/Projectiles/Melee/MonstrousKnife.cs index 8f2abedb44..9ba7015b77 100644 --- a/Projectiles/Melee/MonstrousKnife.cs +++ b/Projectiles/Melee/MonstrousKnife.cs @@ -45,6 +45,6 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 4f); //4x cooldown = 23.3 HP bank, 2.25 hp/s refill + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 3f); //3x cooldown = 23.3 HP bank, 2 hp/s refill } } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 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/OldLordClaymoreHoldout.cs b/Projectiles/Melee/OldLordClaymoreHoldout.cs index 66ed0e1215..cf3264b909 100644 --- a/Projectiles/Melee/OldLordClaymoreHoldout.cs +++ b/Projectiles/Melee/OldLordClaymoreHoldout.cs @@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.OnFire3, 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - CalamityUtils.MoveNPC(target, launchVel, 12, true); + CalamityUtils.MoveNPC(target, launchVel, 12, true, Owner); int dustNum = (int)MathHelper.Clamp(12 - Projectile.numHits * 3, 3, 12); for (int i = 0; i < dustNum; i++) diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs index f40e864581..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(); @@ -85,16 +84,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = newVelocity; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 300); - } - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 170); // Don't suffer from the same issues Murasama did in the past; encouraging people to kill their wrists for some extra DPS is bad lmao diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index 2fc3736a21..c184e5faaf 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -60,6 +60,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.8f); if (Projectile.numHits < 1) { Particle orb = new GlowSparkParticle(target.Center, Projectile.velocity.SafeNormalize(Vector2.UnitY), false, 12, 0.07f, mainColor, new Vector2(1.5f, 0.8f), true); diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs index 4ef4e0f9b3..4f12c74fe9 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusProj.cs @@ -102,7 +102,11 @@ namespace CalamityMod.Projectiles.Melee.Shortswords } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - Owner.Calamity().StratusStarburst++; + if (Projectile.numHits == 0) + Owner.Calamity().StratusStarburst++; + else + Owner.Calamity().StarburstSpawnFrameCounter += 0.25f; + } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs b/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs index ae618ec5b3..0c3d240adb 100644 --- a/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs +++ b/Projectiles/Melee/Shortswords/GalileoGladiusThrown.cs @@ -219,7 +219,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords Particle boostRing = new CustomSpark(position, velocity, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, lifetime, scale, color, stretch, shrinkSpeed: shrink); GeneralParticleHandler.SpawnParticle(boostRing); - if (stabbedNPC.CanBeMoved(true)) + if (stabbedNPC.CanBeMoved()) { stabbedNPC.velocity = -Owner.velocity; } diff --git a/Projectiles/Melee/SkytideDragoonHoldout.cs b/Projectiles/Melee/SkytideDragoonHoldout.cs index 946245b17b..686133e319 100644 --- a/Projectiles/Melee/SkytideDragoonHoldout.cs +++ b/Projectiles/Melee/SkytideDragoonHoldout.cs @@ -298,7 +298,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.65f, Pitch = 0.4f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 23, true); + target.MoveNPC(launchVel, 23, true, Owner); target.AddBuff(BuffID.Electrified, 230); } diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index b61bd6042b..5f67f8f6be 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -90,7 +91,10 @@ namespace CalamityMod.Projectiles.Melee.Spears else { if (timer == StartupTime - 1) - Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 75f)); //scales from 0x to 3x power + { + Projectile.originalDamage = (int)(Projectile.originalDamage * 0.75 * (channelCharge / 75f)); //scales from 0x to 3x power + Projectile.damage = (int)(Projectile.damage * 0.75 * (channelCharge / 75f)); //Both are needed + } } //Make the sprite rotation look right in game Projectile.rotation -= (MathHelper.PiOver2) * (angle.X > 0 ? 1 : -1); @@ -260,15 +264,11 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 900); - Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015)); - if (Projectile.damage > 1) - Projectile.damage = (int)(Projectile.damage * 0.925f); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.0015), 0.5f); + Projectile.originalDamage = (int)(Projectile.originalDamage * 0.925f); + Projectile.damage = (int)(Projectile.damage * 0.925f); //Both are needed as it doesn't recalculate till next frame } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f; - modifiers.CritDamage += critDamage; - } + => modifiers.ApplyScalingForcedCrit(Projectile); } } diff --git a/Projectiles/Melee/Spears/NadirSpear.cs b/Projectiles/Melee/Spears/NadirSpear.cs index 1f02d2c570..672789f03f 100644 --- a/Projectiles/Melee/Spears/NadirSpear.cs +++ b/Projectiles/Melee/Spears/NadirSpear.cs @@ -71,6 +71,6 @@ namespace CalamityMod.Projectiles.Melee.Spears Main.dust[idx].velocity = Vector2.Zero; } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Melee/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index 5dfff076cc..d06ba14221 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -202,7 +202,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(fire2 with { Volume = 0.55f, Pitch = 0.6f }, Projectile.Center); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 17, true); + target.MoveNPC(launchVel, 17, true, Owner); for (int i = 0; i < MathHelper.Clamp(10 - Projectile.numHits * 2, 2, 10); i++) { diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 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/VoidEssence.cs b/Projectiles/Melee/VoidEssence.cs index 52d4a597c0..c14a4dc8c7 100644 --- a/Projectiles/Melee/VoidEssence.cs +++ b/Projectiles/Melee/VoidEssence.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[idx].scale = scale; } - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 30); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index 96c173fec5..fe2ae8174c 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.height = 196; Projectile.Center = Projectile.position; Projectile.originalDamage = Projectile.damage; - Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 0.75f, chargeProgress)); + Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 1f, chargeProgress)); sawHit = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.aiStyle = -1; @@ -113,10 +113,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { if (sawHit) { + if (damageDone > 2 && !target.Calamity().IsArmored()) + Projectile.damage = (int)(Projectile.damage * 0.85f); Vector2 bloodpos = Projectile.Center + Projectile.DirectionTo(target.Center) * 84; - if (!spawnedBlood && Main.rand.NextBool() && chargeProgress > 0.2f && target.Hitbox.Contains(bloodpos.ToPoint())) + if (!spawnedBlood && chargeProgress > Main.rand.NextFloat() && target.Hitbox.Contains(bloodpos.ToPoint())) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 4, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 8, 0f, Projectile.owner); spawnedBlood = true; } return; diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 3f2b27e3c6..3c7a6de762 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -200,8 +200,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCHit/OtherworldlyHit") with { Pitch = -0.45f, Volume = 0.33f }, Projectile.Center); } - else - target.AddBuff(ModContent.BuffType(), 180); GFBCounter = 15; } } diff --git a/Projectiles/Pets/StarSwallowerPet.cs b/Projectiles/Pets/StarSwallowerPet.cs new file mode 100644 index 0000000000..7292b421c4 --- /dev/null +++ b/Projectiles/Pets/StarSwallowerPet.cs @@ -0,0 +1,359 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Pets +{ + public class StarSwallowerPet : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Pets"; + private int playerStill = 0; + private bool idleAnimation = false; + private bool fly = false; + + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 14; + Main.projPet[Projectile.type] = true; + + ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(1, 8, 6) + .WithOffset(-18f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0); + } + + public override void SetDefaults() + { + Projectile.netImportant = true; + Projectile.width = 54; + Projectile.height = 48; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft *= 5; + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 scale = Vector2.One; + if (fly) + { + float animRate = Main.GlobalTimeWrappedHourly * 20; + float scaleMod = 0.2f; + scale += new Vector2(MathF.Cos(animRate), MathF.Sin(animRate)) * scaleMod; + } + SpriteEffects fx = fly ? (SpriteEffects.FlipVertically | (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None)) : Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2 / Main.projFrames[Type]), Projectile.scale * scale, fx, 0); + + return false; + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + Player player = Main.player[Projectile.owner]; + float heightDif = player.Center.Y - Projectile.Center.Y; + fallThrough = fly || heightDif >= 160f; + return true; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + if (!player.active) + { + Projectile.active = false; + return; + } + + CalamityPlayer modPlayer = player.Calamity(); + if (player.dead) + { + modPlayer.starSwallowerPetFroge = false; + } + if (modPlayer.starSwallowerPetFroge) + { + Projectile.timeLeft = 2; + } + + Vector2 projPos = Projectile.position; + Vector2 mouthPos = Projectile.Center + new Vector2(-20 * Projectile.spriteDirection, -6f).RotatedBy(Projectile.rotation); + if (!fly) + { + Projectile.rotation = 0; + Vector2 projCenter = Projectile.Center; + Vector2 playerDirection = player.Center - projCenter; + float playerDistance = playerDirection.Length(); + if (Projectile.velocity.Y == 0 && ((HoleBelow() && playerDistance > 150f) || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X))) + { + Projectile.velocity.Y = -8f; + } + Projectile.velocity.Y += 0.35f; + if (Projectile.velocity.Y > 15f) + { + Projectile.velocity.Y = 15f; + } + if (playerDistance > 480f) + { + fly = true; + Projectile.velocity.X = 0f; + Projectile.velocity.Y = 0f; + } + if (playerDistance > 100f) + { + if (player.position.X - Projectile.position.X > 0f) + { + Projectile.velocity.X += 0.125f; + if (Projectile.velocity.X > 6.75f) + { + Projectile.velocity.X = 6.75f; + } + } + else + { + Projectile.velocity.X -= 0.125f; + if (Projectile.velocity.X < -6.75f) + { + Projectile.velocity.X = -6.75f; + } + } + } + if (playerDistance < 100f) + { + if (Projectile.velocity.X != 0f) + { + if (Projectile.velocity.X > 0.8f) + { + Projectile.velocity.X -= 0.25f; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.velocity.X += 0.25f; + } + else if (Projectile.velocity.X < 0.8f && Projectile.velocity.X > -0.8f) + { + Projectile.velocity.X = 0f; + } + } + } + if (playerDistance < 70f) + { + Projectile.velocity.X *= 0.5f; + } + + //set frames when idle + if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0) + { + // Idle animation where it opens its mouth and lets out some plasma mist + if (Main.rand.NextBool(600) && !idleAnimation) + { + idleAnimation = true; + Projectile.frame = 8; + Projectile.frameCounter = 0; + } + + if (idleAnimation) + { + Projectile.frameCounter++; + if (Projectile.frameCounter > 8) + { + Projectile.frame += (Projectile.ai[0] != -1).ToDirectionInt(); + Projectile.frameCounter = 0; + } + if (Projectile.ai[0] != -1) + { + if (Projectile.frame >= 12) + { + Projectile.ai[0] = -1; + Projectile.frame = 11; + } + } + else + { + if (Projectile.frame <= 7) + { + Projectile.ai[0] = 0; + Projectile.frame = 0; + idleAnimation = false; + } + } + if (Projectile.frame > 8) + { + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(mouthPos, (Vector2.UnitX * -Projectile.spriteDirection).RotatedByRandom(MathHelper.ToRadians(10)) * Main.rand.NextFloat(4, 8), new Color(201, 234, 71), new Color(115, 192, 58), Main.rand.NextFloat(0.8f, 1.1f), 170f, Main.rand.NextFloat(0.1f, 0.2f) * Main.rand.NextFloatDirection())); + } + } + else + { + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + } + //falling frame + else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y) + { + Projectile.frame = 7; + Projectile.frameCounter = 0; + } + else if (Projectile.velocity.X != 0) + { + //moving animation + Projectile.frameCounter++; + if (Projectile.frameCounter >= 6) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame > 7) + { + Projectile.frame = 0; + } + } + + if (Projectile.velocity.X > 0.8f) + { + Projectile.spriteDirection = -1; + } + else if (Projectile.velocity.X < -0.8f) + { + Projectile.spriteDirection = 1; + } + } + else if (fly) + { + idleAnimation = false; + Projectile.ai[0] = 0; + float flySpeed = 0.5f; + Projectile.tileCollide = false; + Vector2 flyDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f); + float horiPos = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - flyDirection.X; + float vertiPos = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - flyDirection.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)player.direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + if (playerDistance > 1200f) + { + Projectile.position.X = player.Center.X - (float)(Projectile.width / 2); + Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2); + Projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + flySpeed = 0.5f; + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 10 && Projectile.Center.Y <= player.Center.Y && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + { + fly = false; + Projectile.velocity *= 0.2f; + Projectile.tileCollide = true; + } + } + if (playerDistance < 50f) + { + if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f) + { + Projectile.velocity *= 0.90f; + } + flySpeed = 0.02f; + } + else + { + if (playerDistance < 100f) + { + flySpeed = 0.35f; + } + if (playerDistance > 300f) + { + flySpeed = 1f; + } + playerDistance = 18f / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + if (Projectile.velocity.X <= horiPos) + { + Projectile.velocity.X = Projectile.velocity.X + flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.X < 0f) + { + Projectile.velocity.X = Projectile.velocity.X + flySpeed; + } + } + if (Projectile.velocity.X > horiPos) + { + Projectile.velocity.X = Projectile.velocity.X - flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.X > 0f) + { + Projectile.velocity.X = Projectile.velocity.X - flySpeed; + } + } + if (Projectile.velocity.Y <= vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y + flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.Y < 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y + flySpeed * 2f; + } + } + if (Projectile.velocity.Y > vertiPos) + { + Projectile.velocity.Y = Projectile.velocity.Y - flySpeed; + if (flySpeed > 0.05f && Projectile.velocity.Y > 0f) + { + Projectile.velocity.Y = Projectile.velocity.Y - flySpeed * 2f; + } + } + + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0); + + if (Projectile.Center.X < Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = -1; + } + else if (Projectile.Center.X > Main.player[Projectile.owner].Center.X) + { + Projectile.spriteDirection = 1; + } + + Projectile.frame = 12; + + // fly anim particles + GeneralParticleHandler.SpawnParticle(new MediumMistParticle(mouthPos, mouthPos.DirectionTo(Projectile.oldPosition).RotatedByRandom(MathHelper.ToRadians(20)).RotatedBy(MathHelper.ToRadians(10 * Projectile.spriteDirection)) * Main.rand.NextFloat(4, 8), new Color(201, 234, 71), new Color(115, 192, 58), Main.rand.NextFloat(0.7f, 1f), 200f, Main.rand.NextFloat(0.1f, 0.2f) * Main.rand.NextFloatDirection())); + } + } + + private bool HoleBelow() + { + int tileWidth = 4; + int tileX = (int)(Projectile.Center.X / 16f) - tileWidth; + if (Projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((Projectile.position.Y + Projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].HasTile && (Main.tile[x - 1, y].HasTile || Main.tile[x + 1, y].HasTile)) + { + return false; + } + } + } + return true; + } + } +} diff --git a/Projectiles/Pets/StarSwallowerPet.png b/Projectiles/Pets/StarSwallowerPet.png new file mode 100644 index 0000000000..d3812caa71 Binary files /dev/null and b/Projectiles/Pets/StarSwallowerPet.png differ diff --git a/Projectiles/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index a52e6c2f5e..da98941b47 100644 --- a/Projectiles/Ranged/AnimosityBullet.cs +++ b/Projectiles/Ranged/AnimosityBullet.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); // Music easter egg in GFB, and more! if (Main.zenithWorld) diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index 8ae685bc7a..649136df35 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -108,7 +108,12 @@ namespace CalamityMod.Projectiles.Ranged LightPower = MathHelper.Lerp(LightPower, lightPowerBelow, 0.15f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + //Doze - Flamethrowers in vanilla are long debuff infliction tools (20 seconds of their debuff). + //I am applying this as the base for Cal flamethrowers, with shorter times being the exception instead of the rule + target.AddBuff(ModContent.BuffType(), 1200); + } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.SourceDamage *= damageMult; diff --git a/Projectiles/Ranged/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/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index 6105c72c87..989ceead5a 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -60,8 +60,7 @@ namespace CalamityMod.Projectiles.Ranged Particle spark = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark2", false, 17, 0.052f, Color.Black, new Vector2(0.6f, 1.3f), false); GeneralParticleHandler.SpawnParticle(spark); Particle spark2 = new CustomSpark(Projectile.Center, -Projectile.velocity * 0.05f, "CalamityMod/Particles/GlowSpark", false, 17, 0.027f, Color.LightGreen, new Vector2(0.6f, 1.3f), true, false); - GeneralParticleHandler.SpawnParticle(spark2); - spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(spark2, false, GeneralDrawLayer.AfterEverything); } if (Time == 9f) @@ -111,8 +110,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 3; i++) { Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.48f, 0.52f, 38); - GeneralParticleHandler.SpawnParticle(blastRing); - blastRing.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(blastRing, false, GeneralDrawLayer.AfterEverything); } float numberOfDusts = 10; @@ -124,8 +122,6 @@ namespace CalamityMod.Projectiles.Ranged dust.scale = Main.rand.NextFloat(1.6f, 2.2f); dust.color = InnerColor; } - //Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, InnerColor, "CalamityMod/Particles/SoftRoundExplosion", new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0f, 0.1f, 15); - //GeneralParticleHandler.SpawnParticle(pulse); if (BounceHits == 0f) SoundEngine.PlaySound(DeadSunsWind.Ricochet, Projectile.Center); diff --git a/Projectiles/Ranged/DeadSunExplosion.cs b/Projectiles/Ranged/DeadSunExplosion.cs index 18d952eb85..06872fddbf 100644 --- a/Projectiles/Ranged/DeadSunExplosion.cs +++ b/Projectiles/Ranged/DeadSunExplosion.cs @@ -33,8 +33,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Particle explosion = new DetailedExplosion(Projectile.Center, Vector2.Zero, color1, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0065f + 0.1f, Main.rand.Next(15, 22)); - GeneralParticleHandler.SpawnParticle(explosion); - explosion.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(explosion, false, GeneralDrawLayer.AfterEverything); Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0045f + 0.1f, Main.rand.Next(15, 22), false); GeneralParticleHandler.SpawnParticle(explosion2); Particle explosion3 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Black, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, ExplosionRadius * 0.0030f + 0.1f, Main.rand.Next(15, 22), false); @@ -43,8 +42,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 4; i++) { Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, color1, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0, ExplosionRadius * 0.005f + 0.05f, 25); - GeneralParticleHandler.SpawnParticle(blastRing); - blastRing.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(blastRing, false, GeneralDrawLayer.AfterEverything); } float numberOfDusts = ExplosionRadius * 0.1f + 10; diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 48d0f4c787..25268fe87a 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -1,74 +1,469 @@ -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(3f * 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) + { + 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) ? null : false && 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/FetidEmesisHoldout.cs b/Projectiles/Ranged/FetidEmesisHoldout.cs index c712407bed..0cd504db1b 100644 --- a/Projectiles/Ranged/FetidEmesisHoldout.cs +++ b/Projectiles/Ranged/FetidEmesisHoldout.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged revFrames++; shineScale *= 0.77f; - if ((revFrames >= maxFrames && !isTired || (Owner.Calamity().mouseRight && revFrames > 2 )) && Owner.whoAmI == Main.myPlayer) + if (revFrames >= maxFrames && !isTired && Owner.whoAmI == Main.myPlayer) { Owner.SetScreenshake(6.5f); OffsetLengthFromArm -= 35f; diff --git a/Projectiles/Ranged/FlashRoundFlash.cs b/Projectiles/Ranged/FlashRoundFlash.cs index 292698a737..6fb1571f0f 100644 --- a/Projectiles/Ranged/FlashRoundFlash.cs +++ b/Projectiles/Ranged/FlashRoundFlash.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { Player Owner = Main.player[Projectile.owner]; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Projectile.Center); - target.MoveNPC(launchVel, 5, false); + target.MoveNPC(launchVel, 5, false, Owner); Vector2 dustVel = Utils.DirectionTo(Projectile.Center, target.Center); for (int i = 0; i < 3; i++) diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 39b2db16d6..5b221afcc8 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/FlurrystormIceShard.cs b/Projectiles/Ranged/FlurrystormIceShard.cs index 343a0ebc35..977a176d83 100644 --- a/Projectiles/Ranged/FlurrystormIceShard.cs +++ b/Projectiles/Ranged/FlurrystormIceShard.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn, 120); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 7b111a00ae..4800aa818b 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center); if (!target.boss) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frozen, 120); int points = 6; float radians = MathHelper.TwoPi / points; diff --git a/Projectiles/Ranged/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/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs index 90705bfdf2..e53c485122 100644 --- a/Projectiles/Ranged/HellbornProj.cs +++ b/Projectiles/Ranged/HellbornProj.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged // Launch Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 6, true); + target.MoveNPC(launchVel, 6, true, Owner); MakeBlast(target.whoAmI, true); } diff --git a/Projectiles/Ranged/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/NullFlash.cs b/Projectiles/Ranged/NullFlash.cs index 3654040cf2..3f728b5c57 100644 --- a/Projectiles/Ranged/NullFlash.cs +++ b/Projectiles/Ranged/NullFlash.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs index 8877b11310..f68087abfd 100644 --- a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs +++ b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -29,17 +30,16 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.45f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (damageMult + critDamage); + modifiers.SourceDamage *= (damageMult); Vector2 launchVel = Projectile.Center.DirectionTo(target.Center); float launchPower = 20; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 450, targetHitbox); } diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 7281333710..4232afc346 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Dusts; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -127,14 +128,11 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; - Vector2 launchVel = Projectile.velocity; float launchPower = 60; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? CanDamage() => Projectile.numHits < 1 ? null : false; public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index fe4aa1371d..7c3c00796b 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using CalamityMod.Dusts; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -200,12 +201,7 @@ namespace CalamityMod.Projectiles.Ranged return useColor; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - Player Owner = Main.player[Projectile.owner]; - float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; - } + => modifiers.ApplyScalingForcedCrit(Projectile); public override bool PreDraw(ref Color lightColor) { if (time < 2) diff --git a/Projectiles/Ranged/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/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index 60c5ea557c..49746ec717 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -127,19 +127,6 @@ namespace CalamityMod.Projectiles.Ranged // Play a sound with volume scaling with charge percent SoundEngine.PlaySound(SoundID.Item62 with { Volume = SoundID.Item62.Volume * ChargePercent }, Owner.MountedCenter); - // Summon Luxor's gift manually, as channeling tends to be.... unbalanced, to say the least, if you don't - if (Owner.Calamity().luxorsGift) - { - double rangedDamage = shotDamage * 0.15; - if (rangedDamage >= 1D) - { - float speed = 24f * ChargePercent; - int projectile = Projectile.NewProjectile(new EntitySource_ItemUse_WithAmmo(Owner, Owner.HeldItem, -1), Projectile.Center, direction * speed, ModContent.ProjectileType(), (int)rangedDamage, 0f, Projectile.owner); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - // Set the initial recoil, mark the projectile as fired, and set the target recoil Owner.itemRotation = initialRecoil; Charge = -1; diff --git a/Projectiles/Rogue/AntumbraShardProjectile.cs b/Projectiles/Rogue/AntumbraShardProjectile.cs index d35823a7da..120b2934d0 100644 --- a/Projectiles/Rogue/AntumbraShardProjectile.cs +++ b/Projectiles/Rogue/AntumbraShardProjectile.cs @@ -109,8 +109,7 @@ namespace CalamityMod.Projectiles.Rogue Particle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * randVel, false, lifetime, 1.2f, Color.Black); GeneralParticleHandler.SpawnParticle(spark); Particle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * randVel, false, lifetime, 0.9f, Color.LightGreen); - GeneralParticleHandler.SpawnParticle(spark2); - spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(spark2, false, GeneralDrawLayer.AfterEverything); if (Main.rand.NextBool() && !Projectile.Calamity().stealthStrike) { Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.FireworksRGB); @@ -127,8 +126,7 @@ namespace CalamityMod.Projectiles.Rogue Particle spark = new AltSparkParticle(placement, -Projectile.velocity * speed, false, 11, 0.8f, Color.Black); GeneralParticleHandler.SpawnParticle(spark); Particle spark2 = new SparkParticle(placement, -Projectile.velocity * speed, false, 11, 0.5f, Color.LightGreen); - GeneralParticleHandler.SpawnParticle(spark2); - spark2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(spark2, false, GeneralDrawLayer.AfterEverything); } if (closestTarget != null && Projectile.numHits < 1 && closestTarget.CanBeChasedBy(Projectile)) { @@ -221,8 +219,7 @@ namespace CalamityMod.Projectiles.Rogue } Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen * 0.85f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1f, 18); - GeneralParticleHandler.SpawnParticle(bolt2); - bolt2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(bolt2, false, GeneralDrawLayer.AfterEverything); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f * (storedVelocity.X > 0 ? 1 : -1)); } diff --git a/Projectiles/Rogue/BileExplosion.cs b/Projectiles/Rogue/BileExplosion.cs index d5dd26b9c3..087f55c3ab 100644 --- a/Projectiles/Rogue/BileExplosion.cs +++ b/Projectiles/Rogue/BileExplosion.cs @@ -47,11 +47,9 @@ namespace CalamityMod.Projectiles.Rogue { if (Main.rand.NextBool(4)) { - Projectile bubble = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(70, 70), Vector2.UnitY * Main.rand.NextFloat(-3.5f, -5f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner); + Projectile bubble = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(70, 70), Vector2.UnitY * Main.rand.NextFloat(-3.5f, -5f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner,0,0,Projectile.Calamity().stealthStrike ? 1 : 0); if (bubble.whoAmI.WithinBounds(Main.maxProjectiles)) { - //We mark it as a stealth strike to change its dust - bubble.Calamity().stealthStrike = Projectile.Calamity().stealthStrike; bubble.DamageType = RogueDamageClass.Instance; bubble.timeLeft = 45; } diff --git a/Projectiles/Rogue/CosmicKunaiProj.cs b/Projectiles/Rogue/CosmicKunaiProj.cs index ce32ce7a81..fbf7c948a3 100644 --- a/Projectiles/Rogue/CosmicKunaiProj.cs +++ b/Projectiles/Rogue/CosmicKunaiProj.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -32,5 +34,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 12f, 20f); } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); } } diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index d7f5e1c37c..9b6affec5e 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -106,8 +106,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < 2; i++) { Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen with { A = 0 }, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), Projectile.ai[1] * 0.5f, Projectile.ai[1] * 0.3f, 15, false); - GeneralParticleHandler.SpawnParticle(blastRing); - blastRing.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(blastRing, false, GeneralDrawLayer.AfterEverything); } } else diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index f8aff95cac..7a12927668 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -157,11 +157,9 @@ namespace CalamityMod.Projectiles.Rogue float bigExplosionDamage = 3f; Player Owner = Main.player[Projectile.owner]; Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen with { A = 0 }, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.82f * sizeBonus, 11); - GeneralParticleHandler.SpawnParticle(orb); - orb.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(orb, false, GeneralDrawLayer.AfterEverything); Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.74f * sizeBonus, 11); - GeneralParticleHandler.SpawnParticle(orb2); - orb2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(orb2, false, GeneralDrawLayer.AfterEverything); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * (big ? bigExplosionDamage : Projectile.Calamity().stealthStrike ? 0.25f : 1f)), Projectile.knockBack * 1.5f, Projectile.owner); @@ -187,16 +185,13 @@ namespace CalamityMod.Projectiles.Rogue } Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f * 1.3f * sizeBonus, 18); - GeneralParticleHandler.SpawnParticle(bolt2); - bolt2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(bolt2, false, GeneralDrawLayer.AfterEverything); Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * sizeBonus, 30); - GeneralParticleHandler.SpawnParticle(bolt3); - bolt3.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(bolt3, false, GeneralDrawLayer.AfterEverything); Particle bolt4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.LightGreen * 0.55f, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * 1.35f * sizeBonus, 30); - GeneralParticleHandler.SpawnParticle(bolt4); - bolt4.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(bolt4, false, GeneralDrawLayer.AfterEverything); for (int i = 0; i < 2; i++) { diff --git a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs index ebdf68342e..45cb58ae7e 100644 --- a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs +++ b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs @@ -137,12 +137,17 @@ namespace CalamityMod.Projectiles.Rogue float speedMult = (float)Math.Pow(Utils.GetLerpValue(1, 4, charge, true), 2) + 0.05f; float arcValue = hasReachedFullCharge ? 0 : (float)Math.Pow(Utils.Remap(speedMult, 0, 1f, 1f, 0.8f), 4); Projectile.ai[1] = arcValue; - Projectile.velocity = velocity * 9 * speedMult; + Projectile.velocity = velocity * 9 * speedMult * Owner.Calamity().rogueVelocity; SoundStyle w = new("CalamityMod/Sounds/Item/SwooshMid"); SoundEngine.PlaySound(w with { Volume = 1f, Pitch = 0.2f, MaxInstances = 6 }, Projectile.Center); if (hasReachedFullCharge) { + if (Owner.Calamity().StealthStrikeAvailable()) + { + Projectile.Calamity().stealthStrike = true; + Owner.Calamity().ConsumeStealthByAttacking(); + } rotSpeed *= 2; SoundStyle w2 = new("CalamityMod/Sounds/Item/SwooshMid"); SoundEngine.PlaySound(w2 with { Volume = 1f, Pitch = -0.4f, MaxInstances = 6 }, Projectile.Center); @@ -150,11 +155,7 @@ namespace CalamityMod.Projectiles.Rogue else Owner.Calamity().ConsumeStealthByAttacking(); - if (Owner.Calamity().StealthStrikeAvailable() && hasReachedFullCharge) - { - Projectile.Calamity().stealthStrike = true; - Owner.Calamity().ConsumeStealthByAttacking(); - } + Projectile.tileCollide = true; flung = true; @@ -343,7 +344,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 launchDir = Utils.DirectionTo(Projectile.Center, target.Center); float launchPower = ((hasReachedFullCharge ? 9 : 0) + charge * 1.5f) * finalHitMult; - target.MoveNPC(launchDir, launchPower, true); + target.MoveNPC(launchDir, launchPower, true, Owner); float extraPitch = (Owner.Calamity().rogueStealthMax > 0 ? (0.25f * (Owner.Calamity().rogueStealth / Owner.Calamity().rogueStealthMax)) : 0); diff --git a/Projectiles/Rogue/EclipseStealthBoom.cs b/Projectiles/Rogue/EclipseStealthBoom.cs deleted file mode 100644 index d258de5353..0000000000 --- a/Projectiles/Rogue/EclipseStealthBoom.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class EclipseStealthBoom : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - - public const int Lifetime = 35; // 7 animation frames, 12 FPS - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 7; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 102; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.penetrate = -1; - Projectile.timeLeft = Lifetime; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - Projectile.frameCounter++; - Projectile.frame = Projectile.frameCounter / 5; - - if (Projectile.frameCounter > Lifetime) - Projectile.Kill(); - } - - public override void PostDraw(Color lightColor) - { - Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Rectangle frame = glow.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); - } - } -} diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs deleted file mode 100644 index acae2f710c..0000000000 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ /dev/null @@ -1,78 +0,0 @@ -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class EclipsesFallMain : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; - - // these also affect KB - public static float RainDamageMult = 0.4f; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 40; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.MaxUpdates = 2; - Projectile.penetrate = 3; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6 * Projectile.MaxUpdates; - Projectile.timeLeft = 150 * Projectile.MaxUpdates; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - if (Main.rand.NextBool(5)) - { - Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); - float trailScale = Main.rand.NextFloat(0.8f, 1.2f); - Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; - Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); - GeneralParticleHandler.SpawnParticle(eclipseTrail); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnSpears(target); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnSpears(target); - - private void SpawnSpears(Entity target) - { - int spearAmt = Main.rand.Next(3, 4 + 1); // 3 or 4 spears - for (int n = 0; n < spearAmt; n++) - { - Vector2 spawnPos = target.Center - new Vector2(Main.rand.NextFloat(-100f, 100f), Main.rand.NextFloat(500f, 800f)); - Vector2 spearVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, target, 29f, 2) + Vector2.UnitX * Main.rand.NextFloat(-6f, 6f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, spearVel, ModContent.ProjectileType(), (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); - } - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); - } - } -} diff --git a/Projectiles/Rogue/EclipseStealthBoom.png b/Projectiles/Rogue/EclipsesFall_LightExplosion.png similarity index 100% rename from Projectiles/Rogue/EclipseStealthBoom.png rename to Projectiles/Rogue/EclipsesFall_LightExplosion.png diff --git a/Projectiles/Rogue/EclipseStealthBoomGlow.png b/Projectiles/Rogue/EclipsesFall_LightExplosionGlow.png similarity index 100% rename from Projectiles/Rogue/EclipseStealthBoomGlow.png rename to Projectiles/Rogue/EclipsesFall_LightExplosionGlow.png diff --git a/Projectiles/Rogue/EclipsesFall_LightFragment.png b/Projectiles/Rogue/EclipsesFall_LightFragment.png new file mode 100644 index 0000000000..fc489108d0 Binary files /dev/null and b/Projectiles/Rogue/EclipsesFall_LightFragment.png differ diff --git a/Projectiles/Rogue/EclipsesFall_StealthSpear.png b/Projectiles/Rogue/EclipsesFall_StealthSpear.png new file mode 100644 index 0000000000..fe72281fb5 Binary files /dev/null and b/Projectiles/Rogue/EclipsesFall_StealthSpear.png differ diff --git a/Projectiles/Rogue/EclipsesFall_StealthSpearExplosion.png b/Projectiles/Rogue/EclipsesFall_StealthSpearExplosion.png new file mode 100644 index 0000000000..58635d492a Binary files /dev/null and b/Projectiles/Rogue/EclipsesFall_StealthSpearExplosion.png differ diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs deleted file mode 100644 index f9831d85bc..0000000000 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ /dev/null @@ -1,44 +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 EclipsesSmol : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; - public override void SetDefaults() - { - Projectile.width = Projectile.height = 24; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.MaxUpdates = 2; - Projectile.timeLeft = 75 * Projectile.MaxUpdates; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.5f, 0.4f, 0.15f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 16f, 20f); - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); - } - } -} diff --git a/Projectiles/Rogue/EclipsesSmol.png b/Projectiles/Rogue/EclipsesSmol.png deleted file mode 100644 index 96e05053b1..0000000000 Binary files a/Projectiles/Rogue/EclipsesSmol.png and /dev/null differ diff --git a/Projectiles/Rogue/EclipsesSmolGlow.png b/Projectiles/Rogue/EclipsesSmolGlow.png deleted file mode 100644 index 0539d70e64..0000000000 Binary files a/Projectiles/Rogue/EclipsesSmolGlow.png and /dev/null differ diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs deleted file mode 100644 index bdf017b9f2..0000000000 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ /dev/null @@ -1,129 +0,0 @@ -using CalamityMod.NPCs; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - [PierceResistException] - public class EclipsesStealth : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/EclipsesFall"; - - // these also affect KB - public const float RainDamageMult = 0.2f; - public const float ExplosionDamageMult = 0.5f; - - private bool changedTimeLeft = false; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 40; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.MaxUpdates = 2; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - Projectile.timeLeft = 150 * Projectile.MaxUpdates; - } - - // Uses localAI[1] to decide how many frames until the next spear drops. - public override void AI() - { - Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.3f); - // Behavior when not sticking to anything - if (Projectile.ai[0] == 0f) - { - // Keep the spear oriented in the correct direction - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - if (Main.rand.NextBool(5)) - { - Vector2 trailPos = Projectile.Center + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-16f, 16f); - float trailScale = Main.rand.NextFloat(0.8f, 1.2f); - Color trailColor = Main.rand.NextBool() ? Color.Indigo : Color.DarkOrange; - Particle eclipseTrail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor); - GeneralParticleHandler.SpawnParticle(eclipseTrail); - } - } - - // Behavior when having impaled a target - else - { - // Eclipse's Fall is guaranteed to impale for 10 seconds, no more, no less - if (!changedTimeLeft) - { - Projectile.MaxUpdates = 1; - Projectile.timeLeft = 600; - changedTimeLeft = true; - } - - // Spawn spears. As this uses local AI, it's done client-side only. - if (Projectile.owner == Main.myPlayer) - { - Projectile.localAI[1] -= 1f; - if (Projectile.localAI[1] <= 0f) - { - // Set up the spear counter for next time. Used to be every 5 frames there was a 50% chance; now it's more reliable but slower. - Projectile.localAI[1] = Main.rand.Next(8, 10+1); // 8 to 10 frames between each spearfall - - int type = ModContent.ProjectileType(); - Vector2 spawnPos = Projectile.Center - new Vector2(Main.rand.NextFloat(-100f, 100f), Main.rand.NextFloat(500f, 800f)); - Vector2 spearVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, Main.npc[(int)Projectile.ai[1]], 29f, 2) + Vector2.UnitX * Main.rand.NextFloat(-6f, 6f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, spearVel, type, (int)(Projectile.damage * RainDamageMult), Projectile.knockBack * RainDamageMult, Projectile.owner); - } - } - } - - // Sticky behavior. Lets the projectile impale enemies and sticks to its impaled enemy automatically. - Projectile.StickyProjAI(10); - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(1); - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (targetHitbox.Width > 8 && targetHitbox.Height > 8) - { - targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); - } - return null; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D glow = ModContent.Request(Texture + "Glow").Value; - Main.EntitySpriteDraw(glow, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, glow.Size() * 0.5f, Projectile.scale, SpriteEffects.None); - } - - public override bool? CanHitNPC(NPC target) => Projectile.ai[0] == 1f ? false : base.CanHitNPC(target); - - public override bool CanHitPvp(Player target) => Projectile.ai[0] != 1f; - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * ExplosionDamageMult), Projectile.knockBack * ExplosionDamageMult, Projectile.owner); - } - } -} diff --git a/Projectiles/Rogue/ExorcismShockwave.cs b/Projectiles/Rogue/ExorcismShockwave.cs index 25e1abd09a..6257692b1c 100644 --- a/Projectiles/Rogue/ExorcismShockwave.cs +++ b/Projectiles/Rogue/ExorcismShockwave.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Player Owner = Main.player[Projectile.owner]; float minMult = 0.35f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = (Projectile.Calamity().stealthStrike ? 4f : 1) * 10; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index dc34689d70..c7d160009e 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,17 +16,39 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = 10; Projectile.height = 10; Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.timeLeft = 90; - AIType = ProjectileID.WoodenArrowFriendly; + Projectile.penetrate = 4; + Projectile.aiStyle = ProjAIStyleID.GroundProjectile; + Projectile.timeLeft = 600; + AIType = ProjectileID.SpikyBall; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.localNPCHitCooldown = 15; + Projectile.usesLocalNPCImmunity = true; } - public override void AI() + public override bool PreAI() { - Projectile.rotation += Projectile.velocity.Y; - Projectile.velocity.Y *= 1.05f; + if (Projectile.originalDamage == 0) + { + Projectile.originalDamage = SpearofPaleolith.ShardBaseDamage; + Projectile.ContinuouslyUpdateDamageStats = true; + } + + Projectile.velocity.X *= 0.975f; + var tile = Main.tile[(Projectile.Bottom + Vector2.UnitY).ToTileCoordinates()]; + if (tile.HasUnactuatedTile && tile.TileType == TileID.ConveyorBeltLeft) + { + Projectile.velocity.X = 2; + } + else if (tile.HasUnactuatedTile && tile.TileType == TileID.ConveyorBeltRight) + { + Projectile.velocity.X = -2; + } + return true; + } + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + fallThrough = false; + return true; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); 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..889f1f140f 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -73,13 +73,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Frozen, 150); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/HypothermiaShard.cs b/Projectiles/Rogue/HypothermiaShard.cs index 987c2786bd..4da315507f 100644 --- a/Projectiles/Rogue/HypothermiaShard.cs +++ b/Projectiles/Rogue/HypothermiaShard.cs @@ -59,8 +59,6 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { for (int k = 0; k < 3; k++) diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index e079d036ad..4f835dfe1a 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue explosionCount++; } - int buffType = ModContent.BuffType(); + int buffType = BuffID.Frozen; float radius = 112f; // 7 blocks foreach (NPC nPC in Main.ActiveNPCs) diff --git a/Projectiles/Rogue/LanceofDestiny.cs b/Projectiles/Rogue/LanceofDestiny.cs index 12007830d2..34bfaacbfc 100644 --- a/Projectiles/Rogue/LanceofDestiny.cs +++ b/Projectiles/Rogue/LanceofDestiny.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue { public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/NPCKilled/DevourerSegmentBreak2") { Volume = 0.6f, PitchVariance = 0.3f }; public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public bool posthit = false; public int Time = 0; public int hitsDust = 7; diff --git a/Projectiles/Rogue/LanceofDestiny.png b/Projectiles/Rogue/LanceofDestiny.png deleted file mode 100644 index 72395d8fa7..0000000000 Binary files a/Projectiles/Rogue/LanceofDestiny.png and /dev/null differ diff --git a/Projectiles/Rogue/LeviathanToothStealth.cs b/Projectiles/Rogue/LeviathanToothStealth.cs index 24fdafda21..90da6945bf 100644 --- a/Projectiles/Rogue/LeviathanToothStealth.cs +++ b/Projectiles/Rogue/LeviathanToothStealth.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Rogue if (hitTimer == 0) hitTimer = Projectile.localNPCHitCooldown; - if (target.CanBeMoved(true)) + if (target.CanBeMoved()) target.velocity *= 0.05f; } public override bool? CanDamage() => canDamage ? null : false; diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs deleted file mode 100644 index 1e519983af..0000000000 --- a/Projectiles/Rogue/MoonSigil.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class MoonSigil : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Rogue"; - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 20; - Projectile.friendly = true; - Projectile.penetrate = 2; - Projectile.ignoreWater = true; - Projectile.timeLeft = 250; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.DamageType = RogueDamageClass.Instance; - } - - public override void AI() - { - if (Projectile.timeLeft < 52) - { - Projectile.alpha += 5; - Projectile.scale -= 0.013f; - } - if (Projectile.alpha >= 255) - { - Projectile.alpha = 255; - Projectile.Kill(); - return; - } - - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 8f, 20f); - } - - // Reduce damage of projectiles if more than the cap are active - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - int cap = 5; - float capDamageFactor = 0.05f; - int excessCount = Main.player[Projectile.owner].ownedProjectileCounts[Type] - cap; - modifiers.SourceDamage *= MathHelper.Clamp(1f - (capDamageFactor * excessCount), 0f, 1f); - } - - public override void OnKill(int timeLeft) - { - float dustSp = 0.2f; - int dustD = 0; - for (int i = 0; i < 4; i++) - { - for (int j = 0; j < 5; j++) - { - Vector2 dustspeed = new Vector2(dustSp, dustSp).RotatedBy(MathHelper.ToRadians(dustD)); - int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(213, 242, 232, 200), 1f); - Main.dust[d].noGravity = true; - Main.dust[d].position = Projectile.Center; - Main.dust[d].velocity = dustspeed; - dustSp += 0.2f; - } - dustD += 90; - dustSp = 0.2f; - } - } - - public override void PostDraw(Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Rogue/MoonSigil").Value; - Main.spriteBatch.Draw - ( - texture, - new Vector2 - ( - Projectile.position.X - Main.screenPosition.X + Projectile.width * 0.5f, - Projectile.position.Y - Main.screenPosition.Y + Projectile.height - 20 * 0.5f - ), - new Rectangle(0, 0, 20, 20), - Color.White, - Projectile.rotation, - new Vector2(10, 10), - Projectile.scale, - SpriteEffects.None, - 0f - ); - } - } -} diff --git a/Projectiles/Rogue/PaleoShatterExplosion.cs b/Projectiles/Rogue/PaleoShatterExplosion.cs new file mode 100644 index 0000000000..d9366c8580 --- /dev/null +++ b/Projectiles/Rogue/PaleoShatterExplosion.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Weapons.Magic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class PaleoShatterExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 7; + } + + public override void SetDefaults() + { + Projectile.width = 84; + Projectile.height = 152; + Projectile.friendly = true; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = -1; + Projectile.timeLeft = 60; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.tileCollide = false; + } + + public override void AI() + { + if (Projectile.timeLeft == 60) + Projectile.Bottom = Projectile.Center + new Vector2(0,16); + if (Projectile.timeLeft % 3f == 2f) + Projectile.frame++; + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.Kill(); + } + } +} diff --git a/Projectiles/Rogue/PaleoShatterExplosion.png b/Projectiles/Rogue/PaleoShatterExplosion.png new file mode 100644 index 0000000000..7740b1ff36 Binary files /dev/null and b/Projectiles/Rogue/PaleoShatterExplosion.png differ diff --git a/Projectiles/Rogue/ProfanedPartisanFlare.cs b/Projectiles/Rogue/ProfanedPartisanFlare.cs new file mode 100644 index 0000000000..67c7ae2fd4 --- /dev/null +++ b/Projectiles/Rogue/ProfanedPartisanFlare.cs @@ -0,0 +1,234 @@ +using System; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Utilities.Daybreak; +using CalamityMod.Utilities.Daybreak.Buffers; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ProfanedPartisanFlare : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Rogue"; + public int timer = 0; + public override string Texture => "CalamityMod/Projectiles/Boss/HolyFire"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + public override void SetDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + Projectile.width = 20; + Projectile.height = 20; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.penetrate = 3; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; + Projectile.timeLeft = 600; + Projectile.tileCollide = false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + NPC target = null; + public override void AI() + { + Projectile.frameCounter++; + if (Projectile.frameCounter > 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + if (Projectile.frame >= Main.projFrames[Type]) + Projectile.frame = 0; + + if (Projectile.originalDamage == 0) + { + Projectile.originalDamage = ProfanedPartisan.StarBaseDamage; + Projectile.ContinuouslyUpdateDamageStats = true; + } + if (target != null && Projectile.localNPCImmunity[target.whoAmI] <= 0 && target.active && !target.dontTakeDamage) + { + Projectile.Calamity().HomingTarget = target.whoAmI; + var dis = Projectile.Distance(target.Center); + Projectile.velocity = Projectile.velocity.ToRotation().AngleLerp(Projectile.DirectionTo(target.Center).ToRotation(), (Projectile.Distance(target.Center) < 160 ? 0.1f + (1 - dis / 160) * 0.4f : 0.1f)).ToRotationVector2() * Projectile.velocity.Length(); + } + else + { + target = GetTargetInRange(2000); + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + public override void OnKill(int timeLeft) + { + Color hiColor = new Color(255, 155, 25, 255); + Color loColor = new Color(255, 0, 0, 0); + + for (int i = 0; i < 25; i++) + { + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); + } + + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); + + for (float i = 0; i < 1; i += 0.25f) + { + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.075f * i, 24)); + } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 16)); + + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact.WithPitchOffset(0.6f), Projectile.Center); + SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center); + } + public override bool PreDraw(ref Color lightColor) + { + Color hiColor = new Color(255, 155, 25, 255); + Color loColor = new Color(255, 0, 0, 0); + + Projectile.Opacity = 1; + Main.spriteBatch.End(out var ss); + var device = Main.instance.GraphicsDevice; + using var trailLease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth / 2, + Main.screenHeight / 2, + RenderTargetDescriptor.Default + ); + //Everything is drawn to this lease, which then is drawn to screen with the desired opacity. + //This is used to allow projectile opacity to scale nicely + using var mainLease = RenderTargetPool.Shared.Rent( + device, + Main.screenWidth, + Main.screenHeight, + RenderTargetDescriptor.Default + ); + + using (mainLease.Scope(clearColor: Color.Transparent)) + { + using (trailLease.Scope(clearColor: Color.Transparent)) + { + GameShaders.Misc["CalamityMod:ImpFlameTrail"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); + PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(5).ToArray(), new(FireWidthFunction, FireColorFunction, (_, _) => Projectile.Size * 0.5f, smoothen: true, pixelate: false, shader: GameShaders.Misc["CalamityMod:ImpFlameTrail"], useUnscaledMatrices: true), Projectile.oldPos.Length + 32); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(trailLease.Target, Vector2.Zero, null, Color.White * 0.75f, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); + + + float lerpMult = MathHelper.Lerp(0.5f, 1.5f, Math.Abs(MathF.Sin(Projectile.localAI[1] / 10f))); + + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[ModContent.ProjectileType()].Value; + Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); + Color baseColor = Color.Lerp(hiColor, loColor, 0.5f); + Color baseColor2 = hiColor; + baseColor.A = 0; + baseColor *= lerpMult; + baseColor2 *= lerpMult; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(0.5f, 1f) * ((lerpMult - 1) * 0.5f + 1f) * 1.2f * Projectile.scale; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (Projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Projectile.rotation += MathHelper.ToRadians(lerpMult * 2f); + + float upRight = MathHelper.PiOver4; + float up = MathHelper.PiOver2; + float upLeft = 3f * MathHelper.PiOver4; + float left = MathHelper.Pi; + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upLeft + Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, upRight - Projectile.rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upLeft + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, upRight - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, up + Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor, left - Projectile.rotation, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, up + Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, baseColor2, left - Projectile.rotation, origin, scale * 0.36f, spriteEffects, 0); + + scale = new Vector2(1f, 1f); + texture = ModContent.Request("CalamityMod/Particles/GlowOrbParticle").Value; + using (Main.spriteBatch.Scope()) + { + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Matrix.Identity); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, baseColor2, 0, texture.Size() * 0.5f, 1f, 0, 0f); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, 0.5f, 0, 0f); + Main.spriteBatch.End(); + } + Main.spriteBatch.End(); + } + + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.Transform); + Main.spriteBatch.Draw(mainLease.Target, Vector2.Zero, null, Color.White * Projectile.Opacity, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(ss); + return false; + } + public float FireWidthFunction(float completion, Vector2 pos) + { + float width; + float maxBodyWidth = 16f * Projectile.scale; + float curveRatio = 0.2f; + var positions = Projectile.oldPos.ToList(); + positions.RemoveAll(x => x == Vector2.Zero); + // Crop the tip of the trail into a conic shape. + if (completion < curveRatio) + width = MathF.Pow(completion / curveRatio, 0.5f) * maxBodyWidth; + else + width = Utils.Remap(completion, curveRatio, 1f, maxBodyWidth, 0f); + + // Pulse inwards and outwards over time. + float pulseInterpolant = MathF.Cos(MathHelper.Pi * completion - Main.GlobalTimeWrappedHourly * 20f) * 0.5f + 0.5f; + float additionalPulseWidth = MathHelper.Lerp(0f, 12f, pulseInterpolant); + return (width + additionalPulseWidth) * positions.Count() / (float)ProjectileID.Sets.TrailCacheLength[Type]; + } + + public Color FireColorFunction(float completion, Vector2 pos) + { + Color mainColor = new Color(255, 155, 25, 255); + Color endColor = Color.Lerp(mainColor, Color.Transparent, Utils.GetLerpValue(0.8f, 1f, completion, true)); + return Color.Lerp(mainColor, Color.Transparent, completion); + } + + NPC GetTargetInRange(float range) + { + var player = Main.player[Projectile.owner]; + { + NPC gotTarget = null; + float currentDistance = range; + foreach (var npc in Main.ActiveNPCs) + { + if (Projectile.localNPCImmunity[npc.whoAmI] > 0) + continue; + var myDistance = npc.Distance(Projectile.Center); + + if (npc.CanBeChasedBy() && myDistance < currentDistance) + { + currentDistance = myDistance; + gotTarget = npc; + } + } + return gotTarget; + } + } + } +} diff --git a/Projectiles/Rogue/ProfanedPartisanProj.cs b/Projectiles/Rogue/ProfanedPartisanProj.cs index b7c056a4ad..c223a5504f 100644 --- a/Projectiles/Rogue/ProfanedPartisanProj.cs +++ b/Projectiles/Rogue/ProfanedPartisanProj.cs @@ -1,8 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using System.Linq; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -13,10 +17,13 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/ProfanedPartisan"; + + public static int Lifetime => 600; + public int ExplodeTime => 60 * Projectile.MaxUpdates; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 24; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -24,47 +31,91 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = 20; Projectile.height = 20; Projectile.friendly = true; - Projectile.penetrate = 9; - Projectile.timeLeft = 600; - Projectile.extraUpdates = 3; - Projectile.tileCollide = false; + Projectile.penetrate = 1; + Projectile.extraUpdates = 5; + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 12; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + } + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } } public override void AI() { - if (Projectile.ai[0] < 0.4f) + Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.2f); + if (StuckEnemyID > 0) { - Projectile.ai[0] += 0.1f; + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID - 1].active) + { + StuckEnemyID = 0; + Projectile.velocity = -Vector2.UnitY.RotatedByRandom(0.25f) * Main.rand.NextFloat(0, 1f); + Projectile.tileCollide = true; + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID - 1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; } - else + else if (Projectile.damage == 0) //after running out of penetrate hits, if not impaled or dead { - Projectile.tileCollide = true; + Projectile.velocity *= 0.975f; + float intensity = 1 - Projectile.timeLeft / (float)ExplodeTime; + Projectile.position += Main.rand.NextVector2CircularEdge(intensity, intensity); + + if (Projectile.timeLeft == 1) + { + + Color hiColor = new Color(255, 155, 25, 255); + Color loColor = new Color(255, 0, 0, 0); + + for (int i = 0; i < 25; i++) + { + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); + } + + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); + + for (float i = 0; i < 1; i += 0.25f) + { + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.075f * i, 24)); + } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 16)); + + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact.WithPitchOffset(0.6f), Projectile.Center); + SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center); + if (Main.myPlayer == Projectile.owner) + { + for (var i = 0; i < 3; i++) + { + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2().RotatedBy((i - 1) * 0.25f + Main.rand.NextFloat(-0.1f, 0.1f)) * 24f, ModContent.ProjectileType(), 0, Projectile.knockBack, Projectile.owner, 0f, 0f); + } + } + } + return; } - //Backwards projectile fix - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - //Rotating 45 degrees if shooting right - if (Projectile.spriteDirection == 1) - { - Projectile.rotation += MathHelper.ToRadians(45f); - DrawOffsetX = -26; - DrawOriginOffsetX = 13; - DrawOriginOffsetY = 2; - } - //Rotating 45 degrees if shooting right - if (Projectile.spriteDirection == -1) - { - Projectile.rotation -= MathHelper.ToRadians(45f); - DrawOffsetX = 2; - DrawOriginOffsetX = -13; - DrawOriginOffsetY = 2; - } + Projectile.velocity *= 0.998f; + if (Projectile.timeLeft < (Lifetime - 45)*Projectile.MaxUpdates) + Projectile.velocity.Y += 0.02f; + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; if (Main.rand.NextBool(3)) { int d = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.1f); @@ -72,20 +123,6 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[d].velocity *= 0.3f; Main.dust[d].velocity += Projectile.velocity * 0.85f; } - Lighting.AddLight(Projectile.Center, 1f, 0.8f, 0.2f); - - if (Projectile.Calamity().stealthStrike) //Stealth strike - { - Vector2 spearPosition = new Vector2(Projectile.Center.X + Main.rand.NextFloat(-15f, 15f), Projectile.Center.Y + Main.rand.NextFloat(-15f, 15f)); - Vector2 spearSpeed = Projectile.velocity; - if (Projectile.timeLeft % 18 == 0) - { - int projID = ModContent.ProjectileType(); - int spearDamage = (int)(Projectile.damage * 0.4f); - float spearKB = 1f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spearPosition, spearSpeed, projID, spearDamage, spearKB, Projectile.owner); - } - } } public override void OnKill(int timeLeft) @@ -95,20 +132,48 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 50, default, 2.6f); } SoundEngine.PlaySound(SoundID.Item45, Projectile.position); - - int projID = ModContent.ProjectileType(); - int explosionDamage = (int)(Projectile.damage * 0.8f); - float explosionKB = 8f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, projID, explosionDamage, explosionKB, Projectile.owner); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + + for (var i = 0; i < ProjectileID.Sets.TrailCacheLength[Type]; i += 3) + { + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition, null, lightColor * Projectile.Opacity * (i > 0 ? (1 - i / (float)ProjectileID.Sets.TrailCacheLength[Type]) * 0.25f : 1), Projectile.rotation, TextureAssets.Projectile[Type].Size() * 0.5f, Projectile.scale, 0); + } + + float glowIntensity = Projectile.damage == 0 && StuckEnemyID == 0 ? 4f * (1-(Projectile.timeLeft/(float)ExplodeTime)) : 0f; + Projectile.DrawProjectileWithBackglow(Color.Yellow, lightColor, glowIntensity); return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Projectile.tileCollide = false; + if (Projectile.Calamity().stealthStrike) + { + StuckEnemyID = target.whoAmI + 1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; + } + else + { + Projectile.timeLeft = ExplodeTime; + } + bool strongSplit = Main.projectile.Any(x => x.active && x.owner == Projectile.owner && x.type == Projectile.type && x.ai[0] == (target.whoAmI + 1)); + if (!strongSplit) + for (var i = 0; i < 3; i++) + { + var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2().RotatedBy((i-1)*0.25f + Main.rand.NextFloat(-0.1f,0.1f)) * 10, ModContent.ProjectileType(), 0, Projectile.knockBack, Projectile.owner, 0f, 0f); + p.localNPCImmunity[target.whoAmI] = 60; + } + target.AddBuff(ModContent.BuffType(), 180); + if (!strongSplit) + { + Projectile.Kill(); + } + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } diff --git a/Projectiles/Rogue/ProfanedPartisanSpear.cs b/Projectiles/Rogue/ProfanedPartisanSpear.cs index 0f9ab63c40..ae6f980748 100644 --- a/Projectiles/Rogue/ProfanedPartisanSpear.cs +++ b/Projectiles/Rogue/ProfanedPartisanSpear.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -10,88 +11,81 @@ namespace CalamityMod.Projectiles.Rogue public class ProfanedPartisanSpear : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public int timer = 0; - - public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true; public override void SetDefaults() { + ProjectileID.Sets.TrailCacheLength[Type] = 6; + ProjectileID.Sets.TrailingMode[Type] = 2; Projectile.width = 10; Projectile.height = 10; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.penetrate = -1; - Projectile.extraUpdates = 3; + Projectile.penetrate = 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = 600; + Projectile.tileCollide = false; } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (Projectile.ai[1] != 1f) - { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - Projectile.ai[1] = 1f; - Projectile.ai[0] = 1f; - Projectile.extraUpdates = 2; - if (Projectile.timeLeft > 280) - Projectile.timeLeft = 280; - } - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffects(); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 180); - OnHitEffects(); - } - - private void OnHitEffects() - { - if (Projectile.ai[1] != 1f) - { - Projectile.velocity.X *= -1f; - Projectile.velocity.Y *= -1f; - Projectile.ai[1] = 1f; - Projectile.ai[0] = 1f; - Projectile.extraUpdates = 2; - if (Projectile.timeLeft > 280) - Projectile.timeLeft = 280; - } } public override void AI() { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - if (Projectile.ai[0] == 1f) - timer++; - if (timer >= 5) - Projectile.penetrate = 1; - if (timer >= 10) + if (Projectile.originalDamage == 0) { - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 7f, 20f); + Projectile.originalDamage = ProfanedPartisan.SpearBaseDamage; + Projectile.ContinuouslyUpdateDamageStats = true; } + + float timeGateValue = 30f; + if (Projectile.ai[0] <= 0f) //Copied from HolySpear.cs + { + Projectile.ai[1] += 1f; + + float slowGateValue = 25f; + float fastGateValue = 10f; + float minVelocity = 2f; + float maxVelocity = minVelocity * 5f; + float extremeVelocity = maxVelocity * 2f; + float deceleration = 0.9f; + float acceleration = 2f; + + if (Projectile.localAI[1] >= timeGateValue) + { + if (Projectile.velocity.Length() < extremeVelocity) + Projectile.velocity *= acceleration; + } + else + { + if (Projectile.ai[1] <= slowGateValue) + { + if (Projectile.velocity.Length() > minVelocity) + Projectile.velocity *= deceleration; + } + else if (Projectile.ai[1] < slowGateValue + fastGateValue) + { + if (Projectile.velocity.Length() < maxVelocity) + Projectile.velocity *= acceleration; + } + else + Projectile.ai[1] = 0f; + } + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + CalamityUtils.DrawAfterimagesCentered(Projectile, 2, Color.White); return false; } } diff --git a/Projectiles/Rogue/PumpkaboomBig.cs b/Projectiles/Rogue/PumpkaboomBig.cs index 7439fa10fd..310ecffa27 100644 --- a/Projectiles/Rogue/PumpkaboomBig.cs +++ b/Projectiles/Rogue/PumpkaboomBig.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target != null && target.active && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < maxPullDistance) + if (target != null && target.active && target.CanBeMoved() && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < maxPullDistance) { if (target.whoAmI == stuckNPC) continue; diff --git a/Projectiles/Rogue/RadiationRain.cs b/Projectiles/Rogue/RadiationRain.cs index 5938658b73..7a7740025e 100644 --- a/Projectiles/Rogue/RadiationRain.cs +++ b/Projectiles/Rogue/RadiationRain.cs @@ -45,18 +45,15 @@ namespace CalamityMod.Projectiles.Rogue Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor * 0.7f, "CalamityMod/ExtraTextures/GreyscaleVortex", new Vector2(1, 1), Projectile.ai[2] * 0.45f, orbScale, orbScale * 1.1f, 12, false); GeneralParticleHandler.SpawnParticle(orb); Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Chartreuse, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.8f, 0.4f, 18); - GeneralParticleHandler.SpawnParticle(orb3); - orb3.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(orb3, false, GeneralDrawLayer.AfterEverything); Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.2f, 18); - GeneralParticleHandler.SpawnParticle(orb2); - orb2.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(orb2, false, GeneralDrawLayer.AfterEverything); for (int i = 0; i < 2; i++) { int dir = (i == 0 ? 1 : -1); Particle pulse3 = new GlowSparkParticle(Projectile.Center + new Vector2(20 * dir, 0), new Vector2(10 * dir, 0), false, 12, 0.087f, Color.Chartreuse, new Vector2(1.7f, 0.8f), true, true, 0.8f); - GeneralParticleHandler.SpawnParticle(pulse3); - pulse3.DrawLayer = GeneralDrawLayer.AfterEverything; + GeneralParticleHandler.SpawnParticle(pulse3, false, GeneralDrawLayer.AfterEverything); } for (int i = 0; i < 3; i++) diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index 94be412dca..b2e33bb877 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 5; Projectile.ArmorPenetration = 20; + Projectile.Calamity().CannotProc = true; } public override void AI() 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/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 3a8948bad7..ceee3c72a8 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Projectiles.Rogue public class SpearofDestinyProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2") { PitchVariance = 0.3f, Volume = 0.5f }; public int framesInAir = 0; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.png b/Projectiles/Rogue/SpearofDestinyProjectile.png new file mode 100644 index 0000000000..8efaf3998f Binary files /dev/null and b/Projectiles/Rogue/SpearofDestinyProjectile.png differ diff --git a/Projectiles/Rogue/SpearofDestinyStealth.cs b/Projectiles/Rogue/SpearofDestinyStealth.cs index 15bca9c5e9..25d93e1e7e 100644 --- a/Projectiles/Rogue/SpearofDestinyStealth.cs +++ b/Projectiles/Rogue/SpearofDestinyStealth.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue { public static readonly SoundStyle Hitsound = new("CalamityMod/Sounds/Item/BlazingCoreParry") { Volume = 0.7f, PitchVariance = 0.3f }; public new string LocalizationCategory => "Projectiles.Rogue"; - public override string Texture => "CalamityMod/Projectiles/Rogue/LanceofDestiny"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofDestiny"; public bool posthit = false; public int Time = 0; public ref float Timer => ref Projectile.ai[0]; diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index 1ddf1453bf..a6f3267548 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -1,6 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using System.Linq; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -11,14 +16,13 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpearofPaleolith"; - private bool stealthInit = false; + public static int Lifetime => 600; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Type] = 6; - ProjectileID.Sets.TrailingMode[Type] = 0; + ProjectileID.Sets.TrailCacheLength[Type] = 24; + ProjectileID.Sets.TrailingMode[Type] = 2; } - public override void SetDefaults() { Projectile.width = 12; @@ -26,50 +30,115 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; - Projectile.aiStyle = ProjAIStyleID.StickProjectile; - Projectile.timeLeft = 600; - AIType = ProjectileID.BoneJavelin; + Projectile.extraUpdates = 5; + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; Projectile.DamageType = RogueDamageClass.Instance; } - + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } + } public override void AI() { - if (Projectile.Calamity().stealthStrike && !stealthInit) + if (StuckEnemyID > 0) { - Projectile.velocity *= 0.5f; - Projectile.timeLeft = 1800; - stealthInit = true; + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID - 1].active) + { + StuckEnemyID = 0; + Projectile.velocity = -Vector2.UnitY.RotatedByRandom(0.25f) * Main.rand.NextFloat(0, 1f); + Projectile.tileCollide = true; + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID - 1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; } - if (Main.rand.NextBool(4)) + Projectile.velocity *= 0.998f; + if (Projectile.timeLeft < (Lifetime - 25) * Projectile.MaxUpdates) + Projectile.velocity.Y += 0.02f; + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; + if (Main.rand.NextBool(20)) { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); - if (Projectile.timeLeft % 3 == 0) - { - if (Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); - } - } + } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + for (var i = 0; i < ProjectileID.Sets.TrailCacheLength[Type]; i += 3) + { + Main.EntitySpriteDraw(TextureAssets.Projectile[Type].Value, Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition, null, lightColor * Projectile.Opacity * (i>0 ? (1 - i / (float)ProjectileID.Sets.TrailCacheLength[Type]) * 0.25f : 1), Projectile.rotation, TextureAssets.Projectile[Type].Size() * 0.5f, Projectile.scale, 0); + } return false; } public override void OnKill(int timeLeft) { - for (int i = 0; i <= 10; i++) + for (int i = 0; i <= 5; i++) { - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Teleporter, Projectile.oldVelocity.X*2.5f, Projectile.oldVelocity.Y*2.5f); } } - 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) + { + if (Projectile.Calamity().stealthStrike) + { + Projectile.stopsDealingDamageAfterPenetrateHits = true; + StuckEnemyID = target.whoAmI + 1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); + Projectile.timeLeft = Lifetime * Projectile.MaxUpdates; + } + + bool strongSplit = Main.projectile.Any(x => x.active && x.owner == Projectile.owner && x.type == Projectile.type && x.ai[0] == (target.whoAmI + 1)); + int shardCount = strongSplit ? SpearofPaleolith.ImpaledShardCount : SpearofPaleolith.NormalShardCount; + for (var i = 0; i < shardCount; i++) + { + var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0,-1).RotatedByRandom(1) * (strongSplit ? 10 : 7.5f) * Main.rand.NextFloat(0.9f,1.1f), ModContent.ProjectileType(), 0 /*Shard dmg is set in its AI*/, Projectile.knockBack, Projectile.owner, 0f, 0f); + p.localNPCImmunity[target.whoAmI] = 30; + } + if (strongSplit) + { + + SoundEngine.PlaySound(SoundID.DeerclopsRubbleAttack with { PitchVariance = 0.5f}, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, Projectile.owner); + } + else + { + for (int i = 0; i < shardCount; i++) + { + int sparkLifetime = Main.rand.Next(8, 22); + float sparkScale = Main.rand.NextFloat(0.5f, 1f); + var sparkColor = Main.rand.NextBool() ? Color.DarkGoldenrod : Color.SandyBrown; + + if (Main.rand.NextBool(5)) + sparkScale *= 1.4f; + + Vector2 sparkVelocity = Vector2.UnitY.RotatedByRandom(1) * MathHelper.Lerp(-7.5f, -15, Main.rand.NextFloat()); + SparkParticle spark = new SparkParticle(target.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + SoundEngine.PlaySound(SoundID.DeerclopsStep with { Pitch = 0.5f, PitchVariance = 0.5f, Volume = 1f, }, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_CrystalCartImpact with { Pitch = -0.5f, PitchVariance = 0.5f, Volume = 1f, }, Projectile.Center); + + target.AddBuff(ModContent.BuffType(), 120); + } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index 9d920c69f4..72676d8d23 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target.CanBeMoved(true) && target.CanBeChasedBy(Projectile, false)) + if (target.CanBeMoved() && target.CanBeChasedBy(Projectile, false)) { if (Vector2.Distance(target.Center, Projectile.Center) > 40 && Vector2.Distance(target.Center, Projectile.Center) < 600) { @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 30, true); + target.MoveNPC(launchVel, 30, true, Owner); target.AddBuff(ModContent.BuffType(), 90); } diff --git a/Projectiles/Rogue/SupernovaStealthBoom.cs b/Projectiles/Rogue/SupernovaStealthBoom.cs index 21f394d99a..291086f2d7 100644 --- a/Projectiles/Rogue/SupernovaStealthBoom.cs +++ b/Projectiles/Rogue/SupernovaStealthBoom.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (target.CanBeMoved(true) && target.CanBeChasedBy(Projectile, false)) + if (target.CanBeMoved() && target.CanBeChasedBy(Projectile, false)) { if (target != null && !CalamityPlayer.areThereAnyDamnBosses) { @@ -284,7 +284,7 @@ namespace CalamityMod.Projectiles.Rogue } Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 60, true); + target.MoveNPC(launchVel, 60, true, Owner); } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) // Add to regular plz diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 40790b782c..f045cf6b42 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Rogue OnHitEffects(target); target.AddBuff(BuffID.Frostburn2, 120); if (Projectile.Calamity().stealthStrike) - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(BuffID.Frozen, 45); } diff --git a/Projectiles/Rogue/VegaStar.cs b/Projectiles/Rogue/VegaStar.cs index 4c2240f9f7..0986d31102 100644 --- a/Projectiles/Rogue/VegaStar.cs +++ b/Projectiles/Rogue/VegaStar.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public class VegaStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; - public static int lifetime = 300; + public static int lifetime => 600; public override void SetStaticDefaults() { @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 5; - lifetime = 600; Projectile.timeLeft = lifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.localAI[0] = 20f; diff --git a/Projectiles/Rogue/WhitewaterAura.cs b/Projectiles/Rogue/WhitewaterAura.cs index 466840dfc2..a1a3c6b70c 100644 --- a/Projectiles/Rogue/WhitewaterAura.cs +++ b/Projectiles/Rogue/WhitewaterAura.cs @@ -65,11 +65,12 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + Player Owner = Main.player[Projectile.owner]; target.AddBuff(BuffID.Wet, 300); target.AddBuff(ModContent.BuffType(), 300); Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); - target.MoveNPC(launchVel, 9, true); + target.MoveNPC(launchVel, 9, true, Owner); } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Rogue/WrathwingFireball.cs b/Projectiles/Rogue/WrathwingFireball.cs index b5996c3d83..b6b9471db2 100644 --- a/Projectiles/Rogue/WrathwingFireball.cs +++ b/Projectiles/Rogue/WrathwingFireball.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { Main.projFrames[Type] = 5; - ProjectileID.Sets.TrailCacheLength[Type] = 20; - ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -57,15 +55,6 @@ namespace CalamityMod.Projectiles.Rogue int frameHeight = texture.Height / Main.projFrames[Type]; int frameY = frameHeight * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); - if (CalamityClientConfig.Instance.Afterimages) - { - for (int i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color2 = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), color2, Projectile.rotation, rectangle.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - } - } Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 1e27343593..8301c8146d 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Particles; @@ -6,6 +7,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -19,6 +21,9 @@ namespace CalamityMod.Projectiles.Rogue internal Color PrimColorMult = Color.White; public override string Texture => "CalamityMod/Items/Weapons/Rogue/WulfrumKnife"; + private bool beginStretchAnim = false; + private float progress = -1f; + public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 20; @@ -27,7 +32,6 @@ namespace CalamityMod.Projectiles.Rogue public static int Lifetime = 1440; public float LifetimeCompletion => MathHelper.Clamp((Lifetime - Projectile.timeLeft) / (float)Lifetime, 0f, 1f); - public float StealthEffectOpacity => MathHelper.Clamp(1 - LifetimeCompletion, 0f, 1f); public float StuckEnemyID { @@ -59,10 +63,23 @@ namespace CalamityMod.Projectiles.Rogue Projectile.localNPCHitCooldown = 1; Projectile.stopsDealingDamageAfterPenetrateHits = true; } - + public override void OnSpawn(IEntitySource source) + { + for (int i = 0; i < Projectile.oldPos.Length; i++) + Projectile.oldPos[i] = Projectile.Center; + } public override void AI() { + if (Projectile.timeLeft >= 50) + Projectile.Opacity = MathHelper.Clamp(LifetimeCompletion * 90f, 0f, 1f); + else + Projectile.Opacity = Projectile.timeLeft / 50f; // Fade out over last 50 frames + + // Update squash and stretch animation + if (progress >= 0f && progress < 1f) + progress += 0.06f; + if (StuckEnemyID > 0) { Projectile.tileCollide = false; @@ -108,7 +125,7 @@ namespace CalamityMod.Projectiles.Rogue if (!Projectile.Calamity().stealthStrike) { - if (Main.rand.NextBool(10)) + if (Main.rand.NextBool(12)) { Vector2 dustCenter = Projectile.Center + Projectile.velocity.RotatedBy(MathHelper.PiOver2).SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(-3f, 3f); @@ -122,13 +139,13 @@ namespace CalamityMod.Projectiles.Rogue else { - Lighting.AddLight(Projectile.Center, (Main.rand.NextBool() ? Color.GreenYellow : Color.DeepSkyBlue).ToVector3() * StealthEffectOpacity); + Lighting.AddLight(Projectile.Center, (Main.rand.NextBool() ? Color.GreenYellow : Color.DeepSkyBlue).ToVector3()); if (Main.rand.NextBool(7)) { Vector2 center = Projectile.Center + Projectile.velocity.RotatedBy(MathHelper.PiOver2).SafeNormalize(Vector2.Zero) * Main.rand.NextFloat(-3f, 3f); Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.Pi / 6f) * Main.rand.NextFloat(4, 10); - GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(center, velocity, Main.rand.NextFloat(1f, 2f), Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247), 25, StealthEffectOpacity)); + GeneralParticleHandler.SpawnParticle(new TechyHoloysquareParticle(center, velocity, Main.rand.NextFloat(1f, 2f), Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247), 25, Projectile.Opacity)); } @@ -141,16 +158,24 @@ namespace CalamityMod.Projectiles.Rogue chust.noLightEmittence = true; } } + + if (Projectile.timeLeft < 120) + Projectile.Opacity -= 0.03f; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); - Projectile.timeLeft = Lifetime; + Projectile.timeLeft = Math.Max(Projectile.timeLeft, 300); StuckEnemyID = target.whoAmI+1; StuckEnemyDistance = Projectile.Distance(target.Center); StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + beginStretchAnim = true; + } + public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); @@ -161,7 +186,7 @@ namespace CalamityMod.Projectiles.Rogue internal Color ColorFunction(float completionRatio, Vector2 vertexPos) { - float fadeOpacity = (float)Math.Pow(1 - completionRatio, 2) * StealthEffectOpacity; + float fadeOpacity = (float)MathHelper.Clamp(LifetimeCompletion * 30f, 0f, 1f); return Color.GreenYellow.MultiplyRGB(PrimColorMult) * fadeOpacity; } @@ -173,7 +198,41 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - float opacitey = StealthEffectOpacity; + + // Squash and Stretch Scale Logic + if (beginStretchAnim) + { + progress = 0f; + beginStretchAnim = false; + } + + float stretchFactorX = 1f; + float stretchFactorY = 1f; + + if (progress >= 0f) + { + if (progress < 0.5f) // Stretch phase + { + float completion = progress / 0.5f; + stretchFactorX = MathHelper.Lerp(1.6f, 0.7f, completion); + stretchFactorY = MathHelper.Lerp(0.7f, 1.6f, completion); + } + else // Squash phase + { + float completion = (progress - 0.5f) / 0.5f; + stretchFactorX = MathHelper.Lerp(0.7f, 1f, completion); + stretchFactorY = MathHelper.Lerp(1.6f, 1f, completion); + } + + if (progress >= 1f) + { + progress = -1f; + } + } + + Vector2 drawScale = new Vector2(stretchFactorX, stretchFactorY) * Projectile.scale; + Vector2 offset = Projectile.Size * 0.5f; + Vector2[] oldPosWithOffset = Projectile.oldPos.Select(p => p - offset).ToArray(); if (Projectile.Calamity().stealthStrike && StuckEnemyID == 0) { @@ -181,33 +240,26 @@ namespace CalamityMod.Projectiles.Rogue Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/Trails/BasicTrail")); - + CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 1f, delegate (Vector2 offset, Color colorMod) { PrimColorMult = colorMod; - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_,_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); + PrimitiveRenderer.RenderTrail(oldPosWithOffset, new(WidthFunction, ColorFunction, (_,_) => Projectile.Size + offset, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 30); }); - - CalamityUtils.DrawChromaticAberration(Vector2.UnitX, 3f, delegate (Vector2 offset, Color colorMod) { - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + offset, null, Color.GreenYellow.MultiplyRGB(colorMod) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + offset, null, Color.GreenYellow.MultiplyRGB(colorMod) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); }); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); - - opacitey = MathHelper.Clamp(LifetimeCompletion * 8f, 0f, 1f); - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); } - else { - opacitey = MathHelper.Clamp(LifetimeCompletion * 15f, 0f, 1f); - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * opacitey, Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor) * Projectile.Opacity, Projectile.rotation, tex.Size() * 0.5f, drawScale, SpriteEffects.None, 0); } return false; } diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index 59a7afc0be..5344a200dc 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Summon modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center); - target.MoveNPC(launchVel, (MinionBuffMode ? 5f : 0.5f), false); + target.MoveNPC(launchVel, (MinionBuffMode ? 5f : 0.5f), false, Owner); } public override bool MinionContactDamage() => !Reforming; } diff --git a/Projectiles/Summon/CosmilampBeam.cs b/Projectiles/Summon/CosmilampBeam.cs index 4c97013286..36b9c5cd24 100644 --- a/Projectiles/Summon/CosmilampBeam.cs +++ b/Projectiles/Summon/CosmilampBeam.cs @@ -105,8 +105,6 @@ namespace CalamityMod.Projectiles.Summon return MathHelper.Lerp(0f, maxWidth, expansionCompletion); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); - public override bool PreDraw(ref Color lightColor) { Projectile.localAI[0] = 0f; diff --git a/Projectiles/Summon/DoGWeaponTeleportRift.cs b/Projectiles/Summon/DoGWeaponTeleportRift.cs index 2e8bbed414..1ca8c9ccb2 100644 --- a/Projectiles/Summon/DoGWeaponTeleportRift.cs +++ b/Projectiles/Summon/DoGWeaponTeleportRift.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Projectile.scale = Projectile.ai[1]; + if (Projectile.ai[1] != 0) + Projectile.scale = Projectile.ai[1]; if (Projectile.ai[0] == 0f) Projectile.ai[0] = 45f; 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/EndoHydraRay.cs b/Projectiles/Summon/EndoHydraRay.cs index afc80011de..4493110678 100644 --- a/Projectiles/Summon/EndoHydraRay.cs +++ b/Projectiles/Summon/EndoHydraRay.cs @@ -46,9 +46,5 @@ namespace CalamityMod.Projectiles.Summon } } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - 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/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 13b0cb3416..3c7ed0682c 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon if (spawnDust) { - Projectile.ai[1] = -1; + Projectile.ai[2] = -1; int dustAmt = 36; for (int d = 0; d < dustAmt; d++) { @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon { spawnDust = true; } - int npcIndex = (int)Projectile.ai[1]; + int npcIndex = (int)Projectile.ai[2]; if (Projectile.localAI[0] >= 600000f) //tryna make it stay on there "forever" without glitching { breakAway = true; @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Summon //let the projectile know it is sticking and the npc it is sticking too Projectile.ai[0] = 3f; - Projectile.ai[1] = npcIndex; + Projectile.ai[2] = npcIndex; //follow the NPC Projectile.velocity = (npc.Center - Projectile.Center) * 0.75f; @@ -203,12 +203,11 @@ namespace CalamityMod.Projectiles.Summon //Count how many projectiles are attached, delete as necessary Point[] array2 = new Point[10]; int projCount = 0; - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + foreach (Projectile p in Main.ActiveProjectiles) { - Projectile proj = Main.projectile[projIndex]; - if (projIndex != Projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == Projectile.type && proj.ai[0] == 3f && proj.ai[1] == npcIndex) + if (p.whoAmI != Projectile.whoAmI && p.owner == Main.myPlayer && p.type == Projectile.type && p.ai[0] == 3f && p.ai[2] == npcIndex) { - array2[projCount++] = new Point(projIndex, proj.timeLeft); + array2[projCount++] = new Point(p.whoAmI, p.timeLeft); if (projCount >= array2.Length) { break; diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index 12833d3ce9..e2f58e969a 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -559,8 +559,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.Calamity().sagePoisonDamage = (int)(SagePoison.debuffData.EnemyLostRegen * SagePoison.ViridVanguardPoisonMultiplier * CurrentViridCount); - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 300); if (ActiveAttacking) { Vector2 vel = new Vector2(0.1f, 0.1f).RotatedByRandom(100); diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs deleted file mode 100644 index 1d9f07ff49..0000000000 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.IO; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationAura : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public int timer = 0; - - public override void SetStaticDefaults() => Main.projPet[Type] = true; - - public override void SetDefaults() - { - Projectile.width = 46; - Projectile.height = 80; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 3f; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.DamageType = DamageClass.Summon; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(timer); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - timer = reader.ReadInt32(); - } - - public override bool? CanCutTiles() - { - return true; - } - - public void HandleRightClick() - { - // 15NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Vector2 velocity = Main.MouseWorld - Main.player[Projectile.owner].Center; - velocity.Normalize(); - velocity *= 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Main.player[Projectile.owner].Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 5f), 0f, Projectile.owner); - - Projectile.Kill(); - } - - public override void AI() - { - Player owner = Main.player[Projectile.owner]; - CalamityPlayer mp = owner.Calamity(); - Projectile.Center = owner.Center; - mp.voidAuraDamage = true; - if (owner.dead) - mp.voidAuraDamage = false; - if (!mp.voidAuraDamage || !mp.voidConcentrationAura && Projectile.ai[0] == 1f) - { - mp.voidAura = false; - Projectile.Kill(); - } - if (owner.whoAmI == Main.myPlayer && owner.ownedProjectileCounts[Type] <= 25 && timer > 0 && timer % 4 == 0) - { - NPC target = CalamityUtils.MinionHoming(Projectile.Center, 1800f, owner); - if (target != null) - { - Vector2 correctedVelocity = target.Center - owner.Center; - correctedVelocity.Normalize(); - correctedVelocity *= 3f; - int perturbificator9000 = Main.rand.Next(-1, 2); - Vector2 perturbedspeed = new Vector2(correctedVelocity.X + perturbificator9000, correctedVelocity.Y + perturbificator9000).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 3))); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedspeed, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), 0f, owner.whoAmI); - } - timer = -1; - } - Projectile.ai[0] = 1f; - if (timer > 50 && timer % 4 == 0) - return; - timer++; - } - - public override bool MinionContactDamage() => true; - } -} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs deleted file mode 100644 index efed72d73c..0000000000 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.IO; -using CalamityMod.NPCs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationBlackhole : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - private int damage = 0; - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(damage); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - damage = reader.ReadInt32(); - } - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.MinionShot[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 80; //32 base, 2.5x the normal (for hitbox purposes) - Projectile.height = 85; //34 base, 2.5x the normal (for hitbox purposes) - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 1800; - Projectile.penetrate = -1; - - Projectile.tileCollide = false; - Projectile.scale = 0.01f; - Projectile.DamageType = DamageClass.Summon; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; - } - - private void ApplySucc(NPC npc) - { - float succStrength = 4f / Projectile.scale; - succStrength *= Projectile.scale; - Vector2 velocity = Projectile.Center - npc.Center; - velocity *= 2f; - velocity.SafeNormalize(Vector2.Zero); - float projSpeed = 5f * Projectile.scale; - Vector2 fireDirection = npc.Center; - float fireXVel = Projectile.Center.X - fireDirection.X; - float fireYVel = Projectile.Center.Y - fireDirection.Y; - float fireVelocity = (float)Math.Sqrt((double)(fireXVel * fireXVel + fireYVel * fireYVel)); - if (fireVelocity < 100f) - { - projSpeed = 28f; //14 - } - fireVelocity = projSpeed / fireVelocity; - fireXVel *= fireVelocity; - fireYVel *= fireVelocity; - npc.velocity.X = (velocity.X * 15f + fireXVel) / 16f; - npc.velocity.Y = (velocity.Y * 15f + fireYVel) / 16f; - npc.velocity = (velocity / succStrength); - } - - private void Death() - { - if (Projectile.scale >= 2.5f) //it's boom o' clock - { - Projectile.height *= 2; - Projectile.width *= 2; - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage = damage; - Projectile.Damage(); - Projectile.friendly = false; - Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - Projectile.Kill(); - } - } - - public override void OnKill(int timeLeft) - { - for (int d = 0; d < 6; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 4f); - Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[shadow].scale = 0.5f; - Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 18; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 4f); - Main.dust[shadow].noGravity = true; - Main.dust[shadow].velocity *= 5f; - shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 3f); - Main.dust[shadow].velocity *= 2f; - } - } - - public override bool PreAI() - { - if (damage == 0) - { - damage = Projectile.damage; - Projectile.damage = 0; - Projectile.position = Main.player[Projectile.owner].position; - } - return true; - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - int height = texture.Height / Main.projFrames[Type]; - int frameHeight = height * Projectile.frame; - Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); - Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); - Main.EntitySpriteDraw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void AI() - { - - Projectile.scale += 0.01f; - if (Projectile.scale % 0.02f == 0) - { - Projectile.scale += 0.01f; //speeds up the projectile's growth to prevent it being too long - } - int radius = (int)(Projectile.scale * 100f); //0.01f; to a max of 2.5f; so radius of 1 to 250 by default - if (Projectile.scale >= 2f) - radius *= 2; - - int baseWidth = 32; - int baseHeight = 34; - int newWidth = (int)(baseWidth * Projectile.scale); - int newHeight = (int)(baseHeight * Projectile.scale); - Projectile.ExpandHitboxBy(newWidth, newHeight); - - - - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type] - 1) - { - Projectile.frame = 0; - } - Projectile.frameCounter++; - - foreach (NPC n in Main.ActiveNPCs) - { - if (!n.friendly && CalamityGlobalNPC.ShouldAffectNPC(n)) - { - if (Vector2.Distance(Projectile.Center, n.Center) <= radius) - ApplySucc(n); - } - } - - - if (Projectile.scale >= 2.5f) //it's boom o' clock - { - Death(); - } - } - } -} diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.png b/Projectiles/Summon/VoidConcentrationBlackhole.png deleted file mode 100644 index ab6fe62770..0000000000 Binary files a/Projectiles/Summon/VoidConcentrationBlackhole.png and /dev/null differ diff --git a/Projectiles/Summon/VoidConcentrationOrb.png b/Projectiles/Summon/VoidConcentrationMark.png similarity index 100% rename from Projectiles/Summon/VoidConcentrationOrb.png rename to Projectiles/Summon/VoidConcentrationMark.png diff --git a/Projectiles/Summon/VoidConcentrationOrb.cs b/Projectiles/Summon/VoidConcentrationOrb.cs deleted file mode 100644 index 7de9d93ea7..0000000000 --- a/Projectiles/Summon/VoidConcentrationOrb.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class VoidConcentrationOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.MinionShot[Type] = true; - ProjectileID.Sets.CultistIsResistantTo[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 54; - Projectile.height = 50; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 300; - Projectile.penetrate = 1; - - Projectile.tileCollide = false; - Projectile.scale = 0.01f; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool? CanHitNPC(NPC target) - { - if (Projectile.scale < 1f) - return false; - return null; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - for (int d = 0; d < 6; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 2f); - Main.dust[shadow].velocity *= 3f; - if (Main.rand.NextBool()) - { - Main.dust[shadow].scale = 0.5f; - Main.dust[shadow].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int d = 0; d < 10; d++) - { - int shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 3f); - Main.dust[shadow].noGravity = true; - Main.dust[shadow].velocity *= 5f; - shadow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Shadowflame, 0f, 0f, 100, new Color(0, 0, 0), 2f); - Main.dust[shadow].velocity *= 2f; - } - } - - public override void AI() - { - Player owner = Main.player[Projectile.owner]; - NPC target = CalamityUtils.MinionHoming(Projectile.Center, 1800f, owner); - - if (Projectile.scale >= 1f) - { - if (target != null) - { - float projSpeed = 40f; - Vector2 fireDirection = Projectile.Center; - float fireXVel = target.Center.X - fireDirection.X; - float fireYVel = target.Center.Y - fireDirection.Y; - float fireVelocity = (float)Math.Sqrt((double)(fireXVel * fireXVel + fireYVel * fireYVel)); - if (fireVelocity < 100f) - { - projSpeed = 28f; //14 - } - fireVelocity = projSpeed / fireVelocity; - fireXVel *= fireVelocity; - fireYVel *= fireVelocity; - Projectile.velocity.X = (Projectile.velocity.X * 25f + fireXVel) / 26f; - Projectile.velocity.Y = (Projectile.velocity.Y * 25f + fireYVel) / 26f; - if (Main.rand.NextBool(5)) - Projectile.velocity *= 1.1f; - } - - } - else - { - Projectile.scale += 0.025f; - Projectile.velocity *= 1.03f; - } - - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Type] - 1) - { - Projectile.frame = 0; - } - Projectile.frameCounter++; - - if (Projectile.timeLeft <= 60) - { - Projectile.alpha += 4; - } - } - } -} diff --git a/Projectiles/Turret/IceExplosion.cs b/Projectiles/Turret/IceExplosion.cs index ea15cffab2..edaa97a1d8 100644 --- a/Projectiles/Turret/IceExplosion.cs +++ b/Projectiles/Turret/IceExplosion.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn2, 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Turret/IceShot.cs b/Projectiles/Turret/IceShot.cs index 8f970f9d8e..3f8f9ced72 100644 --- a/Projectiles/Turret/IceShot.cs +++ b/Projectiles/Turret/IceShot.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn2, 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Typeless/BasicBurst.cs b/Projectiles/Typeless/BasicBurst.cs index df59243a41..10feff399b 100644 --- a/Projectiles/Typeless/BasicBurst.cs +++ b/Projectiles/Typeless/BasicBurst.cs @@ -64,16 +64,14 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff((int)(Projectile.localAI[2]), (int)(Projectile.localAI[1])); } - pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center) * customKnockback; + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); float minMult = Projectile.ai[1]; int hitsToMinMult = (int)Projectile.ai[2]; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; - if (customKnockback != 0 && target.CanBeMoved(hasStongDisplacement)) - { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); - } + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Typeless/BasicBurstExclusive.cs b/Projectiles/Typeless/BasicBurstExclusive.cs index b5297f95f8..3a75ed111f 100644 --- a/Projectiles/Typeless/BasicBurstExclusive.cs +++ b/Projectiles/Typeless/BasicBurstExclusive.cs @@ -62,16 +62,14 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff((int)(Projectile.localAI[1]), (int)(Projectile.localAI[2])); } - pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center) * customKnockback; + pushVelocity = Utils.DirectionTo(Projectile.Center, target.Center); float minMult = Projectile.ai[1]; int hitsToMinMult = (int)Projectile.ai[2]; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; - if (customKnockback != 0 && target.CanBeMoved(hasStongDisplacement)) - { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); - } + if (customKnockback != 0) + target.MoveNPC(pushVelocity, customKnockback, hasStongDisplacement, Main.player[Projectile.owner]); } public override bool? CanHitNPC(NPC target) { diff --git a/Projectiles/Typeless/BatholithBangleProjectile.cs b/Projectiles/Typeless/BatholithBangleProjectile.cs index efd000c2c1..9b62683820 100644 --- a/Projectiles/Typeless/BatholithBangleProjectile.cs +++ b/Projectiles/Typeless/BatholithBangleProjectile.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -117,13 +118,11 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); - modifiers.SourceDamage *= 1 + critDamage; + modifiers.ApplyScalingForcedCrit(Projectile); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) - Vector2.UnitY; float launchPower = 9; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f, targetHitbox); public override bool? CanDamage() diff --git a/Projectiles/Typeless/BlackGlassBandProjectile.cs b/Projectiles/Typeless/BlackGlassBandProjectile.cs index b48eb8ccb2..688c5d7524 100644 --- a/Projectiles/Typeless/BlackGlassBandProjectile.cs +++ b/Projectiles/Typeless/BlackGlassBandProjectile.cs @@ -2,6 +2,7 @@ using CalamityMod.Cooldowns; using CalamityMod.Items.Accessories; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -61,11 +62,7 @@ namespace CalamityMod.Projectiles.Typeless time++; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); - modifiers.SourceDamage *= (1 + critDamage); - } + => modifiers.ApplyScalingForcedCrit(Projectile); public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD); diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index c07289dd98..b3ee8b3aac 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Typeless if (!player.Calamity().CryoStoneVanity) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } } // CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride diff --git a/Projectiles/Typeless/DarkIce.cs b/Projectiles/Typeless/DarkIce.cs index b601c92938..aae5d31743 100644 --- a/Projectiles/Typeless/DarkIce.cs +++ b/Projectiles/Typeless/DarkIce.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs deleted file mode 100644 index 28a575a76d..0000000000 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class DemonshadeRedDevil : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public int dust = 3; - - public ref float State => ref Projectile.ai[0]; // 0 = attacking, 1 = returning, 2 = initial spawn - public ref float Timer => ref Projectile.ai[1]; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 5; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 48; - Projectile.height = 48; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - } - - public override void AI() - { - bool isMinion = Projectile.type == ModContent.ProjectileType(); - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.redDevil) - { - Projectile.active = false; - return; - } - if (isMinion) - { - if (player.dead) - { - modPlayer.rDevil = false; - } - if (modPlayer.rDevil) - { - Projectile.timeLeft = 2; - } - } - - dust--; - if (dust >= 0) - { - for (int i = 0; i < 50; i++) - { - int brimDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); - Main.dust[brimDust].velocity *= 2f; - Main.dust[brimDust].scale *= 1.15f; - } - } - - Projectile.frameCounter++; - if (Projectile.frameCounter > 8) - { - Projectile.frameCounter = 0; - Projectile.frame++; - if (Projectile.frame > 4) - Projectile.frame = 0; - } - - float lights = (float)Main.rand.Next(90, 111) * 0.01f; - lights *= Main.essScale; - Lighting.AddLight(Projectile.Center, 1f * lights, 0f * lights, 0.15f * lights); - - Projectile.rotation = Projectile.velocity.X * 0.04f; - if ((double)Math.Abs(Projectile.velocity.X) > 0.2) - { - Projectile.spriteDirection = -Projectile.direction; - } - - if (State == 2f) - { - Timer++; - if (Timer > 60f) - { - Timer = 1f; - State = 0f; - Projectile.netUpdate = true; - } - return; - } - - Vector2 attackPos = Projectile.position; - float attackRange = 2000f; - bool canAttack = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(Projectile, false)) - { - float npcDist = Vector2.Distance(npc.Center, Projectile.Center); - if (!canAttack && npcDist < attackRange) - { - attackRange = npcDist; - attackPos = npc.Center; - canAttack = true; - } - } - } - else - { - foreach (NPC nPC2 in Main.ActiveNPCs) - { - if (nPC2.CanBeChasedBy(Projectile, false)) - { - float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center); - if ((!canAttack && npcDist < attackRange) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - attackRange = npcDist; - attackPos = nPC2.Center; - canAttack = true; - } - } - } - } - - float separationAnxietyDist = canAttack ? 3000f: 2000f; - if (Vector2.Distance(player.Center, Projectile.Center) > separationAnxietyDist) - { - State = 1f; - Projectile.netUpdate = true; - } - if (canAttack && State == 0f) - { - Vector2 projDirection = attackPos - Projectile.Center; - float projDist = projDirection.Length(); - projDirection.Normalize(); - if (projDist > 200f) - { - projDirection *= 25f; - Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f; - } - else - { - projDirection *= -9f; - Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f; - } - } - else - { - bool isReturning = State == 1f; - float returnSpeed = isReturning ? 24f : 15f; - - Vector2 playerDirection = player.Center - Projectile.Center + new Vector2(0f, -30f); - float playerDist = playerDirection.Length(); - if (playerDist > 200f && returnSpeed < 10f) - { - returnSpeed = 18f; - } - if (playerDist < 150f && isReturning && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) - { - State = 0f; - Projectile.netUpdate = true; - } - if (playerDist > 2000f) - { - Projectile.Center = player.Center; - Projectile.netUpdate = true; - } - if (playerDist > 70f) - { - playerDirection.Normalize(); - playerDirection *= returnSpeed; - Projectile.velocity = (Projectile.velocity * 40f + playerDirection) / 41f; - } - else if (Projectile.velocity == Vector2.Zero) - { - Projectile.velocity = new Vector2(-0.2f, -0.1f); - } - } - if (Timer > 0f) - { - Timer += Main.rand.Next(1, 2 + 1); - } - if (Timer > 80f) - { - Timer = 0f; - Projectile.netUpdate = true; - } - if (State == 0f) - { - if (canAttack && Timer == 0f) - { - Timer += 1f; - if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, attackPos, 0, 0)) - { - Vector2 velocity = Vector2.Normalize(attackPos - Projectile.Center) * 24f; - int trident = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ProjectileID.UnholyTridentFriendly, Projectile.damage, 0f, Main.myPlayer); - if (trident.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[trident].timeLeft = 300; - Main.projectile[trident].usesLocalNPCImmunity = true; - Main.projectile[trident].localNPCHitCooldown = 10; - Main.projectile[trident].DamageType = DamageClass.Generic; //typeless - } - Projectile.netUpdate = true; - } - } - } - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/DemonshadeRedDevil.png b/Projectiles/Typeless/DemonshadeRedDevil.png deleted file mode 100644 index ab63c1a2c0..0000000000 Binary files a/Projectiles/Typeless/DemonshadeRedDevil.png and /dev/null differ diff --git a/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs index c8339673f9..8fa99e61c3 100644 --- a/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs +++ b/Projectiles/Typeless/DiamondOfTheDeepProjectile.cs @@ -446,7 +446,7 @@ namespace CalamityMod.Projectiles.Typeless // HADAL and VOID have knockback, GRAVEL has it's knockback on the explosion Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = 7f; - target.MoveNPC(launchVel, launchPower, false); + target.MoveNPC(launchVel, launchPower, false, Owner); if (visuals) { diff --git a/Projectiles/Typeless/DirectStrike.cs b/Projectiles/Typeless/DirectStrike.cs index b29d83d206..9436c4835d 100644 --- a/Projectiles/Typeless/DirectStrike.cs +++ b/Projectiles/Typeless/DirectStrike.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Typeless if (projHitbox.Intersects(targetHitbox)) { NPC target = Main.npc[(int)Projectile.ai[0]]; - if (pushVelocity != Vector2.Zero && pushVelocity.X < 255f && !invalidTarget && target.CanBeMoved(hasStongDisplacement)) + if (pushVelocity != Vector2.Zero && pushVelocity.X < 255f && !invalidTarget) { - target.velocity = (pushVelocity * (target.knockBackResist == 0 ? 0.5f : 1)); + target.MoveNPC(pushVelocity, pushVelocity.Length(), hasStongDisplacement, Main.player[Projectile.owner]); } return true; } diff --git a/Projectiles/Typeless/FriendlyLaserWallBeam.cs b/Projectiles/Typeless/FriendlyLaserWallBeam.cs index 95f8ae5d59..0227ecb343 100644 --- a/Projectiles/Typeless/FriendlyLaserWallBeam.cs +++ b/Projectiles/Typeless/FriendlyLaserWallBeam.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -130,6 +131,12 @@ namespace CalamityMod.Projectiles.Typeless return hitCheck; } } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.CountsAsClass(DamageClass.Ranged)) //Thread of Eradication + modifiers.ApplyScalingForcedCrit(Projectile); + } public override bool PreDraw(ref Color lightColor) { if (laserFX == 0) diff --git a/Projectiles/Typeless/FungalClumpMinion.cs b/Projectiles/Typeless/FungalClumpMinion.cs index 782a84cecd..a407317fbc 100644 --- a/Projectiles/Typeless/FungalClumpMinion.cs +++ b/Projectiles/Typeless/FungalClumpMinion.cs @@ -230,7 +230,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 2f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 3f); public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs deleted file mode 100644 index 1fda4b4a77..0000000000 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ /dev/null @@ -1,54 +0,0 @@ -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class HydrothermalSmoke : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 42; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = 6; - } - - public override void AI() - { - - if (Projectile.timeLeft == 6) - Projectile.Center = Main.player[Projectile.owner].Center; - - if (Main.rand.NextBool(6)) - { - int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100, default, 0.7f); - if (Main.rand.NextBool(4)) - { - Main.dust[fieryDust].scale *= 0.35f; - } - Main.dust[fieryDust].velocity *= 0f; - } - - - if (Main.rand.NextBool(9) && !Main.dedServ) - { - float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); - MediumMistParticle mist = new MediumMistParticle(Projectile.position, -Projectile.velocity + new Vector2(0.5f, upwardVariation), // This velocity makes it slowly float upward - Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.SteelBlue, Color.LightSlateGray, Main.rand.NextFloat(0.4f, 0.65f), 130); - GeneralParticleHandler.SpawnParticle(mist); - } - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/JewelSpike.cs b/Projectiles/Typeless/JewelSpike.cs index aec3719911..5fcbe77d02 100644 --- a/Projectiles/Typeless/JewelSpike.cs +++ b/Projectiles/Typeless/JewelSpike.cs @@ -6,9 +6,6 @@ namespace CalamityMod.Projectiles.Typeless public class JewelSpike : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; - public ref float RealPenetrate => ref Projectile.ai[0]; - public const int MaxPenetrate = 2; - public override void SetStaticDefaults() { Main.projFrames[Type] = 5; @@ -19,12 +16,14 @@ namespace CalamityMod.Projectiles.Typeless Projectile.width = 36; Projectile.height = 44; Projectile.friendly = true; - Projectile.penetrate = -1; // For the animation, only hits up to 3 times though + Projectile.penetrate = 3; Projectile.tileCollide = false; Projectile.timeLeft = 80; Projectile.DamageType = DamageClass.Generic; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; + Projectile.stopsDealingDamageAfterPenetrateHits = true; + Projectile.appliesImmunityTimeOnSingleHits = true; } public override void AI() @@ -47,10 +46,6 @@ namespace CalamityMod.Projectiles.Typeless Projectile.frame = 0; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => RealPenetrate++; - - public override bool? CanHitNPC(NPC target) => RealPenetrate > MaxPenetrate - 1f ? false : (bool?)null; - public override void OnKill(int timeLeft) { if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Typeless/LeviAmberDash.cs b/Projectiles/Typeless/LeviAmberDash.cs index a77ac9724f..40337949c0 100644 --- a/Projectiles/Typeless/LeviAmberDash.cs +++ b/Projectiles/Typeless/LeviAmberDash.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Typeless target.AddBuff(ModContent.BuffType(), 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 20, true); + target.MoveNPC(launchVel, 20, true, Owner); for (int i = 0; i <= 17; i++) { diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 8df2d4245f..11971b2105 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -114,9 +114,13 @@ namespace CalamityMod.Projectiles.Typeless target.AddBuff(ModContent.BuffType(), 480); Player player = Main.player[Projectile.owner]; - player.statMana += 25; - player.ManaEffect(25); Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.1), 0.75f); + int manaHeal = Math.Clamp(player.statManaMax2 - player.statMana, 0, 20); + if (manaHeal > 0) + { + player.statMana += manaHeal; + player.ManaEffect(manaHeal); + } } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 2febbae82d..1cc60e6c2e 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -171,10 +172,10 @@ namespace CalamityMod.Projectiles.Typeless public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Owner.Calamity().omegaBlueAbyssalMadness) - modifiers.SetCrit(); + modifiers.ApplyScalingForcedCrit(Projectile); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.5f); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.33f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Typeless/PauldronExplosion.cs b/Projectiles/Typeless/PauldronExplosion.cs index eddb8cb142..0dd79cde37 100644 --- a/Projectiles/Typeless/PauldronExplosion.cs +++ b/Projectiles/Typeless/PauldronExplosion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); - target.MoveNPC(launchVel, 15, true); + target.MoveNPC(launchVel, 15, true, Owner); } public override bool? CanCutTiles() => false; diff --git a/Projectiles/Typeless/ProtolithBangleProjectile.cs b/Projectiles/Typeless/ProtolithBangleProjectile.cs index f50a544547..eda80a8c8c 100644 --- a/Projectiles/Typeless/ProtolithBangleProjectile.cs +++ b/Projectiles/Typeless/ProtolithBangleProjectile.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Particles; +using CalamityMod.Utilities; using Microsoft.Xna.Framework; using ReLogic.Utilities; using Terraria; @@ -101,17 +102,16 @@ namespace CalamityMod.Projectiles.Typeless } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SetCrit(); - float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f); + modifiers.ApplyScalingForcedCrit(Projectile); float minMult = 0.1f; int hitsToMinMult = 5; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult + critDamage; + modifiers.SourceDamage *= damageMult; Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY; float launchPower = 6; - target.MoveNPC(launchVel, launchPower, true); + target.MoveNPC(launchVel, launchPower, true, Owner); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox); public override bool? CanDamage() diff --git a/Projectiles/Typeless/PuddleSplash.cs b/Projectiles/Typeless/PuddleSplash.cs index 0d8dff4a2c..56e251accc 100644 --- a/Projectiles/Typeless/PuddleSplash.cs +++ b/Projectiles/Typeless/PuddleSplash.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Typeless { target.AddBuff(BuffID.Wet, 180); Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) + Vector2.UnitY * -0.75f; - target.MoveNPC(launchVel, 12, false); + target.MoveNPC(launchVel, 12, false, Owner); } public override bool? CanCutTiles() => false; } diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index 83fe0d5eb8..9b788095e1 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Typeless { public new string LocalizationCategory => "Projectiles.Typeless"; private const float Radius = 360f; - private const int Duration = 900; public override void SetDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.timeLeft = Duration; + Projectile.timeLeft = SandCloak.SandVeilDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.scale = 1.5f; @@ -52,7 +51,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.Center += Vector2.Normalize(Owner.Center - Projectile.Center) * (ownerDist > Radius * 0.5f ? 2.5f : 1.25f); // Kill the sand veil early if the owner dashes - if (Owner.dashDelay == -1 && Projectile.timeLeft < Duration - 45) + if (Owner.dashDelay == -1 && Projectile.timeLeft < SandCloak.SandVeilDuration - 45) { if (Projectile.timeLeft > 25) Projectile.timeLeft = 25; @@ -74,7 +73,7 @@ namespace CalamityMod.Projectiles.Typeless } // Add Sand Cloak cooldown after the sand veil dies - public override void OnKill(int timeLeft) => Main.player[Projectile.owner].AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(15)); + public override void OnKill(int timeLeft) => Main.player[Projectile.owner].AddCooldown(Cooldowns.SandCloak.ID, SandCloak.SandVeilCooldown); public override bool PreDraw(ref Color lightColor) { @@ -85,8 +84,8 @@ namespace CalamityMod.Projectiles.Typeless Color drawCol = Projectile.GetAlpha(Color.Lerp(lightColor, Color.White, 0.5f)); float drawTransparency = 0.1f; - if (Projectile.timeLeft > Duration - 10) - drawTransparency = (Duration - Projectile.timeLeft) * 0.01f; + if (Projectile.timeLeft > SandCloak.SandVeilDuration - 10) + drawTransparency = (SandCloak.SandVeilDuration - Projectile.timeLeft) * 0.01f; else if (Projectile.timeLeft < 25) drawTransparency = Projectile.timeLeft * 0.004f; diff --git a/Projectiles/Typeless/SpringStoolFX.cs b/Projectiles/Typeless/SpringStoolFX.cs new file mode 100644 index 0000000000..43b814b8a1 --- /dev/null +++ b/Projectiles/Typeless/SpringStoolFX.cs @@ -0,0 +1,140 @@ +using System; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using rail; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class SpringStoolFX : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + + float rotationFactor = 0.015f; + public static float EaseOutElastic(float x, float amplitude = 1f, float period = 0.3f) + { + if (x == 0f) return 0f; + if (x == 1f) return 1f; + + amplitude = Math.Max(1f, amplitude); + + float s = (float)(period / (2 * Math.PI) * Math.Asin(1f / amplitude)); + + return (float)( + amplitude * + Math.Pow(2, -10f * x) * + Math.Sin((x - s) * (2 * Math.PI) / period) + + 1f + ); + } + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } + + public override void SetDefaults() + { + Projectile.width = 78; + Projectile.height = 142; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.friendly = false; + Projectile.penetrate = -1; + Projectile.alpha = 0; + Projectile.timeLeft = 120; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + + if (Projectile.frame < 4) + { + Projectile.frameCounter++; + + if (Projectile.frameCounter >= 4) + { + Projectile.frameCounter = 0; + Projectile.frame++; + + if (Projectile.frame > 4) + { + { + Projectile.frame = 4; // clamp to last frame + } + } + } + } + + float progress = MathHelper.Clamp(Projectile.ai[0] / 70f, 0f, 1f); + + Projectile.ai[1] = EaseOutElastic(progress); + + + Projectile.ai[0]++; + + if (Projectile.ai[0] < 3f) // Stick to bottom of player initially + { + Projectile.Center = player.Bottom + new Vector2(0f, -25f); + } + + else + { + // Begin rotating after initial launch at an increasingly fast rate + rotationFactor *= 1.033f; + Projectile.rotation -= rotationFactor; + } + + if (Projectile.ai[0] == 4f) + { + { + SoundStyle boing = new("CalamityMod/Sounds/Item/Springy"); + SoundEngine.PlaySound(boing with { Volume = 1f, PitchVariance = 0.1f }); + } + } + + if (Projectile.ai[0] == 16) // About when the spring retracts into itself, spawn dusts and sparks + { + for (int k = 0; k < 6; k++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 7 : 8); + dust.scale = Main.rand.NextFloat(0.8f, 1.3f); + dust.velocity = new Vector2(8, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.25f, 1.2f); + dust.noGravity = false; + Particle spark = new AltLineParticle(Projectile.Center, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.9f), true, 15, 0.8f, Color.Lerp(Color.LightGray, Color.Brown, Main.rand.NextFloat(0.3f, 0.7f)) * 0.75f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + + if (Projectile.ai[0] >= 28f) // Begin fading + { + Projectile.alpha += 10; + Projectile.scale *= 0.98f; + + } + + if (Projectile.alpha >= 255 || !player.active || player.dead) + Projectile.Kill(); + } + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + int frameHeight = texture.Height / Main.projFrames[Type]; + Rectangle sourceRect = new Rectangle(0, frameHeight * Projectile.frame, texture.Width, frameHeight); + Vector2 drawOrigin = new Vector2(texture.Width * 0.5f, frameHeight * 0.5f); + Vector2 drawPos = Projectile.Center - Main.screenPosition; + + Vector2 scale = new Vector2(Projectile.scale, Projectile.scale * Projectile.ai[1]); + + Main.EntitySpriteDraw(texture, drawPos, sourceRect, Projectile.GetAlpha(lightColor), Projectile.rotation + (Main.player[Projectile.owner].gravDir == -1 ? MathHelper.Pi : 0), drawOrigin, scale, SpriteEffects.None, 0); + return false; + } + } +} diff --git a/Projectiles/Typeless/SpringStoolFX.png b/Projectiles/Typeless/SpringStoolFX.png new file mode 100644 index 0000000000..4d21337bde Binary files /dev/null and b/Projectiles/Typeless/SpringStoolFX.png differ diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index b692380ee6..a6fde03773 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -1,5 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -14,82 +14,43 @@ namespace CalamityMod.Projectiles.Typeless public override void SetDefaults() { - Projectile.width = 6; - Projectile.height = 12; + Projectile.width = 8; + Projectile.height = 8; Projectile.friendly = true; - Projectile.penetrate = -1; + Projectile.penetrate = 1; Projectile.timeLeft = 240; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 7; + Projectile.MaxUpdates = 4; + Projectile.tileCollide = false; + } public override void AI() { - if (Projectile.velocity.X != Projectile.velocity.X) + CalamityUtils.HomeInOnNPC(Projectile, false, 300, 5.5f, 10f, true); + + if (Projectile.Calamity().HomingTarget < 0) { - Projectile.velocity.X = Projectile.velocity.X * -0.1f; + Projectile.velocity.Y += 0.025f; } - if (Projectile.velocity.X != Projectile.velocity.X) - { - Projectile.velocity.X = Projectile.velocity.X * -0.5f; - } - if (Projectile.velocity.Y != Projectile.velocity.Y && Projectile.velocity.Y > 1f) - { - Projectile.velocity.Y = Projectile.velocity.Y * -0.5f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0f && Projectile.velocity.X != 0f) - { - Projectile.velocity.X = Projectile.velocity.X * 0.97f; - if ((double)Projectile.velocity.X > -0.01 && (double)Projectile.velocity.X < 0.01) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y = Projectile.velocity.Y + 0.2f; - } - Projectile.rotation += Projectile.velocity.X * 0.1f; if (Projectile.ai[1] == 0f && Projectile.type >= ProjectileID.GreekFire1 && Projectile.type <= ProjectileID.GreekFire3) { Projectile.ai[1] = 1f; SoundEngine.PlaySound(SoundID.Item13, Projectile.position); } - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[brimDust]; - dust.position.X -= 2f; - dust.position.Y += 2f; - dust.scale += (float)Main.rand.Next(50) * 0.01f; - dust.noGravity = true; - dust.velocity.Y -= 2f; - if (Main.rand.NextBool()) - { - int brimDusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Dust dusty = Main.dust[brimDusty]; - dusty.position.X -= 2f; - dusty.position.Y += 2f; - dusty.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - dusty.noGravity = true; - dusty.velocity *= 0.1f; - } - if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15) - { - Projectile.velocity.X = Projectile.velocity.X * 0.8f; - } - Projectile.rotation = -Projectile.velocity.X * 0.05f; + + CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); + if (Projectile.velocity.Y > 16f) { Projectile.velocity.Y = 16f; } } - public override bool OnTileCollide(Vector2 oldVelocity) => false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); } } diff --git a/Projectiles/Typeless/StepStoolBonusFX.cs b/Projectiles/Typeless/StepStoolBonusFX.cs new file mode 100644 index 0000000000..6cd1a56d57 --- /dev/null +++ b/Projectiles/Typeless/StepStoolBonusFX.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class StepStoolBonusFX : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override string Texture => "Calamitymod/Projectiles/InvisibleProj"; + public float OpacityMultiplier = 1f; + public override void SetDefaults() + { + Projectile.width = 28; + Projectile.height = 28; + + Projectile.tileCollide = true; + Projectile.ignoreWater = true; + Projectile.friendly = false; + Projectile.penetrate = -1; + + Projectile.timeLeft = 100; + Projectile.alpha = 0; + } + + public override void AI() + { + // Gravity! + Projectile.velocity.Y += 0.15f; + + Projectile.rotation += 0.12f; + Projectile.scale -= 0.0125f; + OpacityMultiplier -= 0.025f; + + if (Projectile.timeLeft > 99) + Projectile.alpha = 255; + else + Projectile.alpha = 0; + } + + public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Extra[102].Value; + Vector2 origin = texture.Size() / 2f; + + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White * ((1f - (Projectile.alpha / 255f)) * OpacityMultiplier), Projectile.rotation + (Main.player[Projectile.owner].gravDir == -1 ? MathHelper.Pi : 0), origin, Projectile.scale * 1.25f, SpriteEffects.None); + + return false; + } + } +} diff --git a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs index cbbd158e99..3af9fac9fc 100644 --- a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs +++ b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.alpha = 255; Projectile.timeLeft = 360; Projectile.penetrate = 1; + Projectile.Calamity().CannotProc = true; } public override void AI() @@ -137,7 +138,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2); int inc; //For use with Contaminated Bile's Stealth Strike - if (Projectile.Calamity().stealthStrike) + if (Projectile.ai[2] > 0) { for (int k = 0; k < 15; k++) { diff --git a/Projectiles/Typeless/TileSlamDamage.cs b/Projectiles/Typeless/TileSlamDamage.cs new file mode 100644 index 0000000000..b359b1b9ab --- /dev/null +++ b/Projectiles/Typeless/TileSlamDamage.cs @@ -0,0 +1,28 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class TileSlamDamage : DirectStrike, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public Player Owner => Main.player[Projectile.owner]; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetInstantKill(); + int damageLength = (int)Math.Pow(target.life.ToString().Length, target.boss ? 2.8f : 1); + string sevens = "7"; + for (int i = 0; i < damageLength; i++) + { + sevens = sevens + "7"; + } + + Rectangle location = new Rectangle((int)target.position.X, (int)target.position.Y - 16, target.width, target.height); + int text = CombatText.NewText(location, Color.DodgerBlue, Language.GetTextValue(sevens), true); + } + + } +} diff --git a/Projectiles/Typeless/TransformerBlob.cs b/Projectiles/Typeless/TransformerBlob.cs index a3fc1c1c55..c9fa8c8bdc 100644 --- a/Projectiles/Typeless/TransformerBlob.cs +++ b/Projectiles/Typeless/TransformerBlob.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Projectiles.Typeless else modifiers.SourceDamage *= 0.2f; - target.MoveNPC(Utils.DirectionTo(Owner.Center, target.Center), (poweredTimer == 0 ? 7 : 3)); + target.MoveNPC(Utils.DirectionTo(Owner.Center, target.Center), (poweredTimer == 0 ? 7 : 3), false, Owner); if (Projectile.numHits == 0 && poweredTimer == 0) { diff --git a/Projectiles/Typeless/V8000SoulVisual.cs b/Projectiles/Typeless/V8000SoulVisual.cs new file mode 100644 index 0000000000..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/Springy.ogg b/Sounds/Item/Springy.ogg new file mode 100644 index 0000000000..09fa4c4f8d Binary files /dev/null and b/Sounds/Item/Springy.ogg differ diff --git a/Sounds/Item/V8000Boost.ogg b/Sounds/Item/V8000Boost.ogg new file mode 100644 index 0000000000..ea2fe8ff96 Binary files /dev/null and b/Sounds/Item/V8000Boost.ogg differ diff --git a/Sounds/Item/V8Boost.ogg b/Sounds/Item/V8Boost.ogg new file mode 100644 index 0000000000..cbcbcd3a3f Binary files /dev/null and b/Sounds/Item/V8Boost.ogg differ diff --git a/Systems/Collections/CalamityBuffSets.cs b/Systems/Collections/CalamityBuffSets.cs index 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..4ced4a300a 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -77,6 +77,11 @@ namespace CalamityMod.Systems.Collections public static bool[] DoesNotGetHomingWithGrapeBeer = Factory.CreateBoolSet(ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType()); + + public static bool[] DaawnlightBlacklist = Factory.CreateNamedSet("DaawnlightBlacklist") + .Description("Disables a projectile from increasing Daawnlight Spirit Origin's extra crit") + .RegisterBoolSet(ProjectileType(), ProjectileType(), ProjectileType()); + /// /// Determines what other projectiles this projectile will share ID-static immunity frames with. Defaults to -1, which means that it does not share immunity frames.
/// Each "set" of projectile which shares immunity frames is registered to point to the same ID reference, usually the first projectile in the set. If a projectile with this reference hits an NPC, all other projectiles with that reference also have their ID-static immunity cooldown set for that NPC. @@ -102,7 +107,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 9d8535f641..78c5a9789f 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -756,8 +756,6 @@ namespace CalamityMod.Systems // Tier lock various items to a higher tier (sorted by progression) { Vanilla(ItemID.Trimarang), AddIngredient(ItemType(), 5) }, - { Vanilla(ItemID.BundleofBalloons), AddIngredient(ItemType(), 3) }, - { r => r.HasResult(ItemID.HorseshoeBundle) && !r.HasIngredient(ItemID.BundleofBalloons), AddIngredient(ItemType(), 3) }, { Vanilla(ItemID.NightsEdge), AddIngredient(ItemType(), 5) }, { Vanilla(ItemID.FairyBoots), AddIngredient(ItemID.SoulofLight, 5) }, { Vanilla(ItemID.FairyBell), RemoveIngredient(ItemID.SoulofSight) }, @@ -796,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. @@ -1581,8 +1576,8 @@ namespace CalamityMod.Systems // Blizzard in a Bottle r = Recipe.Create(ItemID.BlizzardinaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); - r.AddRecipeGroup(AnySnowBlock, 5); + r.AddIngredient(ItemID.Cloud, 15); + r.AddRecipeGroup(AnySnowBlock, 30); r.AddIngredient(ItemID.Feather, 3); r.AddTile(TileID.Anvils); r.Register(); @@ -1590,7 +1585,7 @@ namespace CalamityMod.Systems // Cloud in a Bottle r = Recipe.Create(ItemID.CloudinaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); + r.AddIngredient(ItemID.Cloud, 30); r.AddIngredient(ItemID.Feather, 2); r.AddTile(TileID.Anvils); r.Register(); @@ -1598,9 +1593,8 @@ namespace CalamityMod.Systems // Sandstorm in a Bottle r = Recipe.Create(ItemID.SandstorminaBottle); r.AddIngredient(ItemID.Bottle); - r.AddIngredient(ItemID.Cloud, 5); - r.AddRecipeGroup("Sand", 5); - r.AddIngredient(3); + r.AddIngredient(ItemID.Cloud, 15); + r.AddRecipeGroup("Sand", 40); r.AddIngredient(ItemID.Feather, 3); r.AddTile(TileID.Anvils); r.Register(); @@ -1608,7 +1602,7 @@ namespace CalamityMod.Systems // Fledgling Wings r = Recipe.Create(ItemID.CreativeWings); - r.AddIngredient(ModContent.ItemType(), 2); + r.AddIngredient(2); r.AddIngredient(ItemID.Cloud, 5); r.AddIngredient(ItemID.Feather, 10); r.AddTile(TileID.Anvils); @@ -1619,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/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index 8568bd4e69..81feca5779 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -619,7 +619,10 @@ namespace CalamityMod.Systems bool adultWyrmAlive = CalamityGlobalNPC.adultEidolonWyrmHead != -1 && Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active; if (!adultWyrmAlive) + { + CalamityUtils.BroadcastLocalizedText("Mods.CalamityMod.Status.Boss.PrimordialWyrmSpawn", Color.Cyan); NPC.SpawnOnPlayer(player.whoAmI, NPCType()); + } } #endregion } diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs index e122340eb9..aed63f0f69 100644 --- a/Tiles/Crags/Tree/SpineSapling.cs +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -10,6 +10,32 @@ namespace CalamityMod.Tiles.Crags.Tree { public class SpineSapling : ModTile { + public override void Load() + { + On_Player.TryReplantingTree += LetAxeofRegrowthReplant; + } + + private static void LetAxeofRegrowthReplant(On_Player.orig_TryReplantingTree orig, Player self, int x, int y) + { + if (Main.tile[x, y + 1].TileType == ModContent.TileType()) + { + // Destroy the Spine Tree tile above the base to give space for the Small Spine to place + WorldGen.KillTile(x, y - 1); + if (!TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, ModContent.TileType(), 0, self.direction, out var objectData)) + return; + bool placed = TileObject.Place(objectData); + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + if (placed) + { + TileObjectData.CallPostPlacementPlayerHook(Player.tileTargetX, Player.tileTargetY, ModContent.TileType(), 0, self.direction, objectData.alternate, objectData); + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendObjectPlacement(-1, Player.tileTargetX, Player.tileTargetY, objectData.type, objectData.style, objectData.alternate, objectData.random, self.direction); + } + } + else + orig(self, x, y); + } + public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index 06d6eaffc3..d58e40d647 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -171,14 +171,14 @@ namespace CalamityMod.Tiles.Crags.Tree public override void NearbyEffects(int i, int j, bool closer) { - //kill the tree tiles if there are no tiles below it - if (!Framing.GetTileSafely(i, j + 1).HasTile) + // Kill the tree tiles if there are no tiles below it or if a Sapling is below it + // The Sapling check exists for Axe of Regrowth sapling replanting + Tile belowTile = Framing.GetTileSafely(i, j + 1); + if (!belowTile.HasTile || belowTile.TileType == ModContent.TileType()) { - WorldGen.KillTile(i, j, false, false, false); + WorldGen.KillTile(i, j); if (Main.netMode == NetmodeID.MultiplayerClient) - { NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, i, j); - } } } diff --git a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs index 49fcd0d128..6c036b064e 100644 --- a/Tiles/Furniture/Paintings/BaseCanvasPainting.cs +++ b/Tiles/Furniture/Paintings/BaseCanvasPainting.cs @@ -111,11 +111,11 @@ namespace CalamityMod.Tiles.Furniture.Paintings DrawBorders(spriteBatch, pos - Main.screenPosition, new Point(i, j)); return false; } - public static void DrawBorders(SpriteBatch spriteBatch, Vector2 pos, Point cords) + public void DrawBorders(SpriteBatch spriteBatch, Vector2 pos, Point cords) { var texture = border.Value; var cornerTex = corner.Value; - var canvasID = (ushort)Main.LocalPlayer.Calamity().CurrentlyViewedCanvasType; + var canvasID = Type; var commonDim = 8; var finalCord = 72; var size = 80; diff --git a/Tiles/FurnitureWulfrum/WulfrumLabstation.cs b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs index e58e455dd4..5b7f227594 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLabstation.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Tiles.FurnitureWulfrum public override void SetStaticDefaults() { + this.SetUpTable(ModContent.ItemType(), true); Main.tileFrameImportant[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index c015c371b2..a4b10b3957 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Tiles.SunkenSea TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Sand"]); TileID.Sets.Suffocate[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; - TileID.Sets.Conversion.Sand[Type] = true; TileID.Sets.ForAdvancedCollision.ForSandshark[Type] = true; TileID.Sets.Falling[Type] = true; TileID.Sets.FallingBlockProjectile[Type] = new TileID.Sets.FallingBlockProjectileInfo(ModContent.ProjectileType(), 5); diff --git a/Utilities/HitModiferUtils.cs b/Utilities/HitModiferUtils.cs new file mode 100644 index 0000000000..99cf3df95b --- /dev/null +++ b/Utilities/HitModiferUtils.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.WorldBuilding; + +namespace CalamityMod.Utilities +{ + internal static class HitModiferUtils + { + extension(ref NPC.HitModifiers modifiers) + { + internal void ApplyScalingForcedCrit(Projectile Projectile) + { + modifiers.SetCrit(); + float critDamage = Main.player[Projectile.owner].GetTotalCritChance(Projectile.DamageType) * 0.02f; + modifiers.CritDamage += critDamage; + } + } + } +} diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 4efddb7d89..7ad793f3ad 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -128,6 +128,7 @@ namespace CalamityMod public static Color ElectricDebuffColor => new(255, 245, 0); public static Color BuffColor => new(255, 105, 237); public static Color TypelessDebuffColor => new(230, 202, 250); + public static Color GodSlayerInfernoColor => new(241, 107, 250); public static Color VulnHexDebuffColor => new(196, 35, 43); public static Color MiracleBlightDebuffColor => Main.DiscoColor; public static Color SmashedEvilDebuffColor => Color.Lerp(new Color(162, 88, 231), new Color(221, 66, 97), MathHelper.SmoothStep(0, 1, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) * 0.5f)); @@ -138,6 +139,7 @@ namespace CalamityMod { var color = TypelessDebuffColor; + // God Slayer Inferno, Vulnerability Hex, and Miracle Blight receive special colors if (debuffId == ModContent.BuffType() || debuffId == ModContent.BuffType()) { color = Color.Lerp(VulnHexDebuffColor, FireDebuffColor, (MathF.Sin(Main.GlobalTimeWrappedHourly * 2) + 1) / 4f); @@ -146,11 +148,18 @@ namespace CalamityMod { color = MiracleBlightDebuffColor; } - + else if (debuffId == ModContent.BuffType()) + { + color = GodSlayerInfernoColor; + } else if (debuffId == ModContent.BuffType() && CalamityClientConfig.Instance.TextEffects) { color = SmashedEvilDebuffColor; } + + // Color debuffs based on their element type in the vulnerability and resistance system + // If a debuff has multiple types, the colors are mixed + // If a debuff is typeless, is gets the typeless color else if (BuffDatasets.DebuffDataset[debuffId] is not null) { if (!debuffColorWeightsCache.TryGetValue(debuffId, out var weights)) @@ -187,6 +196,9 @@ namespace CalamityMod color = new Color(normalColor); } } + // If this is actually a beneficial buff, color it as so + else if (!Main.debuff[debuffId]) + color = BuffColor; return color; } diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 10132d352e..f65c49f08d 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -91,12 +91,14 @@ namespace CalamityMod public static string ToMphps(this float velocity) => Round(velocity * 60f * 216000f / 42240f, "N2"); public static string ToTiles(this float pixel) => Round(pixel / 16f); - public static string ToRegenPerSecond(this int regen) => Round(regen * 0.5f, "N2"); + public static string ToRegenPerSecond(this float partialRegen) => Round(partialRegen * 0.5f, "N2"); + public static string ToRegenPerSecond(this int regen, float partialRegen = 0f) => Round((regen + partialRegen) * 0.5f, "N2"); public static string ToJumpSpeedPercent(this float boost) => Round(boost * 20f, "N2"); public static string ToStealth(this float stealth) => Round(stealth * 100f, "N0"); public static string GetChanceFromDenominator(this int denominator) => ToPercent(1 / (float)denominator); + public static string ToPercent(this int percent) => (percent * 100).ToString(); public static string ToPercent(this float percent, string precision = "N1") => Round(percent * 100f, precision); public static string ToPercent(this double percent, string precision = "N1") => Round(percent * 100D, precision); // Double-rounded for proper digit cutoffs diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index bc6f2278bd..aacef829b0 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -136,7 +136,7 @@ namespace CalamityMod #region Standard Enemy Immunity Sets private static readonly int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned }; - private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, ModContent.BuffType() }; + private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, BuffID.Frozen }; private static readonly int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType(), ModContent.BuffType() }; private static readonly int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; private static readonly int[] abyssEnemyImmunities = new int[2] { ModContent.BuffType(), ModContent.BuffType() }; diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index c360a2d7ea..9b41cd6be3 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,12 +1,18 @@ using System; +using System; +using System.Collections.Generic; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Reflection; +using CalamityMod.Balancing; using CalamityMod.Balancing; using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -16,17 +22,22 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.Yharon; using CalamityMod.Packets; using CalamityMod.Systems.Collections; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.ID; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; using static Terraria.ModLoader.ModContent; namespace CalamityMod @@ -732,14 +743,11 @@ namespace CalamityMod ///
/// The NPC attacked. /// Whether or not the NPC can be moved around. - public static bool CanBeMoved(this NPC target, bool ignoreKBImmune = false) + public static bool CanBeMoved(this NPC target) { - // Ideally we can replace [!CalamityPlayer.areThereAnyDamnBosses] with a check for problematic boss minions so that you can knock back regular ones in bossfights. - // For now at least, when a boss is alive it will always fail to knockback enemies with 100% kb resist. - if (CalamityPlayer.areThereAnyDamnBosses) - ignoreKBImmune = false; - bool isAPillar = target.type == NPCID.LunarTowerSolar || target.type == NPCID.LunarTowerVortex || target.type == NPCID.LunarTowerNebula || target.type == NPCID.LunarTowerStardust; - if (!isAPillar && !target.boss && target.IsAnEnemy(true, true, false) && (ignoreKBImmune || target.knockBackResist > 0)) + bool whitelisted = CalamityHeavyKnockbackWhitelist.whitelistNPC.Contains(target.type); + + if ((target.knockBackResist != 0 || whitelisted) && target.IsAnEnemy(true, true, false)) return true; return false; } @@ -748,13 +756,14 @@ namespace CalamityMod ///
/// The NPC being moved. /// Whether or not NPC's that normally have knockback immunity can be moved around. - public static void MoveNPC(this NPC target, Vector2 direction, float strength, bool ignoreKBImmune = false) + public static void MoveNPC(this NPC target, Vector2 direction, float strength, bool heavyKnockback = false, Player attacker = null) { - if (target.CanBeMoved(ignoreKBImmune)) + if (target.CanBeMoved()) { Vector2 launchVel = direction.SafeNormalize(Vector2.UnitX) * strength; - float knockbackMult = Utils.Remap(target.knockBackResist, 0, 1, 0.5f, 1f, false); - target.velocity = launchVel * (knockbackMult > 1 ? (float)Math.Pow(knockbackMult, 10) : knockbackMult); + float playerKnockbackMult = 1; // Xyk 19MARCH2026: If we ever make knockback a real stat, it can go here. It's much too messy right now to work with, but at least the player is already supported. + float knockbackMult = playerKnockbackMult * (heavyKnockback ? Math.Max(target.knockBackResist, 1) : target.knockBackResist); // Heavy knockback ignores knockback resist (but not knockback weakness) + target.velocity = launchVel * knockbackMult; target.SyncMotionToServer(); } } diff --git a/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; diff --git a/World/ShimmerShrine.cs b/World/ShimmerShrine.cs index 7beb14fd6c..67220466ef 100644 --- a/World/ShimmerShrine.cs +++ b/World/ShimmerShrine.cs @@ -20,6 +20,23 @@ namespace CalamityMod.World int placementPositionY = (int)Main.worldSurface - 300; int offset = 28; + int width = schematic.GetLength(0); + int height = schematic.GetLength(1); + // If the point directly above the shimmer is blocked by something, try to move to the side a bit + if (!structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + { + int attempts = 0; + while (attempts < 1000) + { + attempts++; + placementPositionX = Main.rand.Next((int)GenVars.shimmerPosition.X - 100, (int)GenVars.shimmerPosition.X + 100); + if (structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + break; + } + // If still not good, just give up and place it directly above the shimmer regardless + placementPositionX = (int)GenVars.shimmerPosition.X; + } + while (!Main.tile[placementPositionX, placementPositionY].HasTile) placementPositionY++;