Reimplemented from AIAct.
Definition at line 32 of file AI_Idle.cs.
33 {
34 while (true)
35 {
37 {
39 }
41 {
43 owner.nextUse = null;
45 {
47 }
49 }
51 {
53 {
55 }
57 {
59 }
60 }
62 {
65 {
67 if (thing != null)
68 {
70 }
71 }
73 {
75 {
77 }
79 {
82 {
83 thing.isNPCProperty = true;
85 }
86 else
87 {
88 thing = null;
89 }
90 }
91 }
92 if (thing != null)
93 {
95 {
98 }
100 {
102 {
103 target = thing
104 });
105 }
106 }
108 {
110 for (int k = 0; k < 10; k++)
111 {
114 {
115 target = chara;
116 }
117 }
118 if (target != null)
119 {
120 yield
return DoGoto(target);
123 }
124 }
125 }
127 {
129 {
132 }
134 {
136 Act actRevive =
null;
138 {
141 {
142 actRevive = act2;
143 }
144 string[] abilityType = act2.
source.abilityType;
145 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
146 {
148 }
149 }
151 {
152 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
153 foreach (
Chara item2
in list)
154 {
156 {
159 break;
160 }
161 }
162 }
164 {
166 }
167 }
168 }
170 {
173 {
176 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
177 }
178 }
180 {
183 {
185 {
187 {
188 continue;
189 }
190 for (int l = 0; l < 5; l++)
191 {
192 if (thing9.
encLV >= 0)
193 {
194 break;
195 }
200 {
201 break;
202 }
203 }
205 {
206 break;
207 }
208 }
209 }
210 }
212 {
214 {
217 {
219 {
220 shackle = traitShackle
221 });
222 }
224 }
226 {
229 {
231 {
232 target = thing3
233 });
234 }
235 }
237 {
238 List<Chara> list2 = new List<Chara>();
240 {
241 if (member.
Evalue(1227) > 0)
242 {
243 list2.Add(member);
244 }
245 }
247 {
251 }
252 }
254 {
262 }
264 {
266 }
268 {
270 {
272 }
273 else
274 {
276 }
277 }
279 {
281 }
283 {
286 {
288 {
290 {
291 flag = true;
292 }
293 }
294 }
295 if (flag)
296 {
297 bool flag2 = false;
299 {
301 {
302 flag2 = true;
303 break;
304 }
305 }
306 if (flag2)
307 {
309 if (num >= 20000)
310 {
311 num = 20000;
312 }
314 int num2 = num / 200;
316 {
317 if (!(value2.
source.category !=
"skill"))
318 {
322 }
323 }
327 }
328 }
329 }
331 {
333 if (randomPointInRadius != null)
334 {
336 if (randomPointInRadius.
IsValid)
337 {
339 {
340 pos = randomPointInRadius
341 });
342 }
343 }
344 }
345 }
347 {
350 {
352 }
354 {
356 {
358 }
361 {
363 {
365 }
367 continue;
368 }
369 }
370 }
373 {
374 break;
375 }
377 {
379 continue;
380 }
382 {
384 continue;
385 }
387 {
391 {
394 }
395 }
396 else
397 {
399 }
401 }
403 {
405 }
407 {
409 }
411 {
413 }
415 {
417 {
418 case "azzrasizzle":
419 case "geist":
420 {
422 {
423 break;
424 }
426 if (nearestPoint == null)
427 {
428 break;
429 }
431 {
433 }
435 {
437 {
439 }
441 }
443 break;
444 }
445 case "spider_queen":
446 {
448 {
449 break;
450 }
451 int i = 0;
453 {
455 {
456 i++;
457 }
458 });
459 if (i < 2)
460 {
462 if (randomPoint2 != null)
463 {
467 }
468 }
469 break;
470 }
471 case "mech_scarab":
472 {
474 {
475 break;
476 }
477 int j = 0;
479 {
481 {
482 j++;
483 }
484 });
485 if (j >= 2)
486 {
487 break;
488 }
490 if (randomPoint != null)
491 {
494 {
496 }
497 }
498 break;
499 }
500 }
501 }
503 {
506 }
508 {
510 if (room != null)
511 {
514 {
516 }
518 {
520 }
521 if (point != null)
522 {
523 yield
return DoGoto(point);
524 }
525 }
526 }
528 {
530 {
532 {
535 }
537 }
539 {
541 {
543 }
545 {
547 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
548 if (!text.IsEmpty())
549 {
551 }
553 {
555 AI_PlayMusic.ignoreDamage = true;
557 AI_PlayMusic.ignoreDamage = false;
558 }
559 }
560 else
561 {
563 }
565 }
566 }
568 {
570 {
572 }
574 if (tC ==
null || tC.
pop.
items.Count == 0)
575 {
577 {
579 {
581 {
585 }
586 }
587 }
589 {
591 }
593 {
595 }
597 {
599 {
601 }
603 {
605 }
606 }
607 }
608 }
610 {
612 }
614 {
616 }
618 {
619 float mtp = 1f;
622 if (room2 != room3 && room3 != null)
623 {
624 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
625 }
627 }
628 if (
EClass.
rnd(2000) == 0 && owner.IsHuman && (owner.host ==
null || owner.host.ride !=
owner))
629 {
632 {
633 thing4 = null;
634 }
637 {
638 flag5 = true;
639 }
640 if (thing4 == null && !flag5)
641 {
644 }
646 {
649 }
650 }
652 {
654 {
659 {
660 flag6 = false;
661 }
663 {
665 c.
Talk(
"drunk_counter");
667 }
668 });
669 }
671 {
674 {
676 {
677 pos = fishingPoint
678 });
679 }
680 }
683 {
685 }
687 {
689 {
692 if (chara4 !=
owner && thing5 !=
null)
693 {
695 {
696 churyu = thing5,
697 slave = chara4
698 });
699 }
700 }
702 {
704 }
705 }
707 {
709 {
711 });
713 }
715 {
717 if (chara5 != null)
718 {
720 {
721 target = chara5,
722 variation = AI_Fuck.Variation.Bitch
723 });
724 }
725 }
727 {
729 }
731 {
733 }
735 {
737 }
738 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
739 {
741 {
743 {
744 owner.Talk("snail");
745 Thing t4 = ThingGen.Create("1142");
746 ActThrow.Throw(owner, c.pos, t4);
747 }
748 });
750 }
752 {
755 {
757 {
758 shackle = traitShackle2
759 });
761 }
762 }
764 {
766 }
768 {
770 if (cleanPoint != null)
771 {
773 {
774 pos = cleanPoint
775 });
776 }
777 }
779 {
781 {
783 {
786 break;
787 }
788 }
789 }
791 {
793 if (thing6 == null)
794 {
796 {
798 {
800 if (card2 != null)
801 {
803 }
804 });
805 }
806 }
807 else
808 {
810 {
812 {
814 break;
815 }
816 }
817 }
818 }
820 {
822 }
824 {
826 }
829 {
830 owner.idleActTimer = 10 +
EClass.
rnd(50);
831 switch (idAct)
832 {
833 case "torture_snail":
835 {
841 });
842 break;
843 case "buffMage":
845 {
847 }
848 else
849 {
851 }
852 break;
853 case "buffThief":
855 break;
856 case "buffGuildWatch":
858 break;
859 case "buffHealer":
861 break;
862 case "readBook":
863 {
865 {
866 break;
867 }
870 if (list3.Count > 0)
871 {
872 thing7 = list3.RandomItem();
874 {
875 thing7 = null;
876 }
877 }
878 if (thing7 == null)
879 {
881 {
882 break;
883 }
885 thing7.isNPCProperty = true;
886 }
888 {
890 {
892 }
894 {
895 target = thing7
896 });
897 }
898 break;
899 }
900 default:
902 {
904 }
905 break;
906 }
908 }
910 {
912 }
914 {
916 {
918 }
920 }
922 {
924 }
926 {
928 {
931 {
933 }
934 else
935 {
937 if (room4 != null)
938 {
940 }
941 }
942 }
944 {
946 {
947 if (!EClass._zone.IsPCFaction)
948 {
949 owner.Teleport(owner.orgPos, silent: false, force: true);
950 }
952 });
953 }
954 }
956 {
958 if (thing8 != null)
959 {
961 }
962 }
964 {
965 for (int m = 0; m < 100; m++)
966 {
969 {
970 yield
return DoGoto(randomPoint3);
971 break;
972 }
973 }
974 }
976 if (!(aiIdle == "stand") && !(aiIdle == "root"))
977 {
979 {
981 }
983 {
985 }
986 }
988 {
990 if (aI_Haul != null)
991 {
992 yield
return Do(aI_Haul);
993 }
994 }
997 {
998 for (int n = 0; n < 20; n++)
999 {
1002 {
1003 return randomPoint4;
1004 }
1005 }
1006 return null;
1007 }
1008 }
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)
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(), Card.AddThing(), 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.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(), item, ActList.items, PopManager.items, Player.karma, AIAct.KeepRunning(), Party.leader, CharaAbility.list, ThingContainer.List(), Room.lot, Chara.mana, Chara.master, Stats.max, Chara.MaxHP, FactionBranch.members, Party.members, Chara.memberType, 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, EClass.rnd(), EClass.rndHalf(), Cell.room, Msg.Say(), Card.Say(), Chara.SetAI(), Chara.SetEnemy(), Chara.SetHostility(), BaseCard.SetInt(), 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.