Elin Decompiled Documentation EA 23.291 Nightly Patch 1
Loading...
Searching...
No Matches
RecipeSource.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
3public class RecipeSource : EClass
4{
5 public RenderRow row;
6
7 public string type;
8
9 public string id;
10
11 public int colorIng;
12
13 public bool isBridge;
14
15 public bool isBridgePillar;
16
17 public bool isChara;
18
19 public bool noListing;
20
21 public bool isRandom;
22
23 public bool alwaysKnown;
24
25 public bool noRandomRecipe;
26
27 public static List<Recipe.Ingredient> DefaultIngredients = new List<Recipe.Ingredient>
28 {
30 {
31 id = "log",
32 req = 1
33 }
34 };
35
36 public string recipeCat
37 {
38 get
39 {
40 if (!isBridge && !isBridgePillar)
41 {
42 return row.Category.recipeCat;
43 }
44 return "foundation";
45 }
46 }
47
48 public string Name => row.GetName() + (isBridgePillar ? "recipeBridgePillar".lang() : (isBridge ? "recipeBridge".lang() : ""));
49
50 public bool IsQuickCraft
51 {
52 get
53 {
54 if (!row.factory.IsEmpty())
55 {
56 return row.factory[0] == "self";
57 }
58 return false;
59 }
60 }
61
62 public bool NeedFactory
63 {
64 get
65 {
66 if (!row.factory.IsEmpty() && row.factory[0] != "self" && row.factory[0] != "x" && row.factory[0] != "none")
67 {
68 return row.factory[0] != "None";
69 }
70 return false;
71 }
72 }
73
74 public string NameFactory
75 {
76 get
77 {
78 if (!NeedFactory)
79 {
80 return EClass.sources.elements.map[6012].GetName();
81 }
82 return EClass.sources.cards.map[idFactory].GetName();
83 }
84 }
85
86 public string idFactory
87 {
88 get
89 {
90 if (!row.factory.IsEmpty())
91 {
92 if (!isBridge)
93 {
94 if (!isBridgePillar)
95 {
96 return row.factory[0];
97 }
98 return "tool_carving";
99 }
100 return "factory_platform";
101 }
102 return null;
103 }
104 }
105
106 public string GetDetail()
107 {
108 return row.GetDetail();
109 }
110
111 public bool IsCraftable()
112 {
113 if (idFactory.IsEmpty() || idFactory == "x" || idFactory == "none")
114 {
115 return false;
116 }
117 return true;
118 }
119
121 {
123 }
124
126 {
127 if (row.components.Length == 0)
128 {
129 return DefaultIngredients;
130 }
131 if (row.components[0] == "-")
132 {
133 return DefaultIngredients;
134 }
135 if (row.recipeKey.Length != 0)
136 {
137 if (row.recipeKey[0] == "*")
138 {
139 alwaysKnown = true;
140 }
141 else if (row.recipeKey[0] == "-")
142 {
143 noRandomRecipe = true;
144 }
145 }
146 string[] components = row.components;
147 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
148 if (!components.IsEmpty() && components[0] != "-")
149 {
150 for (int i = 0; i < components.Length; i++)
151 {
152 string[] array = components[i].Split('|');
153 string[] array2 = array[0].Split('/');
154 string[] array3 = array2[0].Split('@');
155 bool optional = false;
156 bool useCat = false;
157 while (true)
158 {
159 switch (array3[0][0])
160 {
161 case '$':
162 colorIng = i;
163 array3[0] = array3[0].Remove(0, 1);
164 break;
165 case '#':
166 useCat = true;
167 array3[0] = array3[0].Remove(0, 1);
168 break;
169 case '+':
170 goto IL_0132;
171 }
172 break;
173 IL_0132:
174 optional = true;
175 array3[0] = array3[0].Remove(0, 1);
176 }
177 Recipe.Ingredient ingredient = new Recipe.Ingredient
178 {
179 id = array3[0],
180 tag = ((array3.Length > 1) ? array3[1] : null),
181 req = ((array2.Length <= 1) ? 1 : int.Parse(array2[1])),
182 optional = optional,
183 useCat = useCat
184 };
185 if (array.Length > 1)
186 {
187 for (int j = 1; j < array.Length; j++)
188 {
189 ingredient.idOther.Add(array[j]);
190 }
191 }
192 list.Add(ingredient);
193 }
194 }
195 return list;
196 }
197
198 public string GetIDIngredient()
199 {
200 string[] components = row.components;
201 if (!components.IsEmpty() && components[0] != "-")
202 {
203 int num = 0;
204 if (num < components.Length)
205 {
206 string[] array = components[num].Split('/')[0].Split('@');
207 char c = array[0][0];
208 if (c == '#' || c == '$' || c == '+')
209 {
210 array[0] = array[0].Remove(0, 1);
211 }
212 return array[0];
213 }
214 }
215 return null;
216 }
217
218 public int GetSPCost(Card factory)
219 {
220 Element reqSkill = GetReqSkill();
221 int num = row.Category.costSP + reqSkill.Value / 10;
222 int num2 = EClass.pc.Evalue(reqSkill.id);
223 if (num2 < reqSkill.Value)
224 {
225 num += (reqSkill.Value - num2) * 2 / 3;
226 }
227 return num;
228 }
229}
Definition: Card.cs:11
int Evalue(int ele)
Definition: Card.cs:2611
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
static Chara pc
Definition: EClass.cs:15
int id
Definition: ELEMENT.cs:255
int Value
Definition: ELEMENT.cs:297
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1115
bool alwaysKnown
Definition: RecipeSource.cs:23
Element GetReqSkill()
RenderRow row
Definition: RecipeSource.cs:5
List< Recipe.Ingredient > GetIngredients()
bool IsQuickCraft
Definition: RecipeSource.cs:51
string recipeCat
Definition: RecipeSource.cs:37
string idFactory
Definition: RecipeSource.cs:87
string NameFactory
Definition: RecipeSource.cs:75
string GetDetail()
bool isBridgePillar
Definition: RecipeSource.cs:15
string type
Definition: RecipeSource.cs:7
int GetSPCost(Card factory)
bool noRandomRecipe
Definition: RecipeSource.cs:25
bool NeedFactory
Definition: RecipeSource.cs:63
bool IsCraftable()
string GetIDIngredient()
static List< Recipe.Ingredient > DefaultIngredients
Definition: RecipeSource.cs:27
List< string > idOther
Definition: Recipe.cs:41
Definition: Recipe.cs:7
string[] factory
Definition: RenderRow.cs:54
SourceCategory.Row Category
Definition: RenderRow.cs:119
string[] components
Definition: RenderRow.cs:52
string[] recipeKey
Definition: RenderRow.cs:56
int LV
Definition: RenderRow.cs:22
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
TraitCrafter GetModelCrafter(string id)
Definition: SourceCard.cs:32
string GetDetail()
Definition: SourceData.cs:616
virtual string GetName()
Definition: SourceData.cs:611
SourceCard cards
SourceElement elements
Definition: Trait.cs:7
static TraitSelfFactory SelfFactory
Definition: Trait.cs:26