Elin Decompiled Documentation EA 23.255 Nightly Patch 3
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.factory.IsEmpty() && row.factory[0] == "x")
128 {
129 noListing = true;
130 }
131 if (row.components.Length == 0)
132 {
133 return DefaultIngredients;
134 }
135 if (row.components[0] == "-")
136 {
137 return DefaultIngredients;
138 }
139 if (row.recipeKey.Length != 0)
140 {
141 if (row.recipeKey[0] == "*")
142 {
143 alwaysKnown = true;
144 }
145 else if (row.recipeKey[0] == "-")
146 {
147 noRandomRecipe = true;
148 }
149 }
150 string[] components = row.components;
151 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
152 if (!components.IsEmpty() && components[0] != "-")
153 {
154 for (int i = 0; i < components.Length; i++)
155 {
156 string[] array = components[i].Split('|');
157 string[] array2 = array[0].Split('/');
158 string[] array3 = array2[0].Split('@');
159 bool optional = false;
160 bool useCat = false;
161 while (true)
162 {
163 switch (array3[0][0])
164 {
165 case '$':
166 colorIng = i;
167 array3[0] = array3[0].Remove(0, 1);
168 break;
169 case '#':
170 useCat = true;
171 array3[0] = array3[0].Remove(0, 1);
172 break;
173 case '+':
174 goto IL_0164;
175 }
176 break;
177 IL_0164:
178 optional = true;
179 array3[0] = array3[0].Remove(0, 1);
180 }
181 Recipe.Ingredient ingredient = new Recipe.Ingredient
182 {
183 id = array3[0],
184 tag = ((array3.Length > 1) ? array3[1] : null),
185 req = ((array2.Length <= 1) ? 1 : int.Parse(array2[1])),
186 optional = optional,
187 useCat = useCat
188 };
189 if (array.Length > 1)
190 {
191 for (int j = 1; j < array.Length; j++)
192 {
193 ingredient.idOther.Add(array[j]);
194 }
195 }
196 list.Add(ingredient);
197 }
198 }
199 return list;
200 }
201
202 public string GetIDIngredient()
203 {
204 string[] components = row.components;
205 if (!components.IsEmpty() && components[0] != "-")
206 {
207 int num = 0;
208 if (num < components.Length)
209 {
210 string[] array = components[num].Split('/')[0].Split('@');
211 char c = array[0][0];
212 if (c == '#' || c == '$' || c == '+')
213 {
214 array[0] = array[0].Remove(0, 1);
215 }
216 return array[0];
217 }
218 }
219 return null;
220 }
221
222 public int GetSPCost(Card factory)
223 {
224 Element reqSkill = GetReqSkill();
225 int num = row.Category.costSP + reqSkill.Value / 10;
226 int num2 = EClass.pc.Evalue(reqSkill.id);
227 if (num2 < reqSkill.Value)
228 {
229 num += (reqSkill.Value - num2) * 2 / 3;
230 }
231 return num;
232 }
233}
Definition: Card.cs:11
int Evalue(int ele)
Definition: Card.cs:2573
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
static Chara pc
Definition: EClass.cs:15
int id
Definition: ELEMENT.cs:250
int Value
Definition: ELEMENT.cs:292
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1102
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:8
TraitCrafter GetModelCrafter(string id)
Definition: SourceCard.cs:27
string GetDetail()
Definition: SourceData.cs:543
virtual string GetName()
Definition: SourceData.cs:538
SourceCard cards
SourceElement elements
Definition: Trait.cs:7
static TraitSelfFactory SelfFactory
Definition: Trait.cs:26