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")]
188 private static List<Chara>
_pts =
new List<Chara>();
478 if (base.c_originalHostility == (
Hostility)0)
480 if (!
source.hostility.IsEmpty())
486 return base.c_originalHostility;
496 if (
source.idActor.Length <= 1)
526 return "CharaActorPCC";
538 if (base.dir != 1 && base.dir != 2)
554 return base.dir == 2;
568 return base.ExistsOnMap;
614 if (base.c_love !=
null)
616 return base.c_love.dateMarriage != 0;
646 return base.c_uidMaster != 0;
722 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);
724 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);
728 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
734 if (base.c_idMainElement == 0)
742 public override int DV
753 num = 50 + (num - 50) / 10;
756 int WeaknessMod(
int a)
758 if (HasCondition<ConWeakness>())
771 public override int PV
782 num = 50 + (num - 50) / 10;
785 int WeaknessMod(
int a)
787 if (HasCondition<ConWeakness>())
858 if (!
IsGlobal && !base.isSubsetCard)
1004 if (!(
race.id ==
"cat") && !(
race.id ==
"catsister"))
1006 return race.id ==
"catgod";
1022 return race.id ==
"mutant";
1046 return EClass.Branch.uidMaid == base.uid;
1072 if (!
source.works.Contains(
"Rich"))
1074 return source.hobbies.Contains(
"Rich");
1100 if (base.c_genes !=
null)
1102 return base.c_genes.GetGeneSlot(
this);
1128 if (!
race.tag.Contains(
"mofu"))
1155 if (!h.
source.elements.IsEmpty())
1157 for (
int i = 0; i < h.
source.elements.Length; i += 2)
1159 int ele = h.
source.elements[i];
1160 int v = h.
source.elements[i + 1];
1190 if (base.rarity >=
Rarity.Legendary)
1205 if (
host ==
null || includeRide)
1209 return base.hp <
MaxHP / 5;
1224 return num > num2 + 0.1f;
1317 return p.cell.room.data.accessType
switch
1320 BaseArea.AccessType.Private =>
false,
1347 for (
int i = 0; i < slots.Count; i++)
1356 _cbits1.Bits = (uint)
_cints[0];
1367 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1376 if (
source.tag.Contains(
"boss"))
1397 string text = base.c_altName ??
source.GetName(
this);
1398 if (HasCondition<ConTransmuteShadow>())
1405 if (base.c_bossType ==
BossType.Evolved)
1407 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1410 if (text.Length > 0 &&
char.IsLower(text[0]))
1412 if (base.rarity >=
Rarity.Legendary)
1414 text = text.ToTitleCase();
1418 text = text.AddArticle();
1425 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1430 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1435 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1437 return text + text2;
1442 if (r != base.rarity)
1470 Hostility hostility2 = (base.c_originalHostility = h);
1471 this.hostility = hostility2;
1487 if (uniqueData !=
null)
1526 base.isSubsetCard =
false;
1528 base.c_uidMaster = 0;
1560 if (
source.tag.Contains(
"boss"))
1564 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1586 if (
source.idActor.Length > 2)
1595 if (
source.mainElement.Length != 0)
1597 int _genLv = Mathf.Min(
genLv, 100);
1598 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1599 string[] mainElement =
source.mainElement;
1600 for (
int i = 0; i < mainElement.Length; i++)
1602 string[] array = mainElement[i].Split(
'/');
1604 int num2 = source.LV * row.eleP / 100;
1605 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1607 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1610 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / Mathf.Max(100 + (_genLv - a.Item3) * 25, 1));
1613 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle ||
"ele" + a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1615 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1616 if (list.Count >= 2)
1618 num = tuple.Item3 + base.LV -
source.LV;
1623 base.c_altName = NameGen.getRandomName();
1627 _alias = AliasGen.GetRandomAlias();
1640 if (base.LV > 5 &&
race.id ==
"mutant")
1642 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 20); j++)
1649 case "putty_mech_b":
1658 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1676 case "olderyoungersister":
1679 case "sister_undead":
1683 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1702 if (!
source.faith.IsEmpty())
1763 Debug.LogError(
"source is null");
1782 base.isHidden =
false;
1794 if (
EClass.
_zone.
IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() ||
corruption >= 100)
1803 if (!(text ==
"mech_scarab"))
1824 if (
item.Key != 1275)
1826 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1827 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1830 chara.SetFaith(
faith);
1831 chara.bio = IO.DeepCopy(
bio);
1833 chara.c_daysWithGod = base.c_daysWithGod;
1834 chara.RefreshFaithElement();
1835 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1836 chara.isCopy =
true;
1837 chara.isScaled = base.isScaled;
1847 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1856 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1866 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1882 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1888 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1916 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
1918 else if (
host !=
null)
1924 int value = 100 + (int)
_Speed * ((!
race.tag.Contains(
"noRide")) ? 1 : 5) * Mathf.Max(a, 1) - base.STR -
host.
EvalueRiding() * 2 - (
race.tag.Contains(
"ride") ? 50 : 0);
1945 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
1957 num = 50 + Mathf.Clamp((
int)Mathf.Sqrt(num2) * 5 -
EClass.
_zone.
DangerLv / 50, (num3 > 0) ? 50 : ((base.IsPowerful ||
IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((
int)Mathf.Sqrt(num2), 0, 25);
1958 if (info !=
null && num != 100)
1985 num -= (
IsPC ? 50 : 100);
2025 num += EClass.player.lastEmptyAlly *
Evalue(1646);
2030 num += EClass.player.lastEmptyAlly * 10 - 10;
2036 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
2037 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
2039 if (HasCondition<ConGravity>())
2042 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
2052 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
2063 if (value.
source.category ==
"skill")
2083 this.hostility = hostility2;
2089 this.hostility = hostility2;
2095 this.hostility = hostility2;
2110 base.ApplyEditorTags(tag);
2118 Debug.LogWarning(
"Chara " +
id +
" not found");
2127 if (!
id.StartsWith(
"ele"))
2136 if (base.c_idMainElement != 0)
2138 SetElements(base.c_idMainElement,
remove:
true);
2139 base.c_idMainElement = 0;
2144 SetElements(
id,
remove:
false);
2145 base.c_idMainElement =
id;
2148 base.isElemental =
true;
2151 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);
2155 void SetElements(
int idEle,
bool remove)
2215 base.c_idJob = idNew;
2243 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2247 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2268 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2277 string[] array =
race.figure.Split(
'|');
2278 foreach (
string s
in array)
2291 string[] array =
race.figure.Split(
'|');
2292 foreach (
string s
in array)
2311 if (
race.id ==
"bike" &&
id !=
"bike_cub")
2313 SetFeat(1423, (
id ==
"chara" ||
id ==
"player") ? 10 : (1 +
EClass.
rnd(10)));
2325 base.c_idRace = idNew;
2341 Debug.Log(
"Creating Replacement NPC for:" +
this);
2369 this.hostility = hostility2;
2371 base.c_summonDuration = 0;
2372 base.isSummon =
false;
2393 owner?.
Say(
"summon_vanish",
this);
2403 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2404 this.hostility = hostility2;
2405 base.c_uidMaster = _master.
uid;
2406 base.c_minionType = type;
2413 base.c_uidMaster = 0;
2418 if (chara.
enemy ==
this)
2430 List<Chara> list =
new List<Chara>();
2458 base.c_summonDuration = duration;
2459 base.isSummon =
true;
2506 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2525 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2530 if (cells[x, z].blocked)
2534 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2541 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2546 if (cells[x, z].blocked)
2550 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2576 if (detail !=
null && detail.
charas.Count > 0)
2611 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2621 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2626 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2633 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2638 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2669 List<Point> list =
new List<Point>();
2717 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2726 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2735 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2744 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2759 if (!condition.
TryMove(newPoint))
2764 if (base.isRestrained)
2770 base.isRestrained =
false;
2772 if (!
CanMoveTo(newPoint, allowDestroyPath))
2776 return _Move(newPoint);
2827 EClass.player.lastZonePos =
null;
2830 for (
int i = 0; i < num2 * 4; i++)
2841 EClass.player.regionMoveWarned =
true;
2842 Msg.
Say(
"regionAbortMove");
2853 AddCondition<ConSuffocation>((
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2855 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2862 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
2865 EClass.player.regionMoveWarned =
false;
2873 num = EClass.setting.defaultActPace * 3f;
2901 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2903 newPoint = randomNeighbor;
2911 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2916 if (effect !=
null && effect.
id == 7)
2921 Say(
"abWeb_caught",
this);
2923 effect2.power = effect2.power * 3 / 4;
2927 Say(
"abWeb_pass",
this);
2932 EClass.player.renderExtraTime = 0f;
2937 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2946 if (
item.mimicry !=
null &&
item.IsHostile(
this))
2948 item.mimicry.RevealMimicry(
this, surprise:
true);
2963 traitDoor.TryOpenLock(
this);
2973 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2976 bool flag5 = cell.IsTopWater && !cell.
isFloating;
3006 string text = ((flag3 || flag5) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
3007 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
3009 text = cell.
matObj.soundFoot;
3021 if (!text.IsEmpty())
3023 SoundManager.altLastData =
IsPC;
3030 bool flag6 = scene.actionMode.gameSpeed > 1f;
3031 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
3032 scene.psFoot.startColor = row.
matColor;
3036 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
3060 Say(
"replace_pc", chara, chara2);
3071 traitDoor2.TryOpen(
this);
3110 if ((dataPick.
noRotten && item2.
IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3127 foreach (
int cat
in dataPick.
cats)
3135 else if (!dataPick.
flag.HasFlag(containerFlag))
3177 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3209 EClass.player.flags.isShoesOff =
false;
3216 EClass.player.flags.isShoesOff =
true;
3240 EClass._map.MineBlock(_p, recoverBlock: false, this);
3243 EClass._map.MineObj(_p, null, this);
3249 EClass._map.MineObj(_p, null, this);
3256 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3262 t.SetPlaceState(PlaceState.roaming);
3278 if (list.Count == 0)
3282 list.Copy().ForeachReverse(delegate(
Chara c)
3286 List<Point> list2 = new List<Point>();
3287 for (int i = point.x - 1; i <= point.x + 1; i++)
3289 for (int j = point.z - 1; j <= point.z + 1; j++)
3291 if (i != point.x || j != point.z)
3293 Point point2 = new Point(i, j);
3294 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3301 if (list2.Count > 0)
3303 if (list2.Count > 1)
3305 list2.ForeachReverse(delegate(Point p)
3307 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3313 Point newPoint = list2.RandomItem();
3316 Say(
"displace",
this, c);
3326 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3328 Say(
"pushed_money",
this, c);
3393 if (z == currentZone)
3397 if (HasCondition<ConInvulnerable>())
3399 RemoveCondition<ConInvulnerable>();
3403 EClass.player.nextZone = z;
3411 EClass.player.returnInfo.turns += 5;
3418 EClass.player.deathZoneMove =
false;
3420 currentZone.events.OnLeaveZone();
3421 if (currentZone.instance !=
null)
3435 EClass.player.uidLastZone = currentZone.uid;
3438 if (currentZone.IsRegion)
3446 Msg.
Say(
"leaveZone", currentZone.Name);
3448 else if (z.
id != currentZone.id)
3452 EClass.player.lastZonePos = pos.Copy();
3454 EClass.player.lastTransition = transition;
3476 if (party !=
null && party.
leader ==
this)
3488 Debug.Log(base.Name);
3491 transition.uidLastZone = currentZone?.uid ?? 0;
3492 global.transition = transition;
3496 global.transition =
null;
3499 EClass.player.lastTransition =
null;
3502 if (IsBranchMember())
3513 public void MoveHome(
string id,
int x = -1,
int z = -1)
3528 CureCondition<ConSuspend>();
3555 orgPos =
new Point(x, z);
3556 if (factionBranch !=
null)
3558 RefreshWorkElements();
3570 state = ZoneTransition.EnterState.Fall,
3580 renderer.RefreshSprite();
3583 public override void Rotate(
bool reverse =
false)
3585 if (renderer.hasActor)
3587 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3591 base.dir = ((base.dir == 0) ? 1 : 0);
3594 renderer.RefreshSprite();
3604 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3607 if (angle > 100f && angle < 170f)
3611 else if (angle > 170f && angle < 190f)
3615 else if (angle > 190f || (angle < -10f && angle > -100f))
3625 else if (angle > 170f && angle < 235f)
3629 else if (angle > 80f && angle < 145f)
3633 else if (angle > -100f && angle < -35f)
3637 else if (angle > -10f && angle < 55f)
3641 renderer.RefreshSprite();
3652 else if (base.dir == 1)
3656 else if (base.dir == 2)
3660 else if (base.dir == 3)
3665 else if (base.dir == 0)
3669 else if (base.dir == 1)
3673 else if (base.dir == 2)
3677 else if (base.dir == 3)
3686 if (!renderer.hasActor)
3688 if (angle == 0f || angle == 45f || angle == 90f)
3692 if (angle == -135f || angle == 180f || angle == -90f)
3702 return renderer.actor.currentDir;
3708 for (
int i = -num; i < num + 1; i++)
3710 for (
int j = -num; j < num + 1; j++)
3712 shared.
Set(pos.x + i, pos.z + j);
3723 for (
int num = conditions.Count - 1; num >= 0; num--)
3725 if (conditions[num].ConsumeTurn)
3735 if (_cooldowns !=
null)
3740 consumeTurn =
false;
3741 preventRegen =
false;
3742 emoIcon =
Emo2.none;
3745 base.c_summonDuration--;
3746 if (base.c_summonDuration <= 0)
3754 AddCondition<ConWet>(20);
3759 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3764 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3779 if (parasite !=
null)
3792 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3807 if (isWeakToSunlight && pos.IsSunLit)
3809 AddCondition<ConBurning>(1000, force:
true);
3813 if (HasElement(1250))
3815 if (!HasCondition<ConVampire>())
3817 AddCondition<ConVampire>();
3819 if (!IsPC && !HasCooldown(8793))
3822 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.
HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3829 UseAbility(
"SpTransmuteBat",
this);
3833 if (HasElement(1423) && !HasCondition<ConPeaky>())
3835 AddCondition<ConPeaky>();
3839 if (turn % 200 == 0)
3841 DiminishTempElements();
3853 preventRegen =
true;
3857 Say(
"dmgBurden",
this);
3858 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3870 ModExp(207, 1 + phase2 * phase2);
3898 preventRegen =
true;
3902 if (
EClass.
rnd(100) == 0 && !isConfused)
3905 AddCondition<ConConfuse>(500);
3910 AddCondition<ConBlind>(200);
3913 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3921 int num2 = Evalue(409);
3922 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3927 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3929 if (num3 < conditions.Count)
3944 preventRegen =
true;
3958 if (!(text ==
"cocoon"))
3960 if (text ==
"tsunami")
3962 if (elements.Base(79) < 30)
3969 elements.SetTo(79, elements.Base(79) * 3 / 4);
3984 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3986 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3987 elements.ModExp(300, 8f);
3992 elements.ModExp(301, 8f);
4011 if (parasite !=
null)
4023 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
4034 ignoreSPAbsorb =
false;
4037 if (hasMovedThisTurn)
4039 pos.Things.ForeachReverse(delegate(
Thing t)
4043 AI_Goto aI_Goto = ai.Current as AI_Goto;
4044 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4055 hasMovedThisTurn =
false;
4058 EClass.player.haltMove =
false;
4092 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4103 if (!tileInfo.
shore)
4108 int num2 = (tileInfo.isRoad ? 22 : 12);
4111 num2 = (tileInfo.isRoad ? 16 : 10);
4115 num2 *= (flag2 ? 2 : 20);
4126 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4139 EClass.player.pickupDelay = 0f;
4147 EClass.player.returnInfo =
null;
4170 Msg.
Say(
"returnComplete");
4171 EClass.player.uidLastTravelZone = 0;
4173 EClass.player.lastZonePos =
null;
4175 EClass.player.returnInfo =
null;
4178 EClass.player.returnInfo =
null;
4179 Msg.
Say(
"returnOverweight");
4183 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4191 RecipeUpdater.dirty =
true;
4197 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4198 hasMovedThisTurn =
false;
4201 if (!IsAliveInCurrentZone)
4205 renderer.RefreshStateIcon();
4206 if (host !=
null && !consumeTurn)
4208 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4214 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4216 Say(
"parasite_fail",
this, host);
4217 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4219 Talk(
"parasite_fail");
4234 if (base.isRestrained)
4255 Cell cell = base.Cell;
4258 AddCondition<ConWet>(50);
4259 if (pos.IsHotSpring)
4266 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4282 AddCondition<ConWet>(50);
4286 PlaySound(
"fire_step");
4287 AddCondition<ConBurning>(30);
4292 PlaySound(
"bubble");
4293 AddCondition<ConWet>(30);
4298 if (hasMovedThisTurn)
4300 Say(
"abMistOfDarkness_step",
this);
4302 AddCondition<ConDark>(e.
power);
4324 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4354 if (rootCard !=
this && things.IsFull(c.
Thing))
4361 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4371 if (things.GetDest(t).IsValid)
4392 t = TryPoisonPotion(t);
4400 Say(
"backpack_full_drop", t);
4407 Say(
"backpack_full", t);
4411 if (dest.
stack !=
null)
4415 PlaySound(
"pick_thing");
4416 Say(
"pick_thing",
this, t);
4424 PlaySound(
"pick_thing");
4425 Say(
"pick_thing",
this, t);
4427 TryReservePickupTutorial(t);
4437 Say(
"poisonDrip",
this);
4451 Say(
"absorbRod",
this, t);
4454 if (
rod.source !=
null)
4457 if (enumerator.MoveNext())
4489 if (t.
id ==
"pasture")
4501 foreach (
Card item in pos.ListCards())
4506 if (thing !=
null && !IsPC)
4508 thing.isNPCProperty =
true;
4553 t.isNPCProperty =
false;
4557 pos.TryWitnessCrime(
this);
4567 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4571 if (num == -1 || num > t.
Num)
4582 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4596 WidgetHotbar.dirtyCurrentItem =
true;
4607 if (IsPC && held.
invY == 1)
4609 WidgetHotbar.dirtyCurrentItem =
true;
4621 Say(
"canOnlyCarry", held);
4626 if (!flag && things.IsOverflowing())
4630 Say(
"backpack_full_drop", held);
4638 PlaySound(
"pick_thing");
4639 Say(
"pick_held",
this,
card);
4640 if (IsPC &&
card.id ==
"statue_weird")
4647 WidgetHotbar.dirtyCurrentItem =
true;
4662 return held.
Split(a);
4685 WidgetHotbar.dirtyCurrentItem =
true;
4690 if (
card.trait.CanOnlyCarry)
4701 Msg.
Say(
"markedImportant");
4716 t.ignoreAutoPick =
true;
4727 int num = Evalue(131);
4728 int num2 = Evalue(130);
4729 int num3 = Evalue(123);
4730 if (num > num2 && num > num3)
4734 if (num2 > num && num2 > num3)
4738 if (num3 > num && num3 > num2)
4752 if (elements.Value(122) > elements.Value(120))
4754 return elements.GetElement(122);
4756 return elements.GetElement(120);
4761 isOnCreate = onCreate;
4766 RestockInventory(onCreate);
4771 string equip = source.
equip;
4772 if (equip.IsEmpty())
4776 if (equip ==
"none")
4787 EQ_ID(
"staff_long", 1);
4795 EQ_ID(
"tail_snowleopard");
4801 EQ_ID(
"sword_zephir");
4804 case "adv_mesherada":
4807 EQ_ID(
"dagger_hathaway");
4813 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4817 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4823 EQ_ID(
"sword_muramasa");
4829 EQ_ID(
"dagger_gaki");
4833 EQ_ID(
"dagger_ninto");
4837 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4843 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4854 AddThing(
"gun_gravity2");
4860 AddThing(
"bow_vindale");
4866 EQ_ID(
"EtherDagger2");
4869 case "keeper_garden":
4872 EQ_ID(
"sword_ragnarok");
4878 EQ_ID(
"axe_destruction");
4884 EQ_ID(
"ribbon_duponne");
4890 EQ_ID(
"helm_seeker");
4893 EQ_ID(
"sword_katana");
4895 EQ_ID(
"sword_katana");
4898 EQ_ID(
"boots_seven");
4902 for (
int i = 0; i < 20; i++)
4907 AddThing(
"plat").SetNum(6);
4913 AddThing(
"guitar_efrond");
4919 AddThing(
"guitar_ash");
4925 EQ_ID(
"EtherDagger");
4933 thing.rarity =
Rarity.Normal;
4945 EQ_ID(
"staff_magius");
4951 EQ_ID(
"staff_insanity");
4957 EQ_ID(
"sword_katana");
4963 EQ_ID(
"staff_leek");
4969 EQ_ID(
"dagger_hocho");
4980 if (!TryEquipRanged())
4987 AddThing(
"gun_laser");
4991 Thing thing2 = AddThing(
"panzerfaust");
5000 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
5010 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
5015 if (race.
id ==
"asura")
5017 for (
int j = 0; j < 4; j++)
5019 EQ_CAT(job.
weapon.RandomItem());
5022 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
5030 else if (!job.
weapon.IsEmpty())
5034 EQ_CAT(job.
weapon.RandomItem());
5036 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
5038 EQ_CAT(job.
weapon.RandomItem());
5081 EQ_ID(
"shield_lute");
5084 if (HasTag(
CTAG.shield))
5095 if (ShouldRestock(
"_meat"))
5101 Restock(
"book_story", 1);
5103 case "rock_thrower":
5111 Restock(
"book_story_home", 1);
5116 void Restock(
string id,
int num)
5118 if (ShouldRestock(
id))
5123 bool ShouldRestock(
string id)
5125 return things.Find(
id) ==
null;
5133 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5134 Rarity rarity2 = base.rarity;
5135 if (
id ==
"big_sister")
5137 num = (isOnCreate ? 8 : 4);
5145 rarity =
Rarity.Superior;
5147 else if (rarity2 ==
Rarity.Legendary)
5151 else if (rarity2 >=
Rarity.Mythical)
5157 rarity =
Rarity.Legendary;
5159 CardBlueprint.current.rarity = rarity;
5167 CardBlueprint.current.rarity = r;
5170 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
5175 if (!body.
Equip(thing))
5186 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
5191 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
5228 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
5232 Msg.
Say(
"returnHome",
this, homeZone.Name);
5249 base.hp = MaxHP / 3;
5252 if (hunger.
value > 30)
5256 sleepiness.value = 0;
5257 hostility = OriginalHostility;
5258 RemoveCondition<StanceTaunt>();
5259 if (
id ==
"keeper_garden")
5267 Msg.
Say(
"noDeathPenalty2",
this);
5271 Msg.
Say(
"noDeathPenalty",
this);
5277 List<Thing> dropList =
new List<Thing>();
5282 t.ignoreAutoPick = true;
5285 }, onlyAccessible:
false);
5291 EClass.player.preventDeathPenalty =
false;
5293 if (IsPCFaction && homeBranch !=
null)
5295 homeBranch.
Log(
"bRevive",
this);
5308 PlayEffect(
"revive");
5310 SetCensored(enable:
false);
5316 ModCorruption(-100000);
5317 if (base.LV < 10000000)
5319 SetLv(base.LV * 10 + 9);
5323 mana.value = mana.
max;
5324 stamina.value = stamina.
max;
5332 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5335 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5339 if (!lastword.IsEmpty())
5341 thing.c_note = lastword;
5343 thing.isModified =
true;
5389 if (HasCondition<ConAnorexia>())
5395 else if (base.c_vomit > 10)
5397 AddCondition<ConAnorexia>();
5399 AddCondition<ConDim>();
5400 if (HasCondition<ConAnorexia>())
5421 if ((uint)(attackSource - 17) > 1u)
5423 AddCondition<ConFaint>(200, force:
true);
5428 bool isInActiveZone = IsInActiveZone;
5431 if (
id ==
"putty" && origin !=
null && origin.IsPCParty)
5441 if (
id ==
"tsunami")
5443 pos.PlaySound(
"water");
5447 Say(
"summon_vanish",
this);
5448 pos.PlayEffect(
"vanish");
5449 pos.PlaySound(
"vanish");
5454 if ((uint)(attackSource - 17) <= 1u)
5464 PlayEffect(
"revive");
5465 PlaySound(
"chime_angel");
5472 PlaySound(base.material.GetSoundDead(source));
5474 renderer.RefreshSprite();
5475 renderer.RefreshStateIcon();
5484 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5487 text =
"dead_" + attackSource;
5493 text =
"dead_" + e.
source.alias;
5502 EClass._zone.isDeathLocation =
true;
5503 string s = ((origin ==
null) ? text :
"dead_by");
5515 AI_PlayMusic.keepPlaying =
false;
5521 Msg.
Say(
"goto_heaven",
this);
5525 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5527 Msg.
Say(text,
this,
"", text2);
5529 string text3 = TalkTopic(
"dead");
5530 if (!text3.IsEmpty())
5532 text3 = text3.StripBrackets();
5534 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5549 if (homeBranch !=
null)
5551 homeBranch.
Log(text,
this,
"");
5563 if (
id ==
"mandrake" || HasElement(488))
5565 Say(
"a_scream",
this);
5570 ClearTempElements();
5573 base.isSale =
false;
5585 EClass.player.returnInfo =
null;
5586 EClass.player.uidLastTravelZone = 0;
5595 chara3.enemy =
null;
5600 EClass.player.preventDeathPenalty =
true;
5605 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5614 currentZone.RemoveCard(
this);
5616 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5619 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5623 ModAffinity(
EClass.
pc, a, show:
false);
5625 if (!(text4 ==
"quru"))
5627 if (text4 ==
"corgon")
5639 if (origin.IsPCParty || origin.IsPCPartyMinion)
5642 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5646 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5653 num = num * 30 / 100;
5664 else if (origin.IsPCFaction)
5666 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5667 origin.Chara.ShowEmo(
Emo.love);
5670 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5674 if (base.IsPCFactionOrMinion)
5678 Msg.
Say(
"abort_allyDead");
5683 Msg.
Say(
"abort_enemyDead");
5685 if (IsPCParty && !IsPC)
5688 base.c_wasInPcParty =
true;
5694 if (attackSource !=
AttackSource.Euthanasia && !IsPCFaction)
5696 EClass.player.flags.little_killed =
true;
5709 case "shark_sister":
5718 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5722 if (chara2.
LV < base.LV)
5724 chara2.
SetLv(base.LV);
5726 chara2.
MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara,
MinionType.Friend);
5727 Msg.
Say(
"plant_pop",
this, chara2);
5735 if (IsPCFaction || IsPCFactionMinion)
5742 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5748 flag = (flag2 =
true);
5749 EClass._zone.Boss =
null;
5754 EClass.player.flags.KilledBossInVoid =
true;
5760 SE.Play(
"Jingle/fanfare2");
5770 flag = (flag2 =
true);
5780 flag = (flag2 =
true);
5792 flag = (flag2 =
true);
5797 EClass.player.flags.killedDuponne =
true;
5803 flag = (flag2 =
true);
5809 case "melilith_boss":
5811 flag = (flag2 =
true);
5818 if (questCurry !=
null)
5821 flag = (flag2 =
true);
5831 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
5833 if (num2 && questNasu !=
null && questNasu.
phase <= 1)
5835 if (questNasu.
phase == 0)
5840 flag = (flag2 =
true);
5851 flag = (flag2 =
true);
5853 if (questExploration !=
null)
5855 SE.Play(
"kill_boss");
5865 SE.Play(
"kill_boss");
5866 SoundManager.ForceBGM();
5872 SE.Play(
"kill_boss");
5886 EClass.player.willAutoSave =
true;
5901 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5906 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5911 if (HasCooldown(a.
id))
5919 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
5921 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5922 int num = list.IndexOf(a.
id);
5925 int num2 = list.TryGet(num + Evalue(1422));
5926 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5935 bool flag2 = ability.
Has(a.
id);
5936 if (IsPC && HasCondition<StanceManaCost>())
5938 num4 = Evalue(1657);
5950 ForeachEnemy(delegate
5957 ForeachParty(delegate
5973 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5975 int num6 = cost.cost * num5 / 100;
5978 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5988 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5997 ActPlan.warning =
true;
6000 EClass.scene.mouseTarget.card = cardBk;
6001 if (UseAbility(a, tc, pos, pt))
6010 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))
6012 Say(
"shakeHead",
this);
6015 if (tc !=
null && tc !=
this)
6019 if (pos !=
null && !base.pos.Equals(pos))
6025 num3 = 1 + Evalue(1648);
6027 if (IsPC && cost.
cost > 0 && a.
Value == 0 && !flag2)
6034 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
6035 if (!a.
source.tag.Contains(
"useHand"))
6037 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
6048 if (num4 > 0 && (a.
vPotential >= i * 2 || flag2))
6052 a.vPotential -= i * 2;
6054 num6 = num6 * (100 - num4 * 20) / 100;
6065 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2 && !a.
HasTag(
"dontForget"))
6071 if (a.
source.langAct.Length != 0 && tc !=
null)
6073 string text = a.
source.langAct[0];
6074 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
6075 if (text ==
"spell_hand")
6078 string @ref = text2.lang(list2[4]);
6079 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6083 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
6087 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
6094 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6107 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6111 ignoreSPAbsorb =
true;
6114 if (a is
Spell && GetCondition<ConSilence>() !=
null)
6116 Say(
"cast_silence",
this);
6123 int spellExp = elements.GetSpellExp(
this, a, num5);
6126 Say(
"fizzle",
this);
6127 PlayEffect(
"fizzle");
6128 PlaySound(
"fizzle");
6131 ModExp(a.
id, spellExp / 5);
6133 RemoveCondition<ConInvisibility>();
6137 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
6139 AddCooldown(a.
id, a.
source.cooldown);
6141 if (HasTalk(
"phrase_" + a.
source.alias))
6143 EClass.player.forceTalk =
true;
6144 Talk(
"phrase_" + a.
source.alias);
6151 ForeachEnemy(delegate(
Chara c)
6158 ForeachParty(delegate(
Chara c)
6163 Act.forcePt =
false;
6167 for (
int j = 0; j < num3; j++)
6173 ActEffect.RapidCount = j;
6175 flag3 = a.
Perform(
this, tc, pos);
6178 if (flag3 && !isDead)
6182 elements.ModBase(a.
id, 1);
6186 ModExp(a.
id, spellExp);
6188 if (a.
source.alias.StartsWith(
"sword_"))
6193 ActEffect.RapidCount = 0;
6194 if (flag3 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
6196 RemoveCondition<ConInvisibility>();
6197 RemoveCondition<ConDark>();
6199 if (!base.IsPCFactionOrMinion && a.
HasTag(
"specialAbility"))
6201 string name = a.
Name;
6202 renderer.Say(
"| " + name +
" ");
6205 void ForeachEnemy(Action<Chara> action)
6207 if (_pts.Count == 0)
6212 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
6218 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
6220 action(_pts[num11]);
6223 void ForeachParty(Action<Chara> action)
6225 if (_pts.Count == 0)
6232 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
6243 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
6250 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
6261 return 25 + Evalue(226) * 125 / 100;
6277 if (host.
ride ==
this)
6279 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
6283 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
6288 int num3 = Evalue(304);
6291 num3 = Mathf.Max(num3, base.LV + 5);
6295 bool num6 = GetArmorSkill() == 122;
6299 num4 = 20 - Evalue(122) / 5;
6300 num5 += 10 - Evalue(1654) * 4;
6304 num4 = 10 - Evalue(120) / 5;
6314 if (parasite !=
null)
6325 num5 += 20 - Evalue(1654) * 8;
6331 if (HasCondition<ConDim>())
6333 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6343 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6346 public void DoAI(
int wait, Action onPerform)
6361 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6367 if (headpat &&
this != c)
6378 if (!member.
IsPC && CanSeeLos(member))
6388 if (c.
id ==
"hedgehog_ether")
6392 Say(
"reflect_thorne",
this, c);
6399 EClass.player.forceTalk =
true;
6400 Talk(
"kiss",
null,
null, IsPC);
6402 renderer.PlayAnime(
AnimeID.Kiss, c);
6405 if (num > 0 &&
EClass.
rnd(IsPC ? 100 : 5000) == 0)
6409 if (IsPC &&
this != c)
6421 Effect.
Get(
"love").
_Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.
pos);
6426 if (
id ==
"olderyoungersister")
6431 Say(
"slap",
this, c);
6468 if (enemy ==
null && !IsPC)
6470 if (GetInt(106) == 0)
6474 if (OriginalHostility !=
Hostility.Enemy)
6478 SetEnemy(_tg.
Chara);
6492 if (_tg ==
null || !_tg.
isChara)
6499 EClass.pc.combatCount = 10;
6507 chara.
Say(
"frown",
this, chara);
6519 chara.
Say(
"frown",
this, chara);
6526 bool flag = chara.id ==
"fanatic";
6529 chara.
Say(
"callHelp", chara);
6601 if (mimicry !=
null)
6605 bool flag = enemy !=
null || ai is
GoalCombat;
6606 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6608 bool flag3 = !IsPCParty;
6614 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2) || chara2.mimicry !=
null)
6618 int num3 = Dist(chara2);
6619 int num4 = GetSightRadius() + (flag ? 1 : 0);
6626 if (
this == pos.FirstChara)
6628 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6636 DoHostileAction(chara2);
6649 DoHostileAction(chara);
6661 if (chara !=
this && chara != enemy && chara.
mimicry ==
null && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6663 DoHostileAction(chara);
6682 if (base.IsPCFactionOrMinion)
6695 if (OriginalHostility >=
Hostility.Friend)
6711 if (
id ==
"unicorn" && (Evalue(418) < 0 || (c.
HasElement(1216) && c.
Evalue(418) < 1)))
6744 return EClass.game.activeZone == currentZone;
6751 foreach (
Point item2
in item.ListPoints())
6753 if (pos.Equals(item2))
6774 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6798 charaRenderer.pccData = PCCData.Create(
"ride");
6799 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6800 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6801 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6805 foreach (
Condition condition
in conditions)
6808 if (rendererReplacer !=
null)
6810 charaRenderer.replacer = rendererReplacer;
6811 charaRenderer.data = rendererReplacer.
data;
6815 if (charaRenderer.
replacer ==
null)
6817 charaRenderer.pccData = pccData;
6820 renderer = charaRenderer;
6822 if (cardRenderer !=
null)
6824 renderer.SetFirst(first:
false, cardRenderer.
position);
6826 return charaRenderer;
6833 PCC.Get(pccData).Build(state);
6841 PCC pCC = PCC.Get(pccData);
6843 return pCC.variation.idle[0, 0];
6845 if (spriteReplacer !=
null)
6849 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);
6870 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
6879 p.mat = base.material;
6880 p.matColor = base.colorInt;
6881 if (!renderer.usePass)
6885 if (renderer.replacer !=
null)
6887 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6888 if (renderer.replacer.mat != -1)
6892 p.color -= 1048576f;
6899 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6904 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6907 else if (sourceCard.
_tiles.Length > 1)
6909 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6910 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6914 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6921 if (mimicry !=
null)
6925 string text = base.Name;
6926 if (IsFriendOrAbove())
6930 else if (IsHostile())
6936 if (base.LV >= lV * 5)
6940 else if (base.LV >= lV * 2)
6944 else if (base.LV <= lV / 4)
6948 else if (base.LV <= lV / 2)
6954 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6955 s = (
" (" + s.lang() +
") ").TagSize(14);
6959 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6963 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6969 text2 +=
"lowerGround".lang();
6971 else if (HasHigherGround(
EClass.
pc))
6973 text2 +=
"higherGround".lang();
6976 if (Evalue(1232) > 0)
6978 text2 =
"milkBaby".lang().TagSize(14) + text2;
6982 text2 =
"hasBounty".lang().TagSize(14) + text2;
6986 text2 += (
"(" + faith.Name +
")").TagSize(14);
6992 return text + text2 + s;
6997 if (mimicry !=
null)
7004 text += Environment.NewLine;
7005 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
7010 text2 += Environment.NewLine;
7011 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
7012 text2 += Environment.NewLine;
7014 text2 += Environment.NewLine;
7015 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
7016 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.idSkin +
" scaled:" + base.
isScaled;
7020 text2 += Environment.NewLine;
7021 text2 +=
"<size=14>";
7024 text2 = text2 + item.Name +
", ";
7026 foreach (
Hobby item2
in ListHobbies())
7028 text2 = text2 + item2.Name +
", ";
7030 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
7033 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
7034 if (enumerable.Count() > 0)
7036 text3 += Environment.NewLine;
7037 text3 +=
"<size=14>";
7042 if (text4.IsEmpty() || text4 ==
"#")
7047 switch (item3.
source.group)
7060 text4 = text4 +
"(" + item3.
GetValue() +
")";
7061 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
7063 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
7067 text3 = text3 + text4.TagColor(c) +
", ";
7076 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
7081 text3 += Environment.NewLine;
7084 text3 = text3 + item4.act.Name +
", ";
7086 text3 = text3.TrimEnd(
", ".ToCharArray());
7088 return text + text2 + text3;
7093 string key = source.
idText.IsEmpty(
id);
7103 string text = row.GetText(topic, returnNull:
true);
7108 if (text.StartsWith(
"@"))
7115 text = row.GetText(topic, returnNull:
true);
7121 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7126 if (host ==
null && !IsInActiveZone)
7130 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
7136 int num = EClass.pc.party.members.Count - 1;
7161 string topicText = GetTopicText(topic);
7162 if (topicText.IsEmpty())
7166 string text =
"_bracketTalk".lang();
7167 bool flag = topicText.StartsWith(
"*");
7168 bool flag2 = topicText.StartsWith(
"(");
7169 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
7170 topicText = ApplyTone(topicText);
7171 topicText = topicText.Replace(
"~",
"*");
7173 Msg.
Say(StripTalkSpeiclaCharacters(topicText.Replace(
"&",
"")));
7174 if (topic ==
"dead")
7178 else if (flag || flag3 || flag2)
7180 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
7198 if (conSuspend !=
null && IsPCParty)
7200 RemoveCondition<ConSuspend>();
7204 if (IsDeadOrSleeping)
7206 ShowDialog(
"_chara",
"sleep");
7211 ShowDialog(
"_chara",
"invisible");
7217 ShowDialog(
"_chara",
"give_card");
7226 if (GetInt(71) == -2)
7228 ShowDialog(
"_chara",
"give_lunch");
7234 if (base.isRestrained)
7236 ShowDialog(
"_chara",
"strain");
7241 ShowDialog(
"_chara",
"escort");
7246 string step = ((!(EClass._zone is
Zone_Wedding)) ?
"party" : (IsPCParty ?
"wedding_love" : ((IsMarried || affinity.
IsWeddingHater) ?
"wedding_hater" :
"wedding")));
7249 step =
"wedding_cutter";
7251 base.c_love.gaveCutter =
true;
7253 ShowDialog(
"_chara", step);
7271 EClass.player.flags.loytelEscaped =
false;
7273 ShowDialog(
"loytel",
"loytelEscaped");
7277 if (questDebt !=
null && questDebt.
paid)
7280 if (questDebt.
stage > 7)
7282 questDebt.stage = 7;
7284 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
7292 ShowDialog(
"farris");
7298 ShowDialog(
"farris",
"nymelle_noQuest");
7301 ShowDialog(
"farris",
"nymelle_first");
7304 ShowDialog(
"farris",
"home_first");
7307 ShowDialog(
"farris");
7312 ShowDialog(
"ashland");
7317 SoundManager.ForceBGM();
7324 EClass.player.flags.fiamaFirstDream =
true;
7325 ShowDialog(
"fiama",
"firstDream");
7329 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
7331 EClass.player.flags.fiamaStoryBookGiven =
true;
7337 ShowDialog(
"fiama");
7342 ShowDialog(
"fiama");
7348 ShowDialog(
"big_sister",
"little_saved");
7349 EClass.player.flags.little_saved =
false;
7354 ShowDialog(
"big_sister",
"little_dead");
7355 EClass.player.flags.little_killed =
false;
7363 ShowDialog(
"guild_doorman",
"main", tag);
7369 ShowDialog(
"guild_clerk",
"main", tag2);
7378 if (flag && File.Exists(PackageIterator.GetFiles(
"Dialog/Drama/" +
id +
".xlsx").LastOrDefault()?.FullName ?? (
CorePath.
DramaData +
id +
".xlsx")))
7384 ShowDialog(
"_chara");
7390 return _ShowDialog(
book,
null, step, tag);
7396 if (
book ==
"_chara" && IsPC)
7414 return base.LV / 2 + 4;
7420 if (FindBed() !=
null)
7429 return GetHappiness().ToString() ??
"";
7434 string result =
"?????";
7447 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7457 sortVal = job._index * 10000 + sourceCard.
_index;
7460 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7463 sortVal = -GetTotalFeat();
7469 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7476 sortVal -= 100000000;
7486 foreach (
Card item in map.props.installed.all)
7490 traitBed.RemoveHolder(
this);
7509 if (!IsPCFaction && !IsGuest())
7518 Msg.
Say(
"claimBed",
this);
7527 if (GetInt(113) != 0)
7532 Thing bestRangedWeapon = GetBestRangedWeapon();
7533 foreach (
Thing thing
in things)
7539 _ListItems.Add(thing);
7543 _ListItems.Add(thing);
7547 if (_ListItems.Count == 0)
7551 List<Thing> containers2 = containers.ToList();
7552 foreach (
Thing listItem
in _ListItems)
7577 bool flag = GetInt(113) == 0;
7586 foreach (
Thing thing3
in things)
7588 if (CanEat(thing3, shouldEat))
7604 if (thing3.
id ==
"polish_powder")
7618 foreach (
Thing container
in containers)
7628 if (num4 > 0 && thing4.
id ==
"polish_powder")
7630 _ListItems.Add(thing4);
7635 _ListItems.Add(thing4);
7640 _ListItems.Add(thing4);
7645 _ListItems.Add(thing4);
7648 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
7650 _ListItems.Add(thing4);
7655 _ListItems.Add(thing4);
7660 _ListItems.Add(thing4);
7665 if (_ListItems.Count == 0)
7669 _ListItems.ForeachReverse(delegate(
Thing t)
7674 int slot = t.category.slot;
7675 int equipValue = t.GetEquipValue();
7676 foreach (Thing listItem in _ListItems)
7678 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7686 _ListItems.Remove(t);
7691 foreach (
Thing listItem2
in _ListItems)
7693 Thing thing = listItem2;
7694 if (things.IsFull(thing))
7703 thing = thing.
Split(1);
7706 else if (thing.
Num > 2)
7708 thing = thing.
Split(2);
7715 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
7717 TryEquip(thing, useFav:
true);
7723 TryPutSharedItems(containers);
7729 Thing result =
null;
7737 int num2 = CountNumEaten(
item);
7738 int num3 = 100 - num2 + (
item.HasElement(757) ? 10 : 0);
7752 t = FindBestFoodToEat();
7764 Say(
"eat_start",
this, t.Duplicate(1));
7798 if (!CanEquipRanged(t))
7803 foreach (
Thing thing
in things)
7824 if (bodySlot ==
null)
7830 switch (GetFavAttackStyle())
7869 if (!base.IsPCFactionOrMinion)
7874 if (value.
Value <= 0)
7891 num2 += value.Value * num3 / 100;
7908 if (!ShouldEquip(t, useFav))
7919 switch (GetFavAttackStyle())
7935 body.
Equip(t, slot);
7941 Say(
"equip",
this, t);
7957 return FindThrowable(hotbar:
true);
7961 things.Foreach(delegate(
Thing t)
7963 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7969 Thing FindThrowable(
bool hotbar)
7971 things.Foreach(delegate(
Thing t)
8008 return things.Find((
Thing t) => ranged.
IsAmmo(t));
8013 Thing result =
null;
8015 foreach (
Thing thing
in things)
8038 if (ranged !=
null && ranged.
parent ==
this)
8042 ranged = GetBestRangedWeapon();
8043 return ranged !=
null;
8048 if (body.
GetWeight(armorOnly:
true) <= (HasElement(1204) ? 6000 : 30000))
8073 if (t.
id ==
"cigar")
8078 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8080 SetAIImmediate(
new AI_Eat
8099 if (base.hp < MaxHP * 90 / 100)
8102 if (healAction !=
null)
8113 return FindBed()?.owner.pos.cell.room;
8128 if (!trait.CanChangeAffinity)
8133 if (IsPCFaction && homeBranch !=
null)
8135 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
8152 Say(
"affinityNone",
this, c);
8157 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
8161 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
8167 a = affinity.
Mod(a);
8174 int num = Evalue(289);
8186 num2 += (lV - num) * 10;
8188 elements.
ModExp(289, Mathf.Min(num2, 1000));
8204 chara.orgPos = orgPos.
Copy();
8206 chara.pos = pos.
Copy();
8207 chara.isImported =
true;
8208 chara.c_editorTags = base.c_editorTags;
8209 chara.c_editorTraitVal = base.c_editorTraitVal;
8210 chara.c_idTrait = base.c_idTrait;
8211 chara.homeZone = homeZone;
8217 if (_listFavFood.Count == 0)
8221 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
8223 _listFavFood.Add(row);
8230 r = _listFavFood.RandomItem();
8238 if (_listFavCat.Count == 0)
8244 _listFavCat.Add(row);
8250 r = _listFavCat.RandomItem();
8257 if (base.c_love ==
null)
8264 SetFeat(1275, 1, msg:
true);
8270 if (base.c_love !=
null)
8272 base.c_love.dateMarriage = 0;
8273 base.c_love.dateWedding = 0;
8281 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
8283 if (enumerator.MoveNext())
8285 return enumerator.Current;
8293 Say(
"abCatSniff",
this, c);
8298 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
8304 if (base.c_upgrades !=
null)
8306 num += base.c_upgrades.spent;
8308 if (base.c_genes !=
null)
8310 num += base.c_genes.GetTotalCost();
8312 return num + base.feat;
8319 if (
item.act.id == 6630)
8329 string text = race.
id;
8330 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
8343 if (
id ==
"olderyoungersister")
8345 if (base.idSkin != 2)
8347 return "UN_olderyoungersister";
8349 return "UN_olderyoungersister_alt";
8355 return base.c_idPortrait;
8372 if (HasElement(1231))
8375 AddCondition<ConEuphoric>(100 * Evalue(1231));
8379 SetFeat(1231, 1, msg:
true);
8386 int num2 = ((!HasElement(1411)) ? 1 : 3);
8387 if (GetBurden(t, num) >= num2)
8400 if (!IsValidGiftWeight(t, num))
8408 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
8417 if (things.IsFull())
8444 Msg.
Say(
"affinityNone", c,
this);
8450 int num2 = 200 + t.LV * 3;
8466 c.
Say(
"draw_curse", c, t);
8468 List<Element> list =
new List<Element>();
8476 if (list.Count == 0)
8481 Element element = list.RandomItem();
8487 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8489 GiveLovePotion(c, t);
8503 case "ticket_massage":
8510 case "ticket_armpillow":
8518 case "ticket_champagne":
8525 if (t.
id ==
"flyer")
8530 c.
Talk(
"flyer_miss");
8536 Msg.
Say(
"affinityNone", c,
this);
8538 elements.ModExp(291, 10f);
8541 elements.ModExp(291, 50f);
8543 if (t.
id ==
"statue_weird")
8564 Say(
"give_erohon",
this);
8565 AddCondition<ConParalyze>(50, force:
true);
8566 AddCondition<ConConfuse>(50, force:
true);
8567 AddCondition<ConFear>(1000, force:
true);
8575 c.
Say(
"give_love", c, t);
8585 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
8609 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
8610 int num2 = Dist(chara);
8615 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8621 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
8629 Say(
"intercept_loyal", chara,
this);
8632 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8637 if (!flag && !HasElement(1225))
8639 Say(
"intercept", chara,
this);
8642 chara.
Talk(
"intercept", base.NameSimple);
8644 if (attacker.enemy ==
this)
8646 attacker.SetEnemy(chara);
8709 if (t.
id ==
"flyer")
8729 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
8731 Thing thing = things[num2];
8732 if (ShouldThrowAway(thing, type))
8743 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
8751 _ = base.c_upgrades;
8760 for (
int i = 0; i < 100; i++)
8766 if (base.c_upgrades ==
null)
8770 if (base.c_upgrades.halt)
8781 List<Element> list = ListAvailabeFeats(pet:
true);
8782 if (num >= 90 && list.Count > 0)
8784 Element element = list.RandomItem();
8788 else if (num >= 60 && ie.Any())
8790 num2 = ie.RandomItem().id;
8801 if (num4 > base.feat)
8806 base.c_upgrades.count++;
8807 base.c_upgrades.spent += num4;
8813 if (
item.idEle == num2)
8834 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8836 else if (elements.ValueWithoutLink(row.
id) == 0)
8838 elements.Learn(row.
id);
8842 elements.ModBase(num2, num3);
8849 if (IsPC || base.isScaled || HasElement(1273))
8855 if (base.c_daysWithPC > 360)
8866 if (_cooldowns ==
null)
8868 _cooldowns =
new List<int>();
8872 _cooldowns.Add(idEle * 1000 + turns);
8878 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8884 if (_cooldowns ==
null)
8886 _cooldowns =
new List<int>();
8889 for (
int i = 0; i < _cooldowns.Count; i++)
8891 if (_cooldowns[i] / 1000 == idEle)
8895 _cooldowns.RemoveAt(i);
8899 _cooldowns[i] = idEle * 1000 + turns;
8905 if (!flag && turns > 0)
8907 AddCooldown(idEle, turns);
8909 if (_cooldowns.Count == 0)
8917 return GetCooldown(idEle) != 0;
8922 if (_cooldowns !=
null)
8924 for (
int i = 0; i < _cooldowns.Count; i++)
8926 if (_cooldowns[i] / 1000 == idEle)
8928 return _cooldowns[i] % 1000;
8937 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8939 if (_cooldowns[num] % 1000 == 1)
8941 _cooldowns.RemoveAt(num);
8948 if (_cooldowns.Count == 0)
8961 if (IsPCParty || base.noMove)
8966 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8969 if (goalFromTimeTable !=
null)
8971 SetAI(goalFromTimeTable);
8974 goalFromTimeTable.
Tick();
8979 if (goalList.
index == -2)
8981 goalList.
Refresh(
this, goalListType);
8983 SetAI(goalList.
Next());
9007 return GetGoalWork();
9013 return GetGoalHobby();
9048 if (_works ==
null || _hobbies ==
null)
9052 foreach (
int work
in _works)
9059 foreach (
int hobby
in _hobbies)
9080 return SetAI(_NoGoalPC);
9098 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
9102 if (HasCondition<ConWait>())
9104 RemoveCondition<ConWait>();
9110 renderer.RefreshStateIcon();
9117 bool hasNoGoal = HasNoGoal;
9152 listHobby.Add(
new Hobby
9163 foreach (
int work
in _works)
9165 listHobby.Add(
new Hobby
9179 if (_hobbies ==
null)
9183 foreach (
int hobby
in _hobbies)
9185 listHobby.Add(
new Hobby
9198 if (
item.source.alias ==
id)
9203 foreach (
Hobby item2
in ListHobbies())
9205 if (item2.
source.alias ==
id)
9215 if (workElements !=
null)
9219 workElements =
null;
9220 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
9228 foreach (
Hobby item2
in ListWorks())
9232 if (workElements !=
null)
9236 void TryAdd(
Hobby h)
9238 if (!h.
source.elements.IsEmpty())
9240 if (workElements ==
null)
9244 for (
int i = 0; i < h.
source.elements.Length; i += 2)
9246 int num = h.
source.elements[i];
9247 int num2 = h.
source.elements[i + 1];
9249 if (num != 2115 && num != 2207)
9257 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
9265 string text = (simple ?
"" : (
"hobby".lang() +
":"));
9270 return text.TrimEnd(
',');
9275 string text = (simple ?
"" : (
"work".lang() +
":"));
9280 return text.TrimEnd(
',');
9285 foreach (
int hobby
in _hobbies)
9297 foreach (
int work
in _works)
9309 if (_hobbies !=
null && _works !=
null)
9316 _hobbies =
new List<int>();
9317 _works =
new List<int>();
9325 string[] hobbies = source.
hobbies;
9326 foreach (
string key
in hobbies)
9331 if (source.
works.IsEmpty())
9337 string[] hobbies = source.
works;
9338 foreach (
string key2
in hobbies)
9343 GetWorkSummary().Reset();
9348 if (_workSummary ==
null)
9352 return _workSummary;
9365 if (workSummary.
work !=
null)
9370 else if (workSummary.
hobbies.Count > 0)
9391 hobby.id = session.
id;
9396 workSummary.progress +=
EClass.
rnd(5) + 5;
9398 int num = PerformWork(hobby, 0, isHobby);
9399 int num2 = PerformWork(hobby, 1, isHobby);
9400 int num3 = PerformWork(hobby, 2, isHobby);
9401 int num4 = PerformWork(hobby, 3, isHobby);
9402 workSummary.money += num;
9403 workSummary.food += num2;
9404 workSummary.knowledge += num3;
9405 workSummary.material += num4;
9406 int PerformWork(
Hobby work,
int idx,
bool isHobby)
9408 if (idx >= work.
source.resources.Length)
9412 int num5 = work.
source.resources[idx];
9414 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
9415 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
9416 if (num6 > 0 && num5 <= 0)
9426 _goalWork.
FindWork(
this, setAI:
false);
9442 foreach (
Condition condition
in conditions)
9444 condition.
SetOwner(
this, onDeserialize);
9450 return AddCondition(typeof(T).Name, p, force);
9463 if (c is
ConBleed && ResistLv(964) >= 3)
9468 else if (ResistLv(950) >= 3)
9486 if (c.
source.negate.Length != 0)
9488 string[] negate = c.
source.negate;
9489 foreach (
string text
in negate)
9491 if (HasElement(text))
9498 if (defenseAttribute !=
null)
9500 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
9502 if (c.
source.resistance.Length != 0)
9507 c.power /= num * num + 1;
9525 for (
int j = 0; j < conditions.Count; j++)
9527 if (conditions[j].
id != c.
id)
9533 conditions[j].Kill();
9536 if (conditions[j].CanStack(c))
9538 if (conditions[j].ShouldOverride(c))
9540 if (conditions[j].IsOverrideConditionMet(c, num2))
9542 conditions[j].Kill(silent:
true);
9547 if (CanGainConResist)
9551 conditions[j].OnStacked(c.
power);
9552 conditions[j].OnStartOrStack();
9553 conditions[j].PlayEffect();
9555 if (!conditions[j].AllowMultipleInstance)
9560 foreach (
Condition condition
in conditions)
9569 if (CanGainConResist)
9576 if (c.ShouldRefresh)
9588 if (c.SyncRide && (ride !=
null || parasite !=
null))
9594 if (parasite !=
null)
9602 public override bool HasCondition<T>()
9604 for (
int i = 0; i < conditions.Count; i++)
9606 if (conditions[i] is T)
9616 for (
int i = 0; i < conditions.Count; i++)
9618 if (conditions[i].source.alias == alias)
9633 for (
int i = 0; i < conditions.Count; i++)
9637 return conBuffStats.elements.GetElement(ele);
9646 foreach (
Condition condition
in conditions)
9656 public void CureCondition<T>(
int v = 99999) where T :
Condition
9658 T condition = GetCondition<T>();
9659 if (condition !=
null)
9661 condition.value -= v;
9662 if (condition.value <= 0)
9669 public override T GetCondition<T>()
9671 for (
int i = 0; i < conditions.Count; i++)
9673 if (conditions[i] is T)
9675 return conditions[i] as T;
9683 for (
int num = conditions.Count - 1; num >= 0; num--)
9685 if (conditions[num] is T)
9687 conditions[num].
Kill();
9695 if (parasite !=
null)
9697 parasite.
Cure(type, p, state);
9701 ride.
Cure(type, p, state);
9703 Cure(type, p, state);
9713 CureCondition<ConFear>();
9714 CureCondition<ConBlind>(2 * p / 100 + 5);
9715 CureCondition<ConPoison>(5 * p / 100 + 5);
9716 CureCondition<ConConfuse>(10 * p / 100 + 10);
9717 CureCondition<ConDim>(p / 100 + 5);
9718 CureCondition<ConBleed>(2 * p / 100 + 10);
9725 CureCondition<ConBlind>(5 * p / 100 + 15);
9726 CureCondition<ConPoison>(10 * p / 100 + 15);
9727 CureCondition<ConBleed>(5 * p / 100 + 20);
9728 CureTempElements(p, body:
true, mind:
false);
9731 CureCondition<ConFear>();
9732 CureCondition<ConDim>(3 * p / 100 + 10);
9733 CureTempElements(p, body:
false, mind:
true);
9737 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
9739 Condition condition2 = conditions[num2];
9744 condition2.
Mod(-1, force:
true);
9752 CureCondition<ConWait>();
9753 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
9754 bool flag2 = HasCondition<ConAnorexia>();
9755 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9756 if (base.c_vomit < 0)
9761 RemoveCondition<ConAnorexia>();
9772 CureTempElements(p * 100, body:
true, mind:
true);
9773 for (
int num = conditions.Count - 1; num >= 0; num--)
9780 switch (condition.
Type)
9800 CureCondition<ConWait>();
9801 CureCondition<ConSleep>();
9808 RemoveCondition<ConBrightnessOfLife>();
9809 RemoveCondition<ConDeathSentense>();
9813 if (HasElement(1206))
9815 SetFeat(1206, 0, msg:
true);
9817 RemoveCondition<ConBrightnessOfLife>();
9818 RemoveCondition<ConDeathSentense>();
9832 for (
int num = conditions.Count - 1; num >= 0; num--)
9848 if (
TC.hp > (
long)
TC.MaxHP * (
long)(Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) + Evalue(1426) * 5) / (
TC.IsPowerful ? 200 : 100))
9852 if (
TC.HasElement(427))
9860 PlaySound(
"hit_finish");
9862 Say(
"finish2",
this,
TC);
9872 if (resistCon ==
null)
9874 resistCon =
new Dictionary<int, int>();
9876 if (resistCon.ContainsKey(key))
9878 resistCon[key] += con.power * con.GainResistFactor / 100;
9882 resistCon[key] = con.power * con.GainResistFactor / 100;
9889 if (con.
power > 0 && resistCon !=
null)
9891 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
9913 RemoveCondition<ConAwakening>();
9918 con.pcPillow = pillow;
9919 con.pickup = pickup;
9920 con.posBed = posBed;
9921 con.posPillow = posPillow;
9927 bool isSunLit = pos.IsSunLit;
9929 int num =
bed?.Power ?? 20;
9930 if (traitPillow !=
null)
9932 num += traitPillow.owner.Power / 2;
9936 num +=
bed.Evalue(750) * 5;
9942 OnSleep(num, days, isSunLit);
9945 public void OnSleep(
int power,
int days = 1,
bool isSunLit =
false)
9951 int num = power * days;
9952 if (stamina.
value < 0)
9956 if (isWeakToSunlight && isSunLit)
9963 AddCondition<ConBurning>(1000, force:
true);
9968 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9985 if (!HasElement(450))
9987 long num = bio.height;
9988 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9993 if (num > 999999999)
9997 if (num != bio.height)
9999 bio.height = (int)num;
10000 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
10007 if (HasElement(450) || a == 0)
10011 long num = bio.weight;
10012 long num2 = bio.height;
10013 long num3 = num2 * num2 * 18 / 25000;
10014 long num4 = num2 * num2 * 24 / 10000;
10015 if (ignoreLimit || (num > num3 && num < num4))
10017 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10022 if (num > 999999999)
10026 if (num != bio.weight)
10028 bio.weight = (int)num;
10029 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
10038 if (Evalue(962) >= 25 || (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0))
10042 int num = Evalue(412);
10045 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
10046 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
10053 int num3 = (corruption + a) / 100 - corruption / 100;
10054 for (
int i = 0; i < Mathf.Abs(num3); i++)
10056 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
10063 foreach (
Element value
in elements.dict.Values)
10065 if (value.
source.category ==
"ether")
10067 num4 += value.
Value;
10070 if (num4 > 0 && IsPC)
10074 corruption = num4 * 100 + corruption % 100;
10079 List<Element> list =
new List<Element>();
10082 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
10083 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
10092 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
10094 Feat feat = elements.GetElement(
id) as
Feat;
10096 if (feat !=
null && feat.
Value > 0)
10098 if (value == feat.
Value)
10105 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
10106 if (feat.
Value != 0)
10113 CalculateMaxStamina();
10119 if (feat.
source.textInc.IsEmpty())
10121 PlaySound(
"ding_skill");
10123 Say(
"gainFeat",
this, feat.
FullName);
10127 bool flag = value < num;
10128 if (feat.
source.tag.Contains(
"neg"))
10137 PlaySound(
"chime_angel");
10143 PlaySound(
"chime_devil");
10147 PlaySound(
"mutation");
10151 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
10153 elements.CheckSkillActions();
10160 Element element = elements.GetElement(idEle);
10161 Element element2 = elements.GetElement(row2.
id);
10162 int num = element?.
Value ?? 0;
10171 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
10172 if (a == 0 && (element ==
null || element.
Value == 0))
10174 SayNothingHappans();
10177 if (element !=
null && element.
Value == a)
10179 SayNothingHappans();
10182 if (element2 !=
null && element2.
Value > 0)
10184 SetFeat(element2.
id, 0);
10187 PlaySound(
"mutation");
10188 PlayEffect(
"mutation");
10190 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10195 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
10197 Say(
"resistMutation",
this);
10201 for (
int i = 0; i < tries; i++)
10204 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10210 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10211 if (base.c_corruptionHistory.Count == 0)
10213 base.c_corruptionHistory =
null;
10216 Element element = elements.GetElement(row.
id);
10218 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))
10225 element = elements.GetElement(row.
id);
10227 bool flag = row.
tag.Contains(
"neg");
10240 if (element !=
null)
10242 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
10243 if (num > element.
source.max)
10245 num = element.source.max - 1;
10247 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
10248 flag2 = num > element.
Value;
10249 if (vec > 0 && !flag2)
10254 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
10255 SetFeat(row.
id, num);
10256 if (flag2 && ether)
10258 if (base.c_corruptionHistory ==
null)
10260 base.c_corruptionHistory =
new List<int>();
10262 base.c_corruptionHistory.Add(row.
id);
10265 Element element2 = elements.GetElement(row.
id);
10270 EClass.player.flags.gotEtherDisease =
true;
10272 thing.
SetStr(53,
"letter_ether");
10281 PlaySound(ether ?
"mutation_ether" :
"mutation");
10282 PlayEffect(
"mutation");
10284 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10288 Say(
"nothingHappens");
10294 Element orCreateElement = elements.GetOrCreateElement(ele);
10297 elements.ModBase(orCreateElement.
id, 1);
10299 if (orCreateElement is
Spell)
10301 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10302 int num2 = origin?.Evalue(765) ?? 0;
10303 num = num * (100 - num2) / 100;
10304 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10306 if (orCreateElement.
source.charge == 1)
10310 orCreateElement.vPotential += a;
10312 Say(
"spell_gain",
this, orCreateElement.
Name);
10324 Msg.
Say(
"curse_nullify", member);
10329 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
10331 Say(
"curse_nullify",
this);
10334 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
10336 Say(
"curse_nullify",
this);
10344 if (_historyFood !=
null)
10346 while (_historyFood.Count > 5)
10348 _historyFood.RemoveAt(_historyFood.Count - 1);
10350 if (_historyFood[0].Count > 0)
10352 _historyFood.Insert(0,
new List<string>());
10359 if (!IsPCFaction || !IsGlobal)
10361 _historyFood =
null;
10364 if (_historyFood ==
null)
10366 _historyFood =
new List<List<string>>
10371 if (_historyFood[0].Count < 5)
10373 _historyFood[0].Add(
food.id);
10379 if (_historyFood ==
null)
10384 foreach (List<string>
item in _historyFood)
10386 foreach (
string item2
in item)
10388 if (item2 ==
food.id)
10401 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10403 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10408 if (faithElements !=
null)
10413 if (idFaith ==
"eyth" && !HasElement(1228))
10423 if (!HasCondition<ConExcommunication>())
10431 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10432 for (
int i = 0; i < array.Length; i += 2)
10434 int num2 = array[i + 1] * num / 50;
10435 if (array[i] == 79)
10437 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
10439 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10443 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
10449 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
10455 bool flag = HasElement(1215);
10456 if (tempElements ==
null)
10465 int num = elements.ValueWithoutLink(ele);
10466 int num2 = Mathf.Abs(num) + 100;
10467 int num3 = num2 / (flag ? 2 : 4);
10468 int num4 = -num - 100;
10469 int num5 = tempElements.
Base(ele);
10470 int num6 = num5 + a;
10473 num3 = Mathf.Min(a, num3);
10474 num4 = Mathf.Max(a, -num2 / 3);
10476 if (a > 0 && num6 > num3)
10478 a = ((num3 > num5) ? (num3 - num5) : 0);
10480 if (a < 0 && num6 < num4)
10482 a = ((num4 < num5) ? (num4 - num5) : 0);
10485 if (element.
vBase == 0)
10488 if (tempElements.
dict.Count == 0)
10490 tempElements =
null;
10509 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
10515 foreach (
int ele
in array)
10517 EnhanceTempElement(ele, p, onlyRenew);
10523 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
10528 if (tempElements ==
null)
10534 if (
item.vBase > 0)
10536 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
10543 if (tempElements !=
null)
10554 void Cure(
int[] eles)
10556 foreach (
int ele
in eles)
10558 if (tempElements ==
null)
10563 if (element !=
null && element.
vBase < 0)
10565 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
10573 if (tempElements !=
null)
10576 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 void Unride(Chara host, Chara mount, bool talk=true)
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
virtual bool ValidatePerform(Chara _cc, Card _tc, Point _tp)
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)
void Mod(int a, bool force=false)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual void OnEndPlayerTurn()
virtual ConditionType Type
virtual string GetPhaseStr()
static int GetColorInt(ref Color matColor, int p)
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
GlobalCharaList globalCharas
void PlayAnime(AnimeID id, bool force)
RendererReplacer replacer
virtual string GetName(NameStyle style, int num=-1)
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 string GetHoverText2()
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)
BlessedState blessedState
bool TryStackTo(Thing to)
virtual bool IsPCFactionMinion
void ApplyBacker(int bid)
void ModExp(string alias, int a)
void PlayAnime(AnimeID id, bool force=false)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
virtual RenderRow TileRow
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
void TryPickGroundItem(Func< Card, bool > func=null)
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()
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
bool CanAcceptItem(Card t, int num=-1, bool skipImportantCheck=false)
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 MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
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 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)
ConTransmuteMimic mimicry
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)
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
override bool IsPCFactionMinion
void SetCooldown(int idEle, int turns=0)
void Slap(Chara c, bool slapToDeath=false)
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)
void SetAIImmediate(AIAct g)
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
void PickOrDrop(Point p, Thing t, bool msg=true)
static GoalHobby _goalHobby
override bool IsDeadOrSleeping
List< Hobby > ListHobbies(bool useMemberType=true)
void MakeAlly(bool msg=true)
void RemoveLastBodyPart(bool msg=false)
ElementContainer baseWorkElements
void TickWork(VirtualDate date)
void Stumble(int mtp=100)
void ClearInventory(ClearInventoryType type)
void 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 int curve(long _a, int start, int step, int rate=75)
static ColorProfile Colors
static SourceManager sources
static float rndf(float a)
static FactionBranch Branch
static BaseGameScreen screen
static int rndHalf(int a)
static SoundManager Sound
static GameSetting setting
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
static Effect Get(Effect original)
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
virtual bool PotentialAsStock
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)
List< Chara > listCarryoverMap
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 void GetAchievement(ID_Achievement id)
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)
override string GetHoverText()
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
virtual bool UseRandomName
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 RefreshDeathSentense()
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)