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")]
184 private static List<Chara>
_pts =
new List<Chara>();
474 if (base.c_originalHostility == (
Hostility)0)
476 if (!
source.hostility.IsEmpty())
482 return base.c_originalHostility;
492 if (
source.idActor.Length <= 1)
522 return "CharaActorPCC";
534 if (base.dir != 1 && base.dir != 2)
550 return base.dir == 2;
564 return base.ExistsOnMap;
630 return base.c_uidMaster != 0;
706 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 * ((base.IsPCFactionOrMinion ? 100 : (100 + (int)base.rarity * 300)) + (
IsPC ? (
EClass.
player.
lastEmptyAlly *
Evalue(1646)) : 0)) / 100, 1f, 100000000f);
708 public override int WeightLimit => Mathf.Max((base.STR * 500 + base.END * 250 +
Evalue(207) * 2000) * ((!
HasElement(1411)) ? 1 : 5) + 45000, 1000);
712 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
718 if (base.c_idMainElement == 0)
726 public override int DV
737 num = 50 + (num - 50) / 10;
740 int WeaknessMod(
int a)
742 if (HasCondition<ConWeakness>())
755 public override int PV
766 num = 50 + (num - 50) / 10;
769 int WeaknessMod(
int a)
771 if (HasCondition<ConWeakness>())
842 if (!
IsGlobal && !base.isSubsetCard)
994 return race.id ==
"mutant";
1006 return race.tag.Contains(
"humanSpeak");
1018 return EClass.Branch.uidMaid == base.uid;
1044 if (!
source.works.Contains(
"Rich"))
1046 return source.hobbies.Contains(
"Rich");
1060 if (base.c_genes !=
null)
1062 return base.c_genes.GetGeneSlot(
this);
1084 if (!
race.tag.Contains(
"mofu"))
1111 if (!h.
source.elements.IsEmpty())
1113 for (
int i = 0; i < h.
source.elements.Length; i += 2)
1115 int ele = h.
source.elements[i];
1116 int v = h.
source.elements[i + 1];
1146 if (base.rarity >=
Rarity.Legendary)
1161 if (
host ==
null || includeRide)
1165 return base.hp <
MaxHP / 5;
1180 return num > num2 + 0.1f;
1273 return p.cell.room.data.accessType
switch
1276 BaseArea.AccessType.Private =>
false,
1303 for (
int i = 0; i < slots.Count; i++)
1312 _cbits1.Bits = (uint)
_cints[0];
1323 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1332 if (
source.tag.Contains(
"boss"))
1349 string text = base.c_altName ??
source.GetName(
this);
1353 if (base.c_bossType ==
BossType.Evolved)
1355 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1358 if (text.Length > 0 &&
char.IsLower(text[0]))
1360 if (base.rarity >=
Rarity.Legendary)
1362 text = text.ToTitleCase();
1366 text = text.AddArticle();
1373 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1378 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1383 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1385 return text + text2;
1390 if (r != base.rarity)
1418 Hostility hostility2 = (base.c_originalHostility = h);
1419 this.hostility = hostility2;
1435 if (uniqueData !=
null)
1474 base.isSubsetCard =
false;
1476 base.c_uidMaster = 0;
1508 if (
source.tag.Contains(
"boss"))
1512 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1535 if (
source.idActor.Length > 2)
1544 if (
source.mainElement.Length != 0)
1546 int _genLv = Mathf.Min(
genLv, 100);
1547 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1548 string[] mainElement =
source.mainElement;
1549 for (
int i = 0; i < mainElement.Length; i++)
1551 string[] array = mainElement[i].Split(
'/');
1553 int num2 = source.LV * row.eleP / 100;
1554 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1556 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1559 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1562 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle ||
"ele" + a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1564 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1565 if (list.Count >= 2)
1567 num = tuple.Item3 + base.LV -
source.LV;
1572 base.c_altName = NameGen.getRandomName();
1576 _alias = AliasGen.GetRandomAlias();
1588 if (base.LV > 5 &&
race.id ==
"mutant")
1590 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1598 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1625 case "olderyoungersister":
1628 case "sister_undead":
1632 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1651 if (!
source.faith.IsEmpty())
1712 Debug.LogError(
"source is null");
1730 base.isHidden =
false;
1742 if (
EClass.
_zone.
IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() ||
corruption >= 100)
1760 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1761 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1763 chara.SetFaith(
faith);
1764 chara.bio = IO.DeepCopy(
bio);
1766 chara.c_daysWithGod = base.c_daysWithGod;
1767 chara.RefreshFaithElement();
1768 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1769 chara.isCopy =
true;
1779 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1788 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1798 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1814 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1820 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1843 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
1845 else if (
host !=
null)
1870 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
1881 num = 50 + Mathf.Clamp((
int)Mathf.Sqrt(num2) * 5 -
EClass.
_zone.
DangerLv / 50, 0, 50) + Mathf.Clamp((
int)Mathf.Sqrt(num2), 0, 25);
1882 if (info !=
null && num != 100)
1904 num -= (
IsPC ? 50 : 100);
1944 num += EClass.player.lastEmptyAlly *
Evalue(1646);
1949 num += EClass.player.lastEmptyAlly * 10 - 10;
1955 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
1956 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
1958 if (HasCondition<ConGravity>())
1961 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
1971 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
1982 if (value.
source.category ==
"skill")
2002 this.hostility = hostility2;
2008 this.hostility = hostility2;
2014 this.hostility = hostility2;
2029 base.ApplyEditorTags(tag);
2037 Debug.LogWarning(
"Chara " +
id +
" not found");
2046 if (!
id.StartsWith(
"ele"))
2055 if (base.c_idMainElement != 0)
2057 SetElements(base.c_idMainElement,
remove:
true);
2058 base.c_idMainElement = 0;
2063 SetElements(
id,
remove:
false);
2064 base.c_idMainElement =
id;
2067 base.isElemental =
true;
2070 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);
2074 void SetElements(
int idEle,
bool remove)
2134 base.c_idJob = idNew;
2162 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2166 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2187 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2196 string[] array =
race.figure.Split(
'|');
2197 foreach (
string s
in array)
2210 string[] array =
race.figure.Split(
'|');
2211 foreach (
string s
in array)
2233 base.c_idRace = idNew;
2249 Debug.Log(
"Creating Replacement NPC for:" +
this);
2277 this.hostility = hostility2;
2279 base.c_summonDuration = 0;
2280 base.isSummon =
false;
2302 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2303 this.hostility = hostility2;
2304 base.c_uidMaster = _master.
uid;
2305 base.c_minionType = type;
2324 base.c_uidMaster = 0;
2329 if (chara.
enemy ==
this)
2341 base.c_summonDuration = duration;
2342 base.isSummon =
true;
2389 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2408 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2413 if (cells[x, z].blocked)
2417 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2424 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2429 if (cells[x, z].blocked)
2433 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2459 if (detail !=
null && detail.
charas.Count > 0)
2494 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2504 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2509 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2516 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2521 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2552 List<Point> list =
new List<Point>();
2600 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2609 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2618 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2627 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2645 int num = p.x -
pos.
x;
2646 int num2 = p.z -
pos.
z;
2663 if (num == 0 && num2 == 0)
2673 return TryMove(point, allowDestroyPath:
false);
2682 if (!condition.
TryMove(newPoint))
2687 if (base.isRestrained)
2693 base.isRestrained =
false;
2695 if (!
CanMoveTo(newPoint, allowDestroyPath))
2699 return _Move(newPoint);
2750 EClass.player.lastZonePos =
null;
2753 for (
int i = 0; i < num2 * 4; i++)
2764 EClass.player.regionMoveWarned =
true;
2765 Msg.
Say(
"regionAbortMove");
2773 AddCondition<ConSuffocation>((
EClass.
pc.
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2774 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2781 ModExp(200, 1 + num4 * 12);
2784 EClass.player.regionMoveWarned =
false;
2792 num = EClass.setting.defaultActPace * 3f;
2819 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2821 newPoint = randomNeighbor;
2829 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2834 if (effect !=
null && effect.
id == 7)
2839 Say(
"abWeb_caught",
this);
2841 effect2.power = effect2.power * 3 / 4;
2845 Say(
"abWeb_pass",
this);
2854 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2869 traitDoor.TryOpenLock(
this);
2879 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2882 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2912 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2913 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2915 text = cell.
matObj.soundFoot;
2927 if (!text.IsEmpty())
2929 SoundManager.altLastData =
IsPC;
2936 bool flag5 = scene.actionMode.gameSpeed > 1f;
2937 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2938 scene.psFoot.startColor = row.
matColor;
2942 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
2966 Say(
"replace_pc", chara, chara2);
2977 traitDoor2.TryOpen(
this);
3004 if (!
item.isThing ||
item.placeState != 0 ||
item.ignoreAutoPick)
3016 if ((dataPick.
noRotten &&
item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3033 foreach (
int cat
in dataPick.
cats)
3035 if (
item.category.uid == cat)
3041 else if (!dataPick.
flag.HasFlag(containerFlag))
3083 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3115 EClass.player.flags.isShoesOff =
false;
3122 EClass.player.flags.isShoesOff =
true;
3140 EClass._map.MineBlock(_p, recoverBlock: false, this);
3143 EClass._map.MineObj(_p, null, this);
3149 EClass._map.MineObj(_p, null, this);
3156 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3162 t.SetPlaceState(PlaceState.roaming);
3178 if (list.Count == 0)
3182 list.Copy().ForeachReverse(delegate(
Chara c)
3186 List<Point> list2 = new List<Point>();
3187 for (int i = point.x - 1; i <= point.x + 1; i++)
3189 for (int j = point.z - 1; j <= point.z + 1; j++)
3191 if (i != point.x || j != point.z)
3193 Point point2 = new Point(i, j);
3194 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3201 if (list2.Count > 0)
3203 if (list2.Count > 1)
3205 list2.ForeachReverse(delegate(Point p)
3207 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3213 Point newPoint = list2.RandomItem();
3216 Say(
"displace",
this, c);
3226 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3228 Say(
"pushed_money",
this, c);
3293 if (z == currentZone)
3297 if (HasCondition<ConInvulnerable>())
3299 RemoveCondition<ConInvulnerable>();
3303 EClass.player.nextZone = z;
3311 EClass.player.returnInfo.turns += 5;
3318 EClass.player.deathZoneMove =
false;
3320 currentZone.events.OnLeaveZone();
3321 if (currentZone.instance !=
null)
3335 EClass.player.uidLastZone = currentZone.uid;
3338 if (currentZone.IsRegion)
3346 Msg.
Say(
"leaveZone", currentZone.Name);
3348 else if (z.
id != currentZone.id)
3352 EClass.player.lastZonePos = pos.Copy();
3354 EClass.player.lastTransition = transition;
3366 if (party !=
null && party.
leader ==
this)
3378 Debug.Log(base.Name);
3381 transition.uidLastZone = currentZone?.uid ?? 0;
3382 global.transition = transition;
3386 global.transition =
null;
3389 EClass.player.lastTransition =
null;
3392 if (IsBranchMember())
3403 public void MoveHome(
string id,
int x = -1,
int z = -1)
3418 CureCondition<ConSuspend>();
3445 orgPos =
new Point(x, z);
3446 if (factionBranch !=
null)
3448 RefreshWorkElements();
3460 state = ZoneTransition.EnterState.Fall,
3470 renderer.RefreshSprite();
3473 public override void Rotate(
bool reverse =
false)
3475 if (renderer.hasActor)
3477 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3481 base.dir = ((base.dir == 0) ? 1 : 0);
3484 renderer.RefreshSprite();
3494 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3497 if (angle > 100f && angle < 170f)
3501 else if (angle > 170f && angle < 190f)
3505 else if (angle > 190f || (angle < -10f && angle > -100f))
3515 else if (angle > 170f && angle < 235f)
3519 else if (angle > 80f && angle < 145f)
3523 else if (angle > -100f && angle < -35f)
3527 else if (angle > -10f && angle < 55f)
3531 renderer.RefreshSprite();
3542 else if (base.dir == 1)
3546 else if (base.dir == 2)
3550 else if (base.dir == 3)
3555 else if (base.dir == 0)
3559 else if (base.dir == 1)
3563 else if (base.dir == 2)
3567 else if (base.dir == 3)
3576 if (!renderer.hasActor)
3578 if (angle == 0f || angle == 45f || angle == 90f)
3582 if (angle == -135f || angle == 180f || angle == -90f)
3592 return renderer.actor.currentDir;
3598 for (
int i = -num; i < num + 1; i++)
3600 for (
int j = -num; j < num + 1; j++)
3602 shared.
Set(pos.x + i, pos.z + j);
3613 for (
int num = conditions.Count - 1; num >= 0; num--)
3615 if (conditions[num].ConsumeTurn)
3625 if (_cooldowns !=
null)
3630 consumeTurn =
false;
3631 preventRegen =
false;
3632 emoIcon =
Emo2.none;
3635 base.c_summonDuration--;
3636 if (base.c_summonDuration <= 0)
3644 AddCondition<ConWet>(20);
3649 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3654 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3669 if (parasite !=
null)
3671 ModExp(227, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.
LV) * 25));
3675 ModExp(226, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.
LV) * 25));
3682 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3690 if (turn % 200 == 0)
3692 DiminishTempElements();
3704 preventRegen =
true;
3708 Say(
"dmgBurden",
this);
3709 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3721 ModExp(207, 1 + phase2 * phase2);
3749 preventRegen =
true;
3753 if (
EClass.
rnd(100) == 0 && !isConfused)
3756 AddCondition<ConConfuse>(500);
3761 AddCondition<ConBlind>(200);
3764 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3772 int num2 = Evalue(409);
3773 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3778 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3780 if (num3 < conditions.Count)
3795 preventRegen =
true;
3808 if (
id ==
"tsunami")
3810 if (elements.Base(79) < 30)
3817 elements.SetTo(79, elements.Base(79) * 3 / 4);
3822 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3824 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3825 elements.ModExp(300, 8f);
3830 elements.ModExp(301, 8f);
3849 if (parasite !=
null)
3861 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3872 ignoreSPAbsorb =
false;
3875 if (hasMovedThisTurn)
3877 pos.Things.ForeachReverse(delegate(
Thing t)
3881 AI_Goto aI_Goto = ai.Current as AI_Goto;
3882 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3893 hasMovedThisTurn =
false;
3896 EClass.player.haltMove =
false;
3930 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3941 if (!tileInfo.
shore)
3946 int num2 = (tileInfo.isRoad ? 22 : 12);
3949 num2 = (tileInfo.isRoad ? 16 : 10);
3953 num2 *= (flag2 ? 2 : 20);
3964 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3977 EClass.player.pickupDelay = 0f;
3985 EClass.player.returnInfo =
null;
4008 Msg.
Say(
"returnComplete");
4009 EClass.player.uidLastTravelZone = 0;
4011 EClass.player.lastZonePos =
null;
4013 EClass.player.returnInfo =
null;
4016 EClass.player.returnInfo =
null;
4017 Msg.
Say(
"returnOverweight");
4021 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4029 RecipeUpdater.dirty =
true;
4035 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4036 hasMovedThisTurn =
false;
4039 if (!IsAliveInCurrentZone)
4043 renderer.RefreshStateIcon();
4044 if (host !=
null && !consumeTurn)
4046 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4052 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4054 Say(
"parasite_fail",
this, host);
4055 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4057 Talk(
"parasite_fail");
4072 if (base.isRestrained)
4093 Cell cell = base.Cell;
4096 AddCondition<ConWet>(50);
4097 if (pos.IsHotSpring)
4104 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4120 AddCondition<ConWet>(50);
4124 PlaySound(
"fire_step");
4125 AddCondition<ConBurning>(30);
4130 PlaySound(
"bubble");
4131 AddCondition<ConWet>(30);
4136 if (hasMovedThisTurn)
4138 Say(
"abMistOfDarkness_step",
this);
4161 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4190 if (rootCard !=
this && things.IsFull(c.
Thing))
4197 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4207 if (things.GetDest(t).IsValid)
4228 t = TryPoisonPotion(t);
4236 Say(
"backpack_full_drop", t);
4243 Say(
"backpack_full", t);
4247 if (dest.
stack !=
null)
4251 PlaySound(
"pick_thing");
4252 Say(
"pick_thing",
this, t);
4260 PlaySound(
"pick_thing");
4261 Say(
"pick_thing",
this, t);
4263 TryReservePickupTutorial(t);
4273 Say(
"poisonDrip",
this);
4287 Say(
"absorbRod",
this, t);
4290 if (
rod.source !=
null)
4293 if (enumerator.MoveNext())
4325 if (t.
id ==
"pasture")
4337 foreach (
Card item in pos.ListCards())
4342 if (thing !=
null && !IsPC)
4344 thing.isNPCProperty =
true;
4389 t.isNPCProperty =
false;
4391 pos.TryWitnessCrime(
this);
4400 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4404 if (num == -1 || num > t.
Num)
4415 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4429 WidgetHotbar.dirtyCurrentItem =
true;
4440 if (IsPC && held.
invY == 1)
4442 WidgetHotbar.dirtyCurrentItem =
true;
4454 Say(
"canOnlyCarry", held);
4459 if (!flag && things.IsOverflowing())
4463 Say(
"backpack_full_drop", held);
4471 PlaySound(
"pick_thing");
4472 Say(
"pick_held",
this,
card);
4473 if (IsPC &&
card.id ==
"statue_weird")
4480 WidgetHotbar.dirtyCurrentItem =
true;
4495 return held.
Split(a);
4518 WidgetHotbar.dirtyCurrentItem =
true;
4523 if (
card.trait.CanOnlyCarry)
4534 Msg.
Say(
"markedImportant");
4549 t.ignoreAutoPick =
true;
4560 int num = Evalue(131);
4561 int num2 = Evalue(130);
4562 int num3 = Evalue(123);
4563 if (num > num2 && num > num3)
4567 if (num2 > num && num2 > num3)
4571 if (num3 > num && num3 > num2)
4585 if (elements.Value(122) > elements.Value(120))
4587 return elements.GetElement(122);
4589 return elements.GetElement(120);
4594 isOnCreate = onCreate;
4599 RestockInventory(onCreate);
4604 string equip = source.
equip;
4605 if (equip.IsEmpty())
4609 if (equip ==
"none")
4619 EQ_ID(
"staff_long", 1);
4627 EQ_ID(
"tail_snowleopard");
4633 EQ_ID(
"sword_zephir");
4636 case "adv_mesherada":
4639 EQ_ID(
"dagger_hathaway");
4645 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4649 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4655 EQ_ID(
"sword_muramasa");
4661 EQ_ID(
"dagger_gaki");
4665 EQ_ID(
"dagger_ninto");
4669 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4675 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4686 AddThing(
"bow_vindale");
4692 EQ_ID(
"EtherDagger2");
4698 EQ_ID(
"axe_destruction");
4704 EQ_ID(
"ribbon_duponne");
4710 EQ_ID(
"helm_seeker");
4713 EQ_ID(
"sword_katana");
4715 EQ_ID(
"sword_katana");
4718 EQ_ID(
"boots_seven");
4722 for (
int i = 0; i < 20; i++)
4727 AddThing(
"plat").SetNum(6);
4733 AddThing(
"guitar_efrond");
4739 AddThing(
"guitar_ash");
4745 EQ_ID(
"EtherDagger");
4749 if (onCreate || !TryEquipRanged())
4751 if (
id ==
"mech_scarab")
4753 AddThing(
"gun_laser");
4760 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4769 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4774 if (race.
id ==
"asura")
4776 for (
int j = 0; j < 4; j++)
4778 EQ_CAT(job.
weapon.RandomItem());
4781 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4787 else if (!job.
weapon.IsEmpty())
4791 EQ_CAT(job.
weapon.RandomItem());
4793 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4795 EQ_CAT(job.
weapon.RandomItem());
4837 EQ_ID(
"shield_lute");
4840 if (HasTag(
CTAG.shield))
4851 if (ShouldRestock(
"_meat"))
4857 Restock(
"book_story", 1);
4859 case "rock_thrower":
4867 Restock(
"book_story_home", 1);
4872 void Restock(
string id,
int num)
4874 if (ShouldRestock(
id))
4879 bool ShouldRestock(
string id)
4881 return things.Find(
id) ==
null;
4889 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4890 Rarity rarity2 = base.rarity;
4891 if (
id ==
"big_sister")
4893 num = (isOnCreate ? 8 : 4);
4901 rarity =
Rarity.Superior;
4903 else if (rarity2 ==
Rarity.Legendary)
4907 else if (rarity2 >=
Rarity.Mythical)
4913 rarity =
Rarity.Legendary;
4915 CardBlueprint.current.rarity = rarity;
4923 CardBlueprint.current.rarity = r;
4926 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
4931 if (!body.
Equip(thing))
4942 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
4947 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
4984 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
4988 Msg.
Say(
"returnHome",
this, homeZone.Name);
5005 base.hp = MaxHP / 3;
5008 if (hunger.
value > 30)
5012 sleepiness.value = 0;
5013 hostility = OriginalHostility;
5014 RemoveCondition<StanceTaunt>();
5019 Msg.
Say(
"noDeathPenalty2",
this);
5023 Msg.
Say(
"noDeathPenalty",
this);
5029 List<Thing> dropList =
new List<Thing>();
5034 t.ignoreAutoPick = true;
5037 }, onlyAccessible:
false);
5043 EClass.player.preventDeathPenalty =
false;
5045 if (IsPCFaction && homeBranch !=
null)
5047 homeBranch.
Log(
"bRevive",
this);
5060 PlayEffect(
"revive");
5062 SetCensored(enable:
false);
5070 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5073 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5077 if (!lastword.IsEmpty())
5079 thing.c_note = lastword;
5081 thing.isModified =
true;
5127 if (HasCondition<ConAnorexia>())
5133 else if (base.c_vomit > 10)
5135 AddCondition<ConAnorexia>();
5137 AddCondition<ConDim>();
5138 if (HasCondition<ConAnorexia>())
5152 if (isDead || host !=
null)
5156 bool isInActiveZone = IsInActiveZone;
5165 if (
id ==
"tsunami")
5167 pos.PlaySound(
"water");
5171 Say(
"summon_vanish",
this);
5172 pos.PlayEffect(
"vanish");
5173 pos.PlaySound(
"vanish");
5188 PlayEffect(
"revive");
5189 PlaySound(
"chime_angel");
5196 PlaySound(base.material.GetSoundDead(source));
5198 renderer.RefreshSprite();
5199 renderer.RefreshStateIcon();
5204 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5207 text =
"dead_" + attackSource;
5213 text =
"dead_" + e.
source.alias;
5222 EClass._zone.isDeathLocation =
true;
5223 string s = ((origin ==
null) ? text :
"dead_by");
5235 AI_PlayMusic.keepPlaying =
false;
5241 Msg.
Say(
"goto_heaven",
this);
5245 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5247 Msg.
Say(text,
this,
"", text2);
5249 string text3 = TalkTopic(
"dead");
5250 if (!text3.IsEmpty())
5252 text3 = text3.StripBrackets();
5254 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5269 if (homeBranch !=
null)
5271 homeBranch.
Log(text,
this,
"");
5283 if (
id ==
"mandrake" || HasElement(488))
5285 Say(
"a_scream",
this);
5290 ClearTempElements();
5293 base.isSale =
false;
5305 EClass.player.returnInfo =
null;
5306 EClass.player.uidLastTravelZone = 0;
5315 chara2.enemy =
null;
5320 EClass.player.preventDeathPenalty =
true;
5325 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5334 currentZone.RemoveCard(
this);
5336 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5339 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5343 ModAffinity(
EClass.
pc, a, show:
false);
5345 if (!(text4 ==
"quru"))
5347 if (text4 ==
"corgon")
5359 if (origin.IsPCParty || origin.IsPCPartyMinion)
5362 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5366 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5373 num = num * 30 / 100;
5384 else if (origin.IsPCFaction)
5386 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5387 origin.Chara.ShowEmo(
Emo.love);
5390 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5394 if (base.IsPCFactionOrMinion)
5398 Msg.
Say(
"abort_allyDead");
5403 Msg.
Say(
"abort_enemyDead");
5405 if (IsPCParty && !IsPC)
5408 base.c_wasInPcParty =
true;
5414 if (attackSource !=
AttackSource.DeathSentense && !IsPCFaction)
5416 EClass.player.flags.little_killed =
true;
5428 case "shark_sister":
5437 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5441 if (chara.
LV < base.LV)
5443 chara.
SetLv(base.LV);
5446 Msg.
Say(
"plant_pop",
this, chara);
5453 if (IsPCFaction || IsPCFactionMinion)
5460 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5466 flag = (flag2 =
true);
5467 EClass._zone.Boss =
null;
5472 EClass.player.flags.KilledBossInVoid =
true;
5479 SE.Play(
"Jingle/fanfare2");
5489 flag = (flag2 =
true);
5501 flag = (flag2 =
true);
5507 EClass.player.flags.killedDuponne =
true;
5513 flag = (flag2 =
true);
5520 case "melilith_boss":
5522 flag = (flag2 =
true);
5529 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
5531 if (num2 && questNasu !=
null && questNasu.
phase == 1)
5534 flag = (flag2 =
true);
5545 flag = (flag2 =
true);
5547 if (questExploration !=
null)
5549 SE.Play(
"kill_boss");
5559 SE.Play(
"kill_boss");
5560 SoundManager.ForceBGM();
5566 SE.Play(
"kill_boss");
5580 EClass.player.willAutoSave =
true;
5593 public void Kick(
Point p,
bool ignoreSelf =
false,
bool checkWall =
true)
5597 Kick(
item, ignoreSelf, karmaLoss:
true, show:
true, checkWall);
5601 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true,
bool checkWall =
true)
5603 if (!IsAliveInCurrentZone)
5629 Say(
"kick",
this, t);
5649 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5654 if (HasCooldown(a.
id))
5658 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
5660 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5661 int num = list.IndexOf(a.
id);
5664 int num2 = list.TryGet(num + Evalue(1422));
5665 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5674 if (IsPC && HasCondition<StanceManaCost>())
5676 num4 = Evalue(1657);
5688 ForeachEnemy(delegate
5695 ForeachParty(delegate
5711 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5713 int num6 = cost.cost * num5 / 100;
5716 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5726 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5734 ActPlan.warning =
true;
5737 if (UseAbility(a, tc, pos, pt))
5746 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))
5748 Say(
"shakeHead",
this);
5751 if (tc !=
null && tc !=
this)
5755 if (pos !=
null && !base.pos.Equals(pos))
5761 num3 = 1 + Evalue(1648);
5763 if (IsPC && cost.
cost > 0 && a.
Value == 0)
5770 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5771 if (!a.
source.tag.Contains(
"useHand"))
5773 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5786 a.vPotential -= i * 2;
5787 num6 = num6 * (100 - num4 * 20) / 100;
5796 else if (a.
source.langAct.Length != 0 && tc !=
null)
5798 string text = a.
source.langAct[0];
5799 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5800 if (text ==
"spell_hand")
5803 string @ref = text2.lang(list2[4]);
5804 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5808 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
5812 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
5818 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5828 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5832 ignoreSPAbsorb =
true;
5835 if (a is
Spell && GetCondition<ConSilence>() !=
null)
5837 Say(
"cast_silence",
this);
5844 int spellExp = elements.GetSpellExp(
this, a, num5);
5847 Say(
"fizzle",
this);
5848 PlayEffect(
"fizzle");
5849 PlaySound(
"fizzle");
5852 ModExp(a.
id, spellExp / 5);
5854 RemoveCondition<ConInvisibility>();
5858 if (HasTalk(
"phrase_" + a.
source.alias))
5860 EClass.player.forceTalk =
true;
5861 Talk(
"phrase_" + a.
source.alias);
5868 ForeachEnemy(delegate(
Chara c)
5875 ForeachParty(delegate(
Chara c)
5880 Act.forcePt =
false;
5884 for (
int j = 0; j < num3; j++)
5890 ActEffect.RapidCount = j;
5892 flag2 = a.
Perform(
this, tc, pos);
5895 if (flag2 && !isDead)
5899 ModExp(a.
id, spellExp);
5901 if (a.
source.alias.StartsWith(
"sword_"))
5906 ActEffect.RapidCount = 0;
5907 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
5909 AddCooldown(a.
id, a.
source.cooldown);
5911 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
5913 RemoveCondition<ConInvisibility>();
5916 void ForeachEnemy(Action<Chara> action)
5918 if (_pts.Count == 0)
5923 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
5929 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
5931 action(_pts[num11]);
5934 void ForeachParty(Action<Chara> action)
5936 if (_pts.Count == 0)
5943 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
5954 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
5961 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
5972 return 25 + Evalue(226) * 125 / 100;
5988 if (host.
ride ==
this)
5990 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
5994 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
5999 int num3 = Evalue(304);
6002 num3 = Mathf.Max(num3, base.LV + 5);
6006 bool num6 = GetArmorSkill() == 122;
6010 num4 = 20 - Evalue(122) / 5;
6011 num5 += 10 - Evalue(1654) * 4;
6015 num4 = 10 - Evalue(120) / 5;
6025 if (parasite !=
null)
6036 num5 += 20 - Evalue(1654) * 8;
6042 if (HasCondition<ConDim>())
6044 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6054 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6057 public void DoAI(
int wait, Action onPerform)
6072 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6078 if (headpat &&
this != c)
6089 if (!member.
IsPC && CanSeeLos(member))
6099 if (c.
id ==
"hedgehog_ether")
6103 Say(
"reflect_thorne", c,
this);
6135 if (enemy ==
null && !IsPC)
6137 if (GetInt(106) == 0)
6141 if (OriginalHostility !=
Hostility.Enemy)
6145 SetEnemy(_tg.
Chara);
6159 if (_tg ==
null || !_tg.
isChara)
6166 EClass.pc.combatCount = 10;
6174 chara.
Say(
"frown",
this, chara);
6186 chara.
Say(
"frown",
this, chara);
6193 bool flag = chara.id ==
"fanatic";
6196 chara.
Say(
"callHelp", chara);
6268 bool flag = enemy !=
null || ai is
GoalCombat;
6269 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6271 bool flag3 = !IsPCParty;
6277 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2))
6281 int num3 = Dist(chara2);
6282 int num4 = GetSightRadius() + (flag ? 1 : 0);
6289 if (
this == pos.FirstChara)
6291 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6299 DoHostileAction(chara2);
6312 DoHostileAction(chara);
6324 if (chara !=
this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6326 DoHostileAction(chara);
6345 if (base.IsPCFactionOrMinion)
6358 if (OriginalHostility >=
Hostility.Friend)
6399 return EClass.game.activeZone == currentZone;
6406 foreach (
Point item2
in item.ListPoints())
6408 if (pos.Equals(item2))
6429 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6453 charaRenderer.pccData = PCCData.Create(
"ride");
6454 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6455 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6456 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6460 foreach (
Condition condition
in conditions)
6463 if (rendererReplacer !=
null)
6465 charaRenderer.replacer = rendererReplacer;
6466 charaRenderer.data = rendererReplacer.
data;
6470 if (charaRenderer.
replacer ==
null)
6472 charaRenderer.pccData = pccData;
6475 renderer = charaRenderer;
6477 if (cardRenderer !=
null)
6479 renderer.SetFirst(first:
false, cardRenderer.
position);
6481 return charaRenderer;
6488 PCC.Get(pccData).Build(state);
6496 PCC pCC = PCC.Get(pccData);
6498 return pCC.variation.idle[0, 0];
6500 if (spriteReplacer !=
null)
6504 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);
6525 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
6534 p.mat = base.material;
6535 p.matColor = base.colorInt;
6536 if (!renderer.usePass)
6540 if (renderer.replacer !=
null)
6542 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6548 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6553 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6556 else if (sourceCard.
_tiles.Length > 1)
6558 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6559 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6563 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6570 string text = base.Name;
6571 if (IsFriendOrAbove())
6575 else if (IsHostile())
6581 if (base.LV >= lV * 5)
6585 else if (base.LV >= lV * 2)
6589 else if (base.LV <= lV / 4)
6593 else if (base.LV <= lV / 2)
6599 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6600 s = (
" (" + s.lang() +
") ").TagSize(14);
6604 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6608 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6614 text2 +=
"lowerGround".lang();
6616 else if (HasHigherGround(
EClass.
pc))
6618 text2 +=
"higherGround".lang();
6621 if (Evalue(1232) > 0)
6623 text2 =
"milkBaby".lang().TagSize(14) + text2;
6627 text2 =
"hasBounty".lang().TagSize(14) + text2;
6631 text2 += (
"(" + faith.Name +
")").TagSize(14);
6633 return text + text2 + s;
6641 text += Environment.NewLine;
6642 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6647 text2 += Environment.NewLine;
6648 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6649 text2 += Environment.NewLine;
6651 text2 += Environment.NewLine;
6652 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6653 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.
idSkin;
6657 text2 += Environment.NewLine;
6658 text2 +=
"<size=14>";
6661 text2 = text2 + item.Name +
", ";
6663 foreach (
Hobby item2
in ListHobbies())
6665 text2 = text2 + item2.Name +
", ";
6667 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
6670 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6671 if (enumerable.Count() > 0)
6673 text3 += Environment.NewLine;
6674 text3 +=
"<size=14>";
6679 if (text4.IsEmpty() || text4 ==
"#")
6684 switch (item3.
source.group)
6697 text4 = text4 +
"(" + item3.
GetValue() +
")";
6698 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
6700 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
6704 text3 = text3 + text4.TagColor(c) +
", ";
6713 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6718 text3 += Environment.NewLine;
6721 text3 = text3 + item4.act.Name +
", ";
6723 text3 = text3.TrimEnd(
", ".ToCharArray());
6725 return text + text2 + text3;
6730 string key = source.
idText.IsEmpty(
id);
6740 string text = row.GetText(topic, returnNull:
true);
6745 if (text.StartsWith(
"@"))
6752 text = row.GetText(topic, returnNull:
true);
6758 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6763 if (host ==
null && !IsInActiveZone)
6767 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6773 int num = EClass.pc.party.members.Count - 1;
6798 string topicText = GetTopicText(topic);
6799 if (topicText.IsEmpty())
6803 string text =
"_bracketTalk".lang();
6804 bool flag = topicText.StartsWith(
"*");
6805 bool flag2 = topicText.StartsWith(
"(");
6806 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
6807 topicText = ApplyTone(topicText);
6808 topicText = topicText.Replace(
"~",
"*");
6810 Msg.
Say(topicText.Replace(
"&",
""));
6811 if (topic ==
"dead")
6815 else if (flag || flag3 || flag2)
6817 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
6835 if (conSuspend !=
null && IsPCParty)
6837 RemoveCondition<ConSuspend>();
6841 if (IsDeadOrSleeping)
6843 ShowDialog(
"_chara",
"sleep");
6848 ShowDialog(
"_chara",
"invisible");
6854 ShowDialog(
"_chara",
"give_card");
6863 if (GetInt(71) == -2)
6865 ShowDialog(
"_chara",
"give_lunch");
6871 if (base.isRestrained)
6873 ShowDialog(
"_chara",
"strain");
6878 ShowDialog(
"_chara",
"escort");
6883 ShowDialog(
"_chara",
"party");
6897 EClass.player.flags.loytelEscaped =
false;
6899 ShowDialog(
"loytel",
"loytelEscaped");
6903 if (questDebt !=
null && questDebt.
paid)
6906 if (questDebt.
stage > 7)
6908 questDebt.stage = 7;
6910 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
6918 ShowDialog(
"farris");
6924 ShowDialog(
"farris",
"nymelle_noQuest");
6927 ShowDialog(
"farris",
"nymelle_first");
6930 ShowDialog(
"farris",
"home_first");
6933 ShowDialog(
"farris");
6938 ShowDialog(
"ashland");
6943 SoundManager.ForceBGM();
6950 EClass.player.flags.fiamaFirstDream =
true;
6951 ShowDialog(
"fiama",
"firstDream");
6955 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
6957 EClass.player.flags.fiamaStoryBookGiven =
true;
6963 ShowDialog(
"fiama");
6968 ShowDialog(
"fiama");
6974 ShowDialog(
"big_sister",
"little_saved");
6975 EClass.player.flags.little_saved =
false;
6980 ShowDialog(
"big_sister",
"little_dead");
6981 EClass.player.flags.little_killed =
false;
6989 ShowDialog(
"guild_doorman",
"main", tag);
6995 ShowDialog(
"guild_clerk",
"main", tag2);
7010 ShowDialog(
"_chara");
7016 return _ShowDialog(
book,
null, step, tag);
7022 if (
book ==
"_chara" && IsPC)
7036 return base.LV / 2 + 4;
7042 if (FindBed() !=
null)
7051 return GetHappiness().ToString() ??
"";
7056 string result =
"?????";
7069 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7079 sortVal = job._index * 10000 + sourceCard.
_index;
7082 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7085 sortVal = -GetTotalFeat();
7088 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7101 foreach (
Card item in map.props.installed.all)
7105 traitBed.RemoveHolder(
this);
7124 if (!IsPCFaction && !IsGuest())
7133 Msg.
Say(
"claimBed",
this);
7142 if (GetInt(113) != 0)
7147 Thing bestRangedWeapon = GetBestRangedWeapon();
7148 foreach (
Thing thing
in things)
7154 _ListItems.Add(thing);
7158 _ListItems.Add(thing);
7162 if (_ListItems.Count == 0)
7166 List<Thing> containers2 = containers.ToList();
7167 foreach (
Thing listItem
in _ListItems)
7191 bool flag = GetInt(113) == 0;
7200 foreach (
Thing thing3
in things)
7202 if (CanEat(thing3, shouldEat))
7210 if (thing3.
id ==
"polish_powder")
7224 foreach (
Thing container
in containers)
7234 if (num3 > 0 && thing4.
id ==
"polish_powder")
7236 _ListItems.Add(thing4);
7241 _ListItems.Add(thing4);
7246 _ListItems.Add(thing4);
7249 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
7251 _ListItems.Add(thing4);
7256 _ListItems.Add(thing4);
7261 _ListItems.Add(thing4);
7266 if (_ListItems.Count == 0)
7270 _ListItems.ForeachReverse(delegate(
Thing t)
7275 int slot = t.category.slot;
7276 int equipValue = t.GetEquipValue();
7277 foreach (Thing listItem in _ListItems)
7279 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7287 _ListItems.Remove(t);
7292 foreach (
Thing listItem2
in _ListItems)
7294 Thing thing = listItem2;
7295 if (things.IsFull(thing))
7302 thing = thing.
Split(2);
7309 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
7311 TryEquip(thing, useFav:
true);
7317 TryPutSharedItems(containers);
7323 Thing result =
null;
7331 int num2 = CountNumEaten(
item);
7332 int num3 = 100 - num2;
7346 t = FindBestFoodToEat();
7358 Say(
"eat_start",
this, t.Duplicate(1));
7388 if (!CanEquipRanged(t))
7393 foreach (
Thing thing
in things)
7414 if (bodySlot ==
null)
7420 switch (GetFavAttackStyle())
7468 if (!ShouldEquip(t, useFav))
7479 switch (GetFavAttackStyle())
7495 body.
Equip(t, slot);
7501 Say(
"equip",
this, t);
7517 return FindThrowable(hotbar:
true);
7521 things.Foreach(delegate(
Thing t)
7523 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7529 Thing FindThrowable(
bool hotbar)
7531 things.Foreach(delegate(
Thing t)
7568 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7573 Thing result =
null;
7575 foreach (
Thing thing
in things)
7598 if (ranged !=
null && ranged.
parent ==
this)
7602 ranged = GetBestRangedWeapon();
7603 return ranged !=
null;
7608 if (body.
GetWeight(armorOnly:
true) <= 30000)
7633 if (t.
id ==
"cigar")
7638 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7640 SetAIImmediate(
new AI_Eat
7659 if (base.hp < MaxHP * 90 / 100)
7662 if (healAction !=
null)
7673 return FindBed()?.owner.pos.cell.room;
7688 if (IsPCFaction && homeBranch !=
null)
7690 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7707 Say(
"affinityNone",
this, c);
7712 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7716 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7722 a = affinity.
Mod(a);
7728 int num = Evalue(289);
7740 num2 += (lV - num) * 10;
7742 elements.
ModExp(289, Mathf.Min(num2, 1000));
7758 chara.orgPos = orgPos.
Copy();
7760 chara.pos = pos.
Copy();
7761 chara.isImported =
true;
7762 chara.c_editorTags = base.c_editorTags;
7763 chara.c_editorTraitVal = base.c_editorTraitVal;
7764 chara.c_idTrait = base.c_idTrait;
7765 chara.homeZone = homeZone;
7771 if (_listFavFood.Count == 0)
7775 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
7777 _listFavFood.Add(row);
7784 r = _listFavFood.RandomItem();
7792 if (_listFavCat.Count == 0)
7798 _listFavCat.Add(row);
7804 r = _listFavCat.RandomItem();
7811 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
7813 if (enumerator.MoveNext())
7815 return enumerator.Current;
7823 Say(
"abCatSniff",
this, c);
7828 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
7834 if (base.c_upgrades !=
null)
7836 num += base.c_upgrades.spent;
7838 if (base.c_genes !=
null)
7840 num += base.c_genes.GetTotalCost();
7842 return num + base.feat;
7849 if (
item.act.id == 6630)
7859 string text = race.
id;
7860 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
7873 if (
id ==
"olderyoungersister")
7875 if (base.idSkin != 2)
7877 return "UN_olderyoungersister";
7879 return "UN_olderyoungersister_alt";
7885 return base.c_idPortrait;
7902 if (HasElement(1231))
7905 AddCondition<ConEuphoric>(100 * Evalue(1231));
7909 SetFeat(1231, 1, msg:
true);
7916 int num2 = ((!HasElement(1411)) ? 1 : 3);
7917 if (GetBurden(t, num) >= num2)
7930 if (!IsValidGiftWeight(t, num))
7938 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
7947 if (things.IsFull())
7974 Msg.
Say(
"affinityNone", c,
this);
7980 int num2 = 200 + t.LV * 3;
7996 c.
Say(
"draw_curse", c, t);
7998 List<Element> list =
new List<Element>();
8006 if (list.Count == 0)
8011 Element element = list.RandomItem();
8017 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8019 GiveLovePotion(c, t);
8033 case "ticket_massage":
8040 case "ticket_armpillow":
8048 case "ticket_champagne":
8055 if (t.
id ==
"flyer")
8060 c.
Talk(
"flyer_miss");
8066 Msg.
Say(
"affinityNone", c,
this);
8068 elements.ModExp(291, 10f);
8071 elements.ModExp(291, 50f);
8073 if (t.
id ==
"statue_weird")
8094 Say(
"give_erohon",
this);
8095 AddCondition<ConParalyze>(50, force:
true);
8096 AddCondition<ConConfuse>(50, force:
true);
8097 AddCondition<ConFear>(1000, force:
true);
8105 c.
Say(
"give_love", c, t);
8115 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
8139 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
8140 int num2 = Dist(chara);
8145 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8151 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
8159 Say(
"intercept_loyal", chara,
this);
8162 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8167 if (!flag && !HasElement(1225))
8169 Say(
"intercept", chara,
this);
8172 chara.
Talk(
"intercept", base.NameSimple);
8174 if (attacker.enemy ==
this)
8176 attacker.SetEnemy(chara);
8239 if (t.
id ==
"flyer")
8259 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
8261 Thing thing = things[num2];
8262 if (ShouldThrowAway(thing, type))
8273 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
8281 _ = base.c_upgrades;
8290 for (
int i = 0; i < 100; i++)
8296 if (base.c_upgrades ==
null)
8300 if (base.c_upgrades.halt)
8311 List<Element> list = ListAvailabeFeats(pet:
true);
8312 if (num >= 90 && list.Count > 0)
8314 Element element = list.RandomItem();
8318 else if (num >= 60 && ie.Any())
8320 num2 = ie.RandomItem().id;
8331 if (num4 > base.feat)
8336 base.c_upgrades.count++;
8337 base.c_upgrades.spent += num4;
8343 if (
item.idEle == num2)
8364 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8366 else if (elements.ValueWithoutLink(row.
id) == 0)
8368 elements.Learn(row.
id);
8372 elements.ModBase(num2, num3);
8379 if (_cooldowns ==
null)
8381 _cooldowns =
new List<int>();
8385 _cooldowns.Add(idEle * 1000 + turns);
8391 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8397 return GetCooldown(idEle) != 0;
8402 if (_cooldowns !=
null)
8404 for (
int i = 0; i < _cooldowns.Count; i++)
8406 if (_cooldowns[i] / 1000 == idEle)
8408 return _cooldowns[i] % 1000;
8417 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8419 if (_cooldowns[num] % 1000 == 1)
8421 _cooldowns.RemoveAt(num);
8428 if (_cooldowns.Count == 0)
8441 if (IsPCParty || base.noMove)
8446 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8449 if (goalFromTimeTable !=
null)
8451 SetAI(goalFromTimeTable);
8454 goalFromTimeTable.
Tick();
8459 if (goalList.
index == -2)
8461 goalList.
Refresh(
this, goalListType);
8463 SetAI(goalList.
Next());
8487 return GetGoalWork();
8493 return GetGoalHobby();
8528 if (_works ==
null || _hobbies ==
null)
8532 foreach (
int work
in _works)
8539 foreach (
int hobby
in _hobbies)
8560 return SetAI(_NoGoalPC);
8578 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8582 if (HasCondition<ConWait>())
8584 RemoveCondition<ConWait>();
8590 renderer.RefreshStateIcon();
8597 bool hasNoGoal = HasNoGoal;
8632 listHobby.Add(
new Hobby
8643 foreach (
int work
in _works)
8645 listHobby.Add(
new Hobby
8659 if (_hobbies ==
null)
8663 foreach (
int hobby
in _hobbies)
8665 listHobby.Add(
new Hobby
8678 if (
item.source.alias ==
id)
8683 foreach (
Hobby item2
in ListHobbies())
8685 if (item2.
source.alias ==
id)
8695 if (workElements !=
null)
8699 workElements =
null;
8700 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
8708 foreach (
Hobby item2
in ListWorks())
8712 if (workElements !=
null)
8716 void TryAdd(
Hobby h)
8718 if (!h.
source.elements.IsEmpty())
8720 if (workElements ==
null)
8724 for (
int i = 0; i < h.
source.elements.Length; i += 2)
8726 int num = h.
source.elements[i];
8727 int num2 = h.
source.elements[i + 1];
8729 if (num != 2115 && num != 2207)
8737 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
8745 string text = (simple ?
"" : (
"hobby".lang() +
":"));
8750 return text.TrimEnd(
',');
8755 string text = (simple ?
"" : (
"work".lang() +
":"));
8760 return text.TrimEnd(
',');
8765 foreach (
int hobby
in _hobbies)
8777 foreach (
int work
in _works)
8789 if (_hobbies !=
null && _works !=
null)
8796 _hobbies =
new List<int>();
8797 _works =
new List<int>();
8805 string[] hobbies = source.
hobbies;
8806 foreach (
string key
in hobbies)
8811 if (source.
works.IsEmpty())
8817 string[] hobbies = source.
works;
8818 foreach (
string key2
in hobbies)
8823 GetWorkSummary().Reset();
8828 if (_workSummary ==
null)
8832 return _workSummary;
8845 if (workSummary.
work !=
null)
8850 else if (workSummary.
hobbies.Count > 0)
8871 hobby.id = session.
id;
8876 workSummary.progress +=
EClass.
rnd(5) + 5;
8878 int num = PerformWork(hobby, 0, isHobby);
8879 int num2 = PerformWork(hobby, 1, isHobby);
8880 int num3 = PerformWork(hobby, 2, isHobby);
8881 int num4 = PerformWork(hobby, 3, isHobby);
8882 workSummary.money += num;
8883 workSummary.food += num2;
8884 workSummary.knowledge += num3;
8885 workSummary.material += num4;
8886 int PerformWork(
Hobby work,
int idx,
bool isHobby)
8888 if (idx >= work.
source.resources.Length)
8892 int num5 = work.
source.resources[idx];
8894 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
8895 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
8896 if (num6 > 0 && num5 <= 0)
8906 _goalWork.
FindWork(
this, setAI:
false);
8922 foreach (
Condition condition
in conditions)
8924 condition.
SetOwner(
this, onDeserialize);
8930 return AddCondition(typeof(T).Name, p, force);
8943 if (c is
ConBleed && ResistLv(964) >= 3)
8948 else if (ResistLv(950) >= 3)
8966 if (c.
source.negate.Length != 0)
8968 string[] negate = c.
source.negate;
8969 foreach (
string text
in negate)
8971 if (HasElement(text))
8978 if (defenseAttribute !=
null)
8980 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
8982 if (c.
source.resistance.Length != 0)
8987 c.power /= num * num + 1;
9000 for (
int j = 0; j < conditions.Count; j++)
9002 if (conditions[j].
id != c.
id)
9008 conditions[j].Kill();
9011 if (conditions[j].CanStack(c))
9013 if (conditions[j].WillOverride)
9015 conditions[j].Kill(silent:
true);
9018 if (CanGainConResist)
9022 conditions[j].OnStacked(c.
power);
9023 conditions[j].OnStartOrStack();
9024 conditions[j].PlayEffect();
9026 if (!conditions[j].AllowMultipleInstance)
9031 foreach (
Condition condition
in conditions)
9038 int num2 = c.EvaluateTurn(c.power);
9045 if (CanGainConResist)
9052 if (c.ShouldRefresh)
9064 if (c.SyncRide && (ride !=
null || parasite !=
null))
9070 if (parasite !=
null)
9078 public override bool HasCondition<T>()
9080 for (
int i = 0; i < conditions.Count; i++)
9082 if (conditions[i] is T)
9092 for (
int i = 0; i < conditions.Count; i++)
9094 if (conditions[i].source.alias == alias)
9109 for (
int i = 0; i < conditions.Count; i++)
9113 return conBuffStats.elements.GetElement(ele);
9119 public void CureCondition<T>(
int v = 99999) where T :
Condition
9121 T condition = GetCondition<T>();
9122 if (condition !=
null)
9124 condition.value -= v;
9125 if (condition.value <= 0)
9134 for (
int i = 0; i < conditions.Count; i++)
9136 if (conditions[i] is T)
9138 return conditions[i] as T;
9146 for (
int num = conditions.Count - 1; num >= 0; num--)
9148 if (conditions[num] is T)
9150 conditions[num].
Kill();
9158 if (parasite !=
null)
9160 parasite.
Cure(type, p, state);
9164 ride.
Cure(type, p, state);
9166 Cure(type, p, state);
9176 CureCondition<ConFear>();
9177 CureCondition<ConBlind>(2 * p / 100 + 5);
9178 CureCondition<ConPoison>(5 * p / 100 + 5);
9179 CureCondition<ConConfuse>(10 * p / 100 + 10);
9180 CureCondition<ConDim>(p / 100 + 5);
9181 CureCondition<ConBleed>(2 * p / 100 + 10);
9188 CureCondition<ConBlind>(5 * p / 100 + 15);
9189 CureCondition<ConPoison>(10 * p / 100 + 15);
9190 CureCondition<ConBleed>(5 * p / 100 + 20);
9191 CureTempElements(p, body:
true, mind:
false);
9194 CureCondition<ConFear>();
9195 CureCondition<ConDim>(3 * p / 100 + 10);
9196 CureTempElements(p, body:
false, mind:
true);
9200 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
9202 Condition condition2 = conditions[num2];
9207 condition2.
Mod(-1, force:
true);
9215 CureCondition<ConWait>();
9216 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
9217 bool flag3 = HasCondition<ConAnorexia>();
9218 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9219 if (base.c_vomit < 0)
9224 RemoveCondition<ConAnorexia>();
9234 bool flag2 = type ==
CureType.Death;
9235 CureTempElements(p * 100, body:
true, mind:
true);
9236 for (
int num = conditions.Count - 1; num >= 0; num--)
9243 switch (condition.
Type)
9263 CureCondition<ConWait>();
9264 CureCondition<ConSleep>();
9265 if (flag2 || type ==
CureType.Boss)
9268 RemoveCondition<ConBrightnessOfLife>();
9273 if (HasElement(1206))
9275 SetFeat(1206, 0, msg:
true);
9285 for (
int num = conditions.Count - 1; num >= 0; num--)
9301 if (
TC.hp >
TC.MaxHP * Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) / 100)
9305 if (
TC.HasElement(427))
9313 PlaySound(
"hit_finish");
9315 Say(
"finish2",
this,
TC);
9325 if (resistCon ==
null)
9327 resistCon =
new Dictionary<int, int>();
9329 if (resistCon.ContainsKey(key))
9331 resistCon[key] += con.power * con.GainResistFactor / 100;
9335 resistCon[key] = con.power * con.GainResistFactor / 100;
9342 if (con.
power > 0 && resistCon !=
null)
9344 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
9366 RemoveCondition<ConAwakening>();
9371 con.pcPillow = pillow;
9372 con.pickup = pickup;
9373 con.posBed = posBed;
9374 con.posPillow = posPillow;
9381 int num =
bed?.Power ?? 20;
9382 if (traitPillow !=
null)
9384 num += traitPillow.owner.Power / 2;
9388 num +=
bed.Evalue(750) * 5;
9399 int num = power * days;
9400 if (stamina.
value < 0)
9405 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9421 if (!HasElement(450))
9423 int height = bio.height;
9424 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9429 if (height != bio.height)
9431 bio.height = height;
9432 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
9439 if (HasElement(450) || a == 0)
9443 int weight = bio.weight;
9444 int height = bio.height;
9445 int num = height * height * 18 / 25000;
9446 int num2 = height * height * 24 / 10000;
9447 if (ignoreLimit || (weight > num && weight < num2))
9449 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9454 if (weight != bio.weight)
9456 bio.weight = weight;
9457 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
9466 if (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0)
9470 int num = Evalue(412);
9473 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
9474 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
9481 int num3 = (corruption + a) / 100 - corruption / 100;
9482 for (
int i = 0; i < Mathf.Abs(num3); i++)
9484 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
9491 foreach (
Element value
in elements.dict.Values)
9493 if (value.
source.category ==
"ether")
9495 num4 += value.
Value;
9498 if (num4 > 0 && IsPC)
9502 corruption = num4 * 100 + corruption % 100;
9507 List<Element> list =
new List<Element>();
9510 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
9511 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
9520 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
9522 Feat feat = elements.GetElement(
id) as
Feat;
9524 if (feat !=
null && feat.
Value > 0)
9526 if (value == feat.
Value)
9535 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
9540 elements.Remove(
id);
9545 CalculateMaxStamina();
9551 if (feat.
source.textInc.IsEmpty())
9553 PlaySound(
"ding_skill");
9555 Say(
"gainFeat",
this, feat.
FullName);
9559 bool flag = value < num;
9560 if (feat.
source.tag.Contains(
"neg"))
9569 PlaySound(
"chime_angel");
9575 PlaySound(
"chime_devil");
9579 PlaySound(
"mutation");
9583 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9585 elements.CheckSkillActions();
9592 Element element = elements.GetElement(idEle);
9593 Element element2 = elements.GetElement(row2.
id);
9594 int num = element?.
Value ?? 0;
9603 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
9604 if (a == 0 && (element ==
null || element.
Value == 0))
9606 SayNothingHappans();
9609 if (element !=
null && element.
Value == a)
9611 SayNothingHappans();
9614 if (element2 !=
null && element2.
Value > 0)
9616 SetFeat(element2.
id, 0);
9619 PlaySound(
"mutation");
9620 PlayEffect(
"mutation");
9622 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9627 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
9629 Say(
"resistMutation",
this);
9633 for (
int i = 0; i < tries; i++)
9636 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9639 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9640 if (base.c_corruptionHistory.Count == 0)
9642 base.c_corruptionHistory =
null;
9645 Element element = elements.GetElement(row.
id);
9647 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))
9654 element = elements.GetElement(row.
id);
9656 bool flag = row.
tag.Contains(
"neg");
9669 if (element !=
null)
9671 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
9672 if (num > element.
source.max)
9674 num = element.source.max - 1;
9676 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
9677 flag2 = num > element.
Value;
9678 if (vec > 0 && !flag2)
9683 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
9684 SetFeat(row.
id, num);
9687 if (base.c_corruptionHistory ==
null)
9689 base.c_corruptionHistory =
new List<int>();
9691 base.c_corruptionHistory.Add(row.
id);
9694 Element element2 = elements.GetElement(row.
id);
9699 EClass.player.flags.gotEtherDisease =
true;
9701 thing.
SetStr(53,
"letter_ether");
9710 PlaySound(ether ?
"mutation_ether" :
"mutation");
9711 PlayEffect(
"mutation");
9713 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9717 Say(
"nothingHappens");
9723 Element orCreateElement = elements.GetOrCreateElement(ele);
9726 elements.ModBase(orCreateElement.
id, 1);
9728 if (orCreateElement is
Spell)
9730 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
9731 int num2 = origin?.Evalue(765) ?? 0;
9732 num = num * (100 - num2) / 100;
9733 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
9735 if (orCreateElement.
source.charge == 1)
9739 orCreateElement.vPotential += a;
9741 Say(
"spell_gain",
this, orCreateElement.
Name);
9753 Msg.
Say(
"curse_nullify", member);
9758 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
9760 Say(
"curse_nullify",
this);
9763 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
9765 Say(
"curse_nullify",
this);
9773 if (_historyFood !=
null)
9775 while (_historyFood.Count > 5)
9777 _historyFood.RemoveAt(_historyFood.Count - 1);
9779 if (_historyFood[0].Count > 0)
9781 _historyFood.Insert(0,
new List<string>());
9788 if (!IsPCFaction || !IsGlobal)
9790 _historyFood =
null;
9793 if (_historyFood ==
null)
9795 _historyFood =
new List<List<string>>
9800 if (_historyFood[0].Count < 5)
9802 _historyFood[0].Add(
food.id);
9808 if (_historyFood ==
null)
9813 foreach (List<string>
item in _historyFood)
9815 foreach (
string item2
in item)
9817 if (item2 ==
food.id)
9830 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9832 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9837 if (faithElements !=
null)
9842 if (idFaith ==
"eyth" && !HasElement(1228))
9852 if (!HasCondition<ConExcommunication>())
9860 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9861 for (
int i = 0; i < array.Length; i += 2)
9863 int num2 = array[i + 1] * num / 50;
9866 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
9868 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9872 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
9878 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
9884 bool flag = HasElement(1215);
9885 if (tempElements ==
null)
9894 int num = elements.ValueWithoutLink(ele);
9895 int num2 = Mathf.Abs(num) + 100;
9896 int num3 = num2 / (flag ? 2 : 4);
9897 int num4 = -num - 100;
9898 int num5 = tempElements.
Base(ele);
9899 int num6 = num5 + a;
9902 num3 = Mathf.Min(a, num3);
9903 num4 = Mathf.Max(a, -num2 / 3);
9905 if (a > 0 && num6 > num3)
9907 a = ((num3 > num5) ? (num3 - num5) : 0);
9909 if (a < 0 && num6 < num4)
9911 a = ((num4 < num5) ? (num4 - num5) : 0);
9914 if (element.
vBase == 0)
9917 if (tempElements.
dict.Count == 0)
9919 tempElements =
null;
9938 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
9944 foreach (
int ele
in array)
9946 EnhanceTempElement(ele, p, onlyRenew);
9952 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
9957 if (tempElements ==
null)
9965 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
9972 if (tempElements !=
null)
9983 void Cure(
int[] eles)
9985 foreach (
int ele
in eles)
9987 if (tempElements ==
null)
9992 if (element !=
null && element.
vBase < 0)
9994 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
10002 if (tempElements !=
null)
10005 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)
int EvalueMax(int ele, int min=0)
void MakeFigureFrom(string id)
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)
Card MakeRefFrom(string id)
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)
SourceCellEffect.Row source
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)
bool HasHobbyOrWork(string alias)
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)
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)
Chara GetNearbyCatToSniff()
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 RequestProtection(Chara attacker, Action< Chara > action)
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
static List< Thing > _ListItems
Chara SetHomeZone(Zone zone)
Chara SetFaction(Faction f)
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)
bool HasMinion(string id)
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 MakeMinion(Chara _master, MinionType type=MinionType.Default)
override void LookAt(Point p)
void Kick(Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
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
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
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
void Kick(Point p, bool ignoreSelf=false, bool checkWall=true)
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 GainAbility(int ele, int mtp=100, Thing origin=null)
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()
bool visibleWithTelepathy
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 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)
int GetCooldown(int idEle)
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)
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
Chara SetHostility(Hostility h)
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()
bool DroppedCard(string id)
void MarkCardDrop(string id)
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 MakeLoveLunch(Chara c)
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)
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int ValueWithoutLink(int ele)
Element ModBase(int ele, int v)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
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, bool consume=true)
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 GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
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()
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 int DangerLvBoost
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 DestroyAll(Func< Thing, bool > funcExclude=null)
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 IgnoreOnSteppedWhenMoving
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)