12 {
13 food.CheckJustCooked();
15 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
16 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
17 if (num2 < 0.1f)
18 {
19 num2 = 0.1f;
20 }
21 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
22 float num4 = 25f;
23 float num5 = 1f;
24 string idTaste = "";
25 bool flag2 =
food.HasElement(708);
26 bool flag3 =
food.HasElement(709);
28 bool flag5 = food.IsDecayed || flag3;
32 {
35 if (num6 < 2 || flag7)
36 {
37 if (num6 == 1 || flag7 ||
EClass.
rnd(4) == 0)
38 {
40 }
41 }
42 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
43 {
45 }
46 }
48 {
49 num2 *= 1.5f;
50 }
52 {
53 num2 *= 0.5f;
54 }
55 if (flag4)
56 {
57 if (flag2)
58 {
59 num5 *= 2f;
60 num2 *= 1.5f;
61 }
62 else
63 {
64 num5 *= 0.5f;
65 num2 /= 2f;
66 num3 /= 2;
67 }
68 }
69 else if (flag2)
70 {
71 num5 = 0f;
72 num2 *= 0.5f;
73 }
75 {
76 num2 *= 1.25f;
77 }
79 {
80 num2 *= 3f;
81 }
83 {
85 {
86 if (flag3)
87 {
89 }
91 }
92 num5 = 0f;
93 num3 /= 2;
94 }
95 else
96 {
97 switch (
food.source._origin)
98 {
99 case "meat":
101 {
102 c.
Say(
"food_raw_meat");
103 }
104 num2 *= 0.7f;
105 num5 = 0.5f;
106 break;
107 case "fish":
109 {
111 {
112 c.
Say(
"food_raw_fish");
113 }
114 num2 *= 0.9f;
115 num5 = 0.5f;
116 }
117 break;
118 case "dough":
120 {
121 c.
Say(
"food_raw_powder");
122 }
123 num2 *= 0.9f;
124 num5 = 0.5f;
125 break;
126 }
127 }
130 {
131 num7 *= 1.1f;
132 }
134 {
143 }
144 else
145 {
146 num2 = num2 * num7 / 10f;
148 {
149 num2 = 0.01f;
150 }
151 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
152 foreach (
Element value
in food.elements.dict.Values)
153 {
154 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
155 {
156 continue;
157 }
158 string[] foodEffect = value.
source.foodEffect;
160 float num8 = num2 * (float)value.
Value;
162 {
163 bool flag8 = num8 >= 0f;
164 string text = value.
source.GetText(flag8 ?
"textInc" :
"textDec", returnNull:
true);
165 if (text != null)
166 {
169 }
170 }
171 switch (foodEffect[0])
172 {
173 case "god":
174 {
176 if (int2 < 10)
177 {
179 {
181 {
183 }
184 }
185 }
186 c.
Say(
"little_eat", c);
190 flag6 = false;
191 break;
192 }
193 case "exp":
194 {
196 int a = (int)(num8 * (float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
198 break;
199 }
200 case "pot":
201 {
205 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
207 break;
208 }
209 case "karma":
211 {
213 }
214 break;
215 case "poison":
218 {
219 return;
220 }
221 break;
222 case "love":
224 break;
225 case "loseWeight":
227 break;
228 case "gainWeight":
230 break;
231 case "little":
232 {
234 if (@int < 30)
235 {
236 c.
Say(
"little_eat", c);
238 int v = Mathf.Max(5 - @int / 2, 1);
239 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
241 {
243 {
245 }
246 }
247 }
249 {
250 c.
Say(
"little_adam", c);
252 }
254 flag6 = false;
255 break;
256 }
257 }
258 }
259 }
261 num4 += (float)
food.Evalue(70);
262 num4 += (float)(
food.Evalue(72) / 2);
263 num4 += (float)(
food.Evalue(73) / 2);
264 num4 += (float)(
food.Evalue(75) / 2);
265 num4 += (float)(
food.Evalue(76) * 3 / 2);
266 num4 += (float)
food.Evalue(440);
267 num4 += (float)(
food.Evalue(445) / 2);
268 num4 -= (float)
food.Evalue(71);
269 num4 += (float)(num3 / 2);
270 num4 *= num5;
271 if (idTaste.IsEmpty())
272 {
273 if (num4 > 100f)
274 {
275 idTaste = "food_great";
276 }
277 else if (num4 > 70f)
278 {
279 idTaste = "food_good";
280 }
281 else if (num4 > 50f)
282 {
283 idTaste = "food_soso";
284 }
285 else if (num4 > 30f)
286 {
287 idTaste = "food_average";
288 }
289 else
290 {
291 idTaste = "food_bad";
292 }
294 {
296 if (flag2)
297 {
298 c.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
299 }
300 else if (flag4)
301 {
302 c.
Say(
"food_human_whine");
303 }
304 }
305 }
307 {
309 }
311 {
312 num3 *= 2;
313 }
314 num3 = num3 * (100 + c.
Evalue(1235) * 10) / (100 + c.
Evalue(1234) * 10 + c.
Evalue(1236) * 15);
316 if (flag2)
317 {
318 if (!flag4)
319 {
321 {
324 }
326 {
328 flag4 = true;
329 }
330 }
331 if (flag4)
332 {
334 }
335 }
337 {
339 }
341 {
344 }
346 {
348 }
350 {
353 {
355 }
358 c.
Say(
"fairy_vomit", c, thing);
360 }
363 {
364 food.trait.OnDrink(c);
365 }
366 if (consume)
367 {
368 num7 += 5f;
369 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
370 {
371 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
372 food.SetBool(125, enable:
true);
373 }
374 else
375 {
377 }
378 }
379 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static void Poison(Chara tc, Chara c, int power)
static void LoveMiracle(Chara tc, Chara c, int power, bool plus=false, BlessedState? state=null)
int GetInt(int id, int? defaultInt=null)
void SetInt(int id, int value=0)
ElementContainerCard elements
bool HasElement(int ele, int req=1)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
void ModExp(string alias, int a)
void Say(string lang, string ref1=null, string ref2=null)
Condition AddCondition(string id, int p=100, bool force=false)
void SetFeat(int id, int value=1, bool msg=false)
bool HasCondition(string alias)
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
override bool IsPCFaction
SourceThing.Row GetFavFood()
void ModWeight(int a, bool ignoreLimit=false)
void AddFoodHistory(Thing food)
int CountNumEaten(Thing food)
int GetRaw(int offsetHours=0)
static SourceManager sources
static int rndHalf(int a)
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
Element ModPotential(int ele, int v)
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element GetElement(string alias)
static bool IsLeftoverable(Thing food)
static void ProcTrait(Chara c, Card t)
static bool Has(string id)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Thing ApplySeed(Thing t, int refval)