diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 488e6f404a..43aae96117 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -531,6 +531,7 @@ namespace CalamityMod.CalPlayer public int ascendantInsigniaCooldown = 0; public bool ascendantTrail = false; public bool frozenWingsCold = false; + public bool flameWingsHeat = false; public bool magmaStoneVisuals = true; public bool eGauntlet = false; public bool eGauntletVisuals = true; // Used to control dust spawned when swinging @@ -1786,6 +1787,7 @@ namespace CalamityMod.CalPlayer ascendantInsignia = false; ascendantTrail = false; frozenWingsCold = false; + flameWingsHeat = false; magmaStoneVisuals = true; eGauntlet = false; eGauntletVisuals = true; diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs index 4d2791a158..224a409e07 100644 --- a/CalPlayer/CalamityPlayerDashEffects.cs +++ b/CalPlayer/CalamityPlayerDashEffects.cs @@ -142,7 +142,8 @@ namespace CalamityMod.CalPlayer if (HasCustomDash) { - Player.vortexStealthActive = false; + if (Player.wingsLogic != (int)VanillaWingID.WingsVortex) + Player.vortexStealthActive = false; // Decide the player's facing direction. if (Player.velocity.X != 0f) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index cc2eb87e58..e64f6a2859 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -422,6 +422,21 @@ namespace CalamityMod.CalPlayer else HasReducedDashFirstFrame = false; } + + // Solar Wings increase dash velocity of Solar Flare armor dash + if (Player.wingsLogic == (int)VanillaWingID.WingsSolar) + { + if (Player.dashDelay == -1 && Player.dash == 3) + { + if (!HasReducedDashFirstFrame) + { + Player.velocity.X *= 1.3f; + HasReducedDashFirstFrame = true; + } + } + else + HasReducedDashFirstFrame = false; + } } #endregion diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 53b6a23602..3f38b9a195 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -80,6 +80,7 @@ namespace CalamityMod.CalPlayer target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll; target.Calamity().IncreasedHeatEffects_FlameWakerBoots = flameWakerBoots; target.Calamity().IncreasedHeatEffects_HellfireTreads = hellfireTreads; + target.Calamity().IncreasedHeatEffects_FlameWings = flameWingsHeat; target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart; @@ -183,6 +184,7 @@ namespace CalamityMod.CalPlayer cgn.IncreasedHeatEffects_Fireball = fireball; cgn.IncreasedHeatEffects_CinnamonRoll = cinnamonRoll; cgn.IncreasedHeatEffects_HellfireTreads = hellfireTreads; + cgn.IncreasedHeatEffects_FlameWings = flameWingsHeat; cgn.IncreasedSicknessEffects_ToxicHeart = toxicHeart; diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 3162a2dc91..28c43cb7d7 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Balancing; +using CalamityMod.Enums; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -437,7 +438,7 @@ namespace CalamityMod.ILEditing #endregion #region Damage Variance Dampening and Luck Removal - private static int AdjustDamageVariance(Terraria.On_Main.orig_DamageVar_float_int_float orig, float dmg, int percent, float luck) + private static int AdjustDamageVariance(On_Main.orig_DamageVar_float_int_float orig, float dmg, int percent, float luck) { // Change the default damage variance from +-15% to +-5%. // If other mods decide to change the scale, they can override this. We're solely killing the default value. @@ -566,6 +567,21 @@ namespace CalamityMod.ILEditing } #endregion + #region Vortex Booster Keeps Vortex Stealth When Dashing + private static void VortexBoosterKeepsVortexStealthWhenDashing(On_Player.orig_DashMovement orig, Player self) + { + // Allows for Vortex Booster to keep Vortex armor's stealth when dashing + bool vortexStealth = self.vortexStealthActive; + orig(self); + + if (self.wingsLogic == (int)VanillaWingID.WingsVortex) + { + if (vortexStealth && !self.vortexStealthActive) + self.vortexStealthActive = true; + } + } + #endregion + #region Nebula Armor Nerfs private static void NerfNebulaArmorBaseLifeRegenAndDamage(ILContext il) { @@ -645,6 +661,54 @@ namespace CalamityMod.ILEditing } #endregion + #region Stardust Guardian Buffs + private static void StardustGuardianAttackBuffs(ILContext il) + { + // Increase the Stardust Guardian's attack range while wearing Stardust Wings. + var cursor = new ILCursor(il); + + // Move to the label after the instruction that sets num3 to 500f. + for (int i = 0; i < 2; i++) + { + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(100f))) + { + LogFailure("Stardust Guardian Buffs", "Could not move to after the Stardust Guardian's attack range."); + return; + } + } + + // Define a label for the branch statement. + var label = il.DefineLabel(); + + // Load Player.wingsLogic, and check if it's Stardust Wings. + // If it is, increase the two attack range variables. + cursor.Emit(OpCodes.Ldloc_0); + cursor.Emit(OpCodes.Ldfld, typeof(Player).GetField("wingsLogic")); + cursor.Emit(OpCodes.Ldc_I4, (int)VanillaWingID.WingsStardust); + cursor.Emit(OpCodes.Bne_Un, label); + + cursor.Emit(OpCodes.Ldc_R4, 900f); + cursor.Emit(OpCodes.Stloc, 4); + cursor.Emit(OpCodes.Ldc_R4, 900f); + cursor.Emit(OpCodes.Stloc, 5); + + cursor.MarkLabel(label); + + // Now, increase the Stardust Guardian's move speed when attacking targets. + // This is applied regardless of having Stardust Wings. + // This jumps to the base speed value when moving towards a target. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcR4(6f))) + { + LogFailure("Stardust Guardian Buffs", "Could not locate the Stardust Guardian's attack move speed."); + return; + } + + // Remove and replace with a higher value. + cursor.EmitPop(); + cursor.Emit(OpCodes.Ldc_R4, 12f); + } + #endregion + #region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR private static void RemoveBeetleAndSolarFlareMultiplicativeDR(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 96389529c5..e40c1c10e1 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -70,6 +70,7 @@ namespace CalamityMod.ILEditing IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; IL_Player.DashMovement += FixAllDashMechanics; + On_Player.DashMovement += VortexBoosterKeepsVortexStealthWhenDashing; On_Player.DoCommonDashHandle += ApplyDashKeybind; IL_Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent; IL_Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety; @@ -144,6 +145,7 @@ namespace CalamityMod.ILEditing IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; IL_Projectile.Damage += ReduceEoWGrenadeResist; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; + IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs; IL_Player.UpdateBuffs += NerfSharpeningStation; IL_Player.UpdateBuffs += NerfBeetleScaleMail; IL_Player.UpdateBuffs += NerfNebulaArmorBaseLifeRegenAndDamage; diff --git a/Items/Accessories/Wings/ExodusWings.cs b/Items/Accessories/Wings/ExodusWings.cs index bb3548b316..1ef78be503 100644 --- a/Items/Accessories/Wings/ExodusWings.cs +++ b/Items/Accessories/Wings/ExodusWings.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Materials; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -33,8 +34,8 @@ namespace CalamityMod.Items.Accessories.Wings { if (player.armor[0].type == ModContent.ItemType() && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; + player.AddBuff(ModContent.BuffType(), 2); + player.AddBuff(ModContent.BuffType(), 2); } if (player.wingTime > 0f && player.jump == 0 && player.velocity.Y != 0f && !hideVisual) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 8b1f41a067..77d901c8e9 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1416,18 +1416,12 @@ namespace CalamityMod.Items else if (item.type == ItemID.FrozenWings) // Bonus to melee and ranged stats while wearing frost armor { player.noFallDmg = true; - if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings) - { - player.GetDamage() += 0.04f; - player.GetDamage() += 0.04f; - player.Calamity().frozenWingsCold = true; - } + player.Calamity().frozenWingsCold = true; } else if (item.type == ItemID.FlameWings) // Bonus to melee stats { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; player.noFallDmg = true; + player.Calamity().flameWingsHeat = true; } else if (item.type == ItemID.GhostWings) // Bonus to mage stats while wearing spectre armor { @@ -1535,41 +1529,6 @@ namespace CalamityMod.Items player.moveSpeed += 0.1f; player.noFallDmg = true; } - else if (item.type == ItemID.WingsSolar) // Bonus to melee stats while wearing solar flare armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.SolarFlareHelmet && player.body == ArmorIDs.Body.SolarFlareBreastplate && player.legs == ArmorIDs.Legs.SolarFlareLeggings) - { - player.GetDamage() += 0.07f; - player.GetCritChance() += 3; - } - } - else if (item.type == ItemID.WingsVortex) // Bonus to ranged stats while wearing vortex armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.VortexHelmet && player.body == ArmorIDs.Body.VortexBreastplate && player.legs == ArmorIDs.Legs.VortexLeggings) - { - player.GetDamage() += 0.03f; - player.GetCritChance() += 7; - } - } - else if (item.type == ItemID.WingsNebula) // Bonus to magic stats while wearing nebula armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.NebulaHelmet && player.body == ArmorIDs.Body.NebulaBreastplate && player.legs == ArmorIDs.Legs.NebulaLeggings) - { - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; - player.statManaMax2 += 20; - player.manaCost *= 0.95f; - } - } - else if (item.type == ItemID.WingsStardust) // Bonus to summon stats while wearing stardust armor - { - player.noFallDmg = true; - if (player.head == ArmorIDs.Head.StardustHelmet && player.body == ArmorIDs.Body.StardustPlate && player.legs == ArmorIDs.Legs.StardustLeggings) - player.GetDamage() += 0.1f; - } else if (item.type == ItemID.FishronWings || item.type == ItemID.BetsyWings || item.type == ItemID.Yoraiz0rWings || item.type == ItemID.JimsWings || item.type == ItemID.SkiphsWings || item.type == ItemID.LokisWings || item.type == ItemID.ArkhalisWings || item.type == ItemID.LeinforsWings || item.type == ItemID.BejeweledValkyrieWing || @@ -1633,6 +1592,10 @@ namespace CalamityMod.Items // For reference, Treasure Magnet adds 150 (2.625 + 9.375 = 12 tiles) if (player.Calamity().reaverExplore) grabRange += 246; + + // Nebula boosters have greater pickup range while using Nebula Mantle. + if (player.wingsLogic == (int)VanillaWingID.WingsNebula && ItemID.Sets.NebulaPickup[item.type]) + grabRange *= 2; } #endregion diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 378bbfd827..5fe2387308 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1256,11 +1256,10 @@ namespace CalamityMod.Items AddWingStats(7.5f, 1f, 1, 240, "Halves flight time when taking a hit"); if (item.type == ItemID.FlameWings) - AddWingStats(7.5f, 1f, 1, 160, "5% increased melee damage and critical strike chance"); + AddWingStats(7.5f, 1f, 1, 160, "Multiplies all heat debuff damage by 1.25x"); if (item.type == ItemID.FrozenWings) - AddWingStats(6.75f, 1f, 1, 130, "4% increased melee and ranged damage\n" + - "and multiplies all cold debuff damage by 1.25x while wearing Frost armor"); + AddWingStats(6.75f, 1f, 1, 130, "Multiplies all cold debuff damage by 1.25x"); if (item.type == ItemID.GhostWings) AddWingStats(7.5f, 1f, 1, 170, "+10 defense and 5% increased damage reduction while wearing the Spectre Hood set\n" + @@ -1315,19 +1314,16 @@ namespace CalamityMod.Items AddWingStats(7.5f, 1f, 1, 170, "+5 defense and 5% increased damage"); if (item.type == ItemID.WingsSolar) - AddWingStats(9f, 2.5f, 3, 180, "7% increased melee damage and 3% increased melee critical strike chance\n" + - "while wearing the Solar Flare Armor"); + AddWingStats(9f, 2.5f, 3, 180, "Increases Solar Flare armor's dash velocity by 30%"); if (item.type == ItemID.WingsStardust) - AddWingStats(9f, 2.5f, 3, 180, "10% increased minion damage while wearing the Stardust Armor"); + AddWingStats(9f, 2.5f, 3, 180, "Greatly increases Stardust armor's stardust guardian damage and attack range"); if (item.type == ItemID.WingsVortex) - AddWingStats(6.5f, 1.5f, 2, 180, "3% increased ranged damage and 7% increased ranged critical strike chance\n" + - "while wearing the Vortex Armor"); + AddWingStats(6.5f, 1.5f, 2, 180, "Prevents dashes from disabling Vortex armor's stealth ability"); if (item.type == ItemID.WingsNebula) - AddWingStats(6.5f, 1.5f, 2, 180, "+20 max mana, 5% increased magic damage and critical strike chance,\n" + - "and 5% decreased mana usage while wearing the Nebula Armor"); + AddWingStats(6.5f, 1.5f, 2, 180, "Increases the pickup range of Nebula armor's nebula boosters"); // Betsy's Wings (and dev wings) are the only wings without "Allows flight and free fall" if (item.type == ItemID.BetsyWings) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 9c5d7534b1..788d21752c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -43,7 +43,7 @@ ExodusWings: { Acceleration multiplier: 2.5 Great vertical speed Flight time: 180 - 5% increased rogue damage and critical strike chance while wearing the Empyrean Armor + Grants permanent Empyrean Wrath and Empyrean Rage while wearing the Empyrean armor Pulsing with an alien heartbeat ''' } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 6ba55e4b2d..2f06741f2e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -153,6 +153,7 @@ namespace CalamityMod.NPCs public bool IncreasedHeatEffects_CinnamonRoll = false; public bool IncreasedHeatEffects_FlameWakerBoots = false; public bool IncreasedHeatEffects_HellfireTreads = false; + public bool IncreasedHeatEffects_FlameWings = false; // Toxic Heart effect public bool IncreasedSicknessEffects_ToxicHeart = false; @@ -454,6 +455,7 @@ namespace CalamityMod.NPCs myClone.IncreasedHeatEffects_CinnamonRoll = IncreasedHeatEffects_CinnamonRoll; myClone.IncreasedHeatEffects_FlameWakerBoots = IncreasedHeatEffects_FlameWakerBoots; myClone.IncreasedHeatEffects_HellfireTreads = IncreasedHeatEffects_HellfireTreads; + myClone.IncreasedHeatEffects_FlameWings = IncreasedHeatEffects_FlameWings; myClone.IncreasedSicknessEffects_ToxicHeart = IncreasedSicknessEffects_ToxicHeart; myClone.IncreasedSicknessAndWaterEffects_EvergreenGin = IncreasedSicknessAndWaterEffects_EvergreenGin; @@ -867,6 +869,8 @@ namespace CalamityMod.NPCs heatDamageMult += 0.5; if (IncreasedHeatEffects_HellfireTreads) heatDamageMult += 0.5; + if (IncreasedHeatEffects_FlameWings) + heatDamageMult += 0.25; if (IncreasedSicknessEffects_ToxicHeart) sicknessDamageMult += 0.5; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index f1da03dc6d..da6acb39cd 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.EntitySources; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; @@ -4198,6 +4199,10 @@ namespace CalamityMod.Projectiles modifiers.SourceDamage *= calamityVelocityDamageMultiplier / vanillaVelocityDamageMultiplier; } + // Stardust Wings buff the Stardust Guardian's damage. + if (player.wingsLogic == (int)VanillaWingID.WingsStardust && projectile.type == ProjectileID.StardustGuardian) + modifiers.SourceDamage *= 3f; + // If applicable, use ricoshot bonus damage. if (totalRicoshotDamageBonus > 0f) modifiers.ScalingBonusDamage += totalRicoshotDamageBonus;