-
Notifications
You must be signed in to change notification settings - Fork 0
/
TorchRecipes.cs
85 lines (75 loc) · 3.41 KB
/
TorchRecipes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System.Collections.Generic;
using Terraria.ID;
using Terraria.ModLoader;
using System;
using Terraria;
namespace ColorfulGel
{
static class TorchRecipes
{
static internal List<Tuple<string, short, int>> GelMakeTorchesCount = new List<Tuple<string, short, int>>
{
MakeTuple( "Default", ItemID.Torch, 1 ),
MakeTuple( "Red", ItemID.Torch, 2 ),
MakeTuple( "Green", ItemID.Torch, 2 ),
MakeTuple( "Blue", ItemID.Torch, 3 ),
MakeTuple( "Yellow", ItemID.Torch, 2 ),
MakeTuple( "Purple", ItemID.Torch, 5 ),
MakeTuple( "Jungle", ItemID.Torch, 4 ),
MakeTuple( "Grey", ItemID.Torch, 3 ),
MakeTuple( "Lava", ItemID.Torch, 8 ),
MakeTuple( "Corrupt", ItemID.Torch, 2 ),
MakeTuple( "Crim", ItemID.Torch, 2 ),
MakeTuple( "Dungeon", ItemID.Torch, 3 ),
MakeTuple( "Ice", ItemID.Torch, 1 ),
MakeTuple( "Illuminant", ItemID.Torch, 5 ),
MakeTuple( "Sand", ItemID.Torch, 3 ),
};
static internal List<Tuple<short, string, int>> ItemRecipesAddGel = new List<Tuple<short, string, int>>
{
MakeTuple(ItemID.SpelunkerPotion, "Yellow", 2),
MakeTuple(ItemID.GravitationPotion, "Purple", 2),
MakeTuple(ItemID.IronskinPotion, "Yellow", 1),
MakeTuple(ItemID.LifeforcePotion, "Red", 2),
MakeTuple(ItemID.SwiftnessPotion, "Green", 1),
MakeTuple(ItemID.RegenerationPotion, "Red", 1),
MakeTuple(ItemID.HealingPotion, "Red", 1),
MakeTuple(ItemID.GreaterHealingPotion,"Red", 2),
MakeTuple(ItemID.SuperHealingPotion, "Red", 3),
MakeTuple(ItemID.EndurancePotion, "Grey", 2),
MakeTuple(ItemID.FlaskofFire, "Lava", 4),
};
internal static void AddRecipes(Mod mod)
{
RecipeFinder rf = new RecipeFinder();
rf.SetResult(ItemID.Torch, 3);
rf.AddIngredient(ItemID.Gel);
new RecipeEditor(rf.SearchRecipes()[0]).DeleteRecipe();
ModRecipe r = new ModRecipe(mod);
bool overhaulMod = ModLoader.GetMod("TerrariaOverhaul") != null;
foreach (Tuple<string, short, int> rc in GelMakeTorchesCount)
{
if (rc.Item1 == "Blue" && overhaulMod) continue;
r.AddGelIngredient(rc.Item1);
r.AddRecipeGroup(RecipeGroupID.Wood);
r.SetResult(rc.Item2, Math.Max(overhaulMod? rc.Item3 / 2 : rc.Item3 ,1));
r.AddRecipe();
r = new ModRecipe(mod);
}
foreach (Tuple<short, string, int> rc in ItemRecipesAddGel)
{
RecipeFinder finder = new RecipeFinder();
finder.SetResult(rc.Item1);
foreach (Recipe recipe in finder.SearchRecipes())
{
recipe.AddIngredient(ColorfulGel.GetGelItem(rc.Item2, rc.Item3));
}
}
r.AddGelIngredient("Ice");
r.AddRecipeGroup("Wood");
r.SetResult(ItemID.IceTorch, 3);
r.AddRecipe();
}
static Tuple<T1, T2, T3> MakeTuple<T1, T2, T3>(T1 i1, T2 i2, T3 i3) => new Tuple<T1, T2, T3>(i1,i2,i3);
}
}