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;
634 return base.c_uidMaster != 0;
710 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);
712 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);
716 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
722 if (base.c_idMainElement == 0)
730 public override int DV
741 num = 50 + (num - 50) / 10;
744 int WeaknessMod(
int a)
746 if (HasCondition<ConWeakness>())
759 public override int PV
770 num = 50 + (num - 50) / 10;
773 int WeaknessMod(
int a)
775 if (HasCondition<ConWeakness>())
846 if (!
IsGlobal && !base.isSubsetCard)
992 if (!(
race.id ==
"cat") && !(
race.id ==
"catsister"))
994 return race.id ==
"catgod";
1010 return race.id ==
"mutant";
1034 return EClass.Branch.uidMaid == base.uid;
1060 if (!
source.works.Contains(
"Rich"))
1062 return source.hobbies.Contains(
"Rich");
1088 if (base.c_genes !=
null)
1090 return base.c_genes.GetGeneSlot(
this);
1116 if (!
race.tag.Contains(
"mofu"))
1143 if (!h.
source.elements.IsEmpty())
1145 for (
int i = 0; i < h.
source.elements.Length; i += 2)
1147 int ele = h.
source.elements[i];
1148 int v = h.
source.elements[i + 1];
1178 if (base.rarity >=
Rarity.Legendary)
1193 if (
host ==
null || includeRide)
1197 return base.hp <
MaxHP / 5;
1212 return num > num2 + 0.1f;
1305 return p.cell.room.data.accessType
switch
1308 BaseArea.AccessType.Private =>
false,
1335 for (
int i = 0; i < slots.Count; i++)
1344 _cbits1.Bits = (uint)
_cints[0];
1355 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1364 if (
source.tag.Contains(
"boss"))
1385 string text = base.c_altName ??
source.GetName(
this);
1386 if (HasCondition<ConTransmuteShadow>())
1393 if (base.c_bossType ==
BossType.Evolved)
1395 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1398 if (text.Length > 0 &&
char.IsLower(text[0]))
1400 if (base.rarity >=
Rarity.Legendary)
1402 text = text.ToTitleCase();
1406 text = text.AddArticle();
1413 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1418 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1423 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1425 return text + text2;
1430 if (r != base.rarity)
1458 Hostility hostility2 = (base.c_originalHostility = h);
1459 this.hostility = hostility2;
1475 if (uniqueData !=
null)
1514 base.isSubsetCard =
false;
1516 base.c_uidMaster = 0;
1548 if (
source.tag.Contains(
"boss"))
1552 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1574 if (
source.idActor.Length > 2)
1583 if (
source.mainElement.Length != 0)
1585 int _genLv = Mathf.Min(
genLv, 100);
1586 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1587 string[] mainElement =
source.mainElement;
1588 for (
int i = 0; i < mainElement.Length; i++)
1590 string[] array = mainElement[i].Split(
'/');
1592 int num2 = source.LV * row.eleP / 100;
1593 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1595 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1598 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1601 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle ||
"ele" + a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1603 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1604 if (list.Count >= 2)
1606 num = tuple.Item3 + base.LV -
source.LV;
1611 base.c_altName = NameGen.getRandomName();
1615 _alias = AliasGen.GetRandomAlias();
1628 if (base.LV > 5 &&
race.id ==
"mutant")
1630 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1637 case "putty_mech_b":
1646 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1664 case "olderyoungersister":
1667 case "sister_undead":
1671 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1690 if (!
source.faith.IsEmpty())
1751 Debug.LogError(
"source is null");
1770 base.isHidden =
false;
1782 if (
EClass.
_zone.
IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() ||
corruption >= 100)
1791 if (!(text ==
"mech_scarab"))
1812 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1813 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1815 chara.SetFaith(
faith);
1816 chara.bio = IO.DeepCopy(
bio);
1818 chara.c_daysWithGod = base.c_daysWithGod;
1819 chara.RefreshFaithElement();
1820 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1821 chara.isCopy =
true;
1822 chara.isScaled = base.isScaled;
1832 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1841 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1851 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1867 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1873 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1896 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
1898 else if (
host !=
null)
1904 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);
1925 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
1937 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);
1938 if (info !=
null && num != 100)
1965 num -= (
IsPC ? 50 : 100);
2005 num += EClass.player.lastEmptyAlly *
Evalue(1646);
2010 num += EClass.player.lastEmptyAlly * 10 - 10;
2016 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
2017 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
2019 if (HasCondition<ConGravity>())
2022 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
2032 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
2043 if (value.
source.category ==
"skill")
2063 this.hostility = hostility2;
2069 this.hostility = hostility2;
2075 this.hostility = hostility2;
2090 base.ApplyEditorTags(tag);
2098 Debug.LogWarning(
"Chara " +
id +
" not found");
2107 if (!
id.StartsWith(
"ele"))
2116 if (base.c_idMainElement != 0)
2118 SetElements(base.c_idMainElement,
remove:
true);
2119 base.c_idMainElement = 0;
2124 SetElements(
id,
remove:
false);
2125 base.c_idMainElement =
id;
2128 base.isElemental =
true;
2131 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);
2135 void SetElements(
int idEle,
bool remove)
2195 base.c_idJob = idNew;
2223 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2227 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2248 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2257 string[] array =
race.figure.Split(
'|');
2258 foreach (
string s
in array)
2271 string[] array =
race.figure.Split(
'|');
2272 foreach (
string s
in array)
2289 if (!
remove &&
race.id ==
"bike" &&
id !=
"bike_cub")
2291 SetFeat(1423, (
id ==
"chara" ||
id ==
"player") ? 10 : (1 +
EClass.
rnd(10)));
2298 base.c_idRace = idNew;
2314 Debug.Log(
"Creating Replacement NPC for:" +
this);
2342 this.hostility = hostility2;
2344 base.c_summonDuration = 0;
2345 base.isSummon =
false;
2366 owner?.
Say(
"summon_vanish",
this);
2376 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2377 this.hostility = hostility2;
2378 base.c_uidMaster = _master.
uid;
2379 base.c_minionType = type;
2398 base.c_uidMaster = 0;
2403 if (chara.
enemy ==
this)
2415 base.c_summonDuration = duration;
2416 base.isSummon =
true;
2463 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2482 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2487 if (cells[x, z].blocked)
2491 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2498 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2503 if (cells[x, z].blocked)
2507 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2533 if (detail !=
null && detail.
charas.Count > 0)
2568 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2578 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2583 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2590 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2595 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2626 List<Point> list =
new List<Point>();
2674 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2683 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2692 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2701 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2716 if (!condition.
TryMove(newPoint))
2721 if (base.isRestrained)
2727 base.isRestrained =
false;
2729 if (!
CanMoveTo(newPoint, allowDestroyPath))
2733 return _Move(newPoint);
2784 EClass.player.lastZonePos =
null;
2787 for (
int i = 0; i < num2 * 4; i++)
2798 EClass.player.regionMoveWarned =
true;
2799 Msg.
Say(
"regionAbortMove");
2807 AddCondition<ConSuffocation>((
EClass.
pc.
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2808 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2815 ModExp(200, 1 + num4 * 12);
2818 EClass.player.regionMoveWarned =
false;
2826 num = EClass.setting.defaultActPace * 3f;
2854 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2856 newPoint = randomNeighbor;
2864 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2869 if (effect !=
null && effect.
id == 7)
2874 Say(
"abWeb_caught",
this);
2876 effect2.power = effect2.power * 3 / 4;
2880 Say(
"abWeb_pass",
this);
2885 EClass.player.renderExtraTime = 0f;
2890 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2899 if (
item.mimicry !=
null &&
item.IsHostile(
this))
2901 item.mimicry.RevealMimicry(
this, surprise:
true);
2916 traitDoor.TryOpenLock(
this);
2926 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2929 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2959 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2960 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2962 text = cell.
matObj.soundFoot;
2974 if (!text.IsEmpty())
2976 SoundManager.altLastData =
IsPC;
2983 bool flag5 = scene.actionMode.gameSpeed > 1f;
2984 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2985 scene.psFoot.startColor = row.
matColor;
2989 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
3013 Say(
"replace_pc", chara, chara2);
3024 traitDoor2.TryOpen(
this);
3063 if ((dataPick.
noRotten && item2.
IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3080 foreach (
int cat
in dataPick.
cats)
3088 else if (!dataPick.
flag.HasFlag(containerFlag))
3130 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3162 EClass.player.flags.isShoesOff =
false;
3169 EClass.player.flags.isShoesOff =
true;
3193 EClass._map.MineBlock(_p, recoverBlock: false, this);
3196 EClass._map.MineObj(_p, null, this);
3202 EClass._map.MineObj(_p, null, this);
3209 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3215 t.SetPlaceState(PlaceState.roaming);
3231 if (list.Count == 0)
3235 list.Copy().ForeachReverse(delegate(
Chara c)
3239 List<Point> list2 = new List<Point>();
3240 for (int i = point.x - 1; i <= point.x + 1; i++)
3242 for (int j = point.z - 1; j <= point.z + 1; j++)
3244 if (i != point.x || j != point.z)
3246 Point point2 = new Point(i, j);
3247 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3254 if (list2.Count > 0)
3256 if (list2.Count > 1)
3258 list2.ForeachReverse(delegate(Point p)
3260 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3266 Point newPoint = list2.RandomItem();
3269 Say(
"displace",
this, c);
3279 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3281 Say(
"pushed_money",
this, c);
3346 if (z == currentZone)
3350 if (HasCondition<ConInvulnerable>())
3352 RemoveCondition<ConInvulnerable>();
3356 EClass.player.nextZone = z;
3364 EClass.player.returnInfo.turns += 5;
3371 EClass.player.deathZoneMove =
false;
3373 currentZone.events.OnLeaveZone();
3374 if (currentZone.instance !=
null)
3388 EClass.player.uidLastZone = currentZone.uid;
3391 if (currentZone.IsRegion)
3399 Msg.
Say(
"leaveZone", currentZone.Name);
3401 else if (z.
id != currentZone.id)
3405 EClass.player.lastZonePos = pos.Copy();
3407 EClass.player.lastTransition = transition;
3429 if (party !=
null && party.
leader ==
this)
3441 Debug.Log(base.Name);
3444 transition.uidLastZone = currentZone?.uid ?? 0;
3445 global.transition = transition;
3449 global.transition =
null;
3452 EClass.player.lastTransition =
null;
3455 if (IsBranchMember())
3466 public void MoveHome(
string id,
int x = -1,
int z = -1)
3481 CureCondition<ConSuspend>();
3508 orgPos =
new Point(x, z);
3509 if (factionBranch !=
null)
3511 RefreshWorkElements();
3523 state = ZoneTransition.EnterState.Fall,
3533 renderer.RefreshSprite();
3536 public override void Rotate(
bool reverse =
false)
3538 if (renderer.hasActor)
3540 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3544 base.dir = ((base.dir == 0) ? 1 : 0);
3547 renderer.RefreshSprite();
3557 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3560 if (angle > 100f && angle < 170f)
3564 else if (angle > 170f && angle < 190f)
3568 else if (angle > 190f || (angle < -10f && angle > -100f))
3578 else if (angle > 170f && angle < 235f)
3582 else if (angle > 80f && angle < 145f)
3586 else if (angle > -100f && angle < -35f)
3590 else if (angle > -10f && angle < 55f)
3594 renderer.RefreshSprite();
3605 else if (base.dir == 1)
3609 else if (base.dir == 2)
3613 else if (base.dir == 3)
3618 else if (base.dir == 0)
3622 else if (base.dir == 1)
3626 else if (base.dir == 2)
3630 else if (base.dir == 3)
3639 if (!renderer.hasActor)
3641 if (angle == 0f || angle == 45f || angle == 90f)
3645 if (angle == -135f || angle == 180f || angle == -90f)
3655 return renderer.actor.currentDir;
3661 for (
int i = -num; i < num + 1; i++)
3663 for (
int j = -num; j < num + 1; j++)
3665 shared.
Set(pos.x + i, pos.z + j);
3676 for (
int num = conditions.Count - 1; num >= 0; num--)
3678 if (conditions[num].ConsumeTurn)
3688 if (_cooldowns !=
null)
3693 consumeTurn =
false;
3694 preventRegen =
false;
3695 emoIcon =
Emo2.none;
3698 base.c_summonDuration--;
3699 if (base.c_summonDuration <= 0)
3707 AddCondition<ConWet>(20);
3712 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3717 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3732 if (parasite !=
null)
3745 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3754 if (isWeakToSunlight && pos.IsSunLit)
3756 AddCondition<ConBurning>(1000, force:
true);
3760 if (HasElement(1250))
3762 if (!HasCondition<ConVampire>())
3764 AddCondition<ConVampire>();
3766 if (!IsPC && !HasCooldown(8793))
3769 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.
HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3776 UseAbility(
"SpTransmuteBat",
this);
3780 if (HasElement(1423) && !HasCondition<ConPeaky>())
3782 AddCondition<ConPeaky>();
3786 if (turn % 200 == 0)
3788 DiminishTempElements();
3800 preventRegen =
true;
3804 Say(
"dmgBurden",
this);
3805 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3817 ModExp(207, 1 + phase2 * phase2);
3845 preventRegen =
true;
3849 if (
EClass.
rnd(100) == 0 && !isConfused)
3852 AddCondition<ConConfuse>(500);
3857 AddCondition<ConBlind>(200);
3860 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3868 int num2 = Evalue(409);
3869 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3874 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3876 if (num3 < conditions.Count)
3891 preventRegen =
true;
3905 if (!(text ==
"cocoon"))
3907 if (text ==
"tsunami")
3909 if (elements.Base(79) < 30)
3916 elements.SetTo(79, elements.Base(79) * 3 / 4);
3931 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3933 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3934 elements.ModExp(300, 8f);
3939 elements.ModExp(301, 8f);
3958 if (parasite !=
null)
3970 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3981 ignoreSPAbsorb =
false;
3984 if (hasMovedThisTurn)
3986 pos.Things.ForeachReverse(delegate(
Thing t)
3990 AI_Goto aI_Goto = ai.Current as AI_Goto;
3991 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4002 hasMovedThisTurn =
false;
4005 EClass.player.haltMove =
false;
4039 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4050 if (!tileInfo.
shore)
4055 int num2 = (tileInfo.isRoad ? 22 : 12);
4058 num2 = (tileInfo.isRoad ? 16 : 10);
4062 num2 *= (flag2 ? 2 : 20);
4073 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4086 EClass.player.pickupDelay = 0f;
4094 EClass.player.returnInfo =
null;
4117 Msg.
Say(
"returnComplete");
4118 EClass.player.uidLastTravelZone = 0;
4120 EClass.player.lastZonePos =
null;
4122 EClass.player.returnInfo =
null;
4125 EClass.player.returnInfo =
null;
4126 Msg.
Say(
"returnOverweight");
4130 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4138 RecipeUpdater.dirty =
true;
4144 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4145 hasMovedThisTurn =
false;
4148 if (!IsAliveInCurrentZone)
4152 renderer.RefreshStateIcon();
4153 if (host !=
null && !consumeTurn)
4155 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4161 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4163 Say(
"parasite_fail",
this, host);
4164 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4166 Talk(
"parasite_fail");
4181 if (base.isRestrained)
4202 Cell cell = base.Cell;
4205 AddCondition<ConWet>(50);
4206 if (pos.IsHotSpring)
4213 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4229 AddCondition<ConWet>(50);
4233 PlaySound(
"fire_step");
4234 AddCondition<ConBurning>(30);
4239 PlaySound(
"bubble");
4240 AddCondition<ConWet>(30);
4245 if (hasMovedThisTurn)
4247 Say(
"abMistOfDarkness_step",
this);
4249 AddCondition<ConDark>(e.
power);
4271 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4301 if (rootCard !=
this && things.IsFull(c.
Thing))
4308 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4318 if (things.GetDest(t).IsValid)
4339 t = TryPoisonPotion(t);
4347 Say(
"backpack_full_drop", t);
4354 Say(
"backpack_full", t);
4358 if (dest.
stack !=
null)
4362 PlaySound(
"pick_thing");
4363 Say(
"pick_thing",
this, t);
4371 PlaySound(
"pick_thing");
4372 Say(
"pick_thing",
this, t);
4374 TryReservePickupTutorial(t);
4384 Say(
"poisonDrip",
this);
4398 Say(
"absorbRod",
this, t);
4401 if (
rod.source !=
null)
4404 if (enumerator.MoveNext())
4436 if (t.
id ==
"pasture")
4448 foreach (
Card item in pos.ListCards())
4453 if (thing !=
null && !IsPC)
4455 thing.isNPCProperty =
true;
4500 t.isNPCProperty =
false;
4502 pos.TryWitnessCrime(
this);
4511 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4515 if (num == -1 || num > t.
Num)
4526 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4540 WidgetHotbar.dirtyCurrentItem =
true;
4551 if (IsPC && held.
invY == 1)
4553 WidgetHotbar.dirtyCurrentItem =
true;
4565 Say(
"canOnlyCarry", held);
4570 if (!flag && things.IsOverflowing())
4574 Say(
"backpack_full_drop", held);
4582 PlaySound(
"pick_thing");
4583 Say(
"pick_held",
this,
card);
4584 if (IsPC &&
card.id ==
"statue_weird")
4591 WidgetHotbar.dirtyCurrentItem =
true;
4606 return held.
Split(a);
4629 WidgetHotbar.dirtyCurrentItem =
true;
4634 if (
card.trait.CanOnlyCarry)
4645 Msg.
Say(
"markedImportant");
4660 t.ignoreAutoPick =
true;
4671 int num = Evalue(131);
4672 int num2 = Evalue(130);
4673 int num3 = Evalue(123);
4674 if (num > num2 && num > num3)
4678 if (num2 > num && num2 > num3)
4682 if (num3 > num && num3 > num2)
4696 if (elements.Value(122) > elements.Value(120))
4698 return elements.GetElement(122);
4700 return elements.GetElement(120);
4705 isOnCreate = onCreate;
4710 RestockInventory(onCreate);
4715 string equip = source.
equip;
4716 if (equip.IsEmpty())
4720 if (equip ==
"none")
4731 EQ_ID(
"staff_long", 1);
4739 EQ_ID(
"tail_snowleopard");
4745 EQ_ID(
"sword_zephir");
4748 case "adv_mesherada":
4751 EQ_ID(
"dagger_hathaway");
4757 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4761 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4767 EQ_ID(
"sword_muramasa");
4773 EQ_ID(
"dagger_gaki");
4777 EQ_ID(
"dagger_ninto");
4781 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4787 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4798 AddThing(
"gun_gravity2");
4804 AddThing(
"bow_vindale");
4810 EQ_ID(
"EtherDagger2");
4813 case "keeper_garden":
4816 EQ_ID(
"sword_ragnarok");
4822 EQ_ID(
"axe_destruction");
4828 EQ_ID(
"ribbon_duponne");
4834 EQ_ID(
"helm_seeker");
4837 EQ_ID(
"sword_katana");
4839 EQ_ID(
"sword_katana");
4842 EQ_ID(
"boots_seven");
4846 for (
int i = 0; i < 20; i++)
4851 AddThing(
"plat").SetNum(6);
4857 AddThing(
"guitar_efrond");
4863 AddThing(
"guitar_ash");
4869 EQ_ID(
"EtherDagger");
4877 thing.rarity =
Rarity.Normal;
4889 EQ_ID(
"staff_magius");
4895 EQ_ID(
"staff_insanity");
4901 EQ_ID(
"sword_katana");
4905 if (!TryEquipRanged())
4912 AddThing(
"gun_laser");
4916 Thing thing2 = AddThing(
"panzerfaust");
4925 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4935 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4940 if (race.
id ==
"asura")
4942 for (
int j = 0; j < 4; j++)
4944 EQ_CAT(job.
weapon.RandomItem());
4947 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4955 else if (!job.
weapon.IsEmpty())
4959 EQ_CAT(job.
weapon.RandomItem());
4961 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4963 EQ_CAT(job.
weapon.RandomItem());
5006 EQ_ID(
"shield_lute");
5009 if (HasTag(
CTAG.shield))
5020 if (ShouldRestock(
"_meat"))
5026 Restock(
"book_story", 1);
5028 case "rock_thrower":
5036 Restock(
"book_story_home", 1);
5041 void Restock(
string id,
int num)
5043 if (ShouldRestock(
id))
5048 bool ShouldRestock(
string id)
5050 return things.Find(
id) ==
null;
5058 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5059 Rarity rarity2 = base.rarity;
5060 if (
id ==
"big_sister")
5062 num = (isOnCreate ? 8 : 4);
5070 rarity =
Rarity.Superior;
5072 else if (rarity2 ==
Rarity.Legendary)
5076 else if (rarity2 >=
Rarity.Mythical)
5082 rarity =
Rarity.Legendary;
5084 CardBlueprint.current.rarity = rarity;
5092 CardBlueprint.current.rarity = r;
5095 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
5100 if (!body.
Equip(thing))
5111 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
5116 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
5153 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
5157 Msg.
Say(
"returnHome",
this, homeZone.Name);
5174 base.hp = MaxHP / 3;
5177 if (hunger.
value > 30)
5181 sleepiness.value = 0;
5182 hostility = OriginalHostility;
5183 RemoveCondition<StanceTaunt>();
5184 if (
id ==
"keeper_garden")
5192 Msg.
Say(
"noDeathPenalty2",
this);
5196 Msg.
Say(
"noDeathPenalty",
this);
5202 List<Thing> dropList =
new List<Thing>();
5207 t.ignoreAutoPick = true;
5210 }, onlyAccessible:
false);
5216 EClass.player.preventDeathPenalty =
false;
5218 if (IsPCFaction && homeBranch !=
null)
5220 homeBranch.
Log(
"bRevive",
this);
5233 PlayEffect(
"revive");
5235 SetCensored(enable:
false);
5241 ModCorruption(-100000);
5242 if (base.LV < 10000000)
5244 SetLv(base.LV * 10 + 9);
5248 mana.value = mana.
max;
5249 stamina.value = stamina.
max;
5257 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5260 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5264 if (!lastword.IsEmpty())
5266 thing.c_note = lastword;
5268 thing.isModified =
true;
5314 if (HasCondition<ConAnorexia>())
5320 else if (base.c_vomit > 10)
5322 AddCondition<ConAnorexia>();
5324 AddCondition<ConDim>();
5325 if (HasCondition<ConAnorexia>())
5346 if ((uint)(attackSource - 17) > 1u)
5348 AddCondition<ConFaint>(200, force:
true);
5353 bool isInActiveZone = IsInActiveZone;
5362 if (
id ==
"tsunami")
5364 pos.PlaySound(
"water");
5368 Say(
"summon_vanish",
this);
5369 pos.PlayEffect(
"vanish");
5370 pos.PlaySound(
"vanish");
5375 if ((uint)(attackSource - 17) <= 1u)
5385 PlayEffect(
"revive");
5386 PlaySound(
"chime_angel");
5393 PlaySound(base.material.GetSoundDead(source));
5395 renderer.RefreshSprite();
5396 renderer.RefreshStateIcon();
5401 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5404 text =
"dead_" + attackSource;
5410 text =
"dead_" + e.
source.alias;
5419 EClass._zone.isDeathLocation =
true;
5420 string s = ((origin ==
null) ? text :
"dead_by");
5432 AI_PlayMusic.keepPlaying =
false;
5438 Msg.
Say(
"goto_heaven",
this);
5442 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5444 Msg.
Say(text,
this,
"", text2);
5446 string text3 = TalkTopic(
"dead");
5447 if (!text3.IsEmpty())
5449 text3 = text3.StripBrackets();
5451 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5466 if (homeBranch !=
null)
5468 homeBranch.
Log(text,
this,
"");
5480 if (
id ==
"mandrake" || HasElement(488))
5482 Say(
"a_scream",
this);
5487 ClearTempElements();
5490 base.isSale =
false;
5502 EClass.player.returnInfo =
null;
5503 EClass.player.uidLastTravelZone = 0;
5512 chara3.enemy =
null;
5517 EClass.player.preventDeathPenalty =
true;
5522 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5531 currentZone.RemoveCard(
this);
5533 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5536 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5540 ModAffinity(
EClass.
pc, a, show:
false);
5542 if (!(text4 ==
"quru"))
5544 if (text4 ==
"corgon")
5556 if (origin.IsPCParty || origin.IsPCPartyMinion)
5559 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5563 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5570 num = num * 30 / 100;
5581 else if (origin.IsPCFaction)
5583 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5584 origin.Chara.ShowEmo(
Emo.love);
5587 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5591 if (base.IsPCFactionOrMinion)
5595 Msg.
Say(
"abort_allyDead");
5600 Msg.
Say(
"abort_enemyDead");
5602 if (IsPCParty && !IsPC)
5605 base.c_wasInPcParty =
true;
5611 if (attackSource !=
AttackSource.Euthanasia && !IsPCFaction)
5613 EClass.player.flags.little_killed =
true;
5626 case "shark_sister":
5635 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5639 if (chara2.
LV < base.LV)
5641 chara2.
SetLv(base.LV);
5643 chara2.
MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara,
MinionType.Friend);
5644 Msg.
Say(
"plant_pop",
this, chara2);
5652 if (IsPCFaction || IsPCFactionMinion)
5659 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5665 flag = (flag2 =
true);
5666 EClass._zone.Boss =
null;
5671 EClass.player.flags.KilledBossInVoid =
true;
5677 SE.Play(
"Jingle/fanfare2");
5687 flag = (flag2 =
true);
5697 flag = (flag2 =
true);
5709 flag = (flag2 =
true);
5714 EClass.player.flags.killedDuponne =
true;
5720 flag = (flag2 =
true);
5726 case "melilith_boss":
5728 flag = (flag2 =
true);
5735 if (questCurry !=
null)
5738 flag = (flag2 =
true);
5748 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
5750 if (num2 && questNasu !=
null && questNasu.
phase <= 1)
5752 if (questNasu.
phase == 0)
5757 flag = (flag2 =
true);
5768 flag = (flag2 =
true);
5770 if (questExploration !=
null)
5772 SE.Play(
"kill_boss");
5782 SE.Play(
"kill_boss");
5783 SoundManager.ForceBGM();
5789 SE.Play(
"kill_boss");
5803 EClass.player.willAutoSave =
true;
5818 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5823 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5828 if (HasCooldown(a.
id))
5832 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
5834 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5835 int num = list.IndexOf(a.
id);
5838 int num2 = list.TryGet(num + Evalue(1422));
5839 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5848 if (IsPC && HasCondition<StanceManaCost>())
5850 num4 = Evalue(1657);
5862 ForeachEnemy(delegate
5869 ForeachParty(delegate
5885 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5887 int num6 = cost.cost * num5 / 100;
5890 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5900 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5908 ActPlan.warning =
true;
5911 if (UseAbility(a, tc, pos, pt))
5920 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))
5922 Say(
"shakeHead",
this);
5925 if (tc !=
null && tc !=
this)
5929 if (pos !=
null && !base.pos.Equals(pos))
5935 num3 = 1 + Evalue(1648);
5944 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5945 if (!a.
source.tag.Contains(
"useHand"))
5947 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5949 if (IsPC && !ability.
Has(a.
id))
5960 a.vPotential -= i * 2;
5961 num6 = num6 * (100 - num4 * 20) / 100;
5970 else if (a.
source.langAct.Length != 0 && tc !=
null)
5972 string text = a.
source.langAct[0];
5973 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5974 if (text ==
"spell_hand")
5977 string @ref = text2.lang(list2[4]);
5978 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5982 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
5986 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
5992 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6005 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6009 ignoreSPAbsorb =
true;
6012 if (a is
Spell && GetCondition<ConSilence>() !=
null)
6014 Say(
"cast_silence",
this);
6021 int spellExp = elements.GetSpellExp(
this, a, num5);
6024 Say(
"fizzle",
this);
6025 PlayEffect(
"fizzle");
6026 PlaySound(
"fizzle");
6029 ModExp(a.
id, spellExp / 5);
6031 RemoveCondition<ConInvisibility>();
6035 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
6037 AddCooldown(a.
id, a.
source.cooldown);
6039 if (HasTalk(
"phrase_" + a.
source.alias))
6041 EClass.player.forceTalk =
true;
6042 Talk(
"phrase_" + a.
source.alias);
6049 ForeachEnemy(delegate(
Chara c)
6056 ForeachParty(delegate(
Chara c)
6061 Act.forcePt =
false;
6065 for (
int j = 0; j < num3; j++)
6071 ActEffect.RapidCount = j;
6073 flag2 = a.
Perform(
this, tc, pos);
6076 if (flag2 && !isDead)
6080 ModExp(a.
id, spellExp);
6082 if (a.
source.alias.StartsWith(
"sword_"))
6087 ActEffect.RapidCount = 0;
6088 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
6090 RemoveCondition<ConInvisibility>();
6091 RemoveCondition<ConDark>();
6093 if (!base.IsPCFactionOrMinion && a.
HasTag(
"specialAbility"))
6095 string name = a.
Name;
6096 renderer.Say(
"| " + name +
" ");
6099 void ForeachEnemy(Action<Chara> action)
6101 if (_pts.Count == 0)
6106 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
6112 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
6114 action(_pts[num11]);
6117 void ForeachParty(Action<Chara> action)
6119 if (_pts.Count == 0)
6126 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
6137 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
6144 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
6155 return 25 + Evalue(226) * 125 / 100;
6171 if (host.
ride ==
this)
6173 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
6177 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
6182 int num3 = Evalue(304);
6185 num3 = Mathf.Max(num3, base.LV + 5);
6189 bool num6 = GetArmorSkill() == 122;
6193 num4 = 20 - Evalue(122) / 5;
6194 num5 += 10 - Evalue(1654) * 4;
6198 num4 = 10 - Evalue(120) / 5;
6208 if (parasite !=
null)
6219 num5 += 20 - Evalue(1654) * 8;
6225 if (HasCondition<ConDim>())
6227 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6237 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6240 public void DoAI(
int wait, Action onPerform)
6255 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6261 if (headpat &&
this != c)
6272 if (!member.
IsPC && CanSeeLos(member))
6282 if (c.
id ==
"hedgehog_ether")
6286 Say(
"reflect_thorne",
this, c);
6318 if (enemy ==
null && !IsPC)
6320 if (GetInt(106) == 0)
6324 if (OriginalHostility !=
Hostility.Enemy)
6328 SetEnemy(_tg.
Chara);
6342 if (_tg ==
null || !_tg.
isChara)
6349 EClass.pc.combatCount = 10;
6357 chara.
Say(
"frown",
this, chara);
6369 chara.
Say(
"frown",
this, chara);
6376 bool flag = chara.id ==
"fanatic";
6379 chara.
Say(
"callHelp", chara);
6451 if (mimicry !=
null)
6455 bool flag = enemy !=
null || ai is
GoalCombat;
6456 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6458 bool flag3 = !IsPCParty;
6464 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2) || chara2.mimicry !=
null)
6468 int num3 = Dist(chara2);
6469 int num4 = GetSightRadius() + (flag ? 1 : 0);
6476 if (
this == pos.FirstChara)
6478 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6486 DoHostileAction(chara2);
6499 DoHostileAction(chara);
6511 if (chara !=
this && chara != enemy && chara.
mimicry ==
null && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6513 DoHostileAction(chara);
6532 if (base.IsPCFactionOrMinion)
6545 if (OriginalHostility >=
Hostility.Friend)
6561 if (
id ==
"unicorn" && (Evalue(418) < 0 || (c.
HasElement(1216) && c.
Evalue(418) < 1)))
6594 return EClass.game.activeZone == currentZone;
6601 foreach (
Point item2
in item.ListPoints())
6603 if (pos.Equals(item2))
6624 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6648 charaRenderer.pccData = PCCData.Create(
"ride");
6649 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6650 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6651 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6655 foreach (
Condition condition
in conditions)
6658 if (rendererReplacer !=
null)
6660 charaRenderer.replacer = rendererReplacer;
6661 charaRenderer.data = rendererReplacer.
data;
6665 if (charaRenderer.
replacer ==
null)
6667 charaRenderer.pccData = pccData;
6670 renderer = charaRenderer;
6672 if (cardRenderer !=
null)
6674 renderer.SetFirst(first:
false, cardRenderer.
position);
6676 return charaRenderer;
6683 PCC.Get(pccData).Build(state);
6691 PCC pCC = PCC.Get(pccData);
6693 return pCC.variation.idle[0, 0];
6695 if (spriteReplacer !=
null)
6699 return sourceCard.
GetSprite(0, (sourceCard.
_tiles.Length > 1) ? ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6720 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
6729 p.mat = base.material;
6730 p.matColor = base.colorInt;
6731 if (!renderer.usePass)
6735 if (renderer.replacer !=
null)
6737 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6738 if (renderer.replacer.mat != -1)
6742 p.color -= 1048576f;
6749 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6754 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6757 else if (sourceCard.
_tiles.Length > 1)
6759 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6760 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6764 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6771 if (mimicry !=
null)
6775 string text = base.Name;
6776 if (IsFriendOrAbove())
6780 else if (IsHostile())
6786 if (base.LV >= lV * 5)
6790 else if (base.LV >= lV * 2)
6794 else if (base.LV <= lV / 4)
6798 else if (base.LV <= lV / 2)
6804 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6805 s = (
" (" + s.lang() +
") ").TagSize(14);
6809 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6813 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6819 text2 +=
"lowerGround".lang();
6821 else if (HasHigherGround(
EClass.
pc))
6823 text2 +=
"higherGround".lang();
6826 if (Evalue(1232) > 0)
6828 text2 =
"milkBaby".lang().TagSize(14) + text2;
6832 text2 =
"hasBounty".lang().TagSize(14) + text2;
6836 text2 += (
"(" + faith.Name +
")").TagSize(14);
6842 return text + text2 + s;
6847 if (mimicry !=
null)
6854 text += Environment.NewLine;
6855 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6860 text2 += Environment.NewLine;
6861 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6862 text2 += Environment.NewLine;
6864 text2 += Environment.NewLine;
6865 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6866 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.idSkin +
" scaled:" + base.
isScaled;
6870 text2 += Environment.NewLine;
6871 text2 +=
"<size=14>";
6874 text2 = text2 + item.Name +
", ";
6876 foreach (
Hobby item2
in ListHobbies())
6878 text2 = text2 + item2.Name +
", ";
6880 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
6883 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6884 if (enumerable.Count() > 0)
6886 text3 += Environment.NewLine;
6887 text3 +=
"<size=14>";
6892 if (text4.IsEmpty() || text4 ==
"#")
6897 switch (item3.
source.group)
6910 text4 = text4 +
"(" + item3.
GetValue() +
")";
6911 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
6913 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
6917 text3 = text3 + text4.TagColor(c) +
", ";
6926 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6931 text3 += Environment.NewLine;
6934 text3 = text3 + item4.act.Name +
", ";
6936 text3 = text3.TrimEnd(
", ".ToCharArray());
6938 return text + text2 + text3;
6943 string key = source.
idText.IsEmpty(
id);
6953 string text = row.GetText(topic, returnNull:
true);
6958 if (text.StartsWith(
"@"))
6965 text = row.GetText(topic, returnNull:
true);
6971 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6976 if (host ==
null && !IsInActiveZone)
6980 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6986 int num = EClass.pc.party.members.Count - 1;
7011 string topicText = GetTopicText(topic);
7012 if (topicText.IsEmpty())
7016 string text =
"_bracketTalk".lang();
7017 bool flag = topicText.StartsWith(
"*");
7018 bool flag2 = topicText.StartsWith(
"(");
7019 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
7020 topicText = ApplyTone(topicText);
7021 topicText = topicText.Replace(
"~",
"*");
7023 Msg.
Say(StripTalkSpeiclaCharacters(topicText.Replace(
"&",
"")));
7024 if (topic ==
"dead")
7028 else if (flag || flag3 || flag2)
7030 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
7048 if (conSuspend !=
null && IsPCParty)
7050 RemoveCondition<ConSuspend>();
7054 if (IsDeadOrSleeping)
7056 ShowDialog(
"_chara",
"sleep");
7061 ShowDialog(
"_chara",
"invisible");
7067 ShowDialog(
"_chara",
"give_card");
7076 if (GetInt(71) == -2)
7078 ShowDialog(
"_chara",
"give_lunch");
7084 if (base.isRestrained)
7086 ShowDialog(
"_chara",
"strain");
7091 ShowDialog(
"_chara",
"escort");
7096 ShowDialog(
"_chara",
"party");
7110 EClass.player.flags.loytelEscaped =
false;
7112 ShowDialog(
"loytel",
"loytelEscaped");
7116 if (questDebt !=
null && questDebt.
paid)
7119 if (questDebt.
stage > 7)
7121 questDebt.stage = 7;
7123 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
7131 ShowDialog(
"farris");
7137 ShowDialog(
"farris",
"nymelle_noQuest");
7140 ShowDialog(
"farris",
"nymelle_first");
7143 ShowDialog(
"farris",
"home_first");
7146 ShowDialog(
"farris");
7151 ShowDialog(
"ashland");
7156 SoundManager.ForceBGM();
7163 EClass.player.flags.fiamaFirstDream =
true;
7164 ShowDialog(
"fiama",
"firstDream");
7168 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
7170 EClass.player.flags.fiamaStoryBookGiven =
true;
7176 ShowDialog(
"fiama");
7181 ShowDialog(
"fiama");
7187 ShowDialog(
"big_sister",
"little_saved");
7188 EClass.player.flags.little_saved =
false;
7193 ShowDialog(
"big_sister",
"little_dead");
7194 EClass.player.flags.little_killed =
false;
7202 ShowDialog(
"guild_doorman",
"main", tag);
7208 ShowDialog(
"guild_clerk",
"main", tag2);
7223 ShowDialog(
"_chara");
7229 return _ShowDialog(
book,
null, step, tag);
7235 if (
book ==
"_chara" && IsPC)
7249 return base.LV / 2 + 4;
7255 if (FindBed() !=
null)
7264 return GetHappiness().ToString() ??
"";
7269 string result =
"?????";
7282 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7292 sortVal = job._index * 10000 + sourceCard.
_index;
7295 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7298 sortVal = -GetTotalFeat();
7301 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7314 foreach (
Card item in map.props.installed.all)
7318 traitBed.RemoveHolder(
this);
7337 if (!IsPCFaction && !IsGuest())
7346 Msg.
Say(
"claimBed",
this);
7355 if (GetInt(113) != 0)
7360 Thing bestRangedWeapon = GetBestRangedWeapon();
7361 foreach (
Thing thing
in things)
7367 _ListItems.Add(thing);
7371 _ListItems.Add(thing);
7375 if (_ListItems.Count == 0)
7379 List<Thing> containers2 = containers.ToList();
7380 foreach (
Thing listItem
in _ListItems)
7405 bool flag = GetInt(113) == 0;
7414 foreach (
Thing thing3
in things)
7416 if (CanEat(thing3, shouldEat))
7432 if (thing3.
id ==
"polish_powder")
7446 foreach (
Thing container
in containers)
7456 if (num4 > 0 && thing4.
id ==
"polish_powder")
7458 _ListItems.Add(thing4);
7463 _ListItems.Add(thing4);
7468 _ListItems.Add(thing4);
7473 _ListItems.Add(thing4);
7476 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
7478 _ListItems.Add(thing4);
7483 _ListItems.Add(thing4);
7488 _ListItems.Add(thing4);
7493 if (_ListItems.Count == 0)
7497 _ListItems.ForeachReverse(delegate(
Thing t)
7502 int slot = t.category.slot;
7503 int equipValue = t.GetEquipValue();
7504 foreach (Thing listItem in _ListItems)
7506 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7514 _ListItems.Remove(t);
7519 foreach (
Thing listItem2
in _ListItems)
7521 Thing thing = listItem2;
7522 if (things.IsFull(thing))
7531 thing = thing.
Split(1);
7534 else if (thing.
Num > 2)
7536 thing = thing.
Split(2);
7543 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
7545 TryEquip(thing, useFav:
true);
7551 TryPutSharedItems(containers);
7557 Thing result =
null;
7565 int num2 = CountNumEaten(
item);
7566 int num3 = 100 - num2 + (
item.HasElement(757) ? 10 : 0);
7580 t = FindBestFoodToEat();
7592 Say(
"eat_start",
this, t.Duplicate(1));
7626 if (!CanEquipRanged(t))
7631 foreach (
Thing thing
in things)
7652 if (bodySlot ==
null)
7658 switch (GetFavAttackStyle())
7697 if (!base.IsPCFactionOrMinion)
7702 if (value.
Value <= 0)
7719 num2 += value.Value * num3 / 100;
7736 if (!ShouldEquip(t, useFav))
7747 switch (GetFavAttackStyle())
7763 body.
Equip(t, slot);
7769 Say(
"equip",
this, t);
7785 return FindThrowable(hotbar:
true);
7789 things.Foreach(delegate(
Thing t)
7791 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7797 Thing FindThrowable(
bool hotbar)
7799 things.Foreach(delegate(
Thing t)
7836 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7841 Thing result =
null;
7843 foreach (
Thing thing
in things)
7866 if (ranged !=
null && ranged.
parent ==
this)
7870 ranged = GetBestRangedWeapon();
7871 return ranged !=
null;
7876 if (body.
GetWeight(armorOnly:
true) <= (HasElement(1204) ? 6000 : 30000))
7901 if (t.
id ==
"cigar")
7906 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7908 SetAIImmediate(
new AI_Eat
7927 if (base.hp < MaxHP * 90 / 100)
7930 if (healAction !=
null)
7941 return FindBed()?.owner.pos.cell.room;
7956 if (!trait.CanChangeAffinity)
7961 if (IsPCFaction && homeBranch !=
null)
7963 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7980 Say(
"affinityNone",
this, c);
7985 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7989 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7995 a = affinity.
Mod(a);
8002 int num = Evalue(289);
8014 num2 += (lV - num) * 10;
8016 elements.
ModExp(289, Mathf.Min(num2, 1000));
8032 chara.orgPos = orgPos.
Copy();
8034 chara.pos = pos.
Copy();
8035 chara.isImported =
true;
8036 chara.c_editorTags = base.c_editorTags;
8037 chara.c_editorTraitVal = base.c_editorTraitVal;
8038 chara.c_idTrait = base.c_idTrait;
8039 chara.homeZone = homeZone;
8045 if (_listFavFood.Count == 0)
8049 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
8051 _listFavFood.Add(row);
8058 r = _listFavFood.RandomItem();
8066 if (_listFavCat.Count == 0)
8072 _listFavCat.Add(row);
8078 r = _listFavCat.RandomItem();
8085 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
8087 if (enumerator.MoveNext())
8089 return enumerator.Current;
8097 Say(
"abCatSniff",
this, c);
8102 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
8108 if (base.c_upgrades !=
null)
8110 num += base.c_upgrades.spent;
8112 if (base.c_genes !=
null)
8114 num += base.c_genes.GetTotalCost();
8116 return num + base.feat;
8123 if (
item.act.id == 6630)
8133 string text = race.
id;
8134 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
8147 if (
id ==
"olderyoungersister")
8149 if (base.idSkin != 2)
8151 return "UN_olderyoungersister";
8153 return "UN_olderyoungersister_alt";
8159 return base.c_idPortrait;
8176 if (HasElement(1231))
8179 AddCondition<ConEuphoric>(100 * Evalue(1231));
8183 SetFeat(1231, 1, msg:
true);
8190 int num2 = ((!HasElement(1411)) ? 1 : 3);
8191 if (GetBurden(t, num) >= num2)
8204 if (!IsValidGiftWeight(t, num))
8212 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
8221 if (things.IsFull())
8248 Msg.
Say(
"affinityNone", c,
this);
8254 int num2 = 200 + t.LV * 3;
8270 c.
Say(
"draw_curse", c, t);
8272 List<Element> list =
new List<Element>();
8280 if (list.Count == 0)
8285 Element element = list.RandomItem();
8291 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8293 GiveLovePotion(c, t);
8307 case "ticket_massage":
8314 case "ticket_armpillow":
8322 case "ticket_champagne":
8329 if (t.
id ==
"flyer")
8334 c.
Talk(
"flyer_miss");
8340 Msg.
Say(
"affinityNone", c,
this);
8342 elements.ModExp(291, 10f);
8345 elements.ModExp(291, 50f);
8347 if (t.
id ==
"statue_weird")
8368 Say(
"give_erohon",
this);
8369 AddCondition<ConParalyze>(50, force:
true);
8370 AddCondition<ConConfuse>(50, force:
true);
8371 AddCondition<ConFear>(1000, force:
true);
8379 c.
Say(
"give_love", c, t);
8389 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
8413 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
8414 int num2 = Dist(chara);
8419 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8425 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
8433 Say(
"intercept_loyal", chara,
this);
8436 if (num2 > num || !chara.
CanSeeLos(pos, num2))
8441 if (!flag && !HasElement(1225))
8443 Say(
"intercept", chara,
this);
8446 chara.
Talk(
"intercept", base.NameSimple);
8448 if (attacker.enemy ==
this)
8450 attacker.SetEnemy(chara);
8513 if (t.
id ==
"flyer")
8533 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
8535 Thing thing = things[num2];
8536 if (ShouldThrowAway(thing, type))
8547 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
8555 _ = base.c_upgrades;
8564 for (
int i = 0; i < 100; i++)
8570 if (base.c_upgrades ==
null)
8574 if (base.c_upgrades.halt)
8585 List<Element> list = ListAvailabeFeats(pet:
true);
8586 if (num >= 90 && list.Count > 0)
8588 Element element = list.RandomItem();
8592 else if (num >= 60 && ie.Any())
8594 num2 = ie.RandomItem().id;
8605 if (num4 > base.feat)
8610 base.c_upgrades.count++;
8611 base.c_upgrades.spent += num4;
8617 if (
item.idEle == num2)
8638 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
8640 else if (elements.ValueWithoutLink(row.
id) == 0)
8642 elements.Learn(row.
id);
8646 elements.ModBase(num2, num3);
8653 if (IsPC || base.isScaled || HasElement(1273))
8659 if (base.c_daysWithPC > 360)
8670 if (_cooldowns ==
null)
8672 _cooldowns =
new List<int>();
8676 _cooldowns.Add(idEle * 1000 + turns);
8682 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8688 if (_cooldowns ==
null)
8690 _cooldowns =
new List<int>();
8693 for (
int i = 0; i < _cooldowns.Count; i++)
8695 if (_cooldowns[i] / 1000 == idEle)
8699 _cooldowns.RemoveAt(i);
8703 _cooldowns[i] = idEle * 1000 + turns;
8709 if (!flag && turns > 0)
8711 AddCooldown(idEle, turns);
8713 if (_cooldowns.Count == 0)
8721 return GetCooldown(idEle) != 0;
8726 if (_cooldowns !=
null)
8728 for (
int i = 0; i < _cooldowns.Count; i++)
8730 if (_cooldowns[i] / 1000 == idEle)
8732 return _cooldowns[i] % 1000;
8741 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8743 if (_cooldowns[num] % 1000 == 1)
8745 _cooldowns.RemoveAt(num);
8752 if (_cooldowns.Count == 0)
8765 if (IsPCParty || base.noMove)
8770 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8773 if (goalFromTimeTable !=
null)
8775 SetAI(goalFromTimeTable);
8778 goalFromTimeTable.
Tick();
8783 if (goalList.
index == -2)
8785 goalList.
Refresh(
this, goalListType);
8787 SetAI(goalList.
Next());
8811 return GetGoalWork();
8817 return GetGoalHobby();
8852 if (_works ==
null || _hobbies ==
null)
8856 foreach (
int work
in _works)
8863 foreach (
int hobby
in _hobbies)
8884 return SetAI(_NoGoalPC);
8902 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8906 if (HasCondition<ConWait>())
8908 RemoveCondition<ConWait>();
8914 renderer.RefreshStateIcon();
8921 bool hasNoGoal = HasNoGoal;
8956 listHobby.Add(
new Hobby
8967 foreach (
int work
in _works)
8969 listHobby.Add(
new Hobby
8983 if (_hobbies ==
null)
8987 foreach (
int hobby
in _hobbies)
8989 listHobby.Add(
new Hobby
9002 if (
item.source.alias ==
id)
9007 foreach (
Hobby item2
in ListHobbies())
9009 if (item2.
source.alias ==
id)
9019 if (workElements !=
null)
9023 workElements =
null;
9024 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
9032 foreach (
Hobby item2
in ListWorks())
9036 if (workElements !=
null)
9040 void TryAdd(
Hobby h)
9042 if (!h.
source.elements.IsEmpty())
9044 if (workElements ==
null)
9048 for (
int i = 0; i < h.
source.elements.Length; i += 2)
9050 int num = h.
source.elements[i];
9051 int num2 = h.
source.elements[i + 1];
9053 if (num != 2115 && num != 2207)
9061 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
9069 string text = (simple ?
"" : (
"hobby".lang() +
":"));
9074 return text.TrimEnd(
',');
9079 string text = (simple ?
"" : (
"work".lang() +
":"));
9084 return text.TrimEnd(
',');
9089 foreach (
int hobby
in _hobbies)
9101 foreach (
int work
in _works)
9113 if (_hobbies !=
null && _works !=
null)
9120 _hobbies =
new List<int>();
9121 _works =
new List<int>();
9129 string[] hobbies = source.
hobbies;
9130 foreach (
string key
in hobbies)
9135 if (source.
works.IsEmpty())
9141 string[] hobbies = source.
works;
9142 foreach (
string key2
in hobbies)
9147 GetWorkSummary().Reset();
9152 if (_workSummary ==
null)
9156 return _workSummary;
9169 if (workSummary.
work !=
null)
9174 else if (workSummary.
hobbies.Count > 0)
9195 hobby.id = session.
id;
9200 workSummary.progress +=
EClass.
rnd(5) + 5;
9202 int num = PerformWork(hobby, 0, isHobby);
9203 int num2 = PerformWork(hobby, 1, isHobby);
9204 int num3 = PerformWork(hobby, 2, isHobby);
9205 int num4 = PerformWork(hobby, 3, isHobby);
9206 workSummary.money += num;
9207 workSummary.food += num2;
9208 workSummary.knowledge += num3;
9209 workSummary.material += num4;
9210 int PerformWork(
Hobby work,
int idx,
bool isHobby)
9212 if (idx >= work.
source.resources.Length)
9216 int num5 = work.
source.resources[idx];
9218 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
9219 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
9220 if (num6 > 0 && num5 <= 0)
9230 _goalWork.
FindWork(
this, setAI:
false);
9246 foreach (
Condition condition
in conditions)
9248 condition.
SetOwner(
this, onDeserialize);
9254 return AddCondition(typeof(T).Name, p, force);
9267 if (c is
ConBleed && ResistLv(964) >= 3)
9272 else if (ResistLv(950) >= 3)
9290 if (c.
source.negate.Length != 0)
9292 string[] negate = c.
source.negate;
9293 foreach (
string text
in negate)
9295 if (HasElement(text))
9302 if (defenseAttribute !=
null)
9304 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
9306 if (c.
source.resistance.Length != 0)
9311 c.power /= num * num + 1;
9329 for (
int j = 0; j < conditions.Count; j++)
9331 if (conditions[j].
id != c.
id)
9337 conditions[j].Kill();
9340 if (conditions[j].CanStack(c))
9342 if (conditions[j].ShouldOverride(c))
9344 if (conditions[j].IsOverrideConditionMet(c, num2))
9346 conditions[j].Kill(silent:
true);
9351 if (CanGainConResist)
9355 conditions[j].OnStacked(c.
power);
9356 conditions[j].OnStartOrStack();
9357 conditions[j].PlayEffect();
9359 if (!conditions[j].AllowMultipleInstance)
9364 foreach (
Condition condition
in conditions)
9373 if (CanGainConResist)
9380 if (c.ShouldRefresh)
9392 if (c.SyncRide && (ride !=
null || parasite !=
null))
9398 if (parasite !=
null)
9406 public override bool HasCondition<T>()
9408 for (
int i = 0; i < conditions.Count; i++)
9410 if (conditions[i] is T)
9420 for (
int i = 0; i < conditions.Count; i++)
9422 if (conditions[i].source.alias == alias)
9437 for (
int i = 0; i < conditions.Count; i++)
9441 return conBuffStats.elements.GetElement(ele);
9450 foreach (
Condition condition
in conditions)
9460 public void CureCondition<T>(
int v = 99999) where T :
Condition
9462 T condition = GetCondition<T>();
9463 if (condition !=
null)
9465 condition.value -= v;
9466 if (condition.value <= 0)
9473 public override T GetCondition<T>()
9475 for (
int i = 0; i < conditions.Count; i++)
9477 if (conditions[i] is T)
9479 return conditions[i] as T;
9487 for (
int num = conditions.Count - 1; num >= 0; num--)
9489 if (conditions[num] is T)
9491 conditions[num].
Kill();
9499 if (parasite !=
null)
9501 parasite.
Cure(type, p, state);
9505 ride.
Cure(type, p, state);
9507 Cure(type, p, state);
9517 CureCondition<ConFear>();
9518 CureCondition<ConBlind>(2 * p / 100 + 5);
9519 CureCondition<ConPoison>(5 * p / 100 + 5);
9520 CureCondition<ConConfuse>(10 * p / 100 + 10);
9521 CureCondition<ConDim>(p / 100 + 5);
9522 CureCondition<ConBleed>(2 * p / 100 + 10);
9529 CureCondition<ConBlind>(5 * p / 100 + 15);
9530 CureCondition<ConPoison>(10 * p / 100 + 15);
9531 CureCondition<ConBleed>(5 * p / 100 + 20);
9532 CureTempElements(p, body:
true, mind:
false);
9535 CureCondition<ConFear>();
9536 CureCondition<ConDim>(3 * p / 100 + 10);
9537 CureTempElements(p, body:
false, mind:
true);
9541 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
9543 Condition condition2 = conditions[num2];
9548 condition2.
Mod(-1, force:
true);
9556 CureCondition<ConWait>();
9557 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
9558 bool flag2 = HasCondition<ConAnorexia>();
9559 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9560 if (base.c_vomit < 0)
9565 RemoveCondition<ConAnorexia>();
9576 CureTempElements(p * 100, body:
true, mind:
true);
9577 for (
int num = conditions.Count - 1; num >= 0; num--)
9584 switch (condition.
Type)
9604 CureCondition<ConWait>();
9605 CureCondition<ConSleep>();
9612 RemoveCondition<ConBrightnessOfLife>();
9613 RemoveCondition<ConDeathSentense>();
9617 if (HasElement(1206))
9619 SetFeat(1206, 0, msg:
true);
9621 RemoveCondition<ConBrightnessOfLife>();
9622 RemoveCondition<ConDeathSentense>();
9636 for (
int num = conditions.Count - 1; num >= 0; num--)
9652 if (
TC.hp > (
long)
TC.MaxHP * (
long)(Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) + Evalue(1426) * 5) / (
TC.IsPowerful ? 200 : 100))
9656 if (
TC.HasElement(427))
9664 PlaySound(
"hit_finish");
9666 Say(
"finish2",
this,
TC);
9676 if (resistCon ==
null)
9678 resistCon =
new Dictionary<int, int>();
9680 if (resistCon.ContainsKey(key))
9682 resistCon[key] += con.power * con.GainResistFactor / 100;
9686 resistCon[key] = con.power * con.GainResistFactor / 100;
9693 if (con.
power > 0 && resistCon !=
null)
9695 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
9717 RemoveCondition<ConAwakening>();
9722 con.pcPillow = pillow;
9723 con.pickup = pickup;
9724 con.posBed = posBed;
9725 con.posPillow = posPillow;
9731 bool isSunLit = pos.IsSunLit;
9733 int num =
bed?.Power ?? 20;
9734 if (traitPillow !=
null)
9736 num += traitPillow.owner.Power / 2;
9740 num +=
bed.Evalue(750) * 5;
9746 OnSleep(num, days, isSunLit);
9749 public void OnSleep(
int power,
int days = 1,
bool isSunLit =
false)
9755 int num = power * days;
9756 if (stamina.
value < 0)
9760 if (isWeakToSunlight && isSunLit)
9767 AddCondition<ConBurning>(1000, force:
true);
9772 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9789 if (!HasElement(450))
9791 long num = bio.height;
9792 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9797 if (num > 999999999)
9801 if (num != bio.height)
9803 bio.height = (int)num;
9804 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
9811 if (HasElement(450) || a == 0)
9815 long num = bio.weight;
9816 long num2 = bio.height;
9817 long num3 = num2 * num2 * 18 / 25000;
9818 long num4 = num2 * num2 * 24 / 10000;
9819 if (ignoreLimit || (num > num3 && num < num4))
9821 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9826 if (num > 999999999)
9830 if (num != bio.weight)
9832 bio.weight = (int)num;
9833 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
9842 if (Evalue(962) >= 25 || (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0))
9846 int num = Evalue(412);
9849 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
9850 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
9857 int num3 = (corruption + a) / 100 - corruption / 100;
9858 for (
int i = 0; i < Mathf.Abs(num3); i++)
9860 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
9867 foreach (
Element value
in elements.dict.Values)
9869 if (value.
source.category ==
"ether")
9871 num4 += value.
Value;
9874 if (num4 > 0 && IsPC)
9878 corruption = num4 * 100 + corruption % 100;
9883 List<Element> list =
new List<Element>();
9886 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
9887 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
9896 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
9898 Feat feat = elements.GetElement(
id) as
Feat;
9900 if (feat !=
null && feat.
Value > 0)
9902 if (value == feat.
Value)
9909 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
9910 if (feat.
Value != 0)
9917 CalculateMaxStamina();
9923 if (feat.
source.textInc.IsEmpty())
9925 PlaySound(
"ding_skill");
9927 Say(
"gainFeat",
this, feat.
FullName);
9931 bool flag = value < num;
9932 if (feat.
source.tag.Contains(
"neg"))
9941 PlaySound(
"chime_angel");
9947 PlaySound(
"chime_devil");
9951 PlaySound(
"mutation");
9955 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9957 elements.CheckSkillActions();
9964 Element element = elements.GetElement(idEle);
9965 Element element2 = elements.GetElement(row2.
id);
9966 int num = element?.
Value ?? 0;
9975 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
9976 if (a == 0 && (element ==
null || element.
Value == 0))
9978 SayNothingHappans();
9981 if (element !=
null && element.
Value == a)
9983 SayNothingHappans();
9986 if (element2 !=
null && element2.
Value > 0)
9988 SetFeat(element2.
id, 0);
9991 PlaySound(
"mutation");
9992 PlayEffect(
"mutation");
9994 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9999 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
10001 Say(
"resistMutation",
this);
10005 for (
int i = 0; i < tries; i++)
10008 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10014 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10015 if (base.c_corruptionHistory.Count == 0)
10017 base.c_corruptionHistory =
null;
10020 Element element = elements.GetElement(row.
id);
10022 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))
10029 element = elements.GetElement(row.
id);
10031 bool flag = row.
tag.Contains(
"neg");
10044 if (element !=
null)
10046 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
10047 if (num > element.
source.max)
10049 num = element.source.max - 1;
10051 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
10052 flag2 = num > element.
Value;
10053 if (vec > 0 && !flag2)
10058 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
10059 SetFeat(row.
id, num);
10060 if (flag2 && ether)
10062 if (base.c_corruptionHistory ==
null)
10064 base.c_corruptionHistory =
new List<int>();
10066 base.c_corruptionHistory.Add(row.
id);
10069 Element element2 = elements.GetElement(row.
id);
10074 EClass.player.flags.gotEtherDisease =
true;
10076 thing.
SetStr(53,
"letter_ether");
10085 PlaySound(ether ?
"mutation_ether" :
"mutation");
10086 PlayEffect(
"mutation");
10088 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10092 Say(
"nothingHappens");
10098 Element orCreateElement = elements.GetOrCreateElement(ele);
10101 elements.ModBase(orCreateElement.
id, 1);
10103 if (orCreateElement is
Spell)
10105 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10106 int num2 = origin?.Evalue(765) ?? 0;
10107 num = num * (100 - num2) / 100;
10108 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10110 if (orCreateElement.
source.charge == 1)
10114 orCreateElement.vPotential += a;
10116 Say(
"spell_gain",
this, orCreateElement.
Name);
10128 Msg.
Say(
"curse_nullify", member);
10133 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
10135 Say(
"curse_nullify",
this);
10138 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
10140 Say(
"curse_nullify",
this);
10148 if (_historyFood !=
null)
10150 while (_historyFood.Count > 5)
10152 _historyFood.RemoveAt(_historyFood.Count - 1);
10154 if (_historyFood[0].Count > 0)
10156 _historyFood.Insert(0,
new List<string>());
10163 if (!IsPCFaction || !IsGlobal)
10165 _historyFood =
null;
10168 if (_historyFood ==
null)
10170 _historyFood =
new List<List<string>>
10175 if (_historyFood[0].Count < 5)
10177 _historyFood[0].Add(
food.id);
10183 if (_historyFood ==
null)
10188 foreach (List<string>
item in _historyFood)
10190 foreach (
string item2
in item)
10192 if (item2 ==
food.id)
10205 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10207 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10212 if (faithElements !=
null)
10217 if (idFaith ==
"eyth" && !HasElement(1228))
10227 if (!HasCondition<ConExcommunication>())
10235 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10236 for (
int i = 0; i < array.Length; i += 2)
10238 int num2 = array[i + 1] * num / 50;
10239 if (array[i] == 79)
10241 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
10243 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10247 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
10253 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
10259 bool flag = HasElement(1215);
10260 if (tempElements ==
null)
10269 int num = elements.ValueWithoutLink(ele);
10270 int num2 = Mathf.Abs(num) + 100;
10271 int num3 = num2 / (flag ? 2 : 4);
10272 int num4 = -num - 100;
10273 int num5 = tempElements.
Base(ele);
10274 int num6 = num5 + a;
10277 num3 = Mathf.Min(a, num3);
10278 num4 = Mathf.Max(a, -num2 / 3);
10280 if (a > 0 && num6 > num3)
10282 a = ((num3 > num5) ? (num3 - num5) : 0);
10284 if (a < 0 && num6 < num4)
10286 a = ((num4 < num5) ? (num4 - num5) : 0);
10289 if (element.
vBase == 0)
10292 if (tempElements.
dict.Count == 0)
10294 tempElements =
null;
10313 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
10319 foreach (
int ele
in array)
10321 EnhanceTempElement(ele, p, onlyRenew);
10327 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
10332 if (tempElements ==
null)
10338 if (
item.vBase > 0)
10340 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
10347 if (tempElements !=
null)
10358 void Cure(
int[] eles)
10360 foreach (
int ele
in eles)
10362 if (tempElements ==
null)
10367 if (element !=
null && element.
vBase < 0)
10369 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
10377 if (tempElements !=
null)
10380 tempElements =
null;
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static Act Create(int id)
virtual bool ShouldAllyAttack(Chara tg)
virtual bool CancelOnAggro
override string ToString()
virtual bool CancelWhenMoved
string GetCurrentActionText()
virtual Point GetDestination()
virtual void OnPerformWork(bool realtime)
bool TryCancelInteraction(bool sound=true)
void SetTurbo(int mtp=-1)
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
static void Unride(Chara host, Chara mount, bool talk=true)
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
static void Search(Chara c, bool manual=false)
virtual TargetType TargetType
bool IsTargetHostileParty()
virtual bool CanRapidFire
static Affinity Get(Chara c)
void SetStr(int id, string value=null)
void SetInt(int id, int value=0)
virtual RendererReplacer GetRendererReplacer()
virtual bool PreventRegen
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool TryMove(Point p)
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
void Mod(int a, bool force=false)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual void OnEndPlayerTurn()
virtual ConditionType Type
virtual string GetPhaseStr()
static int GetColorInt(ref Color matColor, int p)
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
GlobalCharaList globalCharas
void PlayAnime(AnimeID id, bool force)
RendererReplacer replacer
virtual string GetName(NameStyle style, int num=-1)
void Teleport(Point point, bool silent=false, bool force=false)
int EvalueMax(int ele, int min=0)
void MakeFigureFrom(string id)
ElementContainerCard elements
Hostility c_originalHostility
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Card MakeRefFrom(string id)
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
virtual string GetHoverText2()
virtual void SetBlessedState(BlessedState s)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void ModCurrency(int a, string id="money")
virtual bool IsAliveInCurrentZone
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
BlessedState blessedState
bool TryStackTo(Thing to)
virtual bool IsPCFactionMinion
void ApplyBacker(int bid)
void ModExp(string alias, int a)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
virtual RenderRow TileRow
void AddExp(int a, bool applyMod=true)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
SourceCellEffect.Row source
SourceBlock.Row sourceBlock
SourceFloor.Row sourceFloor
SourceMaterial.Row matObj
SourceFloor.Row sourceBridge
SourceMaterial.Row matFloor
SourceFloor.Row sourceSurface
void RemoveBodyPartAt(int idx)
void SetOwner(Chara chara, bool deserialized=false)
void AddBodyPart(int ele, Thing thing=null)
bool HasElement(int idEle)
bool IsTooHeavyToEquip(Thing thing)
AttackStyle GetAttackStyle()
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
int GetWeight(bool armorOnly=false)
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
void RemoveBodyPart(int ele)
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
static Chara Create(string id, int lv=-1)
override void SetOwner(Card c)
SourceCategory.Row GetFavCat()
void DamageTempElement(int ele, int p, bool onlyRenew=false)
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
void Refresh(bool calledRecursive=false)
void ChangeRace(string idNew)
bool HasHobbyOrWork(string alias)
static List< Chara > _pts
override string actorPrefab
override bool IsAliveInCurrentZone
bool IsFriendOrAbove(Chara c)
int GetBurden(Card t=null, int num=-1)
override void ApplyEditorTags(EditorTag tag)
Thing FindBestFoodToEat()
Hostility OriginalHostility
void TryPickGroundItem(Func< Card, bool > func=null)
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
bool CanAcceptGift(Chara c, Card t)
WorkSummary GetWorkSummary()
override void Rotate(bool reverse=false)
Chara CreateReplacement()
override Sprite GetImageSprite()
void MoveHome(Zone zone, int x=-1, int z=-1)
void ChangeMemberType(FactionMemberType type)
void CureTempElements(int p, bool body, bool mind)
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
Element GetBuffStats(string alias)
void Cuddle(Chara c, bool headpat=false)
bool IsCriticallyWounded(bool includeRide=false)
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
bool CanInteractTo(Point p)
override void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
void TryPutShared(Thing t, List< Thing > containers=null, bool dropIfFail=true)
void CureHost(CureType type, int p=100, BlessedState state=BlessedState.Normal)
void RefreshWorkElements(ElementContainer parent=null)
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
void InstantEat(Thing t=null, bool sound=true)
Goal GetGoalFromTimeTable(int hour)
Condition AddCondition(string id, int p=100, bool force=false)
override Sprite GetSprite(int dir=0)
Thing FindAmmo(Thing weapon)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
GoalListType goalListType
bool CanAcceptItem(Card t, int num=-1, bool skipImportantCheck=false)
override CardRow sourceRenderCard
override int GetArmorSkill()
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
void SetFaith(Religion r)
bool IsValidGiftWeight(Card t, int num=-1)
Condition AddCondition(Condition c, bool force=false)
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Chara GetNearbyCatToSniff()
static List< SourceCategory.Row > _listFavCat
void SetFeat(int id, int value=1, bool msg=false)
bool CanSeeLos(Card c, int dist=-1)
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
override string ToString()
void TryTakeSharedItems(IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
ElementContainer tempElements
void TryPutSharedItems(bool msg=true)
void SetMainElement(int id, int v=0, bool elemental=false)
void ApplyRace(bool remove=false)
bool RequestProtection(Chara attacker, Action< Chara > action)
bool TryWorkOutside(SourceHobby.Row sourceWork)
override void OnSerializing()
List< Condition > conditions
void SetMutation(int idEle, int a=0)
void HoldCard(Card t, int num=-1)
void PickHeld(bool msg=false)
bool HasCondition(string alias)
SpriteReplacer spriteReplacer
static List< Thing > _ListItems
Chara SetHomeZone(Zone zone)
Chara SetFaction(Faction f)
void SetMainElement(string id, int v=0, bool elemental=false)
Thing GetBestRangedWeapon()
void DiminishTempElements(int a=1)
override string GetName(NameStyle style, int num=-1)
Chara SetGlobal(Zone _home, int x, int z)
void EnhanceTempElements(int p, bool body, bool mind, bool onlyRenew=false)
override string GetHoverText()
override void OnDeserialized()
override void SetSource()
bool TryHoldCard(Card t, int num=-1, bool pickHeld=false)
static List< Hobby > listHobby
int CalcCastingChance(Element e, int num=1)
bool ShouldEquip(Thing t, bool useFav=false)
bool CanMoveTo(Point p, bool allowDestroyPath=true)
ConTransmuteMimic mimicry
bool HasMinion(string id)
void DestroyPath(Point pos)
override CardRenderer _CreateRenderer()
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
override bool IsPCFaction
override bool IsPCPartyMinion
void CalculateMaxStamina()
void MoveZone(Zone z, ZoneTransition transition)
void TryUpgrade(bool msg=true)
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
override void LookAt(Point p)
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
override bool IsPCFactionMinion
void SetCooldown(int idEle, int turns=0)
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
bool CanEat(Thing t, bool shouldEat=false)
bool ShouldThrowAway(Thing t, ClearInventoryType type)
ElementContainer _baseWorkElements
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
void SetAIImmediate(AIAct g)
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
void PickOrDrop(Point p, Thing t, bool msg=true)
static GoalHobby _goalHobby
override bool IsDeadOrSleeping
List< Hobby > ListHobbies(bool useMemberType=true)
void MakeAlly(bool msg=true)
void RemoveLastBodyPart(bool msg=false)
ElementContainer baseWorkElements
void TickWork(VirtualDate date)
void Stumble(int mtp=100)
void ClearInventory(ClearInventoryType type)
void GainAbility(int ele, int mtp=100, Thing origin=null)
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
FactionMemberType memberType
string TalkTopic(string topic="calm")
string GetIdPortraitCat()
bool HasHigherGround(Card c)
void TryRestock(bool onCreate)
void RestockInventory(bool onCreate)
List< List< string > > _historyFood
bool MoveNeighborDefinitely()
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
bool visibleWithTelepathy
void ChangeJob(string idNew)
SourceThing.Row GetFavFood()
void SetTempHand(int right=0, int left=0)
void ApplyJob(bool remove=false)
void AddRandomBodyPart(bool msg=false)
List< Hobby > ListWorks(bool useMemberType=true)
Card DropHeld(Point dropPos=null)
void Revive(Point p=null, bool msg=false)
void TryReservePickupTutorial(Thing t)
LayerDrama ShowDialog(string book, string step="main", string tag="")
void RefreshFaithElement()
ElementContainer faithElements
override void ChangeRarity(Rarity r)
void GiveLovePotion(Chara c, Thing t)
void AddCooldown(int idEle, int turns=0)
void RerollHobby(bool extraSlotChance=true)
Thing MakeGene(DNA.Type? type=null)
void RefreshSpeed(Element.BonusInfo info=null)
static List< SourceRace.Row > ListAdvRace
bool CanBeTempAlly(Chara c)
int GetCooldown(int idEle)
override string AliasMaterialOnCreate
void ModWeight(int a, bool ignoreLimit=false)
void AddFoodHistory(Thing food)
override CardRow sourceCard
bool CanInteractTo(Card c)
string GetTopicText(string topic="calm")
static NoGoal _NoGoalRepeat
void ModCorruption(int a)
void RestockEquip(bool onCreate)
override void SetDir(int d)
MoveResult TryMoveTowards(Point p)
bool FindNearestNewEnemy()
Element GetFavWeaponSkill()
void DropThing(Thing t, int num=-1)
void GiveGift(Chara c, Thing t)
void EQ_Item(string s, int num=1)
string GetTextHappiness()
override bool IsMultisize
Chara SetEnemy(Chara c=null)
void CallHelp(Chara tg, bool fanatic=false)
void DoHostileAction(Card _tg, bool immediate=false)
bool CanSeeSimple(Point p)
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
void ClearBed(Map map=null)
override void SetRenderParam(RenderParam p)
void AddResistCon(Condition con)
void MoveZone(Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
bool UseAbility(Act a, Card tc=null, Point pos=null, bool pt=false)
bool TryEquip(Thing t, bool useFav=false)
override SubPassData GetSubPassData()
bool CanSeeLos(Point p, int dist=-1)
int CountNumEaten(Thing food)
void ResistCon(Condition con)
void SetSummon(int duration)
Element GetFavArmorSkill()
void DamageTempElements(int p, bool body, bool mind, bool onlyRenew=false)
bool IsEnemyOnPath(Point p, bool cancelAI=true)
void InitStats(bool onDeserialize=false)
void MoveHome(string id, int x=-1, int z=-1)
bool TryIdentify(Thing t, int count=1, bool show=true)
Thing TryPoisonPotion(Thing t)
void TryTakeSharedItems(bool msg=true)
override void LookAt(Card c)
static List< SourceThing.Row > _listFavFood
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
static string[] IDTimeTable
TimeTable.Span CurrentSpan
Chara SetHostility(Hostility h)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
void TrySetEnemy(Chara c)
override void OnCreate(int genLv)
void TryAbsorbRod(Thing t)
string GetTextWork(bool simple=false)
void TryPush(Point point)
string GetTextHobby(bool simple=false)
Dictionary< int, int > resistCon
void OnSleep(Thing bed=null, int days=1)
override string GetHoverText2()
int ParseBodySlot(string s)
bool CanEquipRanged(Thing t)
void Sleep(Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
void OnGiveErohon(Thing t)
AttackStyle GetFavAttackStyle()
bool HasCooldown(int idEle)
static GoalWork _goalWork
void OnSleep(int power, int days=1, bool isSunLit=false)
void DoAI(int wait, Action onPerform)
ElementContainer workElements
static List< SourceJob.Row > ListAdvJob
void MoveZone(string alias)
void SetPCCState(PCCState state)
Element GetBuffStats(int ele)
void MakeGrave(string lastword)
override void OnBeforeCreate()
bool DroppedCard(string id)
void MarkCardDrop(string id)
UD_String_MatData matColors
Gradient gradientLVComparison
void Kill(bool silent=false)
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
static void Collect(Thing t)
bool ignoreBackerDestoryFlag
BackerContentConfig backer
static Thing MakeLoveLunch(Chara c)
static string GetBloodText(Chara c)
static Thing GenerateGene(Chara c, Type? type=null)
int GetRaw(int offsetHours=0)
static void TryWarnMana(Action action)
static int curve(long _a, int start, int step, int rate=75)
static ColorProfile Colors
static SourceManager sources
static float rndf(float a)
static FactionBranch Branch
static BaseGameScreen screen
static int rndHalf(int a)
static SoundManager Sound
static GameSetting setting
static Effect Get(Effect original)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int ValueWithoutLink(int ele)
Element ModBase(int ele, int v)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
void SetTo(int id, int v)
Element SetBase(string alias, int v, int potential=0)
Element GetElement(string alias)
static SourceElement.Row Get(int id)
virtual int GetPower(Card c)
static Element Create(int id, int v=0)
virtual Act.Cost GetCost(Chara c)
static List< SourceElement.Row > ListElements
static int[] List_MainAttributesMajor
TileInfo GetTileInfo(int gx, int gy)
static Expedition Create(Chara c, ExpeditionType type)
static SourceFloor.Row sourceSnow
static SourceFloor.Row sourceIce
static bool IsTatami(int id)
static SourceFloor.Row sourceWood
ExpeditionManager expeditions
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
Dictionary< string, Faction > dictAll
List< string > Apply(int a, ElementContainer owner, bool hint=false)
override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
static void Proc(Chara c, Thing food, bool consume=true)
Dictionary< int, byte > lastPoints
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
bool disableDeathPenaltyProtection
UD_String_ElementRef elements
ConfigPreference preference
ConfigAutoCombat autoCombat
ReligionManager religions
bool Save(bool isAutoSave=false, bool silent=false)
PCCUniformManager uniforms
void Refresh(Chara owner, GoalListType type)
void ValidateHobby(Chara c)
bool FindWork(Chara c, bool setAI=true)
static GuildFighter Fighter
int GetEfficiency(Chara c)
static bool Has(string id)
static string[] GetList(string id)
static string _currency(object a, string IDCurrency)
static void SetDirty(Element a)
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
static void SetDirty(Thing t)
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
static SourceMaterial.Row sourceOak
static SourceMaterial.Row sourceSnow
static SourceMaterial.Row sourceIce
Thing FindThing(Func< Thing, bool > func)
Chara FindChara(string id)
void MoveCard(Point p, Card t)
void SetLiquid(int x, int z, CellEffect effect=null)
void SetFoormark(Point pos, int id, int angle, int offset=0)
void SetEffect(int x, int z, CellEffect effect=null)
static ThirstPersonInfo thirdPerson1
static string SayNothingHappen()
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
bool HasElement(int ele, bool excludePC=false)
void RemoveMember(Chara c)
void AddMemeber(Chara c, bool showMsg=false)
void RequestPathImmediate(PathProgress progress)
Point GetFirstStep(Point origin, Point _dest, IPathfindWalker walker, int maxDist=20, MoveType moveType=MoveType.Default)
static PathManager Instance
List< PathFinderNode > nodes
void EndTurn(bool consume=true)
void EnterLocalZone(bool encounter=false, Chara mob=null)
List< Chara > listCarryoverMap
HashSet< int > doneBackers
Thing DropReward(Thing t, bool silent=false)
bool TryAbortAutoCombat(bool immediate=true)
SourceMaterial.Row matFloor
SourceBlock.Row sourceBlock
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
void SetObj(int id=0, int value=1, int dir=0)
ref Vector3 Position(int height)
List< Card > ListCards(bool includeMasked=false)
override string ToString()
Point Set(int _x, int _z)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Point GetPointTowards(Point dest)
bool Equals(int _x, int _z)
List< Chara > ListCharas()
SourceFloor.Row sourceFloor
void SetBlock(int idMat=0, int idBlock=0)
Effect PlayEffect(string id)
Point GetRandomNeighbor()
bool IsActive(int id, int days=-1)
static string GetRandomPortrait(string idDict)
static HashSet< string > allIds
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
virtual void OnGiveItem(Chara c, Thing t)
void OnSetGoal(AIAct newGoal)
static int Range(int min, int max)
static void UseSeed(int seed, Action action)
static void SetSeed(int a=-1)
static int Set(Zone zone)
Dictionary< string, Religion > dictAll
ReligionMoonShadow MoonShadow
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
static Religion recentWrath
void Revelation(string idTalk, int chance=100)
int ConvertTile(int tile)
bool ContainsTag(string _tag)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
static void ShakeCam(string id="default", float magnitude=1f)
SourceCharaText charaText
SourceCategory categories
virtual bool ShowDangerLv
virtual int DangerLvBoost
virtual bool IsSnowCovered
Sprite GetSprite(bool snow=false)
static int GetAffinityMod(int phase)
static StatsSleepiness Sleepiness
static StatsHygiene Hygiene
static StatsBurden Burden
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
static StatsStamina Stamina
static StatsHunger Hunger
static SubPassData Default
static TargetTypeSelfParty SelfParty
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void DestroyAll(Func< Thing, bool > funcExclude=null)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
static void TryLickChest(Thing chest)
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
static Thing CreateParcel(string idLang=null, params Thing[] things)
static Thing CreateSpellbook(string alias, int num=1)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing CreateScroll(int ele, int num=1)
static Thing CreateCurrency(int a, string id="money")
static Thing Create(string id, int idMat=-1, int lv=-1)
override string GetName(NameStyle style, int _num=-1)
override string GetHoverText()
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
virtual bool UseRandomAlias
virtual bool CanExtendBuild
virtual void OnTickHeld()
virtual void OnSteppedOut(Chara c)
virtual bool IgnoreOnSteppedWhenMoving
virtual bool CanBeDestroyed
virtual bool CanRead(Chara c)
virtual bool CanEat(Chara c)
virtual bool IsChangeFloorHeight
virtual void OnStepped(Chara c)
virtual void OnDrink(Chara c)
virtual bool CanBeDropped
virtual Action GetHealAction(Chara c)
virtual void SetName(ref string s)
virtual bool CanDrink(Chara c)
virtual bool CanOnlyCarry
virtual void OnBlend(Thing t, Chara c)
static void Reserve(string idStep, Action onBeforePlay=null)
static void Play(string idStep)
UIItem AddHeaderCard(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Condition CurrentCondition
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
FilterResult IsFilterPass(string text)
List< WorkSession > hobbies
void SendPackage(Thing p)
virtual ZoneTransition.EnterState ReturnState
virtual void OnLeaveZone()
void RefreshDeathSentense()
int CountMinions(Chara c)
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
virtual bool IsUnderwater
virtual bool WillAutoSave
virtual bool KeepAllyDistance
virtual bool HiddenInRegionMap
void RefreshListCitizen()
Card AddCard(Card t, Point point)
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)