Elin Decompiled Documentation EA 23.102 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
110 {
112 }
113
115 {
116 if (!row.factory.IsEmpty() && row.factory[0] == "x")
117 {
118 noListing = true;
119 }
120 if (row.components.Length == 0)
121 {
122 return DefaultIngredients;
123 }
124 if (row.components[0] == "-")
125 {
126 return DefaultIngredients;
127 }
128 if (row.recipeKey.Length != 0 && row.recipeKey[0] == "*")
129 {
130 alwaysKnown = true;
131 }
132 string[] components = row.components;
133 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
134 if (!components.IsEmpty() && components[0] != "-")
135 {
136 for (int i = 0; i < components.Length; i++)
137 {
138 string[] array = components[i].Split('|');
139 string[] array2 = array[0].Split('/');
140 string[] array3 = array2[0].Split('@');
141 bool optional = false;
142 bool useCat = false;
143 while (true)
144 {
145 switch (array3[0][0])
146 {
147 case '$':
148 colorIng = i;
149 array3[0] = array3[0].Remove(0, 1);
150 break;
151 case '#':
152 useCat = true;
153 array3[0] = array3[0].Remove(0, 1);
154 break;
155 case '+':
156 goto IL_0142;
157 }
158 break;
159 IL_0142:
160 optional = true;
161 array3[0] = array3[0].Remove(0, 1);
162 }
163 Recipe.Ingredient ingredient = new Recipe.Ingredient
164 {
165 id = array3[0],
166 tag = ((array3.Length > 1) ? array3[1] : null),
167 req = ((array2.Length <= 1) ? 1 : int.Parse(array2[1])),
168 optional = optional,
169 useCat = useCat
170 };
171 if (array.Length > 1)
172 {
173 for (int j = 1; j < array.Length; j++)
174 {
175 ingredient.idOther.Add(array[j]);
176 }
177 }
178 list.Add(ingredient);
179 }
180 }
181 return list;
182 }
183
184 public string GetIDIngredient()
185 {
186 string[] components = row.components;
187 if (!components.IsEmpty() && components[0] != "-")
188 {
189 int num = 0;
190 if (num < components.Length)
191 {
192 string[] array = components[num].Split('/')[0].Split('@');
193 char c = array[0][0];
194 if (c == '#' || c == '$' || c == '+')
195 {
196 array[0] = array[0].Remove(0, 1);
197 }
198 return array[0];
199 }
200 }
201 return null;
202 }
203
204 public int GetSPCost(Card factory)
205 {
206 Element reqSkill = GetReqSkill();
207 int num = row.Category.costSP + reqSkill.Value / 10;
208 int num2 = EClass.pc.Evalue(reqSkill.id);
209 if (num2 < reqSkill.Value)
210 {
211 num += (reqSkill.Value - num2) * 2 / 3;
212 }
213 return num;
214 }
215}
Definition: Card.cs:11
int Evalue(int ele)
Definition: Card.cs:2431
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
static Chara pc
Definition: EClass.cs:14
int id
Definition: ELEMENT.cs:240
int Value
Definition: ELEMENT.cs:282
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:913
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
string GetIDIngredient()
static List< Recipe.Ingredient > DefaultIngredients
Definition: RecipeSource.cs:25
List< string > idOther
Definition: Recipe.cs:35
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:24