2using System.Collections.Generic;
4using System.Runtime.Serialization;
32 [JsonProperty(PropertyName =
"A")]
33 public int[]
_ints =
new int[30];
35 [JsonProperty(PropertyName =
"B")]
36 public string id =
"";
38 [JsonProperty(PropertyName =
"C")]
41 [JsonProperty(PropertyName =
"D")]
44 [JsonProperty(PropertyName =
"E")]
47 [JsonProperty(PropertyName =
"SC")]
260 return 0.001f * (float)
_ints[15];
264 _ints[15] = (int)(value * 1000f);
272 return 0.001f * (float)
_ints[16];
276 _ints[16] = (int)(value * 1000f);
288 _ints[17] = (int)value;
300 _ints[18] = (int)value;
324 _ints[19] = (int)value * 100;
1046 SetInt(103, value ? 1 : 0);
1058 SetInt(109, value ? 1 : 0);
1070 SetInt(63, value ? 1 : 0);
1082 SetInt(64, value ? 1 : 0);
1094 SetInt(120, value ? 1 : 0);
1106 SetInt(121, value ? 1 : 0);
1118 SetInt(122, value ? 1 : 0);
1816 return GetObj<UniqueData>(6);
1828 return GetObj<Thing>(9);
1840 return GetObj<List<SocketData>>(17);
1852 return GetObj<Thing>(10);
1876 return GetObj<CharaUpgrade>(11);
1888 return GetObj<LoveData>(20);
1900 return GetObj<CharaGenes>(15);
1912 return GetObj<List<int>>(16);
1936 return GetObj<DNA>(14);
1948 return GetObj<CharaList>(13);
1960 return GetObj<MixedFoodData>(18);
1972 return GetObj<Thing>(19);
1984 return GetObj<byte[]>(4);
2060 public int ExpToNext => (int)Math.Min((50 + (
long)
LV * 30L) * (100 -
Evalue(403)) / 100, 99999999L);
2083 if (_childrenWeight < 0 || _childrenWeight > 10000000)
2171 if (
Tiles.Length == 1)
2173 return dir % 2 == 1;
2237 return id ==
"grass";
2385 if (
Tiles.Length < 3)
2459 return bio.gender == 2;
2559 return GetBool(
id.GetHashCode());
2564 SetBool(
id.GetHashCode(), enable);
2567 public int GetInt(
string id,
int? defaultInt =
null)
2569 int @
int =
GetInt(
id.GetHashCode(), defaultInt);
2579 AddInt(
id.GetHashCode(), value);
2588 SetInt(
id.GetHashCode(), value);
2595 public string GetStr(
string id,
string defaultStr =
null)
2597 return GetStr(
id.GetHashCode(), defaultStr);
2600 public void SetStr(
string id,
string value =
null)
2602 SetStr(
id.GetHashCode(), value);
2612 SetObj(
id.GetHashCode(), o);
2674 if (
card.isSale || !
card.trait.CanUseContent)
2679 if (windowSaveData !=
null)
2691 EClass.player.wasDirtyWeight =
true;
2709 public int Evalue(
int ele,
bool ignoreGlobalElement)
2735 return c_editorTags?.Contains(tag.ToString()) ??
false;
2768 int num2 =
item.Value;
2843 for (
int i = 0; i <
sockets.Count; i++)
2861 thing.parent =
this;
2911 CardBlueprint.current =
null;
2962 if (
id ==
"microchip")
3044 EClass._zone.Boss =
Chara;
3086 int num = elementContainer.Value(value.
id);
3116 public void AddExp(
int a,
bool applyMod =
true)
3141 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
3145 return num * (100 +
Evalue(1237) * 30 +
Evalue(1273) * 50 + ((
Evalue(1275) >= 2) ? 50 : 0)) / 100;
3176 Say(
"dingExp",
this);
3191 int num = Mathf.Min(1 +
LV / 5, 20);
3192 for (
int i = 0; i < num; i++)
3194 if (
Evalue(1644) < i + 1)
3232 if (rootCard !=
null && rootCard.
IsPC)
3287 Debug.LogWarning(
"already child:" + t);
3292 Debug.Log(
"already in the list" + t);
3307 t.ignoreAutoPick =
false;
3351 if (rootCard !=
null && rootCard.
IsPC)
3360 t.isNPCProperty =
false;
3374 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3377 void TryAdd(
Thing a)
3379 if (!ings.Contains(a.
id))
3397 List<Chara> list =
new List<Chara>();
3413 if (!
item.IsPCFactionOrMinion)
3418 if (list2.Count == 0)
3422 foreach (
Thing item2
in list2)
3426 item.body.Unequip(item2);
3429 Msg.
Say(
"waterCurse", item2);
3433 foreach (
Chara item3
in list)
3440 if (list3.Count == 0)
3444 foreach (
Thing item4
in list3)
3446 Msg.
Say(
"destroyed_inv_", item4, item3);
3458 List<Chara> list =
new List<Chara>();
3472 if (
item.IsPCFactionOrMinion)
3486 for (
int num =
things.Count - 1; num >= 0; num--)
3497 rootCard.Chara.held =
null;
3503 instance.selectedButton.card =
null;
3506 ActionMode.AdvOrRegion.updatePlans =
true;
3523 if (thing.
invY == 1)
3525 WidgetCurrentTool.dirty =
true;
3529 if (thing.
props !=
null)
3537 WidgetHotbar.dirtyCurrentItem =
true;
3538 thing.parent =
null;
3543 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3550 thing.parent =
null;
3559 return EClass.ui.layers.Count > 0;
3581 to.c_isImportant =
true;
3606 return card.GetRootCard();
3633 thing.encLV =
encLV;
3634 thing.decay =
decay;
3637 foreach (KeyValuePair<int, int>
item in mapInt)
3641 foreach (KeyValuePair<int, string> item2
in mapStr)
3643 thing.
mapStr[item2.Key] = item2.Value;
3649 thing.sockets = IO.DeepCopy(
sockets);
3665 ModNum(-a, notify:
false);
3677 return this as
Thing;
3680 return this as
Thing;
3686 return this as
Thing;
3689 public void ModNum(
int a,
bool notify =
true)
3728 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3734 for (
int i = 0; i <
sockets.Count; i++)
3752 for (
int i = 0; i <
sockets.Count; i++)
3758 int ele = num / 1000;
3759 int num2 = num % 1000;
3854 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3860 string encSlot = source.
encSlot;
3861 if (encSlot ==
null || encSlot.Length != 0)
3874 string[] array = source.
encSlot.Split(
',');
3875 foreach (
string key
in array)
3923 if (this.placeState == newState)
3929 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3941 float num2 = (
fy = 0f);
3952 this.placeState = newState;
3960 this.placeState = newState;
4015 num = num * (100 +
Quality) / 100;
4052 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
4099 public bool TryPay(
int a,
string id =
"money")
4106 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
4110 if (
IsPC && !(
id ==
"ration"))
4130 Say(
"spellbookCrumble",
this);
4139 if (
id ==
"influence")
4151 if (
id ==
"influence")
4158 if (sum >
int.MaxValue)
4185 a = a * Mathf.Max(100 -
Evalue(93), 1) / 100;
4218 int num =
PV + orCreateElement.Value +
DEX / 10;
4225 num2 = num3 / 10 + 1;
4226 sides = num3 / num2 + 1;
4228 dmg = dmg * 100 / Mathf.Max(100 + num, 1);
4230 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
4231 dmg -= num4 * mod / 100;
4245 int num = origin.Evalue(1238);
4249 if (origin.HasElement(1247))
4254 if (attackSource ==
AttackSource.MagicArrow && origin.HasElement(1244))
4258 if (attackSource ==
AttackSource.MagicHand && origin.HasElement(1246))
4262 if (idEle == 916 && (
HasElement(1253) || origin.HasElement(1253)))
4271 DamageHP(dmg, 0, 0, attackSource, origin);
4280 bool flag = originalTarget !=
null;
4281 Action onEvade =
null;
4290 Say(
"wall_bond", chara3,
this);
4292 origin?.Chara?.DoHostileAction(chara3);
4300 if ((uint)(attackSource2 - 3) > 2u && (uint)(attackSource2 - 13) > 5u)
4306 int num = chara4.
Evalue(1241);
4307 int num2 = chara4.
Evalue(438);
4310 Say((num2 == 0) ?
"wall_flesh" :
"wall_knightly", chara4,
this);
4311 chara4.
DamageHP(dmg * (100L + (
long)((num2 > 0) ? (-10) : 0) + ((num > 0) ? 10 : 0)) / 100, ele, eleP, attackSource, origin, showEffect,
weapon,
Chara);
4312 origin?.Chara?.DoHostileAction(chara4);
4320 if (origin !=
null && origin.HasElement(1208))
4322 switch (attackSource)
4325 dmg = dmg * 130 / 100;
4326 eleP = eleP * 150 / 100;
4329 dmg = dmg * 120 / 100;
4330 eleP = eleP * 150 / 100;
4336 dmg = dmg * (100 + origin.Evalue(94)) / 100;
4339 if (ele == 0 || ele == 926)
4344 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
4350 if (attackSource !=
AttackSource.Condition && showEffect)
4361 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
4362 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
4369 if (chara2 !=
null && chara2.
isWet)
4378 if (chara !=
null && chara.
isWet)
4380 dmg = dmg * 150 / 100;
4386 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
4394 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
4396 if (origin !=
null && origin.HasCondition<
ConBerserk>())
4405 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num3 - 50))) / 100;
4410 dmg = dmg * 100 / (100 +
Evalue(435) * 2);
4412 dmg = dmg * Mathf.Max(0, 100 - Mathf.Min(
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56), 100) / ((!flag) ? 1 : 2)) / 100;
4419 dmg = dmg * 90 / 100;
4423 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
4427 dmg = dmg * 90 / 100;
4447 dmg = dmg * 100 / Mathf.Min(100 + num5 * (3 + num4 * 2), 120);
4449 else if (origin !=
null && origin.IsPCFactionOrMinion)
4451 dmg = dmg * Mathf.Min(100 + num6 * (3 + num4 + 2), 120) / 100;
4456 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
4458 if (
HasElement(1218) && attackSource != AttackSource.ManaBackfire && (
hp > 0 ||
Evalue(1421) <= 0))
4460 dmg = dmg * (1000 - Mathf.Min(
Evalue(1218), 1000) / ((!flag) ? 1 : 2)) / 1000;
4468 int num7 =
MaxHP / 10;
4469 long num8 = dmg - num7;
4470 num8 = num8 * 100 / (200 +
Evalue(68) * 10);
4482 long num9 = 99999999L;
4486 if (condition !=
null)
4488 num9 = num9 * (100 + condition.lv * 5) / 100;
4495 float num10 = Mathf.Clamp(dmg * 6 /
MaxHP, 0f, 4f) + (float)((dmg > 0) ? 1 : 0);
4506 if (hp < 0 && Chara.mana.value >= 0)
4522 Chara.mana.value -= (int)dmg;
4539 float ratio = (float)dmg / (
float)
MaxHP;
4550 if (
EClass.
pc.
ai is
AI_PracticeDummy { IsRunning:
not false } aI_PracticeDummy && aI_PracticeDummy.target ==
this && (origin ==
null || origin.IsPC))
4552 aI_PracticeDummy.hit++;
4553 aI_PracticeDummy.totalDamage += dmg;
4596 if (origin !=
null && origin !=
this &&
Evalue(436) > 0 && !HasCondition<ConFractured>())
4605 hp = Mathf.Min(half * (
int)Mathf.Sqrt(
Evalue(436) * 2) / 100,
MaxHP / 3);
4626 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
4628 EClass.player.invlunerable =
true;
4667 if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null && (origin.isSynced ||
IsPC))
4674 text =
"dead_" + e.
source.alias;
4678 text =
"dead_attack";
4686 text =
"kill_" + e.source.alias;
4690 text =
"kill_attack";
4692 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4700 Say(
"reboot",
this);
4707 if (HasCondition<ConRebirth>())
4709 Say(
"rebirth",
this);
4721 Msg.alwaysVisible =
true;
4722 Msg.
Say(
"layhand", chara5,
this);
4723 Msg.
Say(
"pray_heal",
this);
4733 if (zoneInstanceBout !=
null)
4765 Die(e, origin, attackSource, originalTarget);
4766 if (origin !=
null && origin.id ==
"unseenhand" && !origin.IsGlobal)
4768 origin.isSummon =
true;
4769 origin.c_summonDuration = 4;
4776 string text2 =
new int[18]
4778 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4779 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4780 }.RandomItem().ToString();
4783 text2 =
"casino_coin";
4787 text2 =
"scratchcard";
4815 if (origin !=
null && origin.isChara)
4837 if (origin.GetInt(106) == 0)
4839 origin.Chara.TalkTopic(
"kill");
4844 else if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null)
4846 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num10 + (
IsPC ?
"pc" :
""), origin,
this);
4850 int num14 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4851 if (num10 >= (
float)num14)
4855 Say(
"dmg_" + e.source.alias,
this);
4859 Say(
"dmg" + num10,
this);
4882 if (origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4886 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4890 int num16 = origin.Dist(
this);
4894 if (
id ==
"hedgehog_ether")
4898 Say(
"reflect_thorne", origin,
this);
4899 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele2,
Power,
AttackSource.Condition,
this);
4904 Say(
"reflect_acid",
this, origin);
4905 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele3,
Power * 2,
AttackSource.Condition,
this);
4917 int a2 = (int)(100 * (dmg * 100 /
MaxHP) / 100) + 1;
4928 int num17 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4938 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4944 Condition.ignoreEffect =
true;
4946 Condition.ignoreEffect =
false;
4950 float num18 = (float)
hp / (
float)
MaxHP;
4957 PlaySound(
"heartbeat", 1f - num18 * 2f);
4990 EClass.player.forceTalk =
true;
4992 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
5003 void EvadeDeath(Action action)
5008 Chara.mana.value = 0;
5012 int GetHealValue(
int heal,
int skill,
int full,
int healRateLimit,
int skillMod)
5014 int result = Mathf.Clamp(heal, 0,
MathEx.
ClampToInt((
long)full * (
long)Mathf.Clamp(healRateLimit * (100 + skill) / 200, 0, healRateLimit) / 100 + skill * skillMod / 100));
5017 Debug.Log(
"dmg:" + dmg +
" heal:" + result +
" (" + heal +
")");
5031 if (origin !=
null && origin.isChara &&
isChara && (
weapon ==
null || !
weapon.HasElement(486)))
5033 int num19 = origin.Evalue(660) + (
weapon?.Evalue(660, ignoreGlobalElement:
true) ?? 0);
5034 int num20 = origin.Evalue(662) + (
weapon?.Evalue(662, ignoreGlobalElement:
true) ?? 0);
5035 int num21 = origin.Evalue(661) + (
weapon?.Evalue(661, ignoreGlobalElement:
true) ?? 0);
5036 bool flag4 = attackSource == AttackSource.Melee || attackSource == AttackSource.Range || attackSource ==
AttackSource.Throw;
5037 if (num19 > 0 && flag4)
5039 int heal2 =
EClass.
rnd(dmg / 10 + num19 / 5);
5040 origin.Chara.HealHP(GetHealValue(heal2, num19, origin.MaxHP, 20, 100));
5042 if (num20 > 0 && flag4 && origin.isChara && !origin.Chara.ignoreSPAbsorb &&
Chara.
IsHostile(origin as
Chara))
5045 origin.Chara.stamina.Mod(GetHealValue(heal3, num20, origin.Chara.stamina.max, 1, 10));
5051 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
5054 origin.Chara.mana.Mod(GetHealValue(heal4, origin.Chara.GetPietyValue(), origin.Chara.mana.max, 10, 100));
5060 if (num21 > 0 && flag4)
5062 int heal5 =
EClass.
rnd(dmg / 10 + num21 / 10);
5063 origin.Chara.mana.Mod(GetHealValue(heal5, num21, origin.Chara.mana.max, 10, 100));
5080 bool hostile =
false;
5084 if (Chance(30 + eleP / 5, 100))
5086 MarkHostile().AddCondition<
ConBurning>(eleP);
5092 if (Chance(30 + eleP / 10, 100))
5097 else if (Chance(50 + eleP / 10, 100))
5103 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
5109 if (Chance(30 + eleP / 5, 100))
5111 MarkHostile().AddCondition<
ConPoison>(eleP);
5115 if (Chance(30 + eleP / 5, 100))
5122 if (Chance(30 + eleP / 5, 100))
5131 if (Chance(30 + eleP / 5, 100))
5136 else if (Chance(30 + eleP / 5, 100))
5142 if (Chance(50 + eleP / 10, 100))
5150 if (Chance(30 + eleP / 5, 100))
5169 if (Chance(5 + eleP / 25, 40))
5173 if (Chance(5 + eleP / 25, 40))
5177 if (Chance(5 + eleP / 25, 40))
5181 if (Chance(5 + eleP / 25, 40))
5183 MarkHostile().AddCondition<
ConPoison>(eleP / 2);
5185 if (Chance(5 + eleP / 25, 40))
5189 if (Chance(5 + eleP / 25, 40))
5193 if (Chance(30 + eleP / 10, 100))
5199 if (Chance(50 + eleP / 10, 100))
5201 MarkHostile().AddCondition<
ConBleed>(eleP);
5205 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
5218 if (checkHostileAct && hostile && origin !=
null && origin.
isChara)
5222 static bool Chance(
int a,
int max)
5224 return Mathf.Min(a, max) >
EClass.
rnd(100);
5235 Card rootCard = GetRootCard();
5237 if (_pos !=
null && !_pos.
IsValid)
5248 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
5249 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
5251 text += e.source.alias;
5255 Msg.
Say(text,
this, rootCard);
5260 Msg.
Say(
"destroyed",
this);
5265 things.ForeachReverse(delegate(
Thing t)
5275 if (e !=
null && _pos !=
null && e.id == 21)
5281 Explode(pos, origin);
5289 origin = origin?.Chara,
5291 aliasEle =
"eleImpact"
5297 PlaySound(
material.GetSoundDead(sourceCard));
5305 Debug.Log(Name +
" is already destroyed.");
5316 Chara.isDead =
true;
5334 for (
int num = things.Count - 1; num >= 0; num--)
5336 things[num].Destroy();
5343 if (!isChara || IsPCFactionMinion || (isCopy &&
EClass.
rnd(10) != 0))
5349 List<Card> list =
new List<Card>();
5350 if (!IsPCFaction && !isUserZone && sourceCard.
idActor.IsEmpty())
5353 if (this.rarity >=
Rarity.Legendary)
5386 else if (origin !=
null && origin.
HasElement(290) && !IsMinion)
5398 if (
id ==
"littleOne" && IsPCFactionOrMinion)
5406 if (flag2 && !isUserZone)
5410 case "bubble_pudding":
5413 case "marshmallow_monster":
5414 case "marshmallow_king":
5420 if (
id ==
"titan_iron")
5424 bool num2 = text ==
"_meat";
5432 text =
"meat_marble";
5439 if (thing3.
source._origin ==
"meat")
5456 if (!IsPCFaction && !isUserZone)
5458 foreach (
string item2
in sourceCard.
loot.Concat(
Chara.
race.loot).ToList())
5460 string[] array = item2.
Split(
'/');
5461 int num4 = array[1].ToInt();
5510 if (!isBackerContent && !flag)
5546 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.rarity >=
Rarity.Legendary) ? 1 : 0));
5567 List<Thing> list2 =
new List<Thing>();
5568 foreach (
Thing thing6
in things)
5594 if (num5 > 0 && list2.Count > 0)
5597 for (
int j = 0; j < list2.Count && j < num5; j++)
5603 if (this.rarity >=
Rarity.Legendary && !IsUnique && c_bossType !=
BossType.Evolved)
5606 foreach (
Card item3
in list)
5615 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
5620 for (
int k = 0; k < num5; k++)
5649 List<Thing> list3 = thing4.
things.ToList();
5659 while (num8 > 0 && list3.Count != 0)
5661 Thing thing5 = list3.First();
5662 list3.Remove(thing5);
5673 foreach (
Thing thing7
in things)
5675 if (thing7.
GetInt(116) != 0)
5680 Point nearestPoint = GetRootCard().pos;
5685 foreach (
Card item4
in list)
5691 item4.isHidden =
false;
5692 item4.isNPCProperty =
false;
5749 case "egg_fertilized":
5754 string text =
"c_wilds";
5755 if (
id ==
"_meat" ||
id ==
"meat_marble")
5763 for (
int i = 0; i < 20; i++)
5766 if (cardRow.
model.
Chara.
race.corpse[0] !=
"_meat" &&
id !=
"_milk" &&
id !=
"_egg" &&
id !=
"egg_fertilized")
5776 if (crafter !=
null && crafter.id ==
"big_sister")
5778 cardRow = crafter.source;
5783 if (c_idRefCard.IsEmpty())
5785 MakeRefFrom(cardRow.
model);
5790 MakeFoodFrom(cardRow.
model);
5792 return this as
Thing;
5798 return this as
Thing;
5818 int num = race.
food[0].ToInt();
5819 bool flag =
id ==
"meat_marble";
5821 bool flag2 = category.
IsChildOf(
"meat");
5822 bool flag3 =
id ==
"marshmallow_nama" || category.
IsChildOf(
"egg") || trait is
TraitGene;
5823 bool flag4 = category.
IsChildOf(
"milk");
5834 elements.
SetBase(70, race.
STR * race.
STR / 5 * num / 100 - 10 + num / 10);
5837 elements.
SetBase(440, race.
END * race.
END / 5 * num / 100 - 10 + num / 10);
5839 elements.
SetBase(71, (
int)Mathf.Clamp((
float)(num / 10) + Mathf.Sqrt(race.
height) - 10f, 1f, 60f));
5843 num2 = ((!flag4) ? 3 : 2);
5847 elements.
SetBase(444, race.
LER * race.
LER / 5 * num / 100 - 10 + num / 10);
5861 foreach (
Element value
in c.elements.dict.Values)
5863 if ((!flag3 || value.
id != 1229) && (value.source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
5868 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
5869 foreach (KeyValuePair<int, int>
item in race.elementMap)
5873 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
5876 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5877 for (
int i = 0; i < num2 && i < list.Count; i++)
5879 Tuple<int, int> tuple = list[i];
5880 elements.
SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5882 if (c.Chara.IsUndead)
5884 elements.
ModBase(73, (c.Chara.race.id ==
"undeadgod") ? (-90) : (-20));
5886 isWeightChanged =
true;
5887 c_weight = race.height * 4 + 100;
5888 c_idMainElement = c.c_idMainElement;
5890 int num3 = c.LV - c.sourceCard.LV;
5896 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
5900 if (flag2 && c.IsPCFaction && c.IsUnique)
5915 if (IsIgnoreName(
card))
5919 if (IsIgnoreName(card2))
5923 if (
card ==
null && card2 !=
null)
5930 MakeRefFrom(
card, card2);
5931 if (
card.c_idRefCard !=
null)
5933 c_idRefCard =
card.c_idRefCard;
5934 c_altName = TryGetFoodName(
card);
5939 c_altName2 = TryGetFoodName(card2);
5942 static bool IsIgnoreName(
Card c)
5972 if (!row.aka.IsEmpty())
5974 if (row.name ==
"*r" && row.aka ==
"*r")
5976 return "corpseGeneral".lang();
5978 if (row.name ==
"*r")
5980 return row.GetText(
"aka");
5983 return row.GetName();
5988 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
6004 c_idRefCard = c1.
id;
6008 c_idRefCard2 = c2.id;
6009 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName((!simple) ? NameStyle.Ref :
NameStyle.Simple, (!c2.isChara) ? 1 : 0));
6011 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.
c_extraNameRef);
6017 if (!
EClass.
debug.
enable && (HasElement(1290) || HasElement(1292)) && Evalue(418) >= 0)
6025 thing.c_idMainElement = c_idMainElement;
6034 return GiveBirth(thing, effect);
6040 if (!
EClass.
debug.
enable && (HasElement(1290) || HasElement(1292)) && Evalue(418) >= 0)
6052 int num2 = LV - sourceCard.
LV;
6057 if (num2 >= 10 && !HasElement(1290) && !HasElement(1292))
6065 return GiveBirth(thing, effect);
6071 EClass.player.forceTalk =
true;
6072 card.Talk(
"giveBirth");
6076 card.pos.PlayEffect(
"revive");
6077 card.pos.PlaySound(
"egg");
6089 string[] array = ((!(
id ==
"cocoon")) ?
new string[4] {
"alien",
"alien",
"alien",
"alien2" } :
new string[6] {
"spider_queen",
"spider_vampire",
"spider_paralyzer",
"spider_black",
"spider_tarantula",
"spider_spotted" });
6093 AddBlood(12, (uid % 2 == 0) ? (-1) : 3);
6095 PlaySound(
"egghatch");
6104 for (
int i = 0; i < 1 +
EClass.
rnd(num + 1); i++)
6107 if (chara !=
null && isChara)
6110 chara.isHatchling =
true;
6162 SayNothingHappans();
6165 PlayEffect(
"teleport");
6168 Say(
"antiTeleport",
this);
6169 PlaySound(
"gravity");
6174 PlaySound(
"teleport");
6175 Say(
"teleported",
this);
6184 if (chara.
enemy ==
this)
6195 EClass.player.haltMove =
true;
6197 PlayEffect(
"teleport", useRenderPos:
false);
6204 PlayEffect(
"ripple");
6205 PlaySound(
"Footstep/water");
6216 int num = p.x - pos.
x;
6217 int num2 = p.z - pos.
z;
6234 if (num == 0 && num2 == 0)
6248 for (
int i = -1; i < 2; i++)
6250 for (
int j = -1; j < 2; j++)
6254 point.x = pos.x + j;
6255 point.z = pos.z + i;
6269 return _Move(newPoint);
6272 public void Kick(
Point p,
bool ignoreSelf =
false,
bool checkWall =
true)
6276 Kick(
item, ignoreSelf, karmaLoss:
true, show:
true, checkWall);
6280 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true,
bool checkWall =
true)
6282 if (!IsAliveInCurrentZone)
6308 Say(
"kick",
this, t);
6342 if (elements.
Value(ele) <= 0)
6344 if (includeNagative)
6346 return elements.
Value(ele) < 0;
6355 return elements.
Value(ele) >= req;
6370 if (HasElement(764))
6374 if (HasElement(759))
6378 if (HasElement(703))
6382 if (HasElement(758))
6386 if (HasElement(704))
6390 if (HasElement(766))
6408 for (
int i = 0; i < a; i++)
6419 shared.color = 11010048f;
6420 shared.liquidLv = 0;
6422 SetRenderParam(shared);
6442 isDyed = mat !=
null;
6443 c_dyeMat = mat?.id ?? 0;
6459 else if (isElemental)
6496 int num = EClass.game.seed + refVal;
6497 num +=
id[0] % 10000;
6500 num +=
id[1] % 1000;
6503 num +=
id[2] % 1000;
6506 num +=
id[3] % 1000;
6509 num +=
id[4] % 1000;
6518 return ref _randColor;
6543 public void SetImage(Image image,
int dir,
int idSkin = 0)
6545 sourceRenderCard.
SetImage(image, GetSprite(dir), colorInt, setNativeSize:
true, dir, idSkin,
this);
6555 Sprite sprite = GetSprite();
6556 if (!c_idSpriteReplacer.IsEmpty())
6559 if (spriteReplacer !=
null)
6563 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0, renderData, spriteReplacer.
data.
pref ?? Pref);
6567 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0,
this);
6570 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
6572 if ((!isChara ||
Chara.
host ==
null) && !(_emo == lastEmo && skipSame))
6576 renderer.
ShowEmo(_emo, duration);
6584 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6589 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6594 PlaySound(
material.GetSoundImpact(sourceCard), 1f, spatial);
6599 PlaySound(
material.GetSoundDead(sourceCard), 1f, spatial);
6602 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
6604 Card rootCard = GetRootCard();
6611 return rootCard.
pos.
PlaySound(
id, isSynced || !spatial, v, spatial);
6636 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
6642 Card rootCard = GetRootCard();
6646 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
6654 Card rootCard = GetRootCard();
6677 public virtual void Rotate(
bool reverse =
false)
6680 if (sourceCard.
tiles.Length > 4)
6682 num = sourceCard.
tiles.Length;
6744 fx = fx - vector.x + thingPosition.x;
6745 fy = fy - vector.y + thingPosition.y;
6749 float num2 = (fy = 0f);
6773 renderParam.x = v.x;
6774 renderParam.y = v.y;
6775 renderParam.z = v.z;
6777 v.x = renderParam.
x;
6778 v.y = renderParam.
y;
6779 v.z = renderParam.
z;
6793 v.z += thingPosition.z;
6800 if (useCurrentPosition)
6815 renderer.
Draw(renderParam, ref v, drawShadow:
false);
6826 EClass.player.lightRadius = 1;
6834 return GetLightRadius() > 0;
6842 return 0.01f * LightData.color.a * 256f * 1.12f;
6844 if (IsPCFaction && !IsPC)
6910 num2 = traitLightSource.LightRadius;
6915 if (lightRadius > 0)
6917 if (lightRadius > num2)
6937 int radius = GetLightRadius();
6942 float power = GetLightPower();
6963 EClass.player.lightRadius = radius;
6964 EClass.player.lightPower = power;
6970 fov.
Perform(pos.
x, pos.
z, radius, power * 2f);
6981 int num = (trait.UseLightColor ? c_lightColor : 0);
6984 fov.r = (byte)(num / 1024);
6985 fov.g = (byte)(num % 1024 / 32);
6986 fov.b = (byte)(num % 32);
7027 if (fov !=
null && fov.
lastPoints.Count != 0)
7046 things.ForeachReverse(delegate(
Thing t)
7050 if (sourceCard.
_origin ==
"dish")
7058 else if (!isChara && trait.
Decay != 0)
7060 Decay(trait.
Decay * hour);
7078 int num2 = MaxDecay / 4 * 3;
7083 num =
card.trait.DecaySpeedChild;
7085 num = num * trait.DecaySpeed / 100;
7086 int num3 = Evalue(405);
7089 num = num * (100 - num3 * 2) / 100;
7101 if (decay + a > MaxDecay)
7103 if (
card !=
null && !
card.trait.OnChildDecay(
this, !IsDecayed))
7112 card.AddCard(thing);
7113 if (!IsParentLocked())
7115 GetRootCard().Say(
"seed_rot", GetRootCard(),
this, thing.
Name);
7124 else if (GetRootCard() ==
EClass.
pc)
7126 if (!IsParentLocked())
7138 else if (decay < num2 && decay + a >= num2 && GetRootCard() ==
EClass.
pc)
7140 if (!IsParentLocked())
7147 bool IsParentLocked()
7149 if (parent is
Thing)
7151 return (parent as
Thing).c_lockLv > 0;
7159 return !
MOD.
listTalk.
GetTalk(c_idTalk.IsEmpty(
id), idTopic, useDefault:
true).IsEmpty();
7162 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
7166 EClass.player.forceTalk =
false;
7170 EClass.player.forceTalk =
false;
7171 if (!isSynced && !forceSync)
7176 GameLang.refDrama1 = ref1;
7177 GameLang.refDrama2 = ref2;
7178 string text = GetTalkText(idTopic, stripPun:
true);
7180 if ((HasElement(1232) || (condition !=
null && condition.
IsBaby)) && idTopic !=
"baby")
7186 switch ((condition !=
null) ? condition.
chara.
id :
id)
7199 TalkRaw(text, ref1, ref2, forceSync);
7202 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
7204 if ((!isSynced && !forceSync) || text.IsEmpty())
7211 text = text.Replace(
"#1", ref1);
7215 text = text.Replace(
"#2", ref2);
7217 HostRenderer.Say(ApplyNewLine(text));
7218 text = StripTalkSpecialCharacters(text);
7219 bool flag = text.StartsWith(
"*");
7223 text = text.Bracket();
7225 Msg.
Say(text.Replace(
"&",
""));
7234 if (text.Length > 1 &&
int.TryParse(text[1].ToString() ??
"", out var _))
7236 return text.Substring(2);
7242 return text.Substring(1);
7249 if (text.Contains(
"&"))
7251 string text2 =
"_comma".lang();
7252 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
7253 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
7254 text = text.Replace(
"&", Environment.NewLine ??
"");
7259 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
7261 if (isSynced && !text.IsEmpty())
7265 text = text.Replace(
"#1", ref1);
7269 text = text.Replace(
"#2", ref2);
7271 HostRenderer.Say(text);
7277 Say(
"nothingHappens");
7280 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
7289 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
7298 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
7307 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
7311 string text =
MOD.
listTalk.
GetTalk((condition !=
null) ? condition.
chara.
id : c_idTalk.IsEmpty(
id), idTopic, useDefault, flag);
7312 if (!text.IsEmpty())
7314 text = text.Split(
'|').RandomItem();
7315 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
7317 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
7319 text =
"(" + text +
")";
7321 text = text.Replace(
"。)",
")");
7324 return ApplyTone(text, stripPun);
7330 return ApplyTone(
Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
7333 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
7339 string[] array = _tones.IsEmpty(
"").Split(
'|');
7340 string key = array[0];
7345 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
7349 if (array[0].IsEmpty())
7358 if (array.Length >= 2)
7360 stringBuilder.Replace(
"_toneI".lang(), array[1]);
7362 if (array.Length >= 3)
7364 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
7367 text2 = stringBuilder.ToString();
7371 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
7382 return text2.StripLastPun();
7397 List<Dictionary<string, string>> list =
MOD.
tones.
list;
7398 if (list.Count != 0)
7400 int mtp = EClass.core.config.test.extraToneMTP
switch
7413 string text = list.RandomItem()[
"id"];
7414 text = list.RandomItemWeighted((Dictionary<string, string> a) => a[
"chance"].ToInt() * ((!a[
"tag"].Contains(
"meta")) ? 1 : mtp))[
"id"];
7421 return ListCraftBonusTraits().Count > 0;
7426 List<Element> list =
new List<Element>();
7427 string[] tag = sourceCard.
tag;
7428 for (
int i = 0; i < tag.Length; i++)
7430 string[] array = tag[i].Split(
'/');
7431 if (!(array[0] !=
"craft_bonus"))
7447 if (dest.
stack !=
null)
7451 Say(
"stack_thing", t, dest.
stack);
7465 c_idBacker = row.
id;
7471 chara.hostility = hostility2;
7477 Chara.idFaith = row.
deity.ToLowerInvariant();
7482 if (
id ==
"putty_snow")
7495 if (c_idBacker == 164)
7508 c_textureData = GetPaintData();
7518 Sprite sprite = GetSprite();
7519 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
7520 int num = sprite.texture.width * 2;
7521 int num2 = sprite.texture.height * 2;
7522 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
7523 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
7524 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
7525 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
7526 texture2D2.SetPixels(pixels);
7528 byte[] result = texture2D2.EncodeToJPG();
7529 UnityEngine.Object.Destroy(texture2D);
7530 UnityEngine.Object.Destroy(texture2D2);
7536 if ((
bool)_paintSprite)
7538 UnityEngine.Object.Destroy(_paintSprite.texture);
7539 UnityEngine.Object.Destroy(_paintSprite);
7540 _paintSprite =
null;
7548 byte[] data = c_textureData;
7549 Texture2D texture2D =
new Texture2D(1, 1);
7550 texture2D.LoadImage(data);
7551 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
7555 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
7558 return _paintSprite;
7563 if (!(GetRestrainer() ==
null || force))
7567 isRestrained =
false;
7568 Say(
"unrestrained",
this);
7579 if (c_rescueState ==
RescueState.WaitingForRescue)
7593 c.DoHostileAction(
item, immediate:
true);
7620 result = row.value * mat.value / 100;
7657 int num = ((c_fixedValue == 0) ? trait.
GetValue() : c_fixedValue);
7658 if (
id ==
"plat" && !sell)
7669 num2 += (float)c_priceCopy * 0.2f;
7670 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
7674 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
7676 if (IsFood && !
material.tag.Contains(
"food"))
7681 if (IsEquipmentOrRangedOrAmmo || trait is
TraitMod)
7699 if (IsEquipmentOrRanged && rarity >=
Rarity.Legendary)
7701 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
7703 num2 = num2 * (100f + num3 * (float)(
material.value - 100)) / 100f;
7704 if (IsEquipmentOrRanged)
7709 num4 += value.
source.value;
7711 num2 = num2 * (float)(100 + (sell ? ((
int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
7712 if (rarity >=
Rarity.Legendary)
7714 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
7722 if (encLV != 0 && !category.
tag.Contains(
"noEnc"))
7724 num2 = (category.
tag.Contains(
"enc") ? (num2 * (0.7f + (float)(encLV - 1) * 0.2f)) : ((!IsFood) ? (num2 * (1f + (
float)encLV * 0.01f)) : ((!(
id ==
"honey")) ? (num2 * Mathf.Min(1f + 0.1f * (
float)encLV, 2f) + (
float)(encLV * 100)) : (num2 + (float)(encLV * 10)))));
7728 num2 *= (float)(tier + 1);
7730 if (num2 > 2.1474836E+09f)
7732 return int.MaxValue;
7739 if (priceType ==
PriceType.CopyShop && sell)
7745 if (
id ==
"littleball")
7752 if (
id ==
"crimale2")
7760 case "ticket_fortune":
7766 case "scroll_alias":
7768 case "scroll_biography":
7783 if (!(text ==
"mathammer"))
7785 if (!(text ==
"water_jure"))
7791 return 50 + material.tier * material.tier * 10;
7804 case "hammer_strip":
7834 case "diary_sister":
7838 case "diary_catsister":
7840 case "container_magic":
7842 case "wrench_tent_elec":
7844 case "wrench_tent_soil":
7846 case "wrench_tent_seabed":
7850 case "wrench_storage":
7852 case "wrench_fridge":
7854 case "wrench_extend_v":
7856 case "wrench_extend_h":
7862 case "hammer_garokk":
7864 case "scroll_random":
7878 if (!sell &&
id ==
"casino_coin")
7882 int value = GetValue(priceType, sell);
7892 Trait trait = this.trait;
7897 p *= 1f + 4f * (float)(things.
width - traitContainer.Width) + 4f * (float)(things.
height - traitContainer.Height);
7902 p *= 1f + 0.5f * (float)c_containerSize;
7905 if (c_priceFix != 0)
7907 p = (int)((
float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
7917 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
7928 if (!sell && category.
id ==
"spellbook")
7932 bool flag = priceType ==
PriceType.CopyShop;
7933 int num = ((!flag) ? 1 : 5);
7934 float num2 = Mathf.Min(0.01f * (
float)Evalue(752), 1f);
7935 float num3 = Mathf.Min(0.01f * (
float)Evalue(751), 1f);
7936 float num4 = Mathf.Min(0.02f * (
float)Evalue(759), 2f);
7941 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7943 p *= 0.20000000298023224;
7946 p *= 0.20000000298023224;
7949 p *= 0.20000000298023224;
7953 p *= 0.20000000298023224;
7959 if ((uint)(priceType - 1) <= 1u)
7971 if (
id ==
"rod_wish")
7973 p *= (sell ? 0.01f : 50f);
7988 p *= 0.20000000298023224;
7992 p *= 0.10000000149011612;
7995 p *= 0.0020000000949949026;
7998 p *= 0.00019999999494757503;
8001 p *= 0.004999999888241291;
8012 p *= (flag ? 1.25f : 0.3f);
8016 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)c_charges, 0f, 1.5f));
8020 p *= (flag ? 0.9f : 0.5f);
8032 p *= 1f + 0.2f * (float)c.Evalue(1406);
8045 p *= 1.100000023841858;
8079 else if (category.
IsChildOf(
"furniture"))
8099 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
8106 p = ((!sell) ? 1 : 0);
8114 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
8116 else if (p > 10000.0)
8118 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
8120 else if (p > 1000.0)
8122 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
8126 p = Mathf.CeilToInt((
float)p / 100f) * 100;
8130 p = Mathf.CeilToInt((
float)p / 10f) * 10;
8138 if (p > (
double)(sell ? 500000000 : 1000000000))
8151 return Name + GetExtraName();
8168 ForeachPoint(delegate(
Point p,
bool main)
8170 int num2 = DistMulti(p, c);
8178 return DistMulti(pos, c);
8210 isCensored = enable;
8220 if (isDeconstructing != deconstruct)
8230 isDeconstructing = deconstruct;
8244 sortVal = ((c_equippedSlot == 0) ? (category.
sortVal * 1000) : 0);
8247 sortVal = -GetPrice(
currency) * 1000;
8250 sortVal = -Num * 1000;
8253 sortVal = category.sortVal * 1000;
8256 sortVal = -ChildrenAndSelfWeight * 1000;
8259 sortVal = -ChildrenAndSelfWeightSingle * 1000;
8262 sortVal = -GetPrice(
currency) * 1000;
8265 sortVal = sourceCard._index * 1000;
8275 num =
id.CompareTo(c.
id);
8295 num = encLV - c.
encLV;
8314 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
8332 action(pos, arg2:
true);
8346 SE.Play(
"pop_paper");
8376 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
8389 if (!HaveFur() || c_fur < 0)
static bool not(DramaManager dm, Dictionary< string, string > line, params string[] parameters)
virtual bool CancelWhenDamaged
static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
static void TryDelay(Action a)
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
void Add(Act a, string s="")
virtual bool IsRoofEditMode(Card c=null)
virtual void OnInstallCard(Card t)
virtual void OnUninstallCard(Card t)
static void ProcShieldEncs(Chara CC, Card TC, int mtpChance=100)
static void GakiConvert(ref string text, string idLang="zako")
Dictionary< int, int > mapInt
Dictionary< int, string > mapStr
void Mod(int a, bool force=false)
SourceElement.Row sourceElement
void WaitForEndOfFrame(Action action)
List< Action > actionsNextFrame
virtual void RefreshPosition()
static void PublishEvent(string eventId, object data=null)
virtual ConditionType Type
static int GetColorInt(ref Color matColor, int p)
void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h=0, int altitude=0, int dirWall=-1, bool ignoreAltitudeY=false)
Vector3 GetThingPosition(Card tg, Point p)
void SetPortrait(Chara c)
virtual void RefreshSprite()
static void SetRarity(Rarity q=Rarity.Normal)
static CardBlueprint current
static void Set(CardBlueprint _bp=null)
static CardBlueprint _Default
GlobalCharaList globalCharas
void ShowEmo(Emo emo, float duration=0f)
void PlayAnime(AnimeID id, bool force)
override void Draw(RenderParam p)
virtual void SetOwner(Card c)
virtual void SetFirst(bool first, Vector3 pos)
void SetCensored(bool enable)
int CountRune(bool countFree=true)
void SetTier(int a, bool setTraits=true)
void ModExp(int ele, int a)
Thing TryMakeRandomItem(int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
virtual string AliasMaterialOnCreate
virtual string GetName(NameStyle style, int num=-1)
virtual MoveResult _Move(Point p, MoveType type=MoveType.Walk)
virtual string GetHoverText()
void Teleport(Point point, bool silent=false, bool force=false)
virtual string GetExtraName()
ContainerUpgrade c_containerUpgrade
void PurgeDuplicateArtifact(Thing af)
void RemoveEditorTag(EditorTag tag)
void ApplySocket(int id, int lv, Card mod=null)
SocketData AddRune(Card rune)
bool CanAddRune(TraitMod mod)
void Say(string lang, Card c1, Card c2, string ref1=null, string ref2=null)
virtual void ApplyMaterialElements(bool remove)
virtual void OnSimulateHour(VirtualDate date)
int EvalueMax(int ele, int min=0)
void MakeFigureFrom(string id)
void SetPlaceState(PlaceState newState, bool byPlayer=false)
void SetCensored(bool enable)
ElementContainerCard elements
void _OnDeserialized(StreamingContext context)
virtual void HealHPHost(long a, HealSource origin=HealSource.None)
bool IsRestrainedResident
SourceBacker.Row sourceBacker
bool TryReserve(AIAct act)
Hostility c_originalHostility
bool IsExcludeFromCraft(Recipe.Ingredient ing)
Thing AddThing(Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
void PlaySoundHold(bool spatial=true)
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
void AddBlood(int a=1, int id=-1)
void SetRandomLightColors()
CardRenderer HostRenderer
void OnChildNumChange(Card c)
int Evalue(int ele, bool ignoreGlobalElement)
bool IsStackable(Thing tg)
bool HasElement(string id, int req=1)
void Explode(Point p, Card origin)
SourceMaterial.Row DyeMat
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
void SetInt(string id, int value=0)
void MakeRefFrom(Card c1, Card c2=null, bool simple=false)
Card MakeRefFrom(string id)
string TryGetFoodName(Card c)
string ApplyNewLine(string text)
virtual void LookAt(Point p)
virtual SourceMaterial.Row DefaultMaterial
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
virtual void SetDir(int d)
bool IsEquipmentOrRangedOrAmmo
int GetAffinityExpBonus()
void Say(string lang, Card c1, string ref1=null, string ref2=null)
int GetResistPenetrationLevel(int idEle, AttackSource attackSource, Card origin=null)
static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
virtual CardRenderer _CreateRenderer()
Thing AddThing(string id, int lv=-1)
virtual bool MatchEncSearch(string s)
virtual string GetDetail()
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
T SetObj< T >(string id, object o)
void PlaySoundImpact(bool spatial=true)
virtual string actorPrefab
virtual void OnBeforeCreate()
void NotifyAddThing(Thing t, int num)
MixedFoodData c_mixedFoodData
void AddEditorTag(EditorTag tag)
virtual string GetHoverText2()
void ApplySocket(Thing t)
virtual bool IsDeadOrSleeping
void Kick(Point p, bool ignoreSelf=false, bool checkWall=true)
int GetCurrency(string id="money")
void ForeachPoint(Action< Point, bool > action)
void Dye(SourceMaterial.Row mat)
virtual bool IsPCPartyMinion
string c_idSpriteReplacer
SourceMaterial.Row _material
bool HasElement(int ele, int req)
Thing GiveBirth(Thing t, bool effect)
virtual Sprite GetImageSprite()
virtual void ApplyMaterial(bool remove=false)
void ApplyElementEffect(Element e, int eleP, Card origin, bool checkHostileAct=false)
void ChangeAltitude(int a)
List< SocketData > socketList
string GetStr(string id, string defaultStr=null)
void PlayAnime(AnimeID id, Point dest, bool force=false)
virtual void SetBlessedState(BlessedState s)
RenderParam GetRenderParam()
void ModExpParty(int ele, int a)
bool HasTalk(string idTopic)
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
void DecayNatural(int hour=1)
bool IsInMutterDistance(int d=10)
virtual void OnCreate(int genLv)
virtual void LookAt(Card c)
void RenderMarker(Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
virtual long ApplyProtection(long dmg, int mod=100)
void MakeFoodRef(Card c1, Card c2=null)
MoveResult TryMoveFrom(Point p)
virtual void OnDeserialized()
void _OnSerializing(StreamingContext context)
virtual CardRow sourceRenderCard
int ChildrenAndSelfWeightSingle
virtual void SetRenderParam(RenderParam p)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
virtual void HealHP(long a, HealSource origin=HealSource.None)
virtual SubPassData GetSubPassData()
List< int > c_corruptionHistory
override string ToString()
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
virtual Sprite GetSprite(int dir=0)
Window.SaveData GetWindowSaveData()
void ModCurrency(int a, string id="money")
string StripTalkSpecialCharacters(string text)
static string ApplyTone(Chara c, ref string text, string _tones, int gender, bool stripPun=false)
bool ShouldTrySetDirtyInventory()
virtual void ApplyEditorTags(EditorTag tag)
virtual bool IsAliveInCurrentZone
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
virtual int SecondaryCompare(UIList.SortMode m, Card c)
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
void RemoveThing(Thing thing)
Card MakeFoodFrom(string _id)
SocketData GetRuneEnc(int idEle)
Card MakeFoodFrom(Card c, bool makeRef=true)
void PlaySoundDead(bool spatial=true)
bool TryPay(int a, string id="money")
void ModCharge(int a, bool destroy=false)
bool HasGlobalElement(int ele)
bool HasEditorTag(EditorTag tag)
Card ChangeMaterial(string idNew, bool ignoreFixedMaterial=false)
void SetStr(string id, string value=null)
bool HasCraftBonusTrait()
virtual void Rotate(bool reverse=false)
Card SetHidden(bool hide=true)
void SetFreePos(Point point)
int GetDaysTogetherBonus()
void DamageHP(long dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null, int resistPenetrationLevel=0)
virtual void SetImage(Image image)
virtual bool CanStackTo(Thing to)
TraitShackle GetRestrainer()
virtual void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
bool CanReserve(AIAct act)
virtual void OnSerializing()
Window.SaveData c_windowSaveData
void SetObj(string id, object o)
BlessedState blessedState
void PlaySoundDrop(bool spatial=true)
ref Color GetRandomColor()
bool TryStackTo(Thing to)
virtual bool IsPCFactionMinion
void ApplyBacker(int bid)
void TryUnrestrain(bool force=false, Chara c=null)
RescueState c_rescueState
void SetImage(Image image, int dir, int idSkin=0)
virtual CardRow sourceCard
void AddInt(string id, int value)
void ModExp(string alias, int a)
List< Element > ListCraftBonusTraits()
int ChildrenAndSelfWeight
int GetTotalQuality(bool applyBonus=true)
Thing Add(string id, int num=1, int lv=1)
void PlayAnime(AnimeID id, bool force=false)
SourceCategory.Row category
void SetDeconstruct(bool deconstruct)
void SetBool(string id, bool enable)
virtual void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
virtual MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
void ModNum(int a, bool notify=true)
void Kick(Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
virtual void ChangeRarity(Rarity q)
SourceCategory.Row _category
SocketData AddRune(int idEle, int v, bool free)
void SayRaw(string text, string ref1=null, string ref2=null)
virtual int GetArmorSkill()
int GetValue(PriceType priceType=PriceType.Default, bool sell=false)
void PlayEffect(int ele, bool useRenderPos=true, float range=0f)
void AddExp(int a, bool applyMod=true)
int GetInt(string id, int? defaultInt=null)
void SpawnLoot(Card origin)
bool HasElement(int ele, bool includeNagative=false)
string GetFoodName(string s)
VisitorState visitorState
void TalkRaw(string text, string ref1=null, string ref2=null, bool forceSync=false)
Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial=false)
void ForeachFOV(Func< Point, bool > func)
void Create(string _id, int _idMat=-1, int genLv=-1)
int ResistLvFrom(int ele)
void Say(string lang, string ref1=null, string ref2=null)
string ApplyTone(string text, bool stripPun=false)
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
void MoveThingToBottom(Thing t)
void MoveThingToTop(Thing t)
void AddBodyPart(int ele, Thing thing=null)
void Unequip(Thing thing, bool refresh=true)
AttackStyle GetAttackStyle()
Thing GetEquippedThing(int elementId)
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Hostility OriginalHostility
Condition AddCondition(string id, int p=100, bool force=false)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
void SetFeat(int id, int value=1, bool msg=false)
override string ToString()
ElementContainer tempElements
List< Condition > conditions
bool HasCondition(string alias)
override bool IsPCFaction
void CalculateMaxStamina()
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
FactionMemberType memberType
Card DropHeld(Point dropPos=null)
void AddCooldown(int idEle, int turns=0)
Thing MakeGene(DNA.Type? type=null)
void ModCorruption(int a)
Chara SetEnemy(Chara c=null)
void DoHostileAction(Card _tg, bool immediate=false)
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
ConBaseTransmuteMimic mimicry
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Chara SetHostility(Hostility h)
void TrySetEnemy(Chara c)
bool HasCooldown(int idEle)
bool DroppedCard(string id)
CodexCreature GetOrCreate(string id)
void MarkCardDrop(string id)
UD_String_LightData lightColors
UD_String_MatData matColors
override void Reveal(Card attacker=null, bool surprise=false)
virtual bool ShouldRevealOnContact
virtual void OnCalculateFov(Fov fov, ref int radius, ref float power)
void Kill(bool silent=false)
virtual void OnCreateFov(Fov fov)
bool dontCancelIfZeroDamage
static Thing CopyDNA(Thing from, Thing to)
static Thing GenerateRandomGene(int lv=-1, int seed=-1)
void Add(Card target, Card attacker, int dmg, Element e=null)
int GetRaw(int offsetHours=0)
static int Roll(int num, int sides, int bonus=0, Card card=null)
static int curve(long _a, int start, int step, int rate=75)
static ColorProfile Colors
static SourceManager sources
static float rndf(float a)
static FactionBranch Branch
static BaseGameScreen screen
static int rndHalf(int a)
static SoundManager Sound
static GameSetting setting
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
static Effect Get(Effect original)
Effect SetParticleColor(Color c)
void SetOwner(Card c, bool applyFeat)
void ModExp(int ele, float a, bool chain=false)
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
void CopyTo(ElementContainer container)
int ValueWithoutLink(int ele)
Element ModBase(int ele, int v)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
void SetTo(int id, int v)
Element SetBase(string alias, int v, int potential=0)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
static int GetResistLv(int v)
static Element Create(int id, int v=0)
static int[] List_MainAttributesMajor
static long GetResistDamage(long dmg, int v, int power=0)
Dictionary< string, Dictionary< string, string > > all
List< Dictionary< string, string > > list
virtual void Initialize()
HomeResourceManager resources
List< FactionBranch > GetChildren()
void AddContribution(int a)
Dictionary< int, byte > lastPoints
void Perform(int _x, int _z, int _range, float power=1f)
static string ConvertDrama(string text, Chara c=null)
bool enableDamageReduction
bool disableUsermapBenefit
UD_String_ElementRef elements
HashSet< Texture2D > loadedTextures
ReligionManager religions
bool CanGiveContribution(Chara c)
int BuySpellbookPrice(int a)
int SellStolenPrice(int a)
static GuildFighter Fighter
static bool Has(string id)
static LangSetting setting
static NaturalStringComparer comparer
static string[] GetList(string id)
LayerChara SetChara(Chara c)
static LayerDrama Instance
static void SetDirty(Thing t)
static List< LayerInventory > listInv
static SourceMaterial.Row GetRandomMaterial(int lv, string group=null, bool tryLevelMatTier=false)
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
static TalkDataList listTalk
static ToneDataList tones
Chara FindChara(string id)
void TrySmoothPick(Cell cell, Thing t, Chara c)
void MoveCard(Point p, Card t)
void OnSetBlockOrDoor(int x, int z)
void AddDecal(int x, int z, int id, int amount=1, bool refresh=true)
static int ClampToInt(long a)
void Add(Point point, float tile=0f, float color=0f)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
int EvalueTotal(int ele, Func< Chara, bool > funcIf=null)
void RemoveMember(Chara c)
void ModExp(int ele, int a)
Dictionary< string, int > dialogFlags
bool TryAbortAutoCombat(bool immediate=true)
void RefreshCurrentHotItem()
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
ref Vector3 Position(int height)
List< Card > ListCards(bool includeMasked=false)
RenderParam ApplyAnime(RenderParam p)
override string ToString()
Point Set(int _x, int _z)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
ref Vector3 PositionCenter()
bool Equals(int _x, int _z)
Effect PlayEffect(string id)
void RefreshNeighborTiles()
bool IsActive(int id, int days=-1)
void OnCardAddedToZone(Card c)
List< Card > deconstructing
void OnNumChange(Card c, int a)
virtual void OnKillChara(Chara c)
static int Range(int min, int max)
static void UseSeed(int seed, Action action)
static void SetSeed(int a=-1)
HashSet< string > knownIngredients
Religion GetArtifactDeity(string id)
static Religion recentWrath
static RenderParam shared
SourceCategory.Row Category
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0, Card card=null)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
SourceMaterial.Row DefaultMaterial
AnimationCurve fovCurveChara
float playerLightCustomMod
SceneGlobalProfile global
DamageTextRenderer damageTextRenderer
Dictionary< string, CardRow > map
bool IsChildOf(string id)
string GetText(string id="name", bool returnNull=false)
string TryGetId(string id, string id2)
SourceCategory categories
static SpawnList Get(string id, string parent=null, CardFilter filter=null)
CardRow Select(int lv=-1, int levelRange=-1)
Sprite GetSprite(string suffix="")
static Dictionary< string, SpriteReplacer > dictSkins
static SubPassData Default
string GetTalk(string id, string idTopic, bool useDefault=false, bool human=true)
string GetRandomID(string tag)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void SetOwner(Card owner)
Thing TryStack(Thing target, int destInvX=-1, int destInvY=-1)
void AddCurrency(Card owner, string id, int a, SourceMaterial.Row mat=null)
DestData GetDest(Thing t, bool tryStack=true)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
long GetCurrency(string id, ref long sum, SourceMaterial.Row mat=null)
static Thing CreateFromFilter(string id, int lv=-1)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing Create(string id, int idMat=-1, int lv=-1)
void TryLickEnchant(Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
override CardRow sourceCard
virtual void GetMountHeight(ref Vector3 v, Point p, int d, Card target=null)
virtual bool UseMountHeight
StringBuilder ApplyTone(string id, ref string text, int gender)
string GetToneID(string id, int gender)
static Thing MakeRandomSeed(bool enc=false)
virtual bool CanBeAttacked
virtual bool ShouldRefreshTile
virtual void OnChangePlaceState(PlaceState state)
virtual bool CanChildDecay(Card c)
virtual bool CanBeDestroyed
virtual void SetOwner(Card _owner)
virtual void Toggle(bool on, bool silent=false)
virtual void OnSimulateHour(VirtualDate date)
virtual bool CanBeTeleported
virtual EffectDead EffectDead
virtual void OnCreate(int lv)
virtual void OnBarter(bool reroll=false)
virtual ToggleType ToggleType
virtual bool ShouldTryRefreshRoom
virtual bool CanBeSmashedToDeath
virtual bool LevelAsQuality
virtual int CompareTo(Card b)
virtual ThrowType ThrowType
virtual int InstallBottomPriority
void Install(bool byPlayer)
static void Reserve(string idStep, Action onBeforePlay=null)
static Dictionary< string, SaveData > dictData
virtual int SightRadiusBonus
Chara SpawnMob(string id, Point pos=null)
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
Card AddCard(Card t, Point point)
void OnChildNumChange(Card c)