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")]
258 return 0.001f * (float)
_ints[15];
262 _ints[15] = (int)(value * 1000f);
270 return 0.001f * (float)
_ints[16];
274 _ints[16] = (int)(value * 1000f);
286 _ints[17] = (int)value;
298 _ints[18] = (int)value;
322 _ints[19] = (int)value * 100;
1020 SetInt(103, value ? 1 : 0);
1032 SetInt(109, value ? 1 : 0);
1044 SetInt(63, value ? 1 : 0);
1056 SetInt(64, value ? 1 : 0);
1068 SetInt(120, value ? 1 : 0);
1080 SetInt(121, value ? 1 : 0);
1092 SetInt(122, value ? 1 : 0);
1777 return GetObj<UniqueData>(6);
1789 return GetObj<Thing>(9);
1801 return GetObj<List<SocketData>>(17);
1813 return GetObj<Thing>(10);
1837 return GetObj<CharaUpgrade>(11);
1849 return GetObj<CharaGenes>(15);
1861 return GetObj<List<int>>(16);
1885 return GetObj<DNA>(14);
1897 return GetObj<CharaList>(13);
1909 return GetObj<MixedFoodData>(18);
1921 return GetObj<Thing>(19);
1933 return GetObj<byte[]>(4);
2032 if (_childrenWeight < 0 || _childrenWeight > 10000000)
2120 if (
Tiles.Length == 1)
2122 return dir % 2 == 1;
2186 return id ==
"grass";
2318 if (
Tiles.Length < 3)
2392 return bio.gender == 2;
2544 if (
card.isSale || !
card.trait.CanUseContent)
2549 if (windowSaveData !=
null)
2561 EClass.player.wasDirtyWeight =
true;
2579 public int Evalue(
int ele,
bool ignoreGlobalElement)
2605 return c_editorTags?.Contains(tag.ToString()) ??
false;
2638 int num2 =
item.Value;
2698 for (
int i = 0; i <
sockets.Count; i++)
2716 thing.parent =
this;
2766 CardBlueprint.current =
null;
2817 if (
id ==
"microchip")
2898 EClass._zone.Boss =
Chara;
2940 int num = elementContainer.Value(value.
id);
2970 public void AddExp(
int a,
bool applyMod =
true)
2995 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
2999 return num * (100 +
Evalue(1237) * 30 +
Evalue(1273) * 50) / 100;
3030 Say(
"dingExp",
this);
3041 int num = Mathf.Min(1 +
LV / 5, 20);
3042 for (
int i = 0; i < num; i++)
3044 if (
Evalue(1644) < i + 1)
3082 if (rootCard !=
null && rootCard.
IsPC)
3137 Debug.LogWarning(
"already child:" + t);
3142 Debug.Log(
"already in the list" + t);
3157 t.ignoreAutoPick =
false;
3201 if (rootCard !=
null && rootCard.
IsPC)
3210 t.isNPCProperty =
false;
3224 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3227 void TryAdd(
Thing a)
3229 if (!ings.Contains(a.
id))
3247 List<Chara> list =
new List<Chara>();
3263 if (!
item.IsPCFactionOrMinion)
3268 if (list2.Count == 0)
3272 foreach (
Thing item2
in list2)
3277 item.body.Unequip(item2);
3279 item2.c_idDeity = artifactDeity?.
id ??
null;
3280 Msg.
Say(
"waterCurse", item2);
3284 foreach (
Chara item3
in list)
3291 if (list3.Count == 0)
3295 foreach (
Thing item4
in list3)
3297 Msg.
Say(
"destroyed_inv_", item4, item3);
3309 List<Chara> list =
new List<Chara>();
3323 if (
item.IsPCFactionOrMinion)
3337 for (
int num =
things.Count - 1; num >= 0; num--)
3348 rootCard.Chara.held =
null;
3354 instance.selectedButton.card =
null;
3357 ActionMode.AdvOrRegion.updatePlans =
true;
3374 if (thing.
invY == 1)
3376 WidgetCurrentTool.dirty =
true;
3380 if (thing.
props !=
null)
3388 WidgetHotbar.dirtyCurrentItem =
true;
3389 thing.parent =
null;
3394 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3401 thing.parent =
null;
3410 return EClass.ui.layers.Count > 0;
3432 to.c_isImportant =
true;
3457 return card.GetRootCard();
3484 thing.encLV =
encLV;
3485 thing.decay =
decay;
3488 foreach (KeyValuePair<int, int>
item in mapInt)
3492 foreach (KeyValuePair<int, string> item2
in mapStr)
3494 thing.
mapStr[item2.Key] = item2.Value;
3500 thing.sockets = IO.DeepCopy(
sockets);
3516 ModNum(-a, notify:
false);
3528 return this as
Thing;
3531 return this as
Thing;
3537 return this as
Thing;
3540 public void ModNum(
int a,
bool notify =
true)
3579 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3585 for (
int i = 0; i <
sockets.Count; i++)
3603 for (
int i = 0; i <
sockets.Count; i++)
3609 int ele = num / 1000;
3610 int num2 = num % 1000;
3705 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3711 string encSlot = source.
encSlot;
3712 if (encSlot ==
null || encSlot.Length != 0)
3725 string[] array = source.
encSlot.Split(
',');
3726 foreach (
string key
in array)
3774 if (this.placeState == newState)
3780 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3792 float num2 = (
fy = 0f);
3803 this.placeState = newState;
3811 this.placeState = newState;
3866 num = num * (100 +
Quality) / 100;
3903 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
3950 public bool TryPay(
int a,
string id =
"money")
3957 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
3961 if (
IsPC && !(
id ==
"ration"))
3981 Say(
"spellbookCrumble",
this);
3990 if (
id ==
"influence")
4002 if (
id ==
"influence")
4033 num = (long)a * (
long)Mathf.Max(100 -
Evalue(93), 1) / 100;
4035 if (num > 100000000)
4067 int num =
PV + orCreateElement.Value +
DEX / 10;
4074 num2 = num3 / 10 + 1;
4075 sides = num3 / num2 + 1;
4077 dmg = dmg * 100 / Mathf.Max(100 + num, 1);
4079 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
4080 dmg -= num4 * mod / 100;
4090 DamageHP(dmg, 0, 0, attackSource, origin);
4099 bool flag = originalTarget !=
null;
4100 Action onEvade =
null;
4109 Say(
"wall_bond", chara3,
this);
4118 if ((uint)(attackSource2 - 3) > 2u && (uint)(attackSource2 - 13) > 5u)
4124 int num = chara4.
Evalue(1241);
4125 int num2 = chara4.
Evalue(438);
4128 Say((num2 == 0) ?
"wall_flesh" :
"wall_knightly", chara4,
this);
4137 if (origin !=
null && origin.HasElement(1208))
4139 switch (attackSource)
4142 dmg = dmg * 130 / 100;
4143 eleP = eleP * 150 / 100;
4146 dmg = dmg * 120 / 100;
4147 eleP = eleP * 150 / 100;
4153 dmg = dmg * (100 + origin.Evalue(94)) / 100;
4156 if (ele == 0 || ele == 926)
4161 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
4167 if (attackSource !=
AttackSource.Condition && showEffect)
4177 int num3 = ((origin !=
null) ? origin.Evalue(1238) : 0);
4181 if (origin.HasElement(1247))
4186 if (attackSource ==
AttackSource.MagicArrow && origin !=
null && origin.HasElement(1244))
4190 if (attackSource ==
AttackSource.MagicHand && origin !=
null && origin.HasElement(1246))
4195 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
4196 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
4203 if (chara2 !=
null && chara2.
isWet)
4212 if (chara !=
null && chara.
isWet)
4214 dmg = dmg * 150 / 100;
4220 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
4228 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
4230 if (origin !=
null && origin.HasCondition<
ConBerserk>())
4239 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num4 - 50))) / 100;
4244 dmg = dmg * 100 / (100 +
Evalue(435) * 2);
4246 dmg = dmg * Mathf.Max(0, 100 - Mathf.Min(
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56), 100) / ((!flag) ? 1 : 2)) / 100;
4253 dmg = dmg * 90 / 100;
4257 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
4261 dmg = dmg * 90 / 100;
4280 dmg = dmg * 100 / Mathf.Min(100 + num5 * 5, 120);
4284 dmg = dmg * Mathf.Min(100 + num6 * 5, 120) / 100;
4289 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
4291 if (
HasElement(1218) && attackSource != AttackSource.ManaBackfire && (
hp > 0 ||
Evalue(1421) <= 0))
4293 dmg = dmg * (1000 - Mathf.Min(
Evalue(1218), 1000) / ((!flag) ? 1 : 2)) / 1000;
4301 int num7 =
MaxHP / 10;
4302 long num8 = dmg - num7;
4303 num8 = num8 * 100 / (200 +
Evalue(68) * 10);
4319 float num9 = Mathf.Clamp(dmg * 6 /
MaxHP, 0f, 4f) + (float)((dmg > 0) ? 1 : 0);
4330 if (hp < 0 && Chara.mana.value >= 0)
4346 Chara.mana.value -= (int)dmg;
4363 float ratio = (float)dmg / (
float)
MaxHP;
4374 if (
EClass.
pc.
ai is
AI_PracticeDummy { IsRunning: not
false } aI_PracticeDummy && aI_PracticeDummy.target ==
this && (origin ==
null || origin.IsPC))
4376 aI_PracticeDummy.hit++;
4377 aI_PracticeDummy.totalDamage += dmg;
4420 if (origin !=
null && origin !=
this &&
Evalue(436) > 0 && !HasCondition<ConFractured>())
4429 hp = Mathf.Min(half * (
int)Mathf.Sqrt(
Evalue(436) * 2) / 100,
MaxHP / 3);
4450 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
4452 EClass.player.invlunerable =
true;
4491 if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null && (origin.isSynced ||
IsPC))
4498 text =
"dead_" + e.
source.alias;
4502 text =
"dead_attack";
4510 text =
"kill_" + e.source.alias;
4514 text =
"kill_attack";
4516 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4524 Say(
"reboot",
this);
4531 if (HasCondition<ConRebirth>())
4533 Say(
"rebirth",
this);
4545 Msg.alwaysVisible =
true;
4546 Msg.
Say(
"layhand", chara5,
this);
4547 Msg.
Say(
"pray_heal",
this);
4557 if (zoneInstanceBout !=
null)
4589 Die(e, origin, attackSource, originalTarget);
4595 string text2 =
new int[18]
4597 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4598 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4599 }.RandomItem().ToString();
4602 text2 =
"casino_coin";
4606 text2 =
"scratchcard";
4634 if (origin !=
null && origin.isChara)
4656 if (origin.GetInt(106) == 0)
4658 origin.Chara.TalkTopic(
"kill");
4663 else if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null)
4665 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num9 + (
IsPC ?
"pc" :
""), origin,
this);
4669 int num13 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4670 if (num9 >= (
float)num13)
4674 Say(
"dmg_" + e.source.alias,
this);
4678 Say(
"dmg" + num9,
this);
4701 if (origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4705 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4709 int num14 = origin.Dist(
this);
4713 if (
id ==
"hedgehog_ether")
4717 Say(
"reflect_thorne",
this, origin);
4718 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele2,
Power,
AttackSource.Condition,
this);
4723 Say(
"reflect_acid",
this, origin);
4724 origin.DamageHP((
int)Mathf.Clamp(dmg / 10, 1f,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele3,
Power * 2,
AttackSource.Condition,
this);
4736 int a2 = (int)(100 * (dmg * 100 /
MaxHP) / 100) + 1;
4747 int num15 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4757 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4763 Condition.ignoreEffect =
true;
4765 Condition.ignoreEffect =
false;
4769 float num16 = (float)
hp / (
float)
MaxHP;
4776 PlaySound(
"heartbeat", 1f - num16 * 2f);
4809 EClass.player.forceTalk =
true;
4811 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
4822 void EvadeDeath(Action action)
4827 Chara.mana.value = 0;
4841 if (origin !=
null && origin.isChara &&
isChara && (
weapon ==
null || !
weapon.HasElement(486)))
4843 int valueOrDefault = (origin.Evalue(662) +
weapon?.Evalue(662, ignoreGlobalElement:
true)).GetValueOrDefault();
4844 int valueOrDefault2 = (origin.Evalue(661) +
weapon?.Evalue(661, ignoreGlobalElement:
true)).GetValueOrDefault();
4847 int num17 =
EClass.
rnd(3 + (
int)Mathf.Clamp(dmg / 100, 0f, valueOrDefault / 10));
4848 origin.Chara.stamina.Mod(num17);
4854 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
4856 int num18 =
EClass.
rndHalf(2 + (
int)Mathf.Clamp(dmg / 10, 0f, origin.Chara.GetPietyValue() + 10));
4857 origin.Chara.mana.Mod(num18);
4863 if (valueOrDefault2 > 0 && attackSource ==
AttackSource.Melee)
4865 int num19 =
EClass.
rnd(2 + (
int)Mathf.Clamp(dmg / 10, 0f, valueOrDefault2 + 10));
4866 origin.Chara.mana.Mod(num19);
4883 bool hostile =
false;
4887 if (Chance(30 + eleP / 5, 100))
4889 MarkHostile().AddCondition<
ConBurning>(eleP);
4895 if (Chance(30 + eleP / 10, 100))
4900 else if (Chance(50 + eleP / 10, 100))
4906 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
4912 if (Chance(30 + eleP / 5, 100))
4914 MarkHostile().AddCondition<
ConPoison>(eleP);
4918 if (Chance(30 + eleP / 5, 100))
4925 if (Chance(30 + eleP / 5, 100))
4934 if (Chance(30 + eleP / 5, 100))
4939 else if (Chance(30 + eleP / 5, 100))
4945 if (Chance(50 + eleP / 10, 100))
4953 if (Chance(30 + eleP / 5, 100))
4972 if (Chance(5 + eleP / 25, 40))
4976 if (Chance(5 + eleP / 25, 40))
4980 if (Chance(5 + eleP / 25, 40))
4984 if (Chance(5 + eleP / 25, 40))
4986 MarkHostile().AddCondition<
ConPoison>(eleP / 2);
4988 if (Chance(5 + eleP / 25, 40))
4992 if (Chance(5 + eleP / 25, 40))
4996 if (Chance(30 + eleP / 10, 100))
5002 if (Chance(50 + eleP / 10, 100))
5004 MarkHostile().AddCondition<
ConBleed>(eleP);
5008 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
5021 if (checkHostileAct && hostile && origin !=
null && origin.
isChara)
5025 static bool Chance(
int a,
int max)
5027 return Mathf.Min(a, max) >
EClass.
rnd(100);
5038 Card rootCard = GetRootCard();
5040 if (_pos !=
null && !_pos.
IsValid)
5051 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
5052 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
5054 text += e.source.alias;
5058 Msg.
Say(text,
this, rootCard);
5063 Msg.
Say(
"destroyed",
this);
5068 things.ForeachReverse(delegate(
Thing t)
5077 if (e !=
null && _pos !=
null && e.id == 21)
5083 Explode(pos, origin);
5091 origin = origin?.Chara,
5093 aliasEle =
"eleImpact"
5099 PlaySound(
material.GetSoundDead(sourceCard));
5107 Debug.Log(Name +
" is already destroyed.");
5118 Chara.isDead =
true;
5136 for (
int num = things.Count - 1; num >= 0; num--)
5138 things[num].Destroy();
5145 if (!isChara || IsPCFactionMinion || (isCopy &&
EClass.
rnd(10) != 0))
5151 List<Card> list =
new List<Card>();
5152 if (!IsPCFaction && !isUserZone && sourceCard.
idActor.IsEmpty())
5155 if (this.rarity >=
Rarity.Legendary)
5188 else if (origin !=
null && origin.
HasElement(290) && !IsMinion)
5200 if (
id ==
"littleOne" && IsPCFactionOrMinion)
5208 if (flag2 && !isUserZone)
5211 bool num2 = text ==
"_meat";
5223 text =
"meat_marble";
5226 if (thing3.
source._origin ==
"meat")
5240 if (!IsPCFaction && !isUserZone)
5242 foreach (
string item2
in sourceCard.
loot.Concat(
Chara.
race.loot).ToList())
5244 string[] array = item2.
Split(
'/');
5245 int num4 = array[1].ToInt();
5294 if (!isBackerContent && !flag)
5330 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.rarity >=
Rarity.Legendary) ? 1 : 0));
5340 if (text2 ==
"big_daddy" || text2 ==
"santa")
5348 List<Thing> list2 =
new List<Thing>();
5349 foreach (
Thing thing4
in things)
5375 if (num5 > 0 && list2.Count > 0)
5378 for (
int j = 0; j < list2.Count && j < num5; j++)
5384 if (this.rarity >=
Rarity.Legendary && !IsUnique && c_bossType !=
BossType.Evolved)
5387 foreach (
Card item3
in list)
5396 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
5401 for (
int k = 0; k < num5; k++)
5424 foreach (
Thing thing5
in things)
5426 if (thing5.
GetInt(116) != 0)
5431 Point nearestPoint = GetRootCard().pos;
5436 foreach (
Card item4
in list)
5442 item4.isHidden =
false;
5443 item4.isNPCProperty =
false;
5500 case "egg_fertilized":
5505 string text =
"c_wilds";
5506 if (
id ==
"_meat" ||
id ==
"meat_marble")
5514 for (
int i = 0; i < 20; i++)
5517 if (cardRow.
model.
Chara.
race.corpse[0] !=
"_meat" &&
id !=
"milk" &&
id !=
"_egg" &&
id !=
"egg_fertilized")
5527 if (crafter !=
null && crafter.id ==
"big_sister")
5529 cardRow = crafter.source;
5534 if (c_idRefCard.IsEmpty())
5536 MakeRefFrom(cardRow.
model);
5541 MakeFoodFrom(cardRow.
model);
5543 return this as
Thing;
5549 return this as
Thing;
5566 int num = race.
food[0].ToInt();
5567 bool flag =
id ==
"meat_marble";
5569 bool flag2 = category.
IsChildOf(
"meat");
5581 elements.
SetBase(70, race.
STR * race.
STR / 5 * num / 100 - 10 + num / 10);
5584 elements.
SetBase(440, race.
END * race.
END / 5 * num / 100 - 10 + num / 10);
5586 elements.
SetBase(71, (
int)Mathf.Clamp((
float)(num / 10) + Mathf.Sqrt(race.
height) - 10f, 1f, 60f));
5590 elements.
SetBase(444, race.
LER * race.
LER / 5 * num / 100 - 10 + num / 10);
5608 foreach (
Element value
in c.elements.dict.Values)
5610 if ((!flag3 || value.
id != 1229) && (value.
source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
5615 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
5616 foreach (KeyValuePair<int, int>
item in race.elementMap)
5620 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
5623 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5624 for (
int i = 0; i < num2 && i < list.Count; i++)
5626 Tuple<int, int> tuple = list[i];
5627 elements.
SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5629 if (c.Chara.IsUndead)
5631 elements.
ModBase(73, (c.Chara.race.id ==
"undeadgod") ? (-90) : (-20));
5633 isWeightChanged =
true;
5634 c_weight = race.height * 4 + 100;
5635 c_idMainElement = c.c_idMainElement;
5637 int num3 = c.LV - c.sourceCard.LV;
5643 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
5647 if (flag2 && c.IsPCFaction && c.IsUnique)
5662 if (IsIgnoreName(
card))
5666 if (IsIgnoreName(card2))
5670 if (
card ==
null && card2 !=
null)
5677 MakeRefFrom(
card, card2);
5678 if (
card.c_idRefCard !=
null)
5680 c_idRefCard =
card.c_idRefCard;
5681 c_altName = TryGetFoodName(
card);
5686 c_altName2 = TryGetFoodName(card2);
5689 static bool IsIgnoreName(
Card c)
5719 if (!row.aka.IsEmpty())
5721 if (row.name ==
"*r" && row.aka ==
"*r")
5723 return "corpseGeneral".lang();
5725 if (row.name ==
"*r")
5727 return row.GetText(
"aka");
5730 return row.GetName();
5735 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
5751 c_idRefCard = c1.
id;
5755 c_idRefCard2 = c2.id;
5756 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName(
NameStyle.Ref, (!c2.isChara) ? 1 : 0));
5758 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.
c_extraNameRef);
5772 thing.c_idMainElement = c_idMainElement;
5781 return GiveBirth(thing, effect);
5799 int num2 = LV - sourceCard.
LV;
5804 if (num2 >= 10 && !HasElement(1290))
5812 return GiveBirth(thing, effect);
5818 EClass.player.forceTalk =
true;
5819 card.Talk(
"giveBirth");
5823 card.pos.PlayEffect(
"revive");
5824 card.pos.PlaySound(
"egg");
5836 string[] array =
new string[6] {
"spider_queen",
"spider_vampire",
"spider_paralyzer",
"spider_black",
"spider_tarantula",
"spider_spotted" };
5840 AddBlood(12, (uid % 2 == 0) ? (-1) : 3);
5842 PlaySound(
"egghatch");
5851 for (
int i = 0; i < 1 +
EClass.
rnd(num + 1); i++)
5904 SayNothingHappans();
5907 PlayEffect(
"teleport");
5910 Say(
"antiTeleport",
this);
5911 PlaySound(
"gravity");
5916 PlaySound(
"teleport");
5917 Say(
"teleported",
this);
5926 if (chara.
enemy ==
this)
5937 EClass.player.haltMove =
true;
5939 PlayEffect(
"teleport", useRenderPos:
false);
5946 PlayEffect(
"ripple");
5947 PlaySound(
"Footstep/water");
5963 if (elements.
Value(ele) <= 0)
5965 if (includeNagative)
5967 return elements.
Value(ele) < 0;
5976 return elements.
Value(ele) >= req;
5991 if (HasElement(764))
5995 if (HasElement(759))
5999 if (HasElement(703))
6003 if (HasElement(758))
6007 if (HasElement(704))
6025 for (
int i = 0; i < a; i++)
6036 shared.color = 11010048f;
6037 shared.liquidLv = 0;
6039 SetRenderParam(shared);
6059 isDyed = mat !=
null;
6060 c_dyeMat = mat?.id ?? 0;
6072 else if (isElemental)
6108 int num = EClass.game.seed + refVal;
6109 num +=
id[0] % 10000;
6112 num +=
id[1] % 1000;
6115 num +=
id[2] % 1000;
6118 num +=
id[3] % 1000;
6121 num +=
id[4] % 1000;
6130 return ref _randColor;
6155 public void SetImage(Image image,
int dir,
int idSkin = 0)
6157 sourceRenderCard.
SetImage(image, GetSprite(dir), colorInt, setNativeSize:
true, dir, idSkin,
this);
6167 Sprite sprite = GetSprite();
6168 if (!c_idSpriteReplacer.IsEmpty())
6171 if (spriteReplacer !=
null)
6175 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0, renderData, spriteReplacer.
data.
pref ?? Pref);
6179 sourceRenderCard.
SetImage(image, sprite, colorInt, setNativeSize:
true, 0, 0,
this);
6182 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
6184 if ((!isChara ||
Chara.
host ==
null) && !(_emo == lastEmo && skipSame))
6188 renderer.
ShowEmo(_emo, duration);
6196 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6201 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
6206 PlaySound(
material.GetSoundImpact(sourceCard), 1f, spatial);
6211 PlaySound(
material.GetSoundDead(sourceCard), 1f, spatial);
6214 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
6216 Card rootCard = GetRootCard();
6223 return rootCard.
pos.
PlaySound(
id, isSynced || !spatial, v, spatial);
6248 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
6254 Card rootCard = GetRootCard();
6258 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
6266 Card rootCard = GetRootCard();
6289 public virtual void Rotate(
bool reverse =
false)
6292 if (sourceCard.
tiles.Length > 4)
6294 num = sourceCard.
tiles.Length;
6356 fx = fx - vector.x + thingPosition.x;
6357 fy = fy - vector.y + thingPosition.y;
6361 float num2 = (fy = 0f);
6385 renderParam.x = v.x;
6386 renderParam.y = v.y;
6387 renderParam.z = v.z;
6389 v.x = renderParam.
x;
6390 v.y = renderParam.
y;
6391 v.z = renderParam.
z;
6405 v.z += thingPosition.z;
6412 if (useCurrentPosition)
6427 renderer.
Draw(renderParam, ref v, drawShadow:
false);
6438 EClass.player.lightRadius = 1;
6446 return GetLightRadius() > 0;
6454 return 0.01f * LightData.color.a * 256f * 1.12f;
6456 if (IsPCFaction && !IsPC)
6522 num2 = traitLightSource.LightRadius;
6527 if (lightRadius > 0)
6529 if (lightRadius > num2)
6549 int radius = GetLightRadius();
6554 float power = GetLightPower();
6574 radius += EvalueMax(490);
6575 EClass.player.lightRadius = radius;
6576 EClass.player.lightPower = power;
6582 fov.
Perform(pos.
x, pos.
z, radius, power * 2f);
6593 int num = (trait.UseLightColor ? c_lightColor : 0);
6596 fov.r = (byte)(num / 1024);
6597 fov.g = (byte)(num % 1024 / 32);
6598 fov.b = (byte)(num % 32);
6639 if (fov !=
null && fov.
lastPoints.Count != 0)
6658 things.ForeachReverse(delegate(
Thing t)
6662 if (sourceCard.
_origin ==
"dish")
6670 else if (!isChara && trait.
Decay != 0)
6672 Decay(trait.
Decay * hour);
6690 int num2 = MaxDecay / 4 * 3;
6695 num =
card.trait.DecaySpeedChild;
6697 num = num * trait.DecaySpeed / 100;
6698 int num3 = Evalue(405);
6701 num = num * (100 - num3 * 2) / 100;
6713 if (decay + a > MaxDecay)
6715 if (
card !=
null && !
card.trait.OnChildDecay(
this, !IsDecayed))
6724 card.AddCard(thing);
6725 if (!IsParentLocked())
6727 GetRootCard().Say(
"seed_rot", GetRootCard(),
this, thing.
Name);
6736 else if (GetRootCard() ==
EClass.
pc)
6738 if (!IsParentLocked())
6750 else if (decay < num2 && decay + a >= num2 && GetRootCard() ==
EClass.
pc)
6752 if (!IsParentLocked())
6759 bool IsParentLocked()
6761 if (parent is
Thing)
6763 return (parent as
Thing).c_lockLv > 0;
6771 return !
MOD.
listTalk.
GetTalk(c_idTalk.IsEmpty(
id), idTopic, useDefault:
true).IsEmpty();
6774 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6778 EClass.player.forceTalk =
false;
6782 EClass.player.forceTalk =
false;
6783 if (!isSynced && !forceSync)
6788 GameLang.refDrama1 = ref1;
6789 GameLang.refDrama2 = ref2;
6790 string text = GetTalkText(idTopic, stripPun:
true);
6791 if (HasElement(1232) && idTopic !=
"baby")
6798 if (!(text2 ==
"adv_gaki"))
6800 if (text2 ==
"corgon")
6810 TalkRaw(text, ref1, ref2, forceSync);
6813 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6815 if ((!isSynced && !forceSync) || text.IsEmpty())
6822 text = text.Replace(
"#1", ref1);
6826 text = text.Replace(
"#2", ref2);
6828 HostRenderer.Say(ApplyNewLine(text));
6829 text = StripTalkSpeiclaCharacters(text);
6830 bool flag = text.StartsWith(
"*");
6834 text = text.Bracket();
6836 Msg.
Say(text.Replace(
"&",
""));
6845 if (text.Length > 1 &&
int.TryParse(text[1].ToString() ??
"", out var _))
6847 return text.Substring(2);
6853 return text.Substring(1);
6860 if (text.Contains(
"&"))
6862 string text2 =
"_comma".lang();
6863 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
6864 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
6865 text = text.Replace(
"&", Environment.NewLine ??
"");
6870 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
6872 if (isSynced && !text.IsEmpty())
6876 text = text.Replace(
"#1", ref1);
6880 text = text.Replace(
"#2", ref2);
6882 HostRenderer.Say(text);
6888 Say(
"nothingHappens");
6891 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
6900 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
6909 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
6918 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
6922 if (!text.IsEmpty())
6924 text = text.Split(
'|').RandomItem();
6925 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
6927 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
6929 text =
"(" + text +
")";
6931 text = text.Replace(
"。)",
")");
6934 return ApplyTone(text, stripPun);
6940 return ApplyTone(
Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
6943 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
6949 string[] array = _tones.IsEmpty(
"").Split(
'|');
6950 string key = array[0];
6955 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6959 if (array[0].IsEmpty())
6968 if (array.Length >= 2)
6970 stringBuilder.Replace(
"_toneI".lang(), array[1]);
6972 if (array.Length >= 3)
6974 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
6977 text2 = stringBuilder.ToString();
6981 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6992 return text2.StripLastPun();
7007 List<Dictionary<string, string>> list =
MOD.
tones.
list;
7008 if (list.Count != 0)
7010 int mtp = EClass.core.config.test.extraToneMTP
switch
7023 string text = list.RandomItem()[
"id"];
7024 text = list.RandomItemWeighted((Dictionary<string, string> a) => a[
"chance"].ToInt() * ((!a[
"tag"].Contains(
"meta")) ? 1 : mtp))[
"id"];
7031 return ListCraftBonusTraits().Count > 0;
7036 List<Element> list =
new List<Element>();
7037 string[] tag = sourceCard.
tag;
7038 for (
int i = 0; i < tag.Length; i++)
7040 string[] array = tag[i].Split(
'/');
7041 if (!(array[0] !=
"craft_bonus"))
7057 if (dest.
stack !=
null)
7061 Say(
"stack_thing", t, dest.
stack);
7069 ChangeRarity(
Rarity.Normal);
7075 c_idBacker = row.
id;
7081 chara.hostility = hostility2;
7087 Chara.idFaith = row.
deity.ToLowerInvariant();
7092 if (
id ==
"putty_snow")
7105 if (c_idBacker == 164)
7118 c_textureData = GetPaintData();
7128 Sprite sprite = GetSprite();
7129 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
7130 int num = sprite.texture.width * 2;
7131 int num2 = sprite.texture.height * 2;
7132 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
7133 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
7134 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
7135 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
7136 texture2D2.SetPixels(pixels);
7138 byte[] result = texture2D2.EncodeToJPG();
7139 UnityEngine.Object.Destroy(texture2D);
7140 UnityEngine.Object.Destroy(texture2D2);
7146 if ((
bool)_paintSprite)
7148 UnityEngine.Object.Destroy(_paintSprite.texture);
7149 UnityEngine.Object.Destroy(_paintSprite);
7150 _paintSprite =
null;
7158 byte[] data = c_textureData;
7159 Texture2D texture2D =
new Texture2D(1, 1);
7160 texture2D.LoadImage(data);
7161 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
7165 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
7168 return _paintSprite;
7173 if (!(GetRestrainer() ==
null || force))
7177 isRestrained =
false;
7178 Say(
"unrestrained",
this);
7189 if (c_rescueState ==
RescueState.WaitingForRescue)
7203 c.DoHostileAction(
item, immediate:
true);
7230 result = row.value * mat.value / 100;
7267 int num = ((c_fixedValue == 0) ? trait.
GetValue() : c_fixedValue);
7268 if (
id ==
"plat" && !sell)
7279 num2 += (float)c_priceCopy * 0.2f;
7280 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
7284 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
7286 if (IsFood && !
material.tag.Contains(
"food"))
7291 if (IsEquipmentOrRangedOrAmmo || trait is
TraitMod)
7309 if (IsEquipmentOrRanged && rarity >=
Rarity.Legendary)
7311 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
7313 num2 = num2 * (100f + num3 * (float)(
material.value - 100)) / 100f;
7314 if (IsEquipmentOrRanged)
7319 num4 += value.
source.value;
7321 num2 = num2 * (float)(100 + (sell ? ((
int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
7322 if (rarity >=
Rarity.Legendary)
7324 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
7332 if (encLV != 0 && !category.
tag.Contains(
"noEnc"))
7334 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)))));
7338 num2 *= (float)(tier + 1);
7345 if (priceType ==
PriceType.CopyShop && sell)
7351 if (
id ==
"littleball")
7358 if (
id ==
"crimale2")
7366 case "ticket_fortune":
7385 case "hammer_strip":
7415 case "diary_sister":
7419 case "diary_catsister":
7421 case "container_magic":
7423 case "wrench_tent_elec":
7425 case "wrench_tent_soil":
7427 case "wrench_tent_seabed":
7431 case "wrench_storage":
7433 case "wrench_fridge":
7435 case "wrench_extend_v":
7437 case "wrench_extend_h":
7443 case "scroll_random":
7457 if (!sell &&
id ==
"casino_coin")
7461 int value = GetValue(priceType, sell);
7471 Trait trait = this.trait;
7476 p *= 1f + 4f * (float)(things.
width - traitContainer.Width) + 4f * (float)(things.
height - traitContainer.Height);
7481 p *= 1f + 0.5f * (float)c_containerSize;
7484 if (c_priceFix != 0)
7486 p = (int)((
float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
7496 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
7507 if (!sell && category.
id ==
"spellbook")
7511 bool flag = priceType ==
PriceType.CopyShop;
7512 int num = ((!flag) ? 1 : 5);
7513 float num2 = Mathf.Min(0.01f * (
float)Evalue(752), 1f);
7514 float num3 = Mathf.Min(0.01f * (
float)Evalue(751), 1f);
7515 float num4 = Mathf.Min(0.02f * (
float)Evalue(759), 2f);
7520 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7522 p *= 0.20000000298023224;
7525 p *= 0.20000000298023224;
7528 p *= 0.20000000298023224;
7532 p *= 0.20000000298023224;
7538 if ((uint)(priceType - 1) <= 1u)
7550 if (
id ==
"rod_wish")
7552 p *= (sell ? 0.01f : 50f);
7567 p *= 0.20000000298023224;
7571 p *= 0.10000000149011612;
7574 p *= 0.0020000000949949026;
7577 p *= 0.00019999999494757503;
7580 p *= 0.004999999888241291;
7591 p *= (flag ? 1.25f : 0.3f);
7595 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)c_charges, 0f, 1.5f));
7599 p *= (flag ? 0.9f : 0.5f);
7611 p *= 1f + 0.2f * (float)c.Evalue(1406);
7624 p *= 1.100000023841858;
7658 else if (category.
IsChildOf(
"furniture"))
7678 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
7685 p = ((!sell) ? 1 : 0);
7693 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
7695 else if (p > 10000.0)
7697 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
7699 else if (p > 1000.0)
7701 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
7705 p = Mathf.CeilToInt((
float)p / 100f) * 100;
7709 p = Mathf.CeilToInt((
float)p / 10f) * 10;
7717 if (p > (
double)(sell ? 500000000 : 1000000000))
7730 return Name + GetExtraName();
7747 ForeachPoint(delegate(
Point p,
bool main)
7749 int num2 = DistMulti(p, c);
7757 return DistMulti(pos, c);
7789 isCensored = enable;
7799 if (isDeconstructing != deconstruct)
7809 isDeconstructing = deconstruct;
7823 sortVal = ((c_equippedSlot == 0) ? (category.
sortVal * 1000) : 0);
7826 sortVal = -GetPrice(
currency) * 1000;
7829 sortVal = -Num * 1000;
7832 sortVal = category.sortVal * 1000;
7835 sortVal = -ChildrenAndSelfWeight * 1000;
7838 sortVal = -ChildrenAndSelfWeightSingle * 1000;
7841 sortVal = -GetPrice(
currency) * 1000;
7844 sortVal = sourceCard._index * 1000;
7854 num =
id.CompareTo(c.
id);
7874 num = encLV - c.
encLV;
7893 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
7911 action(pos, arg2:
true);
7925 SE.Play(
"pop_paper");
7950 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
7963 if (!HaveFur() || c_fur < 0)
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
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
void SetStr(int id, string value=null)
void SetObj(int id, object o)
string GetStr(int id, string defaultStr=null)
int GetInt(int id, int? defaultInt=null)
void SetInt(int id, int value=0)
Dictionary< int, string > mapStr
void Mod(int a, bool force=false)
SourceElement.Row sourceElement
void WaitForEndOfFrame(Action action)
List< Action > actionsNextFrame
virtual void RefreshPosition()
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)
Card MakeRefFrom(string id)
string TryGetFoodName(Card c)
string ApplyNewLine(string text)
virtual void LookAt(Point p)
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)
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)
static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
virtual CardRenderer _CreateRenderer()
Thing AddThing(string id, int lv=-1)
string StripTalkSpeiclaCharacters(string text)
virtual bool MatchEncSearch(string s)
virtual string GetDetail()
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
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
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()
void MakeRefFrom(Card c1, Card c2=null)
virtual void ApplyMaterial(bool remove=false)
void ApplyElementEffect(Element e, int eleP, Card origin, bool checkHostileAct=false)
void ChangeAltitude(int a)
List< SocketData > socketList
void PlayAnime(AnimeID id, Point dest, bool force=false)
virtual void SetBlessedState(BlessedState s)
RenderParam GetRenderParam()
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)
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")
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)
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)
bool HasCraftBonusTrait()
virtual void Rotate(bool reverse=false)
Card SetHidden(bool hide=true)
void SetFreePos(Point point)
int GetDaysTogetherBonus()
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
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 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)
virtual void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
void ModNum(int a, bool notify=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)
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)
Card MakeFoodFrom(Card c)
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)
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)
ConTransmuteMimic mimicry
override bool IsPCFaction
void CalculateMaxStamina()
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)
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
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
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 GetResistDamage(int dmg, int v, int power=0)
static int GetResistLv(int v)
static Element Create(int id, int v=0)
static int[] List_MainAttributesMajor
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)
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()
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
static Religion recentWrath
static Religion GetArtifactDeity(string id)
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(bool snow=false)
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)
int GetCurrency(string id, ref int 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 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
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)