Elin Decompiled Documentation EA 23.264 Nightly
Loading...
Searching...
No Matches
RecipeSource Class Reference
Inheritance diagram for RecipeSource:
EClass

Public Member Functions

string GetDetail ()
 
bool IsCraftable ()
 
Element GetReqSkill ()
 
List< Recipe.IngredientGetIngredients ()
 
string GetIDIngredient ()
 
int GetSPCost (Card factory)
 

Public Attributes

RenderRow row
 
string type
 
string id
 
int colorIng
 
bool isBridge
 
bool isBridgePillar
 
bool isChara
 
bool noListing
 
bool isRandom
 
bool alwaysKnown
 
bool noRandomRecipe
 

Static Public Attributes

static List< Recipe.IngredientDefaultIngredients
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

string recipeCat [get]
 
string Name [get]
 
bool IsQuickCraft [get]
 
bool NeedFactory [get]
 
string NameFactory [get]
 
string idFactory [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Detailed Description

Definition at line 3 of file RecipeSource.cs.

Member Function Documentation

◆ GetDetail()

string RecipeSource.GetDetail ( )
inline

Definition at line 106 of file RecipeSource.cs.

107 {
108 return row.GetDetail();
109 }
RenderRow row
Definition: RecipeSource.cs:5
string GetDetail()
Definition: SourceData.cs:543

References SourceData< T, T2 >.BaseRow.GetDetail(), and row.

Referenced by Recipe.GetDetail(), and UICardInfo.SetRecipe().

◆ GetIDIngredient()

string RecipeSource.GetIDIngredient ( )
inline

Definition at line 202 of file RecipeSource.cs.

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 }
string[] components
Definition: RenderRow.cs:52

References RenderRow.components, and row.

Referenced by Map.DropBlockComponent().

◆ GetIngredients()

List< Recipe.Ingredient > RecipeSource.GetIngredients ( )
inline

Definition at line 125 of file RecipeSource.cs.

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 }
bool alwaysKnown
Definition: RecipeSource.cs:23
bool noRandomRecipe
Definition: RecipeSource.cs:25
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
string[] recipeKey
Definition: RenderRow.cs:56

References alwaysKnown, colorIng, RenderRow.components, DefaultIngredients, RenderRow.factory, Recipe.Ingredient.idOther, noListing, noRandomRecipe, RenderRow.recipeKey, and row.

Referenced by Recipe.BuildIngredientList(), QuestTrackCraft.GetDetail(), CraftUtil.MakeDish(), and Dialog.Recipe().

◆ GetReqSkill()

◆ GetSPCost()

int RecipeSource.GetSPCost ( Card  factory)
inline

Definition at line 222 of file RecipeSource.cs.

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 }
int Evalue(int ele)
Definition: Card.cs:2574
static Chara pc
Definition: EClass.cs:15
int id
Definition: ELEMENT.cs:255
int Value
Definition: ELEMENT.cs:297
Element GetReqSkill()

References Card.Evalue(), GetReqSkill(), Element.id, EClass.pc, and Element.Value.

Referenced by TraitFactory.GetCostSp(), and UIRecipeInfo.RefreshBalance().

◆ IsCraftable()

bool RecipeSource.IsCraftable ( )
inline

Definition at line 111 of file RecipeSource.cs.

112 {
113 if (idFactory.IsEmpty() || idFactory == "x" || idFactory == "none")
114 {
115 return false;
116 }
117 return true;
118 }

References idFactory.

Referenced by CraftUtil.MakeDish().

Member Data Documentation

◆ alwaysKnown

bool RecipeSource.alwaysKnown

Definition at line 23 of file RecipeSource.cs.

Referenced by GetIngredients(), and WidgetCodex.Search().

◆ colorIng

int RecipeSource.colorIng

◆ DefaultIngredients

List<Recipe.Ingredient> RecipeSource.DefaultIngredients
static
Initial value:
= new List<Recipe.Ingredient>
{
{
id = "log",
req = 1
}
}

Definition at line 27 of file RecipeSource.cs.

Referenced by GetIngredients().

◆ id

◆ isBridge

bool RecipeSource.isBridge

Definition at line 13 of file RecipeSource.cs.

Referenced by Recipe.Craft().

◆ isBridgePillar

bool RecipeSource.isBridgePillar

Definition at line 15 of file RecipeSource.cs.

Referenced by RecipeManager.Add().

◆ isChara

bool RecipeSource.isChara

Definition at line 17 of file RecipeSource.cs.

Referenced by WidgetCodex.Search().

◆ isRandom

bool RecipeSource.isRandom

Definition at line 21 of file RecipeSource.cs.

◆ noListing

bool RecipeSource.noListing

Definition at line 19 of file RecipeSource.cs.

Referenced by GetIngredients(), and WidgetCodex.Search().

◆ noRandomRecipe

bool RecipeSource.noRandomRecipe

Definition at line 25 of file RecipeSource.cs.

Referenced by GetIngredients(), and RecipeManager.GetLearnedRecipe().

◆ row

◆ type

string RecipeSource.type

Definition at line 7 of file RecipeSource.cs.

Referenced by Recipe.Build(), Recipe.Craft(), and Recipe.Create().

Property Documentation

◆ idFactory

string RecipeSource.idFactory
get

Definition at line 86 of file RecipeSource.cs.

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 }
bool isBridgePillar
Definition: RecipeSource.cs:15

Referenced by TraitBBQ.Contains(), TraitCauldron.Contains(), GetReqSkill(), IsCraftable(), Recipe.IsStaticLV(), UIRecipeInfo.Refresh(), UIRecipeInfo.RefreshList(), and HitSummary.SetRecipe().

◆ IsQuickCraft

bool RecipeSource.IsQuickCraft
get

Definition at line 50 of file RecipeSource.cs.

51 {
52 get
53 {
54 if (!row.factory.IsEmpty())
55 {
56 return row.factory[0] == "self";
57 }
58 return false;
59 }
60 }

Referenced by RecipeManager.ComeUpWithRecipe(), RecipeManager.GetLearnedRecipe(), and RecipeManager.GetRecipeLearnState().

◆ Name

string RecipeSource.Name
get

Definition at line 48 of file RecipeSource.cs.

Referenced by Recipe.GetName(), QuestTrackCraft.GetTitle(), and Dialog.Recipe().

◆ NameFactory

string RecipeSource.NameFactory
get

Definition at line 74 of file RecipeSource.cs.

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 }
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceElement elements

Referenced by RecipeManager.Add(), QuestTrackCraft.GetTitle(), UIRecipeInfo.Refresh(), TraitRecipe.WriteNote(), and Recipe.WriteReqFactory().

◆ NeedFactory

bool RecipeSource.NeedFactory
get

◆ recipeCat

string RecipeSource.recipeCat
get

Definition at line 36 of file RecipeSource.cs.

37 {
38 get
39 {
40 if (!isBridge && !isBridgePillar)
41 {
42 return row.Category.recipeCat;
43 }
44 return "foundation";
45 }
46 }
SourceCategory.Row Category
Definition: RenderRow.cs:119

The documentation for this class was generated from the following file: