2using System.Collections.Generic;
13 private static List<Hobby>
listHobby =
new List<Hobby>();
15 public static string[]
IDTimeTable =
new string[2] {
"default",
"owl" };
42 [JsonProperty(PropertyName =
"T1")]
45 [JsonProperty(PropertyName =
"T2")]
48 [JsonProperty(PropertyName =
"T3")]
51 [JsonProperty(PropertyName =
"T4")]
54 [JsonProperty(PropertyName =
"T5")]
57 [JsonProperty(PropertyName =
"T6")]
60 [JsonProperty(PropertyName =
"T7")]
63 [JsonProperty(PropertyName =
"T8")]
66 [JsonProperty(PropertyName =
"1")]
69 [JsonProperty(PropertyName =
"2")]
72 [JsonProperty(PropertyName =
"3")]
75 [JsonProperty(PropertyName =
"4")]
78 [JsonProperty(PropertyName =
"8")]
79 public string[]
_strs =
new string[5];
81 [JsonProperty(PropertyName =
"9")]
176 private static List<Chara>
_pts =
new List<Chara>();
466 if (base.c_originalHostility == (
Hostility)0)
468 if (!
source.hostility.IsEmpty())
474 return base.c_originalHostility;
484 if (
source.idActor.Length <= 1)
514 return "CharaActorPCC";
526 if (base.dir != 1 && base.dir != 2)
542 return base.dir == 2;
556 return base.ExistsOnMap;
622 return base.c_uidMaster != 0;
698 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 * ((
IsPCFaction ? 100 : (100 + (int)base.rarity * 300)) + (
IsPC ? (
EClass.
player.
lastEmptyAlly *
Evalue(1646)) : 0)) / 100, 1f, 100000000f);
704 public int MaxSummon => Mathf.Max((
int)Mathf.Sqrt(base.CHA), 1) +
Evalue(1647) + ((!base.IsPCFactionOrMinion) ? ((
int)base.rarity * 5) : 0);
710 if (base.c_idMainElement == 0)
718 public override int DV
729 num = 50 + (num - 50) / 10;
732 int WeaknessMod(
int a)
734 if (HasCondition<ConWeakness>())
747 public override int PV
758 num = 50 + (num - 50) / 10;
761 int WeaknessMod(
int a)
763 if (HasCondition<ConWeakness>())
802 if (!
IsGlobal && !base.isSubsetCard)
834 return race.id ==
"mutant";
848 return race.tag.Contains(
"humanSpeak");
860 return EClass.Branch.uidMaid == base.uid;
880 public bool IsEyth => faith.id ==
"eyth";
886 if (!
source.works.Contains(
"Rich"))
888 return source.hobbies.Contains(
"Rich");
902 if (base.c_genes !=
null)
904 return base.c_genes.GetGeneSlot(
this);
943 if (!h.
source.elements.IsEmpty())
945 for (
int i = 0; i < h.
source.elements.Length; i += 2)
947 int ele = h.
source.elements[i];
948 int v = h.
source.elements[i + 1];
978 if (base.rarity >=
Rarity.Legendary)
993 if (
host ==
null || includeRide)
997 return base.hp <
MaxHP / 5;
1012 return num > num2 + 0.1f;
1105 return p.cell.room.data.accessType
switch
1108 BaseArea.AccessType.Private =>
false,
1135 for (
int i = 0; i < slots.Count; i++)
1144 _cbits1.Bits = (uint)
_cints[0];
1155 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1164 if (
source.tag.Contains(
"boss"))
1181 string text = base.c_altName ??
source.GetName(
this);
1184 if (base.c_bossType ==
BossType.Evolved)
1186 text =
"_evolved".lang(text.ToTitleCase(wholeText:
true));
1189 if (text.Length > 0 &&
char.IsLower(text[0]))
1191 if (base.rarity >=
Rarity.Legendary)
1193 text = text.ToTitleCase();
1197 text = text.AddArticle();
1204 int num2 = ((base.rarity ==
Rarity.Mythical) ? 3 : ((base.rarity >=
Rarity.Legendary) ? 2 : ((!
_alias.IsEmpty()) ? 1 : (-1))));
1209 text = (
Aka.IsEmpty() ? text.Bracket(num2) : (num2
switch
1214 }).lang((num2 == -1) ?
Aka :
Aka.ToTitleCase(wholeText:
true), text.Bracket(num2)));
1216 return text + text2;
1221 if (r != base.rarity)
1257 if (uniqueData !=
null)
1296 base.isSubsetCard =
false;
1298 base.c_uidMaster = 0;
1330 if (
source.tag.Contains(
"boss"))
1334 int num = ((bp.lv != -999) ?
bp.
lv : base.LV);
1357 if (
source.idActor.Length > 2)
1366 if (
source.mainElement.Length != 0)
1368 int _genLv = Mathf.Min(genLv, 100);
1369 List<Tuple<string, int, int>> list =
new List<Tuple<string, int, int>>();
1370 string[] mainElement =
source.mainElement;
1371 for (
int i = 0; i < mainElement.Length; i++)
1373 string[] array = mainElement[i].Split(
'/');
1375 int num2 = source.LV * row.eleP / 100;
1376 if (list.Count == 0 || num2 < _genLv || array[0] ==
bp.
idEle)
1378 list.Add(
new Tuple<string, int, int>(array[0], (array.Length > 1) ?
int.Parse(array[1]) : 0, num2));
1381 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1384 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 ==
bp.
idEle).FirstOrDefault() ?? tuple;
1386 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental:
true);
1387 if (list.Count >= 2)
1389 num = tuple.Item3 + base.LV -
source.LV;
1394 base.c_altName = NameGen.getRandomName();
1398 _alias = AliasGen.GetRandomAlias();
1410 if (base.LV > 5 &&
race.id ==
"mutant")
1412 for (
int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1420 if (
race.EQ.Length != 0)
1447 case "olderyoungersister":
1450 case "sister_undead":
1454 if (
id ==
"sister_undead" &&
EClass.
rnd(10) == 0)
1473 if (!
source.faith.IsEmpty())
1535 base.isHidden =
false;
1538 if (
host !=
null && !calledRecursive)
1551 Element orCreateElement = chara.elements.GetOrCreateElement(
item.Key);
1552 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.
vSource;
1554 chara.SetFaith(
faith);
1555 chara.bio = IO.DeepCopy(
bio);
1557 chara.c_daysWithGod = base.c_daysWithGod;
1558 chara.RefreshFaithElement();
1559 chara.hp = (int)Mathf.Clamp((
float)chara.MaxHP * ((float)base.hp / (
float)
MaxHP) * 0.99f, 0f, chara.MaxHP);
1560 chara.isCopy =
true;
1570 int num2 = (base.ChildrenWeight + ((t !=
null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 /
WeightLimit;
1579 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1589 int num = base.ChildrenWeight * 100 / Mathf.Max(1,
WeightLimit);
1605 Say(flag ?
"dmgBurdenStairs" :
"dmgBurdenFallDown",
this);
1611 int num2 = (num * (base.ChildrenWeight * 100 /
WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1635 else if (
host !=
null)
1682 num -= (
IsPC ? 50 : 100);
1722 num += EClass.player.lastEmptyAlly *
Evalue(1646);
1727 num += EClass.player.lastEmptyAlly * 10 - 10;
1733 num +=
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100);
1734 info?.AddFix(
EClass.
curve((base.LV - 900) / 100 * 10, 500, 100),
"enemySpeedBuff".lang());
1736 if (HasCondition<ConGravity>())
1739 info?.AddFix(-30, GetCondition<ConGravity>().
Name);
1745 info?.AddText(
"minSpeed".lang(10.
ToString() ??
""));
1756 if (value.
source.category ==
"skill")
1776 this.hostility = hostility2;
1782 this.hostility = hostility2;
1788 this.hostility = hostility2;
1803 base.ApplyEditorTags(tag);
1811 Debug.LogWarning(
"Chara " +
id +
" not found");
1820 if (!
id.StartsWith(
"ele"))
1829 if (base.c_idMainElement != 0)
1831 SetElements(base.c_idMainElement,
remove:
true);
1832 base.c_idMainElement = 0;
1837 SetElements(
id,
remove:
false);
1838 base.c_idMainElement =
id;
1841 base.isElemental =
true;
1844 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);
1848 void SetElements(
int idEle,
bool remove)
1908 base.c_idJob = idNew;
1936 int ele =
new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
1940 Say(
"gain_bodyparts",
this,
Element.
Get(ele).GetName().ToLower());
1961 for (
int num =
body.
slots.Count - 1; num >= 0; num--)
1970 string[] array =
race.figure.Split(
'|');
1971 foreach (
string s
in array)
1984 string[] array =
race.figure.Split(
'|');
1985 foreach (
string s
in array)
2007 base.c_idRace = idNew;
2023 Debug.Log(
"Creating Replacement NPC for:" +
this);
2051 this.hostility = hostility2;
2053 base.c_summonDuration = 0;
2054 base.isSummon =
false;
2076 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.
hostility));
2077 this.hostility = hostility2;
2078 base.c_uidMaster = _master.
uid;
2079 base.c_minionType = type;
2086 Debug.Log(
"released:" +
this);
2087 base.c_uidMaster = 0;
2092 if (chara.
enemy ==
this)
2104 base.c_summonDuration = duration;
2105 base.isSummon =
true;
2152 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2171 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2176 if (cells[x, z].blocked)
2180 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2187 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2192 if (cells[x, z].blocked)
2196 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2222 if (detail !=
null && detail.
charas.Count > 0)
2257 int num = ((p.z >=
pos.
z) ? ((p.
x >
pos.
x) ? 1 : ((p.z >
pos.
z) ? 2 : 3)) : 0);
2267 int num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2272 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2279 num2 = ((z >=
pos.
z) ? ((x >
pos.
x) ? 1 : ((z >
pos.
z) ? 2 : 3)) : 0);
2284 num2 = ((z >= p.
z) ? ((x > p.
x) ? 1 : ((z > p.
z) ? 2 : 3)) : 0);
2315 List<Point> list =
new List<Point>();
2363 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2372 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 4)
2381 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2390 if (pathProgress.
HasPath && pathProgress.
nodes.Count < num + 25)
2408 int num = p.x -
pos.
x;
2409 int num2 = p.z -
pos.
z;
2426 if (num == 0 && num2 == 0)
2436 return TryMove(point, allowDestroyPath:
false);
2445 if (!condition.
TryMove(newPoint))
2450 if (base.isRestrained)
2456 base.isRestrained =
false;
2458 if (!
CanMoveTo(newPoint, allowDestroyPath))
2462 return _Move(newPoint);
2513 EClass.player.lastZonePos =
null;
2516 for (
int i = 0; i < num2 * 4; i++)
2527 EClass.player.regionMoveWarned =
true;
2528 Msg.
Say(
"regionAbortMove");
2536 AddCondition<ConSuffocation>((
EClass.
pc.
Evalue(200) != 0) ? (2000 / (100 +
EvalueMax(200, -5) * 10)) : 30, force:
true);
2537 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2544 ModExp(200, 8 + num4 * 12);
2547 EClass.player.regionMoveWarned =
false;
2555 num = EClass.setting.defaultActPace * 3f;
2570 if (
CanMoveTo(randomNeighbor, allowDestroyPath:
false))
2572 newPoint = randomNeighbor;
2580 if (newPoint.
x !=
pos.
x || newPoint.
z !=
pos.
z)
2585 if (effect !=
null && effect.
id == 7)
2590 Say(
"abWeb_caught",
this);
2592 effect2.power = effect2.power * 3 / 4;
2596 Say(
"abWeb_pass",
this);
2605 else if ((newPoint.
x >
pos.
x && newPoint.
z >
pos.
z) || (newPoint.
x <
pos.
x && newPoint.
z <
pos.
z))
2620 traitDoor.TryOpenLock(
this);
2630 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.
isClearSnow;
2633 bool flag4 = cell.IsTopWater && !cell.
isFloating;
2663 string text = ((flag2 || flag4) ?
"water" : tileRow.
soundFoot.IsEmpty(row.
soundFoot.IsEmpty(
"default")));
2664 if (cell.
obj != 0 && cell.
sourceObj.tileType.IsPlayFootSound && !cell.
matObj.soundFoot.IsEmpty())
2666 text = cell.
matObj.soundFoot;
2678 if (!text.IsEmpty())
2680 SoundManager.altLastData =
IsPC;
2687 bool flag5 = scene.actionMode.gameSpeed > 1f;
2688 scene.psFoot.transform.position = renderer.position + pcOrbit.
footPos;
2689 scene.psFoot.startColor = row.
matColor;
2693 scene.psSmoke.transform.position = renderer.position + pcOrbit.
smokePos;
2717 Say(
"replace_pc", chara, chara2);
2728 traitDoor2.TryOpen(
this);
2755 if (!
item.isThing ||
item.placeState != 0 ||
item.ignoreAutoPick)
2767 if ((dataPick.
noRotten &&
item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
2784 foreach (
int cat
in dataPick.
cats)
2786 if (
item.category.uid == cat)
2792 else if (!dataPick.
flag.HasFlag(containerFlag))
2834 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
2866 EClass.player.flags.isShoesOff =
false;
2873 EClass.player.flags.isShoesOff =
true;
2891 EClass._map.MineBlock(_p, recoverBlock: false, this);
2894 EClass._map.MineObj(_p, null, this);
2900 EClass._map.MineObj(_p, null, this);
2907 if (t.isNPCProperty && t.trait.CanBeDestroyed)
2913 t.SetPlaceState(PlaceState.roaming);
2929 if (list.Count == 0)
2933 list.Copy().ForeachReverse(delegate(
Chara c)
2937 List<Point> list2 = new List<Point>();
2938 for (int i = point.x - 1; i <= point.x + 1; i++)
2940 for (int j = point.z - 1; j <= point.z + 1; j++)
2942 if (i != point.x || j != point.z)
2944 Point point2 = new Point(i, j);
2945 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
2952 if (list2.Count > 0)
2954 if (list2.Count > 1)
2956 list2.ForeachReverse(delegate(Point p)
2958 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
2964 Point newPoint = list2.RandomItem();
2967 Say(
"displace",
this, c);
2977 int num =
EClass.
rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
2979 Say(
"pushed_money",
this, c);
3044 if (z == currentZone)
3048 if (HasCondition<ConInvulnerable>())
3050 RemoveCondition<ConInvulnerable>();
3054 EClass.player.nextZone = z;
3062 EClass.player.returnInfo.turns += 5;
3069 EClass.player.deathZoneMove =
false;
3071 currentZone.events.OnLeaveZone();
3072 if (currentZone.instance !=
null)
3086 EClass.player.uidLastZone = currentZone.uid;
3089 if (currentZone.IsRegion)
3097 Msg.
Say(
"leaveZone", currentZone.Name);
3099 else if (z.
id != currentZone.id)
3103 EClass.player.lastZonePos = pos.Copy();
3105 EClass.player.lastTransition = transition;
3117 if (party !=
null && party.
leader ==
this)
3129 Debug.Log(base.Name);
3132 transition.uidLastZone = currentZone?.uid ?? 0;
3133 global.transition = transition;
3137 global.transition =
null;
3140 EClass.player.lastTransition =
null;
3143 if (IsBranchMember())
3154 public void MoveHome(
string id,
int x = -1,
int z = -1)
3169 CureCondition<ConSuspend>();
3196 orgPos =
new Point(x, z);
3197 if (factionBranch !=
null)
3199 RefreshWorkElements();
3211 state = ZoneTransition.EnterState.Fall,
3221 renderer.RefreshSprite();
3224 public override void Rotate(
bool reverse =
false)
3226 if (renderer.hasActor)
3228 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop:
true);
3232 base.dir = ((base.dir == 0) ? 1 : 0);
3235 renderer.RefreshSprite();
3245 angle =
Util.GetAngle(p.
x - pos.x, p.
z - pos.z);
3248 if (angle > 100f && angle < 170f)
3252 else if (angle > 170f && angle < 190f)
3256 else if (angle > 190f || (angle < -10f && angle > -100f))
3266 else if (angle > 170f && angle < 235f)
3270 else if (angle > 80f && angle < 145f)
3274 else if (angle > -100f && angle < -35f)
3278 else if (angle > -10f && angle < 55f)
3282 renderer.RefreshSprite();
3293 else if (base.dir == 1)
3297 else if (base.dir == 2)
3301 else if (base.dir == 3)
3306 else if (base.dir == 0)
3310 else if (base.dir == 1)
3314 else if (base.dir == 2)
3318 else if (base.dir == 3)
3327 if (!renderer.hasActor)
3329 if (angle == 0f || angle == 45f || angle == 90f)
3333 if (angle == -135f || angle == 180f || angle == -90f)
3343 return renderer.actor.currentDir;
3349 for (
int i = -num; i < num + 1; i++)
3351 for (
int j = -num; j < num + 1; j++)
3353 shared.
Set(pos.x + i, pos.z + j);
3364 for (
int num = conditions.Count - 1; num >= 0; num--)
3366 if (conditions[num].ConsumeTurn)
3376 if (_cooldowns !=
null)
3381 consumeTurn =
false;
3382 preventRegen =
false;
3383 emoIcon =
Emo2.none;
3386 base.c_summonDuration--;
3387 if (base.c_summonDuration <= 0)
3395 AddCondition<ConWet>(20);
3400 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.
value) / 5;
3405 if (
EClass.
rnd(2) == 0 && !HasCondition<ConAwakening>())
3420 if (parasite !=
null)
3422 ModExp(227, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.
LV) * 25));
3426 ModExp(226, (
EClass.
_zone.
IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.
LV) * 25));
3433 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3441 if (turn % 500 == 0)
3443 DiminishTempElements();
3455 preventRegen =
true;
3459 Say(
"dmgBurden",
this);
3460 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1,
AttackSource.Burden);
3472 ModExp(207, 1 + phase2 * phase2);
3500 preventRegen =
true;
3504 if (
EClass.
rnd(100) == 0 && !isConfused)
3507 AddCondition<ConConfuse>(500);
3512 AddCondition<ConBlind>(200);
3515 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3523 int num2 = Evalue(409);
3524 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3529 for (
int num3 = conditions.Count - 1; num3 >= 0; num3--)
3531 if (num3 < conditions.Count)
3546 preventRegen =
true;
3561 if (
EClass.
rnd(25) == 0 && base.hp < MaxHP)
3563 HealHP(
EClass.
rnd(Evalue(300) / 3 + 1) + 1);
3564 elements.ModExp(300, 8);
3569 elements.ModExp(301, 8);
3588 if (parasite !=
null)
3600 Debug.LogError(
"exception: pos is not valid:" + pos?.ToString() +
"/" +
this);
3611 ignoreSPAbsorb =
false;
3614 if (hasMovedThisTurn)
3616 pos.Things.ForeachReverse(delegate(
Thing t)
3624 hasMovedThisTurn =
false;
3627 EClass.player.haltMove =
false;
3661 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3672 if (!tileInfo.
shore)
3677 int num2 = (tileInfo.isRoad ? 22 : 12);
3680 num2 = (tileInfo.isRoad ? 16 : 10);
3684 num2 *= (flag2 ? 2 : 20);
3695 EClass.player.safeTravel = 5 +
EClass.
rnd(5);
3708 EClass.player.pickupDelay = 0f;
3732 Msg.
Say(
"returnComplete");
3733 EClass.player.uidLastTravelZone = 0;
3735 EClass.player.lastZonePos =
null;
3737 EClass.player.returnInfo =
null;
3740 EClass.player.returnInfo =
null;
3741 Msg.
Say(
"returnOverweight");
3744 if ((HasNoGoal || !ai.
IsRunning) && !WillConsumeTurn())
3752 RecipeUpdater.dirty =
true;
3758 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (
float)
EClass.
pc.
Speed / (
float)Speed);
3759 hasMovedThisTurn =
false;
3762 if (!IsAliveInCurrentZone)
3766 renderer.RefreshStateIcon();
3767 if (host !=
null && !consumeTurn)
3769 if (host.
ride ==
this && ((host.
hasMovedThisTurn && IsInCombat) || (enemy !=
null && turn % 3 != 0)))
3775 if (Dist(enemy) < 3 &&
EClass.
rnd(2) == 0)
3777 Say(
"parasite_fail",
this, host);
3778 if (
EClass.
rnd(2) == 0 && GetInt(106) == 0)
3780 Talk(
"parasite_fail");
3795 if (base.isRestrained)
3816 Cell cell = base.Cell;
3819 AddCondition<ConWet>(50);
3820 if (pos.IsHotSpring)
3827 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force:
true);
3843 AddCondition<ConWet>(50);
3847 PlaySound(
"fire_step");
3848 AddCondition<ConBurning>(30);
3853 PlaySound(
"bubble");
3854 AddCondition<ConWet>(30);
3859 if (hasMovedThisTurn)
3861 Say(
"abMistOfDarkness_step",
this);
3884 aliasEle = EClass.sources.elements.map[e.idEle].alias,
3913 if (rootCard !=
this && things.IsFull(c.
Thing))
3920 public void PickOrDrop(
Point p,
string idThing,
int idMat = -1,
int num = 1,
bool msg =
true)
3930 if (things.GetDest(t).IsValid)
3951 t = TryPoisonPotion(t);
3959 Say(
"backpack_full_drop", t);
3966 Say(
"backpack_full", t);
3970 if (dest.
stack !=
null)
3974 PlaySound(
"pick_thing");
3975 Say(
"pick_thing",
this, t);
3983 PlaySound(
"pick_thing");
3984 Say(
"pick_thing",
this, t);
3986 TryReservePickupTutorial(t);
3996 Say(
"poisonDrip",
this);
4010 Say(
"absorbRod",
this, t);
4013 if (
rod.source !=
null)
4016 if (enumerator.MoveNext())
4048 if (t.
id ==
"pasture")
4060 foreach (
Card item in pos.ListCards())
4065 if (thing !=
null && !IsPC)
4067 thing.isNPCProperty =
true;
4112 t.isNPCProperty =
false;
4114 pos.TryWitnessCrime(
this);
4123 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition ||
EClass.
rnd(2) == 0;
4127 if (num == -1 || num > t.
Num)
4138 t =
Pick(t.
Thing, msg:
false, tryStack:
false);
4152 WidgetHotbar.dirtyCurrentItem =
true;
4163 if (IsPC && held.
invY == 1)
4165 WidgetHotbar.dirtyCurrentItem =
true;
4177 Say(
"canOnlyCarry", held);
4182 if (!flag && things.IsOverflowing())
4186 Say(
"backpack_full_drop", held);
4194 PlaySound(
"pick_thing");
4195 Say(
"pick_held",
this,
card);
4196 if (IsPC &&
card.id ==
"statue_weird")
4203 WidgetHotbar.dirtyCurrentItem =
true;
4218 return held.
Split(a);
4241 WidgetHotbar.dirtyCurrentItem =
true;
4246 if (
card.trait.CanOnlyCarry)
4257 Msg.
Say(
"markedImportant");
4272 t.ignoreAutoPick =
true;
4283 int num = Evalue(131);
4284 int num2 = Evalue(130);
4285 int num3 = Evalue(123);
4286 if (num > num2 && num > num3)
4290 if (num2 > num && num2 > num3)
4294 if (num3 > num && num3 > num2)
4308 if (elements.Value(122) > elements.Value(120))
4310 return elements.GetElement(122);
4312 return elements.GetElement(120);
4317 isOnCreate = onCreate;
4322 RestockInventory(onCreate);
4327 string equip = source.
equip;
4328 if (equip.IsEmpty())
4332 if (equip ==
"none")
4342 EQ_ID(
"staff_long", 1);
4350 EQ_ID(
"sword_zephir");
4353 case "adv_mesherada":
4356 EQ_ID(
"dagger_hathaway");
4362 EQ_ID(
"staff_long", -1,
Rarity.Legendary);
4366 EQ_ID(
"cloak_wing", -1,
Rarity.Mythical);
4372 EQ_ID(
"sword_muramasa");
4378 EQ_ID(
"dagger_gaki");
4382 EQ_ID(
"dagger_ninto");
4386 EQ_ID(
"dagger", -1,
Rarity.Legendary);
4392 EQ_ID(
"staff_Cat", -1,
Rarity.Mythical);
4403 EQ_ID(
"helm_seeker");
4406 EQ_ID(
"sword_katana");
4408 EQ_ID(
"sword_katana");
4411 EQ_ID(
"boots_seven");
4415 for (
int i = 0; i < 20; i++)
4420 AddThing(
"plat").SetNum(6);
4426 AddThing(
"guitar_efrond");
4432 AddThing(
"guitar_ash");
4438 EQ_ID(
"EtherDagger");
4445 if (onCreate || !TryEquipRanged())
4447 EQ_CAT((
EClass.
rnd(4) == 0) ?
"crossbow" :
"bow");
4452 if (onCreate || !TryEquipRanged())
4458 int num = ((base.rarity >=
Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >=
Rarity.Legendary) ? (base.LV * 2) : base.LV));
4463 if (race.
id ==
"asura")
4465 for (
int j = 0; j < 4; j++)
4467 EQ_CAT(job.
weapon.RandomItem());
4470 for (
int k = 0; k < ((!(race.id ==
"mutant")) ? 1 : (2 + base.LV / 30)); k++)
4476 else if (!job.
weapon.IsEmpty())
4480 EQ_CAT(job.
weapon.RandomItem());
4482 if (race.
id ==
"mutant" || (Evalue(131) > 0 &&
EClass.
rnd(2) == 0))
4484 EQ_CAT(job.
weapon.RandomItem());
4532 Restock(
"book_story", 1);
4534 case "rock_thrower":
4542 Restock(
"book_story_home", 1);
4547 void Restock(
string id,
int num)
4549 if (things.Find(
id) ==
null)
4560 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4561 Rarity rarity2 = base.rarity;
4562 if (
id ==
"big_sister")
4564 num = (isOnCreate ? 8 : 4);
4572 rarity =
Rarity.Superior;
4574 else if (rarity2 ==
Rarity.Legendary)
4578 else if (rarity2 >=
Rarity.Mythical)
4584 rarity =
Rarity.Legendary;
4586 CardBlueprint.current.rarity = rarity;
4594 CardBlueprint.current.rarity = r;
4597 if (body.
GetSlot(thing, onlyEmpty:
true) ==
null)
4602 if (!body.
Equip(thing))
4613 if ((slot == 0 || bodySlot !=
null) && (slot != 37 || !HasElement(1209)))
4618 if (bodySlot !=
null && !body.
Equip(thing, bodySlot))
4655 if (!IsPC && (!trait.CanJoinPartyResident || !trait.CanJoinParty || memberType != 0))
4659 Msg.
Say(
"returnHome",
this, homeZone.Name);
4676 base.hp = MaxHP / 3;
4679 if (hunger.
value > 30)
4683 sleepiness.value = 0;
4684 hostility = OriginalHostility;
4685 RemoveCondition<StanceTaunt>();
4690 Msg.
Say(
"noDeathPenalty2",
this);
4694 Msg.
Say(
"noDeathPenalty",
this);
4700 List<Thing> dropList =
new List<Thing>();
4705 t.ignoreAutoPick = true;
4708 }, onlyAccessible:
false);
4714 EClass.player.preventDeathPenalty =
false;
4716 if (IsPCFaction && homeBranch !=
null)
4718 homeBranch.
Log(
"bRevive",
this);
4731 PlayEffect(
"revive");
4733 SetCensored(enable:
false);
4741 List<string> list =
new List<string> {
"930",
"931",
"947",
"948",
"949",
"950",
"951",
"952" };
4744 list =
new List<string> {
"944",
"946",
"backerGrave",
"backerGrave2" };
4748 if (!lastword.IsEmpty())
4750 thing.c_note = lastword;
4752 thing.isModified =
true;
4798 if (HasCondition<ConAnorexia>())
4804 else if (base.c_vomit > 10)
4806 AddCondition<ConAnorexia>();
4808 AddCondition<ConDim>();
4809 if (HasCondition<ConAnorexia>())
4823 if (isDead || host !=
null)
4827 bool isInActiveZone = IsInActiveZone;
4836 Say(
"summon_vanish",
this);
4837 pos.PlayEffect(
"vanish");
4838 pos.PlaySound(
"vanish");
4852 PlayEffect(
"revive");
4853 PlaySound(
"chime_angel");
4860 PlaySound(base.material.GetSoundDead(source));
4862 renderer.RefreshSprite();
4863 renderer.RefreshStateIcon();
4868 string text2 = ((origin ==
null) ?
"" : origin.GetName(
NameStyle.Full));
4871 text =
"dead_" + attackSource;
4877 text =
"dead_" + e.source.alias;
4886 EClass._zone.isDeathLocation =
true;
4887 string s = ((origin ==
null) ? text :
"dead_by");
4899 AI_PlayMusic.keepPlaying =
false;
4905 Msg.
Say(
"goto_heaven",
this);
4909 if (origin ==
null || !origin.isSynced || (attackSource !=
AttackSource.Melee && attackSource !=
AttackSource.Range))
4911 Msg.
Say(text,
this,
"", text2);
4913 string text3 = TalkTopic(
"dead");
4914 if (!text3.IsEmpty())
4916 text3 = text3.StripBrackets();
4918 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
4933 if (homeBranch !=
null)
4935 homeBranch.
Log(text,
this,
"");
4947 if (
id ==
"mandrake")
4949 Say(
"a_scream",
this);
4954 ClearTempElements();
4957 base.isSale =
false;
4968 EClass.player.returnInfo =
null;
4969 EClass.player.uidLastTravelZone = 0;
4978 chara2.enemy =
null;
4983 EClass.player.preventDeathPenalty =
true;
4988 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
4997 currentZone.RemoveCard(
this);
4999 if ((origin !=
null && origin.IsPCParty) || IsPCFaction)
5002 if (IsPCFaction && !IsPCParty && (origin ==
null || !origin.IsPCParty))
5006 ModAffinity(
EClass.
pc, a, show:
false);
5008 if (!(text4 ==
"quru"))
5010 if (text4 ==
"corgon")
5022 if (origin.IsPCParty || origin.IsPCPartyMinion)
5025 if (OriginalHostility >=
Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5029 else if (race.
id ==
"cat" && OriginalHostility >=
Hostility.Neutral)
5036 num = num * 30 / 100;
5047 else if (origin.IsPCFaction)
5049 origin.Chara.ModAffinity(
EClass.
pc, 1, show:
false);
5050 origin.Chara.ShowEmo(
Emo.love);
5053 if (base.sourceBacker !=
null && origin !=
null && origin.IsPCParty)
5057 if (base.IsPCFactionOrMinion)
5061 Msg.
Say(
"abort_allyDead");
5066 Msg.
Say(
"abort_enemyDead");
5068 if (IsPCParty && !IsPC)
5071 base.c_wasInPcParty =
true;
5077 if (attackSource !=
AttackSource.DeathSentense && !IsPCFaction)
5079 EClass.player.flags.little_killed =
true;
5091 case "shark_sister":
5100 if (attackSource ==
AttackSource.Finish && origin !=
null && origin.Evalue(665) > 0)
5104 if (chara.
LV < base.LV)
5106 chara.
SetLv(base.LV);
5109 Msg.
Say(
"plant_pop",
this, chara);
5113 item.OnCharaDie(
this);
5119 if (IsPCFaction || IsPCFactionMinion)
5126 Point point = pos.
GetNearestPoint(allowBlock:
true, allowChara:
false, allowInstalled:
false, ignoreCenter:
true) ?? pos;
5132 flag = (flag2 =
true);
5133 EClass._zone.Boss =
null;
5138 EClass.player.flags.KilledBossInVoid =
true;
5144 SE.Play(
"Jingle/fanfare2");
5154 flag = (flag2 =
true);
5162 case "melilith_boss":
5164 flag = (flag2 =
true);
5171 flag = (flag2 =
true);
5173 if (questExploration !=
null)
5175 SE.Play(
"kill_boss");
5185 SE.Play(
"kill_boss");
5186 SoundManager.ForceBGM();
5192 SE.Play(
"kill_boss");
5196 EClass.player.willAutoSave =
true;
5217 public void Kick(
Chara t,
bool ignoreSelf =
false,
bool karmaLoss =
true,
bool show =
true)
5219 if (!IsAliveInCurrentZone)
5245 Say(
"kick",
this, t);
5265 return UseAbility(elements.GetElement(idAct)?.act ??
ACT.
Create(idAct), tc, pos, pt);
5270 if (!IsPC && HasCooldown(a.
id))
5274 if (a.
source.proc.TryGet(0) ==
"Heal" && HasElement(1422))
5276 List<int> list =
new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5277 int num = list.IndexOf(a.
id);
5280 int num2 = list.TryGet(num + Evalue(1422));
5281 a = elements.GetElement(num2)?.
act ??
ACT.
Create(num2);
5290 if (IsPC && HasCondition<StanceManaCost>())
5292 num4 = Evalue(1657);
5304 ForeachEnemy(delegate
5311 ForeachParty(delegate
5327 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5329 int num6 = cost.cost * num5 / 100;
5332 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5342 if (!IsPC && cost.
type ==
Act.
CostType.MP && mana.
value < 0 && (
EClass.
rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5350 ActPlan.warning =
true;
5353 if (UseAbility(a, tc, pos, pt))
5362 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))
5364 Say(
"shakeHead",
this);
5367 if (tc !=
null && tc !=
this)
5371 if (pos !=
null && !base.pos.Equals(pos))
5377 num3 = 1 + Evalue(1648);
5379 if (IsPC && cost.
cost > 0 && a.
Value == 0)
5386 string s = (isConfused ?
"_cast_confuse" : (HasCondition<ConDim>() ?
"_cast_dim" :
""));
5387 if (!a.
source.tag.Contains(
"useHand"))
5389 Say(race.
castStyle.IsEmpty(
"cast"),
this, a.
source.GetName().ToLower(), s.lang());
5402 a.vPotential -= i * 2;
5403 num6 = num6 * (100 - num4 * 20) / 100;
5412 else if (a.
source.langAct.Length != 0 && tc !=
null)
5414 string text = a.
source.langAct[0];
5415 string text2 = ((a.source.langAct.Length >= 2) ? a.
source.langAct[1] :
"");
5416 if (text ==
"spell_hand")
5419 string @ref = text2.lang(list2[4]);
5420 Say(tc.IsPCParty ?
"cast_hand_ally" :
"cast_hand",
this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5424 Say(text,
this, tc, text2.IsEmpty() ?
"" : text2.lang());
5428 Talk(
"insult_" + (base.IsMale ?
"m" :
"f"));
5434 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5444 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5448 ignoreSPAbsorb =
true;
5451 if (a is
Spell && GetCondition<ConSilence>() !=
null)
5453 Say(
"cast_silence",
this);
5460 int spellExp = elements.GetSpellExp(
this, a, num5);
5463 Say(
"fizzle",
this);
5464 PlayEffect(
"fizzle");
5465 PlaySound(
"fizzle");
5468 ModExp(a.
id, spellExp / 5);
5470 RemoveCondition<ConInvisibility>();
5474 if (HasTalk(
"phrase_" + a.
source.alias))
5476 EClass.player.forceTalk =
true;
5477 Talk(
"phrase_" + a.
source.alias);
5484 ForeachEnemy(delegate(
Chara c)
5491 ForeachParty(delegate(
Chara c)
5496 Act.forcePt =
false;
5500 for (
int j = 0; j < num3; j++)
5506 ActEffect.RapidCount = j;
5508 flag2 = a.
Perform(
this, tc, pos);
5511 if (flag2 && !isDead)
5515 ModExp(a.
id, spellExp);
5517 if (a.
source.alias.StartsWith(
"sword_"))
5522 ActEffect.RapidCount = 0;
5523 if (!IsPC && a.
source.cooldown > 0)
5525 AddCooldown(a.
id, a.
source.cooldown);
5527 if (flag2 && !a.
source.tag.Contains(
"keepInvisi") &&
EClass.
rnd(2) == 0)
5529 RemoveCondition<ConInvisibility>();
5532 void ForeachEnemy(Action<Chara> action)
5534 if (_pts.Count == 0)
5539 if (chara3 !=
this && CanSeeLos(chara3) && chara3.
IsHostile(
this))
5545 for (
int num11 = _pts.Count - 1; num11 >= 0; num11--)
5547 action(_pts[num11]);
5550 void ForeachParty(Action<Chara> action)
5552 if (_pts.Count == 0)
5559 if (chara ==
this || chara.
host !=
null || CanSeeLos(chara))
5570 if ((chara2 ==
this || (chara2.
IsFriendOrAbove(
this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 ||
EClass.
rnd(_pts.Count * _pts.Count) > 6))
5577 for (
int num9 = _pts.Count - 1; num9 >= 0; num9--)
5588 return 25 + Evalue(226) * 125 / 100;
5604 if (host.
ride ==
this)
5606 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
EvalueRiding()));
5610 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.
Evalue(227)));
5615 int num3 = Evalue(304);
5618 num3 = Mathf.Max(num3, base.LV + 5);
5622 bool num6 = GetArmorSkill() == 122;
5626 num4 = 20 - Evalue(122) / 5;
5627 num5 += 10 - Evalue(1654) * 4;
5631 num4 = 10 - Evalue(120) / 5;
5641 if (parasite !=
null)
5652 num5 += 10 - Evalue(1654) * 4;
5658 if (HasCondition<ConDim>())
5660 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
5670 return Mathf.Clamp(100 + e.
Value - 10 - e.
source.LV * e.
source.cost[0] * num4 / (10 + num3 * 10), 0, 100 - num5);
5673 public void DoAI(
int wait, Action onPerform)
5688 Say(headpat ?
"headpat" :
"cuddle",
this, c);
5694 if (!headpat ||
this == c)
5709 if (!member.
IsPC && CanSeeLos(member))
5743 if (enemy ==
null && !IsPC)
5745 if (GetInt(106) == 0)
5749 if (OriginalHostility !=
Hostility.Enemy)
5753 SetEnemy(_tg.
Chara);
5767 if (_tg ==
null || !_tg.
isChara)
5774 EClass.pc.combatCount = 10;
5782 chara.
Say(
"frown",
this, chara);
5794 chara.
Say(
"frown",
this, chara);
5801 bool flag = chara.id ==
"fanatic";
5804 chara.
Say(
"callHelp", chara);
5876 bool flag = enemy !=
null || ai is
GoalCombat;
5877 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
5879 bool flag3 = !IsPCParty;
5885 if (chara2 ==
this || !IsHostile(chara2) || !CanSee(chara2))
5889 int num3 = Dist(chara2);
5890 int num4 = GetSightRadius() + (flag ? 1 : 0);
5897 if (
this == pos.FirstChara)
5899 chara2.
ModExp(152, Mathf.Clamp((num - chara2.
Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
5907 DoHostileAction(chara2);
5920 DoHostileAction(chara);
5932 if (chara !=
this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.
pos))
5934 DoHostileAction(chara);
5953 if (base.IsPCFactionOrMinion)
5966 if (OriginalHostility >=
Hostility.Friend)
6007 return EClass.game.activeZone == currentZone;
6014 foreach (
Point item2
in item.ListPoints())
6016 if (pos.Equals(item2))
6037 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6055 if (race.
id ==
"spider" && source.
tiles.Length > 1)
6057 base.idSkin = (EClass.core.config.game.antiSpider ? 1 : 0);
6065 charaRenderer.pccData = PCCData.Create(
"ride");
6066 string idPart = base.c_idRidePCC.IsEmpty(
EClass.
core.
pccs.sets[
"ride"].map[
"body"].map.Keys.First());
6067 charaRenderer.
pccData.SetPart(
"body",
"ride", idPart);
6068 charaRenderer.pccData.ride =
EClass.
core.
pccs.GetRideData(idPart);
6072 foreach (
Condition condition
in conditions)
6075 if (rendererReplacer !=
null)
6077 charaRenderer.replacer = rendererReplacer;
6078 charaRenderer.data = rendererReplacer.
data;
6082 if (charaRenderer.
replacer ==
null)
6084 charaRenderer.pccData = pccData;
6087 renderer = charaRenderer;
6089 if (cardRenderer !=
null)
6091 renderer.SetFirst(first:
false, cardRenderer.
position);
6093 return charaRenderer;
6100 PCC.Get(pccData).Build(state);
6108 PCC pCC = PCC.Get(pccData);
6110 return pCC.variation.idle[0, 0];
6112 return sourceCard.
GetSprite(0, (sourceCard.
_tiles.Length > 1) ? ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6133 else if (conSleep !=
null && host ==
null && pos.Equals(
EClass.
pc.
pos) && IsHuman && GetBool(123))
6142 p.mat = base.material;
6143 p.matColor = base.colorInt;
6144 if (!renderer.usePass)
6148 if (renderer.replacer !=
null)
6150 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6156 int num = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % source.
_tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6161 p.tile = source.
_tiles_snow[0] * ((!flipX) ? 1 : (-1));
6164 else if (sourceCard.
_tiles.Length > 1)
6166 int num2 = ((base.idSkin != 0 || source.
staticSkin) ? base.idSkin : (base.uid % sourceCard.
_tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6167 p.tile = sourceCard.
_tiles[(num2 >= 0 && num2 < sourceCard.
_tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6171 p.tile = sourceCard.
_tiles[0] * ((!flipX) ? 1 : (-1));
6178 string text = base.Name;
6179 if (IsFriendOrAbove())
6183 else if (IsHostile())
6189 if (base.LV >= lV * 5)
6193 else if (base.LV >= lV * 2)
6197 else if (base.LV <= lV / 4)
6201 else if (base.LV <= lV / 2)
6207 string s = (IsFriendOrAbove() ?
"HostilityAlly" : (IsNeutral() ?
"HostilityNeutral" :
"HostilityEnemy"));
6208 s = (
" (" + s.lang() +
") ").TagSize(14);
6212 s += (
" (" +
"guest".lang() +
") ").TagSize(14);
6216 s += (
" (" +
"livestock".lang() +
") ").TagSize(14);
6222 text2 +=
"lowerGround".lang();
6224 else if (HasHigherGround(
EClass.
pc))
6226 text2 +=
"higherGround".lang();
6229 if (Evalue(1232) > 0)
6231 text2 =
"milkBaby".lang().TagSize(14) + text2;
6235 text2 =
"hasBounty".lang().TagSize(14) + text2;
6239 text2 += (
"(" + faith.Name +
")").TagSize(14);
6241 return text + text2 + s;
6249 text += Environment.NewLine;
6250 text = text +
"<size=14>" +
"favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) +
"</size>";
6255 text2 += Environment.NewLine;
6256 text2 = text2 +
"Lv:" + base.LV +
" HP:" + base.hp +
"/" + MaxHP +
" MP:" + mana.value +
"/" + mana.max +
" DV:" + DV +
" PV:" + PV +
" Hunger:" + hunger.
value;
6257 text2 += Environment.NewLine;
6259 text2 += Environment.NewLine;
6260 text2 = text2 + base.uid + IsMinion +
"/" + base.c_uidMaster +
"/" + master;
6261 text2 = text2 +
" dir:" + base.dir +
" skin:" + base.
idSkin;
6265 text2 += Environment.NewLine;
6266 text2 +=
"<size=14>";
6269 text2 = text2 + item.Name +
", ";
6271 foreach (
Hobby item2
in ListHobbies())
6273 text2 = text2 + item2.Name +
", ";
6275 text2 = text2.TrimEnd(
", ".ToCharArray()) +
"</size>";
6278 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ?
new BaseStats[0] :
new BaseStats[2] { hunger, stamina });
6279 if (enumerable.Count() > 0)
6281 text3 += Environment.NewLine;
6282 text3 +=
"<size=14>";
6287 if (text4.IsEmpty() || text4 ==
"#")
6292 switch (item3.
source.group)
6305 text4 = text4 +
"(" + item3.
GetValue() +
")";
6306 if (resistCon !=
null && resistCon.ContainsKey(item3.
id))
6308 text4 = text4 +
"{" + resistCon[item3.
id] +
"}";
6312 text3 = text3 + text4.TagColor(c) +
", ";
6321 text3 = text3.TrimEnd(
", ".ToCharArray()) +
"</size>";
6326 text3 += Environment.NewLine;
6329 text3 = text3 + item4.act.Name +
", ";
6331 text3 = text3.TrimEnd(
", ".ToCharArray());
6333 return text + text2 + text3;
6338 string key = source.
idText.IsEmpty(
id);
6348 string text = row.GetText(topic, returnNull:
true);
6353 if (text.StartsWith(
"@"))
6360 text = row.GetText(topic, returnNull:
true);
6366 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6371 if (host ==
null && !IsInActiveZone)
6375 if (!isSynced && (host ==
null || !host.
isSynced) && topic !=
"dead")
6381 int num = EClass.pc.party.members.Count - 1;
6406 string topicText = GetTopicText(topic);
6407 if (topicText.IsEmpty())
6411 string text =
"_bracketTalk".lang();
6412 bool flag = topicText.StartsWith(
"*");
6413 bool flag2 = topicText.StartsWith(
"(");
6414 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] ==
'“';
6415 topicText = ApplyTone(topicText);
6416 topicText = topicText.Replace(
"~",
"*");
6418 Msg.
Say(topicText.Replace(
"&",
""));
6419 if (topic ==
"dead")
6423 else if (flag || flag3 || flag2)
6425 (host ??
this).renderer.Say(ApplyNewLine(topicText.StripBrackets()),
default(
Color), IsPCParty ? 0.6f : 0f);
6443 if (conSuspend !=
null && IsPCParty)
6445 RemoveCondition<ConSuspend>();
6447 if (IsDeadOrSleeping)
6449 ShowDialog(
"_chara",
"sleep");
6451 else if (base.isRestrained)
6453 ShowDialog(
"_chara",
"strain");
6457 ShowDialog(
"_chara",
"invisible");
6459 else if (IsEscorted())
6461 ShowDialog(
"_chara",
"escort");
6465 ShowDialog(
"_chara",
"party");
6480 EClass.player.flags.loytelEscaped =
false;
6482 ShowDialog(
"loytel",
"loytelEscaped");
6486 if (questDebt !=
null && questDebt.
paid)
6489 if (questDebt.
stage > 7)
6491 questDebt.stage = 1;
6493 ShowDialog(
"loytel",
"debt" + questDebt.
stage);
6501 ShowDialog(
"_chara");
6507 ShowDialog(
"farris",
"nymelle_noQuest");
6510 ShowDialog(
"farris",
"nymelle_first");
6513 ShowDialog(
"farris",
"home_first");
6516 ShowDialog(
"_chara");
6521 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6523 SoundManager.ForceBGM();
6528 ShowDialog(
"ashland");
6532 if (zone_Nymelle !=
null && zone_Nymelle.
IsCrystalLv)
6534 SoundManager.ForceBGM();
6541 EClass.player.flags.fiamaFirstDream =
true;
6542 ShowDialog(
"fiama",
"firstDream");
6546 ShowDialog(
"fiama",
"giveStoryBook").SetOnKill(delegate
6548 EClass.player.flags.fiamaStoryBookGiven =
true;
6554 ShowDialog(
"fiama");
6559 ShowDialog(
"fiama");
6565 ShowDialog(
"big_sister",
"little_saved");
6566 EClass.player.flags.little_saved =
false;
6571 ShowDialog(
"big_sister",
"little_dead");
6572 EClass.player.flags.little_killed =
false;
6580 ShowDialog(
"guild_doorman",
"main", tag);
6586 ShowDialog(
"guild_clerk",
"main", tag2);
6600 ShowDialog(
"_chara");
6607 return _ShowDialog(
book,
null, step, tag);
6613 if (
book ==
"_chara" && IsPC)
6627 return base.LV / 2 + 4;
6633 if (FindBed() !=
null)
6642 return GetHappiness().ToString() ??
"";
6647 string result =
"?????";
6660 uIItem.
text2.
SetText(race.GetText().ToTitleCase(wholeText:
true) +
" " + job.GetText().ToTitleCase(wholeText:
true));
6670 sortVal = job._index * 10000 + sourceCard.
_index;
6673 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard.
_index;
6676 sortVal = -GetTotalFeat();
6679 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
6692 foreach (
Card item in map.props.installed.all)
6696 traitBed.RemoveHolder(
this);
6715 if (!IsPCFaction && !IsGuest())
6724 Msg.
Say(
"claimBed",
this);
6733 if (GetInt(113) != 0)
6738 Thing bestRangedWeapon = GetBestRangedWeapon();
6739 foreach (
Thing thing
in things)
6745 _ListItems.Add(thing);
6749 _ListItems.Add(thing);
6753 if (_ListItems.Count == 0)
6757 List<Thing> containers2 = containers.ToList();
6758 foreach (
Thing listItem
in _ListItems)
6782 bool flag = GetInt(113) == 0;
6791 foreach (
Thing thing3
in things)
6793 if (CanEat(thing3, shouldEat))
6801 if (thing3.
id ==
"polish_powder")
6815 foreach (
Thing container
in containers)
6825 if (num3 > 0 && thing4.
id ==
"polish_powder")
6827 _ListItems.Add(thing4);
6832 _ListItems.Add(thing4);
6837 _ListItems.Add(thing4);
6840 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.
c_isImportant)
6842 _ListItems.Add(thing4);
6847 _ListItems.Add(thing4);
6852 _ListItems.Add(thing4);
6857 if (_ListItems.Count == 0)
6861 _ListItems.ForeachReverse(delegate(
Thing t)
6866 int slot = t.category.slot;
6867 int equipValue = t.GetEquipValue();
6868 foreach (Thing listItem in _ListItems)
6870 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
6878 _ListItems.Remove(t);
6883 foreach (
Thing listItem2
in _ListItems)
6885 Thing thing = listItem2;
6886 if (things.IsFull(thing))
6893 thing = thing.
Split(2);
6900 if (ShouldEquip(thing, useFav:
true) && thing.
category.slot != 0)
6902 TryEquip(thing, useFav:
true);
6908 TryPutSharedItems(containers);
6914 Thing result =
null;
6922 int num2 = CountNumEaten(
item);
6923 int num3 = 100 - num2;
6937 t = FindBestFoodToEat();
6949 Say(
"eat_start",
this, t.Duplicate(1));
6980 if (!CanEquipRanged(t))
6985 foreach (
Thing thing
in things)
7006 if (bodySlot ==
null)
7012 switch (GetFavAttackStyle())
7060 if (!ShouldEquip(t, useFav))
7071 switch (GetFavAttackStyle())
7087 body.
Equip(t, slot);
7093 Say(
"equip",
this, t);
7109 return FindThrowable(hotbar:
true);
7113 things.Foreach(delegate(
Thing t)
7115 if (t.
HasTag(
CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.
HasTag(
CTAG.throwWeaponEnemy)))
7121 Thing FindThrowable(
bool hotbar)
7123 things.Foreach(delegate(
Thing t)
7160 return things.Find((
Thing t) => ranged.
IsAmmo(t));
7165 Thing result =
null;
7167 foreach (
Thing thing
in things)
7190 if (ranged !=
null && ranged.
parent ==
this)
7194 ranged = GetBestRangedWeapon();
7195 return ranged !=
null;
7200 if (body.
GetWeight(armorOnly:
true) <= 30000)
7225 if (t.
id ==
"cigar")
7230 if (t.
trait.
CanEat(
this) && hunger.
GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7232 SetAIImmediate(
new AI_Eat
7251 if (base.hp < MaxHP * 90 / 100)
7254 if (healAction !=
null)
7265 return FindBed()?.owner.pos.cell.room;
7280 if (IsPCFaction && homeBranch !=
null)
7282 num += (int)Mathf.Sqrt(homeBranch.
Evalue(2117)) * 5;
7291 a = affinity.
Mod(a);
7301 Say(
"affinityNone",
this, c);
7305 ShowEmo((!flag) ?
Emo.angry :
Emo.love);
7309 Say(flag ?
"affinityPlus" :
"affinityMinus",
this, c);
7315 int num = Evalue(289);
7327 num2 += (lV - num) * 10;
7329 elements.
ModExp(289, Mathf.Min(num2, 1000));
7345 chara.orgPos = orgPos.
Copy();
7347 chara.pos = pos.
Copy();
7348 chara.isImported =
true;
7349 chara.c_editorTags = base.c_editorTags;
7350 chara.c_editorTraitVal = base.c_editorTraitVal;
7351 chara.c_idTrait = base.c_idTrait;
7352 chara.homeZone = homeZone;
7358 if (_listFavFood.Count == 0)
7362 if (row._origin ==
"dish" && row.value != 0)
7364 _listFavFood.Add(row);
7371 r = _listFavFood.RandomItem();
7379 if (_listFavCat.Count == 0)
7385 _listFavCat.Add(row);
7391 r = _listFavCat.RandomItem();
7399 if (base.c_upgrades !=
null)
7401 num += base.c_upgrades.spent;
7403 if (base.c_genes !=
null)
7405 num += base.c_genes.GetTotalCost();
7407 return num + base.feat;
7414 if (
item.act.id == 6630)
7424 string text = race.
id;
7425 if ((text ==
"mifu" || text ==
"nefu") &&
EClass.
rnd(2) == 0)
7438 if (
id ==
"olderyoungersister")
7440 if (base.idSkin != 2)
7442 return "UN_olderyoungersister";
7444 return "UN_olderyoungersister_alt";
7450 return base.c_idPortrait;
7455 EClass.player.forceTalk =
true;
7460 PlayEffect(
"revive");
7463 AddCondition<ConDim>(200);
7482 int num2 = base.LV - source.
LV;
7495 return GiveBirth(thing, effect);
7498 public Thing MakeEgg(
bool effect =
true,
int num = 1,
bool addToZone =
true)
7507 return GiveBirth(thing, effect);
7514 if (HasElement(1231))
7517 AddCondition<ConEuphoric>();
7521 SetFeat(1231, 1, msg:
true);
7528 int num2 = ((!HasElement(1411)) ? 1 : 3);
7529 if (GetBurden(t, num) >= num2)
7542 if (!IsValidGiftWeight(t, num))
7550 if ((t.
category.IsChildOf(
"furniture") || t.
category.IsChildOf(
"junk")) && !HasElement(1411))
7559 if (things.IsFull())
7586 Msg.
Say(
"affinityNone", c,
this);
7592 int num2 = 200 + t.LV * 3;
7608 c.
Say(
"draw_curse", c, t);
7610 List<Element> list =
new List<Element>();
7618 if (list.Count == 0)
7623 Element element = list.RandomItem();
7629 if ((t.
id ==
"lovepotion" || t.
id ==
"dreambug") && !Application.isEditor)
7631 GiveLovePotion(c, t);
7645 case "ticket_massage":
7652 case "ticket_armpillow":
7660 case "ticket_champagne":
7667 if (t.
id ==
"flyer")
7672 c.
Talk(
"flyer_miss");
7678 Msg.
Say(
"affinityNone", c,
this);
7680 elements.ModExp(291, 10);
7683 elements.ModExp(291, 50);
7685 if (t.
id ==
"statue_weird")
7706 Say(
"give_erohon",
this);
7707 AddCondition<ConParalyze>(50, force:
true);
7708 AddCondition<ConConfuse>(50, force:
true);
7709 AddCondition<ConFear>(1000, force:
true);
7717 c.
Say(
"give_love", c, t);
7727 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker ==
this || (host !=
null && host.
isRestrained) || (base.IsPCFactionOrMinion && attacker.
IsPCFactionOrMinion))
7743 int num = Mathf.Max(chara.
Evalue(1649), (!chara.
IsPC) ? ((!flag2) ? 1 : 3) : 0);
7744 int num2 = Dist(chara);
7749 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7755 if (Dist(chara) < 5)
7762 Point nearestPoint = pos.
GetNearestPoint(allowBlock:
false, allowChara:
false, allowInstalled:
true, ignoreCenter:
true);
7770 Say(
"intercept_loyal", chara,
this);
7773 if (num2 > num || !chara.
CanSeeLos(pos, num2))
7778 if (!flag && !HasElement(1225))
7780 Say(
"intercept", chara,
this);
7783 chara.
Talk(
"intercept", base.NameSimple);
7785 if (attacker.enemy ==
this)
7787 attacker.SetEnemy(chara);
7849 if (t.
id ==
"flyer")
7869 for (
int num2 = things.Count - 1; num2 >= 0; num2--)
7871 Thing thing = things[num2];
7872 if (ShouldThrowAway(thing, type))
7883 Msg.
Say(
"party_sell",
this, num.ToString() ??
"");
7891 _ = base.c_upgrades;
7900 for (
int i = 0; i < 100; i++)
7906 if (base.c_upgrades ==
null)
7910 if (base.c_upgrades.halt)
7921 List<Element> list = ListAvailabeFeats(pet:
true);
7922 if (num >= 90 && list.Count > 0)
7924 Element element = list.RandomItem();
7928 else if (num >= 60 && ie.Any())
7930 num2 = ie.RandomItem().id;
7941 if (num4 > base.feat)
7946 base.c_upgrades.count++;
7947 base.c_upgrades.spent += num4;
7953 if (
item.idEle == num2)
7974 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg:
true);
7976 else if (elements.ValueWithoutLink(row.
id) == 0)
7978 elements.Learn(row.
id);
7982 elements.ModBase(num2, num3);
7989 if (_cooldowns ==
null)
7991 _cooldowns =
new List<int>();
7995 _cooldowns.Add(idEle * 1000 + turns);
8001 _cooldowns.Add(idEle * 1000 + row.
cooldown);
8007 if (_cooldowns !=
null)
8009 for (
int i = 0; i < _cooldowns.Count; i++)
8011 if (_cooldowns[i] / 1000 == idEle)
8022 for (
int num = _cooldowns.Count - 1; num >= 0; num--)
8024 if (_cooldowns[num] % 1000 == 1)
8026 _cooldowns.RemoveAt(num);
8033 if (_cooldowns.Count == 0)
8046 if (IsPCParty || base.noMove)
8051 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8054 if (goalFromTimeTable !=
null)
8056 SetAI(goalFromTimeTable);
8059 goalFromTimeTable.
Tick();
8064 if (goalList.
index == -2)
8066 goalList.
Refresh(
this, goalListType);
8068 SetAI(goalList.
Next());
8092 return GetGoalWork();
8098 return GetGoalHobby();
8140 return SetAI(_NoGoalPC);
8158 Debug.Log(
"goal is g:" + ai?.ToString() +
"/" +
this);
8162 if (HasCondition<ConWait>())
8164 RemoveCondition<ConWait>();
8170 renderer.RefreshStateIcon();
8177 bool hasNoGoal = HasNoGoal;
8212 listHobby.Add(
new Hobby
8223 foreach (
int work
in _works)
8225 listHobby.Add(
new Hobby
8239 if (_hobbies ==
null)
8243 foreach (
int hobby
in _hobbies)
8245 listHobby.Add(
new Hobby
8258 if (
item.source.alias ==
id)
8263 foreach (
Hobby item2
in ListHobbies())
8265 if (item2.
source.alias ==
id)
8275 if (workElements !=
null)
8279 workElements =
null;
8280 if (IsPCParty || homeBranch ==
null || homeBranch.
owner ==
null)
8288 foreach (
Hobby item2
in ListWorks())
8292 if (workElements !=
null)
8296 void TryAdd(
Hobby h)
8298 if (!h.
source.elements.IsEmpty())
8300 if (workElements ==
null)
8304 for (
int i = 0; i < h.
source.elements.Length; i += 2)
8306 int num = h.
source.elements[i];
8307 int num2 = h.
source.elements[i + 1];
8309 if (num != 2115 && num != 2207)
8317 workElements.
ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.
source.elements[i + 1] * num3 / 1000));
8325 string text = (simple ?
"" : (
"hobby".lang() +
":"));
8330 return text.TrimEnd(
',');
8335 string text = (simple ?
"" : (
"work".lang() +
":"));
8340 return text.TrimEnd(
',');
8345 foreach (
int hobby
in _hobbies)
8357 foreach (
int work
in _works)
8369 if (_hobbies !=
null && _works !=
null)
8376 _hobbies =
new List<int>();
8377 _works =
new List<int>();
8385 string[] hobbies = source.
hobbies;
8386 foreach (
string key
in hobbies)
8391 if (source.
works.IsEmpty())
8397 string[] hobbies = source.
works;
8398 foreach (
string key2
in hobbies)
8403 GetWorkSummary().Reset();
8408 if (_workSummary ==
null)
8412 return _workSummary;
8425 if (workSummary.
work !=
null)
8430 else if (workSummary.
hobbies.Count > 0)
8451 hobby.id = session.
id;
8456 workSummary.progress +=
EClass.
rnd(5) + 5;
8458 int num = PerformWork(hobby, 0, isHobby);
8459 int num2 = PerformWork(hobby, 1, isHobby);
8460 int num3 = PerformWork(hobby, 2, isHobby);
8461 int num4 = PerformWork(hobby, 3, isHobby);
8462 workSummary.money += num;
8463 workSummary.food += num2;
8464 workSummary.knowledge += num3;
8465 workSummary.material += num4;
8466 int PerformWork(
Hobby work,
int idx,
bool isHobby)
8468 if (idx >= work.
source.resources.Length)
8472 int num5 = work.
source.resources[idx];
8474 num5 =
Rand.
Range(num5 * (100 - work.
source.resources[idx]) / 100, num5);
8475 num5 = num5 * (isHobby ? 50 : 100) * session.
efficiency / 10000;
8476 if (num6 > 0 && num5 <= 0)
8486 _goalWork.
FindWork(
this, setAI:
false);
8502 foreach (
Condition condition
in conditions)
8504 condition.
SetOwner(
this, onDeserialize);
8510 return AddCondition(typeof(T).Name, p, force);
8523 if (c is
ConBleed && ResistLv(964) >= 3)
8528 else if (ResistLv(950) >= 3)
8546 if (c.
source.negate.Length != 0)
8548 string[] negate = c.
source.negate;
8549 foreach (
string text
in negate)
8551 if (HasElement(text))
8558 if (defenseAttribute !=
null)
8560 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.
Value, 1);
8562 if (c.
source.resistance.Length != 0)
8567 c.power /= num * num + 1;
8580 for (
int j = 0; j < conditions.Count; j++)
8582 if (conditions[j].
id != c.
id)
8588 conditions[j].Kill();
8591 if (conditions[j].CanStack(c))
8593 if (conditions[j].WillOverride)
8595 conditions[j].Kill(silent:
true);
8598 if (CanGainConResist)
8602 conditions[j].OnStacked(c.
power);
8603 conditions[j].OnStartOrStack();
8604 conditions[j].PlayEffect();
8606 if (!conditions[j].AllowMultipleInstance)
8611 foreach (
Condition condition
in conditions)
8618 int num2 = c.EvaluateTurn(c.power);
8625 if (CanGainConResist)
8632 if (c.ShouldRefresh)
8640 if (c.SyncRide && (ride !=
null || parasite !=
null))
8646 if (parasite !=
null)
8654 public override bool HasCondition<T>()
8656 for (
int i = 0; i < conditions.Count; i++)
8658 if (conditions[i] is T)
8668 for (
int i = 0; i < conditions.Count; i++)
8670 if (conditions[i].source.alias == alias)
8685 for (
int i = 0; i < conditions.Count; i++)
8689 return conBuffStats.elements.GetElement(ele);
8695 public void CureCondition<T>(
int v = 99999) where T :
Condition
8697 T condition = GetCondition<T>();
8698 if (condition !=
null)
8700 condition.value -= v;
8701 if (condition.value <= 0)
8710 for (
int i = 0; i < conditions.Count; i++)
8712 if (conditions[i] is T)
8714 return conditions[i] as T;
8722 for (
int num = conditions.Count - 1; num >= 0; num--)
8724 if (conditions[num] is T)
8726 conditions[num].
Kill();
8734 if (parasite !=
null)
8736 parasite.
Cure(type, p, state);
8740 ride.
Cure(type, p, state);
8742 Cure(type, p, state);
8752 CureCondition<ConFear>();
8753 CureCondition<ConBlind>(2 * p / 100 + 5);
8754 CureCondition<ConPoison>(5 * p / 100 + 5);
8755 CureCondition<ConConfuse>(10 * p / 100 + 10);
8756 CureCondition<ConDim>(p / 100 + 5);
8757 CureCondition<ConBleed>(2 * p / 100 + 10);
8764 CureCondition<ConBlind>(5 * p / 100 + 15);
8765 CureCondition<ConPoison>(10 * p / 100 + 15);
8766 CureCondition<ConBleed>(5 * p / 100 + 20);
8767 CureTempElements(p, body:
true, mind:
false);
8770 CureCondition<ConFear>();
8771 CureCondition<ConDim>(3 * p / 100 + 10);
8772 CureTempElements(p, body:
false, mind:
true);
8776 for (
int num2 = conditions.Count - 1; num2 >= 0; num2--)
8778 Condition condition2 = conditions[num2];
8783 condition2.
Mod(-1, force:
true);
8791 CureCondition<ConWait>();
8792 CureCondition<ConDisease>((
EClass.
rnd(20) + 10) * p / 100);
8793 bool flag2 = HasCondition<ConAnorexia>();
8794 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
8795 if (base.c_vomit < 0)
8800 RemoveCondition<ConAnorexia>();
8810 CureTempElements(p * 100, body:
true, mind:
true);
8811 for (
int num = conditions.Count - 1; num >= 0; num--)
8826 CureCondition<ConWait>();
8827 CureCondition<ConSleep>();
8835 if (HasElement(1206))
8837 SetFeat(1206, 0, msg:
true);
8851 if (
TC.hp >
TC.MaxHP * Mathf.Min(5 + (
int)Mathf.Sqrt(power),
harvest ? 35 : 25) / 100)
8855 if (
TC.HasElement(427))
8863 PlaySound(
"hit_finish");
8865 Say(
"finish2",
this,
TC);
8875 if (resistCon ==
null)
8877 resistCon =
new Dictionary<int, int>();
8879 if (resistCon.ContainsKey(key))
8881 resistCon[key] += con.power * con.GainResistFactor / 100;
8885 resistCon[key] = con.power * con.GainResistFactor / 100;
8892 if (con.
power > 0 && resistCon !=
null)
8894 int a =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)resistCon, con.
id, 0);
8912 RemoveCondition<ConAwakening>();
8917 con.pcPillow = pillow;
8918 con.pickup = pickup;
8919 con.posBed = posBed;
8920 con.posPillow = posPillow;
8927 int num =
bed?.Power ?? 20;
8928 if (traitPillow !=
null)
8930 num += traitPillow.owner.Power / 2;
8934 num +=
bed.Evalue(750) * 5;
8945 int num = power * days;
8946 if (stamina.
value < 0)
8951 stamina.
Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
8967 int height = bio.height;
8968 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8973 if (height != bio.height)
8975 bio.height = height;
8976 Say((a > 0) ?
"height_gain" :
"height_lose",
this);
8986 int weight = bio.weight;
8987 int height = bio.height;
8988 int num = height * height * 18 / 25000;
8989 int num2 = height * height * 24 / 10000;
8990 if (ignoreLimit || (weight > num && weight < num2))
8992 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8997 if (weight != bio.weight)
8999 bio.weight = weight;
9000 Say((a > 0) ?
"weight_gain" :
"weight_lose",
this);
9009 if (ResistLv(962) > 0 &&
EClass.
rnd(ResistLv(962) + 1) != 0)
9013 int num = Evalue(412);
9016 float num2 = (float)a * 100f / (
float)Mathf.Max(100 + num * 2, 10);
9017 a = (int)num2 + ((
EClass.
rndf(1f) > num2 % 1f) ? 1 : 0);
9024 int num3 = (corruption + a) / 100 - corruption / 100;
9025 for (
int i = 0; i < Mathf.Abs(num3); i++)
9027 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether:
true))
9034 foreach (
Element value
in elements.dict.Values)
9036 if (value.
source.category ==
"ether")
9038 num4 += value.
Value;
9041 if (num4 > 0 && IsPC)
9045 corruption = num4 * 100 + corruption % 100;
9050 List<Element> list =
new List<Element>();
9053 Feat feat = elements.GetOrCreateElement(
item.id) as
Feat;
9054 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.
ValueWithoutLink + 1));
9063 public void SetFeat(
int id,
int value = 1,
bool msg =
false)
9065 Feat feat = elements.GetElement(
id) as
Feat;
9067 if (feat !=
null && feat.
Value > 0)
9069 if (value == feat.
Value)
9078 feat = elements.SetBase(
id, value - (feat?.vSource ?? 0)) as
Feat;
9083 elements.Remove(
id);
9088 CalculateMaxStamina();
9094 if (feat.
source.textInc.IsEmpty())
9096 PlaySound(
"ding_skill");
9098 Say(
"gainFeat",
this, feat.
FullName);
9102 bool flag = value < num;
9103 if (feat.
source.tag.Contains(
"neg"))
9107 PlaySound(
"mutation");
9109 Say((value > num) ? feat.
source.GetText(
"textInc") : feat.
source.GetText(
"textDec"),
this, feat.
FullName);
9111 elements.CheckSkillActions();
9116 if (!ether && vec >= 0 && HasElement(406) &&
EClass.
rnd(5) != 0)
9118 Say(
"resistMutation",
this);
9122 for (
int i = 0; i < tries; i++)
9125 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9128 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9129 if (base.c_corruptionHistory.Count == 0)
9131 base.c_corruptionHistory =
null;
9134 Element element = elements.GetElement(row.
id);
9136 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))
9143 element = elements.GetElement(row.
id);
9145 bool flag = row.
tag.Contains(
"neg");
9158 if (element !=
null)
9160 num = element.Value + ((vec != 0) ? vec : ((
EClass.
rnd(2) == 0) ? 1 : (-1)));
9161 if (num > element.
source.max)
9163 num = element.source.max - 1;
9165 flag = (flag && num > element.
Value) || (!flag && num < element.
Value);
9166 flag2 = num > element.
Value;
9167 if (vec > 0 && !flag2)
9172 Say(flag2 ?
"mutation_gain" :
"mutation_loose",
this);
9173 SetFeat(row.
id, num);
9176 if (base.c_corruptionHistory ==
null)
9178 base.c_corruptionHistory =
new List<int>();
9180 base.c_corruptionHistory.Add(row.
id);
9183 Element element2 = elements.GetElement(row.
id);
9188 EClass.player.flags.gotEtherDisease =
true;
9190 thing.
SetStr(53,
"letter_ether");
9199 PlaySound(ether ?
"mutation_ether" :
"mutation");
9200 PlayEffect(
"mutation");
9202 Say(row.GetText(flag ?
"textDec" :
"textInc", returnNull:
true) ?? row.
alias,
this);
9206 Say(
"nothingHappens");
9212 Element orCreateElement = elements.GetOrCreateElement(ele);
9215 elements.ModBase(orCreateElement.
id, 1);
9217 if (orCreateElement is
Spell)
9219 int num = mtp * orCreateElement.source.charge * (100 + Evalue(307) + (HasElement(307) ? 20 : 0)) / 100 / 100;
9220 if (orCreateElement.
source.charge == 1)
9224 orCreateElement.vPotential += Mathf.Max(1, num / 2 +
EClass.
rnd(num / 2 + 1));
9226 Say(
"spell_gain",
this, orCreateElement.
Name);
9238 Msg.
Say(
"curse_nullify", member);
9243 else if (HasElement(1641) &&
EClass.
rnd(3) != 0)
9245 Say(
"curse_nullify",
this);
9248 if (GetCondition<ConHolyVeil>() !=
null &&
EClass.
rnd(5) != 0)
9250 Say(
"curse_nullify",
this);
9258 if (_historyFood !=
null)
9260 while (_historyFood.Count > 5)
9262 _historyFood.RemoveAt(_historyFood.Count - 1);
9264 if (_historyFood[0].Count > 0)
9266 _historyFood.Insert(0,
new List<string>());
9273 if (!IsPCFaction || !IsGlobal)
9275 _historyFood =
null;
9278 if (_historyFood ==
null)
9280 _historyFood =
new List<List<string>>
9285 if (_historyFood[0].Count < 5)
9287 _historyFood[0].Add(
food.id);
9293 if (_historyFood ==
null)
9298 foreach (List<string>
item in _historyFood)
9300 foreach (
string item2
in item)
9302 if (item2 ==
food.id)
9315 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9317 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9322 if (faithElements !=
null)
9327 if (idFaith ==
"eyth" && !HasElement(1228))
9342 if (!HasCondition<ConExcommunication>())
9345 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9346 for (
int i = 0; i < array.Length; i += 2)
9348 int num2 = array[i + 1] * num / 50;
9351 num2 =
EClass.
curve(num2, array[i + 1] * 2, 10, 50);
9353 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9357 faithElements.
SetBase(array[i], Mathf.Max(num2, 1));
9369 if (tempElements ==
null)
9374 if (a > 0 && tempElements.
Base(ele) > a)
9376 a = a * 100 / (200 + (tempElements.
Base(ele) - a) * 10);
9378 int num = Mathf.Abs(elements.ValueWithoutLink(ele)) * 2 + 20;
9379 int num2 = tempElements.
Base(ele) + a;
9380 if (num2 < -num || num2 > num || (a < 0 && num2 < -100))
9385 if (element.
vBase == 0)
9388 if (tempElements.
dict.Count == 0)
9390 tempElements =
null;
9409 ModTempElement(ele, -(p / 100 +
EClass.
rnd(p / 100 + 1) + 1));
9426 ModTempElement(ele, p / 100 +
EClass.
rnd(p / 100 + 1));
9431 if (tempElements ==
null)
9439 ModTempElement(
item.id, -Mathf.Min(
item.vBase * 5 / 100 + 1,
item.vBase), naturalDecay:
true);
9446 if (tempElements !=
null)
9457 void Cure(
int[] eles)
9459 foreach (
int ele
in eles)
9461 if (tempElements ==
null)
9466 if (element !=
null && element.
vBase < 0)
9468 ModTempElement(ele, Mathf.Clamp(p / 20 +
EClass.
rnd(p / 20), 1, -element.
vBase));
9476 if (tempElements !=
null)
9479 tempElements =
null;
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
static Act Create(int id)
virtual bool ShouldAllyAttack(Chara tg)
virtual bool CancelOnAggro
override string ToString()
virtual bool CancelWhenMoved
string GetCurrentActionText()
virtual Point GetDestination()
virtual void OnPerformWork(bool realtime)
bool TryCancelInteraction(bool sound=true)
void SetTurbo(int mtp=-1)
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
static void Search(Chara c, bool manual=false)
virtual TargetType TargetType
bool IsTargetHostileParty()
virtual bool CanRapidFire
static Affinity Get(Chara c)
void SetStr(int id, string value=null)
void SetInt(int id, int value=0)
virtual RendererReplacer GetRendererReplacer()
virtual bool PreventRegen
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool TryMove(Point p)
Element GetDefenseAttribute(Chara c=null)
bool TryNullify(Condition c)
void Mod(int a, bool force=false)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual void OnEndPlayerTurn()
virtual ConditionType Type
virtual string GetPhaseStr()
static void Set(CardBlueprint _bp)
static CardBlueprint CharaGenEQ
GlobalCharaList globalCharas
void PlayAnime(AnimeID id, bool force)
RendererReplacer replacer
void Teleport(Point point, bool silent=false, bool force=false)
void MakeRefFrom(string id)
int EvalueMax(int ele, int min=0)
ElementContainerCard elements
Hostility c_originalHostility
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
bool HasElement(int ele, int req=1)
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
virtual void SetBlessedState(BlessedState s)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void ModCurrency(int a, string id="money")
virtual bool IsAliveInCurrentZone
Card MakeFoodFrom(string _id)
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
BlessedState blessedState
bool TryStackTo(Thing to)
virtual bool IsPCFactionMinion
void ApplyBacker(int bid)
void ModExp(string alias, int a)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
void Say(string lang, string ref1=null, string ref2=null)
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 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()
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
void Refresh(bool calledRecursive=false)
void ChangeRace(string idNew)
void SetHomeZone(Zone zone)
static List< Chara > _pts
void ModTempElement(int ele, int a, bool naturalDecay=false)
override string actorPrefab
override bool IsAliveInCurrentZone
bool IsFriendOrAbove(Chara c)
int GetBurden(Card t=null, int num=-1)
override void ApplyEditorTags(EditorTag tag)
Thing FindBestFoodToEat()
Hostility OriginalHostility
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
bool CanAcceptGift(Chara c, Card t)
WorkSummary GetWorkSummary()
override void Rotate(bool reverse=false)
Chara CreateReplacement()
override Sprite GetImageSprite()
MoveResult TryMoveFrom(Point p)
void MoveHome(Zone zone, int x=-1, int z=-1)
void ChangeMemberType(FactionMemberType type)
void CureTempElements(int p, bool body, bool mind)
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
void SetFaction(Faction f)
Element GetBuffStats(string alias)
void Cuddle(Chara c, bool headpat=false)
bool IsCriticallyWounded(bool includeRide=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
void OnSleep(int power, int days=1)
override CardRow sourceRenderCard
override int GetArmorSkill()
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)
void Kick(Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true)
static List< SourceCategory.Row > _listFavCat
void SetFeat(int id, int value=1, bool msg=false)
bool CanSeeLos(Card c, int dist=-1)
void DamageTempElements(int p, bool body, bool mind)
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
override string ToString()
void TryTakeSharedItems(IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
ElementContainer tempElements
void TryPutSharedItems(bool msg=true)
void SetMainElement(int id, int v=0, bool elemental=false)
void ApplyRace(bool remove=false)
bool CanAcceptItem(Card t, int num=-1)
bool TryWorkOutside(SourceHobby.Row sourceWork)
override void OnSerializing()
List< Condition > conditions
void HoldCard(Card t, int num=-1)
void PickHeld(bool msg=false)
bool HasCondition(string alias)
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
static List< Thing > _ListItems
void SetMainElement(string id, int v=0, bool elemental=false)
Thing GetBestRangedWeapon()
void DiminishTempElements(int a=1)
override string GetName(NameStyle style, int num=-1)
Chara SetGlobal(Zone _home, int x, int z)
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)
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 Kick(Point p, bool ignoreSelf=false)
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
override void LookAt(Point p)
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
override bool IsPCFactionMinion
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
bool CanEat(Thing t, bool shouldEat=false)
bool ShouldThrowAway(Thing t, ClearInventoryType type)
ElementContainer _baseWorkElements
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
void SetAIImmediate(AIAct g)
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
void PickOrDrop(Point p, Thing t, bool msg=true)
static GoalHobby _goalHobby
override bool IsDeadOrSleeping
List< Hobby > ListHobbies(bool useMemberType=true)
void MakeAlly(bool msg=true)
void RemoveLastBodyPart(bool msg=false)
ElementContainer baseWorkElements
void TickWork(VirtualDate date)
void Stumble(int mtp=100)
void ClearInventory(ClearInventoryType type)
void 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()
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 GainAbility(int ele, int mtp=100)
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)
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
void EnhanceTempElements(int p, bool body, bool mind)
Chara SetEnemy(Chara c=null)
void CallHelp(Chara tg, bool fanatic=false)
void DoHostileAction(Card _tg, bool immediate=false)
Thing GiveBirth(Thing t, bool effect)
bool CanSeeSimple(Point p)
void RequestProtection(Chara attacker, Action< Chara > action)
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()
void EnhanceTempElement(int ele, int p)
bool CanSeeLos(Point p, int dist=-1)
int CountNumEaten(Thing food)
void ResistCon(Condition con)
void SetSummon(int duration)
Element GetFavArmorSkill()
bool IsEnemyOnPath(Point p, bool cancelAI=true)
void InitStats(bool onDeserialize=false)
void MoveHome(string id, int x=-1, int z=-1)
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true)
bool TryIdentify(Thing t, int count=1, bool show=true)
Thing TryPoisonPotion(Thing t)
void TryTakeSharedItems(bool msg=true)
override void LookAt(Card c)
static List< SourceThing.Row > _listFavFood
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
static string[] IDTimeTable
TimeTable.Span CurrentSpan
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
void TrySetEnemy(Chara c)
override void OnCreate(int genLv)
void TryAbsorbRod(Thing t)
string GetTextWork(bool simple=false)
void TryPush(Point point)
string GetTextHobby(bool simple=false)
Dictionary< int, int > resistCon
void OnSleep(Thing bed=null, int days=1)
override string GetHoverText2()
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true)
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)
void DamageTempElement(int ele, int p)
AttackStyle GetFavAttackStyle()
bool HasCooldown(int idEle)
static GoalWork _goalWork
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()
UD_String_MatData matColors
Gradient gradientLVComparison
void Kill(bool silent=false)
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
static void Collect(Thing t)
bool ignoreBackerDestoryFlag
BackerContentConfig backer
static Thing GenerateGene(Chara c, Type? type=null)
int GetRaw(int offsetHours=0)
static void TryWarnMana(Action action)
static ColorProfile Colors
static int curve(int a, int start, int step, int rate=75)
static SourceManager sources
static float rndf(float a)
static FactionBranch Branch
static BaseGameScreen screen
static int rndHalf(int a)
static SoundManager Sound
static GameSetting setting
static Effect Get(Effect original)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Dictionary< int, Element > dict
int ValueWithoutLink(int ele)
void ModExp(int ele, int a, bool chain=false)
Element ModBase(int ele, int v)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
Element SetBase(string alias, int v, int potential=0)
Element GetElement(string alias)
static SourceElement.Row Get(int id)
virtual int GetPower(Card c)
static Element Create(int id, int v=0)
virtual Act.Cost GetCost(Chara c)
static List< SourceElement.Row > ListElements
static int[] List_MainAttributesMajor
TileInfo GetTileInfo(int gx, int gy)
static Expedition Create(Chara c, ExpeditionType type)
static SourceFloor.Row sourceSnow
static SourceFloor.Row sourceIce
static bool IsTatami(int id)
static SourceFloor.Row sourceWood
ExpeditionManager expeditions
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
Dictionary< string, Faction > dictAll
List< string > Apply(int a, ElementContainer owner, bool hint=false)
override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv=-1)
static void Proc(Chara c, Thing food)
Dictionary< int, byte > lastPoints
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
bool disableDeathPenaltyProtection
UD_String_ElementRef elements
ConfigPreference preference
ConfigAutoCombat autoCombat
ReligionManager religions
bool Save(bool isAutoSave=false, bool silent=false)
PCCUniformManager uniforms
void Refresh(Chara owner, GoalListType type)
void ValidateHobby(Chara c)
bool FindWork(Chara c, bool setAI=true)
static GuildFighter Fighter
int GetEfficiency(Chara c)
static bool Has(string id)
static string[] GetList(string id)
static string _currency(object a, string IDCurrency)
static void SetDirty(Element a)
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
static void SetDirty(Thing t)
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
static SourceMaterial.Row sourceOak
static SourceMaterial.Row sourceSnow
static SourceMaterial.Row sourceIce
Thing FindThing(Func< Thing, bool > func)
Chara FindChara(string id)
void MoveCard(Point p, Card t)
void SetLiquid(int x, int z, CellEffect effect=null)
void SetFoormark(Point pos, int id, int angle, int offset=0)
void SetEffect(int x, int z, CellEffect effect=null)
static ThirstPersonInfo thirdPerson1
static string SayNothingHappen()
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
void RemoveMember(Chara c)
void AddMemeber(Chara c, bool showMsg=false)
void RequestPathImmediate(PathProgress progress)
Point GetFirstStep(Point origin, Point _dest, IPathfindWalker walker, int maxDist=20, MoveType moveType=MoveType.Default)
static PathManager Instance
List< PathFinderNode > nodes
void EndTurn(bool consume=true)
void EnterLocalZone(bool encounter=false, Chara mob=null)
HashSet< int > doneBackers
Thing DropReward(Thing t, bool silent=false)
bool TryAbortAutoCombat(bool immediate=true)
SourceMaterial.Row matFloor
SourceBlock.Row sourceBlock
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
void SetObj(int id=0, int value=1, int dir=0)
ref Vector3 Position(int height)
List< Card > ListCards(bool includeMasked=false)
override string ToString()
Point Set(int _x, int _z)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Point GetPointTowards(Point dest)
bool Equals(int _x, int _z)
List< Chara > ListCharas()
SourceFloor.Row sourceFloor
void SetBlock(int idMat=0, int idBlock=0)
Point GetRandomNeighbor()
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
bool IsActive(int id, int days=-1)
static string GetRandomPortrait(string idDict)
static HashSet< string > allIds
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
virtual void OnGiveItem(Chara c, Thing t)
void OnSetGoal(AIAct newGoal)
static int Range(int min, int max)
static void UseSeed(int seed, Action action)
static void SetSeed(int a=-1)
static int Set(Zone zone)
Dictionary< string, Religion > dictAll
ReligionMoonShadow MoonShadow
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
static Religion recentWrath
void Revelation(string idTalk, int chance=100)
int ConvertTile(int tile)
bool ContainsTag(string _tag)
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
static void ShakeCam(string id="default", float magnitude=1f)
SourceCharaText charaText
SourceCategory categories
virtual bool ShowDangerLv
virtual bool IsSnowCovered
static int GetAffinityMod(int phase)
static StatsSleepiness Sleepiness
static StatsHygiene Hygiene
static StatsBurden Burden
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
static StatsStamina Stamina
static StatsHunger Hunger
static SubPassData Default
static TargetTypeSelfParty SelfParty
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
static void TryLickChest(Thing chest)
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
static Thing CreateParcel(string idLang=null, params Thing[] things)
static Thing CreateSpellbook(string alias, int num=1)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing CreateScroll(int ele, int num=1)
static Thing CreateCurrency(int a, string id="money")
static Thing Create(string id, int idMat=-1, int lv=-1)
override string GetName(NameStyle style, int _num=-1)
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
virtual bool UseRandomAlias
virtual bool CanExtendBuild
virtual void OnTickHeld()
virtual void OnSteppedOut(Chara c)
virtual bool CanBeDestroyed
virtual bool CanRead(Chara c)
virtual bool CanEat(Chara c)
virtual bool IsChangeFloorHeight
virtual void OnStepped(Chara c)
virtual void OnDrink(Chara c)
virtual bool CanBeDropped
virtual Action GetHealAction(Chara c)
virtual void SetName(ref string s)
virtual bool CanDrink(Chara c)
virtual bool CanOnlyCarry
virtual void OnBlend(Thing t, Chara c)
static void Reserve(string idStep, Action onBeforePlay=null)
static void Play(string idStep)
UIItem AddHeaderCard(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Condition CurrentCondition
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
FilterResult IsFilterPass(string text)
List< WorkSession > hobbies
void SendPackage(Thing p)
virtual ZoneTransition.EnterState ReturnState
virtual void OnLeaveZone()
void SetBGM(List< int > ids, bool refresh=true)
int CountMinions(Chara c)
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
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)