Nebula armor mana boosters are now controlled by balance constants. Halved mana regen.

This commit is contained in:
Ozzatron committed 2024-02-18 02:05:40 -05:00
1 parent 1c7f26d98e
commit afeb293706
3 files changed
+32 -1

No files matched your search

+13 -1
View File
@@ -92,7 +92,7 @@
internal static readonly float MovingStealthGenRatio = 0.5f;
#endregion
#region Defense and Health
#region Defense, Health and Mana (Armor set stuff)
// Beetle Shell's multiplicative DR is removed by Calamity. In compensation, you get this much regular DR per beetle.
internal static readonly float BeetleShellDRPerBeetle = 0.1f;
@@ -101,6 +101,18 @@
// Nebula Armor Life Regen
internal static readonly int NebulaLifeRegenPerBooster = 4; // 6 in vanilla
// Nebula Armor Mana Regen
// This value works differently than you might expect. Raising it actually nerfs the mana regeneration of Nebula Armor
// Every frame, Terraria adds 1 to a counter for each Mana Booster the player has.
// If this counter reaches the below threshold, that player gains 1 mana.
// By default, it's 6, which has the following effects:
// 1 booster = +1 mana every 6 frames = +10 mana per second
// 2 boosters = +1 mana every 3 frames = +20 mana per second
// 3 boosters = +1 mana every 2 frames = +30 mana per second
//
// Calamity just halves this, that's probably good enough.
internal static readonly int NebulaManaRegenFrameCounterThreshold = 12; // 6 in vanilla
#endregion
#region Defense Damage
+18
View File
@@ -509,6 +509,24 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.Pop);
cursor.Emit(OpCodes.Ldc_I4_0);
}
private static void NerfNebulaArmorManaRegen(ILContext il)
{
// Reduce Nebula armor mana regen.
// The regen is controlled by a frame counter threshold right at the top of the function, typically 6.
// 1 value is added to the counter for every Mana Booster you have.
// If the value reaches the threshold, you gain 1 mana.
// All that needs to be done is raising the threshold, so it takes more frames to get each point of mana.
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(6)))
{
LogFailure("Nebula Armor Mana Regen Nerf", "Could not locate the Nebula Armor mana regeneration frame counter threshold.");
return;
}
// Swap the threshold with Calamity's value.
cursor.Next.Operand = BalancingConstants.NebulaManaRegenFrameCounterThreshold;
}
#endregion
#region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR
+1
View File
@@ -114,6 +114,7 @@ namespace CalamityMod.ILEditing
// Mana regen balance
IL_Player.Update += ManaRegenDelayAdjustment;
IL_Player.UpdateManaRegen += ManaRegenAdjustment;
IL_Player.UpdateManaRegen += NerfNebulaArmorManaRegen;
// Debuff balancing
IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes;