2using System.Collections.Generic;
15 private static List<Hobby>
listHobby =
new List<Hobby>();
17 public static string[]
IDTimeTable =
new string[2] {
"default",
"owl" };
44 [JsonProperty(PropertyName =
"T1")]
47 [JsonProperty(PropertyName =
"T2")]
50 [JsonProperty(PropertyName =
"T3")]
53 [JsonProperty(PropertyName =
"T4")]
56 [JsonProperty(PropertyName =
"T5")]
59 [JsonProperty(PropertyName =
"T6")]
62 [JsonProperty(PropertyName =
"T7")]
65 [JsonProperty(PropertyName =
"T8")]
68 [JsonProperty(PropertyName =
"1")]
71 [JsonProperty(PropertyName =
"2")]
74 [JsonProperty(PropertyName =
"3")]
77 [JsonProperty(PropertyName =
"4")]
80 [JsonProperty(PropertyName =
"8")]
81 public string[]
_strs =
new string[5];
83 [JsonProperty(PropertyName =
"9")]
192 private static List<Chara>
_pts =
new List<Chara>();
482 if (base.c_originalHostility == (
Hostility)0)
484 if (!
source.hostility.IsEmpty())
490 return base.c_originalHostility;
500 if (
source.idActor.Length <= 1)
532 return "CharaActorPCC";
544 if (base.dir != 1 && base.dir != 2)
560 return base.dir == 2;
574 return base.ExistsOnMap;
620 if (base.c_love !=
null)
622 return base.c_love.dateMarriage != 0;
652 return base.c_uidMaster != 0;
728 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);
730 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);
734 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
740 if (base.c_idMainElement == 0)
748 public override int DV
759 num = 50 + (num - 50) / 10;
762 int WeaknessMod(
int a)
764 if (HasCondition<ConWeakness>())
777 public override int PV
788 num = 50 + (num - 50) / 10;
791 int WeaknessMod(
int a)
793 if (HasCondition<ConWeakness>())
814 spriteReplacer.data.tryFixPrefNotLoadedAtStart =
true;
826 else if (base.idSkin > 0)
878 if (!
race.tag.Contains(
"ride"))
880 if (!
race.tag.Contains(
"noRide"))
902 return !base.isSummon;
1046 if (!(
race.id ==
"cat") && !(
race.id ==
"catsister"))
1048 return race.id ==
"catgod";
1064 return race.id ==
"mutant";
1088 return EClass.Branch.uidMaid == base.uid;
1114 if (!
source.works.Contains(
"Rich"))
1116 return source.hobbies.Contains(
"Rich");
1142 if (base.c_genes !=
null)
1144 return base.c_genes.GetGeneSlot(
this);
1170 if (!
race.tag.Contains(
"mofu"))
1184 if (base.idSkin == 0 && !
source.staticSkin)
1186 return base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0);
1213 if (!h.
source.elements.IsEmpty())
1215 for (
int i = 0; i < h.
source.elements.Length; i += 2)
1217 int ele = h.
source.elements[i];
1218 int v = h.
source.elements[i + 1];
1248 if (base.rarity >=
Rarity.Legendary)
1263 if (
host ==
null || includeRide)
1267 return base.hp <
MaxHP / 5;
1282 return num > num2 + 0.1f;
1379 return p.cell.room.data.accessType
switch
1382 BaseArea.AccessType.Private =>
false,
1409 for (
int i = 0; i < slots.Count; i++)
1418 _cbits1.Bits = (uint)
_cints[0];
1429 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1438 if (
source.tag.Contains(
"boss"))
1459 string text = base.c_altName ??
source.GetName(
this);
1460 if (HasCondition<ConTransmuteShadow>())
1467 if (base.c_bossType ==
BossType.Evolved)
1469 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1472 if (text.Length > 0 &&
char.IsLower(text[0]))
1474 if (base.rarity >=
Rarity.Legendary)
1476 text = text.ToTitleCase();
1480 text = text.AddArticle();
1487 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Mythical) ? 2 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1)))));
1492 text = ((
Aka.IsEmpty() || !(
Aka != text)) ? text.Bracket(num2) : (num2
switch
1497 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1499 return text + text2;
1504 if (r != base.rarity)
1549 if (uniqueData !=
null)
1562 where zone != EClass._zone
1563 select zone).RandomItem();
1590 base.isSubsetCard =
false;
1592 base.c_uidMaster = 0;
1624 if (
source.tag.Contains(
"boss"))
1628 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1650 if (
source.idActor.Length > 2)
1659 if (
source.mainElement.Length != 0)
1661 int _genLv = Mathf.Min(
genLv, 100);
1662 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1663 string[] mainElement =
source.mainElement;
1664 for (
int num2 = 0; num2 < mainElement.Length; num2++)
1666 string[] array = mainElement[num2].Split(
'/');
1668 int num3 = source.LV * row.eleP / 100;
1669 if (list.Count == 0 || num3 < _genLv || array[0] ==
bp.
idEle)
1671 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num3));
1674 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / Mathf.Max(100 + (_genLv - a.Item3) * 25, 1));
1677 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle ||
"ele" + a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1679 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1680 if (list.Count >= 2)
1682 num = tuple.Item3 + base.LV -
source.LV;
1687 base.c_altName = NameGen.getRandomName();
1691 _alias = AliasGen.GetRandomAlias();
1704 if (base.LV > 5 &&
race.id ==
"mutant")
1706 for (
int num4 = 0; num4 < Mathf.Min(1 + base.LV / 5, 20); num4++)
1713 case "putty_mech_b":
1729 if (
race.EQ.Length != 0 || !
source.equip.IsEmpty())
1747 case "olderyoungersister":
1750 case "sister_undead":
1754 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1773 if (!
source.faith.IsEmpty())
1834 Debug.LogError(
"source is null");
1854 base.isHidden =
false;
1876 string text =
"marshmallow_king";
1877 string text2 =
"fusion";
1881 text =
"imotomaton";
1885 text =
"shojomaton";
1889 text =
"sister_catmaton";
1903 if (!text2.IsEmpty())
1916 chara.PlayAnime(
AnimeID.FallSky);
1917 chara.pos.PlaySound(
"fuse");
1918 chara.pos.PlayEffect(
"vanish");
1966 if (con !=
DuplicateCondition.Water && con !=
DuplicateCondition.Quantum && (HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>()))
1994 dest = dest.
GetRandomPoint(2, requireLos:
false, allowChara:
false, allowBlocked:
false, 200);
1995 if (dest ==
null || dest.Equals(
pos) || !dest.IsValid || !
CanDuplicate(con))
1997 Say(
"split_fail",
this);
2002 if (inheritHostility)
2017 if (
item.Key != 1275)
2019 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
2020 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
2023 chara.SetFaith(
faith);
2024 chara.bio = IO.DeepCopy(
bio);
2026 chara.c_daysWithGod = base.c_daysWithGod;
2027 chara.RefreshFaithElement();
2028 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
2029 chara.isCopy =
true;
2030 chara.isScaled = base.isScaled;
2031 chara.c_altName = base.c_altName;
2035 chara.pccData = IO.DeepCopy(
pccData);
2046 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
2055 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
2065 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
2081 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
2087 long num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
2115 info?.AddText(
"rideSpeed".lang(
_Speed.ToString() ??
""));
2117 else if (
host !=
null)
2146 info?.AddText(
_Speed - speed,
"parasiteSpeed".lang());
2158 num3 = 50 + Mathf.Clamp((
int)Mathf.Sqrt(num4) * 5 -
EClass.
_zone.
DangerLv / 50, (num5 > 0) ? 50 : ((base.IsPowerful ||
IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((
int)Mathf.Sqrt(num4), 0, 25);
2159 if (info !=
null && num3 != 100)
2186 num3 -= (
IsPC ? 50 : 100);
2226 num3 += EClass.player.lastEmptyAlly *
Evalue(1646);
2231 num3 += EClass.player.lastEmptyAlly * 10 - 10;
2237 num3 +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
2238 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
2240 if (HasCondition<ConGravity>())
2243 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
2253 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
2264 if (value.
source.category ==
"skill")
2311 base.ApplyEditorTags(tag);
2319 Debug.LogWarning(
"Chara " +
id +
" not found");
2328 if (!
id.StartsWith(
"ele"))
2337 if (base.c_idMainElement != 0)
2339 SetElements(base.c_idMainElement,
remove:
true);
2340 base.c_idMainElement = 0;
2345 SetElements(
id,
remove:
false);
2346 base.c_idMainElement =
id;
2349 base.isElemental =
true;
2352 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);
2356 void SetElements(
int idEle,
bool remove)
2416 base.c_idJob = idNew;
2444 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2448 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
2469 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
2478 string[] array =
race.figure.Split(
'|');
2479 foreach (
string s
in array)
2492 string[] array =
race.figure.Split(
'|');
2493 foreach (
string s
in array)
2518 bool flag =
id ==
"chara" ||
id ==
"player";
2519 if (
race.id ==
"bike" &&
id !=
"bike_cub")
2536 base.c_idRace = idNew;
2552 Debug.Log(
"Creating Replacement NPC for:" +
this);
2582 base.c_summonDuration = 0;
2583 base.isSummon =
false;
2604 owner?.
Say(
"summon_vanish",
this);
2616 base.c_uidMaster = _master.
uid;
2617 base.c_minionType = type;
2624 base.c_uidMaster = 0;
2629 if (chara.
enemy ==
this)
2641 List<Chara> list =
new List<Chara>();
2667 public void SetSummon(
int duration,
bool dropCorpse =
false)
2669 base.c_summonDuration = duration;
2670 base.isSummon =
true;
2721 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2740 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2749 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2756 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2765 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2791 if (detail !=
null && detail.
charas.Count > 0)
2826 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2836 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2841 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2848 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2853 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2884 List<Point> list =
new List<Point>();
2932 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2941 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2950 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2959 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2974 if (!condition.
TryMove(newPoint))
2979 if (base.isRestrained)
2985 base.isRestrained =
false;
2987 if (!
CanMoveTo(newPoint, allowDestroyPath))
2991 return _Move(newPoint);
3042 EClass.player.lastZonePos =
null;
3045 for (
int i = 0; i < num2 * 4; i++)
3056 EClass.player.regionMoveWarned =
true;
3057 Msg.
Say(
"regionAbortMove");
3068 AddCondition<ConSuffocation>((
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
3070 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
3077 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
3080 EClass.player.regionMoveWarned =
false;
3088 num = EClass.setting.defaultActPace * 3f;
3116 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
3118 newPoint = randomNeighbor;
3126 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
3131 if (effect !=
null && effect.
id == 7)
3136 Say(
"abWeb_caught",
this);
3138 effect2.power = effect2.power * 3 / 4;
3142 Say(
"abWeb_pass",
this);
3147 EClass.player.renderExtraTime = 0f;
3152 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
3161 if (
item.mimicry !=
null &&
item.IsHostile(
this))
3163 if (
item.mimicry.ShouldRevealOnPush)
3165 item.mimicry.Reveal(
this, surprise:
true);
3181 traitDoor.TryOpenLock(
this);
3191 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
3194 bool flag5 = cell.IsTopWater && !cell.
isFloating;
3224 string text = ((flag3 || flag5) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
3225 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
3227 text = cell.
matObj.soundFoot;
3239 if (!text.IsEmpty())
3241 SoundManager.altLastData =
IsPC;
3248 bool flag6 = scene.actionMode.gameSpeed > 1f;
3249 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
3250 scene.psFoot.startColor = row.
matColor;
3254 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
3278 Say(
"replace_pc", chara, chara2);
3289 traitDoor2.TryOpen(
this);
3328 if ((dataPick.
noRotten && item2.
IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3345 foreach (
int cat
in dataPick.
cats)
3353 else if (!dataPick.
flag.HasFlag(containerFlag))
3395 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3412 EClass.player.flags.isShoesOff =
false;
3419 EClass.player.flags.isShoesOff =
true;
3449 AddExp(Mathf.Clamp((
int)Mathf.Sqrt(base.ExpToNext / 100), 1, 1000));
3469 EClass._map.MineBlock(_p, recoverBlock: false, this);
3472 EClass._map.MineObj(_p, null, this);
3478 EClass._map.MineObj(_p, null, this);
3485 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3491 t.SetPlaceState(PlaceState.roaming);
3507 if (list.Count == 0)
3511 list.ForeachReverse(delegate(
Chara c)
3515 List<Point> list2 = new List<Point>();
3516 for (int i = point.x - 1; i <= point.x + 1; i++)
3518 for (int j = point.z - 1; j <= point.z + 1; j++)
3520 if (i != point.x || j != point.z)
3522 Point point2 = new Point(i, j);
3523 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3530 if (list2.Count > 0)
3532 if (list2.Count > 1)
3534 list2.ForeachReverse(delegate(Point p)
3536 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3542 Point newPoint = list2.RandomItem();
3545 Say(
"displace",
this, c);
3555 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3557 Say(
"pushed_money",
this, c);
3622 if (z == currentZone)
3631 state = ZoneTransition.EnterState.Return
3634 if (HasCondition<ConInvulnerable>())
3636 RemoveCondition<ConInvulnerable>();
3640 EClass.player.nextZone = z;
3648 EClass.player.returnInfo.turns += 5;
3655 EClass.player.deathZoneMove =
false;
3657 currentZone.events.OnLeaveZone();
3658 if (currentZone.instance !=
null)
3672 EClass.player.uidLastZone = currentZone.uid;
3675 if (currentZone.IsRegion)
3683 Msg.
Say(
"leaveZone", currentZone.Name);
3685 else if (z.
id != currentZone.id)
3689 EClass.player.lastZonePos = pos.Copy();
3691 EClass.player.lastTransition = transition;
3713 if (party !=
null && party.
leader ==
this)
3725 Debug.Log(base.Name);
3728 transition.uidLastZone = currentZone?.uid ?? 0;
3729 global.transition = transition;
3733 global.transition =
null;
3736 EClass.player.lastTransition =
null;
3739 if (IsBranchMember())
3750 public void MoveHome(
string id,
int x = -1,
int z = -1)
3765 CureCondition<ConSuspend>();
3792 orgPos =
new Point(x, z);
3793 if (factionBranch !=
null)
3795 RefreshWorkElements();
3807 state = ZoneTransition.EnterState.Fall,
3817 renderer.RefreshSprite();
3820 public override void Rotate(
bool reverse =
false)
3822 if (renderer.hasActor)
3824 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3828 base.dir = ((base.dir == 0) ? 1 : 0);
3831 renderer.RefreshSprite();
3841 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3844 if (angle > 100f && angle < 170f)
3848 else if (angle > 170f && angle < 190f)
3852 else if (angle > 190f || (angle < -10f && angle > -100f))
3862 else if (angle > 170f && angle < 235f)
3866 else if (angle > 80f && angle < 145f)
3870 else if (angle > -100f && angle < -35f)
3874 else if (angle > -10f && angle < 55f)
3878 renderer.RefreshSprite();
3889 else if (base.dir == 1)
3893 else if (base.dir == 2)
3897 else if (base.dir == 3)
3902 else if (base.dir == 0)
3906 else if (base.dir == 1)
3910 else if (base.dir == 2)
3914 else if (base.dir == 3)
3923 if (!renderer.hasActor)
3925 if (angle == 0f || angle == 45f || angle == 90f)
3929 if (angle == -135f || angle == 180f || angle == -90f)
3939 return renderer.actor.currentDir;
3945 for (
int i = -num; i < num + 1; i++)
3947 for (
int j = -num; j < num + 1; j++)
3949 shared.
Set(pos.x + i, pos.z + j);
3960 for (
int num = conditions.Count - 1; num >= 0; num--)
3962 if (conditions[num].ConsumeTurn)
3972 if (_cooldowns !=
null)
3977 consumeTurn =
false;
3978 preventRegen =
false;
3979 emoIcon =
Emo2.none;
3982 base.c_summonDuration--;
3983 if (base.c_summonDuration <= 0)
3991 AddCondition<ConWet>(20);
3996 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
4001 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
4016 if (parasite !=
null)
4029 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
4046 AddCondition<ConBurning>(1000, force:
true);
4050 if (HasElement(1250))
4052 if (!HasCondition<ConVampire>())
4054 AddCondition<ConVampire>();
4056 if (!IsPC && !HasCooldown(8793))
4059 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.
HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
4066 UseAbility(
"SpTransmuteBat",
this);
4070 if (HasElement(1423) && !HasCondition<ConPeaky>())
4072 AddCondition<ConPeaky>();
4076 if (turn % 200 == 0)
4078 DiminishTempElements();
4090 preventRegen =
true;
4094 Say(
"dmgBurden",
this);
4095 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
4107 ModExp(207, 1 + phase2 * phase2);
4135 preventRegen =
true;
4139 if (
EClass.
rnd(100) == 0 && !isConfused)
4142 AddCondition<ConConfuse>(500);
4147 AddCondition<ConBlind>(200);
4150 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
4158 int num2 = Evalue(409);
4159 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
4164 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
4166 if (num3 < conditions.Count)
4181 preventRegen =
true;
4196 case "cocoon_alien":
4206 if (elements.Base(79) >= 30)
4210 elements.SetTo(79, elements.Base(79) * 3 / 4);
4217 if (pos.IsBlocked && pos.HasBlock)
4219 preventRegen =
true;
4225 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
4227 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
4228 elements.ModExp(300, 8f);
4233 elements.ModExp(301, 8f);
4246 else if (stamina.
value < stamina.
max)
4262 if (parasite !=
null)
4274 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
4285 ignoreSPAbsorb =
false;
4288 if (hasMovedThisTurn)
4290 pos.Things.ForeachReverse(delegate(
Thing t)
4294 AI_Goto aI_Goto = ai.Current as AI_Goto;
4295 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4306 hasMovedThisTurn =
false;
4309 EClass.player.haltMove =
false;
4343 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4354 if (!tileInfo.
shore)
4359 int num2 = (tileInfo.isRoad ? 22 : 12);
4362 num2 = (tileInfo.isRoad ? 16 : 10);
4366 num2 *= (flag2 ? 2 : 20);
4377 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
4390 EClass.player.pickupDelay = 0f;
4398 EClass.player.returnInfo =
null;
4421 Msg.
Say(
"returnComplete");
4422 EClass.player.uidLastTravelZone = 0;
4424 EClass.player.lastZonePos =
null;
4426 EClass.player.returnInfo =
null;
4429 EClass.player.returnInfo =
null;
4430 Msg.
Say(
"returnOverweight");
4434 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
4442 RecipeUpdater.dirty =
true;
4448 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
4449 hasMovedThisTurn =
false;
4452 if (!IsAliveInCurrentZone)
4456 renderer.RefreshStateIcon();
4457 if (host !=
null && !consumeTurn)
4459 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
4465 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
4467 Say(
"parasite_fail",
this, host);
4468 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
4470 Talk(
"parasite_fail");
4485 if (base.isRestrained)
4506 Cell cell2 = base.Cell;
4509 AddCondition<ConWet>(50);
4510 if (pos.IsHotSpring)
4517 AddCondition<ConBurning>();
4521 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
4524 if (cell2.
effect !=
null)
4537 AddCondition<ConWet>(50);
4541 PlaySound(
"fire_step");
4542 AddCondition<ConBurning>(30);
4547 PlaySound(
"bubble");
4548 AddCondition<ConWet>(30);
4553 if (hasMovedThisTurn)
4555 Say(
"abMistOfDarkness_step",
this);
4557 AddCondition<ConDark>(e.
power);
4579 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4609 if (rootCard !=
this && things.IsFull(c.
Thing))
4616 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
4626 if (things.GetDest(t).IsValid)
4647 t = TryPoisonPotion(t);
4655 Say(
"backpack_full_drop", t);
4662 Say(
"backpack_full", t);
4666 if (dest.
stack !=
null)
4670 PlaySound(
"pick_thing");
4671 Say(
"pick_thing",
this, t);
4679 PlaySound(
"pick_thing");
4680 Say(
"pick_thing",
this, t);
4682 TryReservePickupTutorial(t);
4692 Say(
"poisonDrip",
this);
4706 Say(
"absorbRod",
this, t);
4709 if (
rod.source !=
null)
4712 if (enumerator.MoveNext())
4744 if (t.
id ==
"pasture")
4756 foreach (
Card item in pos.ListCards())
4761 if (thing !=
null && !IsPC)
4763 thing.isNPCProperty =
true;
4808 t.isNPCProperty =
false;
4812 pos.TryWitnessCrime(
this);
4822 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4826 if (num == -1 || num > t.
Num)
4837 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4852 WidgetHotbar.dirtyCurrentItem =
true;
4863 if (IsPC && held.
invY == 1)
4865 WidgetHotbar.dirtyCurrentItem =
true;
4877 Say(
"canOnlyCarry", held);
4882 if (!flag && things.IsOverflowing())
4886 Say(
"backpack_full_drop", held);
4894 PlaySound(
"pick_thing");
4895 Say(
"pick_held",
this,
card);
4896 if (IsPC &&
card.id ==
"statue_weird")
4903 WidgetHotbar.dirtyCurrentItem =
true;
4918 return held.
Split(a);
4941 WidgetHotbar.dirtyCurrentItem =
true;
4946 if (
card.trait.CanOnlyCarry)
4957 Msg.
Say(
"markedImportant");
4972 t.ignoreAutoPick =
true;
4983 int num = Evalue(131);
4984 int num2 = Evalue(130);
4985 int num3 = Evalue(123);
4986 if (num > num2 && num > num3)
4990 if (num2 > num && num2 > num3)
4994 if (num3 > num && num3 > num2)
5008 if (elements.Value(122) > elements.Value(120))
5010 return elements.GetElement(122);
5012 return elements.GetElement(120);
5017 isOnCreate = onCreate;
5022 RestockInventory(onCreate);
5027 string equip = source.
equip;
5028 if (equip.IsEmpty())
5032 if (equip ==
"none")
5043 EQ_ID(
"staff_long", 1);
5051 EQ_ID(
"tail_snowleopard");
5057 EQ_ID(
"sword_zephir");
5063 EQ_ID(
"sword", -1,
Rarity.Legendary);
5067 EQ_ID(
"dagger", -1,
Rarity.Legendary);
5070 case "adv_mesherada":
5073 EQ_ID(
"dagger_hathaway");
5079 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
5083 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
5089 EQ_ID(
"sword_muramasa");
5095 EQ_ID(
"dagger_gaki");
5099 EQ_ID(
"dagger_ninto");
5103 EQ_ID(
"dagger", -1,
Rarity.Legendary);
5109 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
5118 EQ_ID(
"lightsaber_double", -1,
Rarity.Mythical);
5121 EQ_ID(
"cloak_mani2");
5123 AddThing(
"gun_gravity2");
5124 AddThing(
"gun_mani");
5130 AddThing(
"gun_gravity2");
5136 AddThing(
"bow_vindale");
5142 EQ_ID(
"martial_ring");
5148 EQ_ID(
"EtherDagger2");
5151 case "keeper_garden":
5154 EQ_ID(
"sword_ragnarok");
5160 EQ_ID(
"axe_destruction");
5166 EQ_ID(
"ribbon_duponne");
5172 EQ_ID(
"helm_seeker");
5175 EQ_ID(
"sword_katana");
5177 EQ_ID(
"sword_katana");
5180 EQ_ID(
"boots_seven");
5184 for (
int i = 0; i < 20; i++)
5189 AddThing(
"plat").SetNum(6);
5195 AddThing(
"guitar_efrond");
5201 AddThing(
"guitar_ash");
5207 EQ_ID(
"EtherDagger");
5215 thing.rarity =
Rarity.Normal;
5227 EQ_ID(
"staff_magius");
5233 EQ_ID(
"staff_insanity");
5239 EQ_ID(
"sword_katana");
5242 case "samurai_kamikaze":
5245 EQ_ID(
"sword_katana");
5251 EQ_ID(
"staff_leek");
5257 EQ_ID(
"dagger_hocho");
5268 if (!TryEquipRanged())
5275 AddThing(
"gun_laser");
5278 case "sister_catmaton":
5283 Thing thing2 = AddThing(
"panzerfaust");
5292 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
5302 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
5307 if (race.
id ==
"asura")
5309 for (
int j = 0; j < 4; j++)
5311 EQ_CAT(job.
weapon.RandomItem());
5314 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : Mathf.Min(2 + base.LV / 30, 20)); k++)
5322 else if (!job.
weapon.IsEmpty())
5326 EQ_CAT(job.
weapon.RandomItem());
5328 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
5330 EQ_CAT(job.
weapon.RandomItem());
5373 EQ_ID(
"shield_lute");
5376 if (HasTag(
CTAG.shield))
5387 if (ShouldRestock(
"_meat"))
5393 Restock(
"book_story", 1);
5395 case "rock_thrower":
5403 Restock(
"book_story_home", 1);
5408 void Restock(
string id,
int num)
5410 if (ShouldRestock(
id))
5415 bool ShouldRestock(
string id)
5417 return things.Find(
id) ==
null;
5425 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5426 Rarity rarity2 = base.rarity;
5427 if (
id ==
"big_sister")
5429 num = (isOnCreate ? 8 : 4);
5437 rarity =
Rarity.Superior;
5439 else if (rarity2 ==
Rarity.Legendary)
5443 else if (rarity2 >=
Rarity.Mythical)
5449 rarity =
Rarity.Legendary;
5451 CardBlueprint.current.rarity = rarity;
5459 CardBlueprint.current.rarity = r;
5462 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
5467 if (!body.
Equip(thing))
5478 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
5483 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
5519 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType !=
FactionMemberType.Default))
5523 Msg.
Say(
"returnHome",
this, homeZone.Name);
5540 base.hp = MaxHP / 3;
5543 if (hunger.
value > 30)
5547 sleepiness.value = 0;
5548 hostility = OriginalHostility;
5549 RemoveCondition<StanceTaunt>();
5550 if (
id ==
"keeper_garden")
5558 Msg.
Say(
"noDeathPenalty2",
this);
5562 Msg.
Say(
"noDeathPenalty",
this);
5568 List<Thing> dropList =
new List<Thing>();
5573 t.ignoreAutoPick = true;
5576 }, onlyAccessible:
false);
5582 EClass.player.preventDeathPenalty =
false;
5584 if (IsPCFaction && homeBranch !=
null)
5586 homeBranch.
Log(
"bRevive",
this);
5599 PlayEffect(
"revive");
5601 SetCensored(enable:
false);
5607 ModCorruption(-100000);
5608 if (base.LV < 10000000)
5610 SetLv(base.LV * 10 + 9);
5614 mana.value = mana.
max;
5615 stamina.value = stamina.
max;
5623 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
5626 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
5630 if (!lastword.IsEmpty())
5632 thing.c_note = lastword;
5634 thing.isModified =
true;
5680 if (HasCondition<ConAnorexia>())
5686 else if (base.c_vomit > 10)
5688 AddCondition<ConAnorexia>();
5690 AddCondition<ConDim>();
5691 if (HasCondition<ConAnorexia>())
5712 if ((uint)(attackSource - 17) > 1u)
5714 AddCondition<ConFaint>(200, force:
true);
5719 bool isInActiveZone = IsInActiveZone;
5722 if (
id ==
"putty" && origin !=
null && origin.IsPCParty)
5730 if (base.isSummon && !GetBool(136))
5732 if (
id ==
"tsunami")
5734 pos.PlaySound(
"water");
5738 Say(
"summon_vanish",
this);
5739 pos.PlayEffect(
"vanish");
5740 pos.PlaySound(
"vanish");
5745 if ((uint)(attackSource - 17) <= 1u)
5755 PlayEffect(
"revive");
5756 PlaySound(
"chime_angel");
5763 PlaySound(base.material.GetSoundDead(source));
5765 renderer.RefreshSprite();
5766 renderer.RefreshStateIcon();
5775 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
5778 text =
"dead_" + attackSource;
5784 text =
"dead_" + e.
source.alias;
5793 EClass.player.staminaRecovery = 0;
5794 EClass._zone.isDeathLocation =
true;
5795 string s = ((origin ==
null) ? text :
"dead_by");
5807 AI_PlayMusic.keepPlaying =
false;
5813 Msg.
Say(
"goto_heaven",
this);
5817 if (originalTarget !=
null || origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
5819 Msg.
Say(text,
this,
"", text2);
5821 string text3 = TalkTopic(
"dead");
5822 if (!text3.IsEmpty())
5824 text3 = text3.StripBrackets();
5826 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5841 if (homeBranch !=
null)
5843 homeBranch.
Log(text,
this,
"");
5855 if (
id ==
"mandrake" || HasElement(488))
5857 Say(
"a_scream",
this);
5862 ClearTempElements();
5865 base.isSale =
false;
5877 EClass.player.returnInfo =
null;
5878 EClass.player.uidLastTravelZone = 0;
5887 chara3.enemy =
null;
5892 EClass.player.preventDeathPenalty =
true;
5897 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5906 currentZone.RemoveCard(
this);
5908 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5911 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5915 ModAffinity(
EClass.
pc, a, show:
false);
5917 if (!(text4 ==
"quru"))
5919 if (text4 ==
"corgon")
5931 if (origin.IsPCParty || origin.IsPCPartyMinion)
5938 else if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5942 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5949 num = num * 30 / 100;
5960 else if (origin.IsPCFaction)
5962 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5963 origin.Chara.ShowEmo(
Emo.love);
5966 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5970 if (base.IsPCFactionOrMinion)
5974 Msg.
Say(
"abort_allyDead");
5979 Msg.
Say(
"abort_enemyDead");
5981 if (IsPCParty && !IsPC)
5984 base.c_wasInPcParty =
true;
5990 if (attackSource !=
AttackSource.Euthanasia && !IsPCFaction)
5992 EClass.player.flags.little_killed =
true;
6006 case "shark_sister":
6015 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
6019 if (chara2.
LV < base.LV)
6021 chara2.
SetLv(base.LV);
6023 chara2.
MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara,
MinionType.Friend);
6024 Msg.
Say(
"plant_pop",
this, chara2);
6033 if (IsPCFaction || IsPCFactionMinion)
6040 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
6046 flag = (flag2 =
true);
6047 EClass._zone.Boss =
null;
6052 EClass.player.flags.KilledBossInVoid =
true;
6058 SE.Play(
"Jingle/fanfare2");
6068 flag = (flag2 =
true);
6078 flag = (flag2 =
true);
6090 flag = (flag2 =
true);
6095 EClass.player.flags.killedDuponne =
true;
6101 flag = (flag2 =
true);
6107 case "melilith_boss":
6109 flag = (flag2 =
true);
6116 if (questCurry !=
null)
6119 flag = (flag2 =
true);
6129 bool num2 =
EClass.
_map.
FindChara((
id ==
"fairy_raina") ?
"fairy_poina" :
"fairy_raina") ==
null;
6131 if (num2 && questNasu !=
null && questNasu.
phase <= 1)
6133 if (questNasu.
phase == 0)
6138 flag = (flag2 =
true);
6149 flag = (flag2 =
true);
6151 if (questExploration !=
null)
6153 SE.Play(
"kill_boss");
6163 SE.Play(
"kill_boss");
6164 SoundManager.ForceBGM();
6170 SE.Play(
"kill_boss");
6184 EClass.player.willAutoSave =
true;
6199 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
6204 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
6209 if (HasCooldown(a.
id))
6217 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422) && !IsPC)
6219 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
6220 int num = list.IndexOf(a.
id);
6223 int num2 = list.TryGet(num + Evalue(1422));
6224 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
6233 bool flag2 = ability.
Has(a.
id);
6234 if (IsPC && HasCondition<StanceManaCost>())
6236 num4 = Evalue(1657);
6248 ForeachEnemy(delegate
6255 ForeachParty(delegate
6271 num5 = (IsPC ? (n * 100) : (50 + n * 50));
6273 int num6 = cost.cost * num5 / 100;
6276 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
6286 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
6295 ActPlan.warning =
true;
6298 EClass.scene.mouseTarget.card = cardBk;
6299 if (UseAbility(a, tc, pos, pt))
6308 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))
6310 Say(
"shakeHead",
this);
6313 if (tc !=
null && tc !=
this)
6317 if (pos !=
null && !base.pos.Equals(pos))
6323 num3 = 1 + Evalue(1648);
6325 if (IsPC && cost.
cost > 0 && a.
Value == 0 && !flag2)
6332 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
6333 if (!a.
source.tag.Contains(
"useHand"))
6335 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
6346 if (num4 > 0 && (a.
vPotential >= n * 2 || flag2))
6350 a.vPotential -= n * 2;
6352 num6 = num6 * (100 - num4 * 20) / 100;
6369 if (a.
source.langAct.Length != 0 && tc !=
null)
6371 string text = a.
source.langAct[0];
6372 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
6373 if (text ==
"spell_hand")
6376 string @ref = text2.lang(list2[4]);
6377 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6381 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
6385 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
6392 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6405 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6409 int value = stamina.
value;
6411 if (IsPC && a.
HasTag(
"recovery"))
6413 EClass.player.staminaRecovery += value - stamina.
value;
6415 ignoreSPAbsorb =
true;
6419 if (a is
Spell && GetCondition<ConSilence>() !=
null)
6421 Say(
"cast_silence",
this);
6428 int spellExp = elements.GetSpellExp(
this, a, num5);
6431 Say(
"fizzle",
this);
6432 PlayEffect(
"fizzle");
6433 PlaySound(
"fizzle");
6436 ModExp(a.
id, spellExp / 5);
6438 RemoveCondition<ConInvisibility>();
6442 if (a.
source.cooldown > 0 && (!IsPC || !a.
source.tag.Contains(
"CD_npc")))
6444 AddCooldown(a.
id, a.
source.cooldown);
6446 if (HasTalk(
"phrase_" + a.
source.alias))
6448 EClass.player.forceTalk =
true;
6449 Talk(
"phrase_" + a.
source.alias);
6456 ForeachEnemy(delegate(
Chara c)
6463 ForeachParty(delegate(
Chara c)
6468 Act.forcePt =
false;
6472 for (
int num7 = 0; num7 < num3; num7++)
6478 ActEffect.RapidCount = num7;
6480 flag3 = a.
Perform(
this, tc, pos);
6483 if (flag3 && !isDead)
6487 elements.ModBase(a.
id, 1);
6491 ModExp(a.
id, spellExp);
6494 ActEffect.RapidCount = 0;
6495 if (flag3 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
6497 RemoveCondition<ConInvisibility>();
6498 RemoveCondition<ConDark>();
6500 if (!base.IsPCFactionOrMinion && a.
HasTag(
"specialAbility") && renderer.isSynced)
6502 string name = a.
Name;
6503 renderer.Say(
"| " + name +
" ");
6506 void ForeachEnemy(Action<Chara> action)
6508 if (_pts.Count == 0)
6513 if (chara !=
this && CanSeeLos(chara) && chara.
IsHostile(
this))
6519 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
6524 void ForeachParty(Action<Chara> action)
6526 if (_pts.Count == 0)
6533 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
6544 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
6551 int num10 = _pts.IndexOf(
this);
6554 _pts.RemoveAt(num10);
6555 _pts.Insert(0,
this);
6557 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
6559 action(_pts[num11]);
6568 return 25 + Evalue(226) * 125 / 100;
6584 if (host.
ride ==
this)
6586 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
6590 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
6595 int num3 = Evalue(304);
6598 num3 = Mathf.Max(num3, base.LV + 5);
6602 bool num6 = GetArmorSkill() == 122;
6606 num4 = 20 - Evalue(122) / 5;
6607 num5 += 10 - Evalue(1654) * 4;
6611 num4 = 10 - Evalue(120) / 5;
6621 if (parasite !=
null)
6632 num5 += 20 - Evalue(1654) * 8;
6638 if (HasCondition<ConDim>())
6640 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6650 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6653 public void DoAI(
int wait, Action onPerform)
6668 Say(headpat ?
"headpat" :
"cuddle",
this, c);
6674 if (headpat &&
this != c)
6685 if (!member.
IsPC && CanSeeLos(member))
6695 if (c.
id ==
"hedgehog_ether")
6699 Say(
"reflect_thorne",
this, c);
6706 EClass.player.forceTalk =
true;
6707 Talk(
"kiss",
null,
null, IsPC);
6709 renderer.PlayAnime(
AnimeID.Kiss, c);
6712 if (num > 0 &&
EClass.
rnd(IsPC ? 100 : 5000) == 0)
6716 if (IsPC &&
this != c)
6728 Effect.
Get(
"love").
_Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.
pos);
6733 if (
id ==
"olderyoungersister")
6738 Say(
"slap",
this, c);
6775 if (enemy ==
null && !IsPC)
6777 if (GetInt(106) == 0)
6781 if (OriginalHostility !=
Hostility.Enemy)
6785 SetEnemy(_tg.
Chara);
6799 if (_tg ==
null || !_tg.
isChara)
6806 EClass.pc.combatCount = 10;
6814 chara.
Say(
"frown",
this, chara);
6826 chara.
Say(
"frown",
this, chara);
6833 bool flag = chara.id ==
"fanatic";
6836 chara.
Say(
"callHelp", chara);
6908 if (mimicry !=
null && mimicry.
IsThing)
6912 if (!base.IsPCFactionOrMinion && OriginalHostility ==
Hostility.Neutral && !(trait is
TraitGuard) &&
id !=
"unicorn")
6916 bool flag = enemy !=
null || ai is
GoalCombat;
6917 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6919 bool flag3 = !IsPCParty;
6925 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry !=
null && chara2.
mimicry.
IsThing))
6929 int num3 = Dist(chara2);
6930 int num4 = GetSightRadius() + (flag ? 1 : 0);
6937 if (
this == pos.FirstChara)
6939 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6947 DoHostileAction(chara2);
6960 DoHostileAction(chara);
6972 if (chara !=
this && chara != enemy && (chara.
mimicry ==
null || !chara.
mimicry.
IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
6974 DoHostileAction(chara);
6993 if (base.IsPCFactionOrMinion)
7006 if (OriginalHostility >=
Hostility.Friend)
7022 if (
id ==
"unicorn" && (Evalue(418) < 0 || (c.
HasElement(1216) && c.
Evalue(418) < 1)))
7055 return EClass.game.activeZone == currentZone;
7062 foreach (
Point item2
in item.ListPoints())
7064 if (pos.Equals(item2))
7085 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
7105 base.idSkin = (EClass.core.config.game.antiSpider ? source.skinAntiSpider : 0);
7109 charaRenderer.pccData = PCCData.Create(
"ride");
7110 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
7111 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
7112 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
7116 foreach (
Condition condition
in conditions)
7119 if (rendererReplacer !=
null)
7121 charaRenderer.replacer = rendererReplacer;
7122 charaRenderer.data = rendererReplacer.
data;
7123 charaRenderer.pccData = rendererReplacer.
pccData;
7127 if (charaRenderer.
replacer ==
null)
7129 charaRenderer.pccData = pccData;
7132 renderer = charaRenderer;
7134 if (cardRenderer !=
null)
7136 renderer.SetFirst(first:
false, cardRenderer.
position);
7138 return charaRenderer;
7145 PCC.Get(pccData).Build(state);
7151 string str = GetStr(
"sprite_override");
7154 Sprite sprite = ModUtil.LoadSprite(str);
7162 PCC pCC = PCC.Get(pccData);
7164 return pCC.variation.idle[0, 0];
7167 return GetSpriteData(dir, snow)?.GetSprite() ?? sourceCard.
GetSprite(dir, SpriteSkin, snow);
7175 if (spriteReplacer?.data ==
null)
7179 return spriteReplacer.
GetData(dir, 0, snow,
this);
7202 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && (GetBool(123) || affinity.
CanSleepBeside()))
7211 p.mat = base.material;
7212 p.matColor = base.colorInt;
7213 if (!renderer.usePass)
7217 if (renderer.replacer !=
null)
7219 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
7220 if (renderer.replacer.mat != -1)
7224 p.color -= 1048576f;
7231 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7240 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
7243 else if (sourceCard.
_tiles.Length > 1)
7245 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7250 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
7254 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
7261 if (mimicry !=
null && mimicry.
IsThing)
7265 string text = ((mimicry !=
null && mimicry.Card !=
this) ? mimicry.
GetName(
NameStyle.Full) : base.Name);
7266 if (IsFriendOrAbove())
7270 else if (IsHostile())
7276 if (base.LV >= lV * 5)
7280 else if (base.LV >= lV * 2)
7284 else if (base.LV <= lV / 4)
7288 else if (base.LV <= lV / 2)
7294 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
7295 s = (
" (" + s.lang() +
") ").TagSize(14);
7299 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
7303 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
7309 text2 +=
"lowerGround".lang();
7311 else if (HasHigherGround(
EClass.
pc))
7313 text2 +=
"higherGround".lang();
7316 if (Evalue(1232) > 0)
7318 text2 =
"milkBaby".lang().TagSize(14) + text2;
7322 text2 =
"hasBounty".lang().TagSize(14) + text2;
7326 text2 += (
"(" + faith.Name +
")").TagSize(14);
7332 return text + text2 + s;
7337 if (mimicry !=
null && mimicry.
IsThing)
7344 text += Environment.NewLine;
7345 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
7350 text2 += Environment.NewLine;
7351 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
7352 text2 += Environment.NewLine;
7354 text2 += Environment.NewLine;
7355 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
7356 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.idSkin +
" scaled:" + base.
isScaled;
7360 text2 += Environment.NewLine;
7361 text2 +=
"<size=14>";
7364 text2 = text2 + item.Name +
", ";
7366 foreach (
Hobby item2
in ListHobbies())
7368 text2 = text2 + item2.Name +
", ";
7370 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
7373 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
7374 if (enumerable.Count() > 0)
7376 text3 += Environment.NewLine;
7377 text3 +=
"<size=14>";
7386 if (text4.IsEmpty() || text4 ==
"#")
7391 switch (item3.
source.group)
7404 text4 = text4 +
"(" + item3.
GetValue() +
")";
7405 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
7407 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
7411 text3 = text3 + text4.TagColor(c) +
", ";
7420 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
7425 text3 += Environment.NewLine;
7428 text3 = text3 + item4.act.Name +
", ";
7430 text3 = text3.TrimEnd(
", ".ToCharArray());
7432 return text + text2 + text3;
7438 string key = ((condition ==
null) ? source : condition.
chara.
source).idText.IsEmpty((condition ==
null) ? id : condition.
chara.
id);
7448 string text = row.GetText(topic, returnNull:
true);
7453 if (text.StartsWith(
"@"))
7460 text = row.GetText(topic, returnNull:
true);
7466 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7471 if (host ==
null && !IsInActiveZone)
7475 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
7481 int num = EClass.pc.party.members.Count - 1;
7506 string topicText = GetTopicText(topic);
7507 if (topicText.IsEmpty())
7511 HashSet<string> obj =
new HashSet<string>
7513 "_bracketTalk".lang(),
7518 bool flag = topicText.StartsWith(
"*");
7519 bool flag2 = topicText.StartsWith(
"(");
7520 bool flag3 = obj.Any(topicText.StartsWith);
7521 topicText = ApplyTone(topicText);
7522 topicText = topicText.Replace(
'~',
'*');
7524 Msg.
Say(StripTalkSpecialCharacters(topicText.Replace(
"&",
"")));
7525 if (topic ==
"dead")
7529 else if (flag || flag3 || flag2)
7531 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
7549 if (conSuspend !=
null && IsPCParty)
7551 RemoveCondition<ConSuspend>();
7555 if (IsDeadOrSleeping)
7557 ShowDialog(
"_chara",
"sleep");
7562 ShowDialog(
"_chara",
"invisible");
7568 ShowDialog(
"_chara",
"give_card");
7577 if (GetInt(71) == -2)
7579 ShowDialog(
"_chara",
"give_lunch");
7585 if (base.isRestrained)
7587 ShowDialog(
"_chara",
"strain");
7592 ShowDialog(
"_chara",
"escort");
7597 string step = ((!(EClass._zone is
Zone_Wedding)) ?
"party" : (IsPCParty ?
"wedding_love" : ((IsMarried || affinity.
IsWeddingHater) ?
"wedding_hater" :
"wedding")));
7600 step =
"wedding_cutter";
7602 base.c_love.gaveCutter =
true;
7604 ShowDialog(
"_chara", step);
7622 EClass.player.flags.loytelEscaped =
false;
7624 ShowDialog(
"loytel",
"loytelEscaped");
7628 if (questDebt !=
null && questDebt.
paid)
7631 if (questDebt.
stage > 7)
7633 questDebt.stage = 7;
7635 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
7643 ShowDialog(
"farris");
7649 ShowDialog(
"farris",
"nymelle_noQuest");
7652 ShowDialog(
"farris",
"nymelle_first");
7655 ShowDialog(
"farris",
"home_first");
7658 ShowDialog(
"farris");
7663 ShowDialog(
"ashland");
7668 SoundManager.ForceBGM();
7675 EClass.player.flags.fiamaFirstDream =
true;
7676 ShowDialog(
"fiama",
"firstDream");
7680 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
7682 EClass.player.flags.fiamaStoryBookGiven =
true;
7688 ShowDialog(
"fiama");
7693 ShowDialog(
"fiama");
7699 ShowDialog(
"big_sister",
"little_saved");
7700 EClass.player.flags.little_saved =
false;
7705 ShowDialog(
"big_sister",
"little_dead");
7706 EClass.player.flags.little_killed =
false;
7714 ShowDialog(
"guild_doorman",
"main", tag);
7720 ShowDialog(
"guild_clerk",
"main", tag2);
7729 string book =
"_chara";
7732 string text = GetStr(
"drama_override").IsEmpty(
id);
7733 if (File.Exists(PackageIterator.GetFiles(
"Dialog/Drama/" + text +
".xlsx").LastOrDefault()?.FullName ?? (
CorePath.
DramaData +
id +
".xlsx")))
7743 return _ShowDialog(
book,
null, step, tag);
7749 if (
book ==
"_chara" && IsPC)
7767 return base.LV / 2 + 4;
7773 if (FindBed() !=
null)
7782 return GetHappiness().ToString() ??
"";
7787 string result =
"?????";
7800 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
7810 sortVal = job._index * 10000 + sourceCard.
_index;
7813 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
7816 sortVal = -GetTotalFeat();
7822 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7829 sortVal -= 100000000;
7839 foreach (
Card item in map.props.installed.all)
7843 traitBed.RemoveHolder(
this);
7862 if (!IsPCFaction && !IsGuest())
7871 Msg.
Say(
"claimBed",
this);
7880 if (GetInt(113) != 0)
7885 Thing bestRangedWeapon = GetBestRangedWeapon();
7886 foreach (
Thing thing
in things)
7892 _ListItems.Add(thing);
7896 _ListItems.Add(thing);
7900 if (_ListItems.Count == 0)
7904 List<Thing> containers2 = containers.ToList();
7905 foreach (
Thing listItem
in _ListItems)
7930 bool flag = GetInt(113) == 0;
7939 foreach (
Thing thing3
in things)
7941 if (CanEat(thing3, shouldEat))
7957 if (thing3.
id ==
"polish_powder")
7971 foreach (
Thing container
in containers)
7981 if (num4 > 0 && thing4.
id ==
"polish_powder")
7983 _ListItems.Add(thing4);
7988 _ListItems.Add(thing4);
7993 _ListItems.Add(thing4);
7998 _ListItems.Add(thing4);
8001 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
8003 _ListItems.Add(thing4);
8008 _ListItems.Add(thing4);
8013 _ListItems.Add(thing4);
8018 if (_ListItems.Count == 0)
8022 _ListItems.ForeachReverse(delegate(
Thing t)
8027 int slot = t.category.slot;
8028 int equipValue = t.GetEquipValue();
8029 foreach (Thing listItem in _ListItems)
8031 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
8039 _ListItems.Remove(t);
8044 foreach (
Thing listItem2
in _ListItems)
8046 Thing thing = listItem2;
8047 if (things.IsFull(thing))
8056 thing = thing.
Split(1);
8059 else if (thing.
Num > 2)
8061 thing = thing.
Split(2);
8068 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
8070 TryEquip(thing, useFav:
true);
8076 TryPutSharedItems(containers);
8082 Thing result =
null;
8090 int num2 = CountNumEaten(
item);
8091 int num3 = 100 - num2 + (
item.HasElement(757) ? 10 : 0);
8105 t = FindBestFoodToEat();
8117 Say(
"eat_start",
this, t.Duplicate(1));
8140 if ((IsPC || (homeBranch !=
null && homeBranch.
GetCivility() >= 50)) && (t.
HasTag(
CTAG.dish_fail) || t.
id ==
"731"))
8155 if (!CanEquipRanged(t))
8160 foreach (
Thing thing
in things)
8181 if (bodySlot ==
null)
8187 switch (GetFavAttackStyle())
8226 if (!base.IsPCFactionOrMinion)
8231 if (value.
Value <= 0)
8248 num2 += value.Value * num3 / 100;
8265 if (!ShouldEquip(t, useFav))
8276 switch (GetFavAttackStyle())
8292 body.
Equip(t, slot);
8298 Say(
"equip",
this, t);
8314 return FindThrowable(hotbar:
true);
8318 things.Foreach(delegate(
Thing t)
8320 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
8326 Thing FindThrowable(
bool hotbar)
8328 things.Foreach(delegate(
Thing t)
8365 return things.Find((
Thing t) => ranged.
IsAmmo(t));
8370 Thing result =
null;
8372 foreach (
Thing thing
in things)
8392 ranged = GetRandomRangedWeapon();
8404 if (ranged !=
null && ranged.
parent ==
this)
8408 ranged = GetBestRangedWeapon();
8409 return ranged !=
null;
8414 if (body.
GetWeight(armorOnly:
true) <= (HasElement(1204) ? 6000 : 30000))
8439 if (t.
id ==
"cigar")
8449 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8451 SetAIImmediate(
new AI_Eat
8465 if (base.hp < MaxHP * 90 / 100)
8468 if (healAction !=
null)
8479 return FindBed()?.owner.pos.cell.room;
8494 if (!trait.CanChangeAffinity)
8499 if (IsPCFaction && homeBranch !=
null)
8501 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
8518 Say(
"affinityNone",
this, c);
8523 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
8527 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
8533 a = affinity.
Mod(a);
8540 int num = Evalue(289);
8552 num2 += (lV - num) * 10;
8554 elements.
ModExp(289, Mathf.Min(num2, 1000));
8570 chara.orgPos = orgPos.
Copy();
8572 chara.pos = pos.
Copy();
8573 chara.isImported =
true;
8574 chara.c_editorTags = base.c_editorTags;
8575 chara.c_editorTraitVal = base.c_editorTraitVal;
8576 chara.c_idTrait = base.c_idTrait;
8577 chara.homeZone = homeZone;
8585 content.RefreshCharaBio(
this);
8586 if (!content.favFood.IsEmpty() &&
EClass.
sources.
things.map.TryGetValue(content.favFood, out var value))
8591 string str = GetStr(72);
8596 if (_listFavFood.Count == 0)
8600 if (row._origin ==
"dish" && row.value != 0 && row.chance != 0)
8602 _listFavFood.Add(row);
8609 r = _listFavFood.RandomItem();
8618 content.RefreshCharaBio(
this);
8619 if (!content.favCategory.IsEmpty() &&
EClass.
sources.
categories.map.TryGetValue(content.favCategory, out var value) && value.gift > 0)
8624 string str = GetStr(73);
8630 if (_listFavCat.Count == 0)
8636 _listFavCat.Add(row);
8642 r = _listFavCat.RandomItem();
8649 if (base.c_love ==
null)
8656 SetFeat(1275, 1, msg:
true);
8662 if (base.c_love !=
null)
8664 base.c_love.dateMarriage = 0;
8665 base.c_love.dateWedding = 0;
8673 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(
this, 3, (
Chara c) => c !=
this && c.
race.id ==
"cat").GetEnumerator())
8675 if (enumerator.MoveNext())
8677 return enumerator.Current;
8685 Say(
"abCatSniff",
this, c);
8690 c.
Talk(
new string[4] {
"labor",
"disgust",
"scold",
"callGuards" }.RandomItem());
8696 if (base.c_upgrades !=
null)
8698 num += base.c_upgrades.spent;
8700 if (base.c_genes !=
null)
8702 num += base.c_genes.GetTotalCost();
8704 return num + base.feat;
8711 if (
item.act.id == 6630)
8721 string text = race.
id;
8722 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
8735 string str = GetStr(
"portrait_override");
8740 if (
id ==
"olderyoungersister")
8742 if (base.idSkin != 2)
8744 return "UN_olderyoungersister";
8746 return "UN_olderyoungersister_alt";
8752 return base.c_idPortrait;
8771 if (HasElement(1231))
8774 AddCondition<ConEuphoric>(100 * Evalue(1231));
8778 SetFeat(1231, 1, msg:
true);
8788 int num2 = ((!HasElement(1411)) ? 1 : 3);
8789 if (GetBurden(t, num) >= num2)
8802 if (!IsValidGiftWeight(t, num))
8819 if (things.IsFull())
8839 if (base.IsPowerful && t.
trait is
TraitScroll { source: not null } traitScroll && traitScroll.
source.abilityType.Contains(
"summon"))
8850 Msg.
Say(
"affinityNone", c,
this);
8856 int num2 = 200 + t.LV * 3;
8869 PlayEffect(
"identify");
8870 PlaySound(
"identify");
8872 c.
Say(
"draw_curse", c, t);
8874 List<Element> list =
new List<Element>();
8875 foreach (
Element value
in elements.dict.Values)
8882 if (list.Count == 0)
8884 SayNothingHappans();
8887 Element element = list.RandomItem();
8888 ModExp(element.
id, num2);
8889 Say(
"draw_curse2",
this, element.
Name);
8893 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
8895 GiveLovePotion(c, t);
8909 case "ticket_massage":
8916 case "ticket_armpillow":
8924 case "ticket_champagne":
8931 if (t.
id ==
"flyer")
8936 c.
Talk(
"flyer_miss");
8942 Msg.
Say(
"affinityNone", c,
this);
8944 elements.ModExp(291, 10f);
8947 elements.ModExp(291, 50f);
8949 if (t.
id ==
"statue_weird")
8974 Say(
"give_erohon",
this);
8975 AddCondition<ConParalyze>(50, force:
true);
8976 AddCondition<ConConfuse>(50, force:
true);
8977 AddCondition<ConFear>(1000, force:
true);
8985 c.
Say(
"give_love", c, t);
8995 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this)
9019 int num = Mathf.Max(chara.
Evalue(1649), (!flag2) ? 1 : 3);
9020 int num2 = Dist(chara);
9025 if (num2 > num || !chara.
CanSeeLos(pos, num2))
9031 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
9039 Say(
"intercept_loyal", chara,
this);
9042 if (num2 > num || !chara.
CanSeeLos(pos, num2))
9047 if (!flag && !HasElement(1225))
9049 Say(
"intercept", chara,
this);
9052 chara.
Talk(
"intercept", base.NameSimple);
9054 if (attacker.enemy ==
this)
9056 attacker.SetEnemy(chara);
9119 if (t.
id ==
"flyer")
9144 if (!things.IsAlmostFull())
9173 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
9175 Thing thing = things[num2];
9176 if (ShouldThrowAway(thing, type))
9187 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
9195 _ = base.c_upgrades;
9204 for (
int i = 0; i < 100; i++)
9210 if (base.c_upgrades ==
null)
9214 if (base.c_upgrades.halt)
9225 List<Element> list = ListAvailabeFeats(pet:
true);
9226 if (num >= 90 && list.Count > 0)
9228 Element element = list.RandomItem();
9232 else if (num >= 60 && ie.Any())
9234 num2 = ie.RandomItem().id;
9245 if (num4 > base.feat)
9250 base.c_upgrades.count++;
9251 base.c_upgrades.spent += num4;
9257 if (
item.idEle == num2)
9278 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
9280 else if (elements.ValueWithoutLink(row.
id) == 0)
9282 elements.Learn(row.
id);
9286 elements.ModBase(num2, num3);
9293 if (IsPC || base.isScaled || HasElement(1273))
9299 if (base.c_daysWithPC > 360)
9310 if (_cooldowns ==
null)
9312 _cooldowns =
new List<int>();
9316 _cooldowns.Add(idEle * 1000 + turns);
9322 _cooldowns.Add(idEle * 1000 + row.
cooldown);
9328 if (_cooldowns ==
null)
9330 _cooldowns =
new List<int>();
9333 for (
int i = 0; i < _cooldowns.Count; i++)
9335 if (_cooldowns[i] / 1000 == idEle)
9339 _cooldowns.RemoveAt(i);
9343 _cooldowns[i] = idEle * 1000 + turns;
9349 if (!flag && turns > 0)
9351 AddCooldown(idEle, turns);
9353 if (_cooldowns.Count == 0)
9361 return GetCooldown(idEle) != 0;
9366 if (_cooldowns !=
null)
9368 for (
int i = 0; i < _cooldowns.Count; i++)
9370 if (_cooldowns[i] / 1000 == idEle)
9372 return _cooldowns[i] % 1000;
9381 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
9383 if (_cooldowns[num] % 1000 == 1)
9385 _cooldowns.RemoveAt(num);
9392 if (_cooldowns.Count == 0)
9405 if (IsPCParty || base.noMove)
9410 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9413 if (goalFromTimeTable !=
null)
9415 SetAI(goalFromTimeTable);
9418 goalFromTimeTable.
Tick();
9423 if (goalList.
index == -2)
9425 goalList.
Refresh(
this, goalListType);
9427 SetAI(goalList.
Next());
9451 return GetGoalWork();
9457 return GetGoalHobby();
9492 if (_works ==
null || _hobbies ==
null)
9496 foreach (
int work
in _works)
9503 foreach (
int hobby
in _hobbies)
9524 return SetAI(_NoGoalPC);
9542 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
9546 if (HasCondition<ConWait>())
9548 RemoveCondition<ConWait>();
9554 renderer.RefreshStateIcon();
9561 bool hasNoGoal = HasNoGoal;
9596 listHobby.Add(
new Hobby
9607 foreach (
int work
in _works)
9609 listHobby.Add(
new Hobby
9623 if (_hobbies ==
null)
9627 foreach (
int hobby
in _hobbies)
9629 listHobby.Add(
new Hobby
9642 if (
item.source.alias ==
id)
9647 foreach (
Hobby item2
in ListHobbies())
9649 if (item2.
source.alias ==
id)
9659 if (workElements !=
null)
9663 workElements =
null;
9664 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
9672 foreach (
Hobby item2
in ListWorks())
9676 if (workElements !=
null)
9680 void TryAdd(
Hobby h)
9682 if (!h.
source.elements.IsEmpty())
9684 if (workElements ==
null)
9688 for (
int i = 0; i < h.
source.elements.Length; i += 2)
9690 int num = h.
source.elements[i];
9691 int num2 = h.
source.elements[i + 1];
9693 if (num != 2115 && num != 2207)
9701 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
9709 string text = (simple ?
"" : (
"hobby".lang() +
":"));
9714 return text.TrimEnd(
',');
9719 string text = (simple ?
"" : (
"work".lang() +
":"));
9724 return text.TrimEnd(
',');
9729 foreach (
int hobby
in _hobbies)
9741 foreach (
int work
in _works)
9753 if (_hobbies !=
null && _works !=
null)
9760 _hobbies =
new List<int>();
9761 _works =
new List<int>();
9769 string[] hobbies = source.
hobbies;
9770 foreach (
string text
in hobbies)
9777 ModUtil.LogModError(
"source chara row '" + source.
id +
"' has invalid hobby '" + text +
"'", source);
9780 if (source.
works.IsEmpty())
9786 string[] hobbies = source.
works;
9787 foreach (
string text2
in hobbies)
9794 ModUtil.LogModError(
"source chara row '" + source.
id +
"' has invalid work '" + text2 +
"'", source);
9797 GetWorkSummary().Reset();
9802 if (_workSummary ==
null)
9806 return _workSummary;
9819 if (workSummary.
work !=
null)
9824 else if (workSummary.
hobbies.Count > 0)
9845 hobby.id = session.
id;
9850 workSummary.progress +=
EClass.
rnd(5) + 5;
9852 int num = PerformWork(hobby, 0, isHobby);
9853 int num2 = PerformWork(hobby, 1, isHobby);
9854 int num3 = PerformWork(hobby, 2, isHobby);
9855 int num4 = PerformWork(hobby, 3, isHobby);
9856 workSummary.money += num;
9857 workSummary.food += num2;
9858 workSummary.knowledge += num3;
9859 workSummary.material += num4;
9860 int PerformWork(
Hobby work,
int idx,
bool flag)
9862 if (idx >= work.
source.resources.Length)
9866 int num5 = work.
source.resources[idx];
9868 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
9869 num5 = num5 * (flag ? 50 : 100) * session.
efficiency / 10000;
9870 if (num6 > 0 && num5 <= 0)
9880 _goalWork.
FindWork(
this, setAI:
false);
9896 foreach (
Condition condition
in conditions)
9898 condition.
SetOwner(
this, onDeserialize);
9904 return AddCondition(typeof(T).Name, p, force);
9909 return AddCondition(typeof(T).Name, p, p2, force);
9921 return AddCondition(condition, force);
9926 return AddCondition(c,
null, force);
9935 c.idGiver = giver.
uid;
9939 if (c is
ConBleed && ResistLv(964) >= 3)
9944 else if (ResistLv(950) >= 3)
9962 if (c.
source.negate.Length != 0)
9964 string[] negate = c.
source.negate;
9965 foreach (
string text
in negate)
9967 if (HasElement(text))
9974 if (defenseAttribute !=
null)
9978 if (c.
source.resistance.Length != 0)
9983 c.power /= num * num + 1;
9999 num2 = num2 * (100 + (int)Mathf.Sqrt(Evalue(494)) * 10) / 100;
10005 for (
int j = 0; j < conditions.Count; j++)
10007 if (conditions[j].
id != c.
id)
10013 conditions[j].Kill();
10016 if (conditions[j].CanStack(c))
10018 if (conditions[j].ShouldOverride(c))
10020 if (conditions[j].IsOverrideConditionMet(c, num2))
10022 conditions[j].Kill(silent:
true);
10027 if (CanGainConResist)
10031 conditions[j].OnStacked(c.
power);
10032 conditions[j].OnStartOrStack();
10033 conditions[j].PlayEffect();
10035 if (!conditions[j].AllowMultipleInstance)
10040 foreach (
Condition condition
in conditions)
10049 if (CanGainConResist)
10056 if (c.ShouldRefresh)
10068 if (c.SyncRide && (
ride !=
null || parasite !=
null))
10074 if (parasite !=
null)
10082 public override bool HasCondition<T>()
10084 for (
int i = 0; i < conditions.Count; i++)
10086 if (conditions[i] is T)
10096 for (
int i = 0; i < conditions.Count; i++)
10098 if (conditions[i].source.alias == alias)
10113 for (
int i = 0; i < conditions.Count; i++)
10117 return conBuffStats.elements.GetElement(ele);
10126 foreach (
Condition condition
in conditions)
10138 T condition = GetCondition<T>();
10139 if (condition !=
null)
10141 int value = condition.value - v;
10142 condition.value = value;
10143 if (condition.value <= 0)
10152 for (
int i = 0; i < conditions.Count; i++)
10154 if (conditions[i].source.alias == idCon)
10156 return conditions[i];
10162 public override T GetCondition<T>()
10164 for (
int i = 0; i < conditions.Count; i++)
10166 if (conditions[i] is T)
10168 return conditions[i] as T;
10176 for (
int num = conditions.Count - 1; num >= 0; num--)
10178 if (conditions[num] is T)
10180 conditions[num].
Kill();
10188 if (parasite !=
null)
10190 parasite.
Cure(type, p, state);
10194 ride.Cure(type, p, state);
10196 Cure(type, p, state);
10206 CureCondition<ConFear>();
10207 CureCondition<ConBlind>(2 * p / 100 + 5);
10208 CureCondition<ConPoison>(5 * p / 100 + 5);
10209 CureCondition<ConConfuse>(10 * p / 100 + 10);
10210 CureCondition<ConDim>(p / 100 + 5);
10211 CureCondition<ConBleed>(2 * p / 100 + 10);
10218 CureCondition<ConBlind>(5 * p / 100 + 15);
10219 CureCondition<ConPoison>(10 * p / 100 + 15);
10220 CureCondition<ConBleed>(5 * p / 100 + 20);
10221 CureTempElements(p, body:
true, mind:
false);
10224 CureCondition<ConFear>();
10225 CureCondition<ConDim>(3 * p / 100 + 10);
10226 CureTempElements(p, body:
false, mind:
true);
10230 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
10232 Condition condition2 = conditions[num2];
10237 condition2.
Mod(-1, force:
true);
10245 CureCondition<ConWait>();
10246 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
10247 bool flag2 = HasCondition<ConAnorexia>();
10248 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
10249 if (base.c_vomit < 0)
10254 RemoveCondition<ConAnorexia>();
10265 CureTempElements(p * 100, body:
true, mind:
true);
10266 for (
int num = conditions.Count - 1; num >= 0; num--)
10273 switch (condition.
Type)
10293 CureCondition<ConWait>();
10294 CureCondition<ConSleep>();
10301 RemoveCondition<ConBrightnessOfLife>();
10302 RemoveCondition<ConDeathSentense>();
10306 if (HasElement(1206))
10308 SetFeat(1206, 0, msg:
true);
10310 RemoveCondition<ConBrightnessOfLife>();
10311 RemoveCondition<ConDeathSentense>();
10325 for (
int num = conditions.Count - 1; num >= 0; num--)
10341 if (
TC.hp > (
long)
TC.MaxHP * (
long)(Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) + Evalue(1426) * 5) / (
TC.IsPowerful ? 200 : 100))
10345 if (
TC.HasElement(427))
10353 PlaySound(
"hit_finish");
10355 Say(
"finish2",
this,
TC);
10365 if (resistCon ==
null)
10367 resistCon =
new Dictionary<int, int>();
10369 if (resistCon.ContainsKey(key))
10371 resistCon[key] += con.power * con.GainResistFactor / 100;
10375 resistCon[key] = con.power * con.GainResistFactor / 100;
10382 if (con.
power > 0 && resistCon !=
null)
10384 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
10406 RemoveCondition<ConAwakening>();
10411 con.pcPillow = pillow;
10412 con.pickup = pickup;
10413 con.posBed = posBed;
10414 con.posPillow = posPillow;
10420 bool isSunLit = pos.IsSunLit;
10422 int num =
bed?.Power ?? 20;
10423 if (traitPillow !=
null)
10425 num += traitPillow.owner.Power / 2;
10429 num +=
bed.Evalue(750) * 5;
10435 OnSleep(num, days, isSunLit);
10438 public void OnSleep(
int power,
int days = 1,
bool isSunLit =
false)
10444 int num = power * days;
10445 if (stamina.
value < 0)
10461 if (isWeakToSunlight && isSunLit)
10464 if (mana.
value > 0)
10468 AddCondition<ConBurning>(1000, force:
true);
10473 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10490 if (!HasElement(450))
10492 long num = bio.height;
10493 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10498 if (num > 999999999)
10502 if (num != bio.height)
10504 bio.height = (int)num;
10505 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
10512 if (HasElement(450) || a == 0)
10516 long num = bio.weight;
10517 long num2 = bio.height;
10518 long num3 = num2 * num2 * 18 / 25000;
10519 long num4 = num2 * num2 * 24 / 10000;
10520 if (ignoreLimit || (num > num3 && num < num4))
10522 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10527 if (num > 999999999)
10531 if (num != bio.weight)
10533 bio.weight = (int)num;
10534 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
10543 if (Evalue(962) >= 25 || (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0))
10547 int num = Evalue(412);
10550 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
10551 a = (int)num2 + ((
EClass.
rndf(1f) < num2 % 1f) ? 1 : 0);
10558 int num3 = (corruption + a) / 100 - corruption / 100;
10559 for (
int i = 0; i < Mathf.Abs(num3); i++)
10561 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
10568 foreach (
Element value
in elements.dict.Values)
10570 if (value.
source.category ==
"ether")
10572 num4 += value.
Value;
10575 if (num4 > 0 && IsPC)
10579 corruption = num4 * 100 + corruption % 100;
10582 public List<Element>
ListAvailabeFeats(
bool pet =
false,
bool showAll =
false,
bool purchaseFeat =
false)
10584 List<Element> list =
new List<Element>();
10587 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
10588 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
10601 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
10603 Feat feat = elements.GetElement(
id) as
Feat;
10614 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
10622 CalculateMaxStamina();
10630 if (feat.
source.textInc.IsEmpty())
10632 PlaySound(
"ding_skill");
10634 Say(
"gainFeat",
this, feat.
FullName);
10638 bool flag = value < num;
10639 if (feat.
source.tag.Contains(
"neg"))
10648 PlaySound(
"chime_angel");
10654 PlaySound(
"chime_devil");
10658 PlaySound(
"mutation");
10662 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
10665 elements.CheckSkillActions();
10672 Element element = elements.GetElement(idEle);
10673 Element element2 = elements.GetElement(row2.
id);
10674 int num = element?.
Value ?? 0;
10683 bool flag = (row.
tag.Contains(
"neg") ? (a > num) : (a < num));
10684 if (a == 0 && (element ==
null || element.
Value == 0))
10686 SayNothingHappans();
10689 if (element !=
null && element.
Value == a)
10691 SayNothingHappans();
10694 if (element2 !=
null && element2.
Value > 0)
10696 SetFeat(element2.
id, 0);
10699 PlaySound(
"mutation");
10700 PlayEffect(
"mutation");
10702 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10707 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
10709 Say(
"resistMutation",
this);
10713 for (
int num = 0; num < tries; num++)
10716 if (num == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10722 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10723 if (base.c_corruptionHistory.Count == 0)
10725 base.c_corruptionHistory =
null;
10728 Element element = elements.GetElement(row.
id);
10730 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))
10737 element = elements.GetElement(row.
id);
10739 bool flag = row.
tag.Contains(
"neg");
10752 if (element !=
null)
10754 num2 = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
10755 if (num2 > element.
source.max)
10757 num2 = element.source.max - 1;
10759 flag = (flag && num2 > element.
Value) || (!flag && num2 < element.
Value);
10760 flag2 = num2 > element.
Value;
10761 if (vec > 0 && !flag2)
10766 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
10767 SetFeat(row.
id, num2);
10768 if (flag2 && ether)
10770 if (base.c_corruptionHistory ==
null)
10772 base.c_corruptionHistory =
new List<int>();
10774 base.c_corruptionHistory.Add(row.
id);
10777 Element element2 = elements.GetElement(row.
id);
10782 EClass.player.flags.gotEtherDisease =
true;
10784 thing.
SetStr(53,
"letter_ether");
10793 PlaySound(ether ?
"mutation_ether" :
"mutation");
10794 PlayEffect(
"mutation");
10796 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
10800 Say(
"nothingHappens");
10806 Element orCreateElement = elements.GetOrCreateElement(ele);
10809 elements.ModBase(orCreateElement.
id, 1);
10811 if (orCreateElement is
Spell)
10813 int num =
EClass.
curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10814 int num2 = origin?.Evalue(765) ?? 0;
10815 num = num * (100 - num2) / 100;
10816 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10818 if (orCreateElement.
source.charge == 1)
10822 orCreateElement.vPotential += a;
10824 Say(
"spell_gain",
this, orCreateElement.
Name);
10836 Msg.
Say(
"curse_nullify", member);
10841 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
10843 Say(
"curse_nullify",
this);
10846 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
10848 Say(
"curse_nullify",
this);
10856 if (_historyFood !=
null)
10858 while (_historyFood.Count > 5)
10860 _historyFood.RemoveAt(_historyFood.Count - 1);
10862 if (_historyFood[0].Count > 0)
10864 _historyFood.Insert(0,
new List<string>());
10871 if (!IsPCFaction || !IsGlobal)
10873 _historyFood =
null;
10876 if (_historyFood ==
null)
10878 _historyFood =
new List<List<string>>
10883 if (_historyFood[0].Count < 5)
10885 _historyFood[0].Add(
food.id);
10891 if (_historyFood ==
null)
10896 foreach (List<string>
item in _historyFood)
10898 foreach (
string item2
in item)
10900 if (item2 ==
food.id)
10913 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10915 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10920 if (faithElements !=
null)
10925 if (idFaith ==
"eyth" && !HasElement(1228))
10935 if (!HasCondition<ConExcommunication>())
10943 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10944 for (
int i = 0; i < array.Length; i += 2)
10946 int num2 = array[i + 1] * num / 50;
10947 if (array[i] == 79)
10949 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
10951 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10955 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
10961 public void ModTempElement(
int ele,
int a,
bool naturalDecay =
false,
bool onlyRenew =
false)
10967 bool flag = HasElement(1215);
10968 if (tempElements ==
null)
10977 int num = elements.ValueWithoutLink(ele);
10978 int num2 = Mathf.Abs(num) + 100;
10979 int num3 = num2 / (flag ? 2 : 4);
10980 int num4 = -num - 100;
10981 int num5 = tempElements.
Base(ele);
10982 int num6 = num5 + a;
10985 num3 = Mathf.Min(a, num3);
10986 num4 = Mathf.Max(a, -num2 / 3);
10988 if (a > 0 && num6 > num3)
10990 a = ((num3 > num5) ? (num3 - num5) : 0);
10992 if (a < 0 && num6 < num4)
10994 a = ((num4 < num5) ? (num4 - num5) : 0);
10997 if (element.
vBase == 0)
11000 if (tempElements.
dict.Count == 0)
11002 tempElements =
null;
11021 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 +
EClass.
rnd(p / 100 + 1) + 1)), naturalDecay:
false, onlyRenew);
11027 foreach (
int ele
in array)
11029 EnhanceTempElement(ele, p, onlyRenew);
11035 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 +
EClass.
rnd(p / 100 + 1)), naturalDecay:
false, onlyRenew);
11040 if (tempElements ==
null)
11046 if (
item.vBase > 0)
11048 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
11055 if (tempElements !=
null)
11066 void Cure(
int[] eles)
11068 foreach (
int ele
in eles)
11070 if (tempElements ==
null)
11075 if (element !=
null && element.
vBase < 0)
11077 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
11085 if (tempElements !=
null)
11088 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)
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)
void SetInt(string id, int value=0)
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)
void SetStr(string id, string value=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 SetBool(string id, bool enable)
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)
BaseCondition GetCondition(string idCon)
Thing FindBestFoodToEat()
Hostility OriginalHostility
void TryPickGroundItem(Func< Card, bool > func=null)
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false, bool purchaseFeat=false)
bool CanAcceptGift(Chara c, Card t)
WorkSummary GetWorkSummary()
override void Rotate(bool reverse=false)
Chara CreateReplacement()
override Sprite GetImageSprite()
override SpriteData GetSpriteData(int dir=0, bool snow=false)
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)
List< Chara > ListFussableCharas(int radius=2)
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()
Chara TryDuplicate(DuplicateCondition con=DuplicateCondition.Default, Point dest=null, bool inheritHostility=false)
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()
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
void DiminishTempElements(int a=1)
Thing GetRandomRangedWeapon()
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)
Condition AddCondition(string id, int p, int p2, bool force=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 SetSummon(int duration, bool dropCorpse=false)
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)
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)
Condition AddCondition(Condition c, Chara giver, bool force=false)
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)
bool TryFuse(float chance=1f)
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
virtual List< string > Apply(int a, ElementContainer owner, bool hint=false)
override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
static void ProcDrink(Chara c, Thing food)
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
bool Contains(int dx, int dz)
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 int ClampToInt(long a)
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
void RecoverStamina(int a)
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)
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
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()
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
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)
bool IsStarted(string id)
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
virtual void Revelation(string idTalk, Card c, int chance=100)
int ConvertTile(int tile)
bool ContainsTag(string _tag)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
SpriteData GetSpriteData(int dir, int skin, bool snow, Card card=null)
static void ShakeCam(string id="default", float magnitude=1f)
SourceCharaText charaText
SourceCategory categories
virtual bool ShowDangerLv
virtual int DangerLvBoost
virtual bool IsSnowCovered
bool tryFixPrefNotLoadedAtStart
void LoadPrefAndFixDensity()
SpriteData GetData(int dir, int skin, bool snow, Card card=null)
static Dictionary< string, SpriteReplacer > dictOverrides
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 int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
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 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)
Chara SpawnMob(string id, Point pos=null)
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)