2using System.Collections.Generic;
18 private static List<BaseArea>
_listRoom =
new List<BaseArea>();
20 public override bool IsIdle => !base.IsChildRunning;
32 public override IEnumerable<Status>
Run()
83 thing.isNPCProperty =
true;
118 Act actRevive =
null;
126 string[] abilityType = act2.
source.abilityType;
127 if (!abilityType.IsEmpty() && (abilityType[0] ==
"heal" || abilityType[0] ==
"hot"))
134 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
135 foreach (
Chara item2
in list)
158 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
172 for (
int i = 0; i < 5; i++)
174 if (thing8.
encLV >= 0)
202 shackle = traitShackle
220 List<Chara> list2 =
new List<Chara>();
223 if (member.
Evalue(1227) > 0)
296 int num2 = num / 200;
299 if (!(value2.
source.category !=
"skill"))
384 if (nearestPoint !=
null)
417 yield
return DoGoto(point);
441 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
449 AI_PlayMusic.ignoreDamage =
true;
451 AI_PlayMusic.ignoreDamage =
false;
468 if (tC ==
null || tC.
pop.
items.Count == 0)
516 if (room2 != room3 && room3 !=
null)
518 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
522 if (
EClass.
rnd(2000) == 0 && owner.IsHuman && (owner.host ==
null || owner.host.ride !=
owner))
534 if (thing4 ==
null && !flag5)
559 c.
Talk(
"drunk_counter");
612 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
619 Thing t4 = ThingGen.Create(
"1142");
620 ActThrow.Throw(owner, c.pos, t4);
632 shackle = traitShackle2
644 if (cleanPoint !=
null)
701 owner.idleActTimer = 10 +
EClass.
rnd(50);
704 case "torture_snail":
727 case "buffGuildWatch":
743 thing6 = list3.RandomItem();
756 thing6.isNPCProperty =
true;
818 if (!EClass._zone.IsPCFaction)
820 owner.Teleport(owner.orgPos, silent: false, force: true);
836 for (
int j = 0; j < 100; j++)
841 yield
return DoGoto(randomPoint);
847 if (!(aiIdle ==
"stand") && !(aiIdle ==
"root"))
863 yield
return Do(aI_Haul);
869 for (
int k = 0; k < 20; k++)
883 string text =
"idle_" + id;
884 owner.PlaySound(text);
885 if (
Lang.
Game.map.ContainsKey(text))
887 owner.Say(text, owner);
893 if (!owner.HasCondition<T>())
901 owner.Say(
"idle_cast", owner);
910 if (
item.type !=
null &&
item.type.uidCharas.Contains(owner.uid))
915 return _listRoom.RandomItem();
922 if (c == owner || !owner.
CanSee(c))
926 return funcPickChara ==
null || funcPickChara(c);
930 Chara chara = list.RandomItem();
931 action?.Invoke(chara);
941 if (c == owner || !owner.
CanSee(c))
945 return funcPickChara ==
null || funcPickChara(c);
949 Chara chara = list.RandomItem();
950 action?.Invoke(chara);
958 for (
int i = 0; i < 10; i++)
960 Point randomPoint = owner.pos.
GetRandomPoint(7, requireLos:
true, allowChara:
true, allowBlocked:
true);
961 if (randomPoint ==
null || randomPoint.
detail ==
null)
969 int num = owner.Dist(thing);
973 owner.Talk(
"nice_statue");
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
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 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)
int GetInt(int id, int? defaultInt=null)
void SetInt(int id, int value=0)
GlobalCharaList globalCharas
void Teleport(Point point, bool silent=false, bool force=false)
ElementContainerCard elements
bool IsRestrainedResident
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
bool HasElement(int ele, int req=1)
CardRenderer HostRenderer
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
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")
bool HasEditorTag(EditorTag tag)
void PlayAnime(AnimeID id, bool force=false)
SourceCategory.Row category
void ModNum(int a, bool notify=true)
void Say(string lang, string ref1=null, string ref2=null)
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
override bool IsAliveInCurrentZone
Thing FindBestFoodToEat()
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)
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()
void SetTempHand(int right=0, int left=0)
MoveResult TryMoveTowards(Point p)
Chara SetEnemy(Chara c=null)
void DoHostileAction(Card _tg, bool immediate=false)
void TryTakeSharedItems(bool msg=true)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
int AllyDistance(Chara c)
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)
static bool Has(string id)
static string _currency(object a, string IDCurrency)
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)
ref Vector3 Position(int height)
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
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)
Thing FindThing(Func< Thing, bool > func)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
bool IsActive(int id, int days=-1)
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 int IdleUseChance
virtual bool IdleUse(Chara c, int dist)
virtual bool CanDrink(Chara c)
virtual bool IsUnderwater