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;
1838 chara.c_altName = base.c_altName;
1842 chara.pccData = IO.DeepCopy(
pccData);
1853 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1862 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1872 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1888 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1894 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1922 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
1924 else if (
host !=
null)
1930 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);
1951 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
1963 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);
1964 if (info !=
null && num != 100)
1991 num -= (
IsPC ? 50 : 100);
2031 num += EClass.player.lastEmptyAlly *
Evalue(1646);
2036 num += EClass.player.lastEmptyAlly * 10 - 10;
2042 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
2043 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
2045 if (HasCondition<ConGravity>())
2048 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
2058 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
2069 if (value.
source.category ==
"skill")
2089 this.hostility = hostility2;
2095 this.hostility = hostility2;
2101 this.hostility = hostility2;
2116 base.ApplyEditorTags(tag);
2124 Debug.LogWarning(
"Chara " +
id +
" not found");
2133 if (!
id.StartsWith(
"ele"))
2142 if (base.c_idMainElement != 0)
2144 SetElements(base.c_idMainElement,
remove:
true);
2145 base.c_idMainElement = 0;
2150 SetElements(
id,
remove:
false);
2151 base.c_idMainElement =
id;
2154 base.isElemental =
true;
2157 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);
2161 void SetElements(
int idEle,
bool remove)
2221 base.c_idJob = idNew;
2249 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2253 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2274 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2283 string[] array =
race.figure.Split(
'|');
2284 foreach (
string s
in array)
2297 string[] array =
race.figure.Split(
'|');
2298 foreach (
string s
in array)
2317 if (
race.id ==
"bike" &&
id !=
"bike_cub")
2319 SetFeat(1423, (
id ==
"chara" ||
id ==
"player") ? 10 : (1 +
EClass.
rnd(10)));
2331 base.c_idRace = idNew;
2347 Debug.Log(
"Creating Replacement NPC for:" +
this);
2375 this.hostility = hostility2;
2377 base.c_summonDuration = 0;
2378 base.isSummon =
false;
2399 owner?.
Say(
"summon_vanish",
this);
2409 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2410 this.hostility = hostility2;
2411 base.c_uidMaster = _master.
uid;
2412 base.c_minionType = type;
2419 base.c_uidMaster = 0;
2424 if (chara.
enemy ==
this)
2436 List<Chara> list =
new List<Chara>();
2464 base.c_summonDuration = duration;
2465 base.isSummon =
true;
2512 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2531 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2536 if (cells[x, z].blocked)
2540 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2547 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2552 if (cells[x, z].blocked)
2556 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2582 if (detail !=
null && detail.
charas.Count > 0)
2617 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2627 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2632 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2639 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2644 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2675 List<Point> list =
new List<Point>();
2723 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2732 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2741 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2750 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2765 if (!condition.
TryMove(newPoint))
2770 if (base.isRestrained)
2776 base.isRestrained =
false;
2778 if (!
CanMoveTo(newPoint, allowDestroyPath))
2782 return _Move(newPoint);
2833 EClass.player.lastZonePos =
null;
2836 for (
int i = 0; i < num2 * 4; i++)
2847 EClass.player.regionMoveWarned =
true;
2848 Msg.
Say(
"regionAbortMove");
2859 AddCondition<ConSuffocation>((
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2861 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2868 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
2871 EClass.player.regionMoveWarned =
false;
2879 num = EClass.setting.defaultActPace * 3f;
2907 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2909 newPoint = randomNeighbor;
2917 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2922 if (effect !=
null && effect.
id == 7)
2927 Say(
"abWeb_caught",
this);
2929 effect2.power = effect2.power * 3 / 4;
2933 Say(
"abWeb_pass",
this);
2938 EClass.player.renderExtraTime = 0f;
2943 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2952 if (
item.mimicry !=
null &&
item.IsHostile(
this))
2954 if (
item.mimicry.ShouldRevealOnPush)
2956 item.mimicry.Reveal(
this, surprise:
true);
2972 traitDoor.TryOpenLock(
this);
2982 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2985 bool flag5 = cell.IsTopWater && !cell.
isFloating;
3015 string text = ((flag3 || flag5) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
3016 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
3018 text = cell.
matObj.soundFoot;
3030 if (!text.IsEmpty())
3032 SoundManager.altLastData =
IsPC;
3039 bool flag6 = scene.actionMode.gameSpeed > 1f;
3040 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
3041 scene.psFoot.startColor = row.
matColor;
3045 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
3069 Say(
"replace_pc", chara, chara2);
3080 traitDoor2.TryOpen(
this);
3119 if ((dataPick.
noRotten && item2.
IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3136 foreach (
int cat
in dataPick.
cats)
3144 else if (!dataPick.
flag.HasFlag(containerFlag))
3186 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3218 EClass.player.flags.isShoesOff =
false;
3225 EClass.player.flags.isShoesOff =
true;
3249 EClass._map.MineBlock(_p, recoverBlock: false, this);
3252 EClass._map.MineObj(_p, null, this);
3258 EClass._map.MineObj(_p, null, this);
3265 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3271 t.SetPlaceState(PlaceState.roaming);
3287 if (list.Count == 0)
3291 list.Copy().ForeachReverse(delegate(
Chara c)
3295 List<Point> list2 = new List<Point>();
3296 for (int i = point.x - 1; i <= point.x + 1; i++)
3298 for (int j = point.z - 1; j <= point.z + 1; j++)
3300 if (i != point.x || j != point.z)
3302 Point point2 = new Point(i, j);
3303 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3310 if (list2.Count > 0)
3312 if (list2.Count > 1)
3314 list2.ForeachReverse(delegate(Point p)
3316 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3322 Point newPoint = list2.RandomItem();
3325 Say(
"displace",
this, c);
3335 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3337 Say(
"pushed_money",
this, c);
3402 if (z == currentZone)
3406 if (HasCondition<ConInvulnerable>())
3408 RemoveCondition<ConInvulnerable>();
3412 EClass.player.nextZone = z;
3420 EClass.player.returnInfo.turns += 5;
3427 EClass.player.deathZoneMove =
false;
3429 currentZone.events.OnLeaveZone();
3430 if (currentZone.instance !=
null)
3444 EClass.player.uidLastZone = currentZone.uid;
3447 if (currentZone.IsRegion)
3455 Msg.
Say(
"leaveZone", currentZone.Name);
3457 else if (z.
id != currentZone.id)
3461 EClass.player.lastZonePos = pos.Copy();
3463 EClass.player.lastTransition = transition;
3485 if (party !=
null && party.
leader ==
this)
3497 Debug.Log(base.Name);
3500 transition.uidLastZone = currentZone?.uid ?? 0;
3501 global.transition = transition;
3505 global.transition =
null;
3508 EClass.player.lastTransition =
null;
3511 if (IsBranchMember())
3522 public void MoveHome(
string id,
int x = -1,
int z = -1)
3537 CureCondition<ConSuspend>();
3564 orgPos =
new Point(x, z);
3565 if (factionBranch !=
null)
3567 RefreshWorkElements();
3579 state = ZoneTransition.EnterState.Fall,
3589 renderer.RefreshSprite();
3592 public override void Rotate(
bool reverse =
false)
3594 if (renderer.hasActor)
3596 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3600 base.dir = ((base.dir == 0) ? 1 : 0);
3603 renderer.RefreshSprite();
3613 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3616 if (angle > 100f && angle < 170f)
3620 else if (angle > 170f && angle < 190f)
3624 else if (angle > 190f || (angle < -10f && angle > -100f))
3634 else if (angle > 170f && angle < 235f)
3638 else if (angle > 80f && angle < 145f)
3642 else if (angle > -100f && angle < -35f)
3646 else if (angle > -10f && angle < 55f)
3650 renderer.RefreshSprite();
3661 else if (base.dir == 1)
3665 else if (base.dir == 2)
3669 else if (base.dir == 3)
3674 else if (base.dir == 0)
3678 else if (base.dir == 1)
3682 else if (base.dir == 2)
3686 else if (base.dir == 3)
3695 if (!renderer.hasActor)
3697 if (angle == 0f || angle == 45f || angle == 90f)
3701 if (angle == -135f || angle == 180f || angle == -90f)
3711 return renderer.actor.currentDir;
3717 for (
int i = -num; i < num + 1; i++)
3719 for (
int j = -num; j < num + 1; j++)
3721 shared.
Set(pos.x + i, pos.z + j);
3732 for (
int num = conditions.Count - 1; num >= 0; num--)
3734 if (conditions[num].ConsumeTurn)
3744 if (_cooldowns !=
null)
3749 consumeTurn =
false;
3750 preventRegen =
false;
3751 emoIcon =
Emo2.none;
3754 base.c_summonDuration--;
3755 if (base.c_summonDuration <= 0)
3763 AddCondition<ConWet>(20);
3768 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3773 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3788 if (parasite !=
null)
3801 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3816 if (isWeakToSunlight && pos.IsSunLit)
3818 AddCondition<ConBurning>(1000, force:
true);
3822 if (HasElement(1250))
3824 if (!HasCondition<ConVampire>())
3826 AddCondition<ConVampire>();
3828 if (!IsPC && !HasCooldown(8793))
3831 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.
HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3838 UseAbility(
"SpTransmuteBat",
this);
3842 if (HasElement(1423) && !HasCondition<ConPeaky>())
3844 AddCondition<ConPeaky>();
3848 if (turn % 200 == 0)
3850 DiminishTempElements();
3862 preventRegen =
true;
3866 Say(
"dmgBurden",
this);
3867 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3879 ModExp(207, 1 + phase2 * phase2);
3907 preventRegen =
true;
3911 if (
EClass.
rnd(100) == 0 && !isConfused)
3914 AddCondition<ConConfuse>(500);
3919 AddCondition<ConBlind>(200);
3922 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3930 int num2 = Evalue(409);
3931 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3936 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3938 if (num3 < conditions.Count)
3953 preventRegen =
true;
3968 case "cocoon_alien":
3978 if (elements.Base(79) >= 30)
3982 elements.SetTo(79, elements.Base(79) * 3 / 4);
3991 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3993 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3994 elements.ModExp(300, 8f);
3999 elements.ModExp(301, 8f);
4018 if (parasite !=
null)
4030 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
4041 ignoreSPAbsorb =
false;
4044 if (hasMovedThisTurn)
4046 pos.Things.ForeachReverse(delegate(
Thing t)
4050 AI_Goto aI_Goto = ai.Current as AI_Goto;
4051 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4062 hasMovedThisTurn =
false;
4065 EClass.player.haltMove =
false;
4099 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4110 if (!tileInfo.
shore)
4115 int num2 = (tileInfo.isRoad ? 22 : 12);
4118 num2 = (tileInfo.isRoad ? 16 : 10);
4122 num2 *= (flag2 ? 2 : 20);
4133 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4146 EClass.player.pickupDelay = 0f;
4154 EClass.player.returnInfo =
null;
4177 Msg.
Say(
"returnComplete");
4178 EClass.player.uidLastTravelZone = 0;
4180 EClass.player.lastZonePos =
null;
4182 EClass.player.returnInfo =
null;
4185 EClass.player.returnInfo =
null;
4186 Msg.
Say(
"returnOverweight");
4190 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4198 RecipeUpdater.dirty =
true;
4204 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4205 hasMovedThisTurn =
false;
4208 if (!IsAliveInCurrentZone)
4212 renderer.RefreshStateIcon();
4213 if (host !=
null && !consumeTurn)
4215 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4221 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4223 Say(
"parasite_fail",
this, host);
4224 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4226 Talk(
"parasite_fail");
4241 if (base.isRestrained)
4262 Cell cell = base.Cell;
4265 AddCondition<ConWet>(50);
4266 if (pos.IsHotSpring)
4273 AddCondition<ConBurning>();
4277 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4293 AddCondition<ConWet>(50);
4297 PlaySound(
"fire_step");
4298 AddCondition<ConBurning>(30);
4303 PlaySound(
"bubble");
4304 AddCondition<ConWet>(30);
4309 if (hasMovedThisTurn)
4311 Say(
"abMistOfDarkness_step",
this);
4313 AddCondition<ConDark>(e.
power);
4335 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4365 if (rootCard !=
this && things.IsFull(c.
Thing))
4372 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4382 if (things.GetDest(t).IsValid)
4403 t = TryPoisonPotion(t);
4411 Say(
"backpack_full_drop", t);
4418 Say(
"backpack_full", t);
4422 if (dest.
stack !=
null)
4426 PlaySound(
"pick_thing");
4427 Say(
"pick_thing",
this, t);
4435 PlaySound(
"pick_thing");
4436 Say(
"pick_thing",
this, t);
4438 TryReservePickupTutorial(t);
4448 Say(
"poisonDrip",
this);
4462 Say(
"absorbRod",
this, t);
4465 if (
rod.source !=
null)
4468 if (enumerator.MoveNext())
4500 if (t.
id ==
"pasture")
4512 foreach (
Card item in pos.ListCards())
4517 if (thing !=
null && !IsPC)
4519 thing.isNPCProperty =
true;
4564 t.isNPCProperty =
false;
4568 pos.TryWitnessCrime(
this);
4578 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4582 if (num == -1 || num > t.
Num)
4593 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4608 WidgetHotbar.dirtyCurrentItem =
true;
4619 if (IsPC && held.
invY == 1)
4621 WidgetHotbar.dirtyCurrentItem =
true;
4633 Say(
"canOnlyCarry", held);
4638 if (!flag && things.IsOverflowing())
4642 Say(
"backpack_full_drop", held);
4650 PlaySound(
"pick_thing");
4651 Say(
"pick_held",
this,
card);
4652 if (IsPC &&
card.id ==
"statue_weird")
4659 WidgetHotbar.dirtyCurrentItem =
true;
4674 return held.
Split(a);
4697 WidgetHotbar.dirtyCurrentItem =
true;
4702 if (
card.trait.CanOnlyCarry)
4713 Msg.
Say(
"markedImportant");
4728 t.ignoreAutoPick =
true;
4739 int num = Evalue(131);
4740 int num2 = Evalue(130);
4741 int num3 = Evalue(123);
4742 if (num > num2 && num > num3)
4746 if (num2 > num && num2 > num3)
4750 if (num3 > num && num3 > num2)
4764 if (elements.Value(122) > elements.Value(120))
4766 return elements.GetElement(122);
4768 return elements.GetElement(120);
4773 isOnCreate = onCreate;
4778 RestockInventory(onCreate);
4783 string equip = source.
equip;
4784 if (equip.IsEmpty())
4788 if (equip ==
"none")
4799 EQ_ID(
"staff_long", 1);
4807 EQ_ID(
"tail_snowleopard");
4813 EQ_ID(
"sword_zephir");
4816 case "adv_mesherada":
4819 EQ_ID(
"dagger_hathaway");
4825 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4829 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4835 EQ_ID(
"sword_muramasa");
4841 EQ_ID(
"dagger_gaki");
4845 EQ_ID(
"dagger_ninto");
4849 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4855 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4866 AddThing(
"gun_gravity2");
4872 AddThing(
"bow_vindale");
4878 EQ_ID(
"martial_ring");
4884 EQ_ID(
"EtherDagger2");
4887 case "keeper_garden":
4890 EQ_ID(
"sword_ragnarok");
4896 EQ_ID(
"axe_destruction");
4902 EQ_ID(
"ribbon_duponne");
4908 EQ_ID(
"helm_seeker");
4911 EQ_ID(
"sword_katana");
4913 EQ_ID(
"sword_katana");
4916 EQ_ID(
"boots_seven");
4920 for (
int i = 0; i < 20; i++)
4925 AddThing(
"plat").SetNum(6);
4931 AddThing(
"guitar_efrond");
4937 AddThing(
"guitar_ash");
4943 EQ_ID(
"EtherDagger");
4951 thing.rarity =
Rarity.Normal;
4963 EQ_ID(
"staff_magius");
4969 EQ_ID(
"staff_insanity");
4975 EQ_ID(
"sword_katana");
4981 EQ_ID(
"staff_leek");
4987 EQ_ID(
"dagger_hocho");
4998 if (!TryEquipRanged())
5005 AddThing(
"gun_laser");
5009 Thing thing2 = AddThing(
"panzerfaust");
5018 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
5028 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
5033 if (race.
id ==
"asura")
5035 for (
int j = 0; j < 4; j++)
5037 EQ_CAT(job.
weapon.RandomItem());
5040 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
5048 else if (!job.
weapon.IsEmpty())
5052 EQ_CAT(job.
weapon.RandomItem());
5054 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
5056 EQ_CAT(job.
weapon.RandomItem());
5099 EQ_ID(
"shield_lute");
5102 if (HasTag(
CTAG.shield))
5113 if (ShouldRestock(
"_meat"))
5119 Restock(
"book_story", 1);
5121 case "rock_thrower":
5129 Restock(
"book_story_home", 1);
5134 void Restock(
string id,
int num)
5136 if (ShouldRestock(
id))
5141 bool ShouldRestock(
string id)
5143 return things.Find(
id) ==
null;
5151 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5152 Rarity rarity2 = base.rarity;
5153 if (
id ==
"big_sister")
5155 num = (isOnCreate ? 8 : 4);
5163 rarity =
Rarity.Superior;
5165 else if (rarity2 ==
Rarity.Legendary)
5169 else if (rarity2 >=
Rarity.Mythical)
5175 rarity =
Rarity.Legendary;
5177 CardBlueprint.current.rarity = rarity;
5185 CardBlueprint.current.rarity = r;
5188 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
5193 if (!body.
Equip(thing))
5204 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
5209 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
5246 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
5250 Msg.
Say(
"returnHome",
this, homeZone.Name);
5267 base.hp = MaxHP / 3;
5270 if (hunger.
value > 30)
5274 sleepiness.value = 0;
5275 hostility = OriginalHostility;
5276 RemoveCondition<StanceTaunt>();
5277 if (
id ==
"keeper_garden")
5285 Msg.
Say(
"noDeathPenalty2",
this);
5289 Msg.
Say(
"noDeathPenalty",
this);
5295 List<Thing> dropList =
new List<Thing>();
5300 t.ignoreAutoPick = true;
5303 }, onlyAccessible:
false);
5309 EClass.player.preventDeathPenalty =
false;
5311 if (IsPCFaction && homeBranch !=
null)
5313 homeBranch.
Log(
"bRevive",
this);
5326 PlayEffect(
"revive");
5328 SetCensored(enable:
false);
5334 ModCorruption(-100000);
5335 if (base.LV < 10000000)
5337 SetLv(base.LV * 10 + 9);
5341 mana.value = mana.
max;
5342 stamina.value = stamina.
max;
5350 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5353 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5357 if (!lastword.IsEmpty())
5359 thing.c_note = lastword;
5361 thing.isModified =
true;
5407 if (HasCondition<ConAnorexia>())
5413 else if (base.c_vomit > 10)
5415 AddCondition<ConAnorexia>();
5417 AddCondition<ConDim>();
5418 if (HasCondition<ConAnorexia>())
5439 if ((uint)(attackSource - 17) > 1u)
5441 AddCondition<ConFaint>(200, force:
true);
5446 bool isInActiveZone = IsInActiveZone;
5449 if (
id ==
"putty" && origin !=
null && origin.IsPCParty)
5459 if (
id ==
"tsunami")
5461 pos.PlaySound(
"water");
5465 Say(
"summon_vanish",
this);
5466 pos.PlayEffect(
"vanish");
5467 pos.PlaySound(
"vanish");
5472 if ((uint)(attackSource - 17) <= 1u)
5482 PlayEffect(
"revive");
5483 PlaySound(
"chime_angel");
5490 PlaySound(base.material.GetSoundDead(source));
5492 renderer.RefreshSprite();
5493 renderer.RefreshStateIcon();
5502 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5505 text =
"dead_" + attackSource;
5511 text =
"dead_" + e.
source.alias;
5520 EClass._zone.isDeathLocation =
true;
5521 string s = ((origin ==
null) ? text :
"dead_by");
5533 AI_PlayMusic.keepPlaying =
false;
5539 Msg.
Say(
"goto_heaven",
this);
5543 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5545 Msg.
Say(text,
this,
"", text2);
5547 string text3 = TalkTopic(
"dead");
5548 if (!text3.IsEmpty())
5550 text3 = text3.StripBrackets();
5552 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5567 if (homeBranch !=
null)
5569 homeBranch.
Log(text,
this,
"");
5581 if (
id ==
"mandrake" || HasElement(488))
5583 Say(
"a_scream",
this);
5588 ClearTempElements();
5591 base.isSale =
false;
5603 EClass.player.returnInfo =
null;
5604 EClass.player.uidLastTravelZone = 0;
5613 chara3.enemy =
null;
5618 EClass.player.preventDeathPenalty =
true;
5623 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5632 currentZone.RemoveCard(
this);
5634 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5637 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5641 ModAffinity(
EClass.
pc, a, show:
false);
5643 if (!(text4 ==
"quru"))
5645 if (text4 ==
"corgon")
5657 if (origin.IsPCParty || origin.IsPCPartyMinion)
5664 else if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5668 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5675 num = num * 30 / 100;
5686 else if (origin.IsPCFaction)
5688 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5689 origin.Chara.ShowEmo(
Emo.love);
5692 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5696 if (base.IsPCFactionOrMinion)
5700 Msg.
Say(
"abort_allyDead");
5705 Msg.
Say(
"abort_enemyDead");
5707 if (IsPCParty && !IsPC)
5710 base.c_wasInPcParty =
true;
5716 if (attackSource !=
AttackSource.Euthanasia && !IsPCFaction)
5718 EClass.player.flags.little_killed =
true;
5732 case "shark_sister":
5741 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5745 if (chara2.
LV < base.LV)
5747 chara2.
SetLv(base.LV);
5749 chara2.
MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara,
MinionType.Friend);
5750 Msg.
Say(
"plant_pop",
this, chara2);
5758 if (IsPCFaction || IsPCFactionMinion)
5765 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5771 flag = (flag2 =
true);
5772 EClass._zone.Boss =
null;
5777 EClass.player.flags.KilledBossInVoid =
true;
5783 SE.Play(
"Jingle/fanfare2");
5793 flag = (flag2 =
true);
5803 flag = (flag2 =
true);
5815 flag = (flag2 =
true);
5820 EClass.player.flags.killedDuponne =
true;
5826 flag = (flag2 =
true);
5832 case "melilith_boss":
5834 flag = (flag2 =
true);
5841 if (questCurry !=
null)
5844 flag = (flag2 =
true);
5854 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
5856 if (num2 && questNasu !=
null && questNasu.
phase <= 1)
5858 if (questNasu.
phase == 0)
5863 flag = (flag2 =
true);
5874 flag = (flag2 =
true);
5876 if (questExploration !=
null)
5878 SE.Play(
"kill_boss");
5888 SE.Play(
"kill_boss");
5889 SoundManager.ForceBGM();
5895 SE.Play(
"kill_boss");
5909 EClass.player.willAutoSave =
true;
5924 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5929 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5934 if (HasCooldown(a.
id))
5942 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
5944 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5945 int num = list.IndexOf(a.
id);
5948 int num2 = list.TryGet(num + Evalue(1422));
5949 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5958 bool flag2 = ability.
Has(a.
id);
5959 if (IsPC && HasCondition<StanceManaCost>())
5961 num4 = Evalue(1657);
5973 ForeachEnemy(delegate
5980 ForeachParty(delegate
5996 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5998 int num6 = cost.cost * num5 / 100;
6001 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
6011 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
6020 ActPlan.warning =
true;
6023 EClass.scene.mouseTarget.card = cardBk;
6024 if (UseAbility(a, tc, pos, pt))
6033 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))
6035 Say(
"shakeHead",
this);
6038 if (tc !=
null && tc !=
this)
6042 if (pos !=
null && !base.pos.Equals(pos))
6048 num3 = 1 + Evalue(1648);
6050 if (IsPC && cost.
cost > 0 && a.
Value == 0 && !flag2)
6057 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
6058 if (!a.
source.tag.Contains(
"useHand"))
6060 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
6071 if (num4 > 0 && (a.
vPotential >= i * 2 || flag2))
6075 a.vPotential -= i * 2;
6077 num6 = num6 * (100 - num4 * 20) / 100;
6088 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2 && !a.
HasTag(
"dontForget"))
6094 if (a.
source.langAct.Length != 0 && tc !=
null)
6096 string text = a.
source.langAct[0];
6097 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
6098 if (text ==
"spell_hand")
6101 string @ref = text2.lang(list2[4]);
6102 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6106 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
6110 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
6117 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6130 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6134 ignoreSPAbsorb =
true;
6137 if (a is
Spell && GetCondition<ConSilence>() !=
null)
6139 Say(
"cast_silence",
this);
6146 int spellExp = elements.GetSpellExp(
this, a, num5);
6149 Say(
"fizzle",
this);
6150 PlayEffect(
"fizzle");
6151 PlaySound(
"fizzle");
6154 ModExp(a.
id, spellExp / 5);
6156 RemoveCondition<ConInvisibility>();
6160 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
6162 AddCooldown(a.
id, a.
source.cooldown);
6164 if (HasTalk(
"phrase_" + a.
source.alias))
6166 EClass.player.forceTalk =
true;
6167 Talk(
"phrase_" + a.
source.alias);
6174 ForeachEnemy(delegate(
Chara c)
6181 ForeachParty(delegate(
Chara c)
6186 Act.forcePt =
false;
6190 for (
int j = 0; j < num3; j++)
6196 ActEffect.RapidCount = j;
6198 flag3 = a.
Perform(
this, tc, pos);
6201 if (flag3 && !isDead)
6205 elements.ModBase(a.
id, 1);
6209 ModExp(a.
id, spellExp);
6212 ActEffect.RapidCount = 0;
6213 if (flag3 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
6215 RemoveCondition<ConInvisibility>();
6216 RemoveCondition<ConDark>();
6218 if (!base.IsPCFactionOrMinion && a.
HasTag(
"specialAbility"))
6220 string name = a.
Name;
6221 renderer.Say(
"| " + name +
" ");
6224 void ForeachEnemy(Action<Chara> action)
6226 if (_pts.Count == 0)
6231 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
6237 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
6239 action(_pts[num11]);
6242 void ForeachParty(Action<Chara> action)
6244 if (_pts.Count == 0)
6251 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
6262 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
6269 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
6280 return 25 + Evalue(226) * 125 / 100;
6296 if (host.
ride ==
this)
6298 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
6302 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
6307 int num3 = Evalue(304);
6310 num3 = Mathf.Max(num3, base.LV + 5);
6314 bool num6 = GetArmorSkill() == 122;
6318 num4 = 20 - Evalue(122) / 5;
6319 num5 += 10 - Evalue(1654) * 4;
6323 num4 = 10 - Evalue(120) / 5;
6333 if (parasite !=
null)
6344 num5 += 20 - Evalue(1654) * 8;
6350 if (HasCondition<ConDim>())
6352 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6362 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6365 public void DoAI(
int wait, Action onPerform)
6380 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6386 if (headpat &&
this != c)
6397 if (!member.
IsPC && CanSeeLos(member))
6407 if (c.
id ==
"hedgehog_ether")
6411 Say(
"reflect_thorne",
this, c);
6418 EClass.player.forceTalk =
true;
6419 Talk(
"kiss",
null,
null, IsPC);
6421 renderer.PlayAnime(
AnimeID.Kiss, c);
6424 if (num > 0 &&
EClass.
rnd(IsPC ? 100 : 5000) == 0)
6428 if (IsPC &&
this != c)
6440 Effect.
Get(
"love").
_Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.
pos);
6445 if (
id ==
"olderyoungersister")
6450 Say(
"slap",
this, c);
6487 if (enemy ==
null && !IsPC)
6489 if (GetInt(106) == 0)
6493 if (OriginalHostility !=
Hostility.Enemy)
6497 SetEnemy(_tg.
Chara);
6511 if (_tg ==
null || !_tg.
isChara)
6518 EClass.pc.combatCount = 10;
6526 chara.
Say(
"frown",
this, chara);
6538 chara.
Say(
"frown",
this, chara);
6545 bool flag = chara.id ==
"fanatic";
6548 chara.
Say(
"callHelp", chara);
6620 if (mimicry !=
null && mimicry.
IsThing)
6624 bool flag = enemy !=
null || ai is
GoalCombat;
6625 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6627 bool flag3 = !IsPCParty;
6633 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry !=
null && chara2.
mimicry.
IsThing))
6637 int num3 = Dist(chara2);
6638 int num4 = GetSightRadius() + (flag ? 1 : 0);
6645 if (
this == pos.FirstChara)
6647 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6655 DoHostileAction(chara2);
6668 DoHostileAction(chara);
6680 if (chara !=
this && chara != enemy && (chara.
mimicry ==
null || !chara.
mimicry.
IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6682 DoHostileAction(chara);
6701 if (base.IsPCFactionOrMinion)
6714 if (OriginalHostility >=
Hostility.Friend)
6730 if (
id ==
"unicorn" && (Evalue(418) < 0 || (c.
HasElement(1216) && c.
Evalue(418) < 1)))
6763 return EClass.game.activeZone == currentZone;
6770 foreach (
Point item2
in item.ListPoints())
6772 if (pos.Equals(item2))
6793 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6817 charaRenderer.pccData = PCCData.Create(
"ride");
6818 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6819 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6820 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6824 foreach (
Condition condition
in conditions)
6827 if (rendererReplacer !=
null)
6829 charaRenderer.replacer = rendererReplacer;
6830 charaRenderer.data = rendererReplacer.
data;
6831 charaRenderer.pccData = rendererReplacer.
pccData;
6835 if (charaRenderer.
replacer ==
null)
6837 charaRenderer.pccData = pccData;
6840 renderer = charaRenderer;
6842 if (cardRenderer !=
null)
6844 renderer.SetFirst(first:
false, cardRenderer.
position);
6846 return charaRenderer;
6853 PCC.Get(pccData).Build(state);
6861 PCC pCC = PCC.Get(pccData);
6863 return pCC.variation.idle[0, 0];
6867 if (spriteReplacer?.data !=
null)
6869 Sprite sprite = spriteReplacer.
GetSprite(dir, skin, snow);
6875 if (sourceCard.
tiles.Length > 1)
6877 skin = ((base.idSkin == 0 && !source.
staticSkin) ? (base.uid % sourceCard.
tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
6879 return sourceCard.
GetSprite(dir, skin, snow);
6900 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
6909 p.mat = base.material;
6910 p.matColor = base.colorInt;
6911 if (!renderer.usePass)
6915 if (renderer.replacer !=
null)
6917 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6918 if (renderer.replacer.mat != -1)
6922 p.color -= 1048576f;
6929 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6934 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6937 else if (sourceCard.
_tiles.Length > 1)
6939 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6940 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6944 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6951 if (mimicry !=
null && mimicry.
IsThing)
6955 string text = ((mimicry !=
null && mimicry.Card !=
this) ? mimicry.
GetName(
NameStyle.Full) : base.Name);
6956 if (IsFriendOrAbove())
6960 else if (IsHostile())
6966 if (base.LV >= lV * 5)
6970 else if (base.LV >= lV * 2)
6974 else if (base.LV <= lV / 4)
6978 else if (base.LV <= lV / 2)
6984 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6985 s = (
" (" + s.lang() +
") ").TagSize(14);
6989 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6993 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6999 text2 +=
"lowerGround".lang();
7001 else if (HasHigherGround(
EClass.
pc))
7003 text2 +=
"higherGround".lang();
7006 if (Evalue(1232) > 0)
7008 text2 =
"milkBaby".lang().TagSize(14) + text2;
7012 text2 =
"hasBounty".lang().TagSize(14) + text2;
7016 text2 += (
"(" + faith.Name +
")").TagSize(14);
7022 return text + text2 + s;
7027 if (mimicry !=
null && mimicry.
IsThing)
7034 text += Environment.NewLine;
7035 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
7040 text2 += Environment.NewLine;
7041 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
7042 text2 += Environment.NewLine;
7044 text2 += Environment.NewLine;
7045 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
7046 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.idSkin +
" scaled:" + base.
isScaled;
7050 text2 += Environment.NewLine;
7051 text2 +=
"<size=14>";
7054 text2 = text2 + item.Name +
", ";
7056 foreach (
Hobby item2
in ListHobbies())
7058 text2 = text2 + item2.Name +
", ";
7060 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
7063 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
7064 if (enumerable.Count() > 0)
7066 text3 += Environment.NewLine;
7067 text3 +=
"<size=14>";
7076 if (text4.IsEmpty() || text4 ==
"#")
7081 switch (item3.
source.group)
7094 text4 = text4 +
"(" + item3.
GetValue() +
")";
7095 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
7097 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
7101 text3 = text3 + text4.TagColor(c) +
", ";
7110 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
7115 text3 += Environment.NewLine;
7118 text3 = text3 + item4.act.Name +
", ";
7120 text3 = text3.TrimEnd(
", ".ToCharArray());
7122 return text + text2 + text3;
7128 string key = ((condition ==
null) ? source : condition.
chara.
source).idText.IsEmpty((condition ==
null) ? id : condition.
chara.
id);
7138 string text = row.GetText(topic, returnNull:
true);
7143 if (text.StartsWith(
"@"))
7150 text = row.GetText(topic, returnNull:
true);
7156 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7161 if (host ==
null && !IsInActiveZone)
7165 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
7171 int num = EClass.pc.party.members.Count - 1;
7196 string topicText = GetTopicText(topic);
7197 if (topicText.IsEmpty())
7201 string text =
"_bracketTalk".lang();
7202 bool flag = topicText.StartsWith(
"*");
7203 bool flag2 = topicText.StartsWith(
"(");
7204 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
7205 topicText = ApplyTone(topicText);
7206 topicText = topicText.Replace(
"~",
"*");
7208 Msg.
Say(StripTalkSpeiclaCharacters(topicText.Replace(
"&",
"")));
7209 if (topic ==
"dead")
7213 else if (flag || flag3 || flag2)
7215 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
7233 if (conSuspend !=
null && IsPCParty)
7235 RemoveCondition<ConSuspend>();
7239 if (IsDeadOrSleeping)
7241 ShowDialog(
"_chara",
"sleep");
7246 ShowDialog(
"_chara",
"invisible");
7252 ShowDialog(
"_chara",
"give_card");
7261 if (GetInt(71) == -2)
7263 ShowDialog(
"_chara",
"give_lunch");
7269 if (base.isRestrained)
7271 ShowDialog(
"_chara",
"strain");
7276 ShowDialog(
"_chara",
"escort");
7281 string step = ((!(EClass._zone is
Zone_Wedding)) ?
"party" : (IsPCParty ?
"wedding_love" : ((IsMarried || affinity.
IsWeddingHater) ?
"wedding_hater" :
"wedding")));
7284 step =
"wedding_cutter";
7286 base.c_love.gaveCutter =
true;
7288 ShowDialog(
"_chara", step);
7306 EClass.player.flags.loytelEscaped =
false;
7308 ShowDialog(
"loytel",
"loytelEscaped");
7312 if (questDebt !=
null && questDebt.
paid)
7315 if (questDebt.
stage > 7)
7317 questDebt.stage = 7;
7319 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
7327 ShowDialog(
"farris");
7333 ShowDialog(
"farris",
"nymelle_noQuest");
7336 ShowDialog(
"farris",
"nymelle_first");
7339 ShowDialog(
"farris",
"home_first");
7342 ShowDialog(
"farris");
7347 ShowDialog(
"ashland");
7352 SoundManager.ForceBGM();
7359 EClass.player.flags.fiamaFirstDream =
true;
7360 ShowDialog(
"fiama",
"firstDream");
7364 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
7366 EClass.player.flags.fiamaStoryBookGiven =
true;
7372 ShowDialog(
"fiama");
7377 ShowDialog(
"fiama");
7383 ShowDialog(
"big_sister",
"little_saved");
7384 EClass.player.flags.little_saved =
false;
7389 ShowDialog(
"big_sister",
"little_dead");
7390 EClass.player.flags.little_killed =
false;
7398 ShowDialog(
"guild_doorman",
"main", tag);
7404 ShowDialog(
"guild_clerk",
"main", tag2);
7413 if (flag && File.Exists(PackageIterator.GetFiles(
"Dialog/Drama/" +
id +
".xlsx").LastOrDefault()?.FullName ?? (
CorePath.
DramaData +
id +
".xlsx")))
7419 ShowDialog(
"_chara");
7425 return _ShowDialog(
book,
null, step, tag);
7431 if (
book ==
"_chara" && IsPC)
7449 return base.LV / 2 + 4;
7455 if (FindBed() !=
null)
7464 return GetHappiness().ToString() ??
"";
7469 string result =
"?????";
7482 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7492 sortVal = job._index * 10000 + sourceCard.
_index;
7495 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7498 sortVal = -GetTotalFeat();
7504 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7511 sortVal -= 100000000;
7521 foreach (
Card item in map.props.installed.all)
7525 traitBed.RemoveHolder(
this);
7544 if (!IsPCFaction && !IsGuest())
7553 Msg.
Say(
"claimBed",
this);
7562 if (GetInt(113) != 0)
7567 Thing bestRangedWeapon = GetBestRangedWeapon();
7568 foreach (
Thing thing
in things)
7574 _ListItems.Add(thing);
7578 _ListItems.Add(thing);
7582 if (_ListItems.Count == 0)
7586 List<Thing> containers2 = containers.ToList();
7587 foreach (
Thing listItem
in _ListItems)
7612 bool flag = GetInt(113) == 0;
7621 foreach (
Thing thing3
in things)
7623 if (CanEat(thing3, shouldEat))
7639 if (thing3.
id ==
"polish_powder")
7653 foreach (
Thing container
in containers)
7663 if (num4 > 0 && thing4.
id ==
"polish_powder")
7665 _ListItems.Add(thing4);
7670 _ListItems.Add(thing4);
7675 _ListItems.Add(thing4);
7680 _ListItems.Add(thing4);
7683 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
7685 _ListItems.Add(thing4);
7690 _ListItems.Add(thing4);
7695 _ListItems.Add(thing4);
7700 if (_ListItems.Count == 0)
7704 _ListItems.ForeachReverse(delegate(
Thing t)
7709 int slot = t.category.slot;
7710 int equipValue = t.GetEquipValue();
7711 foreach (Thing listItem in _ListItems)
7713 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7721 _ListItems.Remove(t);
7726 foreach (
Thing listItem2
in _ListItems)
7728 Thing thing = listItem2;
7729 if (things.IsFull(thing))
7738 thing = thing.
Split(1);
7741 else if (thing.
Num > 2)
7743 thing = thing.
Split(2);
7750 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
7752 TryEquip(thing, useFav:
true);
7758 TryPutSharedItems(containers);
7764 Thing result =
null;
7772 int num2 = CountNumEaten(
item);
7773 int num3 = 100 - num2 + (
item.HasElement(757) ? 10 : 0);
7787 t = FindBestFoodToEat();
7799 Say(
"eat_start",
this, t.Duplicate(1));
7833 if (!CanEquipRanged(t))
7838 foreach (
Thing thing
in things)
7859 if (bodySlot ==
null)
7865 switch (GetFavAttackStyle())
7904 if (!base.IsPCFactionOrMinion)
7909 if (value.
Value <= 0)
7926 num2 += value.Value * num3 / 100;
7943 if (!ShouldEquip(t, useFav))
7954 switch (GetFavAttackStyle())
7970 body.
Equip(t, slot);
7976 Say(
"equip",
this, t);
7992 return FindThrowable(hotbar:
true);
7996 things.Foreach(delegate(
Thing t)
7998 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
8004 Thing FindThrowable(
bool hotbar)
8006 things.Foreach(delegate(
Thing t)
8043 return things.Find((
Thing t) => ranged.
IsAmmo(t));
8048 Thing result =
null;
8050 foreach (
Thing thing
in things)
8073 if (ranged !=
null && ranged.
parent ==
this)
8077 ranged = GetBestRangedWeapon();
8078 return ranged !=
null;
8083 if (body.
GetWeight(armorOnly:
true) <= (HasElement(1204) ? 6000 : 30000))
8108 if (t.
id ==
"cigar")
8113 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8115 SetAIImmediate(
new AI_Eat
8134 if (base.hp < MaxHP * 90 / 100)
8137 if (healAction !=
null)
8148 return FindBed()?.owner.pos.cell.room;
8163 if (!trait.CanChangeAffinity)
8168 if (IsPCFaction && homeBranch !=
null)
8170 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
8187 Say(
"affinityNone",
this, c);
8192 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
8196 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
8202 a = affinity.
Mod(a);
8209 int num = Evalue(289);
8221 num2 += (lV - num) * 10;
8223 elements.
ModExp(289, Mathf.Min(num2, 1000));
8239 chara.orgPos = orgPos.
Copy();
8241 chara.pos = pos.
Copy();
8242 chara.isImported =
true;
8243 chara.c_editorTags = base.c_editorTags;
8244 chara.c_editorTraitVal = base.c_editorTraitVal;
8245 chara.c_idTrait = base.c_idTrait;
8246 chara.homeZone = homeZone;
8252 if (_listFavFood.Count == 0)
8256 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
8258 _listFavFood.Add(row);
8265 r = _listFavFood.RandomItem();
8273 if (_listFavCat.Count == 0)
8279 _listFavCat.Add(row);
8285 r = _listFavCat.RandomItem();
8292 if (base.c_love ==
null)
8299 SetFeat(1275, 1, msg:
true);
8305 if (base.c_love !=
null)
8307 base.c_love.dateMarriage = 0;
8308 base.c_love.dateWedding = 0;
8316 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
8318 if (enumerator.MoveNext())
8320 return enumerator.Current;
8328 Say(
"abCatSniff",
this, c);
8333 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
8339 if (base.c_upgrades !=
null)
8341 num += base.c_upgrades.spent;
8343 if (base.c_genes !=
null)
8345 num += base.c_genes.GetTotalCost();
8347 return num + base.feat;
8354 if (
item.act.id == 6630)
8364 string text = race.
id;
8365 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
8378 if (
id ==
"olderyoungersister")
8380 if (base.idSkin != 2)
8382 return "UN_olderyoungersister";
8384 return "UN_olderyoungersister_alt";
8390 return base.c_idPortrait;
8407 if (HasElement(1231))
8410 AddCondition<ConEuphoric>(100 * Evalue(1231));
8414 SetFeat(1231, 1, msg:
true);
8421 int num2 = ((!HasElement(1411)) ? 1 : 3);
8422 if (GetBurden(t, num) >= num2)
8435 if (!IsValidGiftWeight(t, num))
8452 if (things.IsFull())
8479 Msg.
Say(
"affinityNone", c,
this);
8485 int num2 = 200 + t.LV * 3;
8501 c.
Say(
"draw_curse", c, t);
8503 List<Element> list =
new List<Element>();
8511 if (list.Count == 0)
8516 Element element = list.RandomItem();
8522 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8524 GiveLovePotion(c, t);
8538 case "ticket_massage":
8545 case "ticket_armpillow":
8553 case "ticket_champagne":
8560 if (t.
id ==
"flyer")
8565 c.
Talk(
"flyer_miss");
8571 Msg.
Say(
"affinityNone", c,
this);
8573 elements.ModExp(291, 10f);
8576 elements.ModExp(291, 50f);
8578 if (t.
id ==
"statue_weird")
8603 Say(
"give_erohon",
this);
8604 AddCondition<ConParalyze>(50, force:
true);
8605 AddCondition<ConConfuse>(50, force:
true);
8606 AddCondition<ConFear>(1000, force:
true);
8614 c.
Say(
"give_love", c, t);
8624 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
8648 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
8649 int num2 = Dist(chara);
8654 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8660 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
8668 Say(
"intercept_loyal", chara,
this);
8671 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8676 if (!flag && !HasElement(1225))
8678 Say(
"intercept", chara,
this);
8681 chara.
Talk(
"intercept", base.NameSimple);
8683 if (attacker.enemy ==
this)
8685 attacker.SetEnemy(chara);
8748 if (t.
id ==
"flyer")
8773 if (!things.IsAlmostFull())
8802 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
8804 Thing thing = things[num2];
8805 if (ShouldThrowAway(thing, type))
8816 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
8824 _ = base.c_upgrades;
8833 for (
int i = 0; i < 100; i++)
8839 if (base.c_upgrades ==
null)
8843 if (base.c_upgrades.halt)
8854 List<Element> list = ListAvailabeFeats(pet:
true);
8855 if (num >= 90 && list.Count > 0)
8857 Element element = list.RandomItem();
8861 else if (num >= 60 && ie.Any())
8863 num2 = ie.RandomItem().id;
8874 if (num4 > base.feat)
8879 base.c_upgrades.count++;
8880 base.c_upgrades.spent += num4;
8886 if (
item.idEle == num2)
8907 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8909 else if (elements.ValueWithoutLink(row.
id) == 0)
8911 elements.Learn(row.
id);
8915 elements.ModBase(num2, num3);
8922 if (IsPC || base.isScaled || HasElement(1273))
8928 if (base.c_daysWithPC > 360)
8939 if (_cooldowns ==
null)
8941 _cooldowns =
new List<int>();
8945 _cooldowns.Add(idEle * 1000 + turns);
8951 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8957 if (_cooldowns ==
null)
8959 _cooldowns =
new List<int>();
8962 for (
int i = 0; i < _cooldowns.Count; i++)
8964 if (_cooldowns[i] / 1000 == idEle)
8968 _cooldowns.RemoveAt(i);
8972 _cooldowns[i] = idEle * 1000 + turns;
8978 if (!flag && turns > 0)
8980 AddCooldown(idEle, turns);
8982 if (_cooldowns.Count == 0)
8990 return GetCooldown(idEle) != 0;
8995 if (_cooldowns !=
null)
8997 for (
int i = 0; i < _cooldowns.Count; i++)
8999 if (_cooldowns[i] / 1000 == idEle)
9001 return _cooldowns[i] % 1000;
9010 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
9012 if (_cooldowns[num] % 1000 == 1)
9014 _cooldowns.RemoveAt(num);
9021 if (_cooldowns.Count == 0)
9034 if (IsPCParty || base.noMove)
9039 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9042 if (goalFromTimeTable !=
null)
9044 SetAI(goalFromTimeTable);
9047 goalFromTimeTable.
Tick();
9052 if (goalList.
index == -2)
9054 goalList.
Refresh(
this, goalListType);
9056 SetAI(goalList.
Next());
9080 return GetGoalWork();
9086 return GetGoalHobby();
9121 if (_works ==
null || _hobbies ==
null)
9125 foreach (
int work
in _works)
9132 foreach (
int hobby
in _hobbies)
9153 return SetAI(_NoGoalPC);
9171 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
9175 if (HasCondition<ConWait>())
9177 RemoveCondition<ConWait>();
9183 renderer.RefreshStateIcon();
9190 bool hasNoGoal = HasNoGoal;
9225 listHobby.Add(
new Hobby
9236 foreach (
int work
in _works)
9238 listHobby.Add(
new Hobby
9252 if (_hobbies ==
null)
9256 foreach (
int hobby
in _hobbies)
9258 listHobby.Add(
new Hobby
9271 if (
item.source.alias ==
id)
9276 foreach (
Hobby item2
in ListHobbies())
9278 if (item2.
source.alias ==
id)
9288 if (workElements !=
null)
9292 workElements =
null;
9293 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
9301 foreach (
Hobby item2
in ListWorks())
9305 if (workElements !=
null)
9309 void TryAdd(
Hobby h)
9311 if (!h.
source.elements.IsEmpty())
9313 if (workElements ==
null)
9317 for (
int i = 0; i < h.
source.elements.Length; i += 2)
9319 int num = h.
source.elements[i];
9320 int num2 = h.
source.elements[i + 1];
9322 if (num != 2115 && num != 2207)
9330 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
9338 string text = (simple ?
"" : (
"hobby".lang() +
":"));
9343 return text.TrimEnd(
',');
9348 string text = (simple ?
"" : (
"work".lang() +
":"));
9353 return text.TrimEnd(
',');
9358 foreach (
int hobby
in _hobbies)
9370 foreach (
int work
in _works)
9382 if (_hobbies !=
null && _works !=
null)
9389 _hobbies =
new List<int>();
9390 _works =
new List<int>();
9398 string[] hobbies = source.
hobbies;
9399 foreach (
string key
in hobbies)
9404 if (source.
works.IsEmpty())
9410 string[] hobbies = source.
works;
9411 foreach (
string key2
in hobbies)
9416 GetWorkSummary().Reset();
9421 if (_workSummary ==
null)
9425 return _workSummary;
9438 if (workSummary.
work !=
null)
9443 else if (workSummary.
hobbies.Count > 0)
9464 hobby.id = session.
id;
9469 workSummary.progress +=
EClass.
rnd(5) + 5;
9471 int num = PerformWork(hobby, 0, isHobby);
9472 int num2 = PerformWork(hobby, 1, isHobby);
9473 int num3 = PerformWork(hobby, 2, isHobby);
9474 int num4 = PerformWork(hobby, 3, isHobby);
9475 workSummary.money += num;
9476 workSummary.food += num2;
9477 workSummary.knowledge += num3;
9478 workSummary.material += num4;
9479 int PerformWork(
Hobby work,
int idx,
bool isHobby)
9481 if (idx >= work.
source.resources.Length)
9485 int num5 = work.
source.resources[idx];
9487 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
9488 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
9489 if (num6 > 0 && num5 <= 0)
9499 _goalWork.
FindWork(
this, setAI:
false);
9515 foreach (
Condition condition
in conditions)
9517 condition.
SetOwner(
this, onDeserialize);
9523 return AddCondition(typeof(T).Name, p, force);
9536 if (c is
ConBleed && ResistLv(964) >= 3)
9541 else if (ResistLv(950) >= 3)
9559 if (c.
source.negate.Length != 0)
9561 string[] negate = c.
source.negate;
9562 foreach (
string text
in negate)
9564 if (HasElement(text))
9571 if (defenseAttribute !=
null)
9573 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
9575 if (c.
source.resistance.Length != 0)
9580 c.power /= num * num + 1;
9598 for (
int j = 0; j < conditions.Count; j++)
9600 if (conditions[j].
id != c.
id)
9606 conditions[j].Kill();
9609 if (conditions[j].CanStack(c))
9611 if (conditions[j].ShouldOverride(c))
9613 if (conditions[j].IsOverrideConditionMet(c, num2))
9615 conditions[j].Kill(silent:
true);
9620 if (CanGainConResist)
9624 conditions[j].OnStacked(c.
power);
9625 conditions[j].OnStartOrStack();
9626 conditions[j].PlayEffect();
9628 if (!conditions[j].AllowMultipleInstance)
9633 foreach (
Condition condition
in conditions)
9642 if (CanGainConResist)
9649 if (c.ShouldRefresh)
9661 if (c.SyncRide && (ride !=
null || parasite !=
null))
9667 if (parasite !=
null)
9675 public override bool HasCondition<T>()
9677 for (
int i = 0; i < conditions.Count; i++)
9679 if (conditions[i] is T)
9689 for (
int i = 0; i < conditions.Count; i++)
9691 if (conditions[i].source.alias == alias)
9706 for (
int i = 0; i < conditions.Count; i++)
9710 return conBuffStats.elements.GetElement(ele);
9719 foreach (
Condition condition
in conditions)
9729 public void CureCondition<T>(
int v = 99999) where T :
Condition
9731 T condition = GetCondition<T>();
9732 if (condition !=
null)
9734 condition.value -= v;
9735 if (condition.value <= 0)
9742 public override T GetCondition<T>()
9744 for (
int i = 0; i < conditions.Count; i++)
9746 if (conditions[i] is T)
9748 return conditions[i] as T;
9756 for (
int num = conditions.Count - 1; num >= 0; num--)
9758 if (conditions[num] is T)
9760 conditions[num].
Kill();
9768 if (parasite !=
null)
9770 parasite.
Cure(type, p, state);
9774 ride.
Cure(type, p, state);
9776 Cure(type, p, state);
9786 CureCondition<ConFear>();
9787 CureCondition<ConBlind>(2 * p / 100 + 5);
9788 CureCondition<ConPoison>(5 * p / 100 + 5);
9789 CureCondition<ConConfuse>(10 * p / 100 + 10);
9790 CureCondition<ConDim>(p / 100 + 5);
9791 CureCondition<ConBleed>(2 * p / 100 + 10);
9798 CureCondition<ConBlind>(5 * p / 100 + 15);
9799 CureCondition<ConPoison>(10 * p / 100 + 15);
9800 CureCondition<ConBleed>(5 * p / 100 + 20);
9801 CureTempElements(p, body:
true, mind:
false);
9804 CureCondition<ConFear>();
9805 CureCondition<ConDim>(3 * p / 100 + 10);
9806 CureTempElements(p, body:
false, mind:
true);
9810 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
9812 Condition condition2 = conditions[num2];
9817 condition2.
Mod(-1, force:
true);
9825 CureCondition<ConWait>();
9826 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
9827 bool flag2 = HasCondition<ConAnorexia>();
9828 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9829 if (base.c_vomit < 0)
9834 RemoveCondition<ConAnorexia>();
9845 CureTempElements(p * 100, body:
true, mind:
true);
9846 for (
int num = conditions.Count - 1; num >= 0; num--)
9853 switch (condition.
Type)
9873 CureCondition<ConWait>();
9874 CureCondition<ConSleep>();
9881 RemoveCondition<ConBrightnessOfLife>();
9882 RemoveCondition<ConDeathSentense>();
9886 if (HasElement(1206))
9888 SetFeat(1206, 0, msg:
true);
9890 RemoveCondition<ConBrightnessOfLife>();
9891 RemoveCondition<ConDeathSentense>();
9905 for (
int num = conditions.Count - 1; num >= 0; num--)
9921 if (
TC.hp > (
long)
TC.MaxHP * (
long)(Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) + Evalue(1426) * 5) / (
TC.IsPowerful ? 200 : 100))
9925 if (
TC.HasElement(427))
9933 PlaySound(
"hit_finish");
9935 Say(
"finish2",
this,
TC);
9945 if (resistCon ==
null)
9947 resistCon =
new Dictionary<int, int>();
9949 if (resistCon.ContainsKey(key))
9951 resistCon[key] += con.power * con.GainResistFactor / 100;
9955 resistCon[key] = con.power * con.GainResistFactor / 100;
9962 if (con.
power > 0 && resistCon !=
null)
9964 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
9986 RemoveCondition<ConAwakening>();
9991 con.pcPillow = pillow;
9992 con.pickup = pickup;
9993 con.posBed = posBed;
9994 con.posPillow = posPillow;
10000 bool isSunLit = pos.IsSunLit;
10002 int num =
bed?.Power ?? 20;
10003 if (traitPillow !=
null)
10005 num += traitPillow.owner.Power / 2;
10009 num +=
bed.Evalue(750) * 5;
10015 OnSleep(num, days, isSunLit);
10018 public void OnSleep(
int power,
int days = 1,
bool isSunLit =
false)
10024 int num = power * days;
10025 if (stamina.
value < 0)
10029 if (isWeakToSunlight && isSunLit)
10032 if (mana.
value > 0)
10036 AddCondition<ConBurning>(1000, force:
true);
10041 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10058 if (!HasElement(450))
10060 long num = bio.height;
10061 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10066 if (num > 999999999)
10070 if (num != bio.height)
10072 bio.height = (int)num;
10073 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
10080 if (HasElement(450) || a == 0)
10084 long num = bio.weight;
10085 long num2 = bio.height;
10086 long num3 = num2 * num2 * 18 / 25000;
10087 long num4 = num2 * num2 * 24 / 10000;
10088 if (ignoreLimit || (num > num3 && num < num4))
10090 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10095 if (num > 999999999)
10099 if (num != bio.weight)
10101 bio.weight = (int)num;
10102 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
10111 if (Evalue(962) >= 25 || (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0))
10115 int num = Evalue(412);
10118 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
10119 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
10126 int num3 = (corruption + a) / 100 - corruption / 100;
10127 for (
int i = 0; i < Mathf.Abs(num3); i++)
10129 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
10136 foreach (
Element value
in elements.dict.Values)
10138 if (value.
source.category ==
"ether")
10140 num4 += value.
Value;
10143 if (num4 > 0 && IsPC)
10147 corruption = num4 * 100 + corruption % 100;
10152 List<Element> list =
new List<Element>();
10155 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
10156 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
10165 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
10167 Feat feat = elements.GetElement(
id) as
Feat;
10169 if (feat !=
null && feat.
Value > 0)
10171 if (value == feat.
Value)
10178 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
10179 if (feat.
Value != 0)
10186 CalculateMaxStamina();
10192 if (feat.
source.textInc.IsEmpty())
10194 PlaySound(
"ding_skill");
10196 Say(
"gainFeat",
this, feat.
FullName);
10200 bool flag = value < num;
10201 if (feat.
source.tag.Contains(
"neg"))
10210 PlaySound(
"chime_angel");
10216 PlaySound(
"chime_devil");
10220 PlaySound(
"mutation");
10224 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
10226 elements.CheckSkillActions();
10233 Element element = elements.GetElement(idEle);
10234 Element element2 = elements.GetElement(row2.
id);
10235 int num = element?.
Value ?? 0;
10244 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
10245 if (a == 0 && (element ==
null || element.
Value == 0))
10247 SayNothingHappans();
10250 if (element !=
null && element.
Value == a)
10252 SayNothingHappans();
10255 if (element2 !=
null && element2.
Value > 0)
10257 SetFeat(element2.
id, 0);
10260 PlaySound(
"mutation");
10261 PlayEffect(
"mutation");
10263 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10268 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
10270 Say(
"resistMutation",
this);
10274 for (
int i = 0; i < tries; i++)
10277 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10283 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10284 if (base.c_corruptionHistory.Count == 0)
10286 base.c_corruptionHistory =
null;
10289 Element element = elements.GetElement(row.
id);
10291 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))
10298 element = elements.GetElement(row.
id);
10300 bool flag = row.
tag.Contains(
"neg");
10313 if (element !=
null)
10315 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
10316 if (num > element.
source.max)
10318 num = element.source.max - 1;
10320 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
10321 flag2 = num > element.
Value;
10322 if (vec > 0 && !flag2)
10327 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
10328 SetFeat(row.
id, num);
10329 if (flag2 && ether)
10331 if (base.c_corruptionHistory ==
null)
10333 base.c_corruptionHistory =
new List<int>();
10335 base.c_corruptionHistory.Add(row.
id);
10338 Element element2 = elements.GetElement(row.
id);
10343 EClass.player.flags.gotEtherDisease =
true;
10345 thing.
SetStr(53,
"letter_ether");
10354 PlaySound(ether ?
"mutation_ether" :
"mutation");
10355 PlayEffect(
"mutation");
10357 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10361 Say(
"nothingHappens");
10367 Element orCreateElement = elements.GetOrCreateElement(ele);
10370 elements.ModBase(orCreateElement.
id, 1);
10372 if (orCreateElement is
Spell)
10374 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10375 int num2 = origin?.Evalue(765) ?? 0;
10376 num = num * (100 - num2) / 100;
10377 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10379 if (orCreateElement.
source.charge == 1)
10383 orCreateElement.vPotential += a;
10385 Say(
"spell_gain",
this, orCreateElement.
Name);
10397 Msg.
Say(
"curse_nullify", member);
10402 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
10404 Say(
"curse_nullify",
this);
10407 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
10409 Say(
"curse_nullify",
this);
10417 if (_historyFood !=
null)
10419 while (_historyFood.Count > 5)
10421 _historyFood.RemoveAt(_historyFood.Count - 1);
10423 if (_historyFood[0].Count > 0)
10425 _historyFood.Insert(0,
new List<string>());
10432 if (!IsPCFaction || !IsGlobal)
10434 _historyFood =
null;
10437 if (_historyFood ==
null)
10439 _historyFood =
new List<List<string>>
10444 if (_historyFood[0].Count < 5)
10446 _historyFood[0].Add(
food.id);
10452 if (_historyFood ==
null)
10457 foreach (List<string>
item in _historyFood)
10459 foreach (
string item2
in item)
10461 if (item2 ==
food.id)
10474 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10476 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10481 if (faithElements !=
null)
10486 if (idFaith ==
"eyth" && !HasElement(1228))
10496 if (!HasCondition<ConExcommunication>())
10504 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10505 for (
int i = 0; i < array.Length; i += 2)
10507 int num2 = array[i + 1] * num / 50;
10508 if (array[i] == 79)
10510 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
10512 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10516 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
10522 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
10528 bool flag = HasElement(1215);
10529 if (tempElements ==
null)
10538 int num = elements.ValueWithoutLink(ele);
10539 int num2 = Mathf.Abs(num) + 100;
10540 int num3 = num2 / (flag ? 2 : 4);
10541 int num4 = -num - 100;
10542 int num5 = tempElements.
Base(ele);
10543 int num6 = num5 + a;
10546 num3 = Mathf.Min(a, num3);
10547 num4 = Mathf.Max(a, -num2 / 3);
10549 if (a > 0 && num6 > num3)
10551 a = ((num3 > num5) ? (num3 - num5) : 0);
10553 if (a < 0 && num6 < num4)
10555 a = ((num4 < num5) ? (num4 - num5) : 0);
10558 if (element.
vBase == 0)
10561 if (tempElements.
dict.Count == 0)
10563 tempElements =
null;
10582 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
10588 foreach (
int ele
in array)
10590 EnhanceTempElement(ele, p, onlyRenew);
10596 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
10601 if (tempElements ==
null)
10607 if (
item.vBase > 0)
10609 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
10616 if (tempElements !=
null)
10627 void Cure(
int[] eles)
10629 foreach (
int ele
in eles)
10631 if (tempElements ==
null)
10636 if (element !=
null && element.
vBase < 0)
10638 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
10646 if (tempElements !=
null)
10649 tempElements =
null;
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)
virtual CardRenderer _CreateRenderer()
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
virtual void SetBlessedState(BlessedState s)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void ModCurrency(int a, string id="money")
virtual bool IsAliveInCurrentZone
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
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)
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
ConBaseTransmuteMimic mimicry
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
virtual string GetHoverText2()
virtual string GetName(NameStyle style, int num=-1)
virtual string GetHoverText()
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(string suffix="")
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)
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 ShopType ShopType
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)