10 public static bool IsHumanFlesh(
Thing food)
12 return !food.HasTag(CTAG.notHumanMeat) && (
FoodEffect.IsHumanFlesh(food.refCard) ||
FoodEffect.IsHumanFlesh(food.refCard2));
16 public static bool IsUndeadFlesh(
Thing food)
22 public static bool IsHumanFlesh(
CardRow r)
30 return EClass.pc.race.tag.Contains(
"human");
32 return r.isChara &&
EClass.sources.races.map[
EClass.sources.charas.map[r.id].race].tag.Contains(
"human");
36 public static bool IsUndeadFlesh(
CardRow r)
44 return EClass.pc.race.tag.Contains(
"undead");
46 return r.isChara &&
EClass.sources.races.map[
EClass.sources.charas.map[r.id].race].tag.Contains(
"undead");
52 FoodEffect.<>c__DisplayClass4_0 CS$<>8__locals1;
53 CS$<>8__locals1.c = c;
54 bool flag = EClass._zone.IsPCFaction && CS$<>8__locals1.c.IsInSpot<
TraitSpotDining>();
55 float num = (float)(100 + (flag ? 10 : 0) + Mathf.Min(food.QualityLv * 10, 100)) / 200f;
60 int num2 = food.Evalue(10);
63 CS$<>8__locals1.idTaste =
"";
66 if (food.source._origin !=
"meat" && food.source._origin !=
"dish")
68 flag3 = (flag2 =
false);
70 if (food.id ==
"deadbody")
74 string[] components = food.source.components;
75 for (
int i = 0; i < components.Length; i++)
77 if (components[i].Contains(
"egg"))
82 bool flag4 = CS$<>8__locals1.c.HasElement(1205, 1);
83 bool flag5 = food.IsDecayed || flag3;
111 if (CS$<>8__locals1.c.HasElement(1200, 1))
115 if (!CS$<>8__locals1.c.IsPC)
119 if (flag5 && !CS$<>8__locals1.c.HasElement(480, 1))
121 if (CS$<>8__locals1.c.IsPC)
125 CS$<>8__locals1.c.Say(
"food_undead",
null,
null);
127 CS$<>8__locals1.c.Say(
"food_rot",
null,
null);
134 string text = food.source._origin;
135 if (!(text ==
"meat"))
137 if (!(text ==
"fish"))
141 if (CS$<>8__locals1.c.IsPC)
143 CS$<>8__locals1.c.Say(
"food_raw_powder",
null,
null);
149 else if (CS$<>8__locals1.c.IsHuman)
151 if (CS$<>8__locals1.c.IsPC)
153 CS$<>8__locals1.c.Say(
"food_raw_fish",
null,
null);
161 if (CS$<>8__locals1.c.IsPC)
163 CS$<>8__locals1.c.Say(
"food_raw_meat",
null,
null);
169 float num5 = (float)Mathf.Min(CS$<>8__locals1.c.hunger.value, num2);
170 if (CS$<>8__locals1.c.hunger.GetPhase() >= 3)
174 if (flag5 && !CS$<>8__locals1.c.HasElement(480, 1))
176 CS$<>8__locals1.c.ModExp(70, -300);
177 CS$<>8__locals1.c.ModExp(71, -300);
178 CS$<>8__locals1.c.ModExp(72, -200);
179 CS$<>8__locals1.c.ModExp(73, -200);
180 CS$<>8__locals1.c.ModExp(74, -200);
181 CS$<>8__locals1.c.ModExp(75, 500);
182 CS$<>8__locals1.c.ModExp(76, -200);
183 CS$<>8__locals1.c.ModExp(77, -300);
187 num = num * num5 / 10f;
192 List<Element> list = food.ListValidTraits(
true,
false);
193 foreach (
Element element
in food.elements.dict.Values)
195 if (!element.source.foodEffect.IsEmpty() && list.Contains(element))
197 string[] foodEffect = element.source.foodEffect;
198 int num6 = element.id;
199 float num7 = num * (float)element.Value;
200 if (element.source.category ==
"food" && CS$<>8__locals1.c.IsPC)
202 bool flag6 = num7 >= 0f;
203 string text2 = element.source.GetText(flag6 ?
"textInc" :
"textDec",
true);
206 Msg.SetColor(flag6 ?
"positive" :
"negative");
207 CS$<>8__locals1.c.Say(text2,
null,
null);
210 string text = foodEffect[0];
211 uint num8 = <PrivateImplementationDetails>.ComputeStringHash(text);
212 if (num8 <= 1923516200U)
214 if (num8 <= 893270296U)
216 if (num8 != 207713729U)
218 if (num8 == 893270296U)
220 if (text ==
"loseWeight")
222 CS$<>8__locals1.c.ModWeight(-
EClass.rndHalf(element.Value),
true);
226 else if (text ==
"little")
228 int @
int = CS$<>8__locals1.c.GetInt(112,
null);
231 CS$<>8__locals1.c.Say(
"little_eat", CS$<>8__locals1.c,
null,
null);
232 CS$<>8__locals1.c.PlaySound(
"ding_potential", 1f,
true);
233 int v = Mathf.Max(5 - @
int / 2, 1);
234 Debug.Log(
"sister eaten:" + @
int.ToString() +
"/" + v.ToString());
235 foreach (
Element element2
in CS$<>8__locals1.c.elements.dict.Values)
237 if (element2.IsMainAttribute)
239 CS$<>8__locals1.c.elements.ModPotential(element2.id, v);
242 if (CS$<>8__locals1.c.race.id ==
"mutant" && CS$<>8__locals1.c.elements.Base(1230) < 10)
244 CS$<>8__locals1.c.Say(
"little_adam", CS$<>8__locals1.c,
null,
null);
245 CS$<>8__locals1.c.SetFeat(1230, CS$<>8__locals1.c.elements.Base(1230) + 1,
false);
247 CS$<>8__locals1.c.SetInt(112, @
int + 1);
251 else if (num8 != 1429431836U)
253 if (num8 == 1923516200U)
257 num6 = ((foodEffect.Length > 1) ?
EClass.sources.elements.alias[foodEffect[1]].id : element.id);
258 int a = (int)(num7 * (
float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
259 CS$<>8__locals1.c.ModExp(num6, a);
263 else if (text ==
"pot")
265 num6 = ((foodEffect.Length > 1) ?
EClass.sources.elements.alias[foodEffect[1]].id : element.id);
266 int vTempPotential = CS$<>8__locals1.c.elements.GetElement(num6).vTempPotential;
267 int num9 =
EClass.rndHalf((
int)(num7 / 5f) + 1);
268 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
269 CS$<>8__locals1.c.elements.ModTempPotential(num6, num9, 8);
272 else if (num8 <= 2676017222U)
274 if (num8 != 2399918791U)
276 if (num8 == 2676017222U)
278 if (text ==
"gainWeight")
280 CS$<>8__locals1.c.ModWeight(
EClass.rndHalf(element.Value),
true);
284 else if (text ==
"karma")
286 if (CS$<>8__locals1.c.IsPCParty)
288 EClass.player.ModKarma(-5);
292 else if (num8 != 3470992305U)
294 if (num8 == 3576140497U)
298 ActEffect.LoveMiracle(CS$<>8__locals1.c,
EClass.pc, element.Value * 10);
302 else if (text ==
"poison")
305 if (CS$<>8__locals1.c.isDead)
313 FoodEffect.ProcTrait(CS$<>8__locals1.c, food);
314 num3 += (float)food.Evalue(70);
315 num3 += (float)(food.Evalue(72) / 2);
316 num3 += (float)(food.Evalue(73) / 2);
317 num3 += (float)(food.Evalue(75) / 2);
318 num3 += (float)(food.Evalue(76) * 3 / 2);
319 num3 += (float)food.Evalue(440);
320 num3 += (float)(food.Evalue(445) / 2);
321 num3 -= (float)food.Evalue(71);
322 num3 -= (float)(num2 / 2);
324 if (CS$<>8__locals1.idTaste.IsEmpty())
328 CS$<>8__locals1.idTaste =
"food_great";
332 CS$<>8__locals1.idTaste =
"food_good";
336 CS$<>8__locals1.idTaste =
"food_soso";
340 CS$<>8__locals1.idTaste =
"food_average";
344 CS$<>8__locals1.idTaste =
"food_bad";
346 if (CS$<>8__locals1.c.IsPC)
348 CS$<>8__locals1.c.Say(CS$<>8__locals1.idTaste,
null,
null);
351 CS$<>8__locals1.c.Say(flag4 ?
"food_human_pos" :
"food_human_neg",
null,
null);
355 CS$<>8__locals1.c.Say(
"food_human_whine",
null,
null);
359 if (LangGame.Has(CS$<>8__locals1.idTaste +
"2"))
361 CS$<>8__locals1.c.Say(CS$<>8__locals1.idTaste +
"2", CS$<>8__locals1.c, food,
null,
null);
363 if (!CS$<>8__locals1.c.IsPCParty)
367 num2 = num2 * (100 + CS$<>8__locals1.c.Evalue(1235) * 10) / (100 + CS$<>8__locals1.c.Evalue(1234) * 10);
368 CS$<>8__locals1.c.hunger.Mod(-num2);
373 if (CS$<>8__locals1.c.IsHuman)
375 CS$<>8__locals1.c.AddCondition<
ConInsane>(200,
false);
376 CS$<>8__locals1.c.SAN.Mod(15);
378 if (
EClass.rnd(CS$<>8__locals1.c.IsHuman ? 5 : 20) == 0)
380 CS$<>8__locals1.c.SetFeat(1205, 1,
true);
386 CS$<>8__locals1.c.SetInt(31,
EClass.world.date.GetRaw(0) + 10080);
389 else if (flag4 && CS$<>8__locals1.c.GetInt(31,
null) <
EClass.world.date.GetRaw(0))
391 CS$<>8__locals1.c.SetFeat(1205, 0,
true);
393 if (flag5 && !CS$<>8__locals1.c.HasElement(480, 1))
395 CS$<>8__locals1.c.AddCondition<
ConParalyze>(100,
false);
396 CS$<>8__locals1.c.AddCondition<
ConConfuse>(200,
false);
400 CS$<>8__locals1.c.Vomit();
402 if (num2 > 20 && CS$<>8__locals1.c.HasElement(1413, 1))
409 thing.SetNum(2 +
EClass.rnd(3));
410 CS$<>8__locals1.c.Talk(
"vomit",
null,
null,
false);
411 CS$<>8__locals1.c.Say(
"fairy_vomit", CS$<>8__locals1.c, thing,
null,
null);
412 CS$<>8__locals1.c.PickOrDrop(CS$<>8__locals1.c.pos, thing,
true);
414 food.trait.OnEat(CS$<>8__locals1.c);
418 public static void ProcTrait(
Chara c,
Card t)
420 FoodEffect.<>c__DisplayClass5_0 CS$<>8__locals1;
421 CS$<>8__locals1.c = c;
422 foreach (
Element element
in t.elements.dict.Values)
426 if (element.Value >= 0)
431 CS$<>8__locals1.c.CureCondition<
ConPoison>(element.Value * 2);
434 CS$<>8__locals1.c.AddCondition<
ConPeace>(element.Value * 5,
false);
437 CS$<>8__locals1.c.CureCondition<
ConBleed>(element.Value);
448 FoodEffect.<ProcTrait>g__SayTaste|5_0(
"food_mind", ref CS$<>8__locals1);
449 CS$<>8__locals1.c.AddCondition<
ConConfuse>(-element.Value * 10,
false);
450 CS$<>8__locals1.c.AddCondition<
ConInsane>(-element.Value * 10,
false);
451 CS$<>8__locals1.c.AddCondition<
ConHallucination>(-element.Value * 20,
false);
456 FoodEffect.<ProcTrait>g__SayTaste|5_0(
"food_poison", ref CS$<>8__locals1);
457 CS$<>8__locals1.c.AddCondition<
ConPoison>(-element.Value * 10,
false);
466 internal static void <Proc>g__SayTaste|4_0(
string _id, ref
FoodEffect.<>c__DisplayClass4_0 A_1)
471 A_1.c.Say(A_1.idTaste,
null,
null);
477 internal static void <ProcTrait>g__SayTaste|5_0(
string _id, ref
FoodEffect.<>c__DisplayClass5_0 A_1)
481 A_1.c.Say(_id,
null,
null);