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);
260 num4 += (float)
food.Evalue(70);
261 num4 += (float)(
food.Evalue(72) / 2);
262 num4 += (float)(
food.Evalue(73) / 2);
263 num4 += (float)(
food.Evalue(75) / 2);
264 num4 += (float)(
food.Evalue(76) * 3 / 2);
265 num4 += (float)
food.Evalue(440);
266 num4 += (float)(
food.Evalue(445) / 2);
267 num4 -= (float)
food.Evalue(71);
268 num4 += (float)(num3 / 2);
270 if (idTaste.IsEmpty())
274 idTaste =
"food_great";
278 idTaste =
"food_good";
282 idTaste =
"food_soso";
286 idTaste =
"food_average";
290 idTaste =
"food_bad";
297 c.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
301 c.
Say(
"food_human_whine");
313 num3 = num3 * (100 + c.
Evalue(1235) * 10) / (100 + c.
Evalue(1234) * 10 + c.
Evalue(1236) * 15);
357 c.
Say(
"fairy_vomit", c, thing);
363 food.trait.OnDrink(c);
372 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
374 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
375 food.SetBool(125, enable:
true);
376 if (
food.HasElement(1229))
378 food.elements.Remove(1229);
390 foreach (
Element value
in t.elements.dict.Values)
396 if (value.
Value >= 0)
401 c.CureCondition<
ConPoison>(value.Value * 2);
404 c.AddCondition<
ConPeace>(value.Value * 5);
410 c.AddCondition<
ConHotspring>(value.Value * 2)?.SetPerfume();
424 Msg.
Say(
"recharge_stamina_fail");
429 c.Say(
"recharge_stamina", c);
430 c.stamina.Mod(c.stamina.max * (value.
Value / 10 + 1) / 100 + value.Value * 2 / 3 +
EClass.
rnd(5));
440 SayTaste(
"food_poison");
441 c.AddCondition<
ConPoison>(-value.Value * 10);
444 SayTaste(
"food_mind");
445 c.AddCondition<
ConConfuse>(-value.Value * 10);
446 c.AddCondition<
ConInsane>(-value.Value * 10);
450 c.AddCondition<
ConBleed>(-value.Value * 10);
460 c.Say(
"recharge_stamina_negative", c);
461 c.stamina.Mod(-c.stamina.max * (-value.
Value / 10 + 1) / 100 + value.
Value);
466 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
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)