feat: modify some vanilla recipes to include coal

This commit is contained in:
Muhammad Nauman Raza 2024-11-16 12:16:43 +00:00
parent 98424e0045
commit 9de37e9113
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -0,0 +1,32 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Continuity.Content.Items.Materials;
namespace Continuity.Content.Systems
{
public class CoalRecipeOverrides : ModSystem
{
public override void AddRecipes() {
for (int i = 0; i < Recipe.numRecipes; i++) {
Recipe recipe = Main.recipe[i];
if (recipe.TryGetResult(ItemID.Torch, out Item _)) {
recipe.AddIngredient(ModContent.ItemType<Coal>(), 1);
}
else if (recipe.TryGetResult(ItemID.FlamingMace, out Item _)) {
recipe.RemoveIngredient(ItemID.Torch);
recipe.AddIngredient(ModContent.ItemType<Coal>(), 18);
}
else if (recipe.TryGetResult(ItemID.Furnace, out Item _)) {
recipe.RemoveIngredient(ItemID.Torch);
recipe.AddIngredient(ModContent.ItemType<Coal>(), 16);
}
else if (recipe.TryGetResult(ItemID.Fireplace, out Item _)) {
recipe.RemoveIngredient(ItemID.Torch);
recipe.AddIngredient(ModContent.ItemType<Coal>(), 12);
}
}
}
}
}