1using System.Collections.Generic;
17 List<Element> list =
new List<Element>();
18 foreach (
Element value
in t.elements.dict.Values)
27 Element element = list.RandomItem();
29 if (element.
Value > 60)
31 t.elements.SetTo(element.
id, 60);
41 if (t.elements.dict.ContainsKey(e.id))
49 t.elements.SetBase(row.
id, 1);
57 List<Thing> list =
new List<Thing>();
59 Debug.Log(recipeSource);
60 if (recipeSource ==
null)
76 MakeDish(
food, list, num, crafter);
81 List<Thing> list =
new List<Thing>();
82 bool flag =
food.sourceCard.vals.Contains(
"fixed");
83 for (
int i = 0; i < ings.Count; i++)
85 Thing thing = ings[i];
91 if (!IsIgnoreName(thing))
98 Thing thing2 = list.RandomItem();
101 food.MakeRefFrom(thing2);
105 food.c_altName =
food.TryGetFoodName(thing2);
106 if (thing2.
id ==
"_egg" || thing2.
id ==
"egg_fertilized")
108 food.c_altName =
"_egg".lang(
food.c_altName);
113 MixIngredients(
food, ings,
MixType.Food, qualityBonus, crafter);
114 static bool IsIgnoreName(
Card t)
139 MixIngredients(thing, ings, type, 999, crafter);
145 bool isFood = type ==
MixType.Food;
146 int nutFactor = 100 - (ings.Count - 1) * 5;
147 if (crafter !=
null && crafter.Evalue(1650) >= 3)
151 foreach (
Element value2
in product.elements.dict.Values)
154 if ((uint)(
id - 914) > 1u && value2.
Value >= 0 && (value2.
HasTag(
"noInherit") || IsValidTrait(value2)))
156 product.elements.SetTo(value2.
id, 0);
159 if (product.HasTag(
CTAG.dish_bonus))
161 foreach (
Element value3
in product.sourceCard.model.elements.dict.Values)
165 product.elements.ModBase(value3.
id, value3.
Value);
171 product.elements.SetTo(10, 5);
175 foreach (
Thing ing
in ings)
190 product.isWeightChanged =
true;
191 product.c_weight = num;
192 product.c_priceAdd = num2;
194 if (product.HasElement(652))
196 product.ChangeWeight((isFood ? num : product.Thing.source.weight) * 100 / (100 + product.Evalue(652)));
198 if (product.elements.Value(2) > maxQuality)
200 product.elements.SetTo(2, maxQuality);
202 string id2 = product.id;
203 if (!(id2 ==
"zassouni"))
207 int num3 = 1 + product.Evalue(2) + product.Evalue(751);
212 foreach (
Thing ing2
in ings)
214 if (ing2 !=
null && ing2.
Thing !=
null && !(ing2.
id !=
"gem"))
216 num3 *= ing2.Thing.material.hardness / 20 + 2;
221 num3 = EClass.pc.FameLv + 10 - 1;
223 product.SetInt(25, num3);
228 product.elements.ModBase(10, 6);
233 if (e.
HasTag(
"noInherit"))
246 return product.ShowFoodEnc;
258 void MixElements(
Card t)
264 if (IsValidTrait(value4))
268 product.elements.ModBase(value4.
id, value4.
Value);
272 int num4 = product.elements.Base(value4.
id);
273 if ((num4 <= 0 && value4.
Value < 0 && value4.
Value < num4) || (value4.
Value > 0 && value4.
Value > num4))
275 product.elements.SetTo(value4.
id, value4.
Value);
282 product.elements.ModBase(10, t.
Evalue(10) * nutFactor / 100);
ElementContainerCard elements
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
int GetValue(bool sell=false)
virtual CardRow sourceCard
Thing Add(string id, int num=1, int lv=1)
static void MakeDish(Thing food, int lv, Chara crafter=null)
static void MakeDish(Card food, List< Thing > ings, int qualityBonus, Chara crafter=null)
static void AddRandomFoodEnc(Thing t)
static Thing MixIngredients(string idProduct, List< Thing > ings, MixType type, int idMat=0, Chara crafter=null)
static void ModRandomFoodEnc(Thing t)
static string[] ListFoodEffect
static Card MixIngredients(Card product, List< Thing > ings, MixType type, int maxQuality, Chara crafter=null)
static SourceManager sources
Dictionary< int, Element > dict
Element SetBase(string alias, int v, int potential=0)
static RecipeSource Get(string id)
List< Recipe.Ingredient > GetIngredients()
static Thing Create(string id, int idMat=-1, int lv=-1)
static void LevelSeed(Thing t, SourceObj.Row obj, int num)