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 j = 0;
522 {
524 {
525 j++;
526 }
527 });
528 if (j < 2)
529 {
531 if (randomPoint != null)
532 {
536 }
537 }
538 break;
539 }
540 case "mech_scarab":
541 {
543 {
544 break;
545 }
546 int i = 0;
548 {
550 {
551 i++;
552 }
553 });
554 if (i >= 2)
555 {
556 break;
557 }
559 if (randomPoint2 != null)
560 {
563 {
565 }
566 }
567 break;
568 }
569 case "marshmallow_monster":
571 {
573 }
574 break;
575 }
576 }
578 {
581 }
583 {
585 if (room != null)
586 {
589 {
591 }
593 {
595 }
596 if (point != null)
597 {
598 yield
return DoGoto(point);
599 }
600 }
601 }
603 int num;
605 {
607 {
609 {
612 }
614 }
616 {
618 {
619 id = "money";
621 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
624 {
627 SetId("stone", 1);
629 {
630 SetId("shuriken", 1);
631 }
633 {
634 SetId("explosive", 1);
635 }
637 {
638 SetId("explosive_mega", 1);
639 }
641 {
642 SetId("rock", 1);
643 }
644 }
645 else
646 {
648 {
650 }
653 {
654 SetId("money2", 1);
655 }
657 {
658 SetId("plat", 1);
659 }
661 {
662 SetId(strs.RandomItem(), 1);
663 }
664 }
669 {
671 }
672 }
674 {
676 }
678 {
680 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
681 if (!text.IsEmpty())
682 {
684 }
686 {
688 AI_PlayMusic.ignoreDamage = true;
690 AI_PlayMusic.ignoreDamage = false;
691 }
692 }
693 else
694 {
696 }
698 }
699 }
701 {
703 {
705 }
707 if (tC ==
null || tC.
pop.
items.Count == 0)
708 {
710 {
712 {
714 {
718 }
719 }
720 }
722 {
724 }
726 {
728 }
730 {
732 {
734 }
736 {
738 }
739 }
740 }
741 }
743 {
745 }
747 {
749 }
751 {
752 float mtp = 1f;
755 if (room2 != room3 && room3 != null)
756 {
757 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
758 }
760 }
762 {
765 {
766 thing5 = null;
767 }
770 {
771 flag5 = true;
772 }
773 if (thing5 == null && !flag5)
774 {
777 }
779 {
782 }
783 }
785 {
787 {
792 {
793 flag7 = false;
794 }
796 {
798 c.
Talk(
"drunk_counter");
800 }
801 });
802 }
804 {
807 {
809 {
810 pos = fishingPoint
811 });
812 }
813 }
816 {
818 }
820 {
822 {
825 if (chara4 !=
owner && thing6 !=
null)
826 {
828 {
829 churyu = thing6,
830 slave = chara4
831 });
832 }
833 }
835 {
837 }
838 }
840 {
842 {
844 });
846 }
848 {
851 {
853 if (chara5 != null)
854 {
856 {
857 target = chara5,
859 });
860 }
861 }
862 }
864 {
866 }
868 {
870 }
872 {
874 }
875 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
876 {
878 {
880 {
881 owner.Talk("snail");
882 Thing t4 = ThingGen.Create("1142");
883 ActThrow.Throw(owner, c.pos, t4);
884 }
885 });
887 }
889 {
892 {
894 {
895 shackle = traitShackle2
896 });
898 }
899 }
901 {
903 }
905 {
907 if (cleanPoint != null)
908 {
910 {
911 pos = cleanPoint
912 });
913 }
914 }
916 {
918 {
922 {
924 }
925 }
927 }
929 {
931 {
933 {
936 break;
937 }
938 }
939 }
941 {
943 if (thing7 == null)
944 {
946 {
948 {
950 if (card2 != null)
951 {
953 }
954 });
955 }
956 }
957 else
958 {
960 {
962 {
964 break;
965 }
966 }
967 }
968 }
970 {
972 }
974 {
976 }
979 {
980 owner.idleActTimer = 10 +
EClass.
rnd(50);
981 switch (idAct)
982 {
983 case "torture_snail":
985 {
990 {
991 Steam.GetAchievement(ID_Achievement.SNAIL);
992 }
995 });
996 break;
997 case "buffMage":
999 {
1001 }
1002 else
1003 {
1005 }
1006 break;
1007 case "buffThief":
1009 break;
1010 case "buffGuildWatch":
1012 break;
1013 case "buffHealer":
1015 break;
1016 case "readBook":
1017 {
1019 {
1020 break;
1021 }
1023 Thing thing8 =
null;
1024 if (list4.Count > 0)
1025 {
1026 thing8 = list4.RandomItem();
1028 {
1029 thing8 = null;
1030 }
1031 }
1032 if (thing8 == null)
1033 {
1035 {
1036 break;
1037 }
1039 thing8.isNPCProperty = true;
1040 }
1042 {
1044 {
1046 }
1048 {
1049 target = thing8
1050 });
1051 }
1052 break;
1053 }
1054 default:
1056 {
1058 }
1059 break;
1060 }
1062 }
1064 {
1066 }
1068 {
1070 {
1072 }
1074 }
1076 {
1078 }
1080 {
1082 {
1085 {
1087 }
1088 else
1089 {
1091 if (room4 != null)
1092 {
1094 }
1095 }
1096 }
1098 {
1100 {
1101 if (!EClass._zone.IsPCFaction)
1102 {
1103 owner.Teleport(owner.orgPos, silent: false, force: true);
1104 }
1106 });
1107 }
1108 }
1110 {
1112 if (thing9 != null)
1113 {
1115 }
1116 }
1118 {
1119 for (int m = 0; m < 100; m++)
1120 {
1123 {
1124 yield
return DoGoto(randomPoint3);
1125 break;
1126 }
1127 }
1128 }
1130 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1131 {
1133 {
1135 }
1137 {
1139 }
1140 }
1142 {
1144 if (aI_Haul != null)
1145 {
1146 yield
return Do(aI_Haul);
1147 }
1148 }
1151 {
1152 for (int n = 0; n < 20; n++)
1153 {
1156 {
1157 return randomPoint4;
1158 }
1159 }
1160 return null;
1161 }
1162 void SetId(string _id, int _num)
1163 {
1164 id = _id;
1165 num = _num;
1166 }
1167 }
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.