Elin Modding Docs Doc
Loading...
Searching...
No Matches
RecipeSource.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x0200005D RID: 93
5public class RecipeSource : EClass
6{
7 // Token: 0x17000076 RID: 118
8 // (get) Token: 0x0600025B RID: 603 RVA: 0x000127C0 File Offset: 0x000109C0
9 public string recipeCat
10 {
11 get
12 {
13 if (!this.isBridge && !this.isBridgePillar)
14 {
15 return this.row.Category.recipeCat;
16 }
17 return "foundation";
18 }
19 }
20
21 // Token: 0x0600025C RID: 604 RVA: 0x000127E8 File Offset: 0x000109E8
22 public string GetDetail()
23 {
24 return this.row.GetDetail();
25 }
26
27 // Token: 0x17000077 RID: 119
28 // (get) Token: 0x0600025D RID: 605 RVA: 0x000127F5 File Offset: 0x000109F5
29 public string Name
30 {
31 get
32 {
33 return this.row.GetName() + (this.isBridge ? "recipeBridge".lang() : "");
34 }
35 }
36
37 // Token: 0x17000078 RID: 120
38 // (get) Token: 0x0600025E RID: 606 RVA: 0x00012820 File Offset: 0x00010A20
39 public bool IsQuickCraft
40 {
41 get
42 {
43 return !this.row.factory.IsEmpty() && this.row.factory[0] == "self";
44 }
45 }
46
47 // Token: 0x17000079 RID: 121
48 // (get) Token: 0x0600025F RID: 607 RVA: 0x00012850 File Offset: 0x00010A50
49 public bool NeedFactory
50 {
51 get
52 {
53 return !this.row.factory.IsEmpty() && this.row.factory[0] != "self" && this.row.factory[0] != "x" && this.row.factory[0] != "none" && this.row.factory[0] != "None";
54 }
55 }
56
57 // Token: 0x1700007A RID: 122
58 // (get) Token: 0x06000260 RID: 608 RVA: 0x000128D3 File Offset: 0x00010AD3
59 public string NameFactory
60 {
61 get
62 {
63 return EClass.sources.cards.map[this.idFactory].GetName();
64 }
65 }
66
67 // Token: 0x1700007B RID: 123
68 // (get) Token: 0x06000261 RID: 609 RVA: 0x000128F4 File Offset: 0x00010AF4
69 public string idFactory
70 {
71 get
72 {
73 if (this.row.factory.IsEmpty())
74 {
75 return null;
76 }
77 if (this.isBridge)
78 {
79 return "factory_platform";
80 }
81 if (!this.isBridgePillar)
82 {
83 return this.row.factory[0];
84 }
85 return "tool_carving";
86 }
87 }
88
89 // Token: 0x06000262 RID: 610 RVA: 0x00012933 File Offset: 0x00010B33
90 public Element GetReqSkill()
91 {
92 return Element.Create((this.NeedFactory ? EClass.sources.cards.GetModelCrafter(this.idFactory) : Trait.SelfFactory).IDReqEle(this), this.row.LV);
93 }
94
95 // Token: 0x06000263 RID: 611 RVA: 0x00012970 File Offset: 0x00010B70
96 public List<Recipe.Ingredient> GetIngredients()
97 {
98 if (!this.row.factory.IsEmpty() && this.row.factory[0] == "x")
99 {
100 this.noListing = true;
101 }
102 if (this.row.components.Length == 0)
103 {
104 return RecipeSource.DefaultIngredients;
105 }
106 if (this.row.components[0] == "-")
107 {
108 return RecipeSource.DefaultIngredients;
109 }
110 if (this.row.recipeKey.Length != 0 && this.row.recipeKey[0] == "*")
111 {
112 this.alwaysKnown = true;
113 }
114 string[] components = this.row.components;
115 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
116 if (!components.IsEmpty() && components[0] != "-")
117 {
118 int i = 0;
119 while (i < components.Length)
120 {
121 string[] array = components[i].Split('|', StringSplitOptions.None);
122 string[] array2 = array[0].Split('/', StringSplitOptions.None);
123 string[] array3 = array2[0].Split('@', StringSplitOptions.None);
124 bool optional = false;
125 bool useCat = false;
126 for (;;)
127 {
128 char c = array3[0][0];
129 if (c == '#')
130 {
131 goto IL_12E;
132 }
133 if (c == '$')
134 {
135 goto IL_116;
136 }
137 if (c != '+')
138 {
139 break;
140 }
141 optional = true;
142 array3[0] = array3[0].Remove(0, 1);
143 }
144 IL_156:
145 Recipe.Ingredient ingredient = new Recipe.Ingredient
146 {
147 id = array3[0],
148 tag = ((array3.Length > 1) ? array3[1] : null),
149 req = ((array2.Length > 1) ? int.Parse(array2[1]) : 1),
150 optional = optional,
151 useCat = useCat
152 };
153 if (array.Length > 1)
154 {
155 for (int j = 1; j < array.Length; j++)
156 {
157 ingredient.idOther.Add(array[j]);
158 }
159 }
160 list.Add(ingredient);
161 i++;
162 continue;
163 goto IL_156;
164 IL_116:
165 this.colorIng = i;
166 array3[0] = array3[0].Remove(0, 1);
167 goto IL_156;
168 IL_12E:
169 useCat = true;
170 array3[0] = array3[0].Remove(0, 1);
171 goto IL_156;
172 }
173 }
174 return list;
175 }
176
177 // Token: 0x06000264 RID: 612 RVA: 0x00012B60 File Offset: 0x00010D60
178 public string GetIDIngredient()
179 {
180 string[] components = this.row.components;
181 if (!components.IsEmpty() && components[0] != "-")
182 {
183 int num = 0;
184 if (num < components.Length)
185 {
186 string[] array = components[num].Split('/', StringSplitOptions.None)[0].Split('@', StringSplitOptions.None);
187 char c = array[0][0];
188 if (c == '#' || c == '$' || c == '+')
189 {
190 array[0] = array[0].Remove(0, 1);
191 }
192 return array[0];
193 }
194 }
195 return null;
196 }
197
198 // Token: 0x06000265 RID: 613 RVA: 0x00012BDC File Offset: 0x00010DDC
199 public int GetSPCost(Card factory)
200 {
201 Element reqSkill = this.GetReqSkill();
202 int num = this.row.Category.costSP + reqSkill.Value / 10;
203 int num2 = EClass.pc.Evalue(reqSkill.id);
204 if (num2 < reqSkill.Value)
205 {
206 num += (reqSkill.Value - num2) * 2 / 3;
207 }
208 return num;
209 }
210
211 // Token: 0x040004FD RID: 1277
212 public RenderRow row;
213
214 // Token: 0x040004FE RID: 1278
215 public string type;
216
217 // Token: 0x040004FF RID: 1279
218 public string id;
219
220 // Token: 0x04000500 RID: 1280
221 public int colorIng;
222
223 // Token: 0x04000501 RID: 1281
224 public bool isBridge;
225
226 // Token: 0x04000502 RID: 1282
227 public bool isBridgePillar;
228
229 // Token: 0x04000503 RID: 1283
230 public bool isChara;
231
232 // Token: 0x04000504 RID: 1284
233 public bool noListing;
234
235 // Token: 0x04000505 RID: 1285
236 public bool isRandom;
237
238 // Token: 0x04000506 RID: 1286
239 public bool alwaysKnown;
240
241 // Token: 0x04000507 RID: 1287
242 public static List<Recipe.Ingredient> DefaultIngredients = new List<Recipe.Ingredient>
243 {
245 {
246 id = "log",
247 req = 1
248 }
249 };
250}
Definition Card.cs:13
Definition Trait.cs:9