7 {
8 food.CheckJustCooked();
10 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
11 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
12 if (num2 < 0.1f)
13 {
14 num2 = 0.1f;
15 }
16 int num3 =
food.Evalue(10);
17 float num4 = 25f;
18 float num5 = 1f;
19 string idTaste = "";
20 bool flag2 =
food.HasElement(708);
21 bool flag3 =
food.HasElement(709);
23 bool flag5 = food.IsDecayed || flag3;
26 {
29 if (num6 < 2 || flag6)
30 {
31 if (num6 == 1 || flag6 ||
EClass.
rnd(4) == 0)
32 {
34 }
35 }
36 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
37 {
39 }
40 }
42 {
43 num2 *= 1.5f;
44 }
46 {
47 num2 *= 0.5f;
48 }
49 if (flag4)
50 {
51 if (flag2)
52 {
53 num5 *= 2f;
54 num2 *= 1.5f;
55 }
56 else
57 {
58 num5 *= 0.5f;
59 num2 /= 2f;
60 num3 /= 2;
61 }
62 }
63 else if (flag2)
64 {
65 num5 = 0f;
66 num2 *= 0.5f;
67 }
69 {
70 num2 *= 1.25f;
71 }
73 {
74 num2 *= 3f;
75 }
77 {
79 {
80 if (flag3)
81 {
83 }
85 }
86 num5 = 0f;
87 num3 /= 2;
88 }
89 else
90 {
91 switch (
food.source._origin)
92 {
93 case "meat":
95 {
96 c.
Say(
"food_raw_meat");
97 }
98 num2 *= 0.7f;
99 num5 = 0.5f;
100 break;
101 case "fish":
103 {
105 {
106 c.
Say(
"food_raw_fish");
107 }
108 num2 *= 0.9f;
109 num5 = 0.5f;
110 }
111 break;
112 case "dough":
114 {
115 c.
Say(
"food_raw_powder");
116 }
117 num2 *= 0.9f;
118 num5 = 0.5f;
119 break;
120 }
121 }
124 {
125 num7 *= 1.1f;
126 }
128 {
137 }
138 else
139 {
140 num2 = num2 * num7 / 10f;
142 {
143 num2 = 0.01f;
144 }
145 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
146 foreach (
Element value
in food.elements.dict.Values)
147 {
148 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
149 {
150 continue;
151 }
152 string[] foodEffect = value.
source.foodEffect;
154 float num8 = num2 * (float)value.
Value;
156 {
157 bool flag7 = num8 >= 0f;
158 string text = value.
source.GetText(flag7 ?
"textInc" :
"textDec", returnNull:
true);
159 if (text != null)
160 {
163 }
164 }
165 switch (foodEffect[0])
166 {
167 case "god":
168 {
170 if (int2 < 10)
171 {
173 {
175 {
177 }
178 }
179 }
180 c.
Say(
"little_eat", c);
184 break;
185 }
186 case "exp":
187 {
189 int a = (int)(num8 * (float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
191 break;
192 }
193 case "pot":
194 {
198 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
200 break;
201 }
202 case "karma":
204 {
206 }
207 break;
208 case "poison":
211 {
212 return;
213 }
214 break;
215 case "love":
217 break;
218 case "loseWeight":
220 break;
221 case "gainWeight":
223 break;
224 case "little":
225 {
227 if (@int < 30)
228 {
229 c.
Say(
"little_eat", c);
231 int v = Mathf.Max(5 - @int / 2, 1);
232 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
234 {
236 {
238 }
239 }
240 }
242 {
243 c.
Say(
"little_adam", c);
245 }
247 break;
248 }
249 }
250 }
251 }
253 num4 += (float)
food.Evalue(70);
254 num4 += (float)(
food.Evalue(72) / 2);
255 num4 += (float)(
food.Evalue(73) / 2);
256 num4 += (float)(
food.Evalue(75) / 2);
257 num4 += (float)(
food.Evalue(76) * 3 / 2);
258 num4 += (float)
food.Evalue(440);
259 num4 += (float)(
food.Evalue(445) / 2);
260 num4 -= (float)
food.Evalue(71);
261 num4 += (float)(num3 / 2);
262 num4 *= num5;
263 if (idTaste.IsEmpty())
264 {
265 if (num4 > 100f)
266 {
267 idTaste = "food_great";
268 }
269 else if (num4 > 70f)
270 {
271 idTaste = "food_good";
272 }
273 else if (num4 > 50f)
274 {
275 idTaste = "food_soso";
276 }
277 else if (num4 > 30f)
278 {
279 idTaste = "food_average";
280 }
281 else
282 {
283 idTaste = "food_bad";
284 }
286 {
288 if (flag2)
289 {
290 c.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
291 }
292 else if (flag4)
293 {
294 c.
Say(
"food_human_whine");
295 }
296 }
297 }
299 {
301 }
303 {
304 num3 *= 2;
305 }
306 num3 = num3 * (100 + c.
Evalue(1235) * 10) / (100 + c.
Evalue(1234) * 10 + c.
Evalue(1236) * 15);
308 if (flag2)
309 {
310 if (!flag4)
311 {
313 {
316 }
318 {
320 flag4 = true;
321 }
322 }
323 if (flag4)
324 {
326 }
327 }
329 {
331 }
333 {
336 }
338 {
340 }
342 {
345 {
347 }
350 c.
Say(
"fairy_vomit", c, thing);
352 }
355 {
356 food.trait.OnDrink(c);
357 }
358 }
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)
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)
Dictionary< int, Element > dict
Element ModPotential(int ele, int v)
Element ModTempPotential(int ele, int v, int threshMsg=0)
void ModExp(int ele, int a, bool chain=false)
Element GetElement(string alias)
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)