From b7cd3a7b0407196549b7a67af70066fbeccafddf Mon Sep 17 00:00:00 2001 From: dragon3025 <11652210+dragon3025@users.noreply.github.com> Date: Sun, 5 Feb 2023 16:36:35 -0800 Subject: [PATCH] Shimmer changes, shadow chest, price changes, and code cleanup. - Regular and Ancient Hallowed gear is now crafted into Hallowed Bar at Shimmering Star (to match current 1.4.4+ version. - If craft-able rare chests is on, you can craft Shadow Key to and from Shadow Chest at a Shimmering Star. - Item value modifications that match current 1.4.4+ version. --- Config.cs | 4 ++-- Global/Item.cs | 15 +++++++------- Global/NPCLoot.cs | 1 - Global/Recipes.cs | 39 +++++++++++++++++++++++++----------- Global/Shops.cs | 2 ++ Global/ValueModification.cs | 40 +++++++++++++++++++++++++++++++++++++ Global/WorldGen.cs | 14 ++++++------- build.txt | 2 +- 8 files changed, 87 insertions(+), 30 deletions(-) diff --git a/Config.cs b/Config.cs index b8e5883c..8cd886e5 100644 --- a/Config.cs +++ b/Config.cs @@ -518,8 +518,8 @@ public class IOtherConfig : ModConfig "Regular Wooden Chests. Chance = 1 / configuration_setting. Set to 0 to disable.")] [DefaultValue(75)] public int TerragrimChestChance; - - //TO-DO Remove after 1.4.4 + + //TO-DO Remove after 1.4.4 [Label("Use 1.4.4 [i:4978] Fledgling Wings Chance")] [DefaultValue(true)] public bool FutureFledglingChestChance; diff --git a/Global/Item.cs b/Global/Item.cs index 12869bf4..7b8e306b 100644 --- a/Global/Item.cs +++ b/Global/Item.cs @@ -21,6 +21,7 @@ public override void ModifyTooltips(Terraria.Item item, List toolti return; } + //TO-DO Shimmering makes it easier to get missing items, so this might not be necessary anymore. if (item.type == ItemID.Vitamins || item.type == ItemID.ArmorPolish || item.type == ItemID.AdhesiveBandage || item.type == ItemID.Bezoar || item.type == ItemID.Nazar || item.type == ItemID.Megaphone || item.type == ItemID.TrifoldMap || item.type == ItemID.FastClock || item.type == ItemID.Blindfold || item.type == ItemID.ArmorBracing || item.type == ItemID.MedicatedBandage || item.type == ItemID.CountercurseMantra || item.type == ItemID.ThePlan) { tooltips.Add(new TooltipLine(Mod, "AnkhMaterialUseFromInventory", "Ankh Material\n" + @@ -197,11 +198,11 @@ public override void ModifyItemLoot(Terraria.Item item, ItemLoot itemLoot) if (rule2 is OneFromOptionsNotScaledWithLuckDropRule drop2 && drop2.dropIds.Contains(ItemID.Starfury)) { List newDropOptions = drop2.dropIds.ToList(); - - if (lootOtherConfig.FutureFledglingChestChance) + + if (lootOtherConfig.FutureFledglingChestChance) { - newDropOptions.Remove(ItemID.CreativeWings); - } + newDropOptions.Remove(ItemID.CreativeWings); + } newDropOptions.Add(ItemID.LuckyHorseshoe); newDropOptions.Add(ItemID.CelestialMagnet); @@ -211,9 +212,9 @@ public override void ModifyItemLoot(Terraria.Item item, ItemLoot itemLoot) } } if (lootOtherConfig.FutureFledglingChestChance) - { - itemLoot.Add(ItemDropRule.NotScalingWithLuck(ItemID.CreativeWings, 40)); - } + { + itemLoot.Add(ItemDropRule.NotScalingWithLuck(ItemID.CreativeWings, 40)); + } itemLoot.Add(ItemDropRule.NotScalingWithLuck(ItemID.Cloud, 2, 50, 100)); } if (item.type == ItemID.LavaCrate || item.type == ItemID.LavaCrateHard) diff --git a/Global/NPCLoot.cs b/Global/NPCLoot.cs index 1637dd22..84766839 100644 --- a/Global/NPCLoot.cs +++ b/Global/NPCLoot.cs @@ -5,7 +5,6 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; -using Terraria.GameContent.Bestiary; //Note netID is sometimes used when involving NPCs with negative IDs (variant NPCs), otherwise it gives duplicate loot drops to multiple NPCs. Not always does this happen though. namespace ReducedGrinding.Global diff --git a/Global/Recipes.cs b/Global/Recipes.cs index 7608b369..14aea4cd 100644 --- a/Global/Recipes.cs +++ b/Global/Recipes.cs @@ -482,62 +482,62 @@ public override void AddRecipes() recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedMask); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.HallowedMask); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedHelmet); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.HallowedHelmet); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedHeadgear); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.HallowedHeadgear); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedHood); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.HallowedHood); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedPlateMail); + recipe = Recipe.Create(ItemID.HallowedBar, 24); recipe.AddIngredient(ItemID.HallowedPlateMail); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.AncientHallowedGreaves); + recipe = Recipe.Create(ItemID.HallowedBar, 18); recipe.AddIngredient(ItemID.HallowedGreaves); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedMask); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.AncientHallowedMask); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedHelmet); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.AncientHallowedHelmet); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedHeadgear); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.AncientHallowedHeadgear); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedHood); + recipe = Recipe.Create(ItemID.HallowedBar, 12); recipe.AddIngredient(ItemID.AncientHallowedHood); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedPlateMail); + recipe = Recipe.Create(ItemID.HallowedBar, 24); recipe.AddIngredient(ItemID.AncientHallowedPlateMail); recipe.AddTile(TileType()); recipe.Register(); - recipe = Recipe.Create(ItemID.HallowedGreaves); + recipe = Recipe.Create(ItemID.HallowedBar, 18); recipe.AddIngredient(ItemID.AncientHallowedGreaves); recipe.AddTile(TileType()); recipe.Register(); @@ -1171,6 +1171,19 @@ public override void AddRecipes() recipe.AddTile(TileType()); recipe.Register(); + if (GetInstance().CraftableRareChests) + { + recipe = Recipe.Create(ItemID.ShadowChest); + recipe.AddIngredient(ItemID.ShadowKey); + recipe.AddTile(TileType()); + recipe.Register(); + + recipe = Recipe.Create(ItemID.ShadowKey); + recipe.AddIngredient(ItemID.ShadowChest); + recipe.AddTile(TileType()); + recipe.Register(); + } + #region Dungeon Furniture #region Blue to Green @@ -1545,6 +1558,8 @@ public override void AddRecipes() #region Craftable Rare Chests if (GetInstance().CraftableRareChests) { + //Shadow Chest also requires this condition, but is crafted using shimmering, so it's in the shimmering section above. + recipe = Recipe.Create(ItemID.IvyChest); recipe.AddIngredient(ItemID.RichMahogany, 8); recipe.AddRecipeGroup(RecipeGroupID.IronBar, 2); diff --git a/Global/Shops.cs b/Global/Shops.cs index 59092e4d..8155ffa1 100644 --- a/Global/Shops.cs +++ b/Global/Shops.cs @@ -16,7 +16,9 @@ public override void GetChat(NPC npc, ref string chat) if (npc.type == NPCID.Angler) { if (GetInstance().AnglerTellsQuestCompleted) + { Main.NewText("Quests completed: " + player.anglerQuestsFinished.ToString(), 0, 255, 255); + } if (GetInstance().FishCoinsRewardedForQuest > 0) { diff --git a/Global/ValueModification.cs b/Global/ValueModification.cs index dd0a726c..f1401773 100644 --- a/Global/ValueModification.cs +++ b/Global/ValueModification.cs @@ -352,6 +352,46 @@ void FindNewValue(float oldChance, int newChance) { item.value = Item.sellPrice(0, 0, 54); } + + if (item.type == ItemID.ImpStaff) + { + item.value = Item.sellPrice(0, 0, 54); + } + + if (item.type == ItemID.BeeWax) + { + item.value = Item.sellPrice(0, 0, 5); + } + + if (item.type == ItemID.BeeHeadgear) + { + item.value = Item.sellPrice(0, 0, 40); + } + + if (item.type == ItemID.BeeBreastplate) + { + item.value = Item.sellPrice(0, 0, 60); + } + + if (item.type == ItemID.BeeGreaves) + { + item.value = Item.sellPrice(0, 0, 50); + } + + if (item.type == ItemID.Beenade) + { + item.value = Item.sellPrice(0, 0, 5); + } + + if (item.type == 5294) //Hive-Five + { + item.value = Item.sellPrice(0, 0, 70); + } + + if (item.type == ItemID.HornetStaff) + { + item.value = Item.sellPrice(0, 0, 70); + } #endregion } } diff --git a/Global/WorldGen.cs b/Global/WorldGen.cs index 0c59ef7c..ad7d8c1b 100644 --- a/Global/WorldGen.cs +++ b/Global/WorldGen.cs @@ -149,12 +149,12 @@ protected override void ApplyPass(GenerationProgress progress, GameConfiguration ItemID.LuckyHorseshoe, ItemID.CelestialMagnet }; //Vanilla Skyware items will generate making sure to add rare items that haven't been added yet by going down the list, then it will be random. - - if (!GetInstance().FutureFledglingChestChance) - { - missingSkywareItems.Add(ItemID.CreativeWings); - } - + + if (!GetInstance().FutureFledglingChestChance) + { + missingSkywareItems.Add(ItemID.CreativeWings); + } + List terragrimChests = new(); List nonSkywareChests = new(); //TO-DO Remove when 1.4.4+ comes out List lockedGoldChest = new(); @@ -715,7 +715,7 @@ void tryToPlaceMushroomChest(int mushroomBiome, int item = -1) } else { - int chance = GetInstance().FutureFledglingChestChance ? 4 : 5; + int chance = GetInstance().FutureFledglingChestChance ? 4 : 5; switch (WorldGen.genRand.Next(chance)) { case 0: diff --git a/build.txt b/build.txt index e6aa6445..98c931ad 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Dragon3025 -version = 8.13.2 +version = 8.13.3 displayName = Reduced Grinding homepage = http://forums.terraria.org/index.php?threads/reduced-grinding.51082/ hideCode = false