From 433f7d3a080243cc0bd739e511dffe99162a63bc Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Sat, 5 Aug 2023 18:51:34 -0600 Subject: [PATCH] Gfb: Chests have a chance to be trapped with gas; Evil, Surface and Mushroom which are guaranteed to be trapped. Some chests have extra stuff that can generate instead of a trap --- World/UndergroundShrines.cs | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index 5a114cc858..0393134fab 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -76,6 +76,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(evil, 1), new ChestItem(ItemID.RedPotion, WorldGen.genRand.Next(1, 2 + 1)), + new ChestItem(ItemID.GasTrap,1), }; } @@ -166,6 +167,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(2, 2 + 1)), new ChestItem(ItemID.RedPotion, WorldGen.genRand.Next(1, 2 + 1)), + new ChestItem(ItemID.GasTrap, 1), }; } @@ -246,7 +248,7 @@ namespace CalamityMod.World }; if (Main.zenithWorld) { - int golfClub = Utils.SelectRandom(WorldGen.genRand, ItemID.GolfClubBronzeWedge, ItemID.GolfClubWedge); + int golfClub = Utils.SelectRandom(WorldGen.genRand, ItemID.GolfClubBronzeWedge, ItemID.GolfClubWedge, ItemID.GasTrap); contents = new List() { new ChestItem(ModContent.ItemType(), 1), @@ -255,8 +257,8 @@ namespace CalamityMod.World new ChestItem(ItemID.DesertTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ModContent.ItemType(), 1), - new ChestItem(golfClub, 1), //Implying that the golfer messed with the loot but forgot this new ChestItem(ItemID.RedPotion, WorldGen.genRand.Next(1, 2 + 1)), + new ChestItem(golfClub, 1), //Implying that the golfer messed with the loot but forgot this, OR its trapped }; } @@ -325,7 +327,8 @@ namespace CalamityMod.World new ChestItem(ItemID.BlueTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), - new ChestItem(potionType, WorldGen.genRand.Next(Main.remixWorld ? 1 : 10, (Main.remixWorld ? 2 : 12) + 1)), + new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), + new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Granite, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++) @@ -385,8 +388,6 @@ namespace CalamityMod.World public static void FillIceShrineChest(Chest chest) { int foodType = Utils.SelectRandom(WorldGen.genRand, ItemID.ChristmasPudding, ItemID.SugarCookie, ItemID.GingerbreadCookie); - if (Main.zenithWorld) - foodType = ModContent.ItemType(); List contents = new List() { new ChestItem(ModContent.ItemType(), 1), @@ -394,10 +395,25 @@ namespace CalamityMod.World new ChestItem(ItemID.FrozenKey, 1), new ChestItem(ItemID.IceTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), - new ChestItem(Main.zenithWorld ? ItemID.Eggnog :ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), - new ChestItem(foodType, WorldGen.genRand.Next(Main.remixWorld ? 200 : 10, (Main.zenithWorld ? 349 : 12) + 1)), + new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), + new ChestItem(foodType, WorldGen.genRand.Next(10, 12 + 1)), }; + if (Main.zenithWorld) + { + contents = new List() + { + new ChestItem(ModContent.ItemType(), 1), + new ChestItem(ItemID.FlinxFur, WorldGen.genRand.Next(6, 8 + 1)), + new ChestItem(ItemID.FrozenKey, 1), + new ChestItem(ItemID.IceTorch, WorldGen.genRand.Next(100, 110 + 1)), + new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), + new ChestItem(ItemID.Eggnog, WorldGen.genRand.Next(10, 12 + 1)), + new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(200, 349 + 1)), + new ChestItem(Main.rand.NextBool(2) ? ItemID.GasTrap : ItemID.Marshmallow, 1) + }; + } + for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); @@ -464,7 +480,8 @@ namespace CalamityMod.World new ChestItem(ItemID.WhiteTorch, WorldGen.genRand.Next(100, 110 + 1)), new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(20, 24 + 1)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(10, 12 + 1)), - new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.remixWorld ? 2 : 12) + 1)) + new ChestItem(potionType, WorldGen.genRand.Next(Main.zenithWorld ? 1 : 10, (Main.zenithWorld ? 2 : 12) + 1)), + new ChestItem((Main.rand.NextBool(2) && Main.zenithWorld) ? ItemID.GasTrap : ItemID.Marble, Main.zenithWorld ? 1 : WorldGen.genRand.Next(7,15+1)), }; for (int i = 0; i < contents.Count; i++) @@ -555,6 +572,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(4, 6 + 1)), new ChestItem(ModContent.ItemType(), WorldGen.genRand.Next(2, 3 + 1)), new ChestItem(ItemID.RedPotion, WorldGen.genRand.Next(1, 2 + 1)), + new ChestItem(ItemID.GasTrap, 1) }; } @@ -647,6 +665,7 @@ namespace CalamityMod.World new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(4, 6 + 1)), new ChestItem(Main.zenithWorld ? ItemID.RestorationPotion : ItemID.LesserHealingPotion, WorldGen.genRand.Next(10, 12 + 1)), new ChestItem(potionType, WorldGen.genRand.Next(10, 12 + 1)), + new ChestItem(Main.zenithWorld ? ItemID.GasTrap : ItemID.Mushroom, Main.zenithWorld ? 1 : WorldGen.genRand.Next(5,9+1)), }; for (int i = 0; i < contents.Count; i++)