Elin Decompiled Documentation EA 23.249 Nightly
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 static List<Recipe.Ingredient> DefaultIngredients = new List<Recipe.Ingredient>
26 {
28 {
29 id = "log",
30 req = 1
31 }
32 };
33
34 public string recipeCat
35 {
36 get
37 {
38 if (!isBridge && !isBridgePillar)
39 {
40 return row.Category.recipeCat;
41 }
42 return "foundation";
43 }
44 }
45
46 public string Name => row.GetName() + (isBridgePillar ? "recipeBridgePillar".lang() : (isBridge ? "recipeBridge".lang() : ""));
47
48 public bool IsQuickCraft
49 {
50 get
51 {
52 if (!row.factory.IsEmpty())
53 {
54 return row.factory[0] == "self";
55 }
56 return false;
57 }
58 }
59
60 public bool NeedFactory
61 {
62 get
63 {
64 if (!row.factory.IsEmpty() && row.factory[0] != "self" && row.factory[0] != "x" && row.factory[0] != "none")
65 {
66 return row.factory[0] != "None";
67 }
68 return false;
69 }
70 }
71
72 public string NameFactory
73 {
74 get
75 {
76 if (!NeedFactory)
77 {
78 return EClass.sources.elements.map[6012].GetName();
79 }
80 return EClass.sources.cards.map[idFactory].GetName();
81 }
82 }
83
84 public string idFactory
85 {
86 get
87 {
88 if (!row.factory.IsEmpty())
89 {
90 if (!isBridge)
91 {
92 if (!isBridgePillar)
93 {
94 return row.factory[0];
95 }
96 return "tool_carving";
97 }
98 return "factory_platform";
99 }
100 return null;
101 }
102 }
103
104 public string GetDetail()
105 {
106 return row.GetDetail();
107 }
108
109 public bool IsCraftable()
110 {
111 if (idFactory.IsEmpty() || idFactory == "x" || idFactory == "none")
112 {
113 return false;
114 }
115 return true;
116 }
117
119 {
121 }
122
124 {
125 if (!row.factory.IsEmpty() && row.factory[0] == "x")
126 {
127 noListing = true;
128 }
129 if (row.components.Length == 0)
130 {
131 return DefaultIngredients;
132 }
133 if (row.components[0] == "-")
134 {
135 return DefaultIngredients;
136 }
137 if (row.recipeKey.Length != 0 && row.recipeKey[0] == "*")
138 {
139 alwaysKnown = true;
140 }
141 string[] components = row.components;
142 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
143 if (!components.IsEmpty() && components[0] != "-")
144 {
145 for (int i = 0; i < components.Length; i++)
146 {
147 string[] array = components[i].Split('|');
148 string[] array2 = array[0].Split('/');
149 string[] array3 = array2[0].Split('@');
150 bool optional = false;
151 bool useCat = false;
152 while (true)
153 {
154 switch (array3[0][0])
155 {
156 case '$':
157 colorIng = i;
158 array3[0] = array3[0].Remove(0, 1);
159 break;
160 case '#':
161 useCat = true;
162 array3[0] = array3[0].Remove(0, 1);
163 break;
164 case '+':
165 goto IL_0142;
166 }
167 break;
168 IL_0142:
169 optional = true;
170 array3[0] = array3[0].Remove(0, 1);
171 }
172 Recipe.Ingredient ingredient = new Recipe.Ingredient
173 {
174 id = array3[0],
175 tag = ((array3.Length > 1) ? array3[1] : null),
176 req = ((array2.Length <= 1) ? 1 : int.Parse(array2[1])),
177 optional = optional,
178 useCat = useCat
179 };
180 if (array.Length > 1)
181 {
182 for (int j = 1; j < array.Length; j++)
183 {
184 ingredient.idOther.Add(array[j]);
185 }
186 }
187 list.Add(ingredient);
188 }
189 }
190 return list;
191 }
192
193 public string GetIDIngredient()
194 {
195 string[] components = row.components;
196 if (!components.IsEmpty() && components[0] != "-")
197 {
198 int num = 0;
199 if (num < components.Length)
200 {
201 string[] array = components[num].Split('/')[0].Split('@');
202 char c = array[0][0];
203 if (c == '#' || c == '$' || c == '+')
204 {
205 array[0] = array[0].Remove(0, 1);
206 }
207 return array[0];
208 }
209 }
210 return null;
211 }
212
213 public int GetSPCost(Card factory)
214 {
215 Element reqSkill = GetReqSkill();
216 int num = row.Category.costSP + reqSkill.Value / 10;
217 int num2 = EClass.pc.Evalue(reqSkill.id);
218 if (num2 < reqSkill.Value)
219 {
220 num += (reqSkill.Value - num2) * 2 / 3;
221 }
222 return num;
223 }
224}
Definition: Card.cs:11
int Evalue(int ele)
Definition: Card.cs:2571
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:49
string recipeCat
Definition: RecipeSource.cs:35
string idFactory
Definition: RecipeSource.cs:85
string NameFactory
Definition: RecipeSource.cs:73
string GetDetail()
bool isBridgePillar
Definition: RecipeSource.cs:15
string type
Definition: RecipeSource.cs:7
int GetSPCost(Card factory)
bool NeedFactory
Definition: RecipeSource.cs:61
bool IsCraftable()
string GetIDIngredient()
static List< Recipe.Ingredient > DefaultIngredients
Definition: RecipeSource.cs:25
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:25