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 {
100 }
102 {
104 {
105 target = thing
106 });
107 }
108 }
110 {
112 for (int k = 0; k < 10; k++)
113 {
116 {
117 target = chara;
118 }
119 }
120 if (target != null)
121 {
122 yield
return DoGoto(target);
125 }
126 }
127 }
129 {
131 {
134 }
136 {
138 Act actRevive =
null;
140 {
143 {
145 }
146 string[] abilityType =
act.
source.abilityType;
147 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
148 {
150 }
151 }
152 if (actHeal != null)
153 {
154 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
155 foreach (
Chara item2
in list)
156 {
158 {
161 break;
162 }
163 }
165 {
167 {
169 {
172 }
173 }
175 {
178 }
179 }
180 }
182 {
184 }
185 }
186 }
188 {
191 {
194 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
195 }
196 }
198 {
201 {
203 {
205 {
206 continue;
207 }
208 for (int l = 0; l < 5; l++)
209 {
210 if (thing10.
encLV >= 0)
211 {
212 break;
213 }
218 {
219 break;
220 }
221 }
223 {
224 break;
225 }
226 }
227 }
228 }
230 {
232 {
235 {
237 {
238 shackle = traitShackle
239 });
240 }
242 }
244 {
247 {
249 {
250 target = thing3
251 });
252 }
253 }
255 {
257 {
258 List<Chara> list2 = new List<Chara>();
260 {
261 if (member.
Evalue(1227) > 0)
262 {
263 list2.Add(member);
264 }
265 }
267 {
271 }
272 }
274 {
275 List<Chara> list3 = new List<Chara>();
277 {
279 {
280 list3.Add(member2);
281 }
282 }
284 {
287 }
288 }
289 }
291 {
299 }
301 {
303 }
305 {
307 {
309 }
310 else
311 {
313 }
314 }
316 {
318 }
320 {
323 {
325 {
327 {
328 flag = true;
329 }
330 }
331 }
332 if (flag)
333 {
334 bool flag2 = false;
336 {
338 {
339 flag2 = true;
340 break;
341 }
342 }
343 if (flag2)
344 {
346 if (num2 >= 20000)
347 {
348 num2 = 20000;
349 }
351 int num3 = num2 / 200;
353 {
354 if (!(value2.
source.category !=
"skill"))
355 {
359 }
360 }
364 }
365 }
366 }
368 {
370 if (randomPointInRadius != null)
371 {
373 if (randomPointInRadius.
IsValid)
374 {
376 {
377 pos = randomPointInRadius
378 });
379 }
380 }
381 }
382 }
384 {
387 {
389 }
391 {
393 {
395 }
398 {
400 {
402 }
404 continue;
405 }
406 }
407 }
409 {
411 {
413 }
415 {
417 }
418 }
421 {
422 break;
423 }
425 {
427 continue;
428 }
430 {
432 continue;
433 }
435 {
439 {
442 }
443 }
444 else
445 {
447 }
449 }
451 {
453 }
455 {
457 }
459 {
461 }
463 {
465 {
466 case "azzrasizzle":
467 case "geist":
468 {
470 {
471 break;
472 }
474 if (nearestPoint == null)
475 {
476 break;
477 }
479 {
481 }
483 {
485 {
487 }
489 }
491 break;
492 }
493 case "spider_queen":
494 {
496 {
497 break;
498 }
499 int i = 0;
501 {
503 {
504 i++;
505 }
506 });
507 if (i < 2)
508 {
510 if (randomPoint2 != null)
511 {
515 }
516 }
517 break;
518 }
519 case "mech_scarab":
520 {
522 {
523 break;
524 }
525 int j = 0;
527 {
529 {
530 j++;
531 }
532 });
533 if (j >= 2)
534 {
535 break;
536 }
538 if (randomPoint != null)
539 {
542 {
544 }
545 }
546 break;
547 }
548 }
549 }
551 {
554 }
556 {
558 if (room != null)
559 {
562 {
564 }
566 {
568 }
569 if (point != null)
570 {
571 yield
return DoGoto(point);
572 }
573 }
574 }
576 int num;
578 {
580 {
582 {
585 }
587 }
589 {
591 {
592 id = "money";
594 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
597 {
600 SetId("stone", 1);
602 {
603 SetId("shuriken", 1);
604 }
606 {
607 SetId("explosive", 1);
608 }
610 {
611 SetId("explosive_mega", 1);
612 }
614 {
615 SetId("rock", 1);
616 }
617 }
618 else
619 {
621 {
623 }
626 {
627 SetId("money2", 1);
628 }
630 {
631 SetId("plat", 1);
632 }
634 {
635 SetId(strs.RandomItem(), 1);
636 }
637 }
642 {
644 }
645 }
647 {
649 }
651 {
653 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
654 if (!text.IsEmpty())
655 {
657 }
659 {
661 AI_PlayMusic.ignoreDamage = true;
663 AI_PlayMusic.ignoreDamage = false;
664 }
665 }
666 else
667 {
669 }
671 }
672 }
674 {
676 {
678 }
680 if (tC ==
null || tC.
pop.
items.Count == 0)
681 {
683 {
685 {
687 {
691 }
692 }
693 }
695 {
697 }
699 {
701 }
703 {
705 {
707 }
709 {
711 }
712 }
713 }
714 }
716 {
718 }
720 {
722 }
724 {
725 float mtp = 1f;
728 if (room2 != room3 && room3 != null)
729 {
730 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
731 }
733 }
735 {
738 {
739 thing5 = null;
740 }
743 {
744 flag5 = true;
745 }
746 if (thing5 == null && !flag5)
747 {
750 }
752 {
755 }
756 }
758 {
760 {
765 {
766 flag7 = false;
767 }
769 {
771 c.
Talk(
"drunk_counter");
773 }
774 });
775 }
777 {
780 {
782 {
783 pos = fishingPoint
784 });
785 }
786 }
789 {
791 }
793 {
795 {
798 if (chara4 !=
owner && thing6 !=
null)
799 {
801 {
802 churyu = thing6,
803 slave = chara4
804 });
805 }
806 }
808 {
810 }
811 }
813 {
815 {
817 });
819 }
821 {
824 {
826 if (chara5 != null)
827 {
829 {
830 target = chara5,
832 });
833 }
834 }
835 }
837 {
839 }
841 {
843 }
845 {
847 }
848 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
849 {
851 {
853 {
854 owner.Talk("snail");
855 Thing t4 = ThingGen.Create("1142");
856 ActThrow.Throw(owner, c.pos, t4);
857 }
858 });
860 }
862 {
865 {
867 {
868 shackle = traitShackle2
869 });
871 }
872 }
874 {
876 }
878 {
880 if (cleanPoint != null)
881 {
883 {
884 pos = cleanPoint
885 });
886 }
887 }
889 {
891 {
895 {
897 }
898 }
900 }
902 {
904 {
906 {
909 break;
910 }
911 }
912 }
914 {
916 if (thing7 == null)
917 {
919 {
921 {
923 if (card2 != null)
924 {
926 }
927 });
928 }
929 }
930 else
931 {
933 {
935 {
937 break;
938 }
939 }
940 }
941 }
943 {
945 }
947 {
949 }
952 {
953 owner.idleActTimer = 10 +
EClass.
rnd(50);
954 switch (idAct)
955 {
956 case "torture_snail":
958 {
964 });
965 break;
966 case "buffMage":
968 {
970 }
971 else
972 {
974 }
975 break;
976 case "buffThief":
978 break;
979 case "buffGuildWatch":
981 break;
982 case "buffHealer":
984 break;
985 case "readBook":
986 {
988 {
989 break;
990 }
993 if (list4.Count > 0)
994 {
995 thing8 = list4.RandomItem();
997 {
998 thing8 = null;
999 }
1000 }
1001 if (thing8 == null)
1002 {
1004 {
1005 break;
1006 }
1008 thing8.isNPCProperty = true;
1009 }
1011 {
1013 {
1015 }
1017 {
1018 target = thing8
1019 });
1020 }
1021 break;
1022 }
1023 default:
1025 {
1027 }
1028 break;
1029 }
1031 }
1033 {
1035 }
1037 {
1039 {
1041 }
1043 }
1045 {
1047 }
1049 {
1051 {
1054 {
1056 }
1057 else
1058 {
1060 if (room4 != null)
1061 {
1063 }
1064 }
1065 }
1067 {
1069 {
1070 if (!EClass._zone.IsPCFaction)
1071 {
1072 owner.Teleport(owner.orgPos, silent: false, force: true);
1073 }
1075 });
1076 }
1077 }
1079 {
1081 if (thing9 != null)
1082 {
1084 }
1085 }
1087 {
1088 for (int m = 0; m < 100; m++)
1089 {
1092 {
1093 yield
return DoGoto(randomPoint3);
1094 break;
1095 }
1096 }
1097 }
1099 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1100 {
1102 {
1104 }
1106 {
1108 }
1109 }
1111 {
1113 if (aI_Haul != null)
1114 {
1115 yield
return Do(aI_Haul);
1116 }
1117 }
1120 {
1121 for (int n = 0; n < 20; n++)
1122 {
1125 {
1126 return randomPoint4;
1127 }
1128 }
1129 return null;
1130 }
1131 void SetId(string _id, int _num)
1132 {
1133 id = _id;
1134 num = _num;
1135 }
1136 }
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)
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)
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)
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)
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(), 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, 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, 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, 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, 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.TryMoveTowards(), TryPerformIdleUse(), Chara.TryPutSharedItems(), AI_Shopping.TryRestock(), AI_Shopping.TryShop(), Chara.TryTakeSharedItems(), Chara.TryUse(), Chara.turnLastSeen, Player.Stats.turns, Chara.UseAbility(), Stats.value, Element.ValueWithoutLink, Element.vTempPotential, and EClass.world.