1using System.Collections.Generic;
18 List<Element> list =
new List<Element>();
19 foreach (
Element value
in t.elements.dict.Values)
28 Element element = list.RandomItem();
30 if (element.
Value > 60)
32 t.elements.SetTo(element.
id, 60);
42 if (t.elements.dict.ContainsKey(e.id))
50 t.elements.SetBase(row.
id, 1);
58 List<Thing> list =
new List<Thing>();
60 Debug.Log(recipeSource);
61 if (recipeSource ==
null)
77 MakeDish(
food, list, num, crafter);
78 if (crafter !=
null && crafter.id !=
"rodwyn")
80 if (
food.HasElement(709))
82 food.elements.Remove(709);
84 if (
food.HasElement(708) && !crafter.HasElement(1205))
86 food.elements.Remove(708);
93 List<Thing> list =
new List<Thing>();
94 bool flag =
food.sourceCard.vals.Contains(
"fixed");
95 for (
int i = 0; i < ings.Count; i++)
97 Thing thing = ings[i];
103 if (!IsIgnoreName(thing))
110 Thing thing2 = list.RandomItem();
113 food.MakeRefFrom(thing2);
117 food.c_altName =
food.TryGetFoodName(thing2);
118 if (thing2.
id ==
"_egg" || thing2.
id ==
"egg_fertilized")
120 food.c_altName =
"_egg".lang(
food.c_altName);
125 MixIngredients(
food, ings,
MixType.Food, qualityBonus, crafter);
126 static bool IsIgnoreName(
Card t)
151 MixIngredients(thing, ings, type, 999, crafter);
158 bool isFood = type ==
MixType.Food;
159 int nutFactor = 100 - (ings.Count - 1) * 5;
160 Thing thing = ((ings.Count > 0) ? ings[0] :
null);
161 if (crafter !=
null && crafter.Evalue(1650) >= 3)
170 if ((uint)(
id - 914) > 1u && value2.
Value >= 0 && (value2.
HasTag(
"noInherit") || IsValidTrait(value2)))
190 foreach (
Thing ing
in ings)
206 product.isWeightChanged =
true;
207 product.c_weight = num;
208 product.c_priceAdd = num2;
210 product.c_priceCopy = num3;
213 product.elements.SetTo(10, thing.Evalue(10) / 4);
214 product.isWeightChanged =
true;
215 product.c_weight = Mathf.Min(thing.SelfWeight / 6, 1000);
216 product.c_idRefCard = thing.id;
217 product.c_priceCopy = ((thing.c_priceCopy == 0) ? thing.GetValue() : thing.c_priceCopy);
218 product.c_fixedValue = ((thing.c_fixedValue == 0) ? thing.sourceCard.value : thing.c_fixedValue) / 4;
219 product.c_priceAdd = 0;
220 product.decay = thing.decay;
221 product.elements.SetBase(707, 1);
222 product.SetTier(thing.tier, setTraits:
false);
223 product.idSkin = ((thing.trait is
TraitFoodFishSlice) ? thing.idSkin : (thing.HasTag(
CTAG.bigFish) ? 1 : 0));
225 if (product.HasElement(652))
227 product.ChangeWeight((isFood ? num : product.Thing.source.weight) * 100 / (100 + product.Evalue(652)));
229 if (product.elements.Value(2) > maxQuality)
231 product.elements.SetTo(2, maxQuality);
233 string id2 = product.id;
234 if (!(id2 ==
"zassouni"))
238 int num4 = 1 + product.Evalue(2) + product.Evalue(751);
243 foreach (
Thing ing2
in ings)
245 if (ing2 !=
null && ing2.
Thing !=
null && !(ing2.
id !=
"gem"))
247 num4 *= ing2.Thing.material.hardness / 20 + 2;
252 num4 = EClass.pc.FameLv + 10 - 1;
254 product.SetInt(25, num4);
259 product.elements.ModBase(10, 6);
261 if (product.HasElement(762))
263 product.elements.ModBase(10, product.Evalue(762) / 5);
264 if (product.Evalue(10) < 1)
266 product.elements.SetTo(10, 1);
272 if (e.
HasTag(
"noInherit"))
285 return product.IsInheritFoodTraits;
297 void MixElements(
Card t)
303 if (IsValidTrait(value3) && (!
noMix || value3.
id == 2))
307 product.elements.ModBase(value3.
id, value3.
Value);
311 int num5 = product.elements.Base(value3.
id);
312 if ((num5 <= 0 && value3.
Value < 0 && value3.
Value < num5) || (value3.
Value > 0 && value3.
Value > num5))
314 product.elements.SetTo(value3.
id, value3.
Value);
321 product.elements.ModBase(10, t.
Evalue(10) * nutFactor / 100);
ElementContainerCard elements
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
bool HasCraftBonusTrait()
virtual CardRow sourceCard
List< Element > ListCraftBonusTraits()
Thing Add(string id, int num=1, int lv=1)
int GetValue(PriceType priceType=PriceType.Default, bool sell=false)
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 ModBase(int ele, int v)
void SetTo(int id, int v)
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)