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;
979 SetInt(103, value ? 1 : 0);
991 SetInt(109, value ? 1 : 0);
1003 SetInt(63, value ? 1 : 0);
1015 SetInt(64, value ? 1 : 0);
1027 SetInt(120, value ? 1 : 0);
1039 SetInt(121, value ? 1 : 0);
1051 SetInt(122, value ? 1 : 0);
1676 return GetObj<UniqueData>(6);
1688 return GetObj<Thing>(9);
1700 return GetObj<List<SocketData>>(17);
1712 return GetObj<Thing>(10);
1736 return GetObj<CharaUpgrade>(11);
1748 return GetObj<CharaGenes>(15);
1760 return GetObj<List<int>>(16);
1784 return GetObj<DNA>(14);
1796 return GetObj<CharaList>(13);
1808 return GetObj<byte[]>(4);
1907 if (_childrenWeight < 0 || _childrenWeight > 10000000)
1995 if (
Tiles.Length == 1)
1997 return dir % 2 == 1;
2165 return EClass.player.fame / 100 + 1;
2175 if (
Tiles.Length < 3)
2249 return bio.gender == 2;
2406 if (windowSaveData !=
null)
2418 EClass.player.wasDirtyWeight =
true;
2436 public int Evalue(
int ele,
bool ignoreGlobalElement)
2462 return c_editorTags?.Contains(tag.ToString()) ??
false;
2495 int num2 =
item.Value;
2557 thing.parent =
this;
2574 public void Create(
string _id,
int _idMat = -1,
int genLv = -1)
2579 CardBlueprint.current =
null;
2628 if (
id ==
"microchip")
2709 EClass._zone.Boss =
Chara;
2749 int num = elementContainer.Value(value.
id);
2777 a = a * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
2781 a = a * (100 +
Evalue(1237) * 30) / 100;
2804 Say(
"dingExp",
this);
2817 int num = Mathf.Min(1 +
LV / 5, 22);
2818 for (
int i = 0; i < num; i++)
2820 if (
Evalue(1644) < i + 1)
2860 if (rootCard !=
null && rootCard.
IsPC)
2915 Debug.LogWarning(
"already child:" + t);
2920 Debug.Log(
"already in the list" + t);
2935 t.ignoreAutoPick =
false;
2979 if (rootCard !=
null && rootCard.
IsPC)
2988 t.isNPCProperty =
false;
3002 Msg.
Say((count == 1) ?
"newIng" :
"newIngs", count.ToString() ??
"");
3005 void TryAdd(
Thing a)
3007 if (!ings.Contains(a.
id))
3025 List<Chara> list =
new List<Chara>();
3039 if (!
item.IsPCFactionOrMinion)
3043 List<Thing> list2 =
item.things.List((
Thing t) => t.
id == af.id && t != af);
3044 if (list2.Count == 0)
3048 foreach (
Thing item2
in list2)
3058 for (
int num =
things.Count - 1; num >= 0; num--)
3075 instance.selectedButton.card =
null;
3078 ActionMode.AdvOrRegion.updatePlans =
true;
3096 if (thing.
invY == 1)
3098 WidgetCurrentTool.dirty =
true;
3102 if (thing.
props !=
null)
3110 WidgetHotbar.dirtyCurrentItem =
true;
3111 thing.parent =
null;
3116 if (
item.invs[0].owner.Container.GetRootCard() !=
EClass.
pc &&
item.floatInv)
3123 thing.parent =
null;
3132 return EClass.ui.layers.Count > 0;
3154 to.c_isImportant =
true;
3179 return card.GetRootCard();
3206 thing.encLV =
encLV;
3207 thing.decay =
decay;
3210 foreach (KeyValuePair<int, int>
item in mapInt)
3214 foreach (KeyValuePair<int, string> item2
in mapStr)
3216 thing.
mapStr[item2.Key] = item2.Value;
3222 thing.sockets = IO.DeepCopy(
sockets);
3238 ModNum(-a, notify:
false);
3250 return this as
Thing;
3253 return this as
Thing;
3259 return this as
Thing;
3262 public void ModNum(
int a,
bool notify =
true)
3301 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3307 for (
int i = 0; i <
sockets.Count; i++)
3325 for (
int i = 0; i <
sockets.Count; i++)
3331 int ele = num / 100;
3332 int num2 = num % 100;
3361 type = SocketData.Type.Rune
3421 if (row.category ==
"resist")
3425 if (
item.source.category ==
"resist" && (
item.vBase != 0 ||
item.vSource != 0))
3456 if (this.placeState == newState)
3462 Debug.Log(
"tried to change placestate of non-root card:" +
this);
3474 float num2 = (
fy = 0f);
3485 this.placeState = newState;
3493 this.placeState = newState;
3544 num = num * (100 +
Quality) / 100;
3602 public bool TryPay(
int a,
string id =
"money")
3609 Msg.
Say((
id ==
"ration") ?
"notEnoughFood" :
"notEnoughMoney");
3613 if (
IsPC && !(
id ==
"ration"))
3633 Say(
"spellbookCrumble",
this);
3642 if (
id ==
"influence")
3654 if (
id ==
"influence")
3684 a = a * Mathf.Max(100 -
Evalue(93), 1) / 100;
3714 int num =
PV + orCreateElement.Value +
DEX / 10;
3721 num2 = num3 / 10 + 1;
3722 sides = num3 / num2 + 1;
3724 dmg = dmg * 100 / (100 + num);
3726 int num4 =
Dice.
Roll(num2, sides, bonus,
this);
3727 dmg -= num4 * mod / 100;
3737 DamageHP(dmg, 0, 0, attackSource, origin);
3747 if (ele == 0 || ele == 926)
3752 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
3758 if (attackSource !=
AttackSource.Condition && showEffect)
3769 dmg = dmg * 100 / (100 + Mathf.Clamp(
Evalue(961) * 5, -50, 200));
3770 dmg = dmg * Mathf.Max(100 -
Evalue(93), 10) / 100;
3777 if (chara2 !=
null && chara2.
isWet)
3786 if (chara !=
null && chara.
isWet)
3788 dmg = dmg * 150 / 100;
3794 if (origin !=
null && origin.isChara && origin.Chara.HasCondition<
ConSupress>())
3802 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(
LV - 50) * 2.5f)) / 100;
3804 dmg = dmg * Mathf.Max(0, 100 -
Evalue((e ==
Element.
Void || e.
id == 926) ? 55 : 56)) / 100;
3811 dmg = dmg * 90 / 100;
3815 dmg = dmg * 100 / Mathf.Clamp(100 +
Evalue(971), 25, 1000);
3819 dmg = dmg * 90 / 100;
3838 dmg = dmg * 100 / Mathf.Min(100 + num * 5, 120);
3842 dmg = dmg * Mathf.Min(100 + num2 * 5, 120) / 100;
3847 dmg = dmg * 100 / Mathf.Clamp(105 +
EClass.
pc.
Evalue(135) / 10, 10, 110);
3851 dmg = dmg * (1000 -
Evalue(1218)) / 1000;
3859 int num3 =
MaxHP / 10;
3860 int num4 = dmg - num3;
3861 num4 = num4 * 100 / (200 +
Evalue(68) * 10);
3873 int num5 = Mathf.Clamp(dmg * 6 /
MaxHP, 0, 4) + ((dmg > 0) ? 1 : 0);
3883 if (hp < 0 && Chara.mana.value >= 0)
3899 Chara.mana.value -= dmg;
3916 float ratio = (float)dmg / (
float)
MaxHP;
3928 float num14 = (c2.r + c2.g + c2.b) / 3f;
3929 num14 = ((num14 > 0.5f) ? 0f : (0.6f - num14));
3930 c2 =
new Color(c2.r + num14, c2.g + num14, c2.b + num14, 1f);
3932 popper.
SetText(dmg.ToString() ??
"", c2);
3989 Msg.
Say(
IsPC ?
"abort_damage" :
"abort_damgeAlly");
3991 EClass.player.invlunerable =
true;
4027 text =
"dead_" + e.
source.alias;
4031 text =
"dead_attack";
4039 text =
"kill_" + e.
source.alias;
4043 text =
"kill_attack";
4045 (
IsPC ? EClass.pc : origin).
Say(text, origin,
this);
4053 Say(
"reboot",
this);
4064 Msg.alwaysVisible =
true;
4065 Msg.
Say(
"layhand", chara3,
this);
4066 Msg.
Say(
"pray_heal",
this);
4076 if (zoneInstanceBout !=
null)
4102 Die(e, origin, attackSource);
4107 if (conStrife !=
null &&
isChara)
4113 if (origin !=
null && origin.isChara)
4135 if (origin.GetInt(106) == 0)
4137 origin.Chara.TalkTopic(
"kill");
4144 (
IsPC ? EClass.pc : origin).
Say(
"dmgMelee" + num5 + (
IsPC ?
"pc" :
""), origin,
this);
4148 int num8 = ((attackSource != AttackSource.Condition && attackSource !=
AttackSource.WeaponEnchant) ? 1 : 2);
4157 Say(
"dmg" + num5,
this);
4161 if (
isChara && origin !=
null && origin.IsAliveInCurrentZone && origin.isChara)
4165 origin.HealHP(Mathf.Clamp(
EClass.
rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 +
EClass.
rnd(10)));
4172 if (
id ==
"hedgehog_ether")
4176 Say(
"reflect_thorne",
this, origin);
4182 Say(
"reflect_acid",
this, origin);
4194 int a3 = 100 * (dmg * 100 /
MaxHP) / 100;
4202 int num9 = ((
EClass.
rnd(2) == 0) ? 1 : 0);
4216 if (Chance(30 + eleP / 5, 100))
4224 if (Chance(30 + eleP / 10, 100))
4229 else if (Chance(50 + eleP / 10, 100))
4235 if (Chance(75 + eleP / 20, 100) &&
EClass.
rnd(3) == 0)
4241 if (Chance(30 + eleP / 5, 100))
4247 if (Chance(30 + eleP / 5, 100))
4254 if (Chance(30 + eleP / 5, 100))
4263 if (Chance(30 + eleP / 5, 100))
4268 else if (Chance(30 + eleP / 5, 100))
4274 if (Chance(50 + eleP / 10, 100))
4282 if (Chance(30 + eleP / 5, 100))
4301 if (Chance(5 + eleP / 25, 40))
4305 if (Chance(5 + eleP / 25, 40))
4309 if (Chance(5 + eleP / 25, 40))
4313 if (Chance(5 + eleP / 25, 40))
4317 if (Chance(5 + eleP / 25, 40))
4321 if (Chance(5 + eleP / 25, 40))
4325 if (Chance(30 + eleP / 10, 100))
4331 if (Chance(50 + eleP / 10, 100))
4337 if (Chance(50 + eleP / 10, 100) &&
EClass.
rnd(4) == 0)
4348 Condition.ignoreEffect =
true;
4350 Condition.ignoreEffect =
false;
4362 float num10 = (float)
hp / (
float)
MaxHP;
4369 PlaySound(
"heartbeat", 1f - num10 * 2f);
4399 if (origin !=
null && origin.isChara && attackSource !=
AttackSource.Finish)
4410 bool Chance(
int a,
int max)
4412 if (dmg > 0 || (origin !=
null && origin.HasElement(1345)))
4414 return Mathf.Min(a, max) >
EClass.
rnd(100);
4423 Chara.mana.value = 0;
4436 if (origin !=
null && origin.isChara &&
isChara)
4438 int valueOrDefault = (origin.Evalue(662) +
weapon?.Evalue(662, ignoreGlobalElement:
true)).GetValueOrDefault();
4439 int valueOrDefault2 = (origin.Evalue(661) +
weapon?.Evalue(661, ignoreGlobalElement:
true)).GetValueOrDefault();
4442 int num11 =
EClass.
rnd(3 + Mathf.Clamp(dmg / 100, 0, valueOrDefault / 10));
4443 origin.Chara.stamina.Mod(num11);
4449 if (origin.HasElement(1350) && attackSource ==
AttackSource.Melee)
4451 int num12 =
EClass.
rndHalf(2 + Mathf.Clamp(dmg / 10, 0, origin.Chara.GetPietyValue() + 10));
4452 origin.Chara.mana.Mod(num12);
4458 if (valueOrDefault2 > 0 && attackSource ==
AttackSource.Melee)
4460 int num13 =
EClass.
rnd(2 + Mathf.Clamp(dmg / 10, 0, valueOrDefault2 + 10));
4461 origin.Chara.mana.Mod(num13);
4475 if (_pos !=
null && !_pos.
IsValid)
4486 string text = ((rootCard !=
this) ?
"destroyed_inv_" :
"destroyed_ground_");
4487 if (e !=
null &&
LangGame.
Has(text + e.source.alias))
4489 text += e.source.alias;
4493 Msg.
Say(text,
this, rootCard);
4498 Msg.
Say(
"destroyed",
this);
4512 if (e !=
null && _pos !=
null && e.id == 21)
4526 origin = origin?.Chara,
4528 aliasEle =
"eleImpact"
4542 Debug.Log(
Name +
" is already destroyed.");
4553 Chara.isDead =
true;
4571 for (
int num =
things.Count - 1; num >= 0; num--)
4586 List<Card> list =
new List<Card>();
4636 if (flag2 && !isUserZone)
4639 bool num2 = text ==
"_meat";
4647 text =
"meat_marble";
4650 if (thing3.
source._origin ==
"meat")
4668 string[] array = item2.
Split(
'/');
4669 int num4 = array[1].ToInt();
4714 int num5 = ((EClass._zone.Boss ==
this) ? 2 : ((this.
rarity >=
Rarity.Legendary) ? 1 : 0));
4724 if (text2 ==
"big_daddy" || text2 ==
"santa")
4732 List<Thing> list2 =
new List<Thing>();
4759 if (num5 > 0 && list2.Count > 0)
4762 for (
int j = 0; j < list2.Count && j < num5; j++)
4771 foreach (
Card item3
in list)
4780 int num7 = ((!(EClass._zone is
Zone_Void)) ? 1 : 2);
4785 for (
int k = 0; k < num5; k++)
4810 if (thing5.
GetInt(116) != 0)
4820 foreach (
Card item4
in list)
4826 item4.isHidden =
false;
4883 case "egg_fertilized":
4887 string text =
"c_wilds";
4888 if (
id ==
"_meat" ||
id ==
"meat_marble")
4892 for (
int i = 0; i < 20; i++)
4895 if (cardRow.
model.
Chara.
race.corpse[0] !=
"_meat" &&
id !=
"milk" &&
id !=
"_egg" &&
id !=
"egg_fertilized")
4915 return this as
Thing;
4928 int num = race.
food[0].ToInt();
4929 bool flag =
id ==
"meat_marble";
4931 bool flag2 =
category.IsChildOf(
"meat");
4932 bool flag3 =
category.IsChildOf(
"egg");
4959 foreach (
Element value
in c.elements.dict.Values)
4961 if ((!flag3 || value.
id != 1229) && (value.
source.category ==
"food" || value.
source.tag.Contains(
"foodEnc") || value.
IsTrait))
4966 List<Tuple<int, int>> list =
new List<Tuple<int, int>>();
4967 foreach (KeyValuePair<int, int>
item in race.elementMap)
4971 list.Add(
new Tuple<int, int>(
item.Key,
item.Value));
4974 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
4975 for (
int i = 0; i < num2 && i < list.Count; i++)
4977 Tuple<int, int> tuple = list[i];
4988 int num3 = c.LV - c.sourceCard.LV;
4994 if (c.rarity >=
Rarity.Legendary || c.IsUnique)
4998 if (flag2 && c.IsPCFaction && c.IsUnique)
5013 if (IsIgnoreName(
card))
5017 if (IsIgnoreName(card2))
5021 if (
card ==
null && card2 !=
null)
5029 if (
card.c_idRefCard !=
null)
5040 static bool IsIgnoreName(
Card c)
5070 if (!row.aka.IsEmpty())
5072 if (row.name ==
"*r" && row.aka ==
"*r")
5074 return "corpseGeneral".lang();
5076 if (row.name ==
"*r")
5078 return row.GetText(
"aka");
5081 return row.GetName();
5086 return s.Replace(
"_corpseFrom".lang(),
"_corpseTo".lang());
5163 Say(
"antiTeleport",
this);
5170 Say(
"teleported",
this);
5179 if (chara.
enemy ==
this)
5190 EClass.player.haltMove =
true;
5240 for (
int i = 0; i < a; i++)
5251 shared.color = 11010048f;
5252 shared.liquidLv = 0;
5316 int num = EClass.game.seed +
refVal;
5317 num +=
id[0] % 10000;
5320 num +=
id[1] % 1000;
5323 num +=
id[2] % 1000;
5326 num +=
id[3] % 1000;
5329 num +=
id[4] % 1000;
5372 public void ShowEmo(
Emo _emo =
Emo.none,
float duration = 0f,
bool skipSame =
true)
5404 public SoundSource
PlaySound(
string id,
float v = 1f,
bool spatial =
true)
5438 public Effect PlayEffect(
string id,
bool useRenderPos =
true,
float range = 0f, Vector3 fix =
default(Vector3))
5448 public void PlayEffect(
int ele,
bool useRenderPos =
true,
float range = 0f)
5479 public virtual void Rotate(
bool reverse =
false)
5542 fx =
fx - vector.x + thingPosition.x;
5543 fy =
fy - vector.y + thingPosition.y;
5547 float num2 = (
fy = 0f);
5571 renderParam.x = v.x;
5572 renderParam.y = v.y;
5573 renderParam.z = v.z;
5575 v.x = renderParam.
x;
5576 v.y = renderParam.
y;
5577 v.z = renderParam.
z;
5591 v.z += thingPosition.z;
5598 if (useCurrentPosition)
5624 EClass.player.lightRadius = 1;
5640 return 0.01f * LightData.color.a * 256f * 1.12f;
5703 num2 = traitLightSource.LightRadius;
5708 if (lightRadius > 0)
5710 if (lightRadius > num2)
5776 fov.r = (byte)(num / 1024);
5777 fov.g = (byte)(num % 1024 / 32);
5778 fov.b = (byte)(num % 32);
5875 num =
card.trait.DecaySpeedChild;
5877 num = num * trait.DecaySpeed / 100;
5881 num = num * (100 - num3 * 2) / 100;
5904 card.AddCard(thing);
5905 if (!IsParentLocked())
5918 if (!IsParentLocked())
5932 if (!IsParentLocked())
5939 bool IsParentLocked()
5949 public void Talk(
string idTopic,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
5953 EClass.player.forceTalk =
false;
5957 EClass.player.forceTalk =
false;
5963 GameLang.refDrama1 = ref1;
5964 GameLang.refDrama2 = ref2;
5965 string text =
GetTalkText(idTopic, stripPun:
true);
5973 if (!(text2 ==
"adv_gaki"))
5975 if (text2 ==
"corgon")
5985 TalkRaw(text, ref1, ref2, forceSync);
5988 public void TalkRaw(
string text,
string ref1 =
null,
string ref2 =
null,
bool forceSync =
false)
5990 if ((!
isSynced && !forceSync) || text.IsEmpty())
5997 text = text.Replace(
"#1", ref1);
6001 text = text.Replace(
"#2", ref2);
6004 bool flag = text.StartsWith(
"*");
6008 text = text.Bracket();
6010 Msg.
Say(text.Replace(
"&",
""));
6015 if (text.Contains(
"&"))
6017 string text2 =
"_comma".lang();
6018 text = text.Replace(text2 +
" &", Environment.NewLine ??
"");
6019 text = text.Replace(text2 +
"&", Environment.NewLine ??
"");
6020 text = text.Replace(
"&", Environment.NewLine ??
"");
6025 public void SayRaw(
string text,
string ref1 =
null,
string ref2 =
null)
6031 text = text.Replace(
"#1", ref1);
6035 text = text.Replace(
"#2", ref2);
6043 Say(
"nothingHappens");
6046 public void Say(
string lang,
string ref1 =
null,
string ref2 =
null)
6055 public void Say(
string lang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
6064 public void Say(
string lang,
Card c1,
string ref1 =
null,
string ref2 =
null)
6073 public string GetTalkText(
string idTopic,
bool stripPun =
false,
bool useDefault =
true)
6077 if (!text.IsEmpty())
6079 text = text.Split(
'|').RandomItem();
6082 if (!text.StartsWith(
"(") && !text.StartsWith(
"*"))
6084 text =
"(" + text +
")";
6086 text = text.Replace(
"。)",
")");
6098 public static string ApplyTone(
Chara c, ref
string text,
string _tones,
int gender,
bool stripPun =
false)
6104 string[] array = _tones.IsEmpty(
"").Split(
'|');
6105 string key = array[0];
6110 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6114 if (array[0].IsEmpty())
6123 if (array.Length >= 2)
6125 stringBuilder.Replace(
"_toneI".lang(), array[1]);
6127 if (array.Length >= 3)
6129 stringBuilder.Replace(
"_toneYou".lang(), array[2]);
6132 text2 = stringBuilder.ToString();
6136 text2 = text.Replace(
"{",
"").Replace(
"}",
"");
6143 return text2.StripLastPun();
6158 List<Dictionary<string, string>> list =
MOD.
tones.
list;
6159 if (list.Count == 0)
6163 string text = list.RandomItem()[
"id"];
6164 for (
int i = 0; i < 10; i++)
6166 Dictionary<string, string> dictionary = list.RandomItem();
6167 if (
EClass.
rnd(100) <= dictionary[
"chance"].ToInt())
6169 text = dictionary[
"id"];
6183 if (dest.
stack !=
null)
6207 chara.hostility = hostility2;
6213 Chara.idFaith = row.
deity.ToLower();
6218 if (
id ==
"putty_snow")
6255 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
6256 int num = sprite.texture.width * 2;
6257 int num2 = sprite.texture.height * 2;
6258 int x = (int)Mathf.Clamp(Input.mousePosition.x - (
float)(num / 2), 1f, texture2D.width - num - 1);
6259 int y = (int)Mathf.Clamp(Input.mousePosition.y - (
float)(num2 / 2), 1f, texture2D.height - num2 - 1);
6260 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
6261 Texture2D texture2D2 =
new Texture2D(num, num2, TextureFormat.ARGB32, mipChain:
false);
6262 texture2D2.SetPixels(pixels);
6264 byte[] result = texture2D2.EncodeToJPG();
6265 UnityEngine.Object.Destroy(texture2D);
6266 UnityEngine.Object.Destroy(texture2D2);
6285 Texture2D texture2D =
new Texture2D(1, 1);
6286 texture2D.LoadImage(data);
6287 _paintSprite = Sprite.Create(texture2D,
new Rect(0f, 0f, texture2D.width, texture2D.height),
new Vector2(0.5f, 0.5f), 200f);
6291 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
6304 Say(
"unrestrained",
this);
6325 c.DoHostileAction(
item, immediate:
true);
6352 result = row.value * mat.value / 100;
6395 num = num * (float)Mathf.Max(100 +
rarityLv + Mathf.Min(
QualityLv * 10, 200), 80) / 100f;
6421 num = Mathf.Max(num, 1800f + num / 5f);
6423 num = num * (100f + num2 * (float)(
material.value - 100)) / 100f;
6429 num3 += value2.
source.value;
6431 num = num * (float)(100 + (sell ? ((
int)MathF.Sqrt(num3) * 10) : num3)) / 100f;
6434 num = Mathf.Max(num, 3600f + num / 5f);
6444 num = (
category.tag.Contains(
"enc") ? (num * (0.7f + (float)(
encLV - 1) * 0.2f)) : ((!
IsFood) ? (num * (1f + (
float)
encLV * 0.01f)) : ((!(
id ==
"honey")) ? (num * Mathf.Min(1f + 0.1f * (
float)
encLV, 2f) + (
float)(
encLV * 100)) : (num + (float)(
encLV * 10)))));
6453 if (
id ==
"littleball")
6460 if (
id ==
"lucky_coin")
6476 case "diary_sister":
6480 case "diary_catsister":
6482 case "container_magic":
6484 case "wrench_tent_elec":
6486 case "wrench_tent_soil":
6490 case "wrench_storage":
6492 case "wrench_fridge":
6494 case "wrench_extend_v":
6496 case "wrench_extend_h":
6508 if (!sell &&
id ==
"casino_coin")
6527 p *= 1f + 4f * (float)(
things.
width - traitContainer.Width) + 4f * (float)(
things.
height - traitContainer.Height);
6537 p = (int)((
float)p * (float)Mathf.Clamp(100 +
c_priceFix, 0, 1000000) / 100f);
6547 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(
EClass.
Branch.
Evalue(2824) * 5));
6558 if (!sell &&
category.id ==
"spellbook")
6562 int num = ((priceType !=
PriceType.CopyShop) ? 1 : 5);
6563 float num2 = Mathf.Min(0.01f * (
float)
Evalue(752), 1f);
6564 float num3 = Mathf.Min(0.01f * (
float)
Evalue(751), 1f);
6565 float num4 = Mathf.Min(0.02f * (
float)
Evalue(759), 2f);
6570 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
6572 p *= 0.20000000298023224;
6575 p *= 0.20000000298023224;
6580 if ((uint)(priceType - 1) <= 1u && (
category.IsChildOf(
"vegi") ||
category.IsChildOf(
"fruit")))
6585 if (
id ==
"rod_wish")
6587 p *= (sell ? 0.01f : 50f);
6602 p *= 0.20000000298023224;
6606 p *= 0.10000000149011612;
6609 p *= 0.0020000000949949026;
6612 p *= 0.00019999999494757503;
6615 p *= 0.004999999888241291;
6630 p *= 0.20000000298023224;
6634 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (
float)
c_charges, 0f, 1.5f));
6650 p *= 1f + 0.2f * (float)c.Evalue(1406);
6663 p *= 1.100000023841858;
6697 else if (
category.IsChildOf(
"furniture"))
6717 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
6724 p = ((!sell) ? 1 : 0);
6732 p = Mathf.CeilToInt((
float)p / 100000f) * 100000;
6734 else if (p > 10000.0)
6736 p = Mathf.CeilToInt((
float)p / 10000f) * 10000;
6738 else if (p > 1000.0)
6740 p = Mathf.CeilToInt((
float)p / 1000f) * 1000;
6744 p = Mathf.CeilToInt((
float)p / 100f) * 100;
6748 p = Mathf.CeilToInt((
float)p / 10f) * 10;
6756 if (p > (
double)(sell ? 500000000 : 1000000000))
6788 int num2 = DistMulti(p, c);
6796 return DistMulti(
pos, c);
6871 sortVal = category.sortVal * 1000;
6883 sortVal = sourceCard._index * 1000;
6893 num =
id.CompareTo(c.
id);
6932 foreach (KeyValuePair<int, byte> lastPoint
in fov.
lastPoints)
6950 action(
pos, arg2:
true);
6964 SE.Play(
"pop_paper");
6989 if (text ==
"putty_snow" || text ==
"putty_snow_gold")
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
virtual bool CancelWhenDamaged
override string ToString()
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)
void Say(string text, Color c=default(Color), float duration=0f)
override void Draw(RenderParam p)
virtual void SetOwner(Card c)
virtual void SetFirst(bool first, Vector3 pos)
void SetCensored(bool enable)
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)
void SetHidden(bool hide=true)
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
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)
int GetValue(bool sell=false)
virtual bool IsPCPartyMinion
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)
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()
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
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)
virtual void Rotate(bool reverse=false)
void SetFreePos(Point point)
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)
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()
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)
virtual bool HasCondition< T >()
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)
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)
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_Color elementColors
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)
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 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)
Popper Pop(Vector3 pos, string id, Sprite sprite)
Popper SetText(string s, Color c=default(Color))
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)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
SourceMaterial.Row DefaultMaterial
AnimationCurve fovCurveChara
float playerLightCustomMod
SceneGlobalProfile global
Dictionary< string, CardRow > map
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 LevelAsQuality
virtual int CompareTo(Card b)
virtual ThrowType ThrowType
virtual int InstallBottomPriority
void Install(bool byPlayer)
static void Reserve(string idStep, Action onBeforePlay=null)
bool TryGetValue(TKey key, out TValue value)
static Dictionary< string, SaveData > dictData
Card AddCard(Card t, Point point)
void OnChildNumChange(Card c)