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 =
"T8")]
66 [JsonProperty(PropertyName =
"1")]
69 [JsonProperty(PropertyName =
"2")]
72 [JsonProperty(PropertyName =
"3")]
75 [JsonProperty(PropertyName =
"4")]
78 [JsonProperty(PropertyName =
"8")]
79 public string[]
_strs =
new string[5];
81 [JsonProperty(PropertyName =
"9")]
182 private static List<Chara>
_pts =
new List<Chara>();
472 if (base.c_originalHostility == (
Hostility)0)
474 if (!
source.hostility.IsEmpty())
480 return base.c_originalHostility;
490 if (
source.idActor.Length <= 1)
520 return "CharaActorPCC";
532 if (base.dir != 1 && base.dir != 2)
548 return base.dir == 2;
562 return base.ExistsOnMap;
628 return base.c_uidMaster != 0;
704 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);
706 public override int WeightLimit => Mathf.Max((base.STR * 500 + base.END * 250 +
Evalue(207) * 2000) * ((!
HasElement(1411)) ? 1 : 5) + 45000, 1000);
710 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
716 if (base.c_idMainElement == 0)
724 public override int DV
735 num = 50 + (num - 50) / 10;
738 int WeaknessMod(
int a)
740 if (HasCondition<ConWeakness>())
753 public override int PV
764 num = 50 + (num - 50) / 10;
767 int WeaknessMod(
int a)
769 if (HasCondition<ConWeakness>())
840 if (!
IsGlobal && !base.isSubsetCard)
872 return race.id ==
"mutant";
886 return race.tag.Contains(
"humanSpeak");
898 return EClass.Branch.uidMaid == base.uid;
918 public bool IsEyth => faith.id ==
"eyth";
924 if (!
source.works.Contains(
"Rich"))
926 return source.hobbies.Contains(
"Rich");
940 if (base.c_genes !=
null)
942 return base.c_genes.GetGeneSlot(
this);
981 if (!h.
source.elements.IsEmpty())
983 for (
int i = 0; i < h.
source.elements.Length; i += 2)
985 int ele = h.
source.elements[i];
986 int v = h.
source.elements[i + 1];
1016 if (base.rarity >=
Rarity.Legendary)
1031 if (
host ==
null || includeRide)
1035 return base.hp <
MaxHP / 5;
1050 return num > num2 + 0.1f;
1143 return p.cell.room.data.accessType
switch
1146 BaseArea.AccessType.Private =>
false,
1173 for (
int i = 0; i < slots.Count; i++)
1182 _cbits1.Bits = (uint)
_cints[0];
1193 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1202 if (
source.tag.Contains(
"boss"))
1219 string text = base.c_altName ??
source.GetName(
this);
1223 if (base.c_bossType ==
BossType.Evolved)
1225 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1228 if (text.Length > 0 &&
char.IsLower(text[0]))
1230 if (base.rarity >=
Rarity.Legendary)
1232 text = text.ToTitleCase();
1236 text = text.AddArticle();
1243 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1248 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1253 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1255 return text + text2;
1260 if (r != base.rarity)
1296 if (uniqueData !=
null)
1335 base.isSubsetCard =
false;
1337 base.c_uidMaster = 0;
1369 if (
source.tag.Contains(
"boss"))
1373 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1396 if (
source.idActor.Length > 2)
1405 if (
source.mainElement.Length != 0)
1407 int _genLv = Mathf.Min(genLv, 100);
1408 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1409 string[] mainElement =
source.mainElement;
1410 for (
int i = 0; i < mainElement.Length; i++)
1412 string[] array = mainElement[i].Split(
'/');
1414 int num2 = source.LV * row.eleP / 100;
1415 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1417 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1420 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1423 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1425 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1426 if (list.Count >= 2)
1428 num = tuple.Item3 + base.LV -
source.LV;
1433 base.c_altName = NameGen.getRandomName();
1437 _alias = AliasGen.GetRandomAlias();
1449 if (base.LV > 5 &&
race.id ==
"mutant")
1451 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1459 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1486 case "olderyoungersister":
1489 case "sister_undead":
1493 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1512 if (!
source.faith.IsEmpty())
1575 base.isHidden =
false;
1578 if (
host !=
null && !calledRecursive)
1591 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1592 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1594 chara.SetFaith(
faith);
1595 chara.bio = IO.DeepCopy(
bio);
1597 chara.c_daysWithGod = base.c_daysWithGod;
1598 chara.RefreshFaithElement();
1599 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1600 chara.isCopy =
true;
1610 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1619 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1629 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1645 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1651 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1675 else if (
host !=
null)
1709 num = 50 + Mathf.Clamp((
int)Mathf.Sqrt(num2) * 5 -
EClass.
_zone.
DangerLv / 50, 0, 50) + Mathf.Clamp((
int)Mathf.Sqrt(num2), 0, 25);
1710 if (info !=
null && num != 100)
1732 num -= (
IsPC ? 50 : 100);
1772 num += EClass.player.lastEmptyAlly *
Evalue(1646);
1777 num += EClass.player.lastEmptyAlly * 10 - 10;
1783 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
1784 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
1786 if (HasCondition<ConGravity>())
1789 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
1799 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
1810 if (value.
source.category ==
"skill")
1830 this.hostility = hostility2;
1836 this.hostility = hostility2;
1842 this.hostility = hostility2;
1857 base.ApplyEditorTags(tag);
1865 Debug.LogWarning(
"Chara " +
id +
" not found");
1874 if (!
id.StartsWith(
"ele"))
1883 if (base.c_idMainElement != 0)
1885 SetElements(base.c_idMainElement,
remove:
true);
1886 base.c_idMainElement = 0;
1891 SetElements(
id,
remove:
false);
1892 base.c_idMainElement =
id;
1895 base.isElemental =
true;
1898 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);
1902 void SetElements(
int idEle,
bool remove)
1962 base.c_idJob = idNew;
1990 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
1994 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2015 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2024 string[] array =
race.figure.Split(
'|');
2025 foreach (
string s
in array)
2038 string[] array =
race.figure.Split(
'|');
2039 foreach (
string s
in array)
2061 base.c_idRace = idNew;
2077 Debug.Log(
"Creating Replacement NPC for:" +
this);
2105 this.hostility = hostility2;
2107 base.c_summonDuration = 0;
2108 base.isSummon =
false;
2130 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2131 this.hostility = hostility2;
2132 base.c_uidMaster = _master.
uid;
2133 base.c_minionType = type;
2140 base.c_uidMaster = 0;
2145 if (chara.
enemy ==
this)
2157 base.c_summonDuration = duration;
2158 base.isSummon =
true;
2205 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2224 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2229 if (cells[x, z].blocked)
2233 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2240 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2245 if (cells[x, z].blocked)
2249 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2275 if (detail !=
null && detail.
charas.Count > 0)
2310 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2320 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2325 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2332 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2337 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2368 List<Point> list =
new List<Point>();
2416 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2425 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2434 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2443 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2461 int num = p.x -
pos.
x;
2462 int num2 = p.z -
pos.
z;
2479 if (num == 0 && num2 == 0)
2489 return TryMove(point, allowDestroyPath:
false);
2498 if (!condition.
TryMove(newPoint))
2503 if (base.isRestrained)
2509 base.isRestrained =
false;
2511 if (!
CanMoveTo(newPoint, allowDestroyPath))
2515 return _Move(newPoint);
2566 EClass.player.lastZonePos =
null;
2569 for (
int i = 0; i < num2 * 4; i++)
2580 EClass.player.regionMoveWarned =
true;
2581 Msg.
Say(
"regionAbortMove");
2589 AddCondition<ConSuffocation>((
EClass.
pc.
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2590 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2597 ModExp(200, 1 + num4 * 12);
2600 EClass.player.regionMoveWarned =
false;
2608 num = EClass.setting.defaultActPace * 3f;
2635 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2637 newPoint = randomNeighbor;
2645 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2650 if (effect !=
null && effect.
id == 7)
2655 Say(
"abWeb_caught",
this);
2657 effect2.power = effect2.power * 3 / 4;
2661 Say(
"abWeb_pass",
this);
2670 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2685 traitDoor.TryOpenLock(
this);
2695 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2698 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2728 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2729 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2731 text = cell.
matObj.soundFoot;
2743 if (!text.IsEmpty())
2745 SoundManager.altLastData =
IsPC;
2752 bool flag5 = scene.actionMode.gameSpeed > 1f;
2753 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2754 scene.psFoot.startColor = row.
matColor;
2758 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
2782 Say(
"replace_pc", chara, chara2);
2793 traitDoor2.TryOpen(
this);
2820 if (!
item.isThing ||
item.placeState != 0 ||
item.ignoreAutoPick)
2832 if ((dataPick.
noRotten &&
item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
2849 foreach (
int cat
in dataPick.
cats)
2851 if (
item.category.uid == cat)
2857 else if (!dataPick.
flag.HasFlag(containerFlag))
2899 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
2931 EClass.player.flags.isShoesOff =
false;
2938 EClass.player.flags.isShoesOff =
true;
2956 EClass._map.MineBlock(_p, recoverBlock: false, this);
2959 EClass._map.MineObj(_p, null, this);
2965 EClass._map.MineObj(_p, null, this);
2972 if (t.isNPCProperty && t.trait.CanBeDestroyed)
2978 t.SetPlaceState(PlaceState.roaming);
2994 if (list.Count == 0)
2998 list.Copy().ForeachReverse(delegate(
Chara c)
3002 List<Point> list2 = new List<Point>();
3003 for (int i = point.x - 1; i <= point.x + 1; i++)
3005 for (int j = point.z - 1; j <= point.z + 1; j++)
3007 if (i != point.x || j != point.z)
3009 Point point2 = new Point(i, j);
3010 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3017 if (list2.Count > 0)
3019 if (list2.Count > 1)
3021 list2.ForeachReverse(delegate(Point p)
3023 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3029 Point newPoint = list2.RandomItem();
3032 Say(
"displace",
this, c);
3042 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3044 Say(
"pushed_money",
this, c);
3109 if (z == currentZone)
3113 if (HasCondition<ConInvulnerable>())
3115 RemoveCondition<ConInvulnerable>();
3119 EClass.player.nextZone = z;
3127 EClass.player.returnInfo.turns += 5;
3134 EClass.player.deathZoneMove =
false;
3136 currentZone.events.OnLeaveZone();
3137 if (currentZone.instance !=
null)
3151 EClass.player.uidLastZone = currentZone.uid;
3154 if (currentZone.IsRegion)
3162 Msg.
Say(
"leaveZone", currentZone.Name);
3164 else if (z.
id != currentZone.id)
3168 EClass.player.lastZonePos = pos.Copy();
3170 EClass.player.lastTransition = transition;
3182 if (party !=
null && party.
leader ==
this)
3194 Debug.Log(base.Name);
3197 transition.uidLastZone = currentZone?.uid ?? 0;
3198 global.transition = transition;
3202 global.transition =
null;
3205 EClass.player.lastTransition =
null;
3208 if (IsBranchMember())
3219 public void MoveHome(
string id,
int x = -1,
int z = -1)
3234 CureCondition<ConSuspend>();
3261 orgPos =
new Point(x, z);
3262 if (factionBranch !=
null)
3264 RefreshWorkElements();
3276 state = ZoneTransition.EnterState.Fall,
3286 renderer.RefreshSprite();
3289 public override void Rotate(
bool reverse =
false)
3291 if (renderer.hasActor)
3293 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3297 base.dir = ((base.dir == 0) ? 1 : 0);
3300 renderer.RefreshSprite();
3310 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3313 if (angle > 100f && angle < 170f)
3317 else if (angle > 170f && angle < 190f)
3321 else if (angle > 190f || (angle < -10f && angle > -100f))
3331 else if (angle > 170f && angle < 235f)
3335 else if (angle > 80f && angle < 145f)
3339 else if (angle > -100f && angle < -35f)
3343 else if (angle > -10f && angle < 55f)
3347 renderer.RefreshSprite();
3358 else if (base.dir == 1)
3362 else if (base.dir == 2)
3366 else if (base.dir == 3)
3371 else if (base.dir == 0)
3375 else if (base.dir == 1)
3379 else if (base.dir == 2)
3383 else if (base.dir == 3)
3392 if (!renderer.hasActor)
3394 if (angle == 0f || angle == 45f || angle == 90f)
3398 if (angle == -135f || angle == 180f || angle == -90f)
3408 return renderer.actor.currentDir;
3414 for (
int i = -num; i < num + 1; i++)
3416 for (
int j = -num; j < num + 1; j++)
3418 shared.
Set(pos.x + i, pos.z + j);
3429 for (
int num = conditions.Count - 1; num >= 0; num--)
3431 if (conditions[num].ConsumeTurn)
3441 if (_cooldowns !=
null)
3446 consumeTurn =
false;
3447 preventRegen =
false;
3448 emoIcon =
Emo2.none;
3451 base.c_summonDuration--;
3452 if (base.c_summonDuration <= 0)
3460 AddCondition<ConWet>(20);
3465 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3470 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3485 if (parasite !=
null)
3487 ModExp(227, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.
LV) * 25));
3491 ModExp(226, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.
LV) * 25));
3498 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3506 if (turn % 200 == 0)
3508 DiminishTempElements();
3520 preventRegen =
true;
3524 Say(
"dmgBurden",
this);
3525 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3537 ModExp(207, 1 + phase2 * phase2);
3565 preventRegen =
true;
3569 if (
EClass.
rnd(100) == 0 && !isConfused)
3572 AddCondition<ConConfuse>(500);
3577 AddCondition<ConBlind>(200);
3580 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3588 int num2 = Evalue(409);
3589 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3594 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3596 if (num3 < conditions.Count)
3611 preventRegen =
true;
3624 if (
id ==
"tsunami")
3626 if (elements.Base(79) < 30)
3633 elements.SetTo(79, elements.Base(79) * 3 / 4);
3638 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3640 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3641 elements.ModExp(300, 8);
3646 elements.ModExp(301, 8);
3665 if (parasite !=
null)
3677 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3688 ignoreSPAbsorb =
false;
3691 if (hasMovedThisTurn)
3693 pos.Things.ForeachReverse(delegate(
Thing t)
3701 hasMovedThisTurn =
false;
3704 EClass.player.haltMove =
false;
3738 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3749 if (!tileInfo.
shore)
3754 int num2 = (tileInfo.isRoad ? 22 : 12);
3757 num2 = (tileInfo.isRoad ? 16 : 10);
3761 num2 *= (flag2 ? 2 : 20);
3772 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3785 EClass.player.pickupDelay = 0f;
3809 Msg.
Say(
"returnComplete");
3810 EClass.player.uidLastTravelZone = 0;
3812 EClass.player.lastZonePos =
null;
3814 EClass.player.returnInfo =
null;
3817 EClass.player.returnInfo =
null;
3818 Msg.
Say(
"returnOverweight");
3821 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
3829 RecipeUpdater.dirty =
true;
3835 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
3836 hasMovedThisTurn =
false;
3839 if (!IsAliveInCurrentZone)
3843 renderer.RefreshStateIcon();
3844 if (host !=
null && !consumeTurn)
3846 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
3852 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
3854 Say(
"parasite_fail",
this, host);
3855 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
3857 Talk(
"parasite_fail");
3872 if (base.isRestrained)
3893 Cell cell = base.Cell;
3896 AddCondition<ConWet>(50);
3897 if (pos.IsHotSpring)
3904 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
3920 AddCondition<ConWet>(50);
3924 PlaySound(
"fire_step");
3925 AddCondition<ConBurning>(30);
3930 PlaySound(
"bubble");
3931 AddCondition<ConWet>(30);
3936 if (hasMovedThisTurn)
3938 Say(
"abMistOfDarkness_step",
this);
3961 aliasEle = EClass.sources.elements.map[e.idEle].alias,
3990 if (rootCard !=
this && things.IsFull(c.
Thing))
3997 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4007 if (things.GetDest(t).IsValid)
4028 t = TryPoisonPotion(t);
4036 Say(
"backpack_full_drop", t);
4043 Say(
"backpack_full", t);
4047 if (dest.
stack !=
null)
4051 PlaySound(
"pick_thing");
4052 Say(
"pick_thing",
this, t);
4060 PlaySound(
"pick_thing");
4061 Say(
"pick_thing",
this, t);
4063 TryReservePickupTutorial(t);
4073 Say(
"poisonDrip",
this);
4087 Say(
"absorbRod",
this, t);
4090 if (
rod.source !=
null)
4093 if (enumerator.MoveNext())
4125 if (t.
id ==
"pasture")
4137 foreach (
Card item in pos.ListCards())
4142 if (thing !=
null && !IsPC)
4144 thing.isNPCProperty =
true;
4189 t.isNPCProperty =
false;
4191 pos.TryWitnessCrime(
this);
4200 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4204 if (num == -1 || num > t.
Num)
4215 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4229 WidgetHotbar.dirtyCurrentItem =
true;
4240 if (IsPC && held.
invY == 1)
4242 WidgetHotbar.dirtyCurrentItem =
true;
4254 Say(
"canOnlyCarry", held);
4259 if (!flag && things.IsOverflowing())
4263 Say(
"backpack_full_drop", held);
4271 PlaySound(
"pick_thing");
4272 Say(
"pick_held",
this,
card);
4273 if (IsPC &&
card.id ==
"statue_weird")
4280 WidgetHotbar.dirtyCurrentItem =
true;
4295 return held.
Split(a);
4318 WidgetHotbar.dirtyCurrentItem =
true;
4323 if (
card.trait.CanOnlyCarry)
4334 Msg.
Say(
"markedImportant");
4349 t.ignoreAutoPick =
true;
4360 int num = Evalue(131);
4361 int num2 = Evalue(130);
4362 int num3 = Evalue(123);
4363 if (num > num2 && num > num3)
4367 if (num2 > num && num2 > num3)
4371 if (num3 > num && num3 > num2)
4385 if (elements.Value(122) > elements.Value(120))
4387 return elements.GetElement(122);
4389 return elements.GetElement(120);
4394 isOnCreate = onCreate;
4399 RestockInventory(onCreate);
4404 string equip = source.
equip;
4405 if (equip.IsEmpty())
4409 if (equip ==
"none")
4419 EQ_ID(
"staff_long", 1);
4427 EQ_ID(
"sword_zephir");
4430 case "adv_mesherada":
4433 EQ_ID(
"dagger_hathaway");
4439 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4443 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4449 EQ_ID(
"sword_muramasa");
4455 EQ_ID(
"dagger_gaki");
4459 EQ_ID(
"dagger_ninto");
4463 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4469 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4480 EQ_ID(
"helm_seeker");
4483 EQ_ID(
"sword_katana");
4485 EQ_ID(
"sword_katana");
4488 EQ_ID(
"boots_seven");
4492 for (
int i = 0; i < 20; i++)
4497 AddThing(
"plat").SetNum(6);
4503 AddThing(
"guitar_efrond");
4509 AddThing(
"guitar_ash");
4515 EQ_ID(
"EtherDagger");
4522 if (onCreate || !TryEquipRanged())
4524 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4529 if (onCreate || !TryEquipRanged())
4535 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4540 if (race.
id ==
"asura")
4542 for (
int j = 0; j < 4; j++)
4544 EQ_CAT(job.
weapon.RandomItem());
4547 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4553 else if (!job.
weapon.IsEmpty())
4557 EQ_CAT(job.
weapon.RandomItem());
4559 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4561 EQ_CAT(job.
weapon.RandomItem());
4609 Restock(
"book_story", 1);
4611 case "rock_thrower":
4619 Restock(
"book_story_home", 1);
4624 void Restock(
string id,
int num)
4626 if (things.Find(
id) ==
null)
4637 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4638 Rarity rarity2 = base.rarity;
4639 if (
id ==
"big_sister")
4641 num = (isOnCreate ? 8 : 4);
4649 rarity =
Rarity.Superior;
4651 else if (rarity2 ==
Rarity.Legendary)
4655 else if (rarity2 >=
Rarity.Mythical)
4661 rarity =
Rarity.Legendary;
4663 CardBlueprint.current.rarity = rarity;
4671 CardBlueprint.current.rarity = r;
4674 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
4679 if (!body.
Equip(thing))
4690 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
4695 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
4732 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
4736 Msg.
Say(
"returnHome",
this, homeZone.Name);
4753 base.hp = MaxHP / 3;
4756 if (hunger.
value > 30)
4760 sleepiness.value = 0;
4761 hostility = OriginalHostility;
4762 RemoveCondition<StanceTaunt>();
4767 Msg.
Say(
"noDeathPenalty2",
this);
4771 Msg.
Say(
"noDeathPenalty",
this);
4777 List<Thing> dropList =
new List<Thing>();
4782 t.ignoreAutoPick = true;
4785 }, onlyAccessible:
false);
4791 EClass.player.preventDeathPenalty =
false;
4793 if (IsPCFaction && homeBranch !=
null)
4795 homeBranch.
Log(
"bRevive",
this);
4808 PlayEffect(
"revive");
4810 SetCensored(enable:
false);
4818 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
4821 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
4825 if (!lastword.IsEmpty())
4827 thing.c_note = lastword;
4829 thing.isModified =
true;
4875 if (HasCondition<ConAnorexia>())
4881 else if (base.c_vomit > 10)
4883 AddCondition<ConAnorexia>();
4885 AddCondition<ConDim>();
4886 if (HasCondition<ConAnorexia>())
4900 if (isDead || host !=
null)
4904 bool isInActiveZone = IsInActiveZone;
4913 if (
id ==
"tsunami")
4915 pos.PlaySound(
"water");
4919 Say(
"summon_vanish",
this);
4920 pos.PlayEffect(
"vanish");
4921 pos.PlaySound(
"vanish");
4936 PlayEffect(
"revive");
4937 PlaySound(
"chime_angel");
4944 PlaySound(base.material.GetSoundDead(source));
4946 renderer.RefreshSprite();
4947 renderer.RefreshStateIcon();
4952 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
4955 text =
"dead_" + attackSource;
4961 text =
"dead_" + e.source.alias;
4970 EClass._zone.isDeathLocation =
true;
4971 string s = ((origin ==
null) ? text :
"dead_by");
4983 AI_PlayMusic.keepPlaying =
false;
4989 Msg.
Say(
"goto_heaven",
this);
4993 if (origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
4995 Msg.
Say(text,
this,
"", text2);
4997 string text3 = TalkTopic(
"dead");
4998 if (!text3.IsEmpty())
5000 text3 = text3.StripBrackets();
5002 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5017 if (homeBranch !=
null)
5019 homeBranch.
Log(text,
this,
"");
5031 if (
id ==
"mandrake")
5033 Say(
"a_scream",
this);
5038 ClearTempElements();
5041 base.isSale =
false;
5052 EClass.player.returnInfo =
null;
5053 EClass.player.uidLastTravelZone = 0;
5062 chara2.enemy =
null;
5067 EClass.player.preventDeathPenalty =
true;
5072 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5081 currentZone.RemoveCard(
this);
5083 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5086 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5090 ModAffinity(
EClass.
pc, a, show:
false);
5092 if (!(text4 ==
"quru"))
5094 if (text4 ==
"corgon")
5106 if (origin.IsPCParty || origin.IsPCPartyMinion)
5109 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5113 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5120 num = num * 30 / 100;
5131 else if (origin.IsPCFaction)
5133 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5134 origin.Chara.ShowEmo(
Emo.love);
5137 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5141 if (base.IsPCFactionOrMinion)
5145 Msg.
Say(
"abort_allyDead");
5150 Msg.
Say(
"abort_enemyDead");
5152 if (IsPCParty && !IsPC)
5155 base.c_wasInPcParty =
true;
5161 if (attackSource !=
AttackSource.DeathSentense && !IsPCFaction)
5163 EClass.player.flags.little_killed =
true;
5175 case "shark_sister":
5184 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5188 if (chara.
LV < base.LV)
5190 chara.
SetLv(base.LV);
5193 Msg.
Say(
"plant_pop",
this, chara);
5197 item.OnCharaDie(
this);
5203 if (IsPCFaction || IsPCFactionMinion)
5210 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5216 flag = (flag2 =
true);
5217 EClass._zone.Boss =
null;
5222 EClass.player.flags.KilledBossInVoid =
true;
5228 SE.Play(
"Jingle/fanfare2");
5238 flag = (flag2 =
true);
5246 case "melilith_boss":
5248 flag = (flag2 =
true);
5255 flag = (flag2 =
true);
5257 if (questExploration !=
null)
5259 SE.Play(
"kill_boss");
5269 SE.Play(
"kill_boss");
5270 SoundManager.ForceBGM();
5276 SE.Play(
"kill_boss");
5280 EClass.player.willAutoSave =
true;
5301 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true)
5303 if (!IsAliveInCurrentZone)
5329 Say(
"kick",
this, t);
5349 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5354 if (!IsPC && HasCooldown(a.
id))
5358 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422))
5360 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5361 int num = list.IndexOf(a.
id);
5364 int num2 = list.TryGet(num + Evalue(1422));
5365 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5374 if (IsPC && HasCondition<StanceManaCost>())
5376 num4 = Evalue(1657);
5388 ForeachEnemy(delegate
5395 ForeachParty(delegate
5411 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5413 int num6 = cost.cost * num5 / 100;
5416 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5426 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5434 ActPlan.warning =
true;
5437 if (UseAbility(a, tc, pos, pt))
5446 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))
5448 Say(
"shakeHead",
this);
5451 if (tc !=
null && tc !=
this)
5455 if (pos !=
null && !base.pos.Equals(pos))
5461 num3 = 1 + Evalue(1648);
5463 if (IsPC && cost.
cost > 0 && a.
Value == 0)
5470 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5471 if (!a.
source.tag.Contains(
"useHand"))
5473 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5486 a.vPotential -= i * 2;
5487 num6 = num6 * (100 - num4 * 20) / 100;
5496 else if (a.
source.langAct.Length != 0 && tc !=
null)
5498 string text = a.
source.langAct[0];
5499 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5500 if (text ==
"spell_hand")
5503 string @ref = text2.lang(list2[4]);
5504 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5508 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
5512 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
5518 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5528 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5532 ignoreSPAbsorb =
true;
5535 if (a is
Spell && GetCondition<ConSilence>() !=
null)
5537 Say(
"cast_silence",
this);
5544 int spellExp = elements.GetSpellExp(
this, a, num5);
5547 Say(
"fizzle",
this);
5548 PlayEffect(
"fizzle");
5549 PlaySound(
"fizzle");
5552 ModExp(a.
id, spellExp / 5);
5554 RemoveCondition<ConInvisibility>();
5558 if (HasTalk(
"phrase_" + a.
source.alias))
5560 EClass.player.forceTalk =
true;
5561 Talk(
"phrase_" + a.
source.alias);
5568 ForeachEnemy(delegate(
Chara c)
5575 ForeachParty(delegate(
Chara c)
5580 Act.forcePt =
false;
5584 for (
int j = 0; j < num3; j++)
5590 ActEffect.RapidCount = j;
5592 flag2 = a.
Perform(
this, tc, pos);
5595 if (flag2 && !isDead)
5599 ModExp(a.
id, spellExp);
5601 if (a.
source.alias.StartsWith(
"sword_"))
5606 ActEffect.RapidCount = 0;
5607 if (!IsPC && a.
source.cooldown > 0)
5609 AddCooldown(a.
id, a.
source.cooldown);
5611 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
5613 RemoveCondition<ConInvisibility>();
5616 void ForeachEnemy(Action<Chara> action)
5618 if (_pts.Count == 0)
5623 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
5629 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
5631 action(_pts[num11]);
5634 void ForeachParty(Action<Chara> action)
5636 if (_pts.Count == 0)
5643 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
5654 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
5661 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
5672 return 25 + Evalue(226) * 125 / 100;
5688 if (host.
ride ==
this)
5690 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
5694 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
5699 int num3 = Evalue(304);
5702 num3 = Mathf.Max(num3, base.LV + 5);
5706 bool num6 = GetArmorSkill() == 122;
5710 num4 = 20 - Evalue(122) / 5;
5711 num5 += 10 - Evalue(1654) * 4;
5715 num4 = 10 - Evalue(120) / 5;
5725 if (parasite !=
null)
5736 num5 += 10 - Evalue(1654) * 4;
5742 if (HasCondition<ConDim>())
5744 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
5754 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / (10 + num3 * 10), 0, 100 - num5);
5757 public void DoAI(
int wait, Action onPerform)
5772 Say(headpat ?
"headpat" :
"cuddle",
this, c);
5778 if (headpat &&
this != c)
5789 if (!member.
IsPC && CanSeeLos(member))
5799 if (c.
id ==
"hedgehog_ether")
5803 Say(
"reflect_thorne", c,
this);
5835 if (enemy ==
null && !IsPC)
5837 if (GetInt(106) == 0)
5841 if (OriginalHostility !=
Hostility.Enemy)
5845 SetEnemy(_tg.
Chara);
5859 if (_tg ==
null || !_tg.
isChara)
5866 EClass.pc.combatCount = 10;
5874 chara.
Say(
"frown",
this, chara);
5886 chara.
Say(
"frown",
this, chara);
5893 bool flag = chara.id ==
"fanatic";
5896 chara.
Say(
"callHelp", chara);
5968 bool flag = enemy !=
null || ai is
GoalCombat;
5969 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
5971 bool flag3 = !IsPCParty;
5977 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2))
5981 int num3 = Dist(chara2);
5982 int num4 = GetSightRadius() + (flag ? 1 : 0);
5989 if (
this == pos.FirstChara)
5991 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
5999 DoHostileAction(chara2);
6012 DoHostileAction(chara);
6024 if (chara !=
this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6026 DoHostileAction(chara);
6045 if (base.IsPCFactionOrMinion)
6058 if (OriginalHostility >=
Hostility.Friend)
6099 return EClass.game.activeZone == currentZone;
6106 foreach (
Point item2
in item.ListPoints())
6108 if (pos.Equals(item2))
6129 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6147 if (race.
id ==
"spider" && source.
tiles.Length > 1)
6149 base.idSkin = (EClass.core.config.game.antiSpider ? 1 : 0);
6153 charaRenderer.pccData = PCCData.Create(
"ride");
6154 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6155 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6156 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6160 foreach (
Condition condition
in conditions)
6163 if (rendererReplacer !=
null)
6165 charaRenderer.replacer = rendererReplacer;
6166 charaRenderer.data = rendererReplacer.
data;
6170 if (charaRenderer.
replacer ==
null)
6172 charaRenderer.pccData = pccData;
6175 renderer = charaRenderer;
6177 if (cardRenderer !=
null)
6179 renderer.SetFirst(first:
false, cardRenderer.
position);
6181 return charaRenderer;
6188 PCC.Get(pccData).Build(state);
6196 PCC pCC = PCC.Get(pccData);
6198 return pCC.variation.idle[0, 0];
6200 if (spriteReplacer !=
null)
6204 return sourceCard.
GetSprite(0, (sourceCard.
_tiles.Length > 1) ? ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6225 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && GetBool(123))
6234 p.mat = base.material;
6235 p.matColor = base.colorInt;
6236 if (!renderer.usePass)
6240 if (renderer.replacer !=
null)
6242 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6248 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6253 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6256 else if (sourceCard.
_tiles.Length > 1)
6258 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6259 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6263 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6270 string text = base.Name;
6271 if (IsFriendOrAbove())
6275 else if (IsHostile())
6281 if (base.LV >= lV * 5)
6285 else if (base.LV >= lV * 2)
6289 else if (base.LV <= lV / 4)
6293 else if (base.LV <= lV / 2)
6299 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6300 s = (
" (" + s.lang() +
") ").TagSize(14);
6304 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6308 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6314 text2 +=
"lowerGround".lang();
6316 else if (HasHigherGround(
EClass.
pc))
6318 text2 +=
"higherGround".lang();
6321 if (Evalue(1232) > 0)
6323 text2 =
"milkBaby".lang().TagSize(14) + text2;
6327 text2 =
"hasBounty".lang().TagSize(14) + text2;
6331 text2 += (
"(" + faith.Name +
")").TagSize(14);
6333 return text + text2 + s;
6341 text += Environment.NewLine;
6342 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6347 text2 += Environment.NewLine;
6348 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6349 text2 += Environment.NewLine;
6351 text2 += Environment.NewLine;
6352 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6353 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.
idSkin;
6357 text2 += Environment.NewLine;
6358 text2 +=
"<size=14>";
6361 text2 = text2 + item.Name +
", ";
6363 foreach (
Hobby item2
in ListHobbies())
6365 text2 = text2 + item2.Name +
", ";
6367 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
6370 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6371 if (enumerable.Count() > 0)
6373 text3 += Environment.NewLine;
6374 text3 +=
"<size=14>";
6379 if (text4.IsEmpty() || text4 ==
"#")
6384 switch (item3.
source.group)
6397 text4 = text4 +
"(" + item3.
GetValue() +
")";
6398 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
6400 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
6404 text3 = text3 + text4.TagColor(c) +
", ";
6413 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6418 text3 += Environment.NewLine;
6421 text3 = text3 + item4.act.Name +
", ";
6423 text3 = text3.TrimEnd(
", ".ToCharArray());
6425 return text + text2 + text3;
6430 string key = source.
idText.IsEmpty(
id);
6440 string text = row.GetText(topic, returnNull:
true);
6445 if (text.StartsWith(
"@"))
6452 text = row.GetText(topic, returnNull:
true);
6458 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6463 if (host ==
null && !IsInActiveZone)
6467 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6473 int num = EClass.pc.party.members.Count - 1;
6498 string topicText = GetTopicText(topic);
6499 if (topicText.IsEmpty())
6503 string text =
"_bracketTalk".lang();
6504 bool flag = topicText.StartsWith(
"*");
6505 bool flag2 = topicText.StartsWith(
"(");
6506 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
6507 topicText = ApplyTone(topicText);
6508 topicText = topicText.Replace(
"~",
"*");
6510 Msg.
Say(topicText.Replace(
"&",
""));
6511 if (topic ==
"dead")
6515 else if (flag || flag3 || flag2)
6517 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
6535 if (conSuspend !=
null && IsPCParty)
6537 RemoveCondition<ConSuspend>();
6539 if (IsDeadOrSleeping)
6541 ShowDialog(
"_chara",
"sleep");
6543 else if (base.isRestrained)
6545 ShowDialog(
"_chara",
"strain");
6549 ShowDialog(
"_chara",
"invisible");
6551 else if (IsEscorted())
6553 ShowDialog(
"_chara",
"escort");
6557 ShowDialog(
"_chara",
"party");
6572 EClass.player.flags.loytelEscaped =
false;
6574 ShowDialog(
"loytel",
"loytelEscaped");
6578 if (questDebt !=
null && questDebt.
paid)
6581 if (questDebt.
stage > 7)
6583 questDebt.stage = 7;
6585 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
6593 ShowDialog(
"_chara");
6599 ShowDialog(
"farris",
"nymelle_noQuest");
6602 ShowDialog(
"farris",
"nymelle_first");
6605 ShowDialog(
"farris",
"home_first");
6608 ShowDialog(
"_chara");
6613 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6615 SoundManager.ForceBGM();
6620 ShowDialog(
"ashland");
6624 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6626 SoundManager.ForceBGM();
6633 EClass.player.flags.fiamaFirstDream =
true;
6634 ShowDialog(
"fiama",
"firstDream");
6638 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
6640 EClass.player.flags.fiamaStoryBookGiven =
true;
6646 ShowDialog(
"fiama");
6651 ShowDialog(
"fiama");
6657 ShowDialog(
"big_sister",
"little_saved");
6658 EClass.player.flags.little_saved =
false;
6663 ShowDialog(
"big_sister",
"little_dead");
6664 EClass.player.flags.little_killed =
false;
6672 ShowDialog(
"guild_doorman",
"main", tag);
6678 ShowDialog(
"guild_clerk",
"main", tag2);
6692 ShowDialog(
"_chara");
6699 return _ShowDialog(
book,
null, step, tag);
6705 if (
book ==
"_chara" && IsPC)
6719 return base.LV / 2 + 4;
6725 if (FindBed() !=
null)
6734 return GetHappiness().ToString() ??
"";
6739 string result =
"?????";
6752 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
6762 sortVal = job._index * 10000 + sourceCard.
_index;
6765 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
6768 sortVal = -GetTotalFeat();
6771 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
6784 foreach (
Card item in map.props.installed.all)
6788 traitBed.RemoveHolder(
this);
6807 if (!IsPCFaction && !IsGuest())
6816 Msg.
Say(
"claimBed",
this);
6825 if (GetInt(113) != 0)
6830 Thing bestRangedWeapon = GetBestRangedWeapon();
6831 foreach (
Thing thing
in things)
6837 _ListItems.Add(thing);
6841 _ListItems.Add(thing);
6845 if (_ListItems.Count == 0)
6849 List<Thing> containers2 = containers.ToList();
6850 foreach (
Thing listItem
in _ListItems)
6874 bool flag = GetInt(113) == 0;
6883 foreach (
Thing thing3
in things)
6885 if (CanEat(thing3, shouldEat))
6893 if (thing3.
id ==
"polish_powder")
6907 foreach (
Thing container
in containers)
6917 if (num3 > 0 && thing4.
id ==
"polish_powder")
6919 _ListItems.Add(thing4);
6924 _ListItems.Add(thing4);
6929 _ListItems.Add(thing4);
6932 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
6934 _ListItems.Add(thing4);
6939 _ListItems.Add(thing4);
6944 _ListItems.Add(thing4);
6949 if (_ListItems.Count == 0)
6953 _ListItems.ForeachReverse(delegate(
Thing t)
6958 int slot = t.category.slot;
6959 int equipValue = t.GetEquipValue();
6960 foreach (Thing listItem in _ListItems)
6962 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
6970 _ListItems.Remove(t);
6975 foreach (
Thing listItem2
in _ListItems)
6977 Thing thing = listItem2;
6978 if (things.IsFull(thing))
6985 thing = thing.
Split(2);
6992 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
6994 TryEquip(thing, useFav:
true);
7000 TryPutSharedItems(containers);
7006 Thing result =
null;
7014 int num2 = CountNumEaten(
item);
7015 int num3 = 100 - num2;
7029 t = FindBestFoodToEat();
7041 Say(
"eat_start",
this, t.Duplicate(1));
7072 if (!CanEquipRanged(t))
7077 foreach (
Thing thing
in things)
7098 if (bodySlot ==
null)
7104 switch (GetFavAttackStyle())
7152 if (!ShouldEquip(t, useFav))
7163 switch (GetFavAttackStyle())
7179 body.
Equip(t, slot);
7185 Say(
"equip",
this, t);
7201 return FindThrowable(hotbar:
true);
7205 things.Foreach(delegate(
Thing t)
7207 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7213 Thing FindThrowable(
bool hotbar)
7215 things.Foreach(delegate(
Thing t)
7252 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7257 Thing result =
null;
7259 foreach (
Thing thing
in things)
7282 if (ranged !=
null && ranged.
parent ==
this)
7286 ranged = GetBestRangedWeapon();
7287 return ranged !=
null;
7292 if (body.
GetWeight(armorOnly:
true) <= 30000)
7317 if (t.
id ==
"cigar")
7322 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7324 SetAIImmediate(
new AI_Eat
7343 if (base.hp < MaxHP * 90 / 100)
7346 if (healAction !=
null)
7357 return FindBed()?.owner.pos.cell.room;
7372 if (IsPCFaction && homeBranch !=
null)
7374 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7387 Say(
"affinityNone",
this, c);
7392 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7396 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7402 a = affinity.
Mod(a);
7408 int num = Evalue(289);
7420 num2 += (lV - num) * 10;
7422 elements.
ModExp(289, Mathf.Min(num2, 1000));
7438 chara.orgPos = orgPos.
Copy();
7440 chara.pos = pos.
Copy();
7441 chara.isImported =
true;
7442 chara.c_editorTags = base.c_editorTags;
7443 chara.c_editorTraitVal = base.c_editorTraitVal;
7444 chara.c_idTrait = base.c_idTrait;
7445 chara.homeZone = homeZone;
7451 if (_listFavFood.Count == 0)
7455 if (row._origin ==
"dish" && row.value != 0)
7457 _listFavFood.Add(row);
7464 r = _listFavFood.RandomItem();
7472 if (_listFavCat.Count == 0)
7478 _listFavCat.Add(row);
7484 r = _listFavCat.RandomItem();
7492 if (base.c_upgrades !=
null)
7494 num += base.c_upgrades.spent;
7496 if (base.c_genes !=
null)
7498 num += base.c_genes.GetTotalCost();
7500 return num + base.feat;
7507 if (
item.act.id == 6630)
7517 string text = race.
id;
7518 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
7531 if (
id ==
"olderyoungersister")
7533 if (base.idSkin != 2)
7535 return "UN_olderyoungersister";
7537 return "UN_olderyoungersister_alt";
7543 return base.c_idPortrait;
7560 if (HasElement(1231))
7563 AddCondition<ConEuphoric>(100 * Evalue(1231));
7567 SetFeat(1231, 1, msg:
true);
7574 int num2 = ((!HasElement(1411)) ? 1 : 3);
7575 if (GetBurden(t, num) >= num2)
7588 if (!IsValidGiftWeight(t, num))
7596 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
7605 if (things.IsFull())
7632 Msg.
Say(
"affinityNone", c,
this);
7638 int num2 = 200 + t.LV * 3;
7654 c.
Say(
"draw_curse", c, t);
7656 List<Element> list =
new List<Element>();
7664 if (list.Count == 0)
7669 Element element = list.RandomItem();
7675 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
7677 GiveLovePotion(c, t);
7691 case "ticket_massage":
7698 case "ticket_armpillow":
7706 case "ticket_champagne":
7713 if (t.
id ==
"flyer")
7718 c.
Talk(
"flyer_miss");
7724 Msg.
Say(
"affinityNone", c,
this);
7726 elements.ModExp(291, 10);
7729 elements.ModExp(291, 50);
7731 if (t.
id ==
"statue_weird")
7752 Say(
"give_erohon",
this);
7753 AddCondition<ConParalyze>(50, force:
true);
7754 AddCondition<ConConfuse>(50, force:
true);
7755 AddCondition<ConFear>(1000, force:
true);
7763 c.
Say(
"give_love", c, t);
7773 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this || (host !=
null && host.
isRestrained) || (base.IsPCFactionOrMinion && attacker.
IsPCFactionOrMinion))
7789 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
7790 int num2 = Dist(chara);
7795 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7801 if (Dist(chara) < 5)
7808 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
7816 Say(
"intercept_loyal", chara,
this);
7819 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7824 if (!flag && !HasElement(1225))
7826 Say(
"intercept", chara,
this);
7829 chara.
Talk(
"intercept", base.NameSimple);
7831 if (attacker.enemy ==
this)
7833 attacker.SetEnemy(chara);
7895 if (t.
id ==
"flyer")
7915 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
7917 Thing thing = things[num2];
7918 if (ShouldThrowAway(thing, type))
7929 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
7937 _ = base.c_upgrades;
7946 for (
int i = 0; i < 100; i++)
7952 if (base.c_upgrades ==
null)
7956 if (base.c_upgrades.halt)
7967 List<Element> list = ListAvailabeFeats(pet:
true);
7968 if (num >= 90 && list.Count > 0)
7970 Element element = list.RandomItem();
7974 else if (num >= 60 && ie.Any())
7976 num2 = ie.RandomItem().id;
7987 if (num4 > base.feat)
7992 base.c_upgrades.count++;
7993 base.c_upgrades.spent += num4;
7999 if (
item.idEle == num2)
8020 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8022 else if (elements.ValueWithoutLink(row.
id) == 0)
8024 elements.Learn(row.
id);
8028 elements.ModBase(num2, num3);
8035 if (_cooldowns ==
null)
8037 _cooldowns =
new List<int>();
8041 _cooldowns.Add(idEle * 1000 + turns);
8047 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8053 if (_cooldowns !=
null)
8055 for (
int i = 0; i < _cooldowns.Count; i++)
8057 if (_cooldowns[i] / 1000 == idEle)
8068 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8070 if (_cooldowns[num] % 1000 == 1)
8072 _cooldowns.RemoveAt(num);
8079 if (_cooldowns.Count == 0)
8092 if (IsPCParty || base.noMove)
8097 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8100 if (goalFromTimeTable !=
null)
8102 SetAI(goalFromTimeTable);
8105 goalFromTimeTable.
Tick();
8110 if (goalList.
index == -2)
8112 goalList.
Refresh(
this, goalListType);
8114 SetAI(goalList.
Next());
8138 return GetGoalWork();
8144 return GetGoalHobby();
8186 return SetAI(_NoGoalPC);
8204 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8208 if (HasCondition<ConWait>())
8210 RemoveCondition<ConWait>();
8216 renderer.RefreshStateIcon();
8223 bool hasNoGoal = HasNoGoal;
8258 listHobby.Add(
new Hobby
8269 foreach (
int work
in _works)
8271 listHobby.Add(
new Hobby
8285 if (_hobbies ==
null)
8289 foreach (
int hobby
in _hobbies)
8291 listHobby.Add(
new Hobby
8304 if (
item.source.alias ==
id)
8309 foreach (
Hobby item2
in ListHobbies())
8311 if (item2.
source.alias ==
id)
8321 if (workElements !=
null)
8325 workElements =
null;
8326 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
8334 foreach (
Hobby item2
in ListWorks())
8338 if (workElements !=
null)
8342 void TryAdd(
Hobby h)
8344 if (!h.
source.elements.IsEmpty())
8346 if (workElements ==
null)
8350 for (
int i = 0; i < h.
source.elements.Length; i += 2)
8352 int num = h.
source.elements[i];
8353 int num2 = h.
source.elements[i + 1];
8355 if (num != 2115 && num != 2207)
8363 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
8371 string text = (simple ?
"" : (
"hobby".lang() +
":"));
8376 return text.TrimEnd(
',');
8381 string text = (simple ?
"" : (
"work".lang() +
":"));
8386 return text.TrimEnd(
',');
8391 foreach (
int hobby
in _hobbies)
8403 foreach (
int work
in _works)
8415 if (_hobbies !=
null && _works !=
null)
8422 _hobbies =
new List<int>();
8423 _works =
new List<int>();
8431 string[] hobbies = source.
hobbies;
8432 foreach (
string key
in hobbies)
8437 if (source.
works.IsEmpty())
8443 string[] hobbies = source.
works;
8444 foreach (
string key2
in hobbies)
8449 GetWorkSummary().Reset();
8454 if (_workSummary ==
null)
8458 return _workSummary;
8471 if (workSummary.
work !=
null)
8476 else if (workSummary.
hobbies.Count > 0)
8497 hobby.id = session.
id;
8502 workSummary.progress +=
EClass.
rnd(5) + 5;
8504 int num = PerformWork(hobby, 0, isHobby);
8505 int num2 = PerformWork(hobby, 1, isHobby);
8506 int num3 = PerformWork(hobby, 2, isHobby);
8507 int num4 = PerformWork(hobby, 3, isHobby);
8508 workSummary.money += num;
8509 workSummary.food += num2;
8510 workSummary.knowledge += num3;
8511 workSummary.material += num4;
8512 int PerformWork(
Hobby work,
int idx,
bool isHobby)
8514 if (idx >= work.
source.resources.Length)
8518 int num5 = work.
source.resources[idx];
8520 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
8521 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
8522 if (num6 > 0 && num5 <= 0)
8532 _goalWork.
FindWork(
this, setAI:
false);
8548 foreach (
Condition condition
in conditions)
8550 condition.
SetOwner(
this, onDeserialize);
8556 return AddCondition(typeof(T).Name, p, force);
8569 if (c is
ConBleed && ResistLv(964) >= 3)
8574 else if (ResistLv(950) >= 3)
8592 if (c.
source.negate.Length != 0)
8594 string[] negate = c.
source.negate;
8595 foreach (
string text
in negate)
8597 if (HasElement(text))
8604 if (defenseAttribute !=
null)
8606 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
8608 if (c.
source.resistance.Length != 0)
8613 c.power /= num * num + 1;
8626 for (
int j = 0; j < conditions.Count; j++)
8628 if (conditions[j].
id != c.
id)
8634 conditions[j].Kill();
8637 if (conditions[j].CanStack(c))
8639 if (conditions[j].WillOverride)
8641 conditions[j].Kill(silent:
true);
8644 if (CanGainConResist)
8648 conditions[j].OnStacked(c.
power);
8649 conditions[j].OnStartOrStack();
8650 conditions[j].PlayEffect();
8652 if (!conditions[j].AllowMultipleInstance)
8657 foreach (
Condition condition
in conditions)
8664 int num2 = c.EvaluateTurn(c.power);
8671 if (CanGainConResist)
8678 if (c.ShouldRefresh)
8690 if (c.SyncRide && (ride !=
null || parasite !=
null))
8696 if (parasite !=
null)
8704 public override bool HasCondition<T>()
8706 for (
int i = 0; i < conditions.Count; i++)
8708 if (conditions[i] is T)
8718 for (
int i = 0; i < conditions.Count; i++)
8720 if (conditions[i].source.alias == alias)
8735 for (
int i = 0; i < conditions.Count; i++)
8739 return conBuffStats.elements.GetElement(ele);
8745 public void CureCondition<T>(
int v = 99999) where T :
Condition
8747 T condition = GetCondition<T>();
8748 if (condition !=
null)
8750 condition.value -= v;
8751 if (condition.value <= 0)
8760 for (
int i = 0; i < conditions.Count; i++)
8762 if (conditions[i] is T)
8764 return conditions[i] as T;
8772 for (
int num = conditions.Count - 1; num >= 0; num--)
8774 if (conditions[num] is T)
8776 conditions[num].
Kill();
8784 if (parasite !=
null)
8786 parasite.
Cure(type, p, state);
8790 ride.
Cure(type, p, state);
8792 Cure(type, p, state);
8802 CureCondition<ConFear>();
8803 CureCondition<ConBlind>(2 * p / 100 + 5);
8804 CureCondition<ConPoison>(5 * p / 100 + 5);
8805 CureCondition<ConConfuse>(10 * p / 100 + 10);
8806 CureCondition<ConDim>(p / 100 + 5);
8807 CureCondition<ConBleed>(2 * p / 100 + 10);
8814 CureCondition<ConBlind>(5 * p / 100 + 15);
8815 CureCondition<ConPoison>(10 * p / 100 + 15);
8816 CureCondition<ConBleed>(5 * p / 100 + 20);
8817 CureTempElements(p, body:
true, mind:
false);
8820 CureCondition<ConFear>();
8821 CureCondition<ConDim>(3 * p / 100 + 10);
8822 CureTempElements(p, body:
false, mind:
true);
8826 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
8828 Condition condition2 = conditions[num2];
8833 condition2.
Mod(-1, force:
true);
8841 CureCondition<ConWait>();
8842 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
8843 bool flag2 = HasCondition<ConAnorexia>();
8844 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
8845 if (base.c_vomit < 0)
8850 RemoveCondition<ConAnorexia>();
8860 CureTempElements(p * 100, body:
true, mind:
true);
8861 for (
int num = conditions.Count - 1; num >= 0; num--)
8876 CureCondition<ConWait>();
8877 CureCondition<ConSleep>();
8881 RemoveCondition<ConBrightnessOfLife>();
8886 if (HasElement(1206))
8888 SetFeat(1206, 0, msg:
true);
8902 if (
TC.hp >
TC.MaxHP * Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) / 100)
8906 if (
TC.HasElement(427))
8914 PlaySound(
"hit_finish");
8916 Say(
"finish2",
this,
TC);
8926 if (resistCon ==
null)
8928 resistCon =
new Dictionary<int, int>();
8930 if (resistCon.ContainsKey(key))
8932 resistCon[key] += con.power * con.GainResistFactor / 100;
8936 resistCon[key] = con.power * con.GainResistFactor / 100;
8943 if (con.
power > 0 && resistCon !=
null)
8945 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
8963 RemoveCondition<ConAwakening>();
8968 con.pcPillow = pillow;
8969 con.pickup = pickup;
8970 con.posBed = posBed;
8971 con.posPillow = posPillow;
8978 int num =
bed?.Power ?? 20;
8979 if (traitPillow !=
null)
8981 num += traitPillow.owner.Power / 2;
8985 num +=
bed.Evalue(750) * 5;
8996 int num = power * days;
8997 if (stamina.
value < 0)
9002 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9018 int height = bio.height;
9019 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9024 if (height != bio.height)
9026 bio.height = height;
9027 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
9037 int weight = bio.weight;
9038 int height = bio.height;
9039 int num = height * height * 18 / 25000;
9040 int num2 = height * height * 24 / 10000;
9041 if (ignoreLimit || (weight > num && weight < num2))
9043 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9048 if (weight != bio.weight)
9050 bio.weight = weight;
9051 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
9060 if (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0)
9064 int num = Evalue(412);
9067 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
9068 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
9075 int num3 = (corruption + a) / 100 - corruption / 100;
9076 for (
int i = 0; i < Mathf.Abs(num3); i++)
9078 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
9085 foreach (
Element value
in elements.dict.Values)
9087 if (value.
source.category ==
"ether")
9089 num4 += value.
Value;
9092 if (num4 > 0 && IsPC)
9096 corruption = num4 * 100 + corruption % 100;
9101 List<Element> list =
new List<Element>();
9104 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
9105 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
9114 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
9116 Feat feat = elements.GetElement(
id) as
Feat;
9118 if (feat !=
null && feat.
Value > 0)
9120 if (value == feat.
Value)
9129 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
9134 elements.Remove(
id);
9139 CalculateMaxStamina();
9145 if (feat.
source.textInc.IsEmpty())
9147 PlaySound(
"ding_skill");
9149 Say(
"gainFeat",
this, feat.
FullName);
9153 bool flag = value < num;
9154 if (feat.
source.tag.Contains(
"neg"))
9158 PlaySound(
"mutation");
9160 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9162 elements.CheckSkillActions();
9169 Element element = elements.GetElement(idEle);
9170 Element element2 = elements.GetElement(row2.
id);
9171 int num = element?.
Value ?? 0;
9180 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
9181 if (a == 0 && (element ==
null || element.
Value == 0))
9183 SayNothingHappans();
9186 if (element !=
null && element.
Value == a)
9188 SayNothingHappans();
9191 if (element2 !=
null && element2.
Value > 0)
9193 SetFeat(element2.
id, 0);
9196 PlaySound(
"mutation");
9197 PlayEffect(
"mutation");
9199 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9204 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
9206 Say(
"resistMutation",
this);
9210 for (
int i = 0; i < tries; i++)
9213 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9216 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9217 if (base.c_corruptionHistory.Count == 0)
9219 base.c_corruptionHistory =
null;
9222 Element element = elements.GetElement(row.
id);
9224 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))
9231 element = elements.GetElement(row.
id);
9233 bool flag = row.
tag.Contains(
"neg");
9246 if (element !=
null)
9248 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
9249 if (num > element.
source.max)
9251 num = element.source.max - 1;
9253 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
9254 flag2 = num > element.
Value;
9255 if (vec > 0 && !flag2)
9260 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
9261 SetFeat(row.
id, num);
9264 if (base.c_corruptionHistory ==
null)
9266 base.c_corruptionHistory =
new List<int>();
9268 base.c_corruptionHistory.Add(row.
id);
9271 Element element2 = elements.GetElement(row.
id);
9276 EClass.player.flags.gotEtherDisease =
true;
9278 thing.
SetStr(53,
"letter_ether");
9287 PlaySound(ether ?
"mutation_ether" :
"mutation");
9288 PlayEffect(
"mutation");
9290 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9294 Say(
"nothingHappens");
9300 Element orCreateElement = elements.GetOrCreateElement(ele);
9303 elements.ModBase(orCreateElement.
id, 1);
9305 if (orCreateElement is
Spell)
9307 int num = mtp * orCreateElement.source.charge * (100 + Evalue(307) + (HasElement(307) ? 20 : 0)) / 100 / 100;
9308 if (orCreateElement.
source.charge == 1)
9312 orCreateElement.vPotential += Mathf.Max(1, num / 2 +
EClass.
rnd(num / 2 + 1));
9314 Say(
"spell_gain",
this, orCreateElement.
Name);
9326 Msg.
Say(
"curse_nullify", member);
9331 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
9333 Say(
"curse_nullify",
this);
9336 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
9338 Say(
"curse_nullify",
this);
9346 if (_historyFood !=
null)
9348 while (_historyFood.Count > 5)
9350 _historyFood.RemoveAt(_historyFood.Count - 1);
9352 if (_historyFood[0].Count > 0)
9354 _historyFood.Insert(0,
new List<string>());
9361 if (!IsPCFaction || !IsGlobal)
9363 _historyFood =
null;
9366 if (_historyFood ==
null)
9368 _historyFood =
new List<List<string>>
9373 if (_historyFood[0].Count < 5)
9375 _historyFood[0].Add(
food.id);
9381 if (_historyFood ==
null)
9386 foreach (List<string>
item in _historyFood)
9388 foreach (
string item2
in item)
9390 if (item2 ==
food.id)
9403 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9405 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9410 if (faithElements !=
null)
9415 if (idFaith ==
"eyth" && !HasElement(1228))
9430 if (!HasCondition<ConExcommunication>())
9433 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9434 for (
int i = 0; i < array.Length; i += 2)
9436 int num2 = array[i + 1] * num / 50;
9439 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
9441 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9445 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
9451 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
9457 bool flag = HasElement(1215);
9458 if (tempElements ==
null)
9467 int num = elements.ValueWithoutLink(ele);
9468 int num2 = Mathf.Abs(num) + 100;
9469 int num3 = num2 / (flag ? 2 : 4);
9470 int num4 = -num - 100;
9471 int num5 = tempElements.
Base(ele);
9472 int num6 = num5 + a;
9475 num3 = Mathf.Min(a, num3);
9476 num4 = Mathf.Max(a, -num2 / 3);
9478 if (a > 0 && num6 > num3)
9480 a = ((num3 > num5) ? (num3 - num5) : 0);
9482 if (a < 0 && num6 < num4)
9484 a = ((num4 < num5) ? (num4 - num5) : 0);
9487 if (element.
vBase == 0)
9490 if (tempElements.
dict.Count == 0)
9492 tempElements =
null;
9511 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
9517 foreach (
int ele
in array)
9519 EnhanceTempElement(ele, p, onlyRenew);
9525 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
9530 if (tempElements ==
null)
9538 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
9545 if (tempElements !=
null)
9556 void Cure(
int[] eles)
9558 foreach (
int ele
in eles)
9560 if (tempElements ==
null)
9565 if (element !=
null && element.
vBase < 0)
9567 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
9575 if (tempElements !=
null)
9578 tempElements =
null;
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
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)
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=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()
void DamageTempElement(int ele, int p, bool onlyRenew=false)
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
override string actorPrefab
override bool IsAliveInCurrentZone
bool IsFriendOrAbove(Chara c)
int GetBurden(Card t=null, int num=-1)
override void ApplyEditorTags(EditorTag tag)
Thing FindBestFoodToEat()
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)
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=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 EnhanceTempElement(int ele, int p, bool onlyRenew=false)
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)
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 SetMutation(int idEle, int a=0)
void HoldCard(Card t, int num=-1)
void PickHeld(bool msg=false)
bool HasCondition(string alias)
SpriteReplacer spriteReplacer
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)
void EnhanceTempElements(int p, bool body, bool mind, bool onlyRenew=false)
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)
List< List< string > > _historyFood
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)
void AddFoodHistory(Thing food)
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
Chara SetEnemy(Chara c=null)
void CallHelp(Chara tg, bool fanatic=false)
void DoHostileAction(Card _tg, bool immediate=false)
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()
bool CanSeeLos(Point p, int dist=-1)
int CountNumEaten(Thing food)
void ResistCon(Condition con)
void SetSummon(int duration)
Element GetFavArmorSkill()
void DamageTempElements(int p, bool body, bool mind, bool onlyRenew=false)
bool IsEnemyOnPath(Point p, bool cancelAI=true)
void InitStats(bool onDeserialize=false)
void MoveHome(string id, int x=-1, int z=-1)
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()
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)
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
void RemoveMemeber(Chara c)
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
Sprite GetSprite(bool snow=false)
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
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
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)
virtual bool IsUnderwater
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)