From 86d61674035d6220587bb416ce0389b1a84eded4 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 21 Nov 2025 23:08:55 -0500 Subject: [PATCH] Pharaoh's set returns to pyramids --- ILEditing/ILChangesLoading.cs | 1 - ILEditing/WorldgenILChanges.cs | 22 ---------------------- Utilities/CalamityRecipes.cs | 21 --------------------- 3 files changed, 44 deletions(-) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index e358b4cc5f..a3a7a237e2 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -126,7 +126,6 @@ namespace CalamityMod.ILEditing IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes; // World generation - IL_WorldGen.Pyramid += ReplacePharaohSetInPyramids; IL_WorldGen.GrowLivingTree += BlockLivingTreesNearOcean; On_WorldGen.SmashAltar += PreventSmashAltarCode; IL_WorldGen.hardUpdateWorld += AdjustChlorophyteSpawnRate; diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index 67f4682353..a3e56d9c07 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -33,28 +33,6 @@ namespace CalamityMod.ILEditing set; } - #region Replacement of Pharaoh Set in Pyramids - // Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works. - // The other Pharaoh vanity piece is added automatically if the mask is found in the chest. - private static void ReplacePharaohSetInPyramids(ILContext il) - { - var cursor = new ILCursor(il); - - // Find the instruction which loads in the item ID of the Pharaoh's Mask. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(ItemID.PharaohsMask))) - { - LogFailure("Pharaoh Set Pyramid Replacement", "Could not locate the Pharaoh's Mask item ID."); - return; - } - - // Replace the Pharaoh's Mask with the Amber Hook. - // THIS INT CAST IS MANDATORY. DO NOT REMOVE IT. - // In TML's DLL, despite item IDs being shorts (16 bits), the hardcoded 848 here is a 32-bit integer literal. - // As such, it must be replaced with a 32-bit integer literal or the branches of the switch will misalign and the IL edit fails. - cursor.Next.Operand = (int)ItemID.AmberHook; - } - #endregion Replacement of Pharaoh Set in Pyramids - #region Fixing of Living Tree/Sulphurous Sea Interactions private static void BlockLivingTreesNearOcean(ILContext il) { diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 85c3c4dda1..13e8b2696f 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -1747,19 +1747,6 @@ namespace CalamityMod r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); - - // Pharaoh set - r = Recipe.Create(ItemID.PharaohsMask); - r.AddIngredient(ItemID.AncientCloth, 3); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.PharaohsRobe); - r.AddIngredient(ItemID.AncientCloth, 4); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); } #endregion @@ -2004,14 +1991,6 @@ namespace CalamityMod int[] convert = ItemID.Sets.ShimmerTransformToItem; InsertShimmerResult(ModContent.ItemType(), ItemID.SummonerEmblem); - - // Pyramid loot edits. There's no good way to have this not be hardcoded. - convert[ItemID.PharaohsMask] = ItemID.PharaohsRobe; - convert[ItemID.PharaohsRobe] = ItemID.PharaohsMask; - - convert[ItemID.AmberHook] = ItemID.SandstorminaBottle; - convert[ItemID.SandstorminaBottle] = ItemID.FlyingCarpet; - convert[ItemID.FlyingCarpet] = ItemID.AmberHook; } #endregion