2using System.Collections.Generic;
13 private static List<Hobby>
listHobby =
new List<Hobby>();
15 public static string[]
IDTimeTable =
new string[2] {
"default",
"owl" };
42 [JsonProperty(PropertyName =
"T1")]
45 [JsonProperty(PropertyName =
"T2")]
48 [JsonProperty(PropertyName =
"T3")]
51 [JsonProperty(PropertyName =
"T4")]
54 [JsonProperty(PropertyName =
"T5")]
57 [JsonProperty(PropertyName =
"T6")]
60 [JsonProperty(PropertyName =
"T7")]
63 [JsonProperty(PropertyName =
"1")]
66 [JsonProperty(PropertyName =
"2")]
69 [JsonProperty(PropertyName =
"3")]
72 [JsonProperty(PropertyName =
"4")]
75 [JsonProperty(PropertyName =
"8")]
76 public string[]
_strs =
new string[5];
78 [JsonProperty(PropertyName =
"9")]
171 private static List<Chara>
_pts =
new List<Chara>();
461 if (base.c_originalHostility == (
Hostility)0)
463 if (!
source.hostility.IsEmpty())
469 return base.c_originalHostility;
479 if (
source.idActor.Length <= 1)
509 return "CharaActorPCC";
521 if (base.dir != 1 && base.dir != 2)
537 return base.dir == 2;
551 return base.ExistsOnMap;
617 return base.c_uidMaster != 0;
693 public override int MaxHP => (int)Mathf.Clamp(((
long)(base.END * 2 + base.STR + base.WIL / 2) * (
long)Mathf.Min(base.LV, 25) / 25 + base.END + 10) *
Evalue(60) / 100 * ((
IsPCFaction ? 100 : (100 + (int)base.rarity * 300)) + (
IsPC ? (
EClass.
player.
lastEmptyAlly *
Evalue(1646)) : 0)) / 100, 1f, 100000000f);
699 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
705 if (base.c_idMainElement == 0)
713 public override int DV
724 num = 50 + (num - 50) / 10;
727 int WeaknessMod(
int a)
729 if (HasCondition<ConWeakness>())
742 public override int PV
753 num = 50 + (num - 50) / 10;
756 int WeaknessMod(
int a)
758 if (HasCondition<ConWeakness>())
797 if (!
IsGlobal && !base.isSubsetCard)
829 return race.id ==
"mutant";
843 return race.tag.Contains(
"humanSpeak");
855 return EClass.Branch.uidMaid == base.uid;
875 public bool IsEyth => faith.id ==
"eyth";
881 if (!
source.works.Contains(
"Rich"))
883 return source.hobbies.Contains(
"Rich");
897 if (base.c_genes !=
null)
899 return base.c_genes.GetGeneSlot(
this);
938 if (!h.
source.elements.IsEmpty())
940 for (
int i = 0; i < h.
source.elements.Length; i += 2)
942 int ele = h.
source.elements[i];
943 int v = h.
source.elements[i + 1];
973 if (base.rarity >=
Rarity.Legendary)
988 if (
host ==
null || includeRide)
992 return base.hp <
MaxHP / 5;
1007 return num > num2 + 0.1f;
1100 return p.cell.room.data.accessType
switch
1103 BaseArea.AccessType.Private =>
false,
1130 for (
int i = 0; i < slots.Count; i++)
1139 _cbits1.Bits = (uint)
_cints[0];
1150 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1159 if (
source.tag.Contains(
"boss"))
1176 string text = base.c_altName ??
source.GetName(
this);
1179 if (base.c_bossType ==
BossType.Evolved)
1181 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1184 if (text.Length > 0 &&
char.IsLower(text[0]))
1186 if (base.rarity >=
Rarity.Legendary)
1188 text = text.ToTitleCase();
1192 text = text.AddArticle();
1199 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1204 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1209 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1211 return text + text2;
1216 if (r != base.rarity)
1248 if (uniqueData !=
null)
1287 base.isSubsetCard =
false;
1289 base.c_uidMaster = 0;
1321 if (
source.tag.Contains(
"boss"))
1325 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1347 if (
source.idActor.Length > 2)
1356 if (
source.mainElement.Length != 0)
1358 int _genLv = Mathf.Min(genLv, 100);
1359 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1360 string[] mainElement =
source.mainElement;
1361 for (
int i = 0; i < mainElement.Length; i++)
1363 string[] array = mainElement[i].Split(
'/');
1365 int num2 = source.LV * row.eleP / 100;
1366 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1368 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1371 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1374 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1376 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1377 if (list.Count >= 2)
1379 num = tuple.Item3 + base.LV -
source.LV;
1384 base.c_altName = NameGen.getRandomName();
1388 _alias = AliasGen.GetRandomAlias();
1400 if (base.LV > 5 &&
race.id ==
"mutant")
1402 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1410 if (
race.EQ.Length != 0)
1437 case "olderyoungersister":
1440 case "sister_undead":
1444 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1459 if (!
source.faith.IsEmpty())
1521 base.isHidden =
false;
1524 if (
host !=
null && !calledRecursive)
1537 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1538 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1540 chara.SetFaith(
faith);
1541 chara.bio = IO.DeepCopy(
bio);
1543 chara.c_daysWithGod = base.c_daysWithGod;
1544 chara.RefreshFaithElement();
1545 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1546 chara.isCopy =
true;
1556 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1565 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1575 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1591 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1597 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1621 else if (
host !=
null)
1668 num -= (
IsPC ? 50 : 100);
1708 num += EClass.player.lastEmptyAlly *
Evalue(1646);
1713 num += EClass.player.lastEmptyAlly * 10 - 10;
1719 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
1720 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
1722 if (HasCondition<ConGravity>())
1725 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
1731 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
1742 if (value.
source.category ==
"skill")
1762 this.hostility = hostility2;
1768 this.hostility = hostility2;
1774 this.hostility = hostility2;
1789 base.ApplyEditorTags(tag);
1797 Debug.LogWarning(
"Chara " +
id +
" not found");
1806 if (!
id.StartsWith(
"ele"))
1815 if (base.c_idMainElement != 0)
1817 SetElements(base.c_idMainElement,
remove:
true);
1818 base.c_idMainElement = 0;
1823 SetElements(
id,
remove:
false);
1824 base.c_idMainElement =
id;
1827 base.isElemental =
true;
1830 base.c_lightColor = (byte)Mathf.Clamp(colorSprite.r * 3f, 1f, 31f) * 1024 + (byte)Mathf.Clamp(colorSprite.g * 3f, 1f, 31f) * 32 + (byte)Mathf.Clamp(colorSprite.b * 3f, 1f, 31f);
1834 void SetElements(
int idEle,
bool remove)
1894 base.c_idJob = idNew;
1922 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
1926 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
1947 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
1956 string[] array =
race.figure.Split(
'|');
1957 foreach (
string s
in array)
1970 string[] array =
race.figure.Split(
'|');
1971 foreach (
string s
in array)
1992 base.c_idRace = idNew;
2008 Debug.Log(
"Creating Replacement NPC for:" +
this);
2036 this.hostility = hostility2;
2038 base.c_summonDuration = 0;
2039 base.isSummon =
false;
2061 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2062 this.hostility = hostility2;
2063 base.c_uidMaster = _master.
uid;
2064 base.c_minionType = type;
2071 Debug.Log(
"released:" +
this);
2072 base.c_uidMaster = 0;
2077 if (chara.
enemy ==
this)
2089 base.c_summonDuration = duration;
2090 base.isSummon =
true;
2137 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2156 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2161 if (cells[x, z].blocked)
2165 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2172 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2177 if (cells[x, z].blocked)
2181 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2207 if (detail !=
null && detail.
charas.Count > 0)
2242 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2252 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2257 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2264 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2269 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2296 List<Point> list =
new List<Point>();
2344 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2353 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2362 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2371 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2389 int num = p.x -
pos.
x;
2390 int num2 = p.z -
pos.
z;
2407 if (num == 0 && num2 == 0)
2417 return TryMove(point, allowDestroyPath:
false);
2426 if (!condition.
TryMove(newPoint))
2431 if (base.isRestrained)
2437 base.isRestrained =
false;
2439 if (!
CanMoveTo(newPoint, allowDestroyPath))
2443 return _Move(newPoint);
2494 EClass.player.lastZonePos =
null;
2497 for (
int i = 0; i < num2 * 4; i++)
2508 EClass.player.regionMoveWarned =
true;
2509 Msg.
Say(
"regionAbortMove");
2518 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2525 ModExp(200, 8 + num4 * 12);
2528 EClass.player.regionMoveWarned =
false;
2536 num = EClass.setting.defaultActPace * 3f;
2551 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2553 newPoint = randomNeighbor;
2561 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2566 if (effect !=
null && effect.
id == 7)
2571 Say(
"abWeb_caught",
this);
2573 effect2.power = effect2.power * 3 / 4;
2577 Say(
"abWeb_pass",
this);
2586 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2601 traitDoor.TryOpenLock(
this);
2611 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2614 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2644 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2645 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2647 text = cell.
matObj.soundFoot;
2659 if (!text.IsEmpty())
2661 SoundManager.altLastData =
IsPC;
2668 bool flag5 = scene.actionMode.gameSpeed > 1f;
2669 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2670 scene.psFoot.startColor = row.
matColor;
2674 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
2698 Say(
"replace_pc", chara, chara2);
2709 traitDoor2.TryOpen(
this);
2736 if (!
item.isThing ||
item.placeState != 0 ||
item.ignoreAutoPick)
2748 if ((dataPick.
noRotten &&
item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
2765 foreach (
int cat
in dataPick.
cats)
2767 if (
item.category.uid == cat)
2773 else if (!dataPick.
flag.HasFlag(containerFlag))
2815 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
2847 EClass.player.flags.isShoesOff =
false;
2854 EClass.player.flags.isShoesOff =
true;
2872 EClass._map.MineBlock(_p, recoverBlock: false, this);
2875 EClass._map.MineObj(_p, null, this);
2881 EClass._map.MineObj(_p, null, this);
2888 if (t.isNPCProperty && t.trait.CanBeDestroyed)
2894 t.SetPlaceState(PlaceState.roaming);
2910 if (list.Count == 0)
2914 list.Copy().ForeachReverse(delegate(
Chara c)
2918 List<Point> list2 = new List<Point>();
2919 for (int i = point.x - 1; i <= point.x + 1; i++)
2921 for (int j = point.z - 1; j <= point.z + 1; j++)
2923 if (i != point.x || j != point.z)
2925 Point point2 = new Point(i, j);
2926 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
2933 if (list2.Count > 0)
2935 if (list2.Count > 1)
2937 list2.ForeachReverse(delegate(Point p)
2939 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
2945 Point newPoint = list2.RandomItem();
2948 Say(
"displace",
this, c);
2958 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
2960 Say(
"pushed_money",
this, c);
3025 if (z == currentZone)
3029 if (HasCondition<ConInvulnerable>())
3031 RemoveCondition<ConInvulnerable>();
3035 EClass.player.nextZone = z;
3043 EClass.player.returnInfo.turns += 5;
3050 EClass.player.deathZoneMove =
false;
3052 currentZone.events.OnLeaveZone();
3053 if (currentZone.instance !=
null)
3067 EClass.player.uidLastZone = currentZone.uid;
3070 if (currentZone.IsRegion)
3078 Msg.
Say(
"leaveZone", currentZone.Name);
3080 else if (z.
id != currentZone.id)
3084 EClass.player.lastZonePos = pos.Copy();
3086 EClass.player.lastTransition = transition;
3098 if (party !=
null && party.
leader ==
this)
3110 Debug.Log(base.Name);
3113 transition.uidLastZone = currentZone?.uid ?? 0;
3114 global.transition = transition;
3118 global.transition =
null;
3121 EClass.player.lastTransition =
null;
3124 if (IsBranchMember())
3135 public void MoveHome(
string id,
int x = -1,
int z = -1)
3150 CureCondition<ConSuspend>();
3177 orgPos =
new Point(x, z);
3178 if (factionBranch !=
null)
3180 RefreshWorkElements();
3192 state = ZoneTransition.EnterState.Fall,
3202 renderer.RefreshSprite();
3205 public override void Rotate(
bool reverse =
false)
3207 if (renderer.hasActor)
3209 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3213 base.dir = ((base.dir == 0) ? 1 : 0);
3216 renderer.RefreshSprite();
3226 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3229 if (angle > 100f && angle < 170f)
3233 else if (angle > 170f && angle < 190f)
3237 else if (angle > 190f || (angle < -10f && angle > -100f))
3247 else if (angle > 170f && angle < 235f)
3251 else if (angle > 80f && angle < 145f)
3255 else if (angle > -100f && angle < -35f)
3259 else if (angle > -10f && angle < 55f)
3263 renderer.RefreshSprite();
3274 else if (base.dir == 1)
3278 else if (base.dir == 2)
3282 else if (base.dir == 3)
3287 else if (base.dir == 0)
3291 else if (base.dir == 1)
3295 else if (base.dir == 2)
3299 else if (base.dir == 3)
3308 if (!renderer.hasActor)
3310 if (angle == 0f || angle == 45f || angle == 90f)
3314 if (angle == -135f || angle == 180f || angle == -90f)
3324 return renderer.actor.currentDir;
3330 for (
int i = -num; i < num + 1; i++)
3332 for (
int j = -num; j < num + 1; j++)
3334 shared.
Set(pos.x + i, pos.z + j);
3345 for (
int num = conditions.Count - 1; num >= 0; num--)
3347 if (conditions[num].ConsumeTurn)
3357 if (_cooldowns !=
null)
3362 consumeTurn =
false;
3363 preventRegen =
false;
3364 emoIcon =
Emo2.none;
3367 base.c_summonDuration--;
3368 if (base.c_summonDuration <= 0)
3376 AddCondition<ConWet>(20);
3381 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3401 if (parasite !=
null)
3403 ModExp(227, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.
LV) * 25));
3407 ModExp(226, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.
LV) * 25));
3414 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3422 if (turn % 500 == 0)
3424 DiminishTempElements();
3436 preventRegen =
true;
3440 Say(
"dmgBurden",
this);
3441 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3453 ModExp(207, 1 + phase2 * phase2);
3481 preventRegen =
true;
3485 if (
EClass.
rnd(100) == 0 && !isConfused)
3488 AddCondition<ConConfuse>(500);
3493 AddCondition<ConBlind>(200);
3496 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3504 int num2 = Evalue(409);
3505 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3510 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3512 if (num3 < conditions.Count)
3527 preventRegen =
true;
3542 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3544 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3545 elements.ModExp(300, 8);
3550 elements.ModExp(301, 8);
3569 if (parasite !=
null)
3581 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3594 if (hasMovedThisTurn)
3596 pos.Things.ForeachReverse(delegate(
Thing t)
3604 hasMovedThisTurn =
false;
3607 EClass.player.haltMove =
false;
3641 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3652 if (!tileInfo.
shore)
3657 int num2 = (tileInfo.isRoad ? 22 : 12);
3660 num2 = (tileInfo.isRoad ? 16 : 10);
3664 num2 *= (flag2 ? 2 : 20);
3675 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3688 EClass.player.pickupDelay = 0f;
3712 Msg.
Say(
"returnComplete");
3713 EClass.player.uidLastTravelZone = 0;
3715 EClass.player.lastZonePos =
null;
3717 EClass.player.returnInfo =
null;
3720 EClass.player.returnInfo =
null;
3721 Msg.
Say(
"returnOverweight");
3724 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
3732 RecipeUpdater.dirty =
true;
3738 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
3739 hasMovedThisTurn =
false;
3742 if (!IsAliveInCurrentZone)
3746 renderer.RefreshStateIcon();
3747 if (host !=
null && !consumeTurn)
3749 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
3755 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
3757 Say(
"parasite_fail",
this, host);
3758 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
3760 Talk(
"parasite_fail");
3775 if (base.isRestrained)
3796 Cell cell = base.Cell;
3799 AddCondition<ConWet>(50);
3800 if (pos.IsHotSpring)
3807 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10));
3823 AddCondition<ConWet>(50);
3827 PlaySound(
"fire_step");
3828 AddCondition<ConBurning>(30);
3833 PlaySound(
"bubble");
3834 AddCondition<ConWet>(30);
3839 if (hasMovedThisTurn)
3841 Say(
"abMistOfDarkness_step",
this);
3864 aliasEle = EClass.sources.elements.map[e.idEle].alias,
3893 if (rootCard !=
this && things.IsFull(c.
Thing))
3900 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
3910 if (things.GetDest(t).IsValid)
3931 t = TryPoisonPotion(t);
3939 Say(
"backpack_full_drop", t);
3946 Say(
"backpack_full", t);
3950 if (dest.
stack !=
null)
3954 PlaySound(
"pick_thing");
3955 Say(
"pick_thing",
this, t);
3963 PlaySound(
"pick_thing");
3964 Say(
"pick_thing",
this, t);
3966 TryReservePickupTutorial(t);
3976 Say(
"poisonDrip",
this);
3990 Say(
"absorbRod",
this, t);
3993 if (
rod.source !=
null)
3996 if (enumerator.MoveNext())
4028 if (t.
id ==
"pasture")
4040 foreach (
Card item in pos.ListCards())
4045 if (thing !=
null && !IsPC)
4047 thing.isNPCProperty =
true;
4092 t.isNPCProperty =
false;
4094 pos.TryWitnessCrime(
this);
4103 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4107 if (num == -1 || num > t.
Num)
4118 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4132 WidgetHotbar.dirtyCurrentItem =
true;
4143 if (IsPC && held.
invY == 1)
4145 WidgetHotbar.dirtyCurrentItem =
true;
4157 Say(
"canOnlyCarry", held);
4162 if (!flag && things.IsOverflowing())
4166 Say(
"backpack_full_drop", held);
4174 PlaySound(
"pick_thing");
4175 Say(
"pick_held",
this,
card);
4176 if (IsPC &&
card.id ==
"statue_weird")
4183 WidgetHotbar.dirtyCurrentItem =
true;
4198 return held.
Split(a);
4221 WidgetHotbar.dirtyCurrentItem =
true;
4226 if (
card.trait.CanOnlyCarry)
4237 Msg.
Say(
"markedImportant");
4252 t.ignoreAutoPick =
true;
4263 int num = Evalue(131);
4264 int num2 = Evalue(130);
4265 int num3 = Evalue(123);
4266 if (num > num2 && num > num3)
4270 if (num2 > num && num2 > num3)
4274 if (num3 > num && num3 > num2)
4288 if (elements.Value(122) > elements.Value(120))
4290 return elements.GetElement(122);
4292 return elements.GetElement(120);
4297 isOnCreate = onCreate;
4302 RestockInventory(onCreate);
4307 string equip = source.
equip;
4308 if (equip.IsEmpty())
4312 if (equip ==
"none")
4322 EQ_ID(
"staff_long", 1);
4330 EQ_ID(
"sword_zephir");
4333 case "adv_mesherada":
4336 EQ_ID(
"dagger_hathaway");
4342 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4346 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4352 EQ_ID(
"sword_muramasa");
4358 EQ_ID(
"dagger_gaki");
4362 EQ_ID(
"dagger_ninto");
4366 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4372 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4383 EQ_ID(
"helm_seeker");
4386 EQ_ID(
"sword_katana");
4388 EQ_ID(
"sword_katana");
4391 EQ_ID(
"boots_seven");
4395 for (
int i = 0; i < 20; i++)
4400 AddThing(
"plat").SetNum(6);
4406 AddThing(
"guitar_efrond");
4412 AddThing(
"guitar_ash");
4418 EQ_ID(
"EtherDagger");
4425 if (onCreate || !TryEquipRanged())
4427 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4432 if (onCreate || !TryEquipRanged())
4438 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4443 if (race.
id ==
"asura")
4445 for (
int j = 0; j < 4; j++)
4447 EQ_CAT(job.
weapon.RandomItem());
4450 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4456 else if (!job.
weapon.IsEmpty())
4460 EQ_CAT(job.
weapon.RandomItem());
4462 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4464 EQ_CAT(job.
weapon.RandomItem());
4512 Restock(
"book_story", 1);
4514 case "rock_thrower":
4522 Restock(
"book_story_home", 1);
4527 void Restock(
string id,
int num)
4529 if (things.Find(
id) ==
null)
4540 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4541 Rarity rarity2 = base.rarity;
4542 if (
id ==
"big_sister")
4544 num = (isOnCreate ? 8 : 4);
4552 rarity =
Rarity.Superior;
4554 else if (rarity2 ==
Rarity.Legendary)
4558 else if (rarity2 >=
Rarity.Mythical)
4564 rarity =
Rarity.Legendary;
4566 CardBlueprint.current.rarity = rarity;
4574 CardBlueprint.current.rarity = r;
4577 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
4582 if (!body.
Equip(thing))
4593 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
4598 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
4635 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty))
4639 Msg.
Say(
"returnHome",
this, homeZone.Name);
4656 base.hp = MaxHP / 3;
4659 if (hunger.
value > 30)
4663 sleepiness.value = 0;
4664 hostility = OriginalHostility;
4665 RemoveCondition<StanceTaunt>();
4670 Msg.
Say(
"noDeathPenalty2",
this);
4674 Msg.
Say(
"noDeathPenalty",
this);
4680 List<Thing> dropList =
new List<Thing>();
4685 t.ignoreAutoPick = true;
4688 }, onlyAccessible:
false);
4694 EClass.player.preventDeathPenalty =
false;
4696 if (IsPCFaction && homeBranch !=
null)
4698 homeBranch.
Log(
"bRevive",
this);
4711 PlayEffect(
"revive");
4713 SetCensored(enable:
false);
4721 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
4724 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
4728 if (!lastword.IsEmpty())
4730 thing.c_note = lastword;
4732 thing.isModified =
true;
4778 if (HasCondition<ConAnorexia>())
4784 else if (base.c_vomit > 10)
4786 AddCondition<ConAnorexia>();
4788 AddCondition<ConDim>();
4789 if (HasCondition<ConAnorexia>())
4803 if (isDead || host !=
null)
4807 bool isInActiveZone = IsInActiveZone;
4816 Say(
"summon_vanish",
this);
4817 pos.PlayEffect(
"vanish");
4818 pos.PlaySound(
"vanish");
4828 PlayEffect(
"revive");
4829 PlaySound(
"chime_angel");
4836 PlaySound(base.material.GetSoundDead(source));
4838 renderer.RefreshSprite();
4839 renderer.RefreshStateIcon();
4844 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
4847 text =
"dead_" + attackSource;
4853 text =
"dead_" + e.source.alias;
4862 EClass._zone.isDeathLocation =
true;
4863 string s = ((origin ==
null) ? text :
"dead_by");
4875 AI_PlayMusic.keepPlaying =
false;
4881 Msg.
Say(
"goto_heaven",
this);
4885 if (origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
4887 Msg.
Say(text,
this,
"", text2);
4889 string text3 = TalkTopic(
"dead");
4890 if (!text3.IsEmpty())
4892 text3 = text3.StripBrackets();
4894 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
4909 if (homeBranch !=
null)
4911 homeBranch.
Log(text,
this,
"");
4923 if (
id ==
"mandrake")
4925 Say(
"a_scream",
this);
4932 base.isSale =
false;
4943 EClass.player.returnInfo =
null;
4944 EClass.player.uidLastTravelZone = 0;
4953 chara2.enemy =
null;
4958 EClass.player.preventDeathPenalty =
true;
4963 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
4972 currentZone.RemoveCard(
this);
4975 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
4978 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
4982 ModAffinity(
EClass.
pc, a, show:
false);
4984 if (!(text4 ==
"quru"))
4986 if (text4 ==
"corgon")
4998 if (origin.IsPCParty || origin.IsPCPartyMinion)
5001 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5005 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5012 num = num * 30 / 100;
5023 else if (origin.IsPCFaction)
5025 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5026 origin.Chara.ShowEmo(
Emo.love);
5029 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5033 if (base.IsPCFactionOrMinion)
5037 Msg.
Say(
"abort_allyDead");
5042 Msg.
Say(
"abort_enemyDead");
5044 if (IsPCParty && !IsPC)
5047 base.c_wasInPcParty =
true;
5051 if (!(text4 ==
"littleOne"))
5053 if (text4 ==
"big_daddy" && !IsPCFaction)
5062 EClass.player.flags.little_killed =
true;
5065 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5069 if (chara.
LV < base.LV)
5071 chara.
SetLv(base.LV);
5074 Msg.
Say(
"plant_pop",
this, chara);
5078 item.OnCharaDie(
this);
5084 if (IsPCFaction || IsPCFactionMinion)
5091 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5097 flag = (flag2 =
true);
5098 EClass._zone.Boss =
null;
5103 EClass.player.flags.KilledBossInVoid =
true;
5109 SE.Play(
"Jingle/fanfare2");
5119 flag = (flag2 =
true);
5127 case "melilith_boss":
5129 flag = (flag2 =
true);
5136 flag = (flag2 =
true);
5138 if (questExploration !=
null)
5140 SE.Play(
"kill_boss");
5150 SE.Play(
"kill_boss");
5151 SoundManager.ForceBGM();
5157 SE.Play(
"kill_boss");
5161 EClass.player.willAutoSave =
true;
5182 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true)
5184 if (!IsAliveInCurrentZone)
5210 Say(
"kick",
this, t);
5230 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5235 if (!IsPC && HasCooldown(a.
id))
5245 if (IsPC && HasCondition<StanceManaCost>())
5247 num2 = Evalue(1657);
5259 ForeachEnemy(delegate
5266 ForeachParty(delegate
5282 num3 = (IsPC ? (i * 100) : (50 + i * 50));
5284 int num4 = cost.cost * num3 / 100;
5287 num4 = num4 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5297 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5305 ActPlan.warning =
true;
5308 if (UseAbility(a, tc, pos, pt))
5317 if ((isConfused &&
EClass.
rnd(4) == 0) || (isBlind && (pt || (pos !=
null && !pos.Equals(base.pos)) || (tc !=
null && tc.pos !=
null && !tc.pos.Equals(base.pos))) &&
EClass.
rnd(2) == 0))
5319 Say(
"shakeHead",
this);
5322 if (tc !=
null && tc !=
this)
5326 if (pos !=
null && !base.pos.Equals(pos))
5332 num = 1 + Evalue(1648);
5334 if (IsPC && cost.
cost > 0 && a.
Value == 0)
5341 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5342 if (!a.
source.tag.Contains(
"useHand"))
5344 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5357 a.vPotential -= i * 2;
5358 num4 = num4 * (100 - num2 * 20) / 100;
5367 else if (a.
source.langAct.Length != 0 && tc !=
null)
5369 string text = a.
source.langAct[0];
5370 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5371 if (text ==
"spell_hand")
5374 string @ref = text2.lang(list[4]);
5375 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list[1] : list[2]);
5379 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
5383 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
5389 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5399 elements.ModExp(304, Mathf.Clamp(num4 * 2, 1, 200));
5405 if (a is
Spell && GetCondition<ConSilence>() !=
null)
5407 Say(
"cast_silence",
this);
5414 int spellExp = elements.GetSpellExp(
this, a, num3);
5417 Say(
"fizzle",
this);
5418 PlayEffect(
"fizzle");
5419 PlaySound(
"fizzle");
5422 ModExp(a.
id, spellExp / 5);
5424 RemoveCondition<ConInvisibility>();
5433 ForeachEnemy(delegate(
Chara c)
5440 ForeachParty(delegate(
Chara c)
5445 Act.forcePt =
false;
5449 for (
int j = 0; j < num; j++)
5455 ActEffect.RapidCount = j;
5457 flag2 = a.
Perform(
this, tc, pos);
5460 if (flag2 && !isDead && cost.
cost > 0 && a.
source.lvFactor > 0)
5462 ModExp(a.
id, spellExp);
5464 ActEffect.RapidCount = 0;
5465 if (!IsPC && a.
source.cooldown > 0)
5467 AddCooldown(a.
id, a.
source.cooldown);
5469 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
5471 RemoveCondition<ConInvisibility>();
5474 void ForeachEnemy(Action<Chara> action)
5476 if (_pts.Count == 0)
5481 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
5487 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
5492 void ForeachParty(Action<Chara> action)
5494 if (_pts.Count == 0)
5501 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
5512 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
5519 for (
int num7 = _pts.Count - 1; num7 >= 0; num7--)
5530 return 25 + Evalue(226) * 125 / 100;
5546 if (host.
ride ==
this)
5548 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
5552 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
5557 int num3 = Evalue(304);
5560 num3 = Mathf.Max(num3, base.LV + 5);
5564 bool num6 = GetArmorSkill() == 122;
5568 num4 = 20 - Evalue(122) / 5;
5569 num5 += 10 - Evalue(1654) * 4;
5573 num4 = 10 - Evalue(120) / 5;
5583 if (parasite !=
null)
5594 num5 += 10 - Evalue(1654) * 4;
5600 if (HasCondition<ConDim>())
5602 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
5612 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / (10 + num3 * 10), 0, 100 - num5);
5615 public void DoAI(
int wait, Action onPerform)
5630 Say(headpat ?
"headpat" :
"cuddle",
this, c);
5636 if (!headpat ||
this == c)
5651 if (!member.
IsPC && CanSeeLos(member))
5685 if (enemy ==
null && !IsPC)
5687 if (GetInt(106) == 0)
5691 if (OriginalHostility !=
Hostility.Enemy)
5695 SetEnemy(_tg.
Chara);
5709 if (_tg ==
null || !_tg.
isChara)
5716 EClass.pc.combatCount = 10;
5724 chara.
Say(
"frown",
this, chara);
5736 chara.
Say(
"frown",
this, chara);
5743 bool flag = chara.id ==
"fanatic";
5746 chara.
Say(
"callHelp", chara);
5818 bool flag = enemy !=
null || ai is
GoalCombat;
5819 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
5821 bool flag3 = !IsPCParty;
5827 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2))
5831 int num3 = Dist(chara2);
5832 int num4 = GetSightRadius() + (flag ? 1 : 0);
5839 if (
this == pos.FirstChara)
5841 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
5849 DoHostileAction(chara2);
5862 DoHostileAction(chara);
5874 if (chara !=
this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
5876 DoHostileAction(chara);
5895 if (base.IsPCFactionOrMinion)
5908 if (OriginalHostility >=
Hostility.Friend)
5949 return EClass.game.activeZone == currentZone;
5956 foreach (
Point item2
in item.ListPoints())
5958 if (pos.Equals(item2))
5979 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
5997 if (race.
id ==
"spider" && source.
tiles.Length > 1)
5999 base.idSkin = (EClass.core.config.game.antiSpider ? 1 : 0);
6007 charaRenderer.pccData = PCCData.Create(
"ride");
6008 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6009 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6010 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6014 foreach (
Condition condition
in conditions)
6017 if (rendererReplacer !=
null)
6019 charaRenderer.replacer = rendererReplacer;
6020 charaRenderer.data = rendererReplacer.
data;
6024 if (charaRenderer.
replacer ==
null)
6026 charaRenderer.pccData = pccData;
6029 renderer = charaRenderer;
6031 if (cardRenderer !=
null)
6033 renderer.SetFirst(first:
false, cardRenderer.
position);
6035 return charaRenderer;
6042 PCC.Get(pccData).Build(state);
6050 PCC pCC = PCC.Get(pccData);
6052 return pCC.variation.idle[0, 0];
6054 return sourceCard.
GetSprite((sourceCard.
_tiles.Length > 1) ? ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6075 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && GetBool(123))
6084 p.mat = base.material;
6085 p.matColor = base.colorInt;
6086 if (!renderer.usePass)
6090 if (renderer.replacer !=
null)
6092 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6098 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6103 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6106 else if (sourceCard.
_tiles.Length > 1)
6108 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6109 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6113 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6120 string text = base.Name;
6121 if (IsFriendOrAbove())
6125 else if (IsHostile())
6131 if (base.LV >= lV * 5)
6135 else if (base.LV >= lV * 2)
6139 else if (base.LV <= lV / 4)
6143 else if (base.LV <= lV / 2)
6149 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6150 s = (
" (" + s.lang() +
") ").TagSize(14);
6154 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6158 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6164 text2 +=
"lowerGround".lang();
6166 else if (HasHigherGround(
EClass.
pc))
6168 text2 +=
"higherGround".lang();
6171 if (Evalue(1232) > 0)
6173 text2 =
"milkBaby".lang().TagSize(14) + text2;
6177 text2 =
"hasBounty".lang().TagSize(14) + text2;
6181 text2 += (
"(" + faith.Name +
")").TagSize(14);
6183 return text + text2 + s;
6191 text += Environment.NewLine;
6192 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6197 text2 += Environment.NewLine;
6198 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6199 text2 += Environment.NewLine;
6201 text2 += Environment.NewLine;
6202 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6203 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.
idSkin;
6206 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6207 if (enumerable.Count() > 0)
6209 text3 += Environment.NewLine;
6210 text3 +=
"<size=14>";
6214 string text4 =
item.GetPhaseStr();
6215 if (text4.IsEmpty() || text4 ==
"#")
6220 switch (
item.source.group)
6233 text4 = text4 +
"(" +
item.GetValue() +
")";
6234 if (resistCon !=
null && resistCon.ContainsKey(
item.id))
6236 text4 = text4 +
"{" + resistCon[
item.id] +
"}";
6240 text3 = text3 + text4.TagColor(c) +
", ";
6249 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6254 text3 += Environment.NewLine;
6257 text3 = text3 + item2.act.Name +
", ";
6259 text3 = text3.TrimEnd(
", ".ToCharArray());
6261 return text + text2 + text3;
6266 string key = source.
idText.IsEmpty(
id);
6276 string text = row.GetText(topic, returnNull:
true);
6281 if (text.StartsWith(
"@"))
6288 text = row.GetText(topic, returnNull:
true);
6294 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6299 if (host ==
null && !IsInActiveZone)
6303 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6309 int num = EClass.pc.party.members.Count - 1;
6334 string topicText = GetTopicText(topic);
6335 if (topicText.IsEmpty())
6339 string text =
"_bracketTalk".lang();
6340 bool flag = topicText.StartsWith(
"*");
6341 bool flag2 = topicText.StartsWith(
"(");
6342 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
6343 topicText = ApplyTone(topicText);
6344 topicText = topicText.Replace(
"~",
"*");
6346 Msg.
Say(topicText.Replace(
"&",
""));
6347 if (topic ==
"dead")
6351 else if (flag || flag3 || flag2)
6353 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
6371 if (conSuspend !=
null && IsPCParty)
6373 RemoveCondition<ConSuspend>();
6375 if (IsDeadOrSleeping)
6377 ShowDialog(
"_chara",
"sleep");
6379 else if (base.isRestrained)
6381 ShowDialog(
"_chara",
"strain");
6385 ShowDialog(
"_chara",
"invisible");
6387 else if (IsEscorted())
6389 ShowDialog(
"_chara",
"escort");
6393 ShowDialog(
"_chara",
"party");
6408 EClass.player.flags.loytelEscaped =
false;
6410 ShowDialog(
"loytel",
"loytelEscaped");
6414 if (questDebt !=
null && questDebt.
paid)
6417 if (questDebt.
stage > 6)
6419 questDebt.stage = 1;
6421 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
6429 ShowDialog(
"_chara");
6435 ShowDialog(
"farris",
"nymelle_noQuest");
6438 ShowDialog(
"farris",
"nymelle_first");
6441 ShowDialog(
"farris",
"home_first");
6444 ShowDialog(
"_chara");
6449 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6451 SoundManager.ForceBGM();
6456 ShowDialog(
"ashland");
6460 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6462 SoundManager.ForceBGM();
6469 EClass.player.flags.fiamaFirstDream =
true;
6470 ShowDialog(
"fiama",
"firstDream");
6474 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
6476 EClass.player.flags.fiamaStoryBookGiven =
true;
6482 ShowDialog(
"fiama");
6487 ShowDialog(
"fiama");
6493 ShowDialog(
"big_sister",
"little_saved");
6494 EClass.player.flags.little_saved =
false;
6499 ShowDialog(
"big_sister",
"little_dead");
6500 EClass.player.flags.little_killed =
false;
6508 ShowDialog(
"guild_doorman",
"main", tag);
6514 ShowDialog(
"guild_clerk",
"main", tag2);
6528 ShowDialog(
"_chara");
6535 return _ShowDialog(
book,
null, step, tag);
6541 if (
book ==
"_chara" && IsPC)
6555 return base.LV / 2 + 4;
6561 if (FindBed() !=
null)
6570 return GetHappiness().ToString() ??
"";
6575 string result =
"?????";
6588 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
6598 sortVal = job._index * 10000 + sourceCard.
_index;
6601 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
6604 sortVal = -GetTotalFeat();
6607 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
6620 foreach (
Card item in map.props.installed.all)
6624 traitBed.RemoveHolder(
this);
6643 if (!IsPCFaction && !IsGuest())
6652 Msg.
Say(
"claimBed",
this);
6661 if (GetInt(113) != 0)
6666 Thing bestRangedWeapon = GetBestRangedWeapon();
6667 foreach (
Thing thing
in things)
6673 _ListItems.Add(thing);
6677 _ListItems.Add(thing);
6681 if (_ListItems.Count == 0)
6685 List<Thing> containers2 = containers.ToList();
6686 foreach (
Thing listItem
in _ListItems)
6710 bool flag = GetInt(113) == 0;
6719 foreach (
Thing thing3
in things)
6721 if (CanEat(thing3, shouldEat))
6729 if (thing3.
id ==
"polish_powder")
6743 foreach (
Thing container
in containers)
6753 if (num3 > 0 && thing4.
id ==
"polish_powder")
6755 _ListItems.Add(thing4);
6760 _ListItems.Add(thing4);
6765 _ListItems.Add(thing4);
6768 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
6770 _ListItems.Add(thing4);
6775 _ListItems.Add(thing4);
6780 _ListItems.Add(thing4);
6785 if (_ListItems.Count == 0)
6789 _ListItems.ForeachReverse(delegate(
Thing t)
6794 int slot = t.category.slot;
6795 int equipValue = t.GetEquipValue();
6796 foreach (Thing listItem in _ListItems)
6798 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
6806 _ListItems.Remove(t);
6811 foreach (
Thing listItem2
in _ListItems)
6813 Thing thing = listItem2;
6814 if (things.IsFull(thing))
6821 thing = thing.
Split(2);
6828 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
6830 TryEquip(thing, useFav:
true);
6836 TryPutSharedItems(containers);
6852 Say(
"eat_start",
this, t.Duplicate(1));
6883 if (!CanEquipRanged(t))
6888 foreach (
Thing thing
in things)
6909 if (bodySlot ==
null)
6915 switch (GetFavAttackStyle())
6963 if (!ShouldEquip(t, useFav))
6974 switch (GetFavAttackStyle())
6990 body.
Equip(t, slot);
6996 Say(
"equip",
this, t);
7012 return FindThrowable(hotbar:
true);
7016 things.Foreach(delegate(
Thing t)
7018 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7024 Thing FindThrowable(
bool hotbar)
7026 things.Foreach(delegate(
Thing t)
7063 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7068 Thing result =
null;
7070 foreach (
Thing thing
in things)
7093 if (ranged !=
null && ranged.
parent ==
this)
7097 ranged = GetBestRangedWeapon();
7098 return ranged !=
null;
7103 if (body.
GetWeight(armorOnly:
true) <= 30000)
7128 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7130 SetAIImmediate(
new AI_Eat
7149 if (base.hp < MaxHP * 90 / 100)
7152 if (healAction !=
null)
7163 return FindBed()?.owner.pos.cell.room;
7178 if (IsPCFaction && homeBranch !=
null)
7180 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7189 a = affinity.
Mod(a);
7199 Say(
"affinityNone",
this, c);
7203 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7207 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7213 int num = Evalue(289);
7225 num2 += (lV - num) * 10;
7227 elements.
ModExp(289, Mathf.Min(num2, 1000));
7243 chara.orgPos = orgPos.
Copy();
7245 chara.pos = pos.
Copy();
7246 chara.isImported =
true;
7247 chara.c_editorTags = base.c_editorTags;
7248 chara.c_editorTraitVal = base.c_editorTraitVal;
7249 chara.c_idTrait = base.c_idTrait;
7250 chara.homeZone = homeZone;
7256 if (_listFavFood.Count == 0)
7260 if (row._origin ==
"dish" && row.value != 0)
7262 _listFavFood.Add(row);
7269 r = _listFavFood.RandomItem();
7277 if (_listFavCat.Count == 0)
7283 _listFavCat.Add(row);
7289 r = _listFavCat.RandomItem();
7297 if (base.c_upgrades !=
null)
7299 num += base.c_upgrades.spent;
7301 if (base.c_genes !=
null)
7303 num += base.c_genes.GetTotalCost();
7305 return num + base.feat;
7312 if (
item.act.id == 6630)
7322 string text = race.
id;
7323 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
7336 if (
id ==
"olderyoungersister")
7338 if (base.idSkin != 2)
7340 return "UN_olderyoungersister";
7342 return "UN_olderyoungersister_alt";
7348 return base.c_idPortrait;
7353 EClass.player.forceTalk =
true;
7358 PlayEffect(
"revive");
7361 AddCondition<ConDim>(200);
7380 int num2 = base.LV - source.
LV;
7393 return GiveBirth(thing, effect);
7396 public Thing MakeEgg(
bool effect =
true,
int num = 1,
bool addToZone =
true)
7405 return GiveBirth(thing, effect);
7412 if (HasElement(1231))
7415 AddCondition<ConEuphoric>();
7419 SetFeat(1231, 1, msg:
true);
7426 int num2 = ((!HasElement(1411)) ? 1 : 3);
7427 if (GetBurden(t, num) >= num2)
7440 if (!IsValidGiftWeight(t, num))
7448 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
7457 if (things.IsFull())
7484 Msg.
Say(
"affinityNone", c,
this);
7490 int num2 = 200 + t.LV * 3;
7506 c.
Say(
"draw_curse", c, t);
7508 List<Element> list =
new List<Element>();
7516 if (list.Count == 0)
7521 Element element = list.RandomItem();
7527 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
7529 GiveLovePotion(c, t);
7543 case "ticket_massage":
7550 case "ticket_armpillow":
7558 case "ticket_champagne":
7565 if (t.
id ==
"flyer")
7570 c.
Talk(
"flyer_miss");
7576 Msg.
Say(
"affinityNone", c,
this);
7578 elements.ModExp(291, 10);
7581 elements.ModExp(291, 50);
7583 if (t.
id ==
"statue_weird")
7604 Say(
"give_erohon",
this);
7605 AddCondition<ConParalyze>(50, force:
true);
7606 AddCondition<ConConfuse>(50, force:
true);
7607 AddCondition<ConFear>(1000, force:
true);
7615 c.
Say(
"give_love", c, t);
7625 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this || (host !=
null && host.
isRestrained) || (IsPCFaction && attacker.
IsPCFaction))
7641 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
7642 int num2 = Dist(chara);
7647 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7653 if (Dist(chara) < 5)
7660 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
7668 Say(
"intercept_loyal", chara,
this);
7671 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7676 if (!flag && !HasElement(1225))
7678 Say(
"intercept", chara,
this);
7681 chara.
Talk(
"intercept", base.NameSimple);
7683 if (attacker.enemy ==
this)
7685 attacker.SetEnemy(chara);
7751 if (t.
id ==
"flyer")
7771 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
7773 Thing thing = things[num2];
7774 if (ShouldThrowAway(thing, type))
7785 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
7793 _ = base.c_upgrades;
7802 for (
int i = 0; i < 100; i++)
7808 if (base.c_upgrades ==
null)
7812 if (base.c_upgrades.halt)
7823 List<Element> list = ListAvailabeFeats(pet:
true);
7824 if (num >= 90 && list.Count > 0)
7826 Element element = list.RandomItem();
7830 else if (num >= 60 && ie.Any())
7832 num2 = ie.RandomItem().id;
7843 if (num4 > base.feat)
7848 base.c_upgrades.count++;
7849 base.c_upgrades.spent += num4;
7855 if (
item.idEle == num2)
7876 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
7878 else if (elements.ValueWithoutLink(row.
id) == 0)
7880 elements.Learn(row.
id);
7884 elements.ModBase(num2, num3);
7891 if (_cooldowns ==
null)
7893 _cooldowns =
new List<int>();
7897 _cooldowns.Add(idEle * 1000 + turns);
7903 _cooldowns.Add(idEle * 1000 + row.
cooldown);
7909 if (_cooldowns !=
null)
7911 for (
int i = 0; i < _cooldowns.Count; i++)
7913 if (_cooldowns[i] / 1000 == idEle)
7924 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
7926 if (_cooldowns[num] % 1000 == 1)
7928 _cooldowns.RemoveAt(num);
7935 if (_cooldowns.Count == 0)
7948 if (IsPCParty || base.noMove)
7953 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
7956 if (goalFromTimeTable !=
null)
7958 SetAI(goalFromTimeTable);
7961 goalFromTimeTable.
Tick();
7966 if (goalList.
index == -2)
7968 goalList.
Refresh(
this, goalListType);
7970 SetAI(goalList.
Next());
7994 return GetGoalWork();
8000 return GetGoalHobby();
8042 return SetAI(_NoGoalPC);
8060 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8064 if (HasCondition<ConWait>())
8066 RemoveCondition<ConWait>();
8072 renderer.RefreshStateIcon();
8079 bool hasNoGoal = HasNoGoal;
8114 listHobby.Add(
new Hobby
8125 foreach (
int work
in _works)
8127 listHobby.Add(
new Hobby
8141 if (_hobbies ==
null)
8145 foreach (
int hobby
in _hobbies)
8147 listHobby.Add(
new Hobby
8160 if (
item.source.alias ==
id)
8165 foreach (
Hobby item2
in ListHobbies())
8167 if (item2.
source.alias ==
id)
8177 if (workElements !=
null)
8181 workElements =
null;
8182 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
8190 foreach (
Hobby item2
in ListWorks())
8194 if (workElements !=
null)
8198 void TryAdd(
Hobby h)
8200 if (!h.
source.elements.IsEmpty())
8202 if (workElements ==
null)
8206 for (
int i = 0; i < h.
source.elements.Length; i += 2)
8208 int num = h.
source.elements[i];
8209 int num2 = h.
source.elements[i + 1];
8211 if (num != 2115 && num != 2207)
8219 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
8227 string text = (simple ?
"" : (
"hobby".lang() +
":"));
8232 return text.TrimEnd(
',');
8237 string text = (simple ?
"" : (
"work".lang() +
":"));
8242 return text.TrimEnd(
',');
8247 foreach (
int hobby
in _hobbies)
8259 foreach (
int work
in _works)
8271 if (_hobbies !=
null && _works !=
null)
8278 _hobbies =
new List<int>();
8279 _works =
new List<int>();
8287 string[] hobbies = source.
hobbies;
8288 foreach (
string key
in hobbies)
8293 if (source.
works.IsEmpty())
8299 string[] hobbies = source.
works;
8300 foreach (
string key2
in hobbies)
8305 GetWorkSummary().Reset();
8310 if (_workSummary ==
null)
8314 return _workSummary;
8327 if (workSummary.
work !=
null)
8332 else if (workSummary.
hobbies.Count > 0)
8353 hobby.id = session.
id;
8358 workSummary.progress +=
EClass.
rnd(5) + 5;
8360 int num = PerformWork(hobby, 0, isHobby);
8361 int num2 = PerformWork(hobby, 1, isHobby);
8362 int num3 = PerformWork(hobby, 2, isHobby);
8363 int num4 = PerformWork(hobby, 3, isHobby);
8364 workSummary.money += num;
8365 workSummary.food += num2;
8366 workSummary.knowledge += num3;
8367 workSummary.material += num4;
8368 int PerformWork(
Hobby work,
int idx,
bool isHobby)
8370 if (idx >= work.
source.resources.Length)
8374 int num5 = work.
source.resources[idx];
8376 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
8377 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
8378 if (num6 > 0 && num5 <= 0)
8388 _goalWork.
FindWork(
this, setAI:
false);
8404 foreach (
Condition condition
in conditions)
8406 condition.
SetOwner(
this, onDeserialize);
8412 return AddCondition(typeof(T).Name, p, force);
8425 if (c is
ConBleed && ResistLv(964) >= 3)
8430 else if (ResistLv(950) >= 3)
8448 if (c.
source.negate.Length != 0)
8450 string[] negate = c.
source.negate;
8451 foreach (
string text
in negate)
8453 if (HasElement(text))
8460 if (defenseAttribute !=
null)
8462 c.power = 100 * c.power / (100 + defenseAttribute.
Value);
8464 if (c.
source.resistance.Length != 0)
8469 c.power /= num * num + 1;
8482 for (
int j = 0; j < conditions.Count; j++)
8484 if (conditions[j].
id != c.
id)
8490 conditions[j].Kill();
8493 if (conditions[j].CanStack(c))
8495 if (conditions[j].WillOverride)
8497 conditions[j].Kill(silent:
true);
8500 if (CanGainConResist)
8504 conditions[j].OnStacked(c.
power);
8505 conditions[j].OnStartOrStack();
8506 conditions[j].PlayEffect();
8508 if (!conditions[j].AllowMultipleInstance)
8513 foreach (
Condition condition
in conditions)
8520 int num2 = c.EvaluateTurn(c.power);
8527 if (CanGainConResist)
8534 if (c.ShouldRefresh)
8542 if (c.SyncRide && (ride !=
null || parasite !=
null))
8548 if (parasite !=
null)
8556 public override bool HasCondition<T>()
8558 for (
int i = 0; i < conditions.Count; i++)
8560 if (conditions[i] is T)
8570 for (
int i = 0; i < conditions.Count; i++)
8572 if (conditions[i].source.alias == alias)
8587 for (
int i = 0; i < conditions.Count; i++)
8591 return conBuffStats.elements.GetElement(ele);
8597 public void CureCondition<T>(
int v = 99999) where T :
Condition
8599 T condition = GetCondition<T>();
8600 if (condition !=
null)
8602 condition.value -= v;
8603 if (condition.value <= 0)
8612 for (
int i = 0; i < conditions.Count; i++)
8614 if (conditions[i] is T)
8616 return conditions[i] as T;
8624 for (
int num = conditions.Count - 1; num >= 0; num--)
8626 if (conditions[num] is T)
8628 conditions[num].
Kill();
8636 if (parasite !=
null)
8638 parasite.
Cure(type, p, state);
8642 ride.
Cure(type, p, state);
8644 Cure(type, p, state);
8654 CureCondition<ConFear>();
8655 CureCondition<ConBlind>(2 * p / 100 + 5);
8656 CureCondition<ConPoison>(5 * p / 100 + 5);
8657 CureCondition<ConConfuse>(10 * p / 100 + 10);
8658 CureCondition<ConDim>(p / 100 + 5);
8659 CureCondition<ConBleed>(2 * p / 100 + 10);
8666 CureCondition<ConBlind>(5 * p / 100 + 15);
8667 CureCondition<ConPoison>(10 * p / 100 + 15);
8668 CureCondition<ConBleed>(5 * p / 100 + 20);
8669 CureTempElements(p, body:
true, mind:
false);
8672 CureCondition<ConFear>();
8673 CureCondition<ConDim>(3 * p / 100 + 10);
8674 CureTempElements(p, body:
false, mind:
true);
8678 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
8680 Condition condition2 = conditions[num2];
8685 condition2.
Mod(-1, force:
true);
8693 CureCondition<ConWait>();
8694 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
8695 bool flag2 = HasCondition<ConAnorexia>();
8696 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
8697 if (base.c_vomit < 0)
8702 RemoveCondition<ConAnorexia>();
8712 CureTempElements(p * 100, body:
true, mind:
true);
8713 for (
int num = conditions.Count - 1; num >= 0; num--)
8728 CureCondition<ConWait>();
8729 CureCondition<ConSleep>();
8737 if (HasElement(1206))
8739 SetFeat(1206, 0, msg:
true);
8753 if (
TC.hp >
TC.MaxHP * Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) / 100)
8757 if (
TC.HasElement(427))
8765 PlaySound(
"hit_finish");
8767 Say(
"finish2",
this,
TC);
8777 if (resistCon ==
null)
8779 resistCon =
new Dictionary<int, int>();
8781 if (resistCon.ContainsKey(key))
8783 resistCon[key] += con.power * con.GainResistFactor / 100;
8787 resistCon[key] = con.power * con.GainResistFactor / 100;
8794 if (con.
power > 0 && resistCon !=
null)
8796 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
8818 con.pcPillow = pillow;
8819 con.pickup = pickup;
8820 con.posBed = posBed;
8821 con.posPillow = posPillow;
8828 int num =
bed?.Power ?? 20;
8829 if (traitPillow !=
null)
8831 num += traitPillow.owner.Power / 2;
8835 num +=
bed.Evalue(750) * 5;
8846 int num = power * days;
8847 if (stamina.
value < 0)
8852 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
8868 int height = bio.height;
8869 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8874 if (height != bio.height)
8876 bio.height = height;
8877 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
8887 int weight = bio.weight;
8888 int height = bio.height;
8889 int num = height * height * 18 / 25000;
8890 int num2 = height * height * 24 / 10000;
8891 if (ignoreLimit || (weight > num && weight < num2))
8893 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8898 if (weight != bio.weight)
8900 bio.weight = weight;
8901 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
8910 if (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0)
8914 int num = Evalue(412);
8917 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
8918 a = (int)num2 + ((
EClass.
rndf(1f) > num2 % 1f) ? 1 : 0);
8925 int num3 = (corruption + a) / 100 - corruption / 100;
8926 for (
int i = 0; i < Mathf.Abs(num3); i++)
8928 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
8935 foreach (
Element value
in elements.dict.Values)
8937 if (value.
source.category ==
"ether")
8939 num4 += value.
Value;
8942 if (num4 > 0 && IsPC)
8946 corruption = num4 * 100 + corruption % 100;
8951 List<Element> list =
new List<Element>();
8954 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
8955 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
8964 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
8966 Feat feat = elements.GetElement(
id) as
Feat;
8968 if (feat !=
null && feat.
Value > 0)
8970 if (value == feat.
Value)
8979 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
8984 elements.Remove(
id);
8989 CalculateMaxStamina();
8995 if (feat.
source.textInc.IsEmpty())
8997 PlaySound(
"ding_skill");
8999 Say(
"gainFeat",
this, feat.
FullName);
9003 bool flag = value < num;
9004 if (feat.
source.tag.Contains(
"neg"))
9008 PlaySound(
"mutation");
9010 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9012 elements.CheckSkillActions();
9017 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
9019 Say(
"resistMutation",
this);
9023 for (
int i = 0; i < tries; i++)
9026 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9029 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9030 if (base.c_corruptionHistory.Count == 0)
9032 base.c_corruptionHistory =
null;
9035 Element element = elements.GetElement(row.
id);
9037 if ((vec > 0 && ((row.
id == 1563 && corruption < 300) || (row.
id == 1562 && corruption < 1000 && base.IsPowerful))) || (vec < 0 && (element ==
null || element.
Value <= 0)) || (vec > 0 && element !=
null && element.
Value >= row.
max))
9044 element = elements.GetElement(row.
id);
9046 bool flag = row.
tag.Contains(
"neg");
9059 if (element !=
null)
9061 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
9062 if (num > element.
source.max)
9064 num = element.source.max - 1;
9066 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
9067 flag2 = num > element.
Value;
9068 if (vec > 0 && !flag2)
9073 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
9074 SetFeat(row.
id, num);
9077 if (base.c_corruptionHistory ==
null)
9079 base.c_corruptionHistory =
new List<int>();
9081 base.c_corruptionHistory.Add(row.
id);
9084 Element element2 = elements.GetElement(row.
id);
9089 EClass.player.flags.gotEtherDisease =
true;
9091 thing.
SetStr(53,
"letter_ether");
9100 PlaySound(ether ?
"mutation_ether" :
"mutation");
9101 PlayEffect(
"mutation");
9103 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9107 Say(
"nothingHappens");
9113 Element orCreateElement = elements.GetOrCreateElement(ele);
9116 elements.ModBase(orCreateElement.
id, 1);
9118 if (orCreateElement is
Spell)
9120 int num = mtp * orCreateElement.source.charge * (100 + Evalue(307) + (HasElement(307) ? 20 : 0)) / 100 / 100;
9121 if (orCreateElement.
source.charge == 1)
9125 orCreateElement.vPotential += Mathf.Max(1, num / 2 +
EClass.
rnd(num / 2 + 1));
9127 Say(
"spell_gain",
this, orCreateElement.
Name);
9139 Msg.
Say(
"curse_nullify", member);
9144 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
9146 Say(
"curse_nullify",
this);
9149 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
9151 Say(
"curse_nullify",
this);
9161 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9163 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9168 if (faithElements !=
null)
9173 if (idFaith ==
"eyth" && !HasElement(1228))
9188 if (!HasCondition<ConExcommunication>())
9191 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9192 for (
int i = 0; i < array.Length; i += 2)
9194 int num2 = array[i + 1] * num / 50;
9197 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
9199 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9203 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
9215 if (tempElements ==
null)
9220 if (a > 0 && tempElements.
Base(ele) > a)
9222 a = a * 100 / (200 + (tempElements.
Base(ele) - a) * 10);
9225 if (element.
vBase == 0)
9228 if (tempElements.
dict.Count == 0)
9230 tempElements =
null;
9249 ModTempElement(ele, -(p / 100 +
EClass.
rnd(p / 100 + 1) + 1));
9266 ModTempElement(ele, p / 100 +
EClass.
rnd(p / 100 + 1));
9271 if (tempElements ==
null)
9279 ModTempElement(
item.id, -Mathf.Min(a,
item.vBase), naturalDecay:
true);
9286 if (tempElements !=
null)
9297 void Cure(
int[] eles)
9299 foreach (
int ele
in eles)
9301 if (tempElements ==
null)
9306 if (element !=
null && element.
vBase < 0)
9308 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static Act Create(int id)
virtual bool ShouldAllyAttack(Chara tg)
virtual bool CancelOnAggro
override string ToString()
virtual bool CancelWhenMoved
string GetCurrentActionText()
virtual Point GetDestination()
virtual void OnPerformWork(bool realtime)
bool TryCancelInteraction(bool sound=true)
void SetTurbo(int mtp=-1)
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
static void Search(Chara c, bool manual=false)
virtual TargetType TargetType
bool IsTargetHostileParty()
virtual bool CanRapidFire
static Affinity Get(Chara c)
void SetStr(int id, string value=null)
void SetInt(int id, int value=0)
virtual RendererReplacer GetRendererReplacer()
virtual bool PreventRegen
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool TryMove(Point p)
Element GetDefenseAttribute(Chara c=null)
bool TryNullify(Condition c)
void Mod(int a, bool force=false)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual void OnEndPlayerTurn()
virtual ConditionType Type
virtual string GetPhaseStr()
static void Set(CardBlueprint _bp)
static CardBlueprint CharaGenEQ
GlobalCharaList globalCharas
void PlayAnime(AnimeID id, bool force)
RendererReplacer replacer
void Teleport(Point point, bool silent=false, bool force=false)
void MakeRefFrom(string id)
int EvalueMax(int ele, int min=0)
ElementContainerCard elements
Hostility c_originalHostility
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
bool HasElement(int ele, int req=1)
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
virtual void SetBlessedState(BlessedState s)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void ModCurrency(int a, string id="money")
virtual bool IsAliveInCurrentZone
Card MakeFoodFrom(string _id)
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
BlessedState blessedState
bool TryStackTo(Thing to)
virtual bool IsPCFactionMinion
void ApplyBacker(int bid)
void ModExp(string alias, int a)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
void Say(string lang, string ref1=null, string ref2=null)
SourceBlock.Row sourceBlock
SourceFloor.Row sourceFloor
SourceMaterial.Row matObj
SourceFloor.Row sourceBridge
SourceMaterial.Row matFloor
SourceFloor.Row sourceSurface
void RemoveBodyPartAt(int idx)
void SetOwner(Chara chara, bool deserialized=false)
void AddBodyPart(int ele, Thing thing=null)
bool IsTooHeavyToEquip(Thing thing)
AttackStyle GetAttackStyle()
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
int GetWeight(bool armorOnly=false)
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
void RemoveBodyPart(int ele)
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
static Chara Create(string id, int lv=-1)
override void SetOwner(Card c)
SourceCategory.Row GetFavCat()
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
void Refresh(bool calledRecursive=false)
void ChangeRace(string idNew)
void SetHomeZone(Zone zone)
static List< Chara > _pts
void ModTempElement(int ele, int a, bool naturalDecay=false)
override string actorPrefab
override bool IsAliveInCurrentZone
bool IsFriendOrAbove(Chara c)
int GetBurden(Card t=null, int num=-1)
override void ApplyEditorTags(EditorTag tag)
Hostility OriginalHostility
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
bool CanAcceptGift(Chara c, Card t)
WorkSummary GetWorkSummary()
override void Rotate(bool reverse=false)
Chara CreateReplacement()
override Sprite GetImageSprite()
MoveResult TryMoveFrom(Point p)
void MoveHome(Zone zone, int x=-1, int z=-1)
void ChangeMemberType(FactionMemberType type)
void CureTempElements(int p, bool body, bool mind)
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
void SetFaction(Faction f)
Element GetBuffStats(string alias)
void Cuddle(Chara c, bool headpat=false)
bool IsCriticallyWounded(bool includeRide=false)
bool CanInteractTo(Point p)
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
void TryPutShared(Thing t, List< Thing > containers=null, bool dropIfFail=true)
void CureHost(CureType type, int p=100, BlessedState state=BlessedState.Normal)
void RefreshWorkElements(ElementContainer parent=null)
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
void InstantEat(Thing t=null, bool sound=true)
Goal GetGoalFromTimeTable(int hour)
Condition AddCondition(string id, int p=100, bool force=false)
override Sprite GetSprite(int dir=0)
Thing FindAmmo(Thing weapon)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
GoalListType goalListType
void OnSleep(int power, int days=1)
override CardRow sourceRenderCard
override int GetArmorSkill()
void SetFaith(Religion r)
bool IsValidGiftWeight(Card t, int num=-1)
Condition AddCondition(Condition c, bool force=false)
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
void Kick(Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true)
static List< SourceCategory.Row > _listFavCat
void SetFeat(int id, int value=1, bool msg=false)
bool CanSeeLos(Card c, int dist=-1)
void DamageTempElements(int p, bool body, bool mind)
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
override string ToString()
void TryTakeSharedItems(IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
ElementContainer tempElements
void TryPutSharedItems(bool msg=true)
void SetMainElement(int id, int v=0, bool elemental=false)
void ApplyRace(bool remove=false)
bool CanAcceptItem(Card t, int num=-1)
bool TryWorkOutside(SourceHobby.Row sourceWork)
override void OnSerializing()
List< Condition > conditions
void HoldCard(Card t, int num=-1)
void PickHeld(bool msg=false)
bool HasCondition(string alias)
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
static List< Thing > _ListItems
void SetMainElement(string id, int v=0, bool elemental=false)
Thing GetBestRangedWeapon()
void DiminishTempElements(int a=1)
override string GetName(NameStyle style, int num=-1)
Chara SetGlobal(Zone _home, int x, int z)
override string GetHoverText()
override void OnDeserialized()
override void SetSource()
bool TryHoldCard(Card t, int num=-1, bool pickHeld=false)
static List< Hobby > listHobby
int CalcCastingChance(Element e, int num=1)
bool ShouldEquip(Thing t, bool useFav=false)
bool CanMoveTo(Point p, bool allowDestroyPath=true)
void DestroyPath(Point pos)
override CardRenderer _CreateRenderer()
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
override bool IsPCFaction
override bool IsPCPartyMinion
void CalculateMaxStamina()
void MoveZone(Zone z, ZoneTransition transition)
void TryUpgrade(bool msg=true)
void Kick(Point p, bool ignoreSelf=false)
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
override void LookAt(Point p)
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
override bool IsPCFactionMinion
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
bool CanEat(Thing t, bool shouldEat=false)
bool ShouldThrowAway(Thing t, ClearInventoryType type)
ElementContainer _baseWorkElements
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
void SetAIImmediate(AIAct g)
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
void PickOrDrop(Point p, Thing t, bool msg=true)
static GoalHobby _goalHobby
override bool IsDeadOrSleeping
List< Hobby > ListHobbies(bool useMemberType=true)
void MakeAlly(bool msg=true)
void RemoveLastBodyPart(bool msg=false)
ElementContainer baseWorkElements
void TickWork(VirtualDate date)
void Stumble(int mtp=100)
void ClearInventory(ClearInventoryType type)
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
FactionMemberType memberType
string TalkTopic(string topic="calm")
string GetIdPortraitCat()
bool HasHigherGround(Card c)
void TryRestock(bool onCreate)
void RestockInventory(bool onCreate)
bool MoveNeighborDefinitely()
void ChangeJob(string idNew)
SourceThing.Row GetFavFood()
void SetTempHand(int right=0, int left=0)
void ApplyJob(bool remove=false)
void AddRandomBodyPart(bool msg=false)
List< Hobby > ListWorks(bool useMemberType=true)
Card DropHeld(Point dropPos=null)
void Revive(Point p=null, bool msg=false)
void GainAbility(int ele, int mtp=100)
void TryReservePickupTutorial(Thing t)
LayerDrama ShowDialog(string book, string step="main", string tag="")
void RefreshFaithElement()
ElementContainer faithElements
override void ChangeRarity(Rarity r)
void GiveLovePotion(Chara c, Thing t)
void AddCooldown(int idEle, int turns=0)
void RerollHobby(bool extraSlotChance=true)
Thing MakeGene(DNA.Type? type=null)
void RefreshSpeed(Element.BonusInfo info=null)
static List< SourceRace.Row > ListAdvRace
bool CanBeTempAlly(Chara c)
override string AliasMaterialOnCreate
void ModWeight(int a, bool ignoreLimit=false)
override CardRow sourceCard
bool CanInteractTo(Card c)
string GetTopicText(string topic="calm")
static NoGoal _NoGoalRepeat
void ModCorruption(int a)
void RestockEquip(bool onCreate)
override void SetDir(int d)
MoveResult TryMoveTowards(Point p)
bool FindNearestNewEnemy()
Element GetFavWeaponSkill()
void DropThing(Thing t, int num=-1)
void GiveGift(Chara c, Thing t)
void EQ_Item(string s, int num=1)
string GetTextHappiness()
override bool IsMultisize
void EnhanceTempElements(int p, bool body, bool mind)
Chara SetEnemy(Chara c=null)
void CallHelp(Chara tg, bool fanatic=false)
void DoHostileAction(Card _tg, bool immediate=false)
Thing GiveBirth(Thing t, bool effect)
bool CanSeeSimple(Point p)
void RequestProtection(Chara attacker, Action< Chara > action)
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
void ClearBed(Map map=null)
override void SetRenderParam(RenderParam p)
void AddResistCon(Condition con)
void MoveZone(Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
bool UseAbility(Act a, Card tc=null, Point pos=null, bool pt=false)
bool TryEquip(Thing t, bool useFav=false)
override SubPassData GetSubPassData()
void EnhanceTempElement(int ele, int p)
bool CanSeeLos(Point p, int dist=-1)
void ResistCon(Condition con)
void SetSummon(int duration)
Element GetFavArmorSkill()
bool IsEnemyOnPath(Point p, bool cancelAI=true)
void InitStats(bool onDeserialize=false)
void MoveHome(string id, int x=-1, int z=-1)
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true)
bool TryIdentify(Thing t, int count=1, bool show=true)
Thing TryPoisonPotion(Thing t)
void TryTakeSharedItems(bool msg=true)
override void LookAt(Card c)
static List< SourceThing.Row > _listFavFood
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
static string[] IDTimeTable
TimeTable.Span CurrentSpan
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
void TrySetEnemy(Chara c)
override void OnCreate(int genLv)
void TryAbsorbRod(Thing t)
string GetTextWork(bool simple=false)
void TryPush(Point point)
string GetTextHobby(bool simple=false)
Dictionary< int, int > resistCon
void OnSleep(Thing bed=null, int days=1)
override string GetHoverText2()
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true)
int ParseBodySlot(string s)
bool CanEquipRanged(Thing t)
void Sleep(Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
void OnGiveErohon(Thing t)
void DamageTempElement(int ele, int p)
AttackStyle GetFavAttackStyle()
bool HasCooldown(int idEle)
static GoalWork _goalWork
void DoAI(int wait, Action onPerform)
ElementContainer workElements
static List< SourceJob.Row > ListAdvJob
void MoveZone(string alias)
void SetPCCState(PCCState state)
Element GetBuffStats(int ele)
void MakeGrave(string lastword)
override void OnBeforeCreate()
UD_String_MatData matColors
Gradient gradientLVComparison
void Kill(bool silent=false)
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
static void Collect(Thing t)
bool ignoreBackerDestoryFlag
BackerContentConfig backer
static Thing GenerateGene(Chara c, Type? type=null)
int GetRaw(int offsetHours=0)
static void TryWarnMana(Action action)
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
static Effect Get(Effect original)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Dictionary< int, Element > dict
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)
Element SetBase(string alias, int v, int potential=0)
Element GetElement(string alias)
static SourceElement.Row Get(int id)
virtual int GetPower(Card c)
static Element Create(int id, int v=0)
virtual Act.Cost GetCost(Chara c)
static List< SourceElement.Row > ListElements
static int[] List_MainAttributesMajor
TileInfo GetTileInfo(int gx, int gy)
static Expedition Create(Chara c, ExpeditionType type)
static SourceFloor.Row sourceSnow
static SourceFloor.Row sourceIce
static bool IsTatami(int id)
static SourceFloor.Row sourceWood
ExpeditionManager expeditions
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
Dictionary< string, Faction > dictAll
List< string > Apply(int a, ElementContainer owner, bool hint=false)
override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
static void Proc(Chara c, Thing food)
Dictionary< int, byte > lastPoints
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
bool disableDeathPenaltyProtection
UD_String_ElementRef elements
ConfigPreference preference
ConfigAutoCombat autoCombat
ReligionManager religions
bool Save(bool isAutoSave=false, bool silent=false)
PCCUniformManager uniforms
void Refresh(Chara owner, GoalListType type)
void ValidateHobby(Chara c)
bool FindWork(Chara c, bool setAI=true)
static GuildFighter Fighter
int GetEfficiency(Chara c)
static bool Has(string id)
static string[] GetList(string id)
static string _currency(object a, string IDCurrency)
static void SetDirty(Element a)
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
static void SetDirty(Thing t)
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
static SourceMaterial.Row sourceOak
static SourceMaterial.Row sourceSnow
static SourceMaterial.Row sourceIce
Thing FindThing(Func< Thing, bool > func)
Chara FindChara(string id)
void MoveCard(Point p, Card t)
void SetLiquid(int x, int z, CellEffect effect=null)
void SetFoormark(Point pos, int id, int angle, int offset=0)
void SetEffect(int x, int z, CellEffect effect=null)
static ThirstPersonInfo thirdPerson1
static string SayNothingHappen()
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
void RemoveMember(Chara c)
void AddMemeber(Chara c, bool showMsg=false)
void RequestPathImmediate(PathProgress progress)
Point GetFirstStep(Point origin, Point _dest, IPathfindWalker walker, int maxDist=20, MoveType moveType=MoveType.Default)
static PathManager Instance
List< PathFinderNode > nodes
void EndTurn(bool consume=true)
void EnterLocalZone(bool encounter=false, Chara mob=null)
HashSet< int > doneBackers
Thing DropReward(Thing t, bool silent=false)
bool TryAbortAutoCombat(bool immediate=true)
SourceMaterial.Row matFloor
SourceBlock.Row sourceBlock
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
void SetObj(int id=0, int value=1, int dir=0)
ref Vector3 Position(int height)
List< Card > ListCards(bool includeMasked=false)
override string ToString()
Point Set(int _x, int _z)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Point GetPointTowards(Point dest)
bool Equals(int _x, int _z)
List< Chara > ListCharas()
SourceFloor.Row sourceFloor
void SetBlock(int idMat=0, int idBlock=0)
Point GetRandomNeighbor()
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
bool IsActive(int id, int days=-1)
static string GetRandomPortrait(string idDict)
static HashSet< string > allIds
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
virtual void OnGiveItem(Chara c, Thing t)
void OnSetGoal(AIAct newGoal)
static int Range(int min, int max)
static void UseSeed(int seed, Action action)
static void SetSeed(int a=-1)
static int Set(Zone zone)
Dictionary< string, Religion > dictAll
ReligionMoonShadow MoonShadow
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
static Religion recentWrath
void Revelation(string idTalk, int chance=100)
int ConvertTile(int tile)
bool ContainsTag(string _tag)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
static void ShakeCam(string id="default", float magnitude=1f)
SourceCharaText charaText
SourceCategory categories
virtual bool ShowDangerLv
virtual bool IsSnowCovered
static int GetAffinityMod(int phase)
static StatsSleepiness Sleepiness
static StatsHygiene Hygiene
static StatsBurden Burden
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
static StatsStamina Stamina
static StatsHunger Hunger
static SubPassData Default
static TargetTypeSelfParty SelfParty
void Foreach(Action< Thing > action, bool onlyAccessible=true)
static void TryLickChest(Thing chest)
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
static Thing CreateParcel(string idLang=null, params Thing[] things)
static Thing CreateSpellbook(string alias, int num=1)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing CreateScroll(int ele, int num=1)
static Thing CreateCurrency(int a, string id="money")
static Thing Create(string id, int idMat=-1, int lv=-1)
override string GetName(NameStyle style, int _num=-1)
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
virtual bool UseRandomAlias
virtual bool CanExtendBuild
virtual void OnTickHeld()
virtual void OnSteppedOut(Chara c)
virtual bool CanBeDestroyed
virtual bool CanRead(Chara c)
virtual bool CanEat(Chara c)
virtual bool IsChangeFloorHeight
virtual void OnStepped(Chara c)
virtual void OnDrink(Chara c)
virtual bool CanBeDropped
virtual Action GetHealAction(Chara c)
virtual void SetName(ref string s)
virtual bool CanDrink(Chara c)
virtual bool CanOnlyCarry
virtual void OnBlend(Thing t, Chara c)
static void Reserve(string idStep, Action onBeforePlay=null)
static void Play(string idStep)
UIItem AddHeaderCard(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Condition CurrentCondition
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
FilterResult IsFilterPass(string text)
List< WorkSession > hobbies
void SendPackage(Thing p)
virtual ZoneTransition.EnterState ReturnState
virtual void OnLeaveZone()
void SetBGM(List< int > ids, bool refresh=true)
int CountMinions(Chara c)
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
virtual bool WillAutoSave
virtual bool KeepAllyDistance
virtual bool HiddenInRegionMap
void RefreshListCitizen()
Card AddCard(Card t, Point point)
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)