2using System.Collections.Generic;
18 private static List<BaseArea>
_listRoom =
new List<BaseArea>();
20 public override bool IsIdle => !base.IsChildRunning;
34 public override IEnumerable<Status>
Run()
85 thing.isNPCProperty =
true;
116 for (
int num = 0; num < 10; num++)
126 yield
return DoGoto(target);
142 Act actRevive =
null;
150 string[] abilityType =
act.
source.abilityType;
151 if (!abilityType.IsEmpty() && (abilityType[0] ==
"heal" || abilityType[0] ==
"hot"))
158 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
159 foreach (
Chara item2
in list)
216 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
230 for (
int num2 = 0; num2 < 5; num2++)
232 if (thing10.
encLV >= 0)
260 shackle = traitShackle
280 List<Chara> list2 =
new List<Chara>();
283 if (member.
Evalue(1227) > 0)
297 List<Chara> list3 =
new List<Chara>();
373 int num4 = num3 / 200;
376 if (!(value2.
source.category !=
"skill"))
392 if (randomPointInRadius !=
null)
395 if (randomPointInRadius.
IsValid)
399 pos = randomPointInRadius
448 owner.mimicry.Reveal(chara6, surprise: true);
512 if (nearestPoint ==
null)
518 item3.
Teleport(nearestPoint.GetNearestPoint(allowBlock:
false, allowChara:
false) ?? nearestPoint);
548 if (randomPoint2 !=
null)
576 if (randomPoint !=
null)
613 yield
return DoGoto(point);
636 string[] strs =
new string[4] {
"1294",
"1294",
"1130",
"1131" };
645 SetId(
"shuriken", 1);
649 SetId(
"explosive", 1);
653 SetId(
"explosive_mega", 1);
677 SetId(strs.RandomItem(), 1);
695 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
703 AI_PlayMusic.ignoreDamage =
true;
705 AI_PlayMusic.ignoreDamage =
false;
722 if (tC ==
null || tC.
pop.
items.Count == 0)
770 if (room2 != room3 && room3 !=
null)
772 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
788 if (thing5 ==
null && !flag5)
813 chara6.
Talk(
"drunk_counter");
840 if (chara4 !=
owner && thing6 !=
null)
890 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
897 Thing t3 = ThingGen.Create(
"1142");
898 ActThrow.Throw(owner, chara6.pos, t3);
910 shackle = traitShackle2
922 if (cleanPoint !=
null)
995 owner.idleActTimer = 10 +
EClass.
rnd(50);
998 case "torture_snail":
1006 Steam.GetAchievement(ID_Achievement.SNAIL);
1025 case "buffGuildWatch":
1041 Thing thing8 =
null;
1042 if (list4.Count > 0)
1044 thing8 = list4.RandomItem();
1057 thing8.isNPCProperty =
true;
1059 if ((!(thing8.
id ==
"1084") || !
owner.
IsPCFaction) && !(thing8.
id ==
"book_death") && !(thing8.
id ==
"book_black"))
1119 if (!EClass._zone.IsPCFaction)
1121 owner.Teleport(owner.orgPos, silent: false, force: true);
1137 for (
int num8 = 0; num8 < 100; num8++)
1142 yield
return DoGoto(randomPoint3);
1148 if (!(aiIdle ==
"stand") && !(aiIdle ==
"root"))
1162 if (aI_Haul !=
null)
1164 yield
return Do(aI_Haul);
1170 for (
int i = 0; i < 20; i++)
1175 return randomPoint4;
1180 void SetId(
string _id,
int _num)
1189 string text =
"idle_" + id;
1190 owner.PlaySound(text);
1191 if (
Lang.
Game.map.ContainsKey(text))
1193 owner.Say(text, owner);
1199 if (!owner.HasCondition<T>())
1207 owner.Say(
"idle_cast", owner);
1216 if (
item.type !=
null &&
item.type.uidCharas.Contains(owner.uid))
1218 _listRoom.Add(
item);
1221 return _listRoom.RandomItem();
1228 if (c == owner || !owner.
CanSee(c))
1232 return funcPickChara ==
null || funcPickChara(c);
1236 Chara chara = list.RandomItem();
1237 action?.Invoke(chara);
1247 if (c == owner || !owner.
CanSee(c))
1251 return funcPickChara ==
null || funcPickChara(c);
1255 Chara chara = list.RandomItem();
1256 action?.Invoke(chara);
1264 for (
int i = 0; i < 10; i++)
1270 Point randomPoint = owner.pos.
GetRandomPoint(7, requireLos:
true, allowChara:
true, allowBlocked:
true);
1271 if (randomPoint ==
null || randomPoint.
detail ==
null)
1275 foreach (
Thing thing
in randomPoint.detail.
things)
1281 int num = owner.Dist(thing);
1284 owner.LookAt(thing);
1285 owner.Talk(
"nice_statue");
1292 owner.LookAt(thing);
Status Do(AIAct _seq, Func< Status > _onChildFail=null)
Status DoGotoSpot(Card card, Func< Status > _onChildFail=null)
Status DoGoto(Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
static Point GetCleanPoint(Chara c, int r=-1, int tries=10)
static Point GetFishingPoint(Point p)
static AI_Haul TryGetAI(Chara c)
Chara DoSomethingToNearChara(Func< Chara, bool > funcPickChara, Action< Chara > action=null)
BaseArea GetRandomAssignedRoom()
static List< BaseArea > _listRoom
override IEnumerable< Status > Run()
override bool ShouldEndMimicry
override bool InformCancel
Chara DoSomethingToCharaInRadius(int radius, Func< Chara, bool > funcPickChara, Action< Chara > action=null)
void IdleActText(string id)
void TryCast(EffectId id, int power=100)
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
BaseArea.AccessType accessType
virtual Point GetRandomPoint(bool walkable=true, bool allowChara=true)
void Teleport(Point point, bool silent=false, bool force=false)
ElementContainerCard elements
bool IsRestrainedResident
CardRenderer HostRenderer
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
void SetInt(string id, int value=0)
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
int GetCurrency(string id="money")
bool IsInMutterDistance(int d=10)
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void ModCurrency(int a, string id="money")
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
bool HasEditorTag(EditorTag tag)
void PlayAnime(AnimeID id, bool force=false)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
int GetInt(string id, int? defaultInt=null)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
bool HasHobbyOrWork(string alias)
override bool IsAliveInCurrentZone
Thing FindBestFoodToEat()
Hostility OriginalHostility
void Cuddle(Chara c, bool headpat=false)
void InstantEat(Thing t=null, bool sound=true)
Condition AddCondition(string id, int p=100, bool force=false)
Chara GetNearbyCatToSniff()
bool CanSeeLos(Card c, int dist=-1)
void PickHeld(bool msg=false)
bool HasCondition(string alias)
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
override bool IsPCFaction
bool CanEat(Thing t, bool shouldEat=false)
void ClearInventory(ClearInventoryType type)
FactionMemberType memberType
string TalkTopic(string topic="calm")
bool MoveNeighborDefinitely()
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
void SetTempHand(int right=0, int left=0)
void AddCooldown(int idEle, int turns=0)
MoveResult TryMoveTowards(Point p)
Chara SetEnemy(Chara c=null)
void DoHostileAction(Card _tg, bool immediate=false)
void TryTakeSharedItems(bool msg=true)
ConBaseTransmuteMimic mimicry
Chara SetHostility(Hostility h)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
bool TryFuse(float chance=1f)
Chara FindCharaToRevive()
override void Reveal(Card attacker=null, bool surprise=false)
int AllyDistance(Chara c)
static int GetFoodScore(Thing food)
int GetRaw(int offsetHours=0)
static FactionBranch Branch
static int rndHalf(int a)
static SoundManager Sound
Dictionary< int, Element > dict
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
ReligionManager religions
static bool Has(string id)
static string _currency(object a, string IDCurrency)
static LayerCraft Instance
static LayerDragGrid Instance
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Point GetRandomPoint(Point center, int radius, int tries=100, bool mustBeWalkable=true, bool requireLos=true)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
bool HasElement(int ele, bool excludePC=false)
int EvalueTotal(int ele, Func< Chara, bool > funcIf=null)
ref Vector3 Position(int height)
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)
List< Chara > ListCharasInNeighbor(Func< Chara, bool > func)
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
bool Equals(int _x, int _z)
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Point GetRandomPointInRadius(int minRadius, int maxRadius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=2000)
Thing FindThing(Func< Thing, bool > func)
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
bool IsActive(int id, int days=-1)
static void GetAchievement(ID_Achievement id)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing Create(string id, int idMat=-1, int lv=-1)
virtual AI_Idle.Behaviour IdleBehaviour
virtual string IdAmbience
virtual bool AllowTraining
virtual bool CanRead(Chara c)
virtual bool CanEat(Chara c)
virtual Action GetHealAction(Chara c)
virtual int IdleUseChance
virtual bool IdleUse(Chara c, int dist)
virtual bool CanDrink(Chara c)
Chara SpawnMob(string id, Point pos=null)
virtual bool IsUnderwater
Card AddCard(Card t, Point point)