12 {
14 if (
food.id ==
"bloodsample")
15 {
17 return;
18 }
19 food.CheckJustCooked();
21 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
22 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
23 if (num2 < 0.1f)
24 {
25 num2 = 0.1f;
26 }
27 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
28 float num4 = 25f;
29 float num5 = 1f;
30 string idTaste = "";
31 bool flag2 =
food.HasElement(708);
32 bool flag3 =
food.HasElement(709);
34 bool flag5 = food.IsDecayed || flag3;
38 {
41 if (num6 < 2 || flag7)
42 {
43 if (num6 == 1 || flag7 ||
EClass.
rnd(4) == 0)
44 {
46 }
47 }
48 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
49 {
51 }
52 }
54 {
55 num2 *= 1.5f;
56 }
58 {
59 num2 *= 0.5f;
60 }
61 if (flag4)
62 {
63 if (flag2)
64 {
65 num5 *= 2f;
66 num2 *= 1.3f;
67 }
68 else
69 {
70 num5 *= 0.5f;
71 num2 /= 2f;
72 num3 /= 2;
73 }
74 }
75 else if (flag2)
76 {
77 num5 = 0f;
78 num2 *= 0.5f;
79 }
81 {
82 if (
food.HasElement(710))
83 {
84 num2 = num2 * 0.1f * (float)(
food.Evalue(710) + 10);
85 }
86 else
87 {
88 num3 /= 10;
89 }
90 }
92 {
93 num2 *= 1f + (float)c2.
Evalue(1200) * 0.25f;
94 }
96 {
97 num2 *= 3f;
98 }
100 {
102 {
103 if (flag3)
104 {
105 c2.
Say(
"food_undead");
106 }
108 }
109 num5 = 0f;
110 num3 /= 2;
111 }
112 else
113 {
114 switch (
food.source._origin)
115 {
116 case "meat":
118 {
119 c2.
Say(
"food_raw_meat");
120 }
121 num2 *= 0.7f;
122 num5 = 0.5f;
123 break;
124 case "fish":
126 {
128 {
129 c2.
Say(
"food_raw_fish");
130 }
131 num2 *= 0.9f;
132 num5 = 0.5f;
133 }
134 break;
135 case "dough":
137 {
138 c2.
Say(
"food_raw_powder");
139 }
140 num2 *= 0.9f;
141 num5 = 0.5f;
142 break;
143 }
144 }
147 {
148 num7 *= 1.1f;
149 }
151 {
160 }
161 else
162 {
163 num2 = num2 * num7 / 10f;
165 {
166 num2 = 0.01f;
167 }
168 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
169 foreach (
Element value
in food.elements.dict.Values)
170 {
171 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
172 {
173 continue;
174 }
175 string[] foodEffect = value.
source.foodEffect;
177 float num8 = num2 * (float)value.
Value;
179 {
180 bool flag8 = num8 >= 0f;
181 string text = value.
source.GetText(flag8 ?
"textInc" :
"textDec", returnNull:
true);
182 if (text != null)
183 {
186 }
187 }
188 switch (foodEffect[0])
189 {
190 case "god":
191 {
192 int int2 = c2.
GetInt(117);
193 if (int2 < 10)
194 {
196 {
198 {
200 }
201 }
202 }
203 c2.
Say(
"little_eat", c2);
207 flag6 = false;
208 break;
209 }
210 case "exp":
211 {
213 int a = (int)(num8 * (float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
215 break;
216 }
217 case "pot":
218 {
222 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
224 break;
225 }
226 case "karma":
228 {
230 }
231 break;
232 case "poison":
235 {
236 break;
237 }
238 goto IL_0f76;
239 case "love":
241 break;
242 case "loseWeight":
244 break;
245 case "gainWeight":
247 break;
248 case "little":
249 {
250 int @
int = c2.
GetInt(112);
251 if (@int < 30)
252 {
253 c2.
Say(
"little_eat", c2);
255 int v = Mathf.Max(5 - @int / 2, 1);
256 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
258 {
260 {
262 }
263 }
264 }
266 {
267 c2.
Say(
"little_adam", c2);
269 }
271 break;
272 }
273 }
274 }
275 }
277 num4 += (float)
food.Evalue(70);
278 num4 += (float)(
food.Evalue(72) / 2);
279 num4 += (float)(
food.Evalue(73) / 2);
280 num4 += (float)(
food.Evalue(75) / 2);
281 num4 += (float)(
food.Evalue(76) * 3 / 2);
282 num4 += (float)
food.Evalue(440);
283 num4 += (float)(
food.Evalue(445) / 2);
284 num4 -= (float)
food.Evalue(71);
285 num4 += (float)(num3 / 2);
286 num4 *= num5;
287 if (idTaste.IsEmpty())
288 {
289 if (num4 > 100f)
290 {
291 idTaste = "food_great";
292 }
293 else if (num4 > 70f)
294 {
295 idTaste = "food_good";
296 }
297 else if (num4 > 50f)
298 {
299 idTaste = "food_soso";
300 }
301 else if (num4 > 30f)
302 {
303 idTaste = "food_average";
304 }
305 else
306 {
307 idTaste = "food_bad";
308 }
310 {
312 if (flag2)
313 {
314 c2.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
315 }
316 else if (flag4)
317 {
318 c2.
Say(
"food_human_whine");
319 }
320 }
321 }
323 {
324 c2.
Say(idTaste +
"2", c2,
food);
325 }
327 {
328 num3 *= 2;
329 }
330 num3 = num3 * (100 + c2.
Evalue(1235) * 10) / (100 + c2.
Evalue(1234) * 10 + c2.
Evalue(1236) * 15);
332 if (flag2)
333 {
334 if (!flag4)
335 {
337 {
340 }
342 {
343 c2.
SetFeat(1205, 1, msg:
true);
344 flag4 = true;
345 }
346 }
347 if (flag4)
348 {
350 }
351 }
353 {
354 c2.
SetFeat(1205, 0, msg:
true);
355 }
357 {
360 }
362 {
364 }
366 {
369 {
371 }
374 c2.
Say(
"fairy_vomit", c2, thing);
376 }
377 food.trait.OnEat(c2);
379 {
380 food.trait.OnDrink(c2);
381 }
382 goto IL_0f76;
383 IL_0f76:
384 if (consume)
385 {
386 num7 += 5f;
387 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
388 {
389 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
390 food.SetBool(125, enable:
true);
391 if (
food.HasElement(1229))
392 {
393 food.elements.Remove(1229);
394 }
395 }
396 else
397 {
399 }
400 }
402 {
403 return;
404 }
406 {
409 item.PlaySound(
"Animal/Cat/cat_angry");
411 {
413 }
414 }
415 }
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, EffectId idEffect=EffectId.Love, 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)
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Thing ApplySeed(Thing t, int refval)