From b252a8e3a068fa028a1c8f68b823b86c571fb4be Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Fri, 2 Jan 2026 19:48:09 +0100 Subject: [PATCH] use item groups in recipe and adjust recipe for calamity's altered progression --- Items/ToclafaneStaff.cs | 72 ++++++++++++++-------------- Localization/en-US_Mods.YHTMod.hjson | 5 ++ 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/Items/ToclafaneStaff.cs b/Items/ToclafaneStaff.cs index 16f882e..4781fc4 100644 --- a/Items/ToclafaneStaff.cs +++ b/Items/ToclafaneStaff.cs @@ -3,6 +3,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.GameContent.Creative; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using YHTMod.Buffs; using YHTMod.Projectiles.Weapons; @@ -48,41 +49,40 @@ public class ToclafaneStaff : ModItem public override void AddRecipes() { - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddIngredient(ItemID.CopperWatch) - .AddTile(TileID.MythrilAnvil) - .Register(); - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddIngredient(ItemID.TinWatch) - .AddTile(TileID.MythrilAnvil) - .Register(); - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddIngredient(ItemID.SilverWatch) - .AddTile(TileID.MythrilAnvil) - .Register(); - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddIngredient(ItemID.TungstenWatch) - .AddTile(TileID.MythrilAnvil) - .Register(); - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddTile(TileID.MythrilAnvil) - .AddIngredient(ItemID.GoldWatch) - .Register(); - CreateRecipe() - .AddIngredient(ItemID.GuideVoodooDoll, 1) - .AddIngredient(ItemID.HallowedBar, 15) - .AddIngredient(ItemID.PlatinumWatch) - .AddTile(TileID.MythrilAnvil) - .Register(); + var watchGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.AnyWatch"), + ItemID.GoldWatch, + ItemID.SilverWatch, + ItemID.TinWatch, + ItemID.CopperWatch, + ItemID.PlatinumWatch, + ItemID.TungstenWatch + ); + RecipeGroup.RegisterGroup("YHTMod:Watches", watchGroup); + + var tier2BarGroup = new RecipeGroup(() => Language.GetTextValue("Mods.YHTMod.Recipes.Tier2Bars"), + ItemID.MythrilBar, + ItemID.OrichalcumBar + ); + RecipeGroup.RegisterGroup("YHTMod:Tier2Bars", tier2BarGroup); + + var recipe = CreateRecipe(); + + recipe.AddRecipeGroup(watchGroup); + recipe.AddIngredient(ItemID.GuideVoodooDoll); + recipe.AddTile(TileID.MythrilAnvil); + + // Calamity delays when you obtain hallowed bars, so use alternate recipe if Calamity is installed + if (ModLoader.HasMod("CalamityMod")) + { + recipe.AddRecipeGroup(tier2BarGroup, 35); + recipe.AddIngredient(ItemID.SoulofLight, 10); + recipe.AddIngredient(ItemID.SoulofLight, 10); + } + else + { + recipe.AddIngredient(ItemID.HallowedBar, 15); + } + + recipe.Register(); } } \ No newline at end of file diff --git a/Localization/en-US_Mods.YHTMod.hjson b/Localization/en-US_Mods.YHTMod.hjson index a2d6f34..a06aa72 100644 --- a/Localization/en-US_Mods.YHTMod.hjson +++ b/Localization/en-US_Mods.YHTMod.hjson @@ -1,3 +1,8 @@ +Recipes: { + AnyWatch: Any Watch + Tier2Bars: Tier 2 Hardmode Bars +} + Buffs: { ToclafaneMinionBuff: { DisplayName: Summon Toclafane