1using System.Collections.Generic;
9 if (
food.HasElement(758) ||
food.HasElement(1229))
18 if (
food.id ==
"bloodsample")
23 food.CheckJustCooked();
24 bool flag = EClass._zone.IsPCFactionOrTent && c.IsInSpot<
TraitSpotDining>();
25 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
26 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
31 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
35 bool flag2 =
food.HasElement(708);
36 bool flag3 =
food.HasElement(709);
38 bool flag5 = food.IsDecayed || flag3;
46 if (num6 < 2 || flag8)
48 if (num6 == 1 || flag8 ||
EClass.
rnd(4) == 0)
53 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
87 if (
food.HasElement(710))
89 num2 = num2 * 0.1f * (float)(
food.Evalue(710) + 10);
98 num2 *= 1f + (float)c.
Evalue(1200) * 0.3f;
110 c.
Say(
"food_undead");
119 switch (
food.source._origin)
124 c.
Say(
"food_raw_meat");
134 c.
Say(
"food_raw_fish");
143 c.
Say(
"food_raw_powder");
150 float num7 = (flag7 ? num3 : Mathf.Min(c.
hunger.
value, num3));
161 num4 += (float)
food.Evalue(70);
162 num4 += (float)(
food.Evalue(72) / 2);
163 num4 += (float)(
food.Evalue(73) / 2);
164 num4 += (float)(
food.Evalue(75) / 2);
165 num4 += (float)(
food.Evalue(76) * 3 / 2);
166 num4 += (float)
food.Evalue(440);
167 num4 += (float)(
food.Evalue(445) / 2);
168 num4 -= (float)
food.Evalue(71);
169 num4 += (float)
food.Evalue(18);
170 num4 += (float)(num3 / 2);
172 if (idTaste.IsEmpty())
176 idTaste =
"food_great";
180 idTaste =
"food_good";
184 idTaste =
"food_soso";
188 idTaste =
"food_average";
192 idTaste =
"food_bad";
199 c.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
203 c.
Say(
"food_human_whine");
215 num3 = num3 * (100 + c.
Evalue(1235) * 10) / (100 + c.
Evalue(1234) * 10 + c.
Evalue(1236) * 15);
259 c.
Say(
"fairy_vomit", c, thing);
268 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
270 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
271 food.SetBool(125, enable:
true);
272 if (
food.HasElement(1229))
274 food.elements.Remove(1229);
293 item.PlaySound(
"Animal/Cat/cat_angry");
300 EClass.player.stats.angryCats += num8;
323 int slot = c_DNA.
slot;
325 int excess = c.CurrentGeneSlot + slot - c.
MaxGeneSlot;
331 RemoveDNA(fromOldest:
false);
337 genes.
items.Shuffle();
338 Msg.
Say(
"reconstruct", c);
339 c.
Say(
"food_mind", c);
346 while (excess > 0 && genes !=
null && genes.
items.Count != 0)
348 RemoveDNA(fromOldest:
true);
352 c.
Say(
"little_eat", c);
356 void RemoveDNA(
bool fromOldest)
358 DNA dNA = (fromOldest ? genes.
items[0] : genes.
items.Last());
366 int num = Mathf.Max(1,
food.Evalue(10));
367 float num2 = (float)(100 + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
384 food.trait.OnDrink(c);
390 bool flag =
food.HasElement(709);
403 effP = effP * validFill / 10f;
408 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
409 foreach (
Element value
in food.elements.dict.Values)
411 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
415 string[] foodEffect = value.
source.foodEffect;
417 float num = effP * (float)value.
Value;
418 if (value.
source.category ==
"food" && c.IsPC)
420 bool flag2 = num >= 0f;
421 string text = value.
source.GetText(flag2 ?
"textInc" :
"textDec", returnNull:
true);
428 switch (foodEffect[0])
432 int int2 = c.GetInt(117);
435 foreach (
Element value2
in c.elements.dict.Values)
439 c.elements.ModPotential(value2.
id, 2);
443 c.Say(
"little_eat", c);
444 c.PlaySound(
"ding_potential");
445 c.elements.ModExp(306, -1000f);
446 c.SetInt(117, int2 + 1);
452 int a = (int)(num * (
float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
459 int vTempPotential = c.elements.GetElement(
id).vTempPotential;
461 num2 = num2 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
462 c.elements.ModTempPotential(
id, num2, 8);
485 int @
int = c.GetInt(112);
488 c.Say(
"little_eat", c);
489 c.PlaySound(
"ding_potential");
490 int v = Mathf.Max(5 - @
int / 2, 1);
491 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
492 foreach (
Element value3
in c.elements.dict.Values)
496 c.elements.ModPotential(value3.
id, v);
500 if (c.race.id ==
"mutant" && c.elements.Base(1230) < 10)
502 c.Say(
"little_adam", c);
503 c.SetFeat(1230, c.elements.Base(1230) + 1);
505 c.SetInt(112, @
int + 1);
515 foreach (
Element value
in food.elements.dict.Values)
521 if (value.
Value >= 0)
526 c.CureCondition<
ConPoison>(value.Value * 2);
529 c.AddCondition<
ConPeace>(value.Value * 5);
535 c.AddCondition<
ConHotspring>(value.Value * 2)?.SetPerfume();
549 Msg.
Say(
"recharge_stamina_fail");
554 c.Say(
"recharge_stamina", c);
555 c.stamina.Mod(c.stamina.max * (value.
Value / 10 + 1) / 100 + value.Value * 2 / 3 +
EClass.
rnd(5));
565 SayTaste(
"food_poison");
566 c.AddCondition<
ConPoison>(-value.Value * 10);
569 SayTaste(
"food_mind");
570 c.AddCondition<
ConConfuse>(-value.Value * 10);
571 c.AddCondition<
ConInsane>(-value.Value * 10);
575 c.AddCondition<
ConBleed>(-value.Value * 10);
585 c.Say(
"recharge_stamina_negative", c);
586 c.stamina.Mod(-c.stamina.max * (-value.
Value / 10 + 1) / 100 + value.
Value);
591 void SayTaste(
string _id)
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)
void Mod(int a, bool force=false)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
void SetInt(string id, int value=0)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ModExp(string alias, int a)
int GetInt(string id, int? defaultInt=null)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
static void Remove(Chara c, DNA item)
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 AddFoodHistory(Thing food)
int CountNumEaten(Thing food)
int GetRaw(int offsetHours=0)
static SourceManager sources
static int rndHalf(int a)
static void ProcNutrition(Chara c, Thing food, float effP, float validFill)
static void ProcTrait(Chara c, Card food)
static bool IsLeftoverable(Thing food)
static void ProcDrink(Chara c, Thing food)
static void Proc(Chara c, Thing food, bool consume=true)
static bool Has(string id)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
static void GetAchievement(ID_Achievement id)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Thing ApplySeed(Thing t, int refval)