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";
2369 if (
Tiles.Length < 3)
2443 return bio.gender == 2;
2543 return GetBool(
id.GetHashCode());
2548 SetBool(
id.GetHashCode(), enable);
2551 public int GetInt(
string id,
int? defaultInt =
null)
2553 int @
int =
GetInt(
id.GetHashCode(), defaultInt);
2563 AddInt(
id.GetHashCode(), value);
2572 SetInt(
id.GetHashCode(), value);
2579 public string GetStr(
string id,
string defaultStr =
null)
2581 return GetStr(
id.GetHashCode(), defaultStr);
2584 public void SetStr(
string id,
string value =
null)
2586 SetStr(
id.GetHashCode(), value);
2596 SetObj(
id.GetHashCode(), o);
2658 if (
card.isSale || !
card.trait.CanUseContent)
2663 if (windowSaveData !=
null)
2675 EClass.player.wasDirtyWeight =
true;
2693 public int Evalue(
int ele,
bool ignoreGlobalElement)
2719 return c_editorTags?.Contains(tag.ToString()) ??
false;
2752 int num2 =
item.Value;
2827 for (
int i = 0; i <
sockets.Count; i++)
2845 thing.parent =
this;
2895 CardBlueprint.current =
null;
2946 if (
id ==
"microchip")
3028 EClass._zone.Boss =
Chara;
3070 int num = elementContainer.Value(value.
id);
3100 public void AddExp(
int a,
bool applyMod =
true)
3125 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
3129 return num * (100 +
Evalue(1237) * 30 +
Evalue(1273) * 50 + ((
Evalue(1275) >= 2) ? 50 : 0)) / 100;
3160 Say(
"dingExp",
this);
3175 int num = Mathf.Min(1 +
LV / 5, 20);
3176 for (
int i = 0; i < num; i++)
3178 if (
Evalue(1644) < i + 1)
3216 if (rootCard !=
null && rootCard.
IsPC)
3271 Debug.LogWarning(
"already child:" + t);
3276 Debug.Log(
"already in the list" + t);
3291 t.ignoreAutoPick =
false;
3335 if (rootCard !=
null && rootCard.
IsPC)
3344 t.isNPCProperty =
false;
3358 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3361 void TryAdd(
Thing a)
3363 if (!ings.Contains(a.
id))
3381 List<Chara> list =
new List<Chara>();
3397 if (!
item.IsPCFactionOrMinion)
3402 if (list2.Count == 0)
3406 foreach (
Thing item2
in list2)
3410 item.body.Unequip(item2);
3413 Msg.
Say(
"waterCurse", item2);
3417 foreach (
Chara item3
in list)
3424 if (list3.Count == 0)
3428 foreach (
Thing item4
in list3)
3430 Msg.
Say(
"destroyed_inv_", item4, item3);
3442 List<Chara> list =
new List<Chara>();
3456 if (
item.IsPCFactionOrMinion)
3470 for (
int num =
things.Count - 1; num >= 0; num--)
3481 rootCard.Chara.held =
null;
3487 instance.selectedButton.card =
null;
3490 ActionMode.AdvOrRegion.updatePlans =
true;
3507 if (thing.
invY == 1)
3509 WidgetCurrentTool.dirty =
true;
3513 if (thing.
props !=
null)
3521 WidgetHotbar.dirtyCurrentItem =
true;
3522 thing.parent =
null;
3527 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3534 thing.parent =
null;
3543 return EClass.ui.layers.Count > 0;
3565 to.c_isImportant =
true;
3590 return card.GetRootCard();
3617 thing.encLV =
encLV;
3618 thing.decay =
decay;
3621 foreach (KeyValuePair<int, int>
item in mapInt)
3625 foreach (KeyValuePair<int, string> item2
in mapStr)
3627 thing.
mapStr[item2.Key] = item2.Value;
3633 thing.sockets = IO.DeepCopy(
sockets);
3649 ModNum(-a, notify:
false);
3661 return this as
Thing;
3664 return this as
Thing;
3670 return this as
Thing;
3673 public void ModNum(
int a,
bool notify =
true)
3712 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3718 for (
int i = 0; i <
sockets.Count; i++)
3736 for (
int i = 0; i <
sockets.Count; i++)
3742 int ele = num / 1000;
3743 int num2 = num % 1000;
3838 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3844 string encSlot = source.
encSlot;
3845 if (encSlot ==
null || encSlot.Length != 0)
3858 string[] array = source.
encSlot.Split(
',');
3859 foreach (
string key
in array)
3907 if (this.placeState == newState)
3913 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3925 float num2 = (
fy = 0f);
3936 this.placeState = newState;
3944 this.placeState = newState;
3999 num = num * (100 +
Quality) / 100;
4036 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
4083 public bool TryPay(
int a,
string id =
"money")
4090 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
4094 if (
IsPC && !(
id ==
"ration"))
4114 Say(
"spellbookCrumble",
this);
4123 if (
id ==
"influence")
4135 if (
id ==
"influence")
4142 if (sum >
int.MaxValue)
4170 num = (long)a * (
long)Mathf.Max(100 -
Evalue(93), 1) / 100;
4172 if (num > 100000000)
4204 int num =
PV + orCreateElement.Value +
DEX / 10;
4211 num2 = num3 / 10 + 1;
4212 sides = num3 / num2 + 1;
4214 dmg = dmg * 100 / Mathf.Max(100 + num, 1);
4216 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
4217 dmg -= num4 * mod / 100;
4231 int num = origin.Evalue(1238);
4235 if (origin.HasElement(1247))
4240 if (attackSource ==
AttackSource.MagicArrow && origin.HasElement(1244))
4244 if (attackSource ==
AttackSource.MagicHand && origin.HasElement(1246))
4248 if (idEle == 916 && (
HasElement(1253) || origin.HasElement(1253)))
4257 DamageHP(dmg, 0, 0, attackSource, origin);
4266 bool flag = originalTarget !=
null;
4267 Action onEvade =
null;
4276 Say(
"wall_bond", chara3,
this);
4285 if ((uint)(attackSource2 - 3) > 2u && (uint)(attackSource2 - 13) > 5u)
4291 int num = chara4.
Evalue(1241);
4292 int num2 = chara4.
Evalue(438);
4295 Say((num2 == 0) ?
"wall_flesh" :
"wall_knightly", chara4,
this);
4296 chara4.
DamageHP(dmg * (100 + ((num2 > 0) ? (-10) : 0) + ((num > 0) ? 10 : 0)) / 100, ele, eleP, attackSource, origin, showEffect,
weapon,
Chara);
4304 if (origin !=
null && origin.HasElement(1208))
4306 switch (attackSource)
4309 dmg = dmg * 130 / 100;
4310 eleP = eleP * 150 / 100;
4313 dmg = dmg * 120 / 100;
4314 eleP = eleP * 150 / 100;
4320 dmg = dmg * (100 + origin.Evalue(94)) / 100;
4323 if (ele == 0 || ele == 926)
4328 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
4334 if (attackSource !=
AttackSource.Condition && showEffect)
4345 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
4346 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
4353 if (chara2 !=
null && chara2.
isWet)
4362 if (chara !=
null && chara.
isWet)
4364 dmg = dmg * 150 / 100;
4370 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
4378 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
4380 if (origin !=
null && origin.HasCondition<
ConBerserk>())
4389 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num3 - 50))) / 100;
4394 dmg = dmg * 100 / (100 +
Evalue(435) * 2);
4396 dmg = dmg * Mathf.Max(0, 100 - Mathf.Min(
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56), 100) / ((!flag) ? 1 : 2)) / 100;
4403 dmg = dmg * 90 / 100;
4407 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
4411 dmg = dmg * 90 / 100;
4430 dmg = dmg * 100 / Mathf.Min(100 + num4 * 5, 120);
4434 dmg = dmg * Mathf.Min(100 + num5 * 5, 120) / 100;
4439 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
4441 if (
HasElement(1218) && attackSource != AttackSource.ManaBackfire && (
hp > 0 ||
Evalue(1421) <= 0))
4443 dmg = dmg * (1000 - Mathf.Min(
Evalue(1218), 1000) / ((!flag) ? 1 : 2)) / 1000;
4451 int num6 =
MaxHP / 10;
4452 long num7 = dmg - num6;
4453 num7 = num7 * 100 / (200 +
Evalue(68) * 10);
4465 long num8 = 99999999L;
4469 if (condition !=
null)
4471 num8 = num8 * (100 + condition.lv * 5) / 100;
4478 float num9 = Mathf.Clamp(dmg * 6 /
MaxHP, 0f, 4f) + (float)((dmg > 0) ? 1 : 0);
4489 if (hp < 0 && Chara.mana.value >= 0)
4505 Chara.mana.value -= (int)dmg;
4522 float ratio = (float)dmg / (
float)
MaxHP;
4533 if (
EClass.
pc.
ai is
AI_PracticeDummy { IsRunning:
not false } aI_PracticeDummy && aI_PracticeDummy.target ==
this && (origin ==
null || origin.IsPC))
4535 aI_PracticeDummy.hit++;
4536 aI_PracticeDummy.totalDamage += dmg;
4579 if (origin !=
null && origin !=
this &&
Evalue(436) > 0 && !HasCondition<ConFractured>())
4588 hp = Mathf.Min(half * (
int)Mathf.Sqrt(
Evalue(436) * 2) / 100,
MaxHP / 3);
4609 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
4611 EClass.player.invlunerable =
true;
4650 if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null && (origin.isSynced ||
IsPC))
4657 text =
"dead_" + e.
source.alias;
4661 text =
"dead_attack";
4669 text =
"kill_" + e.source.alias;
4673 text =
"kill_attack";
4675 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4683 Say(
"reboot",
this);
4690 if (HasCondition<ConRebirth>())
4692 Say(
"rebirth",
this);
4704 Msg.alwaysVisible =
true;
4705 Msg.
Say(
"layhand", chara5,
this);
4706 Msg.
Say(
"pray_heal",
this);
4716 if (zoneInstanceBout !=
null)
4748 Die(e, origin, attackSource, originalTarget);
4749 if (origin !=
null && origin.id ==
"unseenhand" && !origin.IsGlobal)
4751 origin.isSummon =
true;
4752 origin.c_summonDuration = 4;
4759 string text2 =
new int[18]
4761 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4762 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4763 }.RandomItem().ToString();
4766 text2 =
"casino_coin";
4770 text2 =
"scratchcard";
4798 if (origin !=
null && origin.isChara)
4820 if (origin.GetInt(106) == 0)
4822 origin.Chara.TalkTopic(
"kill");
4827 else if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null)
4829 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num9 + (
IsPC ?
"pc" :
""), origin,
this);
4833 int num13 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4834 if (num9 >= (
float)num13)
4838 Say(
"dmg_" + e.source.alias,
this);
4842 Say(
"dmg" + num9,
this);
4865 if (origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4869 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4873 int num15 = origin.Dist(
this);
4877 if (
id ==
"hedgehog_ether")
4881 Say(
"reflect_thorne", origin,
this);
4882 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele2,
Power,
AttackSource.Condition,
this);
4887 Say(
"reflect_acid",
this, origin);
4888 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele3,
Power * 2,
AttackSource.Condition,
this);
4900 int a2 = (int)(100 * (dmg * 100 /
MaxHP) / 100) + 1;
4911 int num16 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4921 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4927 Condition.ignoreEffect =
true;
4929 Condition.ignoreEffect =
false;
4933 float num17 = (float)
hp / (
float)
MaxHP;
4940 PlaySound(
"heartbeat", 1f - num17 * 2f);
4973 EClass.player.forceTalk =
true;
4975 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
4986 void EvadeDeath(Action action)
4991 Chara.mana.value = 0;
5005 if (origin !=
null && origin.isChara &&
isChara && (
weapon ==
null || !
weapon.HasElement(486)))
5007 int num18 = origin.Evalue(662) + (
weapon?.Evalue(662, ignoreGlobalElement:
true) ?? 0);
5008 int num19 = origin.Evalue(661) + (
weapon?.Evalue(661, ignoreGlobalElement:
true) ?? 0);
5011 int num20 =
EClass.
rnd(3 + (
int)Mathf.Clamp(dmg / 100, 0f, num18 / 10));
5012 origin.Chara.stamina.Mod(num20);
5018 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
5020 int num21 =
EClass.
rndHalf(2 + (
int)Mathf.Clamp(dmg / 10, 0f, origin.Chara.GetPietyValue() + 10));
5021 origin.Chara.mana.Mod(num21);
5029 int num22 =
EClass.
rnd(2 + (
int)Mathf.Clamp(dmg / 10, 0f, num19 + 10));
5030 origin.Chara.mana.Mod(num22);
5047 bool hostile =
false;
5051 if (Chance(30 + eleP / 5, 100))
5053 MarkHostile().AddCondition<
ConBurning>(eleP);
5059 if (Chance(30 + eleP / 10, 100))
5064 else if (Chance(50 + eleP / 10, 100))
5070 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
5076 if (Chance(30 + eleP / 5, 100))
5078 MarkHostile().AddCondition<
ConPoison>(eleP);
5082 if (Chance(30 + eleP / 5, 100))
5089 if (Chance(30 + eleP / 5, 100))
5098 if (Chance(30 + eleP / 5, 100))
5103 else if (Chance(30 + eleP / 5, 100))
5109 if (Chance(50 + eleP / 10, 100))
5117 if (Chance(30 + eleP / 5, 100))
5136 if (Chance(5 + eleP / 25, 40))
5140 if (Chance(5 + eleP / 25, 40))
5144 if (Chance(5 + eleP / 25, 40))
5148 if (Chance(5 + eleP / 25, 40))
5150 MarkHostile().AddCondition<
ConPoison>(eleP / 2);
5152 if (Chance(5 + eleP / 25, 40))
5156 if (Chance(5 + eleP / 25, 40))
5160 if (Chance(30 + eleP / 10, 100))
5166 if (Chance(50 + eleP / 10, 100))
5168 MarkHostile().AddCondition<
ConBleed>(eleP);
5172 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
5185 if (checkHostileAct && hostile && origin !=
null && origin.
isChara)
5189 static bool Chance(
int a,
int max)
5191 return Mathf.Min(a, max) >
EClass.
rnd(100);
5202 Card rootCard = GetRootCard();
5204 if (_pos !=
null && !_pos.
IsValid)
5215 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
5216 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
5218 text += e.source.alias;
5222 Msg.
Say(text,
this, rootCard);
5227 Msg.
Say(
"destroyed",
this);
5232 things.ForeachReverse(delegate(
Thing t)
5242 if (e !=
null && _pos !=
null && e.id == 21)
5248 Explode(pos, origin);
5256 origin = origin?.Chara,
5258 aliasEle =
"eleImpact"
5264 PlaySound(
material.GetSoundDead(sourceCard));
5272 Debug.Log(Name +
" is already destroyed.");
5283 Chara.isDead =
true;
5301 for (
int num = things.Count - 1; num >= 0; num--)
5303 things[num].Destroy();
5310 if (!isChara || IsPCFactionMinion || (isCopy &&
EClass.
rnd(10) != 0))
5316 List<Card> list =
new List<Card>();
5317 if (!IsPCFaction && !isUserZone && sourceCard.
idActor.IsEmpty())
5320 if (this.rarity >=
Rarity.Legendary)
5353 else if (origin !=
null && origin.
HasElement(290) && !IsMinion)
5365 if (
id ==
"littleOne" && IsPCFactionOrMinion)
5373 if (flag2 && !isUserZone)
5376 if (!(text ==
"bubble_pudding"))
5378 if (text ==
"marshmallow_monster")
5385 bool num2 = text2 ==
"_meat";
5393 text2 =
"dattamono";
5397 text2 =
"meat_marble";
5400 if (thing3.
source._origin ==
"meat")
5420 if (!IsPCFaction && !isUserZone)
5422 foreach (
string item2
in sourceCard.
loot.Concat(
Chara.
race.loot).ToList())
5424 string[] array = item2.
Split(
'/');
5425 int num4 = array[1].ToInt();
5474 if (!isBackerContent && !flag)
5510 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.rarity >=
Rarity.Legendary) ? 1 : 0));
5531 List<Thing> list2 =
new List<Thing>();
5532 foreach (
Thing thing6
in things)
5558 if (num5 > 0 && list2.Count > 0)
5561 for (
int j = 0; j < list2.Count && j < num5; j++)
5567 if (this.rarity >=
Rarity.Legendary && !IsUnique && c_bossType !=
BossType.Evolved)
5570 foreach (
Card item3
in list)
5579 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
5584 for (
int k = 0; k < num5; k++)
5613 List<Thing> list3 = thing4.
things.ToList();
5623 while (num8 > 0 && list3.Count != 0)
5625 Thing thing5 = list3.First();
5626 list3.Remove(thing5);
5637 foreach (
Thing thing7
in things)
5639 if (thing7.
GetInt(116) != 0)
5644 Point nearestPoint = GetRootCard().pos;
5649 foreach (
Card item4
in list)
5655 item4.isHidden =
false;
5656 item4.isNPCProperty =
false;
5713 case "egg_fertilized":
5718 string text =
"c_wilds";
5719 if (
id ==
"_meat" ||
id ==
"meat_marble")
5727 for (
int i = 0; i < 20; i++)
5730 if (cardRow.
model.
Chara.
race.corpse[0] !=
"_meat" &&
id !=
"milk" &&
id !=
"_egg" &&
id !=
"egg_fertilized")
5740 if (crafter !=
null && crafter.id ==
"big_sister")
5742 cardRow = crafter.source;
5747 if (c_idRefCard.IsEmpty())
5749 MakeRefFrom(cardRow.
model);
5754 MakeFoodFrom(cardRow.
model);
5756 return this as
Thing;
5762 return this as
Thing;
5782 int num = race.
food[0].ToInt();
5783 bool flag =
id ==
"meat_marble";
5785 bool flag2 = category.
IsChildOf(
"meat");
5786 bool flag3 =
id ==
"517" ||
id ==
"marshmallow_nama" || category.
IsChildOf(
"egg") || trait is
TraitGene;
5797 elements.
SetBase(70, race.
STR * race.
STR / 5 * num / 100 - 10 + num / 10);
5800 elements.
SetBase(440, race.
END * race.
END / 5 * num / 100 - 10 + num / 10);
5802 elements.
SetBase(71, (
int)Mathf.Clamp((
float)(num / 10) + Mathf.Sqrt(race.
height) - 10f, 1f, 60f));
5806 elements.
SetBase(444, race.
LER * race.
LER / 5 * num / 100 - 10 + num / 10);
5824 foreach (
Element value
in c.elements.dict.Values)
5826 if ((!flag3 || value.
id != 1229) && (value.
source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
5831 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
5832 foreach (KeyValuePair<int, int>
item in race.elementMap)
5836 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
5839 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5840 for (
int i = 0; i < num2 && i < list.Count; i++)
5842 Tuple<int, int> tuple = list[i];
5843 elements.
SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5845 if (c.Chara.IsUndead)
5847 elements.
ModBase(73, (c.Chara.race.id ==
"undeadgod") ? (-90) : (-20));
5849 isWeightChanged =
true;
5850 c_weight = race.height * 4 + 100;
5851 c_idMainElement = c.c_idMainElement;
5853 int num3 = c.LV - c.sourceCard.LV;
5859 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
5863 if (flag2 && c.IsPCFaction && c.IsUnique)
5878 if (IsIgnoreName(
card))
5882 if (IsIgnoreName(card2))
5886 if (
card ==
null && card2 !=
null)
5893 MakeRefFrom(
card, card2);
5894 if (
card.c_idRefCard !=
null)
5896 c_idRefCard =
card.c_idRefCard;
5897 c_altName = TryGetFoodName(
card);
5902 c_altName2 = TryGetFoodName(card2);
5905 static bool IsIgnoreName(
Card c)
5935 if (!row.aka.IsEmpty())
5937 if (row.name ==
"*r" && row.aka ==
"*r")
5939 return "corpseGeneral".lang();
5941 if (row.name ==
"*r")
5943 return row.GetText(
"aka");
5946 return row.GetName();
5951 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
5967 c_idRefCard = c1.
id;
5971 c_idRefCard2 = c2.id;
5972 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName((!simple) ? NameStyle.Ref :
NameStyle.Simple, (!c2.isChara) ? 1 : 0));
5974 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.
c_extraNameRef);
5988 thing.c_idMainElement = c_idMainElement;
5997 return GiveBirth(thing, effect);
6015 int num2 = LV - sourceCard.
LV;
6020 if (num2 >= 10 && !HasElement(1290))
6028 return GiveBirth(thing, effect);
6034 EClass.player.forceTalk =
true;
6035 card.Talk(
"giveBirth");
6039 card.pos.PlayEffect(
"revive");
6040 card.pos.PlaySound(
"egg");
6052 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" });
6056 AddBlood(12, (uid % 2 == 0) ? (-1) : 3);
6058 PlaySound(
"egghatch");
6067 for (
int i = 0; i < 1 +
EClass.
rnd(num + 1); i++)
6070 if (chara !=
null && isChara)
6073 chara.isHatchling =
true;
6125 SayNothingHappans();
6128 PlayEffect(
"teleport");
6131 Say(
"antiTeleport",
this);
6132 PlaySound(
"gravity");
6137 PlaySound(
"teleport");
6138 Say(
"teleported",
this);
6147 if (chara.
enemy ==
this)
6158 EClass.player.haltMove =
true;
6160 PlayEffect(
"teleport", useRenderPos:
false);
6167 PlayEffect(
"ripple");
6168 PlaySound(
"Footstep/water");
6179 int num = p.x - pos.
x;
6180 int num2 = p.z - pos.
z;
6197 if (num == 0 && num2 == 0)
6211 for (
int i = -1; i < 2; i++)
6213 for (
int j = -1; j < 2; j++)
6217 point.x = pos.x + j;
6218 point.z = pos.z + i;
6232 return _Move(newPoint);
6235 public void Kick(
Point p,
bool ignoreSelf =
false,
bool checkWall =
true)
6239 Kick(
item, ignoreSelf, karmaLoss:
true, show:
true, checkWall);
6243 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true,
bool checkWall =
true)
6245 if (!IsAliveInCurrentZone)
6271 Say(
"kick",
this, t);
6305 if (elements.
Value(ele) <= 0)
6307 if (includeNagative)
6309 return elements.
Value(ele) < 0;
6318 return elements.
Value(ele) >= req;
6333 if (HasElement(764))
6337 if (HasElement(759))
6341 if (HasElement(703))
6345 if (HasElement(758))
6349 if (HasElement(704))
6367 for (
int i = 0; i < a; i++)
6378 shared.color = 11010048f;
6379 shared.liquidLv = 0;
6381 SetRenderParam(shared);
6401 isDyed = mat !=
null;
6402 c_dyeMat = mat?.id ?? 0;
6418 else if (isElemental)
6455 int num = EClass.game.seed + refVal;
6456 num +=
id[0] % 10000;
6459 num +=
id[1] % 1000;
6462 num +=
id[2] % 1000;
6465 num +=
id[3] % 1000;
6468 num +=
id[4] % 1000;
6477 return ref _randColor;
6502 public void SetImage(Image image,
int dir,
int idSkin = 0)
6504 sourceRenderCard.
SetImage(image, GetSprite(dir), colorInt, setNativeSize:
true, dir, idSkin,
this);
6514 Sprite sprite = GetSprite();
6515 if (!c_idSpriteReplacer.IsEmpty())
6518 if (spriteReplacer !=
null)
6522 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0, renderData, spriteReplacer.
data.
pref ?? Pref);
6526 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0,
this);
6529 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
6531 if ((!isChara ||
Chara.
host ==
null) && !(_emo == lastEmo && skipSame))
6535 renderer.
ShowEmo(_emo, duration);
6543 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6548 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6553 PlaySound(
material.GetSoundImpact(sourceCard), 1f, spatial);
6558 PlaySound(
material.GetSoundDead(sourceCard), 1f, spatial);
6561 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
6563 Card rootCard = GetRootCard();
6570 return rootCard.
pos.
PlaySound(
id, isSynced || !spatial, v, spatial);
6595 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
6601 Card rootCard = GetRootCard();
6605 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
6613 Card rootCard = GetRootCard();
6636 public virtual void Rotate(
bool reverse =
false)
6639 if (sourceCard.
tiles.Length > 4)
6641 num = sourceCard.
tiles.Length;
6703 fx = fx - vector.x + thingPosition.x;
6704 fy = fy - vector.y + thingPosition.y;
6708 float num2 = (fy = 0f);
6732 renderParam.x = v.x;
6733 renderParam.y = v.y;
6734 renderParam.z = v.z;
6736 v.x = renderParam.
x;
6737 v.y = renderParam.
y;
6738 v.z = renderParam.
z;
6752 v.z += thingPosition.z;
6759 if (useCurrentPosition)
6774 renderer.
Draw(renderParam, ref v, drawShadow:
false);
6785 EClass.player.lightRadius = 1;
6793 return GetLightRadius() > 0;
6801 return 0.01f * LightData.color.a * 256f * 1.12f;
6803 if (IsPCFaction && !IsPC)
6869 num2 = traitLightSource.LightRadius;
6874 if (lightRadius > 0)
6876 if (lightRadius > num2)
6896 int radius = GetLightRadius();
6901 float power = GetLightPower();
6922 EClass.player.lightRadius = radius;
6923 EClass.player.lightPower = power;
6929 fov.
Perform(pos.
x, pos.
z, radius, power * 2f);
6940 int num = (trait.UseLightColor ? c_lightColor : 0);
6943 fov.r = (byte)(num / 1024);
6944 fov.g = (byte)(num % 1024 / 32);
6945 fov.b = (byte)(num % 32);
6986 if (fov !=
null && fov.
lastPoints.Count != 0)
7005 things.ForeachReverse(delegate(
Thing t)
7009 if (sourceCard.
_origin ==
"dish")
7017 else if (!isChara && trait.
Decay != 0)
7019 Decay(trait.
Decay * hour);
7037 int num2 = MaxDecay / 4 * 3;
7042 num =
card.trait.DecaySpeedChild;
7044 num = num * trait.DecaySpeed / 100;
7045 int num3 = Evalue(405);
7048 num = num * (100 - num3 * 2) / 100;
7060 if (decay + a > MaxDecay)
7062 if (
card !=
null && !
card.trait.OnChildDecay(
this, !IsDecayed))
7071 card.AddCard(thing);
7072 if (!IsParentLocked())
7074 GetRootCard().Say(
"seed_rot", GetRootCard(),
this, thing.
Name);
7083 else if (GetRootCard() ==
EClass.
pc)
7085 if (!IsParentLocked())
7097 else if (decay < num2 && decay + a >= num2 && GetRootCard() ==
EClass.
pc)
7099 if (!IsParentLocked())
7106 bool IsParentLocked()
7108 if (parent is
Thing)
7110 return (parent as
Thing).c_lockLv > 0;
7118 return !
MOD.
listTalk.
GetTalk(c_idTalk.IsEmpty(
id), idTopic, useDefault:
true).IsEmpty();
7121 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
7125 EClass.player.forceTalk =
false;
7129 EClass.player.forceTalk =
false;
7130 if (!isSynced && !forceSync)
7135 GameLang.refDrama1 = ref1;
7136 GameLang.refDrama2 = ref2;
7137 string text = GetTalkText(idTopic, stripPun:
true);
7139 if ((HasElement(1232) || (condition !=
null && condition.
IsBaby)) && idTopic !=
"baby")
7145 switch ((condition !=
null) ? condition.
chara.
id :
id)
7158 TalkRaw(text, ref1, ref2, forceSync);
7161 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
7163 if ((!isSynced && !forceSync) || text.IsEmpty())
7170 text = text.Replace(
"#1", ref1);
7174 text = text.Replace(
"#2", ref2);
7176 HostRenderer.Say(ApplyNewLine(text));
7177 text = StripTalkSpecialCharacters(text);
7178 bool flag = text.StartsWith(
"*");
7182 text = text.Bracket();
7184 Msg.
Say(text.Replace(
"&",
""));
7193 if (text.Length > 1 &&
int.TryParse(text[1].ToString() ??
"", out var _))
7195 return text.Substring(2);
7201 return text.Substring(1);
7208 if (text.Contains(
"&"))
7210 string text2 =
"_comma".lang();
7211 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
7212 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
7213 text = text.Replace(
"&", Environment.NewLine ??
"");
7218 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
7220 if (isSynced && !text.IsEmpty())
7224 text = text.Replace(
"#1", ref1);
7228 text = text.Replace(
"#2", ref2);
7230 HostRenderer.Say(text);
7236 Say(
"nothingHappens");
7239 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
7248 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
7257 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
7266 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
7270 string text =
MOD.
listTalk.
GetTalk((condition !=
null) ? condition.
chara.
id : c_idTalk.IsEmpty(
id), idTopic, useDefault, flag);
7271 if (!text.IsEmpty())
7273 text = text.Split(
'|').RandomItem();
7274 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
7276 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
7278 text =
"(" + text +
")";
7280 text = text.Replace(
"。)",
")");
7283 return ApplyTone(text, stripPun);
7289 return ApplyTone(
Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
7292 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
7298 string[] array = _tones.IsEmpty(
"").Split(
'|');
7299 string key = array[0];
7304 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
7308 if (array[0].IsEmpty())
7317 if (array.Length >= 2)
7319 stringBuilder.Replace(
"_toneI".lang(), array[1]);
7321 if (array.Length >= 3)
7323 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
7326 text2 = stringBuilder.ToString();
7330 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
7341 return text2.StripLastPun();
7356 List<Dictionary<string, string>> list =
MOD.
tones.
list;
7357 if (list.Count != 0)
7359 int mtp = EClass.core.config.test.extraToneMTP
switch
7372 string text = list.RandomItem()[
"id"];
7373 text = list.RandomItemWeighted((Dictionary<string, string> a) => a[
"chance"].ToInt() * ((!a[
"tag"].Contains(
"meta")) ? 1 : mtp))[
"id"];
7380 return ListCraftBonusTraits().Count > 0;
7385 List<Element> list =
new List<Element>();
7386 string[] tag = sourceCard.
tag;
7387 for (
int i = 0; i < tag.Length; i++)
7389 string[] array = tag[i].Split(
'/');
7390 if (!(array[0] !=
"craft_bonus"))
7406 if (dest.
stack !=
null)
7410 Say(
"stack_thing", t, dest.
stack);
7424 c_idBacker = row.
id;
7430 chara.hostility = hostility2;
7436 Chara.idFaith = row.
deity.ToLowerInvariant();
7441 if (
id ==
"putty_snow")
7454 if (c_idBacker == 164)
7467 c_textureData = GetPaintData();
7477 Sprite sprite = GetSprite();
7478 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
7479 int num = sprite.texture.width * 2;
7480 int num2 = sprite.texture.height * 2;
7481 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
7482 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
7483 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
7484 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
7485 texture2D2.SetPixels(pixels);
7487 byte[] result = texture2D2.EncodeToJPG();
7488 UnityEngine.Object.Destroy(texture2D);
7489 UnityEngine.Object.Destroy(texture2D2);
7495 if ((
bool)_paintSprite)
7497 UnityEngine.Object.Destroy(_paintSprite.texture);
7498 UnityEngine.Object.Destroy(_paintSprite);
7499 _paintSprite =
null;
7507 byte[] data = c_textureData;
7508 Texture2D texture2D =
new Texture2D(1, 1);
7509 texture2D.LoadImage(data);
7510 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
7514 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
7517 return _paintSprite;
7522 if (!(GetRestrainer() ==
null || force))
7526 isRestrained =
false;
7527 Say(
"unrestrained",
this);
7538 if (c_rescueState ==
RescueState.WaitingForRescue)
7552 c.DoHostileAction(
item, immediate:
true);
7579 result = row.value * mat.value / 100;
7616 int num = ((c_fixedValue == 0) ? trait.
GetValue() : c_fixedValue);
7617 if (
id ==
"plat" && !sell)
7628 num2 += (float)c_priceCopy * 0.2f;
7629 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
7633 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
7635 if (IsFood && !
material.tag.Contains(
"food"))
7640 if (IsEquipmentOrRangedOrAmmo || trait is
TraitMod)
7658 if (IsEquipmentOrRanged && rarity >=
Rarity.Legendary)
7660 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
7662 num2 = num2 * (100f + num3 * (float)(
material.value - 100)) / 100f;
7663 if (IsEquipmentOrRanged)
7668 num4 += value.
source.value;
7670 num2 = num2 * (float)(100 + (sell ? ((
int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
7671 if (rarity >=
Rarity.Legendary)
7673 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
7681 if (encLV != 0 && !category.
tag.Contains(
"noEnc"))
7683 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)))));
7687 num2 *= (float)(tier + 1);
7694 if (priceType ==
PriceType.CopyShop && sell)
7700 if (
id ==
"littleball")
7707 if (
id ==
"crimale2")
7715 case "ticket_fortune":
7721 case "scroll_alias":
7723 case "scroll_biography":
7738 if (!(text ==
"mathammer"))
7740 if (!(text ==
"water_jure"))
7746 return 50 + material.tier * material.tier * 10;
7759 case "hammer_strip":
7789 case "diary_sister":
7793 case "diary_catsister":
7795 case "container_magic":
7797 case "wrench_tent_elec":
7799 case "wrench_tent_soil":
7801 case "wrench_tent_seabed":
7805 case "wrench_storage":
7807 case "wrench_fridge":
7809 case "wrench_extend_v":
7811 case "wrench_extend_h":
7817 case "hammer_garokk":
7819 case "scroll_random":
7833 if (!sell &&
id ==
"casino_coin")
7837 int value = GetValue(priceType, sell);
7847 Trait trait = this.trait;
7852 p *= 1f + 4f * (float)(things.
width - traitContainer.Width) + 4f * (float)(things.
height - traitContainer.Height);
7857 p *= 1f + 0.5f * (float)c_containerSize;
7860 if (c_priceFix != 0)
7862 p = (int)((
float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
7872 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
7883 if (!sell && category.
id ==
"spellbook")
7887 bool flag = priceType ==
PriceType.CopyShop;
7888 int num = ((!flag) ? 1 : 5);
7889 float num2 = Mathf.Min(0.01f * (
float)Evalue(752), 1f);
7890 float num3 = Mathf.Min(0.01f * (
float)Evalue(751), 1f);
7891 float num4 = Mathf.Min(0.02f * (
float)Evalue(759), 2f);
7896 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7898 p *= 0.20000000298023224;
7901 p *= 0.20000000298023224;
7904 p *= 0.20000000298023224;
7908 p *= 0.20000000298023224;
7914 if ((uint)(priceType - 1) <= 1u)
7926 if (
id ==
"rod_wish")
7928 p *= (sell ? 0.01f : 50f);
7943 p *= 0.20000000298023224;
7947 p *= 0.10000000149011612;
7950 p *= 0.0020000000949949026;
7953 p *= 0.00019999999494757503;
7956 p *= 0.004999999888241291;
7967 p *= (flag ? 1.25f : 0.3f);
7971 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)c_charges, 0f, 1.5f));
7975 p *= (flag ? 0.9f : 0.5f);
7987 p *= 1f + 0.2f * (float)c.Evalue(1406);
8000 p *= 1.100000023841858;
8034 else if (category.
IsChildOf(
"furniture"))
8054 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
8061 p = ((!sell) ? 1 : 0);
8069 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
8071 else if (p > 10000.0)
8073 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
8075 else if (p > 1000.0)
8077 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
8081 p = Mathf.CeilToInt((
float)p / 100f) * 100;
8085 p = Mathf.CeilToInt((
float)p / 10f) * 10;
8093 if (p > (
double)(sell ? 500000000 : 1000000000))
8106 return Name + GetExtraName();
8123 ForeachPoint(delegate(
Point p,
bool main)
8125 int num2 = DistMulti(p, c);
8133 return DistMulti(pos, c);
8165 isCensored = enable;
8175 if (isDeconstructing != deconstruct)
8185 isDeconstructing = deconstruct;
8199 sortVal = ((c_equippedSlot == 0) ? (category.
sortVal * 1000) : 0);
8202 sortVal = -GetPrice(
currency) * 1000;
8205 sortVal = -Num * 1000;
8208 sortVal = category.sortVal * 1000;
8211 sortVal = -ChildrenAndSelfWeight * 1000;
8214 sortVal = -ChildrenAndSelfWeightSingle * 1000;
8217 sortVal = -GetPrice(
currency) * 1000;
8220 sortVal = sourceCard._index * 1000;
8230 num =
id.CompareTo(c.
id);
8250 num = encLV - c.
encLV;
8269 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
8287 action(pos, arg2:
true);
8301 SE.Play(
"pop_paper");
8331 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
8344 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)
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 HealHPHost(int a, HealSource origin=HealSource.None)
virtual void SetDir(int d)
virtual void HealHP(int a, HealSource origin=HealSource.None)
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 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)
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)
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)