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 }
414 {
415 break;
416 }
418 {
420 continue;
421 }
423 {
425 continue;
426 }
428 {
432 {
435 }
436 }
437 else
438 {
440 }
442 }
444 {
446 }
448 {
450 }
452 {
454 }
456 {
458 {
459 case "azzrasizzle":
460 case "geist":
461 {
463 {
464 break;
465 }
467 if (nearestPoint == null)
468 {
469 break;
470 }
472 {
474 }
476 {
478 {
480 }
482 }
484 break;
485 }
486 case "spider_queen":
487 {
489 {
490 break;
491 }
492 int i = 0;
494 {
496 {
497 i++;
498 }
499 });
500 if (i < 2)
501 {
503 if (randomPoint2 != null)
504 {
508 }
509 }
510 break;
511 }
512 case "mech_scarab":
513 {
515 {
516 break;
517 }
518 int j = 0;
520 {
522 {
523 j++;
524 }
525 });
526 if (j >= 2)
527 {
528 break;
529 }
531 if (randomPoint != null)
532 {
535 {
537 }
538 }
539 break;
540 }
541 }
542 }
544 {
547 }
549 {
551 if (room != null)
552 {
555 {
557 }
559 {
561 }
562 if (point != null)
563 {
564 yield
return DoGoto(point);
565 }
566 }
567 }
569 int num;
571 {
573 {
575 {
578 }
580 }
582 {
584 {
585 id = "money";
587 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
590 {
593 SetId("stone", 1);
595 {
596 SetId("shuriken", 1);
597 }
599 {
600 SetId("explosive", 1);
601 }
603 {
604 SetId("explosive_mega", 1);
605 }
607 {
608 SetId("rock", 1);
609 }
610 }
611 else
612 {
614 {
616 }
619 {
620 SetId("money2", 1);
621 }
623 {
624 SetId("plat", 1);
625 }
627 {
628 SetId(strs.RandomItem(), 1);
629 }
630 }
635 {
637 }
638 }
640 {
642 }
644 {
646 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
647 if (!text.IsEmpty())
648 {
650 }
652 {
654 AI_PlayMusic.ignoreDamage = true;
656 AI_PlayMusic.ignoreDamage = false;
657 }
658 }
659 else
660 {
662 }
664 }
665 }
667 {
669 {
671 }
673 if (tC ==
null || tC.
pop.
items.Count == 0)
674 {
676 {
678 {
680 {
684 }
685 }
686 }
688 {
690 }
692 {
694 }
696 {
698 {
700 }
702 {
704 }
705 }
706 }
707 }
709 {
711 }
713 {
715 }
717 {
718 float mtp = 1f;
721 if (room2 != room3 && room3 != null)
722 {
723 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
724 }
726 }
728 {
731 {
732 thing5 = null;
733 }
736 {
737 flag5 = true;
738 }
739 if (thing5 == null && !flag5)
740 {
743 }
745 {
748 }
749 }
751 {
753 {
758 {
759 flag6 = false;
760 }
762 {
764 c.
Talk(
"drunk_counter");
766 }
767 });
768 }
770 {
773 {
775 {
776 pos = fishingPoint
777 });
778 }
779 }
782 {
784 }
786 {
788 {
791 if (chara4 !=
owner && thing6 !=
null)
792 {
794 {
795 churyu = thing6,
796 slave = chara4
797 });
798 }
799 }
801 {
803 }
804 }
806 {
808 {
810 });
812 }
814 {
816 if (chara5 != null)
817 {
819 {
820 target = chara5,
821 variation = AI_Fuck.Variation.Bitch
822 });
823 }
824 }
826 {
828 }
830 {
832 }
834 {
836 }
837 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
838 {
840 {
842 {
843 owner.Talk("snail");
844 Thing t4 = ThingGen.Create("1142");
845 ActThrow.Throw(owner, c.pos, t4);
846 }
847 });
849 }
851 {
854 {
856 {
857 shackle = traitShackle2
858 });
860 }
861 }
863 {
865 }
867 {
869 if (cleanPoint != null)
870 {
872 {
873 pos = cleanPoint
874 });
875 }
876 }
878 {
880 {
884 {
886 }
887 }
889 }
891 {
893 {
895 {
898 break;
899 }
900 }
901 }
903 {
905 if (thing7 == null)
906 {
908 {
910 {
912 if (card2 != null)
913 {
915 }
916 });
917 }
918 }
919 else
920 {
922 {
924 {
926 break;
927 }
928 }
929 }
930 }
932 {
934 }
936 {
938 }
941 {
942 owner.idleActTimer = 10 +
EClass.
rnd(50);
943 switch (idAct)
944 {
945 case "torture_snail":
947 {
953 });
954 break;
955 case "buffMage":
957 {
959 }
960 else
961 {
963 }
964 break;
965 case "buffThief":
967 break;
968 case "buffGuildWatch":
970 break;
971 case "buffHealer":
973 break;
974 case "readBook":
975 {
977 {
978 break;
979 }
982 if (list4.Count > 0)
983 {
984 thing8 = list4.RandomItem();
986 {
987 thing8 = null;
988 }
989 }
990 if (thing8 == null)
991 {
993 {
994 break;
995 }
997 thing8.isNPCProperty = true;
998 }
1000 {
1002 {
1004 }
1006 {
1007 target = thing8
1008 });
1009 }
1010 break;
1011 }
1012 default:
1014 {
1016 }
1017 break;
1018 }
1020 }
1022 {
1024 }
1026 {
1028 {
1030 }
1032 }
1034 {
1036 }
1038 {
1040 {
1043 {
1045 }
1046 else
1047 {
1049 if (room4 != null)
1050 {
1052 }
1053 }
1054 }
1056 {
1058 {
1059 if (!EClass._zone.IsPCFaction)
1060 {
1061 owner.Teleport(owner.orgPos, silent: false, force: true);
1062 }
1064 });
1065 }
1066 }
1068 {
1070 if (thing9 != null)
1071 {
1073 }
1074 }
1076 {
1077 for (int m = 0; m < 100; m++)
1078 {
1081 {
1082 yield
return DoGoto(randomPoint3);
1083 break;
1084 }
1085 }
1086 }
1088 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1089 {
1091 {
1093 }
1095 {
1097 }
1098 }
1100 {
1102 if (aI_Haul != null)
1103 {
1104 yield
return Do(aI_Haul);
1105 }
1106 }
1109 {
1110 for (int n = 0; n < 20; n++)
1111 {
1114 {
1115 return randomPoint4;
1116 }
1117 }
1118 return null;
1119 }
1120 void SetId(string _id, int _num)
1121 {
1122 id = _id;
1123 num = _num;
1124 }
1125 }
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)
ConTransmuteMimic mimicry
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)
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.