11 public static void ModRandomFoodEnc(
Thing t)
13 List<Element> list =
new List<Element>();
14 foreach (
Element element
in t.elements.dict.Values)
16 if (element.IsFoodTrait)
26 t.elements.ModBase(element2.id,
EClass.rnd(6) + 1);
27 if (element2.Value > 60)
29 t.elements.SetTo(element2.id, 60);
34 public static void AddRandomFoodEnc(
Thing t)
37 where e.foodEffect.Length > 1 &&
CraftUtil.ListFoodEffect.Contains(e.foodEffect[0])
41 if (t.elements.dict.ContainsKey(e.id))
51 t.elements.SetBase(row.id, 1, 0);
56 public static void MakeDish(
Thing food,
int lv)
59 List<Thing> list =
new List<Thing>();
61 Debug.Log(recipeSource);
62 if (recipeSource ==
null)
66 int num = Mathf.Min(
EClass.rnd(lv), 50);
71 thing.SetEncLv(thing.encLV / 2);
72 if (num > 0 &&
EClass.rnd(3) == 0)
74 thing.elements.SetBase(2, num, 0);
82 public static void MakeDish(
Card food, List<Thing> ings,
int qualityBonus)
84 List<Thing> list =
new List<Thing>();
85 bool flag = food.sourceCard.vals.Contains(
"fixed");
86 for (
int i = 0; i < ings.Count; i++)
88 Thing thing = ings[i];
94 if (!
CraftUtil.<MakeDish>g__IsIgnoreName|5_0(thing))
104 food.MakeRefFrom(thing2,
null);
105 if (thing2.c_idRefCard !=
null)
107 food.c_idRefCard = thing2.c_idRefCard;
108 food.c_altName = food.TryGetFoodName(thing2);
109 if (thing2.id ==
"_egg" || thing2.id ==
"egg_fertilized")
111 food.c_altName =
"_egg".lang(food.c_altName,
null,
null,
null,
null);
120 public static Thing MixIngredients(
string idProduct, List<Thing> ings,
CraftUtil.MixType type,
int idMat = 0)
125 thing.ChangeMaterial(idMat);
127 CraftUtil.MixIngredients(thing, ings, type, 999);
132 public static Card MixIngredients(
Card product, List<Thing> ings,
CraftUtil.MixType type,
int maxQuality)
134 CraftUtil.<>c__DisplayClass7_0 CS$<>8__locals1;
135 CS$<>8__locals1.type = type;
136 CS$<>8__locals1.product = product;
137 CS$<>8__locals1.isFood = (CS$<>8__locals1.type ==
CraftUtil.MixType.Food);
138 foreach (
Element element
in CS$<>8__locals1.product.elements.dict.Values)
141 if (
id - 914 > 1 && element.Value >= 0 &&
CraftUtil.<MixIngredients>g__IsValidTrait|7_0(element, ref CS$<>8__locals1))
143 CS$<>8__locals1.product.elements.SetTo(element.id, 0);
146 if (CS$<>8__locals1.isFood)
148 CS$<>8__locals1.product.elements.SetTo(10, 5);
152 foreach (
Thing thing
in ings)
156 CraftUtil.<MixIngredients>g__MixElements|7_1(thing, ref CS$<>8__locals1);
157 if (CS$<>8__locals1.isFood)
159 num += Mathf.Clamp(thing.SelfWeight * 80 / 100, 50, 400 + thing.SelfWeight / 20);
160 int value = thing.GetValue(
false);
165 if (CS$<>8__locals1.isFood)
167 CS$<>8__locals1.product.isWeightChanged =
true;
168 CS$<>8__locals1.product.c_weight = num;
169 CS$<>8__locals1.product.c_priceAdd = num2;
171 if (CS$<>8__locals1.product.elements.Value(2) > maxQuality)
173 CS$<>8__locals1.product.elements.SetTo(2, maxQuality);
175 return CS$<>8__locals1.product;
180 internal static bool <MakeDish>g__IsIgnoreName|5_0(
Card t)
186 string origin = t.sourceCard._origin;
187 return origin ==
"dough" || origin ==
"dish" || origin ==
"dish_lunch";
192 internal static bool <MixIngredients>g__IsValidTrait|7_0(
Element e, ref
CraftUtil.<>c__DisplayClass7_0 A_1)
194 CraftUtil.MixType type = A_1.type;
199 if (e.IsFoodTrait || e.IsTrait || e.id == 2)
213 return A_1.product.ShowFoodEnc;
221 internal static void <MixIngredients>g__MixElements|7_1(
Card t, ref
CraftUtil.<>c__DisplayClass7_0 A_1)
227 foreach (
Element element
in t.elements.dict.Values)
229 if (
CraftUtil.<MixIngredients>g__IsValidTrait|7_0(element, ref A_1))
231 if (A_1.isFood && element.IsFoodTraitMain)
233 A_1.product.elements.ModBase(element.id, element.Value);
237 int num = A_1.product.elements.Base(element.id);
238 if ((num <= 0 && element.Value < 0 && element.Value < num) || (element.Value > 0 && element.Value > num))
240 A_1.product.elements.SetTo(element.id, element.Value);
247 A_1.product.elements.ModBase(10, t.Evalue(10));
252 public static string[] ListFoodEffect =
new string[]