1using System.Collections.Generic;
15 if (
food.id ==
"bloodsample")
20 food.CheckJustCooked();
21 bool flag = EClass._zone.IsPCFactionOrTent && c2.IsInSpot<
TraitSpotDining>();
22 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
23 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
28 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
32 bool flag2 =
food.HasElement(708);
33 bool flag3 =
food.HasElement(709);
35 bool flag5 = food.IsDecayed || flag3;
43 if (num6 < 2 || flag8)
45 if (num6 == 1 || flag8 ||
EClass.
rnd(4) == 0)
50 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
84 if (
food.HasElement(710))
86 num2 = num2 * 0.1f * (float)(
food.Evalue(710) + 10);
95 num2 *= 1f + (float)c2.
Evalue(1200) * 0.3f;
107 c2.
Say(
"food_undead");
116 switch (
food.source._origin)
121 c2.
Say(
"food_raw_meat");
131 c2.
Say(
"food_raw_fish");
140 c2.
Say(
"food_raw_powder");
147 float num7 = (flag7 ? num3 : Mathf.Min(c2.
hunger.
value, num3));
165 num2 = num2 * num7 / 10f;
170 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
171 foreach (
Element value
in food.elements.dict.Values)
173 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
177 string[] foodEffect = value.
source.foodEffect;
179 float num8 = num2 * (float)value.
Value;
182 bool flag9 = num8 >= 0f;
183 string text = value.
source.GetText(flag9 ?
"textInc" :
"textDec", returnNull:
true);
190 switch (foodEffect[0])
194 int int2 = c2.
GetInt(117);
205 c2.
Say(
"little_eat", c2);
215 int a = (int)(num8 * (
float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
224 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
252 int @
int = c2.
GetInt(112);
255 c2.
Say(
"little_eat", c2);
257 int v = Mathf.Max(5 - @
int / 2, 1);
258 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
269 c2.
Say(
"little_adam", c2);
279 num4 += (float)
food.Evalue(70);
280 num4 += (float)(
food.Evalue(72) / 2);
281 num4 += (float)(
food.Evalue(73) / 2);
282 num4 += (float)(
food.Evalue(75) / 2);
283 num4 += (float)(
food.Evalue(76) * 3 / 2);
284 num4 += (float)
food.Evalue(440);
285 num4 += (float)(
food.Evalue(445) / 2);
286 num4 -= (float)
food.Evalue(71);
287 num4 += (float)
food.Evalue(18);
288 num4 += (float)(num3 / 2);
290 if (idTaste.IsEmpty())
294 idTaste =
"food_great";
298 idTaste =
"food_good";
302 idTaste =
"food_soso";
306 idTaste =
"food_average";
310 idTaste =
"food_bad";
317 c2.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
321 c2.
Say(
"food_human_whine");
327 c2.
Say(idTaste +
"2", c2,
food);
333 num3 = num3 * (100 + c2.
Evalue(1235) * 10) / (100 + c2.
Evalue(1234) * 10 + c2.
Evalue(1236) * 15);
346 c2.
SetFeat(1205, 1, msg:
true);
357 c2.
SetFeat(1205, 0, msg:
true);
377 c2.
Say(
"fairy_vomit", c2, thing);
380 food.trait.OnEat(c2);
383 food.trait.OnDrink(c2);
390 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
392 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
393 food.SetBool(125, enable:
true);
394 if (
food.HasElement(1229))
396 food.elements.Remove(1229);
411 item.PlaySound(
"Animal/Cat/cat_angry");
418 EClass.player.stats.angryCats += num10;
441 int slot = c_DNA.
slot;
443 int excess = c2.CurrentGeneSlot + slot - c2.
MaxGeneSlot;
449 RemoveDNA(fromOldest:
false);
455 genes.
items.Shuffle();
456 Msg.
Say(
"reconstruct", c2);
457 c2.
Say(
"food_mind", c2);
464 while (excess > 0 && genes !=
null && genes.
items.Count != 0)
466 RemoveDNA(fromOldest:
true);
470 c2.
Say(
"little_eat", c2);
474 void RemoveDNA(
bool fromOldest)
476 DNA dNA = (fromOldest ? genes.
items[0] : genes.
items.Last());
485 foreach (
Element value
in t.elements.dict.Values)
491 if (value.
Value >= 0)
496 c.CureCondition<
ConPoison>(value.Value * 2);
499 c.AddCondition<
ConPeace>(value.Value * 5);
505 c.AddCondition<
ConHotspring>(value.Value * 2)?.SetPerfume();
519 Msg.
Say(
"recharge_stamina_fail");
524 c.Say(
"recharge_stamina", c);
525 c.stamina.Mod(c.stamina.max * (value.
Value / 10 + 1) / 100 + value.Value * 2 / 3 +
EClass.
rnd(5));
535 SayTaste(
"food_poison");
536 c.AddCondition<
ConPoison>(-value.Value * 10);
539 SayTaste(
"food_mind");
540 c.AddCondition<
ConConfuse>(-value.Value * 10);
541 c.AddCondition<
ConInsane>(-value.Value * 10);
545 c.AddCondition<
ConBleed>(-value.Value * 10);
555 c.Say(
"recharge_stamina_negative", c);
556 c.stamina.Mod(-c.stamina.max * (-value.
Value / 10 + 1) / 100 + value.
Value);
561 void SayTaste(
string _id)
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)
void Mod(int a, bool force=false)
ElementContainerCard elements
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
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)
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 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 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)