Return of Pharaoh's Set

This commit is contained in:
Altixal committed 2025-07-13 00:35:15 +07:00
1 parent 33ba2ed27a
commit dda66c2b57
3 files changed
-44

No files matched your search

-1
View File
@@ -171,7 +171,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;
-22
View File
@@ -34,28 +34,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)
{
-21
View File
@@ -956,14 +956,6 @@ namespace CalamityMod.Systems
convert[ItemID.LifeformAnalyzer] = ItemID.Stopwatch;
convert[ItemID.Stopwatch] = ItemID.DPSMeter;
// 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;
// Enchanted Sword and Terragrim shimmer into each other
convert[ItemID.EnchantedSword] = ItemID.Terragrim;
convert[ItemID.Terragrim] = ItemID.EnchantedSword;
@@ -1608,19 +1600,6 @@ namespace CalamityMod.Systems
r.AddTile(TileID.Loom);
r.Register();
r.DisableDecraft();
// Pharaoh set (replaced Chest items)
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