1using System.Collections.Generic;
14 if (
food.id ==
"bloodsample")
19 food.CheckJustCooked();
21 int num = (food.isCrafted ? ((
EClass.
pc.
Evalue(1650) >= 3) ? 5 : 0) : 0);
22 float num2 = (float)(100 + (
food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(
food.QualityLv * 10, 100)) / 200f;
27 int num3 = Mathf.Clamp(
food.Evalue(10), 0, 10000);
31 bool flag2 =
food.HasElement(708);
32 bool flag3 =
food.HasElement(709);
34 bool flag5 = food.IsDecayed || flag3;
41 if (num6 < 2 || flag7)
43 if (num6 == 1 || flag7 ||
EClass.
rnd(4) == 0)
48 else if (num6 > 3 &&
EClass.
rnd(num6) >= 3)
82 if (
food.HasElement(710))
84 num2 = num2 * 0.1f * (float)(
food.Evalue(710) + 10);
93 num2 *= 1f + (float)c2.
Evalue(1200) * 0.25f;
105 c2.
Say(
"food_undead");
114 switch (
food.source._origin)
119 c2.
Say(
"food_raw_meat");
129 c2.
Say(
"food_raw_fish");
138 c2.
Say(
"food_raw_powder");
163 num2 = num2 * num7 / 10f;
168 List<Element> list =
food.ListValidTraits(isCraft:
true, limit:
false);
169 foreach (
Element value
in food.elements.dict.Values)
171 if (value.
source.foodEffect.IsEmpty() || !list.Contains(value))
175 string[] foodEffect = value.
source.foodEffect;
177 float num8 = num2 * (float)value.
Value;
180 bool flag8 = num8 >= 0f;
181 string text = value.
source.GetText(flag8 ?
"textInc" :
"textDec", returnNull:
true);
188 switch (foodEffect[0])
192 int int2 = c2.
GetInt(117);
203 c2.
Say(
"little_eat", c2);
213 int a = (int)(num8 * (
float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3;
222 num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3);
250 int @
int = c2.
GetInt(112);
253 c2.
Say(
"little_eat", c2);
255 int v = Mathf.Max(5 - @
int / 2, 1);
256 Debug.Log(
"sister eaten:" + @
int +
"/" + v);
267 c2.
Say(
"little_adam", c2);
277 num4 += (float)
food.Evalue(70);
278 num4 += (float)(
food.Evalue(72) / 2);
279 num4 += (float)(
food.Evalue(73) / 2);
280 num4 += (float)(
food.Evalue(75) / 2);
281 num4 += (float)(
food.Evalue(76) * 3 / 2);
282 num4 += (float)
food.Evalue(440);
283 num4 += (float)(
food.Evalue(445) / 2);
284 num4 -= (float)
food.Evalue(71);
285 num4 += (float)(num3 / 2);
287 if (idTaste.IsEmpty())
291 idTaste =
"food_great";
295 idTaste =
"food_good";
299 idTaste =
"food_soso";
303 idTaste =
"food_average";
307 idTaste =
"food_bad";
314 c2.
Say(flag4 ?
"food_human_pos" :
"food_human_neg");
318 c2.
Say(
"food_human_whine");
324 c2.
Say(idTaste +
"2", c2,
food);
330 num3 = num3 * (100 + c2.
Evalue(1235) * 10) / (100 + c2.
Evalue(1234) * 10 + c2.
Evalue(1236) * 15);
343 c2.
SetFeat(1205, 1, msg:
true);
354 c2.
SetFeat(1205, 0, msg:
true);
374 c2.
Say(
"fairy_vomit", c2, thing);
377 food.trait.OnEat(c2);
380 food.trait.OnDrink(c2);
387 if (flag6 && (
float)
food.Evalue(10) > num7 + 10f)
389 food.elements.SetTo(10, (
int)Mathf.Max((
float)
food.Evalue(10) - num7, 1f));
390 food.SetBool(125, enable:
true);
391 if (
food.HasElement(1229))
393 food.elements.Remove(1229);
409 item.PlaySound(
"Animal/Cat/cat_angry");
420 foreach (
Element value
in t.elements.dict.Values)
426 if (value.
Value >= 0)
431 c.CureCondition<
ConPoison>(value.Value * 2);
434 c.AddCondition<
ConPeace>(value.Value * 5);
440 c.AddCondition<
ConHotspring>(value.Value * 2)?.SetPerfume();
454 Msg.
Say(
"recharge_stamina_fail");
459 c.Say(
"recharge_stamina", c);
460 c.stamina.Mod(c.stamina.max * (value.
Value / 10 + 1) / 100 + value.Value * 2 / 3 +
EClass.
rnd(5));
470 SayTaste(
"food_poison");
471 c.AddCondition<
ConPoison>(-value.Value * 10);
474 SayTaste(
"food_mind");
475 c.AddCondition<
ConConfuse>(-value.Value * 10);
476 c.AddCondition<
ConInsane>(-value.Value * 10);
480 c.AddCondition<
ConBleed>(-value.Value * 10);
490 c.Say(
"recharge_stamina_negative", c);
491 c.stamina.Mod(-c.stamina.max * (-value.
Value / 10 + 1) / 100 + value.
Value);
496 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)