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 }
198 }
199 }
201 {
204 {
207 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
208 }
209 }
211 {
214 {
216 {
218 {
219 continue;
220 }
221 for (int num2 = 0; num2 < 5; num2++)
222 {
223 if (thing10.
encLV >= 0)
224 {
225 break;
226 }
231 {
232 break;
233 }
234 }
236 {
237 break;
238 }
239 }
240 }
241 }
243 {
245 {
248 {
250 {
251 shackle = traitShackle
252 });
253 }
255 }
257 {
260 {
262 {
263 target = thing3
264 });
265 }
266 }
268 {
270 {
271 List<Chara> list2 = new List<Chara>();
273 {
274 if (member.
Evalue(1227) > 0)
275 {
276 list2.Add(member);
277 }
278 }
280 {
284 }
285 }
287 {
288 List<Chara> list3 = new List<Chara>();
290 {
292 {
293 list3.Add(member2);
294 }
295 }
297 {
300 }
301 }
302 }
304 {
312 }
314 {
316 }
318 {
320 {
322 }
323 else
324 {
326 }
327 }
329 {
331 }
333 {
336 {
338 {
340 {
341 flag = true;
342 }
343 }
344 }
345 if (flag)
346 {
347 bool flag2 = false;
349 {
351 {
352 flag2 = true;
353 break;
354 }
355 }
356 if (flag2)
357 {
359 if (num3 >= 20000)
360 {
361 num3 = 20000;
362 }
364 int num4 = num3 / 200;
366 {
367 if (!(value2.
source.category !=
"skill"))
368 {
372 }
373 }
377 }
378 }
379 }
381 {
383 if (randomPointInRadius != null)
384 {
386 if (randomPointInRadius.
IsValid)
387 {
389 {
390 pos = randomPointInRadius
391 });
392 }
393 }
394 }
395 }
397 {
400 {
402 }
404 {
406 {
408 }
411 {
413 {
415 }
417 continue;
418 }
419 }
420 }
422 {
424 {
426 }
428 {
430 }
432 {
434 {
438 {
439 owner.mimicry.Reveal(chara6, surprise: true);
440 }
441 });
442 }
443 }
445 {
447 }
450 {
451 break;
452 }
454 {
456 continue;
457 }
459 {
461 continue;
462 }
464 {
468 {
471 }
472 }
473 else
474 {
476 }
478 }
480 {
482 }
484 {
486 }
488 {
490 }
492 {
494 {
495 case "azzrasizzle":
496 case "geist":
497 {
499 {
500 break;
501 }
503 if (nearestPoint == null)
504 {
505 break;
506 }
508 {
510 }
512 {
514 {
516 }
518 }
520 break;
521 }
522 case "spider_queen":
523 {
525 {
526 break;
527 }
528 int n2 = 0;
530 {
532 {
533 n2++;
534 }
535 });
536 if (n2 < 2)
537 {
539 if (randomPoint2 != null)
540 {
544 }
545 }
546 break;
547 }
548 case "mech_scarab":
549 {
551 {
552 break;
553 }
554 int n = 0;
556 {
558 {
559 n++;
560 }
561 });
562 if (n >= 2)
563 {
564 break;
565 }
567 if (randomPoint != null)
568 {
571 {
573 }
574 }
575 break;
576 }
577 }
579 {
581 }
582 }
584 {
587 }
589 {
591 if (room != null)
592 {
595 {
597 }
599 {
601 }
602 if (point != null)
603 {
604 yield
return DoGoto(point);
605 }
606 }
607 }
609 int num7;
611 {
613 {
615 {
618 }
620 }
622 {
624 {
625 id = "money";
627 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
630 {
633 SetId("stone", 1);
635 {
636 SetId("shuriken", 1);
637 }
639 {
640 SetId("explosive", 1);
641 }
643 {
644 SetId("explosive_mega", 1);
645 }
647 {
648 SetId("rock", 1);
649 }
650 }
651 else
652 {
654 {
656 }
659 {
660 SetId("money2", 1);
661 }
663 {
664 SetId("plat", 1);
665 }
667 {
668 SetId(strs.RandomItem(), 1);
669 }
670 }
675 {
677 }
678 }
680 {
682 }
684 {
686 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
687 if (!text.IsEmpty())
688 {
690 }
692 {
694 AI_PlayMusic.ignoreDamage = true;
696 AI_PlayMusic.ignoreDamage = false;
697 }
698 }
699 else
700 {
702 }
704 }
705 }
707 {
709 {
711 }
713 if (tC ==
null || tC.
pop.
items.Count == 0)
714 {
716 {
718 {
720 {
724 }
725 }
726 }
728 {
730 }
732 {
734 }
736 {
738 {
740 }
742 {
744 }
745 }
746 }
747 }
749 {
751 }
753 {
755 }
757 {
758 float mtp = 1f;
761 if (room2 != room3 && room3 != null)
762 {
763 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
764 }
766 }
768 {
771 {
772 thing5 = null;
773 }
776 {
777 flag5 = true;
778 }
779 if (thing5 == null && !flag5)
780 {
783 }
785 {
788 }
789 }
791 {
793 {
798 {
799 flag7 = false;
800 }
802 {
804 chara6.
Talk(
"drunk_counter");
806 }
807 });
808 }
810 {
813 {
815 {
816 pos = fishingPoint
817 });
818 }
819 }
822 {
824 }
826 {
828 {
831 if (chara4 !=
owner && thing6 !=
null)
832 {
834 {
835 churyu = thing6,
836 slave = chara4
837 });
838 }
839 }
841 {
843 }
844 }
846 {
848 {
850 });
852 }
854 {
857 {
859 if (chara5 != null)
860 {
862 {
863 target = chara5,
865 });
866 }
867 }
868 }
870 {
872 }
874 {
876 }
878 {
880 }
881 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
882 {
884 {
886 {
887 owner.Talk("snail");
888 Thing t3 = ThingGen.Create("1142");
889 ActThrow.Throw(owner, chara6.pos, t3);
890 }
891 });
893 }
895 {
898 {
900 {
901 shackle = traitShackle2
902 });
904 }
905 }
907 {
909 }
911 {
913 if (cleanPoint != null)
914 {
916 {
917 pos = cleanPoint
918 });
919 }
920 }
922 {
924 {
928 {
930 }
931 }
933 }
935 {
937 {
939 {
942 break;
943 }
944 }
945 }
947 {
949 if (thing7 == null)
950 {
952 {
954 {
956 if (card2 != null)
957 {
959 }
960 });
961 }
962 }
963 else
964 {
966 {
968 {
970 break;
971 }
972 }
973 }
974 }
976 {
978 }
980 {
982 }
985 {
986 owner.idleActTimer = 10 +
EClass.
rnd(50);
987 switch (idAct)
988 {
989 case "torture_snail":
991 {
996 {
997 Steam.GetAchievement(ID_Achievement.SNAIL);
998 }
1001 });
1002 break;
1003 case "buffMage":
1005 {
1007 }
1008 else
1009 {
1011 }
1012 break;
1013 case "buffThief":
1015 break;
1016 case "buffGuildWatch":
1018 break;
1019 case "buffHealer":
1021 break;
1022 case "readBook":
1023 {
1025 {
1026 break;
1027 }
1029 Thing thing8 =
null;
1030 if (list4.Count > 0)
1031 {
1032 thing8 = list4.RandomItem();
1034 {
1035 thing8 = null;
1036 }
1037 }
1038 if (thing8 == null)
1039 {
1041 {
1042 break;
1043 }
1045 thing8.isNPCProperty = true;
1046 }
1048 {
1050 {
1052 }
1054 {
1055 target = thing8
1056 });
1057 }
1058 break;
1059 }
1060 default:
1062 {
1064 }
1065 break;
1066 }
1068 }
1070 {
1072 }
1074 {
1076 {
1078 }
1080 }
1082 {
1084 }
1086 {
1088 {
1091 {
1093 }
1094 else
1095 {
1097 if (room4 != null)
1098 {
1100 }
1101 }
1102 }
1104 {
1106 {
1107 if (!EClass._zone.IsPCFaction)
1108 {
1109 owner.Teleport(owner.orgPos, silent: false, force: true);
1110 }
1112 });
1113 }
1114 }
1116 {
1118 if (thing9 != null)
1119 {
1121 }
1122 }
1124 {
1125 for (int num8 = 0; num8 < 100; num8++)
1126 {
1129 {
1130 yield
return DoGoto(randomPoint3);
1131 break;
1132 }
1133 }
1134 }
1136 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1137 {
1139 {
1141 }
1143 {
1145 }
1146 }
1148 {
1150 if (aI_Haul != null)
1151 {
1152 yield
return Do(aI_Haul);
1153 }
1154 }
1157 {
1158 for (int i = 0; i < 20; i++)
1159 {
1162 {
1163 return randomPoint4;
1164 }
1165 }
1166 return null;
1167 }
1168 void SetId(string _id, int _num)
1169 {
1170 id = _id;
1171 num7 = _num;
1172 }
1173 }
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 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(), 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.