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")]
186 private static List<Chara>
_pts =
new List<Chara>();
476 if (base.c_originalHostility == (
Hostility)0)
478 if (!
source.hostility.IsEmpty())
484 return base.c_originalHostility;
494 if (
source.idActor.Length <= 1)
524 return "CharaActorPCC";
536 if (base.dir != 1 && base.dir != 2)
552 return base.dir == 2;
566 return base.ExistsOnMap;
632 return base.c_uidMaster != 0;
708 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, 1E+09f);
710 public override int WeightLimit => (int)Mathf.Clamp(((
long)base.STR * 500L + base.END * 250 +
Evalue(207) * 2000) * ((!
HasElement(1411)) ? 1 : 5) + 45000, 1000f, 1.0737418E+09f);
714 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
720 if (base.c_idMainElement == 0)
728 public override int DV
739 num = 50 + (num - 50) / 10;
742 int WeaknessMod(
int a)
744 if (HasCondition<ConWeakness>())
757 public override int PV
768 num = 50 + (num - 50) / 10;
771 int WeaknessMod(
int a)
773 if (HasCondition<ConWeakness>())
844 if (!
IsGlobal && !base.isSubsetCard)
990 if (!(
race.id ==
"cat") && !(
race.id ==
"catsister"))
992 return race.id ==
"catgod";
1008 return race.id ==
"mutant";
1032 return EClass.Branch.uidMaid == base.uid;
1058 if (!
source.works.Contains(
"Rich"))
1060 return source.hobbies.Contains(
"Rich");
1074 if (base.c_genes !=
null)
1076 return base.c_genes.GetGeneSlot(
this);
1102 if (!
race.tag.Contains(
"mofu"))
1129 if (!h.
source.elements.IsEmpty())
1131 for (
int i = 0; i < h.
source.elements.Length; i += 2)
1133 int ele = h.
source.elements[i];
1134 int v = h.
source.elements[i + 1];
1164 if (base.rarity >=
Rarity.Legendary)
1179 if (
host ==
null || includeRide)
1183 return base.hp <
MaxHP / 5;
1198 return num > num2 + 0.1f;
1291 return p.cell.room.data.accessType
switch
1294 BaseArea.AccessType.Private =>
false,
1321 for (
int i = 0; i < slots.Count; i++)
1330 _cbits1.Bits = (uint)
_cints[0];
1341 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1350 if (
source.tag.Contains(
"boss"))
1367 string text = base.c_altName ??
source.GetName(
this);
1371 if (base.c_bossType ==
BossType.Evolved)
1373 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1376 if (text.Length > 0 &&
char.IsLower(text[0]))
1378 if (base.rarity >=
Rarity.Legendary)
1380 text = text.ToTitleCase();
1384 text = text.AddArticle();
1391 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1396 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1401 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1403 return text + text2;
1408 if (r != base.rarity)
1436 Hostility hostility2 = (base.c_originalHostility = h);
1437 this.hostility = hostility2;
1453 if (uniqueData !=
null)
1492 base.isSubsetCard =
false;
1494 base.c_uidMaster = 0;
1526 if (
source.tag.Contains(
"boss"))
1530 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1552 if (
source.idActor.Length > 2)
1561 if (
source.mainElement.Length != 0)
1563 int _genLv = Mathf.Min(
genLv, 100);
1564 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1565 string[] mainElement =
source.mainElement;
1566 for (
int i = 0; i < mainElement.Length; i++)
1568 string[] array = mainElement[i].Split(
'/');
1570 int num2 = source.LV * row.eleP / 100;
1571 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1573 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1576 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1579 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle ||
"ele" + a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1581 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1582 if (list.Count >= 2)
1584 num = tuple.Item3 + base.LV -
source.LV;
1589 base.c_altName = NameGen.getRandomName();
1593 _alias = AliasGen.GetRandomAlias();
1606 if (base.LV > 5 &&
race.id ==
"mutant")
1608 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1615 case "putty_mech_b":
1624 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1642 case "olderyoungersister":
1645 case "sister_undead":
1649 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1668 if (!
source.faith.IsEmpty())
1729 Debug.LogError(
"source is null");
1748 base.isHidden =
false;
1760 if (
EClass.
_zone.
IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() ||
corruption >= 100)
1769 if (!(text ==
"mech_scarab"))
1790 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1791 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1793 chara.SetFaith(
faith);
1794 chara.bio = IO.DeepCopy(
bio);
1796 chara.c_daysWithGod = base.c_daysWithGod;
1797 chara.RefreshFaithElement();
1798 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1799 chara.isCopy =
true;
1800 chara.isScaled = base.isScaled;
1810 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1819 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1829 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1845 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1851 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1874 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
1876 else if (
host !=
null)
1901 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
1912 num = 50 + Mathf.Clamp((
int)Mathf.Sqrt(num2) * 5 -
EClass.
_zone.
DangerLv / 50, 0, 50) + Mathf.Clamp((
int)Mathf.Sqrt(num2), 0, 25);
1913 if (info !=
null && num != 100)
1935 num -= (
IsPC ? 50 : 100);
1975 num += EClass.player.lastEmptyAlly *
Evalue(1646);
1980 num += EClass.player.lastEmptyAlly * 10 - 10;
1986 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
1987 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
1989 if (HasCondition<ConGravity>())
1992 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
2002 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
2013 if (value.
source.category ==
"skill")
2033 this.hostility = hostility2;
2039 this.hostility = hostility2;
2045 this.hostility = hostility2;
2060 base.ApplyEditorTags(tag);
2068 Debug.LogWarning(
"Chara " +
id +
" not found");
2077 if (!
id.StartsWith(
"ele"))
2086 if (base.c_idMainElement != 0)
2088 SetElements(base.c_idMainElement,
remove:
true);
2089 base.c_idMainElement = 0;
2094 SetElements(
id,
remove:
false);
2095 base.c_idMainElement =
id;
2098 base.isElemental =
true;
2101 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);
2105 void SetElements(
int idEle,
bool remove)
2165 base.c_idJob = idNew;
2193 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2197 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2218 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2227 string[] array =
race.figure.Split(
'|');
2228 foreach (
string s
in array)
2241 string[] array =
race.figure.Split(
'|');
2242 foreach (
string s
in array)
2264 base.c_idRace = idNew;
2280 Debug.Log(
"Creating Replacement NPC for:" +
this);
2308 this.hostility = hostility2;
2310 base.c_summonDuration = 0;
2311 base.isSummon =
false;
2332 owner?.
Say(
"summon_vanish",
this);
2342 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2343 this.hostility = hostility2;
2344 base.c_uidMaster = _master.
uid;
2345 base.c_minionType = type;
2364 base.c_uidMaster = 0;
2369 if (chara.
enemy ==
this)
2381 base.c_summonDuration = duration;
2382 base.isSummon =
true;
2429 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2448 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2453 if (cells[x, z].blocked)
2457 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2464 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2469 if (cells[x, z].blocked)
2473 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2499 if (detail !=
null && detail.
charas.Count > 0)
2534 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2544 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2549 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2556 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2561 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2592 List<Point> list =
new List<Point>();
2640 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2649 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2658 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2667 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2685 int num = p.x -
pos.
x;
2686 int num2 = p.z -
pos.
z;
2703 if (num == 0 && num2 == 0)
2713 return TryMove(point, allowDestroyPath:
false);
2722 if (!condition.
TryMove(newPoint))
2727 if (base.isRestrained)
2733 base.isRestrained =
false;
2735 if (!
CanMoveTo(newPoint, allowDestroyPath))
2739 return _Move(newPoint);
2790 EClass.player.lastZonePos =
null;
2793 for (
int i = 0; i < num2 * 4; i++)
2804 EClass.player.regionMoveWarned =
true;
2805 Msg.
Say(
"regionAbortMove");
2813 AddCondition<ConSuffocation>((
EClass.
pc.
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2814 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2821 ModExp(200, 1 + num4 * 12);
2824 EClass.player.regionMoveWarned =
false;
2832 num = EClass.setting.defaultActPace * 3f;
2860 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2862 newPoint = randomNeighbor;
2870 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2875 if (effect !=
null && effect.
id == 7)
2880 Say(
"abWeb_caught",
this);
2882 effect2.power = effect2.power * 3 / 4;
2886 Say(
"abWeb_pass",
this);
2895 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2910 traitDoor.TryOpenLock(
this);
2920 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2923 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2953 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2954 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2956 text = cell.
matObj.soundFoot;
2968 if (!text.IsEmpty())
2970 SoundManager.altLastData =
IsPC;
2977 bool flag5 = scene.actionMode.gameSpeed > 1f;
2978 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2979 scene.psFoot.startColor = row.
matColor;
2983 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
3007 Say(
"replace_pc", chara, chara2);
3018 traitDoor2.TryOpen(
this);
3045 if (!
item.isThing ||
item.placeState != 0 ||
item.ignoreAutoPick)
3057 if ((dataPick.
noRotten &&
item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3074 foreach (
int cat
in dataPick.
cats)
3076 if (
item.category.uid == cat)
3082 else if (!dataPick.
flag.HasFlag(containerFlag))
3124 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3156 EClass.player.flags.isShoesOff =
false;
3163 EClass.player.flags.isShoesOff =
true;
3181 EClass._map.MineBlock(_p, recoverBlock: false, this);
3184 EClass._map.MineObj(_p, null, this);
3190 EClass._map.MineObj(_p, null, this);
3197 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3203 t.SetPlaceState(PlaceState.roaming);
3219 if (list.Count == 0)
3223 list.Copy().ForeachReverse(delegate(
Chara c)
3227 List<Point> list2 = new List<Point>();
3228 for (int i = point.x - 1; i <= point.x + 1; i++)
3230 for (int j = point.z - 1; j <= point.z + 1; j++)
3232 if (i != point.x || j != point.z)
3234 Point point2 = new Point(i, j);
3235 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3242 if (list2.Count > 0)
3244 if (list2.Count > 1)
3246 list2.ForeachReverse(delegate(Point p)
3248 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3254 Point newPoint = list2.RandomItem();
3257 Say(
"displace",
this, c);
3267 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3269 Say(
"pushed_money",
this, c);
3334 if (z == currentZone)
3338 if (HasCondition<ConInvulnerable>())
3340 RemoveCondition<ConInvulnerable>();
3344 EClass.player.nextZone = z;
3352 EClass.player.returnInfo.turns += 5;
3359 EClass.player.deathZoneMove =
false;
3361 currentZone.events.OnLeaveZone();
3362 if (currentZone.instance !=
null)
3376 EClass.player.uidLastZone = currentZone.uid;
3379 if (currentZone.IsRegion)
3387 Msg.
Say(
"leaveZone", currentZone.Name);
3389 else if (z.
id != currentZone.id)
3393 EClass.player.lastZonePos = pos.Copy();
3395 EClass.player.lastTransition = transition;
3407 if (party !=
null && party.
leader ==
this)
3419 Debug.Log(base.Name);
3422 transition.uidLastZone = currentZone?.uid ?? 0;
3423 global.transition = transition;
3427 global.transition =
null;
3430 EClass.player.lastTransition =
null;
3433 if (IsBranchMember())
3444 public void MoveHome(
string id,
int x = -1,
int z = -1)
3459 CureCondition<ConSuspend>();
3486 orgPos =
new Point(x, z);
3487 if (factionBranch !=
null)
3489 RefreshWorkElements();
3501 state = ZoneTransition.EnterState.Fall,
3511 renderer.RefreshSprite();
3514 public override void Rotate(
bool reverse =
false)
3516 if (renderer.hasActor)
3518 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3522 base.dir = ((base.dir == 0) ? 1 : 0);
3525 renderer.RefreshSprite();
3535 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3538 if (angle > 100f && angle < 170f)
3542 else if (angle > 170f && angle < 190f)
3546 else if (angle > 190f || (angle < -10f && angle > -100f))
3556 else if (angle > 170f && angle < 235f)
3560 else if (angle > 80f && angle < 145f)
3564 else if (angle > -100f && angle < -35f)
3568 else if (angle > -10f && angle < 55f)
3572 renderer.RefreshSprite();
3583 else if (base.dir == 1)
3587 else if (base.dir == 2)
3591 else if (base.dir == 3)
3596 else if (base.dir == 0)
3600 else if (base.dir == 1)
3604 else if (base.dir == 2)
3608 else if (base.dir == 3)
3617 if (!renderer.hasActor)
3619 if (angle == 0f || angle == 45f || angle == 90f)
3623 if (angle == -135f || angle == 180f || angle == -90f)
3633 return renderer.actor.currentDir;
3639 for (
int i = -num; i < num + 1; i++)
3641 for (
int j = -num; j < num + 1; j++)
3643 shared.
Set(pos.x + i, pos.z + j);
3654 for (
int num = conditions.Count - 1; num >= 0; num--)
3656 if (conditions[num].ConsumeTurn)
3666 if (_cooldowns !=
null)
3671 consumeTurn =
false;
3672 preventRegen =
false;
3673 emoIcon =
Emo2.none;
3676 base.c_summonDuration--;
3677 if (base.c_summonDuration <= 0)
3685 AddCondition<ConWet>(20);
3690 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3695 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3710 if (parasite !=
null)
3712 ModExp(227, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.
LV) * 25));
3716 ModExp(226, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.
LV) * 25));
3723 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3732 if (isWeakToSunlight && pos.IsSunLit)
3734 AddCondition<ConBurning>(1000, force:
true);
3738 if (!HasElement(1250))
3742 if (!HasCondition<ConVampire>())
3744 AddCondition<ConVampire>();
3746 if (!IsPC && !HasCooldown(8793))
3749 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.
HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3756 UseAbility(
"SpTransmuteBat",
this);
3761 if (turn % 200 == 0)
3763 DiminishTempElements();
3775 preventRegen =
true;
3779 Say(
"dmgBurden",
this);
3780 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3792 ModExp(207, 1 + phase2 * phase2);
3820 preventRegen =
true;
3824 if (
EClass.
rnd(100) == 0 && !isConfused)
3827 AddCondition<ConConfuse>(500);
3832 AddCondition<ConBlind>(200);
3835 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3843 int num2 = Evalue(409);
3844 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3849 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3851 if (num3 < conditions.Count)
3866 preventRegen =
true;
3880 if (!(text ==
"cocoon"))
3882 if (text ==
"tsunami")
3884 if (elements.Base(79) < 30)
3891 elements.SetTo(79, elements.Base(79) * 3 / 4);
3906 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3908 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3909 elements.ModExp(300, 8f);
3914 elements.ModExp(301, 8f);
3933 if (parasite !=
null)
3945 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3956 ignoreSPAbsorb =
false;
3959 if (hasMovedThisTurn)
3961 pos.Things.ForeachReverse(delegate(
Thing t)
3965 AI_Goto aI_Goto = ai.Current as AI_Goto;
3966 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3977 hasMovedThisTurn =
false;
3980 EClass.player.haltMove =
false;
4014 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4025 if (!tileInfo.
shore)
4030 int num2 = (tileInfo.isRoad ? 22 : 12);
4033 num2 = (tileInfo.isRoad ? 16 : 10);
4037 num2 *= (flag2 ? 2 : 20);
4048 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4061 EClass.player.pickupDelay = 0f;
4069 EClass.player.returnInfo =
null;
4092 Msg.
Say(
"returnComplete");
4093 EClass.player.uidLastTravelZone = 0;
4095 EClass.player.lastZonePos =
null;
4097 EClass.player.returnInfo =
null;
4100 EClass.player.returnInfo =
null;
4101 Msg.
Say(
"returnOverweight");
4105 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4113 RecipeUpdater.dirty =
true;
4119 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4120 hasMovedThisTurn =
false;
4123 if (!IsAliveInCurrentZone)
4127 renderer.RefreshStateIcon();
4128 if (host !=
null && !consumeTurn)
4130 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4136 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4138 Say(
"parasite_fail",
this, host);
4139 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4141 Talk(
"parasite_fail");
4156 if (base.isRestrained)
4177 Cell cell = base.Cell;
4180 AddCondition<ConWet>(50);
4181 if (pos.IsHotSpring)
4188 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4204 AddCondition<ConWet>(50);
4208 PlaySound(
"fire_step");
4209 AddCondition<ConBurning>(30);
4214 PlaySound(
"bubble");
4215 AddCondition<ConWet>(30);
4220 if (hasMovedThisTurn)
4222 Say(
"abMistOfDarkness_step",
this);
4224 AddCondition<ConDark>(e.
power);
4246 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4276 if (rootCard !=
this && things.IsFull(c.
Thing))
4283 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4293 if (things.GetDest(t).IsValid)
4314 t = TryPoisonPotion(t);
4322 Say(
"backpack_full_drop", t);
4329 Say(
"backpack_full", t);
4333 if (dest.
stack !=
null)
4337 PlaySound(
"pick_thing");
4338 Say(
"pick_thing",
this, t);
4346 PlaySound(
"pick_thing");
4347 Say(
"pick_thing",
this, t);
4349 TryReservePickupTutorial(t);
4359 Say(
"poisonDrip",
this);
4373 Say(
"absorbRod",
this, t);
4376 if (
rod.source !=
null)
4379 if (enumerator.MoveNext())
4411 if (t.
id ==
"pasture")
4423 foreach (
Card item in pos.ListCards())
4428 if (thing !=
null && !IsPC)
4430 thing.isNPCProperty =
true;
4475 t.isNPCProperty =
false;
4477 pos.TryWitnessCrime(
this);
4486 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4490 if (num == -1 || num > t.
Num)
4501 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4515 WidgetHotbar.dirtyCurrentItem =
true;
4526 if (IsPC && held.
invY == 1)
4528 WidgetHotbar.dirtyCurrentItem =
true;
4540 Say(
"canOnlyCarry", held);
4545 if (!flag && things.IsOverflowing())
4549 Say(
"backpack_full_drop", held);
4557 PlaySound(
"pick_thing");
4558 Say(
"pick_held",
this,
card);
4559 if (IsPC &&
card.id ==
"statue_weird")
4566 WidgetHotbar.dirtyCurrentItem =
true;
4581 return held.
Split(a);
4604 WidgetHotbar.dirtyCurrentItem =
true;
4609 if (
card.trait.CanOnlyCarry)
4620 Msg.
Say(
"markedImportant");
4635 t.ignoreAutoPick =
true;
4646 int num = Evalue(131);
4647 int num2 = Evalue(130);
4648 int num3 = Evalue(123);
4649 if (num > num2 && num > num3)
4653 if (num2 > num && num2 > num3)
4657 if (num3 > num && num3 > num2)
4671 if (elements.Value(122) > elements.Value(120))
4673 return elements.GetElement(122);
4675 return elements.GetElement(120);
4680 isOnCreate = onCreate;
4685 RestockInventory(onCreate);
4690 string equip = source.
equip;
4691 if (equip.IsEmpty())
4695 if (equip ==
"none")
4706 EQ_ID(
"staff_long", 1);
4714 EQ_ID(
"tail_snowleopard");
4720 EQ_ID(
"sword_zephir");
4723 case "adv_mesherada":
4726 EQ_ID(
"dagger_hathaway");
4732 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4736 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4742 EQ_ID(
"sword_muramasa");
4748 EQ_ID(
"dagger_gaki");
4752 EQ_ID(
"dagger_ninto");
4756 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4762 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4773 AddThing(
"gun_gravity2");
4779 AddThing(
"bow_vindale");
4785 EQ_ID(
"EtherDagger2");
4788 case "keeper_garden":
4791 EQ_ID(
"sword_ragnarok");
4797 EQ_ID(
"axe_destruction");
4803 EQ_ID(
"ribbon_duponne");
4809 EQ_ID(
"helm_seeker");
4812 EQ_ID(
"sword_katana");
4814 EQ_ID(
"sword_katana");
4817 EQ_ID(
"boots_seven");
4821 for (
int i = 0; i < 20; i++)
4826 AddThing(
"plat").SetNum(6);
4832 AddThing(
"guitar_efrond");
4838 AddThing(
"guitar_ash");
4844 EQ_ID(
"EtherDagger");
4852 thing.rarity =
Rarity.Normal;
4864 EQ_ID(
"staff_magius");
4870 EQ_ID(
"staff_insanity");
4876 EQ_ID(
"sword_katana");
4880 if (!TryEquipRanged())
4887 AddThing(
"gun_laser");
4891 Thing thing2 = AddThing(
"panzerfaust");
4900 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4910 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4915 if (race.
id ==
"asura")
4917 for (
int j = 0; j < 4; j++)
4919 EQ_CAT(job.
weapon.RandomItem());
4922 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4930 else if (!job.
weapon.IsEmpty())
4934 EQ_CAT(job.
weapon.RandomItem());
4936 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4938 EQ_CAT(job.
weapon.RandomItem());
4981 EQ_ID(
"shield_lute");
4984 if (HasTag(
CTAG.shield))
4995 if (ShouldRestock(
"_meat"))
5001 Restock(
"book_story", 1);
5003 case "rock_thrower":
5011 Restock(
"book_story_home", 1);
5016 void Restock(
string id,
int num)
5018 if (ShouldRestock(
id))
5023 bool ShouldRestock(
string id)
5025 return things.Find(
id) ==
null;
5033 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5034 Rarity rarity2 = base.rarity;
5035 if (
id ==
"big_sister")
5037 num = (isOnCreate ? 8 : 4);
5045 rarity =
Rarity.Superior;
5047 else if (rarity2 ==
Rarity.Legendary)
5051 else if (rarity2 >=
Rarity.Mythical)
5057 rarity =
Rarity.Legendary;
5059 CardBlueprint.current.rarity = rarity;
5067 CardBlueprint.current.rarity = r;
5070 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
5075 if (!body.
Equip(thing))
5086 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
5091 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
5128 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
5132 Msg.
Say(
"returnHome",
this, homeZone.Name);
5149 base.hp = MaxHP / 3;
5152 if (hunger.
value > 30)
5156 sleepiness.value = 0;
5157 hostility = OriginalHostility;
5158 RemoveCondition<StanceTaunt>();
5159 if (
id ==
"keeper_garden")
5167 Msg.
Say(
"noDeathPenalty2",
this);
5171 Msg.
Say(
"noDeathPenalty",
this);
5177 List<Thing> dropList =
new List<Thing>();
5182 t.ignoreAutoPick = true;
5185 }, onlyAccessible:
false);
5191 EClass.player.preventDeathPenalty =
false;
5193 if (IsPCFaction && homeBranch !=
null)
5195 homeBranch.
Log(
"bRevive",
this);
5208 PlayEffect(
"revive");
5210 SetCensored(enable:
false);
5216 ModCorruption(-100000);
5217 if (base.LV < 10000000)
5219 SetLv(base.LV * 10 + 9);
5223 mana.value = mana.
max;
5224 stamina.value = stamina.
max;
5232 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5235 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5239 if (!lastword.IsEmpty())
5241 thing.c_note = lastword;
5243 thing.isModified =
true;
5289 if (HasCondition<ConAnorexia>())
5295 else if (base.c_vomit > 10)
5297 AddCondition<ConAnorexia>();
5299 AddCondition<ConDim>();
5300 if (HasCondition<ConAnorexia>())
5314 if (isDead || host !=
null)
5318 bool isInActiveZone = IsInActiveZone;
5327 if (
id ==
"tsunami")
5329 pos.PlaySound(
"water");
5333 Say(
"summon_vanish",
this);
5334 pos.PlayEffect(
"vanish");
5335 pos.PlaySound(
"vanish");
5350 PlayEffect(
"revive");
5351 PlaySound(
"chime_angel");
5358 PlaySound(base.material.GetSoundDead(source));
5360 renderer.RefreshSprite();
5361 renderer.RefreshStateIcon();
5366 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5369 text =
"dead_" + attackSource;
5375 text =
"dead_" + e.
source.alias;
5384 EClass._zone.isDeathLocation =
true;
5385 string s = ((origin ==
null) ? text :
"dead_by");
5397 AI_PlayMusic.keepPlaying =
false;
5403 Msg.
Say(
"goto_heaven",
this);
5407 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5409 Msg.
Say(text,
this,
"", text2);
5411 string text3 = TalkTopic(
"dead");
5412 if (!text3.IsEmpty())
5414 text3 = text3.StripBrackets();
5416 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5431 if (homeBranch !=
null)
5433 homeBranch.
Log(text,
this,
"");
5445 if (
id ==
"mandrake" || HasElement(488))
5447 Say(
"a_scream",
this);
5452 ClearTempElements();
5455 base.isSale =
false;
5467 EClass.player.returnInfo =
null;
5468 EClass.player.uidLastTravelZone = 0;
5477 chara3.enemy =
null;
5482 EClass.player.preventDeathPenalty =
true;
5487 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5496 currentZone.RemoveCard(
this);
5498 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5501 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5505 ModAffinity(
EClass.
pc, a, show:
false);
5507 if (!(text4 ==
"quru"))
5509 if (text4 ==
"corgon")
5521 if (origin.IsPCParty || origin.IsPCPartyMinion)
5524 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5528 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5535 num = num * 30 / 100;
5546 else if (origin.IsPCFaction)
5548 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5549 origin.Chara.ShowEmo(
Emo.love);
5552 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5556 if (base.IsPCFactionOrMinion)
5560 Msg.
Say(
"abort_allyDead");
5565 Msg.
Say(
"abort_enemyDead");
5567 if (IsPCParty && !IsPC)
5570 base.c_wasInPcParty =
true;
5576 if (attackSource !=
AttackSource.DeathSentense && !IsPCFaction)
5578 EClass.player.flags.little_killed =
true;
5591 case "shark_sister":
5600 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5604 if (chara2.
LV < base.LV)
5606 chara2.
SetLv(base.LV);
5608 chara2.
MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara,
MinionType.Friend);
5609 Msg.
Say(
"plant_pop",
this, chara2);
5616 if (IsPCFaction || IsPCFactionMinion)
5623 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5629 flag = (flag2 =
true);
5630 EClass._zone.Boss =
null;
5635 EClass.player.flags.KilledBossInVoid =
true;
5641 SE.Play(
"Jingle/fanfare2");
5651 flag = (flag2 =
true);
5661 flag = (flag2 =
true);
5673 flag = (flag2 =
true);
5678 EClass.player.flags.killedDuponne =
true;
5684 flag = (flag2 =
true);
5690 case "melilith_boss":
5692 flag = (flag2 =
true);
5699 if (questCurry !=
null)
5702 flag = (flag2 =
true);
5712 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
5714 if (num2 && questNasu !=
null && questNasu.
phase <= 1)
5716 if (questNasu.
phase == 0)
5721 flag = (flag2 =
true);
5732 flag = (flag2 =
true);
5734 if (questExploration !=
null)
5736 SE.Play(
"kill_boss");
5746 SE.Play(
"kill_boss");
5747 SoundManager.ForceBGM();
5753 SE.Play(
"kill_boss");
5767 EClass.player.willAutoSave =
true;
5780 public void Kick(
Point p,
bool ignoreSelf =
false,
bool checkWall =
true)
5784 Kick(
item, ignoreSelf, karmaLoss:
true, show:
true, checkWall);
5788 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true,
bool checkWall =
true)
5790 if (!IsAliveInCurrentZone)
5816 Say(
"kick",
this, t);
5836 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5841 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5846 if (HasCooldown(a.
id))
5850 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
5852 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5853 int num = list.IndexOf(a.
id);
5856 int num2 = list.TryGet(num + Evalue(1422));
5857 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5866 if (IsPC && HasCondition<StanceManaCost>())
5868 num4 = Evalue(1657);
5880 ForeachEnemy(delegate
5887 ForeachParty(delegate
5903 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5905 int num6 = cost.cost * num5 / 100;
5908 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5918 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5926 ActPlan.warning =
true;
5929 if (UseAbility(a, tc, pos, pt))
5938 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))
5940 Say(
"shakeHead",
this);
5943 if (tc !=
null && tc !=
this)
5947 if (pos !=
null && !base.pos.Equals(pos))
5953 num3 = 1 + Evalue(1648);
5955 if (IsPC && cost.
cost > 0 && a.
Value == 0)
5962 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5963 if (!a.
source.tag.Contains(
"useHand"))
5965 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5978 a.vPotential -= i * 2;
5979 num6 = num6 * (100 - num4 * 20) / 100;
5988 else if (a.
source.langAct.Length != 0 && tc !=
null)
5990 string text = a.
source.langAct[0];
5991 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5992 if (text ==
"spell_hand")
5995 string @ref = text2.lang(list2[4]);
5996 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6000 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
6004 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
6010 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
6020 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6024 ignoreSPAbsorb =
true;
6027 if (a is
Spell && GetCondition<ConSilence>() !=
null)
6029 Say(
"cast_silence",
this);
6036 int spellExp = elements.GetSpellExp(
this, a, num5);
6039 Say(
"fizzle",
this);
6040 PlayEffect(
"fizzle");
6041 PlaySound(
"fizzle");
6044 ModExp(a.
id, spellExp / 5);
6046 RemoveCondition<ConInvisibility>();
6050 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
6052 AddCooldown(a.
id, a.
source.cooldown);
6054 if (HasTalk(
"phrase_" + a.
source.alias))
6056 EClass.player.forceTalk =
true;
6057 Talk(
"phrase_" + a.
source.alias);
6064 ForeachEnemy(delegate(
Chara c)
6071 ForeachParty(delegate(
Chara c)
6076 Act.forcePt =
false;
6080 for (
int j = 0; j < num3; j++)
6086 ActEffect.RapidCount = j;
6088 flag2 = a.
Perform(
this, tc, pos);
6091 if (flag2 && !isDead)
6095 ModExp(a.
id, spellExp);
6097 if (a.
source.alias.StartsWith(
"sword_"))
6102 ActEffect.RapidCount = 0;
6103 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
6105 RemoveCondition<ConInvisibility>();
6106 RemoveCondition<ConDark>();
6108 if (!base.IsPCFactionOrMinion && a.
HasTag(
"specialAbility"))
6110 string name = a.
Name;
6111 renderer.Say(
"| " + name +
" ");
6114 void ForeachEnemy(Action<Chara> action)
6116 if (_pts.Count == 0)
6121 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
6127 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
6129 action(_pts[num11]);
6132 void ForeachParty(Action<Chara> action)
6134 if (_pts.Count == 0)
6141 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
6152 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
6159 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
6170 return 25 + Evalue(226) * 125 / 100;
6186 if (host.
ride ==
this)
6188 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
6192 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
6197 int num3 = Evalue(304);
6200 num3 = Mathf.Max(num3, base.LV + 5);
6204 bool num6 = GetArmorSkill() == 122;
6208 num4 = 20 - Evalue(122) / 5;
6209 num5 += 10 - Evalue(1654) * 4;
6213 num4 = 10 - Evalue(120) / 5;
6223 if (parasite !=
null)
6234 num5 += 20 - Evalue(1654) * 8;
6240 if (HasCondition<ConDim>())
6242 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6252 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6255 public void DoAI(
int wait, Action onPerform)
6270 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6276 if (headpat &&
this != c)
6287 if (!member.
IsPC && CanSeeLos(member))
6297 if (c.
id ==
"hedgehog_ether")
6301 Say(
"reflect_thorne", c,
this);
6333 if (enemy ==
null && !IsPC)
6335 if (GetInt(106) == 0)
6339 if (OriginalHostility !=
Hostility.Enemy)
6343 SetEnemy(_tg.
Chara);
6357 if (_tg ==
null || !_tg.
isChara)
6364 EClass.pc.combatCount = 10;
6372 chara.
Say(
"frown",
this, chara);
6384 chara.
Say(
"frown",
this, chara);
6391 bool flag = chara.id ==
"fanatic";
6394 chara.
Say(
"callHelp", chara);
6466 bool flag = enemy !=
null || ai is
GoalCombat;
6467 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6469 bool flag3 = !IsPCParty;
6475 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2))
6479 int num3 = Dist(chara2);
6480 int num4 = GetSightRadius() + (flag ? 1 : 0);
6487 if (
this == pos.FirstChara)
6489 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6497 DoHostileAction(chara2);
6510 DoHostileAction(chara);
6522 if (chara !=
this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6524 DoHostileAction(chara);
6543 if (base.IsPCFactionOrMinion)
6556 if (OriginalHostility >=
Hostility.Friend)
6601 return EClass.game.activeZone == currentZone;
6608 foreach (
Point item2
in item.ListPoints())
6610 if (pos.Equals(item2))
6631 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6655 charaRenderer.pccData = PCCData.Create(
"ride");
6656 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6657 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6658 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6662 foreach (
Condition condition
in conditions)
6665 if (rendererReplacer !=
null)
6667 charaRenderer.replacer = rendererReplacer;
6668 charaRenderer.data = rendererReplacer.
data;
6672 if (charaRenderer.
replacer ==
null)
6674 charaRenderer.pccData = pccData;
6677 renderer = charaRenderer;
6679 if (cardRenderer !=
null)
6681 renderer.SetFirst(first:
false, cardRenderer.
position);
6683 return charaRenderer;
6690 PCC.Get(pccData).Build(state);
6698 PCC pCC = PCC.Get(pccData);
6700 return pCC.variation.idle[0, 0];
6702 if (spriteReplacer !=
null)
6706 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);
6727 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
6736 p.mat = base.material;
6737 p.matColor = base.colorInt;
6738 if (!renderer.usePass)
6742 if (renderer.replacer !=
null)
6744 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6750 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6755 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6758 else if (sourceCard.
_tiles.Length > 1)
6760 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6761 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6765 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6772 string text = base.Name;
6773 if (IsFriendOrAbove())
6777 else if (IsHostile())
6783 if (base.LV >= lV * 5)
6787 else if (base.LV >= lV * 2)
6791 else if (base.LV <= lV / 4)
6795 else if (base.LV <= lV / 2)
6801 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6802 s = (
" (" + s.lang() +
") ").TagSize(14);
6806 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6810 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6816 text2 +=
"lowerGround".lang();
6818 else if (HasHigherGround(
EClass.
pc))
6820 text2 +=
"higherGround".lang();
6823 if (Evalue(1232) > 0)
6825 text2 =
"milkBaby".lang().TagSize(14) + text2;
6829 text2 =
"hasBounty".lang().TagSize(14) + text2;
6833 text2 += (
"(" + faith.Name +
")").TagSize(14);
6839 return text + text2 + s;
6847 text += Environment.NewLine;
6848 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6853 text2 += Environment.NewLine;
6854 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6855 text2 += Environment.NewLine;
6857 text2 += Environment.NewLine;
6858 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6859 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.idSkin +
" scaled:" + base.
isScaled;
6863 text2 += Environment.NewLine;
6864 text2 +=
"<size=14>";
6867 text2 = text2 + item.Name +
", ";
6869 foreach (
Hobby item2
in ListHobbies())
6871 text2 = text2 + item2.Name +
", ";
6873 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
6876 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6877 if (enumerable.Count() > 0)
6879 text3 += Environment.NewLine;
6880 text3 +=
"<size=14>";
6885 if (text4.IsEmpty() || text4 ==
"#")
6890 switch (item3.
source.group)
6903 text4 = text4 +
"(" + item3.
GetValue() +
")";
6904 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
6906 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
6910 text3 = text3 + text4.TagColor(c) +
", ";
6919 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6924 text3 += Environment.NewLine;
6927 text3 = text3 + item4.act.Name +
", ";
6929 text3 = text3.TrimEnd(
", ".ToCharArray());
6931 return text + text2 + text3;
6936 string key = source.
idText.IsEmpty(
id);
6946 string text = row.GetText(topic, returnNull:
true);
6951 if (text.StartsWith(
"@"))
6958 text = row.GetText(topic, returnNull:
true);
6964 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6969 if (host ==
null && !IsInActiveZone)
6973 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6979 int num = EClass.pc.party.members.Count - 1;
7004 string topicText = GetTopicText(topic);
7005 if (topicText.IsEmpty())
7009 string text =
"_bracketTalk".lang();
7010 bool flag = topicText.StartsWith(
"*");
7011 bool flag2 = topicText.StartsWith(
"(");
7012 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
7013 topicText = ApplyTone(topicText);
7014 topicText = topicText.Replace(
"~",
"*");
7016 Msg.
Say(StripTalkSpeiclaCharacters(topicText.Replace(
"&",
"")));
7017 if (topic ==
"dead")
7021 else if (flag || flag3 || flag2)
7023 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
7041 if (conSuspend !=
null && IsPCParty)
7043 RemoveCondition<ConSuspend>();
7047 if (IsDeadOrSleeping)
7049 ShowDialog(
"_chara",
"sleep");
7054 ShowDialog(
"_chara",
"invisible");
7060 ShowDialog(
"_chara",
"give_card");
7069 if (GetInt(71) == -2)
7071 ShowDialog(
"_chara",
"give_lunch");
7077 if (base.isRestrained)
7079 ShowDialog(
"_chara",
"strain");
7084 ShowDialog(
"_chara",
"escort");
7089 ShowDialog(
"_chara",
"party");
7103 EClass.player.flags.loytelEscaped =
false;
7105 ShowDialog(
"loytel",
"loytelEscaped");
7109 if (questDebt !=
null && questDebt.
paid)
7112 if (questDebt.
stage > 7)
7114 questDebt.stage = 7;
7116 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
7124 ShowDialog(
"farris");
7130 ShowDialog(
"farris",
"nymelle_noQuest");
7133 ShowDialog(
"farris",
"nymelle_first");
7136 ShowDialog(
"farris",
"home_first");
7139 ShowDialog(
"farris");
7144 ShowDialog(
"ashland");
7149 SoundManager.ForceBGM();
7156 EClass.player.flags.fiamaFirstDream =
true;
7157 ShowDialog(
"fiama",
"firstDream");
7161 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
7163 EClass.player.flags.fiamaStoryBookGiven =
true;
7169 ShowDialog(
"fiama");
7174 ShowDialog(
"fiama");
7180 ShowDialog(
"big_sister",
"little_saved");
7181 EClass.player.flags.little_saved =
false;
7186 ShowDialog(
"big_sister",
"little_dead");
7187 EClass.player.flags.little_killed =
false;
7195 ShowDialog(
"guild_doorman",
"main", tag);
7201 ShowDialog(
"guild_clerk",
"main", tag2);
7216 ShowDialog(
"_chara");
7222 return _ShowDialog(
book,
null, step, tag);
7228 if (
book ==
"_chara" && IsPC)
7242 return base.LV / 2 + 4;
7248 if (FindBed() !=
null)
7257 return GetHappiness().ToString() ??
"";
7262 string result =
"?????";
7275 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7285 sortVal = job._index * 10000 + sourceCard.
_index;
7288 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7291 sortVal = -GetTotalFeat();
7294 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7307 foreach (
Card item in map.props.installed.all)
7311 traitBed.RemoveHolder(
this);
7330 if (!IsPCFaction && !IsGuest())
7339 Msg.
Say(
"claimBed",
this);
7348 if (GetInt(113) != 0)
7353 Thing bestRangedWeapon = GetBestRangedWeapon();
7354 foreach (
Thing thing
in things)
7360 _ListItems.Add(thing);
7364 _ListItems.Add(thing);
7368 if (_ListItems.Count == 0)
7372 List<Thing> containers2 = containers.ToList();
7373 foreach (
Thing listItem
in _ListItems)
7398 bool flag = GetInt(113) == 0;
7407 foreach (
Thing thing3
in things)
7409 if (CanEat(thing3, shouldEat))
7425 if (thing3.
id ==
"polish_powder")
7439 foreach (
Thing container
in containers)
7449 if (num4 > 0 && thing4.
id ==
"polish_powder")
7451 _ListItems.Add(thing4);
7456 _ListItems.Add(thing4);
7461 _ListItems.Add(thing4);
7466 _ListItems.Add(thing4);
7469 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
7471 _ListItems.Add(thing4);
7476 _ListItems.Add(thing4);
7481 _ListItems.Add(thing4);
7486 if (_ListItems.Count == 0)
7490 _ListItems.ForeachReverse(delegate(
Thing t)
7495 int slot = t.category.slot;
7496 int equipValue = t.GetEquipValue();
7497 foreach (Thing listItem in _ListItems)
7499 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7507 _ListItems.Remove(t);
7512 foreach (
Thing listItem2
in _ListItems)
7514 Thing thing = listItem2;
7515 if (things.IsFull(thing))
7524 thing = thing.
Split(1);
7527 else if (thing.
Num > 2)
7529 thing = thing.
Split(2);
7536 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
7538 TryEquip(thing, useFav:
true);
7544 TryPutSharedItems(containers);
7550 Thing result =
null;
7558 int num2 = CountNumEaten(
item);
7559 int num3 = 100 - num2 + (
item.HasElement(757) ? 10 : 0);
7573 t = FindBestFoodToEat();
7585 Say(
"eat_start",
this, t.Duplicate(1));
7619 if (!CanEquipRanged(t))
7624 foreach (
Thing thing
in things)
7645 if (bodySlot ==
null)
7651 switch (GetFavAttackStyle())
7690 if (!base.IsPCFactionOrMinion)
7695 if (value.
Value <= 0)
7712 num2 += value.Value * num3 / 100;
7729 if (!ShouldEquip(t, useFav))
7740 switch (GetFavAttackStyle())
7756 body.
Equip(t, slot);
7762 Say(
"equip",
this, t);
7778 return FindThrowable(hotbar:
true);
7782 things.Foreach(delegate(
Thing t)
7784 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7790 Thing FindThrowable(
bool hotbar)
7792 things.Foreach(delegate(
Thing t)
7829 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7834 Thing result =
null;
7836 foreach (
Thing thing
in things)
7859 if (ranged !=
null && ranged.
parent ==
this)
7863 ranged = GetBestRangedWeapon();
7864 return ranged !=
null;
7869 if (body.
GetWeight(armorOnly:
true) <= (HasElement(1204) ? 6000 : 30000))
7894 if (t.
id ==
"cigar")
7899 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7901 SetAIImmediate(
new AI_Eat
7920 if (base.hp < MaxHP * 90 / 100)
7923 if (healAction !=
null)
7934 return FindBed()?.owner.pos.cell.room;
7949 if (!trait.CanChangeAffinity)
7954 if (IsPCFaction && homeBranch !=
null)
7956 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7973 Say(
"affinityNone",
this, c);
7978 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7982 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7988 a = affinity.
Mod(a);
7995 int num = Evalue(289);
8007 num2 += (lV - num) * 10;
8009 elements.
ModExp(289, Mathf.Min(num2, 1000));
8025 chara.orgPos = orgPos.
Copy();
8027 chara.pos = pos.
Copy();
8028 chara.isImported =
true;
8029 chara.c_editorTags = base.c_editorTags;
8030 chara.c_editorTraitVal = base.c_editorTraitVal;
8031 chara.c_idTrait = base.c_idTrait;
8032 chara.homeZone = homeZone;
8038 if (_listFavFood.Count == 0)
8042 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
8044 _listFavFood.Add(row);
8051 r = _listFavFood.RandomItem();
8059 if (_listFavCat.Count == 0)
8065 _listFavCat.Add(row);
8071 r = _listFavCat.RandomItem();
8078 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
8080 if (enumerator.MoveNext())
8082 return enumerator.Current;
8090 Say(
"abCatSniff",
this, c);
8095 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
8101 if (base.c_upgrades !=
null)
8103 num += base.c_upgrades.spent;
8105 if (base.c_genes !=
null)
8107 num += base.c_genes.GetTotalCost();
8109 return num + base.feat;
8116 if (
item.act.id == 6630)
8126 string text = race.
id;
8127 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
8140 if (
id ==
"olderyoungersister")
8142 if (base.idSkin != 2)
8144 return "UN_olderyoungersister";
8146 return "UN_olderyoungersister_alt";
8152 return base.c_idPortrait;
8169 if (HasElement(1231))
8172 AddCondition<ConEuphoric>(100 * Evalue(1231));
8176 SetFeat(1231, 1, msg:
true);
8183 int num2 = ((!HasElement(1411)) ? 1 : 3);
8184 if (GetBurden(t, num) >= num2)
8197 if (!IsValidGiftWeight(t, num))
8205 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
8214 if (things.IsFull())
8241 Msg.
Say(
"affinityNone", c,
this);
8247 int num2 = 200 + t.LV * 3;
8263 c.
Say(
"draw_curse", c, t);
8265 List<Element> list =
new List<Element>();
8273 if (list.Count == 0)
8278 Element element = list.RandomItem();
8284 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8286 GiveLovePotion(c, t);
8300 case "ticket_massage":
8307 case "ticket_armpillow":
8315 case "ticket_champagne":
8322 if (t.
id ==
"flyer")
8327 c.
Talk(
"flyer_miss");
8333 Msg.
Say(
"affinityNone", c,
this);
8335 elements.ModExp(291, 10f);
8338 elements.ModExp(291, 50f);
8340 if (t.
id ==
"statue_weird")
8361 Say(
"give_erohon",
this);
8362 AddCondition<ConParalyze>(50, force:
true);
8363 AddCondition<ConConfuse>(50, force:
true);
8364 AddCondition<ConFear>(1000, force:
true);
8372 c.
Say(
"give_love", c, t);
8382 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
8406 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
8407 int num2 = Dist(chara);
8412 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8418 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
8426 Say(
"intercept_loyal", chara,
this);
8429 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8434 if (!flag && !HasElement(1225))
8436 Say(
"intercept", chara,
this);
8439 chara.
Talk(
"intercept", base.NameSimple);
8441 if (attacker.enemy ==
this)
8443 attacker.SetEnemy(chara);
8506 if (t.
id ==
"flyer")
8526 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
8528 Thing thing = things[num2];
8529 if (ShouldThrowAway(thing, type))
8540 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
8548 _ = base.c_upgrades;
8557 for (
int i = 0; i < 100; i++)
8563 if (base.c_upgrades ==
null)
8567 if (base.c_upgrades.halt)
8578 List<Element> list = ListAvailabeFeats(pet:
true);
8579 if (num >= 90 && list.Count > 0)
8581 Element element = list.RandomItem();
8585 else if (num >= 60 && ie.Any())
8587 num2 = ie.RandomItem().id;
8598 if (num4 > base.feat)
8603 base.c_upgrades.count++;
8604 base.c_upgrades.spent += num4;
8610 if (
item.idEle == num2)
8631 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8633 else if (elements.ValueWithoutLink(row.
id) == 0)
8635 elements.Learn(row.
id);
8639 elements.ModBase(num2, num3);
8646 if (IsPC || base.isScaled || HasElement(1273))
8652 if (base.c_daysWithPC > 360)
8663 if (_cooldowns ==
null)
8665 _cooldowns =
new List<int>();
8669 _cooldowns.Add(idEle * 1000 + turns);
8675 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8681 if (_cooldowns ==
null)
8683 _cooldowns =
new List<int>();
8686 for (
int i = 0; i < _cooldowns.Count; i++)
8688 if (_cooldowns[i] / 1000 == idEle)
8692 _cooldowns.RemoveAt(i);
8696 _cooldowns[i] = idEle * 1000 + turns;
8702 if (!flag && turns > 0)
8704 AddCooldown(idEle, turns);
8706 if (_cooldowns.Count == 0)
8714 return GetCooldown(idEle) != 0;
8719 if (_cooldowns !=
null)
8721 for (
int i = 0; i < _cooldowns.Count; i++)
8723 if (_cooldowns[i] / 1000 == idEle)
8725 return _cooldowns[i] % 1000;
8734 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8736 if (_cooldowns[num] % 1000 == 1)
8738 _cooldowns.RemoveAt(num);
8745 if (_cooldowns.Count == 0)
8758 if (IsPCParty || base.noMove)
8763 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8766 if (goalFromTimeTable !=
null)
8768 SetAI(goalFromTimeTable);
8771 goalFromTimeTable.
Tick();
8776 if (goalList.
index == -2)
8778 goalList.
Refresh(
this, goalListType);
8780 SetAI(goalList.
Next());
8804 return GetGoalWork();
8810 return GetGoalHobby();
8845 if (_works ==
null || _hobbies ==
null)
8849 foreach (
int work
in _works)
8856 foreach (
int hobby
in _hobbies)
8877 return SetAI(_NoGoalPC);
8895 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8899 if (HasCondition<ConWait>())
8901 RemoveCondition<ConWait>();
8907 renderer.RefreshStateIcon();
8914 bool hasNoGoal = HasNoGoal;
8949 listHobby.Add(
new Hobby
8960 foreach (
int work
in _works)
8962 listHobby.Add(
new Hobby
8976 if (_hobbies ==
null)
8980 foreach (
int hobby
in _hobbies)
8982 listHobby.Add(
new Hobby
8995 if (
item.source.alias ==
id)
9000 foreach (
Hobby item2
in ListHobbies())
9002 if (item2.
source.alias ==
id)
9012 if (workElements !=
null)
9016 workElements =
null;
9017 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
9025 foreach (
Hobby item2
in ListWorks())
9029 if (workElements !=
null)
9033 void TryAdd(
Hobby h)
9035 if (!h.
source.elements.IsEmpty())
9037 if (workElements ==
null)
9041 for (
int i = 0; i < h.
source.elements.Length; i += 2)
9043 int num = h.
source.elements[i];
9044 int num2 = h.
source.elements[i + 1];
9046 if (num != 2115 && num != 2207)
9054 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
9062 string text = (simple ?
"" : (
"hobby".lang() +
":"));
9067 return text.TrimEnd(
',');
9072 string text = (simple ?
"" : (
"work".lang() +
":"));
9077 return text.TrimEnd(
',');
9082 foreach (
int hobby
in _hobbies)
9094 foreach (
int work
in _works)
9106 if (_hobbies !=
null && _works !=
null)
9113 _hobbies =
new List<int>();
9114 _works =
new List<int>();
9122 string[] hobbies = source.
hobbies;
9123 foreach (
string key
in hobbies)
9128 if (source.
works.IsEmpty())
9134 string[] hobbies = source.
works;
9135 foreach (
string key2
in hobbies)
9140 GetWorkSummary().Reset();
9145 if (_workSummary ==
null)
9149 return _workSummary;
9162 if (workSummary.
work !=
null)
9167 else if (workSummary.
hobbies.Count > 0)
9188 hobby.id = session.
id;
9193 workSummary.progress +=
EClass.
rnd(5) + 5;
9195 int num = PerformWork(hobby, 0, isHobby);
9196 int num2 = PerformWork(hobby, 1, isHobby);
9197 int num3 = PerformWork(hobby, 2, isHobby);
9198 int num4 = PerformWork(hobby, 3, isHobby);
9199 workSummary.money += num;
9200 workSummary.food += num2;
9201 workSummary.knowledge += num3;
9202 workSummary.material += num4;
9203 int PerformWork(
Hobby work,
int idx,
bool isHobby)
9205 if (idx >= work.
source.resources.Length)
9209 int num5 = work.
source.resources[idx];
9211 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
9212 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
9213 if (num6 > 0 && num5 <= 0)
9223 _goalWork.
FindWork(
this, setAI:
false);
9239 foreach (
Condition condition
in conditions)
9241 condition.
SetOwner(
this, onDeserialize);
9247 return AddCondition(typeof(T).Name, p, force);
9260 if (c is
ConBleed && ResistLv(964) >= 3)
9265 else if (ResistLv(950) >= 3)
9283 if (c.
source.negate.Length != 0)
9285 string[] negate = c.
source.negate;
9286 foreach (
string text
in negate)
9288 if (HasElement(text))
9295 if (defenseAttribute !=
null)
9297 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
9299 if (c.
source.resistance.Length != 0)
9304 c.power /= num * num + 1;
9322 for (
int j = 0; j < conditions.Count; j++)
9324 if (conditions[j].
id != c.
id)
9330 conditions[j].Kill();
9333 if (conditions[j].CanStack(c))
9335 if (conditions[j].ShouldOverride(c))
9337 if (conditions[j].IsOverrideConditionMet(c, num2))
9339 conditions[j].Kill(silent:
true);
9344 if (CanGainConResist)
9348 conditions[j].OnStacked(c.
power);
9349 conditions[j].OnStartOrStack();
9350 conditions[j].PlayEffect();
9352 if (!conditions[j].AllowMultipleInstance)
9357 foreach (
Condition condition
in conditions)
9366 if (CanGainConResist)
9373 if (c.ShouldRefresh)
9385 if (c.SyncRide && (ride !=
null || parasite !=
null))
9391 if (parasite !=
null)
9399 public override bool HasCondition<T>()
9401 for (
int i = 0; i < conditions.Count; i++)
9403 if (conditions[i] is T)
9413 for (
int i = 0; i < conditions.Count; i++)
9415 if (conditions[i].source.alias == alias)
9430 for (
int i = 0; i < conditions.Count; i++)
9434 return conBuffStats.elements.GetElement(ele);
9443 foreach (
Condition condition
in conditions)
9453 public void CureCondition<T>(
int v = 99999) where T :
Condition
9455 T condition = GetCondition<T>();
9456 if (condition !=
null)
9458 condition.value -= v;
9459 if (condition.value <= 0)
9468 for (
int i = 0; i < conditions.Count; i++)
9470 if (conditions[i] is T)
9472 return conditions[i] as T;
9480 for (
int num = conditions.Count - 1; num >= 0; num--)
9482 if (conditions[num] is T)
9484 conditions[num].
Kill();
9492 if (parasite !=
null)
9494 parasite.
Cure(type, p, state);
9498 ride.
Cure(type, p, state);
9500 Cure(type, p, state);
9510 CureCondition<ConFear>();
9511 CureCondition<ConBlind>(2 * p / 100 + 5);
9512 CureCondition<ConPoison>(5 * p / 100 + 5);
9513 CureCondition<ConConfuse>(10 * p / 100 + 10);
9514 CureCondition<ConDim>(p / 100 + 5);
9515 CureCondition<ConBleed>(2 * p / 100 + 10);
9522 CureCondition<ConBlind>(5 * p / 100 + 15);
9523 CureCondition<ConPoison>(10 * p / 100 + 15);
9524 CureCondition<ConBleed>(5 * p / 100 + 20);
9525 CureTempElements(p, body:
true, mind:
false);
9528 CureCondition<ConFear>();
9529 CureCondition<ConDim>(3 * p / 100 + 10);
9530 CureTempElements(p, body:
false, mind:
true);
9534 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
9536 Condition condition2 = conditions[num2];
9541 condition2.
Mod(-1, force:
true);
9549 CureCondition<ConWait>();
9550 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
9551 bool flag3 = HasCondition<ConAnorexia>();
9552 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9553 if (base.c_vomit < 0)
9558 RemoveCondition<ConAnorexia>();
9568 bool flag2 = type ==
CureType.Death;
9569 CureTempElements(p * 100, body:
true, mind:
true);
9570 for (
int num = conditions.Count - 1; num >= 0; num--)
9577 switch (condition.
Type)
9597 CureCondition<ConWait>();
9598 CureCondition<ConSleep>();
9599 if (flag2 || type ==
CureType.Boss)
9602 RemoveCondition<ConBrightnessOfLife>();
9607 if (HasElement(1206))
9609 SetFeat(1206, 0, msg:
true);
9619 for (
int num = conditions.Count - 1; num >= 0; num--)
9635 if (
TC.hp > (
long)
TC.MaxHP * (
long)Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) / 100)
9639 if (
TC.HasElement(427))
9647 PlaySound(
"hit_finish");
9649 Say(
"finish2",
this,
TC);
9659 if (resistCon ==
null)
9661 resistCon =
new Dictionary<int, int>();
9663 if (resistCon.ContainsKey(key))
9665 resistCon[key] += con.power * con.GainResistFactor / 100;
9669 resistCon[key] = con.power * con.GainResistFactor / 100;
9676 if (con.
power > 0 && resistCon !=
null)
9678 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
9700 RemoveCondition<ConAwakening>();
9705 con.pcPillow = pillow;
9706 con.pickup = pickup;
9707 con.posBed = posBed;
9708 con.posPillow = posPillow;
9714 bool isSunLit = pos.IsSunLit;
9716 int num =
bed?.Power ?? 20;
9717 if (traitPillow !=
null)
9719 num += traitPillow.owner.Power / 2;
9723 num +=
bed.Evalue(750) * 5;
9729 OnSleep(num, days, isSunLit);
9732 public void OnSleep(
int power,
int days = 1,
bool isSunLit =
false)
9738 int num = power * days;
9739 if (stamina.
value < 0)
9743 if (isWeakToSunlight && isSunLit)
9750 AddCondition<ConBurning>(1000, force:
true);
9755 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9772 if (!HasElement(450))
9774 long num = bio.height;
9775 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9780 if (num > 999999999)
9784 if (num != bio.height)
9786 bio.height = (int)num;
9787 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
9794 if (HasElement(450) || a == 0)
9798 long num = bio.weight;
9799 long num2 = bio.height;
9800 long num3 = num2 * num2 * 18 / 25000;
9801 long num4 = num2 * num2 * 24 / 10000;
9802 if (ignoreLimit || (num > num3 && num < num4))
9804 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9809 if (num > 999999999)
9813 if (num != bio.weight)
9815 bio.weight = (int)num;
9816 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
9825 if (Evalue(962) >= 25 || (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0))
9829 int num = Evalue(412);
9832 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
9833 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
9840 int num3 = (corruption + a) / 100 - corruption / 100;
9841 for (
int i = 0; i < Mathf.Abs(num3); i++)
9843 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
9850 foreach (
Element value
in elements.dict.Values)
9852 if (value.
source.category ==
"ether")
9854 num4 += value.
Value;
9857 if (num4 > 0 && IsPC)
9861 corruption = num4 * 100 + corruption % 100;
9866 List<Element> list =
new List<Element>();
9869 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
9870 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
9879 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
9881 Feat feat = elements.GetElement(
id) as
Feat;
9883 if (feat !=
null && feat.
Value > 0)
9885 if (value == feat.
Value)
9892 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
9893 if (feat.
Value != 0)
9900 CalculateMaxStamina();
9906 if (feat.
source.textInc.IsEmpty())
9908 PlaySound(
"ding_skill");
9910 Say(
"gainFeat",
this, feat.
FullName);
9914 bool flag = value < num;
9915 if (feat.
source.tag.Contains(
"neg"))
9924 PlaySound(
"chime_angel");
9930 PlaySound(
"chime_devil");
9934 PlaySound(
"mutation");
9938 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9940 elements.CheckSkillActions();
9947 Element element = elements.GetElement(idEle);
9948 Element element2 = elements.GetElement(row2.
id);
9949 int num = element?.
Value ?? 0;
9958 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
9959 if (a == 0 && (element ==
null || element.
Value == 0))
9961 SayNothingHappans();
9964 if (element !=
null && element.
Value == a)
9966 SayNothingHappans();
9969 if (element2 !=
null && element2.
Value > 0)
9971 SetFeat(element2.
id, 0);
9974 PlaySound(
"mutation");
9975 PlayEffect(
"mutation");
9977 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9982 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
9984 Say(
"resistMutation",
this);
9988 for (
int i = 0; i < tries; i++)
9991 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9994 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9995 if (base.c_corruptionHistory.Count == 0)
9997 base.c_corruptionHistory =
null;
10000 Element element = elements.GetElement(row.
id);
10002 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))
10009 element = elements.GetElement(row.
id);
10011 bool flag = row.
tag.Contains(
"neg");
10024 if (element !=
null)
10026 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
10027 if (num > element.
source.max)
10029 num = element.source.max - 1;
10031 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
10032 flag2 = num > element.
Value;
10033 if (vec > 0 && !flag2)
10038 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
10039 SetFeat(row.
id, num);
10040 if (flag2 && ether)
10042 if (base.c_corruptionHistory ==
null)
10044 base.c_corruptionHistory =
new List<int>();
10046 base.c_corruptionHistory.Add(row.
id);
10049 Element element2 = elements.GetElement(row.
id);
10054 EClass.player.flags.gotEtherDisease =
true;
10056 thing.
SetStr(53,
"letter_ether");
10065 PlaySound(ether ?
"mutation_ether" :
"mutation");
10066 PlayEffect(
"mutation");
10068 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10072 Say(
"nothingHappens");
10078 Element orCreateElement = elements.GetOrCreateElement(ele);
10081 elements.ModBase(orCreateElement.
id, 1);
10083 if (orCreateElement is
Spell)
10085 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10086 int num2 = origin?.Evalue(765) ?? 0;
10087 num = num * (100 - num2) / 100;
10088 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10090 if (orCreateElement.
source.charge == 1)
10094 orCreateElement.vPotential += a;
10096 Say(
"spell_gain",
this, orCreateElement.
Name);
10108 Msg.
Say(
"curse_nullify", member);
10113 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
10115 Say(
"curse_nullify",
this);
10118 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
10120 Say(
"curse_nullify",
this);
10128 if (_historyFood !=
null)
10130 while (_historyFood.Count > 5)
10132 _historyFood.RemoveAt(_historyFood.Count - 1);
10134 if (_historyFood[0].Count > 0)
10136 _historyFood.Insert(0,
new List<string>());
10143 if (!IsPCFaction || !IsGlobal)
10145 _historyFood =
null;
10148 if (_historyFood ==
null)
10150 _historyFood =
new List<List<string>>
10155 if (_historyFood[0].Count < 5)
10157 _historyFood[0].Add(
food.id);
10163 if (_historyFood ==
null)
10168 foreach (List<string>
item in _historyFood)
10170 foreach (
string item2
in item)
10172 if (item2 ==
food.id)
10185 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10187 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10192 if (faithElements !=
null)
10197 if (idFaith ==
"eyth" && !HasElement(1228))
10207 if (!HasCondition<ConExcommunication>())
10215 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10216 for (
int i = 0; i < array.Length; i += 2)
10218 int num2 = array[i + 1] * num / 50;
10219 if (array[i] == 79)
10221 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
10223 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10227 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
10233 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
10239 bool flag = HasElement(1215);
10240 if (tempElements ==
null)
10249 int num = elements.ValueWithoutLink(ele);
10250 int num2 = Mathf.Abs(num) + 100;
10251 int num3 = num2 / (flag ? 2 : 4);
10252 int num4 = -num - 100;
10253 int num5 = tempElements.
Base(ele);
10254 int num6 = num5 + a;
10257 num3 = Mathf.Min(a, num3);
10258 num4 = Mathf.Max(a, -num2 / 3);
10260 if (a > 0 && num6 > num3)
10262 a = ((num3 > num5) ? (num3 - num5) : 0);
10264 if (a < 0 && num6 < num4)
10266 a = ((num4 < num5) ? (num4 - num5) : 0);
10269 if (element.
vBase == 0)
10272 if (tempElements.
dict.Count == 0)
10274 tempElements =
null;
10293 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
10299 foreach (
int ele
in array)
10301 EnhanceTempElement(ele, p, onlyRenew);
10307 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
10312 if (tempElements ==
null)
10318 if (
item.vBase > 0)
10320 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
10327 if (tempElements !=
null)
10338 void Cure(
int[] eles)
10340 foreach (
int ele
in eles)
10342 if (tempElements ==
null)
10347 if (element !=
null && element.
vBase < 0)
10349 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
10357 if (tempElements !=
null)
10360 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)
virtual int EvaluateTurn(int p)
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=null)
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
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
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 DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
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 AddExp(int a, bool applyMod=true)
bool HasElement(int ele, bool includeNagative=false)
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 HasElement(int idEle)
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
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
void SetCooldown(int idEle, int turns=0)
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 UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
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 OnSleep(int power, int days=1, bool isSunLit=false)
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 string GetBloodText(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)
void SetTo(int id, int v)
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)
bool HasElement(int ele, bool excludePC=false)
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)
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=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)
Effect PlayEffect(string id)
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()
int CountMinions(Chara c)
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
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)