Pharaoh's set returns to pyramids
This commit is contained in:
1 parent
b8bfef18ce
commit
86d6167403
3 files changed
-44
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<RogueEmblem>(), 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
|
||||
|
||||
|
||||
Reference in new issue
Block a user