Elin Decompiled Documentation EA 23.299 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:616

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

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

◆ GetIDIngredient()

string RecipeSource.GetIDIngredient ( )
inline

Definition at line 198 of file RecipeSource.cs.

199 {
200 string[] components = row.components;
201 if (!components.IsEmpty() && components[0] != "-")
202 {
203 int num = 0;
204 if (num < components.Length)
205 {
206 string[] array = components[num].Split('/')[0].Split('@');
207 char c = array[0][0];
208 if (c == '#' || c == '$' || c == '+')
209 {
210 array[0] = array[0].Remove(0, 1);
211 }
212 return array[0];
213 }
214 }
215 return null;
216 }
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.components.Length == 0)
128 {
129 return DefaultIngredients;
130 }
131 if (row.components[0] == "-")
132 {
133 return DefaultIngredients;
134 }
135 if (row.recipeKey.Length != 0)
136 {
137 if (row.recipeKey[0] == "*")
138 {
139 alwaysKnown = true;
140 }
141 else if (row.recipeKey[0] == "-")
142 {
143 noRandomRecipe = true;
144 }
145 }
146 string[] components = row.components;
147 List<Recipe.Ingredient> list = new List<Recipe.Ingredient>();
148 if (!components.IsEmpty() && components[0] != "-")
149 {
150 for (int i = 0; i < components.Length; i++)
151 {
152 string[] array = components[i].Split('|');
153 string[] array2 = array[0].Split('/');
154 string[] array3 = array2[0].Split('@');
155 bool optional = false;
156 bool useCat = false;
157 while (true)
158 {
159 switch (array3[0][0])
160 {
161 case '$':
162 colorIng = i;
163 array3[0] = array3[0].Remove(0, 1);
164 break;
165 case '#':
166 useCat = true;
167 array3[0] = array3[0].Remove(0, 1);
168 break;
169 case '+':
170 goto IL_0132;
171 }
172 break;
173 IL_0132:
174 optional = true;
175 array3[0] = array3[0].Remove(0, 1);
176 }
177 Recipe.Ingredient ingredient = new Recipe.Ingredient
178 {
179 id = array3[0],
180 tag = ((array3.Length > 1) ? array3[1] : null),
181 req = ((array2.Length <= 1) ? 1 : int.Parse(array2[1])),
182 optional = optional,
183 useCat = useCat
184 };
185 if (array.Length > 1)
186 {
187 for (int j = 1; j < array.Length; j++)
188 {
189 ingredient.idOther.Add(array[j]);
190 }
191 }
192 list.Add(ingredient);
193 }
194 }
195 return list;
196 }
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[] recipeKey
Definition: RenderRow.cs:56

References alwaysKnown, colorIng, RenderRow.components, DefaultIngredients, Recipe.Ingredient.idOther, 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 218 of file RecipeSource.cs.

219 {
220 Element reqSkill = GetReqSkill();
221 int num = row.Category.costSP + reqSkill.Value / 10;
222 int num2 = EClass.pc.Evalue(reqSkill.id);
223 if (num2 < reqSkill.Value)
224 {
225 num += (reqSkill.Value - num2) * 2 / 3;
226 }
227 return num;
228 }
int Evalue(int ele)
Definition: Card.cs:2613
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 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
string[] factory
Definition: RenderRow.cs:54

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:9
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: