2using System.Collections.Generic;
4using System.Runtime.Serialization;
27 [JsonProperty(PropertyName =
"A")]
28 public int[]
_ints =
new int[30];
30 [JsonProperty(PropertyName =
"B")]
31 public string id =
"";
33 [JsonProperty(PropertyName =
"C")]
36 [JsonProperty(PropertyName =
"D")]
39 [JsonProperty(PropertyName =
"E")]
42 [JsonProperty(PropertyName =
"SC")]
241 return 0.001f * (float)
_ints[15];
245 _ints[15] = (int)(value * 1000f);
253 return 0.001f * (float)
_ints[16];
257 _ints[16] = (int)(value * 1000f);
269 _ints[17] = (int)value;
281 _ints[18] = (int)value;
305 _ints[19] = (int)value * 100;
991 SetInt(103, value ? 1 : 0);
1003 SetInt(109, value ? 1 : 0);
1015 SetInt(63, value ? 1 : 0);
1027 SetInt(64, value ? 1 : 0);
1039 SetInt(120, value ? 1 : 0);
1051 SetInt(121, value ? 1 : 0);
1063 SetInt(122, value ? 1 : 0);
1736 return GetObj<UniqueData>(6);
1748 return GetObj<Thing>(9);
1760 return GetObj<List<SocketData>>(17);
1772 return GetObj<Thing>(10);
1796 return GetObj<CharaUpgrade>(11);
1808 return GetObj<CharaGenes>(15);
1820 return GetObj<List<int>>(16);
1844 return GetObj<DNA>(14);
1856 return GetObj<CharaList>(13);
1868 return GetObj<byte[]>(4);
1967 if (_childrenWeight < 0 || _childrenWeight > 10000000)
2055 if (
Tiles.Length == 1)
2057 return dir % 2 == 1;
2119 return id ==
"grass";
2241 return EClass.player.fame / 100 + 1;
2251 if (
Tiles.Length < 3)
2325 return bio.gender == 2;
2477 if (
card.isSale || !
card.trait.CanUseContent)
2482 if (windowSaveData !=
null)
2494 EClass.player.wasDirtyWeight =
true;
2512 public int Evalue(
int ele,
bool ignoreGlobalElement)
2538 return c_editorTags?.Contains(tag.ToString()) ??
false;
2571 int num2 =
item.Value;
2643 thing.parent =
this;
2660 public void Create(
string _id,
int _idMat = -1,
int genLv = -1)
2665 CardBlueprint.current =
null;
2714 if (
id ==
"microchip")
2795 EClass._zone.Boss =
Chara;
2836 int num = elementContainer.Value(value.
id);
2888 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
2892 return num * (100 +
Evalue(1237) * 30) / 100;
2923 Say(
"dingExp",
this);
2936 int num = Mathf.Min(1 +
LV / 5, 20);
2937 for (
int i = 0; i < num; i++)
2939 if (
Evalue(1644) < i + 1)
2979 if (rootCard !=
null && rootCard.
IsPC)
3034 Debug.LogWarning(
"already child:" + t);
3039 Debug.Log(
"already in the list" + t);
3054 t.ignoreAutoPick =
false;
3098 if (rootCard !=
null && rootCard.
IsPC)
3107 t.isNPCProperty =
false;
3121 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3124 void TryAdd(
Thing a)
3126 if (!ings.Contains(a.
id))
3140 List<Chara> list =
new List<Chara>();
3154 if (!
item.IsPCFactionOrMinion)
3158 List<Thing> list2 =
item.things.List((
Thing t) => t.
id == af.id && t != af);
3159 if (list2.Count == 0)
3163 foreach (
Thing item2
in list2)
3173 for (
int num =
things.Count - 1; num >= 0; num--)
3184 rootCard.Chara.held =
null;
3190 instance.selectedButton.card =
null;
3193 ActionMode.AdvOrRegion.updatePlans =
true;
3210 if (thing.
invY == 1)
3212 WidgetCurrentTool.dirty =
true;
3216 if (thing.
props !=
null)
3224 WidgetHotbar.dirtyCurrentItem =
true;
3225 thing.parent =
null;
3230 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3237 thing.parent =
null;
3246 return EClass.ui.layers.Count > 0;
3268 to.c_isImportant =
true;
3293 return card.GetRootCard();
3320 thing.encLV =
encLV;
3321 thing.decay =
decay;
3324 foreach (KeyValuePair<int, int>
item in mapInt)
3328 foreach (KeyValuePair<int, string> item2
in mapStr)
3330 thing.
mapStr[item2.Key] = item2.Value;
3336 thing.sockets = IO.DeepCopy(
sockets);
3352 ModNum(-a, notify:
false);
3364 return this as
Thing;
3367 return this as
Thing;
3373 return this as
Thing;
3376 public void ModNum(
int a,
bool notify =
true)
3415 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3421 for (
int i = 0; i <
sockets.Count; i++)
3439 for (
int i = 0; i <
sockets.Count; i++)
3445 int ele = num / 100;
3446 int num2 = num % 100;
3475 type = SocketData.Type.Rune
3535 if (row.category ==
"resist")
3539 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3545 string encSlot = row.encSlot;
3546 if (encSlot ==
null || encSlot.Length != 0)
3553 string[] array = row.encSlot.Split(
',');
3554 foreach (
string key
in array)
3598 if (this.placeState == newState)
3604 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3616 float num2 = (
fy = 0f);
3627 this.placeState = newState;
3635 this.placeState = newState;
3686 num = num * (100 +
Quality) / 100;
3723 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
3770 public bool TryPay(
int a,
string id =
"money")
3777 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
3781 if (
IsPC && !(
id ==
"ration"))
3801 Say(
"spellbookCrumble",
this);
3810 if (
id ==
"influence")
3822 if (
id ==
"influence")
3853 num = (long)a * (
long)Mathf.Max(100 -
Evalue(93), 1) / 100;
3855 if (num > 100000000)
3887 int num =
PV + orCreateElement.Value +
DEX / 10;
3894 num2 = num3 / 10 + 1;
3895 sides = num3 / num2 + 1;
3897 dmg = dmg * 100 / (100 + num);
3899 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
3900 dmg -= num4 * mod / 100;
3910 DamageHP(dmg, 0, 0, attackSource, origin);
3920 if (ele == 0 || ele == 926)
3925 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
3931 if (attackSource !=
AttackSource.Condition && showEffect)
3941 int num = ((origin !=
null) ? origin.Evalue(1238) : 0);
3947 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
3948 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
3955 if (chara2 !=
null && chara2.
isWet)
3964 if (chara !=
null && chara.
isWet)
3966 dmg = dmg * 150 / 100;
3972 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
3980 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
3982 if (origin !=
null && origin.HasCondition<
ConBerserk>())
3991 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num2 - 50))) / 100;
3994 dmg = dmg * Mathf.Max(0, 100 -
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56)) / 100;
4001 dmg = dmg * 90 / 100;
4005 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
4009 dmg = dmg * 90 / 100;
4028 dmg = dmg * 100 / Mathf.Min(100 + num3 * 5, 120);
4032 dmg = dmg * Mathf.Min(100 + num4 * 5, 120) / 100;
4037 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
4039 if (
HasElement(1218) && attackSource != AttackSource.ManaBackfire && (
hp > 0 ||
Evalue(1421) <= 0))
4041 dmg = dmg * (1000 -
Evalue(1218)) / 1000;
4049 int num5 =
MaxHP / 10;
4050 int num6 = dmg - num5;
4051 num6 = num6 * 100 / (200 +
Evalue(68) * 10);
4063 int num7 = Mathf.Clamp(dmg * 6 /
MaxHP, 0, 4) + ((dmg > 0) ? 1 : 0);
4073 if (hp < 0 && Chara.mana.value >= 0)
4089 Chara.mana.value -= dmg;
4106 float ratio = (float)dmg / (
float)
MaxHP;
4117 if (
EClass.
pc.
ai is
AI_PracticeDummy { IsRunning: not
false } aI_PracticeDummy && aI_PracticeDummy.target ==
this && (origin ==
null || origin.IsPC))
4119 aI_PracticeDummy.hit++;
4120 aI_PracticeDummy.totalDamage += dmg;
4177 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
4179 EClass.player.invlunerable =
true;
4219 text =
"dead_" + e.
source.alias;
4223 text =
"dead_attack";
4231 text =
"kill_" + e.source.alias;
4235 text =
"kill_attack";
4237 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4245 Say(
"reboot",
this);
4252 if (HasCondition<ConRebirth>())
4254 Say(
"rebirth",
this);
4266 Msg.alwaysVisible =
true;
4267 Msg.
Say(
"layhand", chara3,
this);
4268 Msg.
Say(
"pray_heal",
this);
4278 if (zoneInstanceBout !=
null)
4303 Die(e, origin, attackSource);
4309 string text2 =
new int[18]
4311 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4312 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4313 }.RandomItem().ToString();
4316 text2 =
"casino_coin";
4320 text2 =
"scratchcard";
4348 if (origin !=
null && origin.isChara)
4370 if (origin.GetInt(106) == 0)
4372 origin.Chara.TalkTopic(
"kill");
4379 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num7 + (
IsPC ?
"pc" :
""), origin,
this);
4383 int num10 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4388 Say(
"dmg_" + e.source.alias,
this);
4392 Say(
"dmg" + num7,
this);
4406 if (origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4410 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4417 if (
id ==
"hedgehog_ether")
4421 Say(
"reflect_thorne",
this, origin);
4427 Say(
"reflect_acid",
this, origin);
4440 int a3 = (int)(100L * (
long)(dmg * 100 /
MaxHP) / 100) + 1;
4451 int num11 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4465 if (Chance(30 + eleP / 5, 100))
4473 if (Chance(30 + eleP / 10, 100))
4478 else if (Chance(50 + eleP / 10, 100))
4484 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
4490 if (Chance(30 + eleP / 5, 100))
4496 if (Chance(30 + eleP / 5, 100))
4503 if (Chance(30 + eleP / 5, 100))
4512 if (Chance(30 + eleP / 5, 100))
4517 else if (Chance(30 + eleP / 5, 100))
4523 if (Chance(50 + eleP / 10, 100))
4531 if (Chance(30 + eleP / 5, 100))
4550 if (Chance(5 + eleP / 25, 40))
4554 if (Chance(5 + eleP / 25, 40))
4558 if (Chance(5 + eleP / 25, 40))
4562 if (Chance(5 + eleP / 25, 40))
4566 if (Chance(5 + eleP / 25, 40))
4570 if (Chance(5 + eleP / 25, 40))
4574 if (Chance(30 + eleP / 10, 100))
4580 if (Chance(50 + eleP / 10, 100))
4586 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
4597 Condition.ignoreEffect =
true;
4599 Condition.ignoreEffect =
false;
4607 float num12 = (float)
hp / (
float)
MaxHP;
4614 PlaySound(
"heartbeat", 1f - num12 * 2f);
4644 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
4655 bool Chance(
int a,
int max)
4657 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4659 return Mathf.Min(a, max) >
EClass.
rnd(100);
4668 Chara.mana.value = 0;
4681 if (origin !=
null && origin.isChara &&
isChara && (
weapon ==
null || !
weapon.HasElement(486)))
4683 int valueOrDefault = (origin.Evalue(662) +
weapon?.Evalue(662, ignoreGlobalElement:
true)).GetValueOrDefault();
4684 int valueOrDefault2 = (origin.Evalue(661) +
weapon?.Evalue(661, ignoreGlobalElement:
true)).GetValueOrDefault();
4687 int num13 =
EClass.
rnd(3 + Mathf.Clamp(dmg / 100, 0, valueOrDefault / 10));
4688 origin.Chara.stamina.Mod(num13);
4694 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
4696 int num14 =
EClass.
rndHalf(2 + Mathf.Clamp(dmg / 10, 0, origin.Chara.GetPietyValue() + 10));
4697 origin.Chara.mana.Mod(num14);
4703 if (valueOrDefault2 > 0 && attackSource ==
AttackSource.Melee)
4705 int num15 =
EClass.
rnd(2 + Mathf.Clamp(dmg / 10, 0, valueOrDefault2 + 10));
4706 origin.Chara.mana.Mod(num15);
4718 Card rootCard = GetRootCard();
4720 if (_pos !=
null && !_pos.
IsValid)
4731 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
4732 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
4734 text += e.source.alias;
4738 Msg.
Say(text,
this, rootCard);
4743 Msg.
Say(
"destroyed",
this);
4748 things.ForeachReverse(delegate(
Thing t)
4757 if (e !=
null && _pos !=
null && e.id == 21)
4763 Explode(pos, origin);
4771 origin = origin?.Chara,
4773 aliasEle =
"eleImpact"
4779 PlaySound(
material.GetSoundDead(sourceCard));
4787 Debug.Log(Name +
" is already destroyed.");
4798 Chara.isDead =
true;
4816 for (
int num = things.Count - 1; num >= 0; num--)
4818 things[num].Destroy();
4825 if (!isChara || IsPCFactionMinion || (isCopy &&
EClass.
rnd(10) != 0))
4831 List<Card> list =
new List<Card>();
4833 if (!IsPCFaction && !isUserZone && sourceCard.
idActor.IsEmpty())
4836 if (this.rarity >=
Rarity.Legendary)
4869 else if (origin !=
null && origin.
HasElement(290) && !IsMinion)
4881 if (
id ==
"littleOne" && IsPCFactionOrMinion)
4885 if (flag2 && !isUserZone)
4888 bool num2 = text ==
"_meat";
4900 text =
"meat_marble";
4903 if (thing3.
source._origin ==
"meat")
4917 if (!IsPCFaction && !isUserZone)
4919 foreach (
string item2
in sourceCard.
loot.Concat(
Chara.
race.loot).ToList())
4921 string[] array = item2.
Split(
'/');
4922 int num4 = array[1].ToInt();
4961 if (!isBackerContent && !flag)
4991 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.rarity >=
Rarity.Legendary) ? 1 : 0));
5001 if (text2 ==
"big_daddy" || text2 ==
"santa")
5009 List<Thing> list2 =
new List<Thing>();
5010 foreach (
Thing thing4
in things)
5036 if (num5 > 0 && list2.Count > 0)
5039 for (
int j = 0; j < list2.Count && j < num5; j++)
5045 if (this.rarity >=
Rarity.Legendary && !IsUnique && c_bossType !=
BossType.Evolved)
5048 foreach (
Card item3
in list)
5057 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
5062 for (
int k = 0; k < num5; k++)
5085 foreach (
Thing thing5
in things)
5087 if (thing5.
GetInt(116) != 0)
5092 Point nearestPoint = GetRootCard().pos;
5097 foreach (
Card item4
in list)
5103 item4.isHidden =
false;
5160 case "egg_fertilized":
5164 string text =
"c_wilds";
5165 if (
id ==
"_meat" ||
id ==
"meat_marble")
5169 for (
int i = 0; i < 20; i++)
5172 if (cardRow.
model.
Chara.
race.corpse[0] !=
"_meat" &&
id !=
"milk" &&
id !=
"_egg" &&
id !=
"egg_fertilized")
5178 if (c_idRefCard.IsEmpty())
5180 MakeRefFrom(cardRow.
model);
5185 MakeFoodFrom(cardRow.
model);
5192 return this as
Thing;
5209 int num = race.
food[0].ToInt();
5210 bool flag =
id ==
"meat_marble";
5212 bool flag2 = category.
IsChildOf(
"meat");
5224 elements.
SetBase(70, race.
STR * race.
STR / 5 * num / 100 - 10 + num / 10);
5227 elements.
SetBase(440, race.
END * race.
END / 5 * num / 100 - 10 + num / 10);
5229 elements.
SetBase(71, (
int)Mathf.Clamp((
float)(num / 10) + Mathf.Sqrt(race.
height) - 10f, 1f, 60f));
5233 elements.
SetBase(444, race.
LER * race.
LER / 5 * num / 100 - 10 + num / 10);
5251 foreach (
Element value
in c.elements.dict.Values)
5253 if ((!flag3 || value.
id != 1229) && (value.
source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
5258 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
5259 foreach (KeyValuePair<int, int>
item in race.elementMap)
5263 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
5266 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5267 for (
int i = 0; i < num2 && i < list.Count; i++)
5269 Tuple<int, int> tuple = list[i];
5270 elements.
SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5276 isWeightChanged =
true;
5277 c_weight = race.height * 4 + 100;
5278 c_idMainElement = c.c_idMainElement;
5280 int num3 = c.LV - c.sourceCard.LV;
5286 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
5290 if (flag2 && c.IsPCFaction && c.IsUnique)
5305 if (IsIgnoreName(
card))
5309 if (IsIgnoreName(card2))
5313 if (
card ==
null && card2 !=
null)
5320 MakeRefFrom(
card, card2);
5321 if (
card.c_idRefCard !=
null)
5323 c_idRefCard =
card.c_idRefCard;
5324 c_altName = TryGetFoodName(
card);
5329 c_altName2 = TryGetFoodName(card2);
5332 static bool IsIgnoreName(
Card c)
5362 if (!row.aka.IsEmpty())
5364 if (row.name ==
"*r" && row.aka ==
"*r")
5366 return "corpseGeneral".lang();
5368 if (row.name ==
"*r")
5370 return row.GetText(
"aka");
5373 return row.GetName();
5378 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
5393 c_idRefCard = c1.
id;
5397 c_idRefCard2 = c2.id;
5398 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName(
NameStyle.Ref, (!c2.isChara) ? 1 : 0));
5400 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.
c_extraNameRef);
5407 thing.c_idMainElement = c_idMainElement;
5416 return GiveBirth(thing, effect);
5427 int num2 = LV - sourceCard.
LV;
5440 return GiveBirth(thing, effect);
5446 EClass.player.forceTalk =
true;
5447 card.Talk(
"giveBirth");
5451 card.pos.PlayEffect(
"revive");
5452 card.pos.PlaySound(
"egg");
5509 SayNothingHappans();
5512 PlayEffect(
"teleport");
5515 Say(
"antiTeleport",
this);
5516 PlaySound(
"gravity");
5521 PlaySound(
"teleport");
5522 Say(
"teleported",
this);
5531 if (chara.
enemy ==
this)
5542 EClass.player.haltMove =
true;
5544 PlayEffect(
"teleport", useRenderPos:
false);
5551 PlayEffect(
"ripple");
5552 PlaySound(
"Footstep/water");
5568 return elements.
Value(ele) >= req;
5583 if (HasElement(759))
5587 if (HasElement(703))
5605 for (
int i = 0; i < a; i++)
5616 shared.color = 11010048f;
5617 shared.liquidLv = 0;
5619 SetRenderParam(shared);
5639 isDyed = mat !=
null;
5640 c_dyeMat = mat?.id ?? 0;
5652 else if (isElemental)
5688 int num = EClass.game.seed + refVal;
5689 num +=
id[0] % 10000;
5692 num +=
id[1] % 1000;
5695 num +=
id[2] % 1000;
5698 num +=
id[3] % 1000;
5701 num +=
id[4] % 1000;
5710 return ref _randColor;
5727 public void SetImage(Image image,
int dir,
int idSkin = 0)
5729 sourceRenderCard.
SetImage(image, GetSprite(dir), colorInt, setNativeSize:
true, dir, idSkin,
this);
5740 sourceRenderCard.
SetImage(image, GetSprite(), colorInt, setNativeSize:
true, 0, 0,
this);
5744 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
5746 if ((!isChara ||
Chara.
host ==
null) && !(_emo == lastEmo && skipSame))
5750 renderer.
ShowEmo(_emo, duration);
5758 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
5763 PlaySound(
material.GetSoundDrop(sourceCard), 1f, spatial);
5768 PlaySound(
material.GetSoundImpact(sourceCard), 1f, spatial);
5773 PlaySound(
material.GetSoundDead(sourceCard), 1f, spatial);
5776 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
5778 Card rootCard = GetRootCard();
5785 return rootCard.
pos.
PlaySound(
id, isSynced || !spatial, v, spatial);
5810 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
5816 Card rootCard = GetRootCard();
5820 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
5828 Card rootCard = GetRootCard();
5851 public virtual void Rotate(
bool reverse =
false)
5854 if (sourceCard.
tiles.Length > 4)
5856 num = sourceCard.
tiles.Length;
5914 fx = fx - vector.x + thingPosition.x;
5915 fy = fy - vector.y + thingPosition.y;
5919 float num2 = (fy = 0f);
5943 renderParam.x = v.x;
5944 renderParam.y = v.y;
5945 renderParam.z = v.z;
5947 v.x = renderParam.
x;
5948 v.y = renderParam.
y;
5949 v.z = renderParam.
z;
5963 v.z += thingPosition.z;
5970 if (useCurrentPosition)
5985 renderer.
Draw(renderParam, ref v, drawShadow:
false);
5996 EClass.player.lightRadius = 1;
6004 return GetLightRadius() > 0;
6012 return 0.01f * LightData.color.a * 256f * 1.12f;
6014 if (IsPCFaction && !IsPC)
6075 num2 = traitLightSource.LightRadius;
6080 if (lightRadius > 0)
6082 if (lightRadius > num2)
6102 int radius = GetLightRadius();
6107 float power = GetLightPower();
6134 fov.
Perform(pos.
x, pos.
z, radius, power * 2f);
6145 int num = (trait.UseLightColor ? c_lightColor : 0);
6148 fov.r = (byte)(num / 1024);
6149 fov.g = (byte)(num % 1024 / 32);
6150 fov.b = (byte)(num % 32);
6191 if (fov !=
null && fov.
lastPoints.Count != 0)
6210 things.ForeachReverse(delegate(
Thing t)
6214 if (sourceCard.
_origin ==
"dish")
6222 else if (!isChara && trait.
Decay != 0)
6224 Decay(trait.
Decay * hour);
6242 int num2 = MaxDecay / 4 * 3;
6247 num =
card.trait.DecaySpeedChild;
6249 num = num * trait.DecaySpeed / 100;
6250 int num3 = Evalue(405);
6253 num = num * (100 - num3 * 2) / 100;
6265 if (decay + a > MaxDecay)
6267 if (
card !=
null && !
card.trait.OnChildDecay(
this, !IsDecayed))
6276 card.AddCard(thing);
6277 if (!IsParentLocked())
6279 GetRootCard().Say(
"seed_rot", GetRootCard(),
this, thing.
Name);
6288 else if (GetRootCard() ==
EClass.
pc)
6290 if (!IsParentLocked())
6302 else if (decay < num2 && decay + a >= num2 && GetRootCard() ==
EClass.
pc)
6304 if (!IsParentLocked())
6311 bool IsParentLocked()
6313 if (parent is
Thing)
6315 return (parent as
Thing).c_lockLv > 0;
6323 return !
MOD.
listTalk.
GetTalk(c_idTalk.IsEmpty(
id), idTopic, useDefault:
true).IsEmpty();
6326 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6330 EClass.player.forceTalk =
false;
6334 EClass.player.forceTalk =
false;
6335 if (!isSynced && !forceSync)
6340 GameLang.refDrama1 = ref1;
6341 GameLang.refDrama2 = ref2;
6342 string text = GetTalkText(idTopic, stripPun:
true);
6343 if (HasElement(1232) && idTopic !=
"baby")
6350 if (!(text2 ==
"adv_gaki"))
6352 if (text2 ==
"corgon")
6362 TalkRaw(text, ref1, ref2, forceSync);
6365 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
6367 if ((!isSynced && !forceSync) || text.IsEmpty())
6374 text = text.Replace(
"#1", ref1);
6378 text = text.Replace(
"#2", ref2);
6380 HostRenderer.Say(ApplyNewLine(text));
6381 bool flag = text.StartsWith(
"*");
6385 text = text.Bracket();
6387 Msg.
Say(text.Replace(
"&",
""));
6392 if (text.Contains(
"&"))
6394 string text2 =
"_comma".lang();
6395 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
6396 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
6397 text = text.Replace(
"&", Environment.NewLine ??
"");
6402 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
6404 if (isSynced && !text.IsEmpty())
6408 text = text.Replace(
"#1", ref1);
6412 text = text.Replace(
"#2", ref2);
6414 HostRenderer.Say(text);
6420 Say(
"nothingHappens");
6423 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
6432 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
6441 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
6450 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
6454 if (!text.IsEmpty())
6456 text = text.Split(
'|').RandomItem();
6457 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
6459 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
6461 text =
"(" + text +
")";
6463 text = text.Replace(
"。)",
")");
6466 return ApplyTone(text, stripPun);
6472 return ApplyTone(
Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
6475 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
6481 string[] array = _tones.IsEmpty(
"").Split(
'|');
6482 string key = array[0];
6487 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6491 if (array[0].IsEmpty())
6500 if (array.Length >= 2)
6502 stringBuilder.Replace(
"_toneI".lang(), array[1]);
6504 if (array.Length >= 3)
6506 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
6509 text2 = stringBuilder.ToString();
6513 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6524 return text2.StripLastPun();
6539 List<Dictionary<string, string>> list =
MOD.
tones.
list;
6540 if (list.Count != 0)
6542 int mtp = EClass.core.config.test.extraToneMTP
switch
6555 string text = list.RandomItem()[
"id"];
6556 text = list.RandomItemWeighted((Dictionary<string, string> a) => a[
"chance"].ToInt() * ((!a[
"tag"].Contains(
"meta")) ? 1 : mtp))[
"id"];
6563 return ListCraftBonusTraits().Count > 0;
6568 List<Element> list =
new List<Element>();
6569 string[] tag = sourceCard.
tag;
6570 for (
int i = 0; i < tag.Length; i++)
6572 string[] array = tag[i].Split(
'/');
6573 if (!(array[0] !=
"craft_bonus"))
6589 if (dest.
stack !=
null)
6593 Say(
"stack_thing", t, dest.
stack);
6601 ChangeRarity(
Rarity.Normal);
6607 c_idBacker = row.
id;
6613 chara.hostility = hostility2;
6619 Chara.idFaith = row.
deity.ToLower();
6624 if (
id ==
"putty_snow")
6637 if (c_idBacker == 164)
6650 c_textureData = GetPaintData();
6660 Sprite sprite = GetSprite();
6661 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
6662 int num = sprite.texture.width * 2;
6663 int num2 = sprite.texture.height * 2;
6664 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
6665 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
6666 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
6667 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
6668 texture2D2.SetPixels(pixels);
6670 byte[] result = texture2D2.EncodeToJPG();
6671 UnityEngine.Object.Destroy(texture2D);
6672 UnityEngine.Object.Destroy(texture2D2);
6678 if ((
bool)_paintSprite)
6680 UnityEngine.Object.Destroy(_paintSprite.texture);
6681 UnityEngine.Object.Destroy(_paintSprite);
6682 _paintSprite =
null;
6690 byte[] data = c_textureData;
6691 Texture2D texture2D =
new Texture2D(1, 1);
6692 texture2D.LoadImage(data);
6693 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
6697 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
6700 return _paintSprite;
6705 if (!(GetRestrainer() ==
null || force))
6709 isRestrained =
false;
6710 Say(
"unrestrained",
this);
6721 if (c_rescueState ==
RescueState.WaitingForRescue)
6735 c.DoHostileAction(
item, immediate:
true);
6762 result = row.value * mat.value / 100;
6799 int num = ((c_fixedValue == 0) ? trait.
GetValue() : c_fixedValue);
6800 if (
id ==
"plat" && !sell)
6811 num2 += (float)c_priceCopy * 0.2f;
6812 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
6816 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
6818 if (IsFood && !
material.tag.Contains(
"food"))
6823 if (IsEquipmentOrRangedOrAmmo || trait is
TraitMod)
6841 if (IsEquipmentOrRanged && rarity >=
Rarity.Legendary)
6843 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
6845 num2 = num2 * (100f + num3 * (float)(
material.value - 100)) / 100f;
6846 if (IsEquipmentOrRanged)
6851 num4 += value.
source.value;
6853 num2 = num2 * (float)(100 + (sell ? ((
int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
6854 if (rarity >=
Rarity.Legendary)
6856 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
6864 if (encLV != 0 && !category.
tag.Contains(
"noEnc"))
6866 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)))));
6870 num2 *= (float)(tier + 1);
6877 if (priceType ==
PriceType.CopyShop && sell)
6883 if (
id ==
"littleball")
6892 if (!(text ==
"plat"))
6894 if (!(text ==
"whip_egg"))
6905 if (!(text ==
"lucky_coin"))
6907 if (!(text ==
"book_skill"))
6926 case "diary_sister":
6930 case "diary_catsister":
6932 case "container_magic":
6934 case "wrench_tent_elec":
6936 case "wrench_tent_soil":
6940 case "wrench_storage":
6942 case "wrench_fridge":
6944 case "wrench_extend_v":
6946 case "wrench_extend_h":
6958 if (!sell &&
id ==
"casino_coin")
6962 int value = GetValue(priceType, sell);
6972 Trait trait = this.trait;
6977 p *= 1f + 4f * (float)(things.
width - traitContainer.Width) + 4f * (float)(things.
height - traitContainer.Height);
6982 p *= 1f + 0.5f * (float)c_containerSize;
6985 if (c_priceFix != 0)
6987 p = (int)((
float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
6997 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
7008 if (!sell && category.
id ==
"spellbook")
7012 bool flag = priceType ==
PriceType.CopyShop;
7013 int num = ((!flag) ? 1 : 5);
7014 float num2 = Mathf.Min(0.01f * (
float)Evalue(752), 1f);
7015 float num3 = Mathf.Min(0.01f * (
float)Evalue(751), 1f);
7016 float num4 = Mathf.Min(0.02f * (
float)Evalue(759), 2f);
7021 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7023 p *= 0.20000000298023224;
7026 p *= 0.20000000298023224;
7029 p *= 0.20000000298023224;
7035 if ((uint)(priceType - 1) <= 1u)
7047 if (
id ==
"rod_wish")
7049 p *= (sell ? 0.01f : 50f);
7064 p *= 0.20000000298023224;
7068 p *= 0.10000000149011612;
7071 p *= 0.0020000000949949026;
7074 p *= 0.00019999999494757503;
7077 p *= 0.004999999888241291;
7088 p *= (flag ? 1.25f : 0.3f);
7092 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)c_charges, 0f, 1.5f));
7096 p *= (flag ? 0.9f : 0.5f);
7108 p *= 1f + 0.2f * (float)c.Evalue(1406);
7121 p *= 1.100000023841858;
7155 else if (category.
IsChildOf(
"furniture"))
7175 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
7182 p = ((!sell) ? 1 : 0);
7190 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
7192 else if (p > 10000.0)
7194 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
7196 else if (p > 1000.0)
7198 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
7202 p = Mathf.CeilToInt((
float)p / 100f) * 100;
7206 p = Mathf.CeilToInt((
float)p / 10f) * 10;
7214 if (p > (
double)(sell ? 500000000 : 1000000000))
7227 return Name + GetExtraName();
7244 ForeachPoint(delegate(
Point p,
bool main)
7246 int num2 = DistMulti(p, c);
7254 return DistMulti(pos, c);
7286 isCensored = enable;
7296 if (isDeconstructing != deconstruct)
7306 isDeconstructing = deconstruct;
7320 sortVal = ((c_equippedSlot == 0) ? (category.
sortVal * 1000) : 0);
7323 sortVal = -GetPrice(
currency) * 1000;
7326 sortVal = -Num * 1000;
7329 sortVal = category.sortVal * 1000;
7332 sortVal = -ChildrenAndSelfWeight * 1000;
7335 sortVal = -ChildrenAndSelfWeightSingle * 1000;
7338 sortVal = -GetPrice(
currency) * 1000;
7341 sortVal = sourceCard._index * 1000;
7351 num =
id.CompareTo(c.
id);
7371 num = encLV - c.
encLV;
7390 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
7408 action(pos, arg2:
true);
7422 SE.Play(
"pop_paper");
7447 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
7460 if (!HaveFur() || c_fur < 0)
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
virtual bool CancelWhenDamaged
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 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 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)
void SetTier(int a, bool setTraits=true)
void ModExp(int ele, int a)
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
bool CanAddRune(SourceElement.Row row)
void PurgeDuplicateArtifact(Thing af)
void RemoveEditorTag(EditorTag tag)
void ApplySocket(int id, int lv, Card mod=null)
SocketData AddRune(Card rune)
void MakeRefFrom(string id)
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)
Thing AddThing(Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
void PlaySoundHold(bool spatial=true)
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)
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)
bool IsExcludeFromCraft()
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)
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
void DamageHP(int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null)
SourceMaterial.Row _material
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
Thing GiveBirth(Thing t, bool effect)
virtual Sprite GetImageSprite()
void MakeRefFrom(Card c1, Card c2=null)
virtual void ApplyMaterial(bool remove=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)
SocketData AddRune(int idEle, int v)
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)
Thing TryMakeRandomItem(int lv=-1)
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
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)
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)
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)
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
void CopyTo(ElementContainer container)
int ValueWithoutLink(int ele)
void ModExp(int ele, int a, bool chain=false)
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)
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
ref Vector3 PositionCenter()
Effect PlayEffect(string id)
void RefreshNeighborTiles()
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
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
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 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)