Reimplemented from AIAct.
Definition at line 34 of file AI_Idle.cs.
35 {
36 while (true)
37 {
39 {
41 }
43 {
45 owner.nextUse = null;
47 {
49 }
51 }
53 {
55 {
57 }
59 {
61 }
62 }
64 {
67 {
69 if (thing != null)
70 {
72 }
73 }
75 {
77 {
79 }
81 {
84 {
85 thing.isNPCProperty = true;
87 }
88 else
89 {
90 thing = null;
91 }
92 }
93 }
94 if (thing != null)
95 {
97 {
99 }
101 {
104 }
106 {
108 {
109 target = thing
110 });
111 }
112 }
114 {
116 for (int num = 0; num < 10; num++)
117 {
120 {
121 target = chara;
122 }
123 }
124 if (target != null)
125 {
126 yield
return DoGoto(target);
129 }
130 }
131 }
133 {
135 {
138 }
140 {
142 Act actRevive =
null;
144 {
147 {
149 }
150 string[] abilityType =
act.
source.abilityType;
151 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
152 {
154 }
155 }
156 if (actHeal != null)
157 {
158 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
159 foreach (
Chara item2
in list)
160 {
162 {
165 break;
166 }
167 }
169 {
171 {
173 {
175 {
177 }
181 }
182 }
184 {
186 {
188 }
191 }
192 }
193 }
195 {
197 }
199 {
201 if (action != null)
202 {
203 action();
205 }
206 }
207 }
208 }
210 {
213 {
216 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
217 }
218 }
220 {
223 {
225 {
227 {
228 continue;
229 }
230 for (int num2 = 0; num2 < 5; num2++)
231 {
232 if (thing10.
encLV >= 0)
233 {
234 break;
235 }
240 {
241 break;
242 }
243 }
245 {
246 break;
247 }
248 }
249 }
250 }
252 {
254 {
257 {
259 {
260 shackle = traitShackle
261 });
262 }
264 }
266 {
269 {
271 {
272 target = thing3
273 });
274 }
275 }
277 {
279 {
280 List<Chara> list2 = new List<Chara>();
282 {
283 if (member.
Evalue(1227) > 0)
284 {
285 list2.Add(member);
286 }
287 }
289 {
293 }
294 }
296 {
297 List<Chara> list3 = new List<Chara>();
299 {
301 {
302 list3.Add(member2);
303 }
304 }
306 {
309 }
310 }
311 }
313 {
321 }
323 {
325 }
327 {
329 {
331 }
332 else
333 {
335 }
336 }
338 {
340 }
342 {
345 {
347 {
349 {
350 flag = true;
351 }
352 }
353 }
354 if (flag)
355 {
356 bool flag2 = false;
358 {
360 {
361 flag2 = true;
362 break;
363 }
364 }
365 if (flag2)
366 {
368 if (num3 >= 20000)
369 {
370 num3 = 20000;
371 }
373 int num4 = num3 / 200;
375 {
376 if (!(value2.
source.category !=
"skill"))
377 {
381 }
382 }
386 }
387 }
388 }
390 {
392 if (randomPointInRadius != null)
393 {
395 if (randomPointInRadius.
IsValid)
396 {
398 {
399 pos = randomPointInRadius
400 });
401 }
402 }
403 }
404 }
406 {
409 {
411 }
413 {
415 {
417 }
420 {
422 {
424 }
426 continue;
427 }
428 }
429 }
431 {
433 {
435 }
437 {
439 }
441 {
443 {
447 {
448 owner.mimicry.Reveal(chara6, surprise: true);
449 }
450 });
451 }
452 }
454 {
456 }
459 {
460 break;
461 }
463 {
465 continue;
466 }
468 {
470 continue;
471 }
473 {
477 {
480 }
481 }
482 else
483 {
485 }
487 }
489 {
491 }
493 {
495 }
497 {
499 }
501 {
503 {
504 case "azzrasizzle":
505 case "geist":
506 {
508 {
509 break;
510 }
512 if (nearestPoint == null)
513 {
514 break;
515 }
517 {
519 }
521 {
523 {
525 }
527 }
529 break;
530 }
531 case "spider_queen":
532 {
534 {
535 break;
536 }
537 int n2 = 0;
539 {
541 {
542 n2++;
543 }
544 });
545 if (n2 < 2)
546 {
548 if (randomPoint2 != null)
549 {
553 }
554 }
555 break;
556 }
557 case "mech_scarab":
558 {
560 {
561 break;
562 }
563 int n = 0;
565 {
567 {
568 n++;
569 }
570 });
571 if (n >= 2)
572 {
573 break;
574 }
576 if (randomPoint != null)
577 {
580 {
582 }
583 }
584 break;
585 }
586 }
588 {
590 }
591 }
593 {
596 }
598 {
600 if (room != null)
601 {
604 {
606 }
608 {
610 }
611 if (point != null)
612 {
613 yield
return DoGoto(point);
614 }
615 }
616 }
618 int num7;
620 {
622 {
624 {
627 }
629 }
631 {
633 {
634 id = "money";
636 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
639 {
642 SetId("stone", 1);
644 {
645 SetId("shuriken", 1);
646 }
648 {
649 SetId("explosive", 1);
650 }
652 {
653 SetId("explosive_mega", 1);
654 }
656 {
657 SetId("rock", 1);
658 }
659 }
660 else
661 {
663 {
665 }
668 {
669 SetId("money2", 1);
670 }
672 {
673 SetId("plat", 1);
674 }
676 {
677 SetId(strs.RandomItem(), 1);
678 }
679 }
684 {
686 }
687 }
689 {
691 }
693 {
695 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
696 if (!text.IsEmpty())
697 {
699 }
701 {
703 AI_PlayMusic.ignoreDamage = true;
705 AI_PlayMusic.ignoreDamage = false;
706 }
707 }
708 else
709 {
711 }
713 }
714 }
716 {
718 {
720 }
722 if (tC ==
null || tC.
pop.
items.Count == 0)
723 {
725 {
727 {
729 {
733 }
734 }
735 }
737 {
739 }
741 {
743 }
745 {
747 {
749 }
751 {
753 }
754 }
755 }
756 }
758 {
760 }
762 {
764 }
766 {
767 float mtp = 1f;
770 if (room2 != room3 && room3 != null)
771 {
772 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
773 }
775 }
777 {
780 {
781 thing5 = null;
782 }
785 {
786 flag5 = true;
787 }
788 if (thing5 == null && !flag5)
789 {
792 }
794 {
797 }
798 }
800 {
802 {
807 {
808 flag7 = false;
809 }
811 {
813 chara6.
Talk(
"drunk_counter");
815 }
816 });
817 }
819 {
822 {
824 {
825 pos = fishingPoint
826 });
827 }
828 }
831 {
833 }
835 {
837 {
840 if (chara4 !=
owner && thing6 !=
null)
841 {
843 {
844 churyu = thing6,
845 slave = chara4
846 });
847 }
848 }
850 {
852 }
853 }
855 {
857 {
859 });
861 }
863 {
866 {
868 if (chara5 != null)
869 {
871 {
872 target = chara5,
874 });
875 }
876 }
877 }
879 {
881 }
883 {
885 }
887 {
889 }
890 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
891 {
893 {
895 {
896 owner.Talk("snail");
897 Thing t3 = ThingGen.Create("1142");
898 ActThrow.Throw(owner, chara6.pos, t3);
899 }
900 });
902 }
904 {
907 {
909 {
910 shackle = traitShackle2
911 });
913 }
914 }
916 {
918 }
920 {
922 if (cleanPoint != null)
923 {
925 {
926 pos = cleanPoint
927 });
928 }
929 }
931 {
933 {
937 {
939 }
940 }
942 }
944 {
946 {
948 {
951 break;
952 }
953 }
954 }
956 {
958 if (thing7 == null)
959 {
961 {
963 {
965 if (card2 != null)
966 {
968 }
969 });
970 }
971 }
972 else
973 {
975 {
977 {
979 break;
980 }
981 }
982 }
983 }
985 {
987 }
989 {
991 }
994 {
995 owner.idleActTimer = 10 +
EClass.
rnd(50);
996 switch (idAct)
997 {
998 case "torture_snail":
1000 {
1005 {
1006 Steam.GetAchievement(ID_Achievement.SNAIL);
1007 }
1010 });
1011 break;
1012 case "buffMage":
1014 {
1016 }
1017 else
1018 {
1020 }
1021 break;
1022 case "buffThief":
1024 break;
1025 case "buffGuildWatch":
1027 break;
1028 case "buffHealer":
1030 {
1032 }
1033 break;
1034 case "readBook":
1035 {
1037 {
1038 break;
1039 }
1041 Thing thing8 =
null;
1042 if (list4.Count > 0)
1043 {
1044 thing8 = list4.RandomItem();
1046 {
1047 thing8 = null;
1048 }
1049 }
1050 if (thing8 == null)
1051 {
1053 {
1054 break;
1055 }
1057 thing8.isNPCProperty = true;
1058 }
1059 if ((!(thing8.
id ==
"1084") || !
owner.
IsPCFaction) && !(thing8.
id ==
"book_death") && !(thing8.
id ==
"book_black"))
1060 {
1062 {
1064 }
1066 {
1067 target = thing8
1068 });
1069 }
1070 break;
1071 }
1072 default:
1074 {
1076 }
1077 break;
1078 }
1080 }
1082 {
1084 }
1086 {
1088 {
1090 }
1092 }
1094 {
1096 }
1098 {
1100 {
1103 {
1105 }
1106 else
1107 {
1109 if (room4 != null)
1110 {
1112 }
1113 }
1114 }
1116 {
1118 {
1119 if (!EClass._zone.IsPCFaction)
1120 {
1121 owner.Teleport(owner.orgPos, silent: false, force: true);
1122 }
1124 });
1125 }
1126 }
1128 {
1130 if (thing9 != null)
1131 {
1133 }
1134 }
1136 {
1137 for (int num8 = 0; num8 < 100; num8++)
1138 {
1141 {
1142 yield
return DoGoto(randomPoint3);
1143 break;
1144 }
1145 }
1146 }
1148 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1149 {
1151 {
1153 }
1155 {
1157 }
1158 }
1160 {
1162 if (aI_Haul != null)
1163 {
1164 yield
return Do(aI_Haul);
1165 }
1166 }
1169 {
1170 for (int i = 0; i < 20; i++)
1171 {
1174 {
1175 return randomPoint4;
1176 }
1177 }
1178 return null;
1179 }
1180 void SetId(string _id, int _num)
1181 {
1182 id = _id;
1183 num7 = _num;
1184 }
1185 }
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)
Chara DoSomethingToCharaInRadius(int radius, Func< Chara, bool > funcPickChara, Action< Chara > action=null)
void IdleActText(string id)
void TryCast(EffectId id, int power=100)
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)
GlobalCharaList globalCharas
void Teleport(Point point, bool silent=false, bool force=false)
ElementContainerCard elements
bool IsRestrainedResident
CardRenderer HostRenderer
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 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)
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 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)
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)
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 bool CanDrink(Chara c)
Chara SpawnMob(string id, Point pos=null)
virtual bool IsUnderwater
Card AddCard(Card t, Point point)
References Lang._currency(), EClass._map, EClass._zone, Chara.ability, AreaData.accessType, Element.act, Zone.AddCard(), Chara.AddCondition(), Chara.AddCooldown(), Card.AddThing(), Chara.affinity, Chara.ai, TraitShackle.AllowTraining, ConfigTactics.AllyDistance(), Chara.Banish(), Zone.Boss, EClass.Branch, Zone.branch, Card.c_bloodData, Card.c_isImportant, Card.c_minionType, Card.c_uidMaster, AIAct.Cancel(), Trait.CanDrink(), Chara.CanDuplicate(), Trait.CanEat(), Chara.CanEat(), TraitChara.CanFish, Trait.CanRead(), Chara.CanSee(), Chara.CanSeeLos(), card, Game.cards, Card.category, Card.Cell, Point.cell, Map.charas, Chara.ClearInventory(), Game.config, ThingGen.Create(), ThingGen.CreateFromCategory(), Chara.Cuddle(), Affinity.CurrentStage, Card.DamageHP(), BaseArea.data, World.date, EClass.debug, ElementContainer.dict, Card.Dist(), Point.Distance(), AIAct.Do(), AIAct.DoGoto(), AIAct.DoGotoSpot(), Chara.DoHostileAction(), DoSomethingToCharaInRadius(), DoSomethingToNearChara(), Chara.Drink(), Chara.Duplicate(), Card.elements, CoreDebug.enable, Card.encLV, Chara.enemy, Point.Equals(), Card.Evalue(), Party.EvalueTotal(), Card.ExistsOnMap, Chara.faction, Chara.faith, Props.Find(), ThingContainer.Find(), Chara.FindBed(), Chara.FindBestFoodToEat(), Chara.FindMaster(), Chara.FindRoom(), Point.FindThing(), Point.FirstChara, Point.ForeachNeighbor(), EClass.game, Steam.GetAchievement(), AI_Clean.GetCleanPoint(), Card.GetCurrency(), Chara.GetDestination(), AI_Fish.GetFishingPoint(), CraftUtil.GetFoodScore(), Trait.GetHealAction(), Card.GetHearingRadius(), Card.GetInt(), FactionBranch.GetMeal(), Chara.GetNearbyCatToSniff(), Point.GetNearestPoint(), Stats.GetPhase(), BaseArea.GetRandomPoint(), Point.GetRandomPoint(), Point.GetRandomPointInRadius(), Date.GetRaw(), CardRenderer.GetTC(), CardManager.globalCharas, ReligionManager.Harmony, CharaAbility.Has(), LangGame.Has(), Chara.HasAccess(), Point.HasChara, Chara.HasCondition(), Card.HasEditorTag(), Party.HasElement(), Card.HasElement(), Cell.HasFire, Chara.HasHobbyOrWork(), Chara.held, Chara.homeBranch, Chara.host, Chara.hostility, Card.HostRenderer, Card.hp, Chara.hunger, Card.id, Element.id, TraitChara.IdAmbience, TraitChara.IdleAct(), IdleActText(), Chara.idleActTimer, TraitChara.IdleBehaviour, if(), Map.Installed, PropsManager.installed, LayerCraft.Instance, LayerDragGrid.Instance, Chara.InstantEat(), PolicyManager.IsActive(), Chara.IsAliveInCurrentZone, Point.IsBlocked, Chara.IsCat, Card.isDestroyed, Chara.isDrunk, Card.IsEquipment, ThingContainer.IsFull(), Card.isGifted, Chara.IsGuest(), Chara.IsHostile(), Point.IsHotSpring, Chara.IsHuman, Chara.IsIdle, Point.IsInBounds, Chara.IsInCombat, Card.IsInMutterDistance(), Card.IsInstalled, Chara.IsMarried, Chara.IsMinion, Chara.IsMofuable, Zone.IsNefia, Date.IsNight, Chara.IsPC, Chara.IsPCC, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Chara.IsPCParty, Spatial.IsRegion, Card.isRestrained, Card.IsRestrainedResident, Thing.IsSharedContainer, Cell.IsSnowTile, Card.isSummon, Chara.isSynced, Cell.IsTopWaterAndNoSnow, Zone.IsTown, Zone.IsUserZone, Point.IsValid, Los.IsVisible(), Affinity.IsWeddingHater, item, ActList.items, PopManager.items, Player.karma, AIAct.KeepRunning(), Party.leader, CharaAbility.list, ThingContainer.List(), Room.lot, Card.LV, Chara.mana, Chara.master, Stats.max, Chara.MaxHP, FactionBranch.members, Party.members, Chara.memberType, Chara.mimicry, Stats.Mod(), ElementContainer.ModBase(), Card.ModCurrency(), Card.ModEncLv(), Card.ModNum(), ElementContainer.ModTempPotential(), moveFailCount, Chara.MoveNeighborDefinitely(), Chara.nextUse, Card.noMove, Card.Num, Zone.okaerinko, Chara.OnInsulted(), Chara.orgPos, Chara.OriginalHostility, AIAct.owner, Chara.parasite, Card.parent, Chara.party, EClass.pc, Chara.pccData, Zone.PetFollow, Chara.Pick(), Chara.PickHeld(), Card.PlayAnime(), EClass.player, Card.PlaySound(), FactionBranch.policies, TCText.pop, Card.pos, Point.Position(), Map.props, Chara.race, Game.religions, AIAct.Restart(), TraitManager.restSpots, ConBaseTransmuteMimic.Reveal(), Chara.ride, EClass.rnd(), EClass.rndHalf(), Cell.room, Msg.Say(), Card.Say(), Chara.SetAI(), Chara.SetEnemy(), Chara.SetHostility(), Card.SetInt(), Card.SetNum(), Card.SetRandomDir(), Chara.sharedCheckTurn, Chara.Sniff(), EClass.Sound, Chara.source, Element.source, Zone.SpawnMob(), Chara.stamina, Player.stats, AIAct.Success, Game.Config.tactics, Card.Talk(), Chara.TalkTopic(), Card.Teleport(), Card.Thing, Card.things, Point.Things, ActThrow.Throw(), Card.trait, Chara.trait, Props.traits, Chara.TryAssignBed(), TryCast(), Chara.TryClearInventory(), Chara.TryFuse(), Chara.TryMoveTowards(), TryPerformIdleUse(), Chara.TryPutSharedItems(), AI_Shopping.TryRestock(), AI_Shopping.TryShop(), Chara.TryTakeSharedItems(), Chara.TryUse(), Point.TryWitnessCrime(), Chara.turnLastSeen, Player.Stats.turns, Chara.UseAbility(), Stats.value, Element.ValueWithoutLink, Element.vTempPotential, and EClass.world.