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 k = 0; k < 10; k++)
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 {
177 }
178 }
180 {
183 }
184 }
185 }
187 {
189 }
190 }
191 }
193 {
196 {
199 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
200 }
201 }
203 {
206 {
208 {
210 {
211 continue;
212 }
213 for (int l = 0; l < 5; l++)
214 {
215 if (thing10.
encLV >= 0)
216 {
217 break;
218 }
223 {
224 break;
225 }
226 }
228 {
229 break;
230 }
231 }
232 }
233 }
235 {
237 {
240 {
242 {
243 shackle = traitShackle
244 });
245 }
247 }
249 {
252 {
254 {
255 target = thing3
256 });
257 }
258 }
260 {
262 {
263 List<Chara> list2 = new List<Chara>();
265 {
266 if (member.
Evalue(1227) > 0)
267 {
268 list2.Add(member);
269 }
270 }
272 {
276 }
277 }
279 {
280 List<Chara> list3 = new List<Chara>();
282 {
284 {
285 list3.Add(member2);
286 }
287 }
289 {
292 }
293 }
294 }
296 {
304 }
306 {
308 }
310 {
312 {
314 }
315 else
316 {
318 }
319 }
321 {
323 }
325 {
328 {
330 {
332 {
333 flag = true;
334 }
335 }
336 }
337 if (flag)
338 {
339 bool flag2 = false;
341 {
343 {
344 flag2 = true;
345 break;
346 }
347 }
348 if (flag2)
349 {
351 if (num2 >= 20000)
352 {
353 num2 = 20000;
354 }
356 int num3 = num2 / 200;
358 {
359 if (!(value2.
source.category !=
"skill"))
360 {
364 }
365 }
369 }
370 }
371 }
373 {
375 if (randomPointInRadius != null)
376 {
378 if (randomPointInRadius.
IsValid)
379 {
381 {
382 pos = randomPointInRadius
383 });
384 }
385 }
386 }
387 }
389 {
392 {
394 }
396 {
398 {
400 }
403 {
405 {
407 }
409 continue;
410 }
411 }
412 }
414 {
416 {
418 }
420 {
422 }
424 {
426 {
430 {
431 owner.mimicry.Reveal(c, surprise: true);
432 }
433 });
434 }
435 }
437 {
439 }
442 {
443 break;
444 }
446 {
448 continue;
449 }
451 {
453 continue;
454 }
456 {
460 {
463 }
464 }
465 else
466 {
468 }
470 }
472 {
474 }
476 {
478 }
480 {
482 }
484 {
486 {
487 case "azzrasizzle":
488 case "geist":
489 {
491 {
492 break;
493 }
495 if (nearestPoint == null)
496 {
497 break;
498 }
500 {
502 }
504 {
506 {
508 }
510 }
512 break;
513 }
514 case "spider_queen":
515 {
517 {
518 break;
519 }
520 int i = 0;
522 {
524 {
525 i++;
526 }
527 });
528 if (i < 2)
529 {
531 if (randomPoint2 != null)
532 {
536 }
537 }
538 break;
539 }
540 case "mech_scarab":
541 {
543 {
544 break;
545 }
546 int j = 0;
548 {
550 {
551 j++;
552 }
553 });
554 if (j >= 2)
555 {
556 break;
557 }
559 if (randomPoint != null)
560 {
563 {
565 }
566 }
567 break;
568 }
569 }
570 }
572 {
575 }
577 {
579 if (room != null)
580 {
583 {
585 }
587 {
589 }
590 if (point != null)
591 {
592 yield
return DoGoto(point);
593 }
594 }
595 }
597 int num;
599 {
601 {
603 {
606 }
608 }
610 {
612 {
613 id = "money";
615 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
618 {
621 SetId("stone", 1);
623 {
624 SetId("shuriken", 1);
625 }
627 {
628 SetId("explosive", 1);
629 }
631 {
632 SetId("explosive_mega", 1);
633 }
635 {
636 SetId("rock", 1);
637 }
638 }
639 else
640 {
642 {
644 }
647 {
648 SetId("money2", 1);
649 }
651 {
652 SetId("plat", 1);
653 }
655 {
656 SetId(strs.RandomItem(), 1);
657 }
658 }
663 {
665 }
666 }
668 {
670 }
672 {
674 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
675 if (!text.IsEmpty())
676 {
678 }
680 {
682 AI_PlayMusic.ignoreDamage = true;
684 AI_PlayMusic.ignoreDamage = false;
685 }
686 }
687 else
688 {
690 }
692 }
693 }
695 {
697 {
699 }
701 if (tC ==
null || tC.
pop.
items.Count == 0)
702 {
704 {
706 {
708 {
712 }
713 }
714 }
716 {
718 }
720 {
722 }
724 {
726 {
728 }
730 {
732 }
733 }
734 }
735 }
737 {
739 }
741 {
743 }
745 {
746 float mtp = 1f;
749 if (room2 != room3 && room3 != null)
750 {
751 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
752 }
754 }
756 {
759 {
760 thing5 = null;
761 }
764 {
765 flag5 = true;
766 }
767 if (thing5 == null && !flag5)
768 {
771 }
773 {
776 }
777 }
779 {
781 {
786 {
787 flag7 = false;
788 }
789 if (flag7)
790 {
792 c.
Talk(
"drunk_counter");
794 }
795 });
796 }
798 {
801 {
803 {
804 pos = fishingPoint
805 });
806 }
807 }
810 {
812 }
814 {
816 {
819 if (chara4 !=
owner && thing6 !=
null)
820 {
822 {
823 churyu = thing6,
824 slave = chara4
825 });
826 }
827 }
829 {
831 }
832 }
834 {
836 {
838 });
840 }
842 {
845 {
847 if (chara5 != null)
848 {
850 {
851 target = chara5,
853 });
854 }
855 }
856 }
858 {
860 }
862 {
864 }
866 {
868 }
869 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
870 {
872 {
874 {
875 owner.Talk("snail");
876 Thing t4 = ThingGen.Create("1142");
877 ActThrow.Throw(owner, c.pos, t4);
878 }
879 });
881 }
883 {
886 {
888 {
889 shackle = traitShackle2
890 });
892 }
893 }
895 {
897 }
899 {
901 if (cleanPoint != null)
902 {
904 {
905 pos = cleanPoint
906 });
907 }
908 }
910 {
912 {
916 {
918 }
919 }
921 }
923 {
925 {
927 {
930 break;
931 }
932 }
933 }
935 {
937 if (thing7 == null)
938 {
940 {
942 {
944 if (card2 != null)
945 {
947 }
948 });
949 }
950 }
951 else
952 {
954 {
956 {
958 break;
959 }
960 }
961 }
962 }
964 {
966 }
968 {
970 }
973 {
974 owner.idleActTimer = 10 +
EClass.
rnd(50);
975 switch (idAct)
976 {
977 case "torture_snail":
979 {
985 });
986 break;
987 case "buffMage":
989 {
991 }
992 else
993 {
995 }
996 break;
997 case "buffThief":
999 break;
1000 case "buffGuildWatch":
1002 break;
1003 case "buffHealer":
1005 break;
1006 case "readBook":
1007 {
1009 {
1010 break;
1011 }
1013 Thing thing8 =
null;
1014 if (list4.Count > 0)
1015 {
1016 thing8 = list4.RandomItem();
1018 {
1019 thing8 = null;
1020 }
1021 }
1022 if (thing8 == null)
1023 {
1025 {
1026 break;
1027 }
1029 thing8.isNPCProperty = true;
1030 }
1032 {
1034 {
1036 }
1038 {
1039 target = thing8
1040 });
1041 }
1042 break;
1043 }
1044 default:
1046 {
1048 }
1049 break;
1050 }
1052 }
1054 {
1056 }
1058 {
1060 {
1062 }
1064 }
1066 {
1068 }
1070 {
1072 {
1075 {
1077 }
1078 else
1079 {
1081 if (room4 != null)
1082 {
1084 }
1085 }
1086 }
1088 {
1090 {
1091 if (!EClass._zone.IsPCFaction)
1092 {
1093 owner.Teleport(owner.orgPos, silent: false, force: true);
1094 }
1096 });
1097 }
1098 }
1100 {
1102 if (thing9 != null)
1103 {
1105 }
1106 }
1108 {
1109 for (int m = 0; m < 100; m++)
1110 {
1113 {
1114 yield
return DoGoto(randomPoint3);
1115 break;
1116 }
1117 }
1118 }
1120 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1121 {
1123 {
1125 }
1127 {
1129 }
1130 }
1132 {
1134 if (aI_Haul != null)
1135 {
1136 yield
return Do(aI_Haul);
1137 }
1138 }
1141 {
1142 for (int n = 0; n < 20; n++)
1143 {
1146 {
1147 return randomPoint4;
1148 }
1149 }
1150 return null;
1151 }
1152 void SetId(string _id, int _num)
1153 {
1154 id = _id;
1155 num = _num;
1156 }
1157 }
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)
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
CardRenderer HostRenderer
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)
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)
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)
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 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(), Card.GetHearingRadius(), BaseCard.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, 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(), BaseCard.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.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.