2using System.Collections.Generic;
4using System.Runtime.Serialization;
29 [JsonProperty(PropertyName =
"A")]
30 public int[]
_ints =
new int[30];
32 [JsonProperty(PropertyName =
"B")]
33 public string id =
"";
35 [JsonProperty(PropertyName =
"C")]
38 [JsonProperty(PropertyName =
"D")]
41 [JsonProperty(PropertyName =
"E")]
44 [JsonProperty(PropertyName =
"SC")]
243 return 0.001f * (float)
_ints[15];
247 _ints[15] = (int)(value * 1000f);
255 return 0.001f * (float)
_ints[16];
259 _ints[16] = (int)(value * 1000f);
271 _ints[17] = (int)value;
283 _ints[18] = (int)value;
307 _ints[19] = (int)value * 100;
993 SetInt(103, value ? 1 : 0);
1005 SetInt(109, value ? 1 : 0);
1017 SetInt(63, value ? 1 : 0);
1029 SetInt(64, value ? 1 : 0);
1041 SetInt(120, value ? 1 : 0);
1053 SetInt(121, value ? 1 : 0);
1065 SetInt(122, value ? 1 : 0);
1750 return GetObj<UniqueData>(6);
1762 return GetObj<Thing>(9);
1774 return GetObj<List<SocketData>>(17);
1786 return GetObj<Thing>(10);
1810 return GetObj<CharaUpgrade>(11);
1822 return GetObj<CharaGenes>(15);
1834 return GetObj<List<int>>(16);
1858 return GetObj<DNA>(14);
1870 return GetObj<CharaList>(13);
1882 return GetObj<MixedFoodData>(18);
1894 return GetObj<byte[]>(4);
1993 if (_childrenWeight < 0 || _childrenWeight > 10000000)
2081 if (
Tiles.Length == 1)
2083 return dir % 2 == 1;
2145 return id ==
"grass";
2267 return EClass.player.fame / 100 + 1;
2277 if (
Tiles.Length < 3)
2351 return bio.gender == 2;
2503 if (
card.isSale || !
card.trait.CanUseContent)
2508 if (windowSaveData !=
null)
2520 EClass.player.wasDirtyWeight =
true;
2538 public int Evalue(
int ele,
bool ignoreGlobalElement)
2564 return c_editorTags?.Contains(tag.ToString()) ??
false;
2597 int num2 =
item.Value;
2660 for (
int i = 0; i <
sockets.Count; i++)
2680 thing.parent =
this;
2697 public void Create(
string _id,
int _idMat = -1,
int genLv = -1)
2702 CardBlueprint.current =
null;
2751 if (
id ==
"microchip")
2832 EClass._zone.Boss =
Chara;
2873 int num = elementContainer.Value(value.
id);
2925 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
2929 return num * (100 +
Evalue(1237) * 30) / 100;
2960 Say(
"dingExp",
this);
2973 int num = Mathf.Min(1 +
LV / 5, 20);
2974 for (
int i = 0; i < num; i++)
2976 if (
Evalue(1644) < i + 1)
3016 if (rootCard !=
null && rootCard.
IsPC)
3071 Debug.LogWarning(
"already child:" + t);
3076 Debug.Log(
"already in the list" + t);
3091 t.ignoreAutoPick =
false;
3135 if (rootCard !=
null && rootCard.
IsPC)
3144 t.isNPCProperty =
false;
3158 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3161 void TryAdd(
Thing a)
3163 if (!ings.Contains(a.
id))
3177 List<Chara> list =
new List<Chara>();
3191 if (!
item.IsPCFactionOrMinion)
3195 List<Thing> list2 =
item.things.List((
Thing t) => t.
id == af.id && t != af);
3196 if (list2.Count == 0)
3200 foreach (
Thing item2
in list2)
3210 for (
int num =
things.Count - 1; num >= 0; num--)
3221 rootCard.Chara.held =
null;
3227 instance.selectedButton.card =
null;
3230 ActionMode.AdvOrRegion.updatePlans =
true;
3247 if (thing.
invY == 1)
3249 WidgetCurrentTool.dirty =
true;
3253 if (thing.
props !=
null)
3261 WidgetHotbar.dirtyCurrentItem =
true;
3262 thing.parent =
null;
3267 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3274 thing.parent =
null;
3283 return EClass.ui.layers.Count > 0;
3305 to.c_isImportant =
true;
3330 return card.GetRootCard();
3357 thing.encLV =
encLV;
3358 thing.decay =
decay;
3361 foreach (KeyValuePair<int, int>
item in mapInt)
3365 foreach (KeyValuePair<int, string> item2
in mapStr)
3367 thing.
mapStr[item2.Key] = item2.Value;
3373 thing.sockets = IO.DeepCopy(
sockets);
3389 ModNum(-a, notify:
false);
3401 return this as
Thing;
3404 return this as
Thing;
3410 return this as
Thing;
3413 public void ModNum(
int a,
bool notify =
true)
3452 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3458 for (
int i = 0; i <
sockets.Count; i++)
3476 for (
int i = 0; i <
sockets.Count; i++)
3482 int ele = num / 1000;
3483 int num2 = num % 1000;
3578 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3584 string encSlot = source.
encSlot;
3585 if (encSlot ==
null || encSlot.Length != 0)
3598 string[] array = source.
encSlot.Split(
',');
3599 foreach (
string key
in array)
3647 if (this.placeState == newState)
3653 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3665 float num2 = (
fy = 0f);
3676 this.placeState = newState;
3684 this.placeState = newState;
3739 num = num * (100 +
Quality) / 100;
3776 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
3823 public bool TryPay(
int a,
string id =
"money")
3830 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
3834 if (
IsPC && !(
id ==
"ration"))
3854 Say(
"spellbookCrumble",
this);
3863 if (
id ==
"influence")
3875 if (
id ==
"influence")
3906 num = (long)a * (
long)Mathf.Max(100 -
Evalue(93), 1) / 100;
3908 if (num > 100000000)
3940 int num =
PV + orCreateElement.Value +
DEX / 10;
3947 num2 = num3 / 10 + 1;
3948 sides = num3 / num2 + 1;
3950 dmg = dmg * 100 / Mathf.Max(100 + num, 1);
3952 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
3953 dmg -= num4 * mod / 100;
3963 DamageHP(dmg, 0, 0, attackSource, origin);
3972 bool flag = originalTarget !=
null;
3973 Action onEvade =
null;
3977 if ((uint)(attackSource2 - 3) > 2u && (uint)(attackSource2 - 13) > 4u)
3983 int num = chara3.
Evalue(1241);
3984 int num2 = chara3.
Evalue(438);
3987 Say((num2 == 0) ?
"wall_flesh" :
"wall_knightly", chara3,
this);
3996 if (ele == 0 || ele == 926)
4001 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
4007 if (attackSource !=
AttackSource.Condition && showEffect)
4017 int num3 = ((origin !=
null) ? origin.Evalue(1238) : 0);
4021 if (origin.HasElement(1247))
4026 if (attackSource ==
AttackSource.MagicArrow && origin !=
null && origin.HasElement(1244))
4030 if (attackSource ==
AttackSource.MagicHand && origin !=
null && origin.HasElement(1246))
4035 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
4036 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
4043 if (chara2 !=
null && chara2.
isWet)
4052 if (chara !=
null && chara.
isWet)
4054 dmg = dmg * 150 / 100;
4060 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
4068 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
4070 if (origin !=
null && origin.HasCondition<
ConBerserk>())
4079 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num4 - 50))) / 100;
4084 dmg = dmg * 100 / (100 +
Evalue(435) * 2);
4086 dmg = dmg * Mathf.Max(0, 100 - Mathf.Min(
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56), 100) / ((!flag) ? 1 : 2)) / 100;
4093 dmg = dmg * 90 / 100;
4097 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
4101 dmg = dmg * 90 / 100;
4120 dmg = dmg * 100 / Mathf.Min(100 + num5 * 5, 120);
4124 dmg = dmg * Mathf.Min(100 + num6 * 5, 120) / 100;
4129 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
4131 if (
HasElement(1218) && attackSource != AttackSource.ManaBackfire && (
hp > 0 ||
Evalue(1421) <= 0))
4133 dmg = dmg * (1000 - Mathf.Min(
Evalue(1218), 1000) / ((!flag) ? 1 : 2)) / 1000;
4141 int num7 =
MaxHP / 10;
4142 int num8 = dmg - num7;
4143 num8 = num8 * 100 / (200 +
Evalue(68) * 10);
4155 int num9 = Mathf.Clamp(dmg * 6 /
MaxHP, 0, 4) + ((dmg > 0) ? 1 : 0);
4166 if (hp < 0 && Chara.mana.value >= 0)
4182 Chara.mana.value -= dmg;
4199 float ratio = (float)dmg / (
float)
MaxHP;
4210 if (
EClass.
pc.
ai is
AI_PracticeDummy { IsRunning: not
false } aI_PracticeDummy && aI_PracticeDummy.target ==
this && (origin ==
null || origin.IsPC))
4212 aI_PracticeDummy.hit++;
4213 aI_PracticeDummy.totalDamage += dmg;
4256 if (origin !=
null && origin !=
this &&
Evalue(436) > 0 && !HasCondition<ConFractured>())
4265 hp = Mathf.Min(half * (
int)Mathf.Sqrt(
Evalue(436) * 2) / 100,
MaxHP / 3);
4286 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
4288 EClass.player.invlunerable =
true;
4327 if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null && (origin.isSynced ||
IsPC))
4334 text =
"dead_" + e.
source.alias;
4338 text =
"dead_attack";
4346 text =
"kill_" + e.source.alias;
4350 text =
"kill_attack";
4352 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4360 Say(
"reboot",
this);
4367 if (HasCondition<ConRebirth>())
4369 Say(
"rebirth",
this);
4381 Msg.alwaysVisible =
true;
4382 Msg.
Say(
"layhand", chara4,
this);
4383 Msg.
Say(
"pray_heal",
this);
4393 if (zoneInstanceBout !=
null)
4425 Die(e, origin, attackSource, originalTarget);
4431 string text2 =
new int[18]
4433 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4434 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4435 }.RandomItem().ToString();
4438 text2 =
"casino_coin";
4442 text2 =
"scratchcard";
4470 if (origin !=
null && origin.isChara)
4492 if (origin.GetInt(106) == 0)
4494 origin.Chara.TalkTopic(
"kill");
4499 else if ((attackSource ==
AttackSource.Melee || attackSource ==
AttackSource.Range) && origin !=
null && originalTarget ==
null)
4501 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num9 + (
IsPC ?
"pc" :
""), origin,
this);
4505 int num13 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4510 Say(
"dmg_" + e.source.alias,
this);
4514 Say(
"dmg" + num9,
this);
4529 if (origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4533 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4537 int num14 = origin.Dist(
this);
4541 if (
id ==
"hedgehog_ether")
4545 Say(
"reflect_thorne",
this, origin);
4546 origin.DamageHP(Mathf.Clamp(dmg / 10, 1,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele2,
Power,
AttackSource.Condition,
this);
4551 Say(
"reflect_acid",
this, origin);
4552 origin.DamageHP(Mathf.Clamp(dmg / 10, 1,
MaxHP / (origin.IsPowerful ? 200 : 20)), ele3,
Power * 2,
AttackSource.Condition,
this);
4564 int a2 = (int)(100L * (
long)(dmg * 100 /
MaxHP) / 100) + 1;
4575 int num15 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4585 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4591 Condition.ignoreEffect =
true;
4593 Condition.ignoreEffect =
false;
4597 float num16 = (float)
hp / (
float)
MaxHP;
4604 PlaySound(
"heartbeat", 1f - num16 * 2f);
4637 EClass.player.forceTalk =
true;
4639 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
4650 void EvadeDeath(Action action)
4655 Chara.mana.value = 0;
4669 if (origin !=
null && origin.isChara &&
isChara && (
weapon ==
null || !
weapon.HasElement(486)))
4671 int valueOrDefault = (origin.Evalue(662) +
weapon?.Evalue(662, ignoreGlobalElement:
true)).GetValueOrDefault();
4672 int valueOrDefault2 = (origin.Evalue(661) +
weapon?.Evalue(661, ignoreGlobalElement:
true)).GetValueOrDefault();
4675 int num17 =
EClass.
rnd(3 + Mathf.Clamp(dmg / 100, 0, valueOrDefault / 10));
4676 origin.Chara.stamina.Mod(num17);
4682 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
4684 int num18 =
EClass.
rndHalf(2 + Mathf.Clamp(dmg / 10, 0, origin.Chara.GetPietyValue() + 10));
4685 origin.Chara.mana.Mod(num18);
4691 if (valueOrDefault2 > 0 && attackSource ==
AttackSource.Melee)
4693 int num19 =
EClass.
rnd(2 + Mathf.Clamp(dmg / 10, 0, valueOrDefault2 + 10));
4694 origin.Chara.mana.Mod(num19);
4711 bool hostile =
false;
4715 if (Chance(30 + eleP / 5, 100))
4717 MarkHostile().AddCondition<
ConBurning>(eleP);
4723 if (Chance(30 + eleP / 10, 100))
4728 else if (Chance(50 + eleP / 10, 100))
4734 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
4740 if (Chance(30 + eleP / 5, 100))
4742 MarkHostile().AddCondition<
ConPoison>(eleP);
4746 if (Chance(30 + eleP / 5, 100))
4753 if (Chance(30 + eleP / 5, 100))
4762 if (Chance(30 + eleP / 5, 100))
4767 else if (Chance(30 + eleP / 5, 100))
4773 if (Chance(50 + eleP / 10, 100))
4781 if (Chance(30 + eleP / 5, 100))
4800 if (Chance(5 + eleP / 25, 40))
4804 if (Chance(5 + eleP / 25, 40))
4808 if (Chance(5 + eleP / 25, 40))
4812 if (Chance(5 + eleP / 25, 40))
4814 MarkHostile().AddCondition<
ConPoison>(eleP / 2);
4816 if (Chance(5 + eleP / 25, 40))
4820 if (Chance(5 + eleP / 25, 40))
4824 if (Chance(30 + eleP / 10, 100))
4830 if (Chance(50 + eleP / 10, 100))
4832 MarkHostile().AddCondition<
ConBleed>(eleP);
4836 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
4849 if (checkHostileAct && hostile && origin !=
null && origin.
isChara)
4853 static bool Chance(
int a,
int max)
4855 return Mathf.Min(a, max) >
EClass.
rnd(100);
4866 Card rootCard = GetRootCard();
4868 if (_pos !=
null && !_pos.
IsValid)
4879 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
4880 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
4882 text += e.source.alias;
4886 Msg.
Say(text,
this, rootCard);
4891 Msg.
Say(
"destroyed",
this);
4896 things.ForeachReverse(delegate(
Thing t)
4905 if (e !=
null && _pos !=
null && e.id == 21)
4911 Explode(pos, origin);
4919 origin = origin?.Chara,
4921 aliasEle =
"eleImpact"
4927 PlaySound(
material.GetSoundDead(sourceCard));
4935 Debug.Log(Name +
" is already destroyed.");
4946 Chara.isDead =
true;
4964 for (
int num = things.Count - 1; num >= 0; num--)
4966 things[num].Destroy();
4973 if (!isChara || IsPCFactionMinion || (isCopy &&
EClass.
rnd(10) != 0))
4979 List<Card> list =
new List<Card>();
4980 if (!IsPCFaction && !isUserZone && sourceCard.
idActor.IsEmpty())
4983 if (this.rarity >=
Rarity.Legendary)
5016 else if (origin !=
null && origin.
HasElement(290) && !IsMinion)
5028 if (
id ==
"littleOne" && IsPCFactionOrMinion)
5032 if (flag2 && !isUserZone)
5035 bool num2 = text ==
"_meat";
5047 text =
"meat_marble";
5050 if (thing3.
source._origin ==
"meat")
5064 if (!IsPCFaction && !isUserZone)
5066 foreach (
string item2
in sourceCard.
loot.Concat(
Chara.
race.loot).ToList())
5068 string[] array = item2.
Split(
'/');
5069 int num4 = array[1].ToInt();
5113 if (!isBackerContent && !flag)
5143 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.rarity >=
Rarity.Legendary) ? 1 : 0));
5153 if (text2 ==
"big_daddy" || text2 ==
"santa")
5161 List<Thing> list2 =
new List<Thing>();
5162 foreach (
Thing thing4
in things)
5188 if (num5 > 0 && list2.Count > 0)
5191 for (
int j = 0; j < list2.Count && j < num5; j++)
5197 if (this.rarity >=
Rarity.Legendary && !IsUnique && c_bossType !=
BossType.Evolved)
5200 foreach (
Card item3
in list)
5209 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
5214 for (
int k = 0; k < num5; k++)
5237 foreach (
Thing thing5
in things)
5239 if (thing5.
GetInt(116) != 0)
5244 Point nearestPoint = GetRootCard().pos;
5249 foreach (
Card item4
in list)
5255 item4.isHidden =
false;
5312 case "egg_fertilized":
5317 string text =
"c_wilds";
5318 if (
id ==
"_meat" ||
id ==
"meat_marble")
5326 for (
int i = 0; i < 20; i++)
5335 if (c_idRefCard.IsEmpty())
5337 MakeRefFrom(cardRow.
model);
5342 MakeFoodFrom(cardRow.
model);
5344 return this as
Thing;
5350 return this as
Thing;
5367 int num = race.
food[0].ToInt();
5368 bool flag =
id ==
"meat_marble";
5370 bool flag2 = category.
IsChildOf(
"meat");
5382 elements.
SetBase(70, race.
STR * race.
STR / 5 * num / 100 - 10 + num / 10);
5385 elements.
SetBase(440, race.
END * race.
END / 5 * num / 100 - 10 + num / 10);
5387 elements.
SetBase(71, (
int)Mathf.Clamp((
float)(num / 10) + Mathf.Sqrt(race.
height) - 10f, 1f, 60f));
5391 elements.
SetBase(444, race.
LER * race.
LER / 5 * num / 100 - 10 + num / 10);
5409 foreach (
Element value
in c.elements.dict.Values)
5411 if ((!flag3 || value.
id != 1229) && (value.
source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
5416 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
5417 foreach (KeyValuePair<int, int>
item in race.elementMap)
5421 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
5424 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5425 for (
int i = 0; i < num2 && i < list.Count; i++)
5427 Tuple<int, int> tuple = list[i];
5428 elements.
SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5430 if (c.Chara.IsUndead)
5434 isWeightChanged =
true;
5435 c_weight = race.height * 4 + 100;
5436 c_idMainElement = c.c_idMainElement;
5438 int num3 = c.LV - c.sourceCard.LV;
5444 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
5448 if (flag2 && c.IsPCFaction && c.IsUnique)
5463 if (IsIgnoreName(
card))
5467 if (IsIgnoreName(card2))
5471 if (
card ==
null && card2 !=
null)
5478 MakeRefFrom(
card, card2);
5479 if (
card.c_idRefCard !=
null)
5481 c_idRefCard =
card.c_idRefCard;
5482 c_altName = TryGetFoodName(
card);
5487 c_altName2 = TryGetFoodName(card2);
5490 static bool IsIgnoreName(
Card c)
5520 if (!row.aka.IsEmpty())
5522 if (row.name ==
"*r" && row.aka ==
"*r")
5524 return "corpseGeneral".lang();
5526 if (row.name ==
"*r")
5528 return row.GetText(
"aka");
5531 return row.GetName();
5536 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
5552 c_idRefCard = c1.
id;
5556 c_idRefCard2 = c2.id;
5557 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName(
NameStyle.Ref, (!c2.isChara) ? 1 : 0));
5559 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.
c_extraNameRef);
5566 thing.c_idMainElement = c_idMainElement;
5575 return GiveBirth(thing, effect);
5586 int num2 = LV - sourceCard.
LV;
5599 return GiveBirth(thing, effect);
5605 EClass.player.forceTalk =
true;
5606 card.Talk(
"giveBirth");
5610 card.pos.PlayEffect(
"revive");
5611 card.pos.PlaySound(
"egg");
5668 SayNothingHappans();
5671 PlayEffect(
"teleport");
5674 Say(
"antiTeleport",
this);
5675 PlaySound(
"gravity");
5680 PlaySound(
"teleport");
5681 Say(
"teleported",
this);
5690 if (chara.
enemy ==
this)
5701 EClass.player.haltMove =
true;
5703 PlayEffect(
"teleport", useRenderPos:
false);
5710 PlayEffect(
"ripple");
5711 PlaySound(
"Footstep/water");
5727 return elements.
Value(ele) >= req;
5742 if (HasElement(764))
5746 if (HasElement(759))
5750 if (HasElement(703))
5768 for (
int i = 0; i < a; i++)
5779 shared.color = 11010048f;
5780 shared.liquidLv = 0;
5782 SetRenderParam(shared);
5802 isDyed = mat !=
null;
5803 c_dyeMat = mat?.id ?? 0;
5815 else if (isElemental)
5851 int num = EClass.game.seed + refVal;
5852 num +=
id[0] % 10000;
5855 num +=
id[1] % 1000;
5858 num +=
id[2] % 1000;
5861 num +=
id[3] % 1000;
5864 num +=
id[4] % 1000;
5873 return ref _randColor;
5890 public void SetImage(Image image,
int dir,
int idSkin = 0)
5892 sourceRenderCard.
SetImage(image, GetSprite(dir), colorInt, setNativeSize:
true, dir, idSkin,
this);
5903 sourceRenderCard.
SetImage(image, GetSprite(), colorInt, setNativeSize:
true, 0, 0,
this);
5907 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
5909 if ((!isChara ||
Chara.
host ==
null) && !(_emo == lastEmo && skipSame))
5913 renderer.
ShowEmo(_emo, duration);
5921 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
5926 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
5931 PlaySound(
material.GetSoundImpact(sourceCard), 1f, spatial);
5936 PlaySound(
material.GetSoundDead(sourceCard), 1f, spatial);
5939 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
5941 Card rootCard = GetRootCard();
5948 return rootCard.
pos.
PlaySound(
id, isSynced || !spatial, v, spatial);
5973 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
5979 Card rootCard = GetRootCard();
5983 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
5991 Card rootCard = GetRootCard();
6014 public virtual void Rotate(
bool reverse =
false)
6017 if (sourceCard.
tiles.Length > 4)
6019 num = sourceCard.
tiles.Length;
6077 fx = fx - vector.x + thingPosition.x;
6078 fy = fy - vector.y + thingPosition.y;
6082 float num2 = (fy = 0f);
6106 renderParam.x = v.x;
6107 renderParam.y = v.y;
6108 renderParam.z = v.z;
6110 v.x = renderParam.
x;
6111 v.y = renderParam.
y;
6112 v.z = renderParam.
z;
6126 v.z += thingPosition.z;
6133 if (useCurrentPosition)
6148 renderer.
Draw(renderParam, ref v, drawShadow:
false);
6159 EClass.player.lightRadius = 1;
6167 return GetLightRadius() > 0;
6175 return 0.01f * LightData.color.a * 256f * 1.12f;
6177 if (IsPCFaction && !IsPC)
6238 num2 = traitLightSource.LightRadius;
6243 if (lightRadius > 0)
6245 if (lightRadius > num2)
6265 int radius = GetLightRadius();
6270 float power = GetLightPower();
6297 fov.
Perform(pos.
x, pos.
z, radius, power * 2f);
6308 int num = (trait.UseLightColor ? c_lightColor : 0);
6311 fov.r = (byte)(num / 1024);
6312 fov.g = (byte)(num % 1024 / 32);
6313 fov.b = (byte)(num % 32);
6354 if (fov !=
null && fov.
lastPoints.Count != 0)
6373 things.ForeachReverse(delegate(
Thing t)
6377 if (sourceCard.
_origin ==
"dish")
6385 else if (!isChara && trait.
Decay != 0)
6387 Decay(trait.
Decay * hour);
6405 int num2 = MaxDecay / 4 * 3;
6410 num =
card.trait.DecaySpeedChild;
6412 num = num * trait.DecaySpeed / 100;
6413 int num3 = Evalue(405);
6416 num = num * (100 - num3 * 2) / 100;
6428 if (decay + a > MaxDecay)
6430 if (
card !=
null && !
card.trait.OnChildDecay(
this, !IsDecayed))
6439 card.AddCard(thing);
6440 if (!IsParentLocked())
6442 GetRootCard().Say(
"seed_rot", GetRootCard(),
this, thing.
Name);
6451 else if (GetRootCard() ==
EClass.
pc)
6453 if (!IsParentLocked())
6465 else if (decay < num2 && decay + a >= num2 && GetRootCard() ==
EClass.
pc)
6467 if (!IsParentLocked())
6474 bool IsParentLocked()
6476 if (parent is
Thing)
6478 return (parent as
Thing).c_lockLv > 0;
6486 return !
MOD.
listTalk.
GetTalk(c_idTalk.IsEmpty(
id), idTopic, useDefault:
true).IsEmpty();
6489 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6493 EClass.player.forceTalk =
false;
6497 EClass.player.forceTalk =
false;
6498 if (!isSynced && !forceSync)
6503 GameLang.refDrama1 = ref1;
6504 GameLang.refDrama2 = ref2;
6505 string text = GetTalkText(idTopic, stripPun:
true);
6506 if (HasElement(1232) && idTopic !=
"baby")
6513 if (!(text2 ==
"adv_gaki"))
6515 if (text2 ==
"corgon")
6525 TalkRaw(text, ref1, ref2, forceSync);
6528 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6530 if ((!isSynced && !forceSync) || text.IsEmpty())
6537 text = text.Replace(
"#1", ref1);
6541 text = text.Replace(
"#2", ref2);
6543 HostRenderer.Say(ApplyNewLine(text));
6544 bool flag = text.StartsWith(
"*");
6548 text = text.Bracket();
6550 Msg.
Say(text.Replace(
"&",
""));
6555 if (text.Contains(
"&"))
6557 string text2 =
"_comma".lang();
6558 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
6559 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
6560 text = text.Replace(
"&", Environment.NewLine ??
"");
6565 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
6567 if (isSynced && !text.IsEmpty())
6571 text = text.Replace(
"#1", ref1);
6575 text = text.Replace(
"#2", ref2);
6577 HostRenderer.Say(text);
6583 Say(
"nothingHappens");
6586 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
6595 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
6604 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
6613 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
6617 if (!text.IsEmpty())
6619 text = text.Split(
'|').RandomItem();
6620 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
6622 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
6624 text =
"(" + text +
")";
6626 text = text.Replace(
"。)",
")");
6629 return ApplyTone(text, stripPun);
6635 return ApplyTone(
Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
6638 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
6644 string[] array = _tones.IsEmpty(
"").Split(
'|');
6645 string key = array[0];
6650 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6654 if (array[0].IsEmpty())
6663 if (array.Length >= 2)
6665 stringBuilder.Replace(
"_toneI".lang(), array[1]);
6667 if (array.Length >= 3)
6669 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
6672 text2 = stringBuilder.ToString();
6676 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6687 return text2.StripLastPun();
6702 List<Dictionary<string, string>> list =
MOD.
tones.
list;
6703 if (list.Count != 0)
6705 int mtp = EClass.core.config.test.extraToneMTP
switch
6718 string text = list.RandomItem()[
"id"];
6719 text = list.RandomItemWeighted((Dictionary<string, string> a) => a[
"chance"].ToInt() * ((!a[
"tag"].Contains(
"meta")) ? 1 : mtp))[
"id"];
6726 return ListCraftBonusTraits().Count > 0;
6731 List<Element> list =
new List<Element>();
6732 string[] tag = sourceCard.
tag;
6733 for (
int i = 0; i < tag.Length; i++)
6735 string[] array = tag[i].Split(
'/');
6736 if (!(array[0] !=
"craft_bonus"))
6752 if (dest.
stack !=
null)
6756 Say(
"stack_thing", t, dest.
stack);
6764 ChangeRarity(
Rarity.Normal);
6770 c_idBacker = row.
id;
6776 chara.hostility = hostility2;
6782 Chara.idFaith = row.
deity.ToLowerInvariant();
6787 if (
id ==
"putty_snow")
6800 if (c_idBacker == 164)
6813 c_textureData = GetPaintData();
6823 Sprite sprite = GetSprite();
6824 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
6825 int num = sprite.texture.width * 2;
6826 int num2 = sprite.texture.height * 2;
6827 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
6828 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
6829 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
6830 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
6831 texture2D2.SetPixels(pixels);
6833 byte[] result = texture2D2.EncodeToJPG();
6834 UnityEngine.Object.Destroy(texture2D);
6835 UnityEngine.Object.Destroy(texture2D2);
6841 if ((
bool)_paintSprite)
6843 UnityEngine.Object.Destroy(_paintSprite.texture);
6844 UnityEngine.Object.Destroy(_paintSprite);
6845 _paintSprite =
null;
6853 byte[] data = c_textureData;
6854 Texture2D texture2D =
new Texture2D(1, 1);
6855 texture2D.LoadImage(data);
6856 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
6860 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
6863 return _paintSprite;
6868 if (!(GetRestrainer() ==
null || force))
6872 isRestrained =
false;
6873 Say(
"unrestrained",
this);
6884 if (c_rescueState ==
RescueState.WaitingForRescue)
6898 c.DoHostileAction(
item, immediate:
true);
6925 result = row.value * mat.value / 100;
6962 int num = ((c_fixedValue == 0) ? trait.
GetValue() : c_fixedValue);
6963 if (
id ==
"plat" && !sell)
6974 num2 += (float)c_priceCopy * 0.2f;
6975 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
6979 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
6981 if (IsFood && !
material.tag.Contains(
"food"))
6986 if (IsEquipmentOrRangedOrAmmo || trait is
TraitMod)
7004 if (IsEquipmentOrRanged && rarity >=
Rarity.Legendary)
7006 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
7008 num2 = num2 * (100f + num3 * (float)(
material.value - 100)) / 100f;
7009 if (IsEquipmentOrRanged)
7014 num4 += value.
source.value;
7016 num2 = num2 * (float)(100 + (sell ? ((
int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
7017 if (rarity >=
Rarity.Legendary)
7019 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
7027 if (encLV != 0 && !category.
tag.Contains(
"noEnc"))
7029 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)))));
7033 num2 *= (float)(tier + 1);
7040 if (priceType ==
PriceType.CopyShop && sell)
7046 if (
id ==
"littleball")
7061 case "hammer_strip":
7070 if (!(text ==
"lucky_coin"))
7072 if (!(text ==
"book_skill"))
7091 case "diary_sister":
7095 case "diary_catsister":
7097 case "container_magic":
7099 case "wrench_tent_elec":
7101 case "wrench_tent_soil":
7103 case "wrench_tent_seabed":
7107 case "wrench_storage":
7109 case "wrench_fridge":
7111 case "wrench_extend_v":
7113 case "wrench_extend_h":
7127 if (!sell &&
id ==
"casino_coin")
7131 int value = GetValue(priceType, sell);
7141 Trait trait = this.trait;
7146 p *= 1f + 4f * (float)(things.
width - traitContainer.Width) + 4f * (float)(things.
height - traitContainer.Height);
7151 p *= 1f + 0.5f * (float)c_containerSize;
7154 if (c_priceFix != 0)
7156 p = (int)((
float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
7166 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
7177 if (!sell && category.
id ==
"spellbook")
7181 bool flag = priceType ==
PriceType.CopyShop;
7182 int num = ((!flag) ? 1 : 5);
7183 float num2 = Mathf.Min(0.01f * (
float)Evalue(752), 1f);
7184 float num3 = Mathf.Min(0.01f * (
float)Evalue(751), 1f);
7185 float num4 = Mathf.Min(0.02f * (
float)Evalue(759), 2f);
7190 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7192 p *= 0.20000000298023224;
7195 p *= 0.20000000298023224;
7198 p *= 0.20000000298023224;
7204 if ((uint)(priceType - 1) <= 1u)
7216 if (
id ==
"rod_wish")
7218 p *= (sell ? 0.01f : 50f);
7233 p *= 0.20000000298023224;
7237 p *= 0.10000000149011612;
7240 p *= 0.0020000000949949026;
7243 p *= 0.00019999999494757503;
7246 p *= 0.004999999888241291;
7257 p *= (flag ? 1.25f : 0.3f);
7261 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)c_charges, 0f, 1.5f));
7265 p *= (flag ? 0.9f : 0.5f);
7277 p *= 1f + 0.2f * (float)c.Evalue(1406);
7290 p *= 1.100000023841858;
7324 else if (category.
IsChildOf(
"furniture"))
7344 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
7351 p = ((!sell) ? 1 : 0);
7359 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
7361 else if (p > 10000.0)
7363 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
7365 else if (p > 1000.0)
7367 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
7371 p = Mathf.CeilToInt((
float)p / 100f) * 100;
7375 p = Mathf.CeilToInt((
float)p / 10f) * 10;
7383 if (p > (
double)(sell ? 500000000 : 1000000000))
7396 return Name + GetExtraName();
7413 ForeachPoint(delegate(
Point p,
bool main)
7415 int num2 = DistMulti(p, c);
7423 return DistMulti(pos, c);
7455 isCensored = enable;
7465 if (isDeconstructing != deconstruct)
7475 isDeconstructing = deconstruct;
7489 sortVal = ((c_equippedSlot == 0) ? (category.
sortVal * 1000) : 0);
7492 sortVal = -GetPrice(
currency) * 1000;
7495 sortVal = -Num * 1000;
7498 sortVal = category.sortVal * 1000;
7501 sortVal = -ChildrenAndSelfWeight * 1000;
7504 sortVal = -ChildrenAndSelfWeightSingle * 1000;
7507 sortVal = -GetPrice(
currency) * 1000;
7510 sortVal = sourceCard._index * 1000;
7520 num =
id.CompareTo(c.
id);
7540 num = encLV - c.
encLV;
7559 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
7577 action(pos, arg2:
true);
7591 SE.Play(
"pop_paper");
7616 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
7629 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 Set(CardBlueprint _bp)
static void SetRarity(Rarity q=Rarity.Normal)
static CardBlueprint current
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
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
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)
bool HasElement(int ele, int req=1)
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)
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)
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
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)
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 int ApplyProtection(int dmg, int mod=100)
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 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()
void DamageHP(int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null)
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 SpawnLoot(Card origin)
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 Unequip(Thing thing, bool refresh=true)
AttackStyle GetAttackStyle()
Thing GetEquippedThing(int elementId)
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 TryUpgrade(bool msg=true)
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 ColorProfile Colors
static int curve(int a, int start, int step, int rate=75)
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 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)
static SubPassData Default
string GetTalk(string id, string idTopic, bool useDefault=false, bool human=true)
string GetRandomID(string tag)
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 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
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
Card AddCard(Card t, Point point)
void OnChildNumChange(Card c)