1 - Nerfed Magic Power to 10% damage.

2 - Nerfed Magic Hat to 5% damage and crit.
3 - Nerfed Wizard Hat to 5% damage.
4 - Mana Regen and Mana Regen Delay IL Edits.
This commit is contained in:
Andrew Marheine committed 2021-10-22 05:46:57 -05:00
1 parent 7e4ccf5d4b
commit 78018d1876
4 files changed
+92 -9

No files matched your search

+10 -2
View File
@@ -11,7 +11,11 @@ namespace CalamityMod.Buffs
{
public override void Update(int type, Player player, ref int buffIndex)
{
if (type == BuffID.Panic)
if (type == BuffID.MagicPower)
{
player.magicDamage -= 0.1f;
}
else if (type == BuffID.Panic)
{
player.moveSpeed -= 0.5f;
}
@@ -85,9 +89,13 @@ namespace CalamityMod.Buffs
{
Player player = Main.player[Main.myPlayer];
//Vanilla buffs
// Vanilla buffs
switch (type)
{
case BuffID.MagicPower:
tip = "10% increased magic damage";
break;
case BuffID.Archery:
tip = "20% increased arrow speed and 1.05x arrow damage";
break;
+59 -6
View File
@@ -147,6 +147,10 @@ namespace CalamityMod.ILEditing
IL.Terraria.Player.Update += RunSpeedAdjustments;
IL.Terraria.Player.Update += ReduceWingHoverVelocities;
// Mana regen balance
IL.Terraria.Player.Update += ManaRegenDelayAdjustment;
IL.Terraria.Player.UpdateManaRegen += ManaRegenAdjustment;
// World generation
IL.Terraria.WorldGen.Pyramid += ReplacePharaohSetInPyramids;
IL.Terraria.WorldGen.MakeDungeon += PreventDungeonHorizontalCollisions;
@@ -205,8 +209,12 @@ namespace CalamityMod.ILEditing
IL.Terraria.Player.Update -= RunSpeedAdjustments;
IL.Terraria.Player.Update -= ReduceWingHoverVelocities;
// World generation
IL.Terraria.WorldGen.Pyramid -= ReplacePharaohSetInPyramids;
// Mana regen balance
IL.Terraria.Player.Update -= ManaRegenDelayAdjustment;
IL.Terraria.Player.UpdateManaRegen -= ManaRegenAdjustment;
// World generation
IL.Terraria.WorldGen.Pyramid -= ReplacePharaohSetInPyramids;
IL.Terraria.WorldGen.MakeDungeon -= PreventDungeonHorizontalCollisions;
IL.Terraria.WorldGen.DungeonHalls -= PreventDungeonHallCollisions;
IL.Terraria.WorldGen.GrowLivingTree -= BlockLivingTreesNearOcean;
@@ -882,12 +890,57 @@ namespace CalamityMod.ILEditing
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 10.8f); // Reduce by 10%.
}
#endregion
#endregion
#region World generation
#region Mana regen balance
private static void ManaRegenDelayAdjustment(ILContext il)
{
// Decrease the max mana regen delay so that mage is less annoying to play without mana regen buffs.
// Decreases the max mana regen delay from a range of 31.5 - 199.5 to 4 - 52.
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(45f))) // The flat amount added to max regen delay in the formula.
{
LogFailure("Max Mana Regen Delay Reduction", "Could not locate the max mana regen flat variable.");
return;
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 20f); // Decrease to 20f.
// Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works.
private static void ReplacePharaohSetInPyramids(ILContext il)
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.7f))) // The multiplier for max mana regen delay.
{
LogFailure("Max Mana Regen Delay Reduction", "Could not locate the max mana regen delay multiplier variable.");
return;
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 0.2f); // Decrease to 0.2f.
}
private static void ManaRegenAdjustment(ILContext il)
{
// Increase the base mana regen so that mage is less annoying to play without mana regen buffs.
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.8f))) // The multiplier for the mana regen formula: (float)statMana / (float)statManaMax2 * 0.8f + 0.2f.
{
LogFailure("Mana Regen Buff", "Could not locate the mana regen multiplier variable.");
return;
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 0.25f); // Decrease to 0.25f.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.2f))) // The flat added mana regen amount.
{
LogFailure("Mana Regen Buff", "Could not locate the flat mana regen variable.");
return;
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_R4, 0.75f); // Increase to 0.75f.
}
#endregion
#region World generation
// Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works.
private static void ReplacePharaohSetInPyramids(ILContext il)
{
var cursor = new ILCursor(il);
+10 -1
View File
@@ -1007,7 +1007,7 @@ namespace CalamityMod.Items
}
#endregion
#region SavingAndLoading
#region Saving And Loading
public override bool NeedsSaving(Item item)
{
return rogue || canFirePointBlankShots || trueMelee || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0;
@@ -1665,6 +1665,15 @@ namespace CalamityMod.Items
{
switch (item.type)
{
case ItemID.MagicHat:
player.magicDamage -= 0.02f;
player.magicCrit -= 2;
break;
case ItemID.WizardHat:
player.magicDamage -= 0.1f;
break;
case ItemID.GladiatorHelmet:
case ItemID.ObsidianHelm:
player.Calamity().throwingDamage += 0.03f;
+13
View File
@@ -493,6 +493,19 @@ namespace CalamityMod.Items
// Rebalances to vanilla item stats
#region Vanilla Item Rebalance Tooltips
// Magic Power Potion nerf
if (item.type == ItemID.MagicPowerPotion)
EditTooltipByNum(0, (line) => line.text = "10% increased magic damage");
// Magic and Wizard Hat nerfs
// Magic Hat
if (item.type == ItemID.MagicHat)
EditTooltipByNum(0, (line) => line.text = "5% increased magic damage and critical strike chance");
// Wizard Hat
if (item.type == ItemID.WizardHat)
EditTooltipByNum(0, (line) => line.text = "5% increased magic damage");
// Reduce DD2 armor piece bonuses because they're overpowered
// Squire armor
if (item.type == ItemID.SquirePlating)