1 - Blood Moons now require 200 max life to occur.

This commit is contained in:
Andrew Marheine committed 2021-12-17 16:58:32 -06:00
1 parent 595e4d233e
commit ba3fdebc42
1 file changed
+15
+15
View File
@@ -182,6 +182,7 @@ namespace CalamityMod.ILEditing
On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
IL.Terraria.NPC.SpawnNPC += MakeVoodooDemonDollWork;
IL.Terraria.NPC.VanillaHitEffect += RemoveLavaDropsFromExpertLavaSlimes;
IL.Terraria.Main.UpdateTime += BloodMoonsRequire200MaxLife;
// Fix vanilla bugs exposed by Calamity mechanics
On.Terraria.Main.InitLifeBytes += BossRushLifeBytes;
@@ -255,6 +256,7 @@ namespace CalamityMod.ILEditing
On.Terraria.NPC.SlimeRainSpawns -= PreventBossSlimeRainSpawns;
IL.Terraria.NPC.SpawnNPC -= MakeVoodooDemonDollWork;
IL.Terraria.NPC.VanillaHitEffect -= RemoveLavaDropsFromExpertLavaSlimes;
IL.Terraria.Main.UpdateTime -= BloodMoonsRequire200MaxLife;
// Fix vanilla bugs exposed by Calamity mechanics
On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes;
@@ -1489,6 +1491,19 @@ namespace CalamityMod.ILEditing
cursor.Remove();
cursor.Emit(OpCodes.Ldc_I4, 0); // Change to an impossible scenario.
}
private static void BloodMoonsRequire200MaxLife(ILContext il)
{
// Blood Moons only happen when the player has over 200 max life.
var cursor = new ILCursor(il);
if (!cursor.TryGotoPrev(MoveType.Before, i => i.MatchLdcI4(120))) // The 120 max life check.
{
LogFailure("Make Blood Moons Require 200 Max Life", "Could not locate the max life variable.");
return;
}
cursor.Remove();
cursor.Emit(OpCodes.Ldc_I4, 200); // Change to 200.
}
#endregion
#region Vanilla bugs exposed by Calamity mechanics