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

Public Member Functions

bool ShouldList ()
 
string GetDetail ()
 
bool IsCraftable ()
 
Element GetReqSkill ()
 
List< Recipe.Ingredient > GetIngredients ()
 
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.Ingredient > DefaultIngredients
 
- 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 123 of file RecipeSource.cs.

124 {
125 return row.GetDetail();
126 }
RenderRow row
Definition: RecipeSource.cs:5
string GetDetail()
Definition: SourceData.cs:678

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

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

◆ GetIDIngredient()

string RecipeSource.GetIDIngredient ( )
inline

Definition at line 215 of file RecipeSource.cs.

216 {
217 string[] components = row.components;
218 if (!components.IsEmpty() && components[0] != "-")
219 {
220 int num = 0;
221 if (num < components.Length)
222 {
223 string[] array = components[num].Split('/')[0].Split('@');
224 char c = array[0][0];
225 if (c == '#' || c == '$' || c == '+')
226 {
227 array[0] = array[0].Remove(0, 1);
228 }
229 return array[0];
230 }
231 }
232 return null;
233 }
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 142 of file RecipeSource.cs.

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

236 {
237 Element reqSkill = GetReqSkill();
238 int num = row.Category.costSP + reqSkill.Value / 10;
239 int num2 = EClass.pc.Evalue(reqSkill.id);
240 if (num2 < reqSkill.Value)
241 {
242 num += (reqSkill.Value - num2) * 2 / 3;
243 }
244 return num;
245 }
int Evalue(int ele)
Definition: Card.cs:2704
static Chara pc
Definition: EClass.cs:15
int id
Definition: ELEMENT.cs:259
int Value
Definition: ELEMENT.cs:301
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 128 of file RecipeSource.cs.

129 {
130 if (idFactory.IsEmpty() || idFactory == "x" || idFactory == "none")
131 {
132 return false;
133 }
134 return true;
135 }

References idFactory.

Referenced by CraftUtil.MakeDish().

◆ ShouldList()

bool RecipeSource.ShouldList ( )
inline

Definition at line 110 of file RecipeSource.cs.

111 {
112 if (noListing)
113 {
114 if (id == "f90" && EClass.game.IsSurvival)
115 {
116 return true;
117 }
118 return false;
119 }
120 return true;
121 }
static Game game
Definition: EClass.cs:9
bool IsSurvival
Definition: Game.cs:276

References EClass.game, Game.IsSurvival, and noListing.

Referenced by BuildMenu._Search(), and WidgetCodex.Search().

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(), and RecipeManager.Create().

◆ isBridgePillar

bool RecipeSource.isBridgePillar

Definition at line 15 of file RecipeSource.cs.

Referenced by RecipeManager.Add(), and RecipeManager.Create().

◆ 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 ShouldList().

◆ 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(), and Recipe.Create().

Property Documentation

◆ idFactory

string RecipeSource.idFactory
get

Definition at line 90 of file RecipeSource.cs.

91 {
92 get
93 {
94 if (!row.factory.IsEmpty())
95 {
96 if (!isBridge)
97 {
98 if (!isBridgePillar)
99 {
100 return row.factory[0];
101 }
102 return "tool_carving";
103 }
104 return "factory_platform";
105 }
106 return null;
107 }
108 }
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 if (!EClass.sources.cards.map.TryGetValue(idFactory, out var value))
83 {
84 return idFactory;
85 }
86 return value.GetName();
87 }
88 }
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:123

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