1using System.Collections.Generic;
13 food.CheckJustCooked();
15 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
16 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
21 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
25 bool flag2 =
food.HasElement(708);
26 bool flag3 =
food.HasElement(709);
28 bool flag5 = food.IsDecayed || flag3;
35 if (num6 < 2 || flag7)
37 if (num6 == 1 || flag7 ||
EClass.
rnd(4) == 0)
42 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
97 switch (
food.source._origin)
102 c.
Say(
"food_raw_meat");
112 c.
Say(
"food_raw_fish");
121 c.
Say(
"food_raw_powder");
146 num2 = num2 * num7 / 10f;
151 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
152 foreach (
Element value
in food.elements.dict.Values)
154 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
158 string[] foodEffect = value.
source.foodEffect;
160 float num8 = num2 * (float)value.
Value;
163 bool flag8 = num8 >= 0f;
164 string text = value.
source.GetText(flag8 ?
"textInc" :
"textDec", returnNull:
true);
171 switch (foodEffect[0])
186 c.
Say(
"little_eat", c);
196 int a = (int)(num8 * (
float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
205 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
236 c.
Say(
"little_eat", c);
238 int v = Mathf.Max(5 - @
int / 2, 1);
239 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
250 c.
Say(
"little_adam", c);
261 num4 += (float)
food.Evalue(70);
262 num4 += (float)(
food.Evalue(72) / 2);
263 num4 += (float)(
food.Evalue(73) / 2);
264 num4 += (float)(
food.Evalue(75) / 2);
265 num4 += (float)(
food.Evalue(76) * 3 / 2);
266 num4 += (float)
food.Evalue(440);
267 num4 += (float)(
food.Evalue(445) / 2);
268 num4 -= (float)
food.Evalue(71);
269 num4 += (float)(num3 / 2);
271 if (idTaste.IsEmpty())
275 idTaste =
"food_great";
279 idTaste =
"food_good";
283 idTaste =
"food_soso";
287 idTaste =
"food_average";
291 idTaste =
"food_bad";
298 c.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
302 c.
Say(
"food_human_whine");
314 num3 = num3 * (100 + c.
Evalue(1235) * 10) / (100 + c.
Evalue(1234) * 10 + c.
Evalue(1236) * 15);
358 c.
Say(
"fairy_vomit", c, thing);
364 food.trait.OnDrink(c);
369 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
371 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
372 food.SetBool(125, enable:
true);
384 foreach (
Element value
in t.elements.dict.Values)
390 if (value.
Value >= 0)
395 c.CureCondition<
ConPoison>(value.Value * 2);
398 c.AddCondition<
ConPeace>(value.Value * 5);
404 c.AddCondition<
ConHotspring>(value.Value * 2)?.SetPerfume();
418 Msg.
Say(
"recharge_stamina_fail");
423 c.Say(
"recharge_stamina", c);
424 c.stamina.Mod(c.stamina.max * (value.
Value / 10 + 1) / 100 + value.Value * 2 / 3 +
EClass.
rnd(5));
434 SayTaste(
"food_poison");
435 c.AddCondition<
ConPoison>(-value.Value * 10);
438 SayTaste(
"food_mind");
439 c.AddCondition<
ConConfuse>(-value.Value * 10);
440 c.AddCondition<
ConInsane>(-value.Value * 10);
444 c.AddCondition<
ConBleed>(-value.Value * 10);
454 c.Say(
"recharge_stamina_negative", c);
455 c.stamina.Mod(-c.stamina.max * (-value.
Value / 10 + 1) / 100 + value.
Value);
460 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, bool plus=false, 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
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 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)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Thing ApplySeed(Thing t, int refval)