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 {
144 actRevive = act2;
145 }
146 string[] abilityType = act2.
source.abilityType;
147 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
148 {
150 }
151 }
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 }
164 }
166 {
168 }
169 }
170 }
172 {
175 {
178 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
179 }
180 }
182 {
185 {
187 {
189 {
190 continue;
191 }
192 for (int l = 0; l < 5; l++)
193 {
194 if (thing9.
encLV >= 0)
195 {
196 break;
197 }
202 {
203 break;
204 }
205 }
207 {
208 break;
209 }
210 }
211 }
212 }
214 {
216 {
219 {
221 {
222 shackle = traitShackle
223 });
224 }
226 }
228 {
231 {
233 {
234 target = thing3
235 });
236 }
237 }
239 {
240 List<Chara> list2 = new List<Chara>();
242 {
243 if (member.
Evalue(1227) > 0)
244 {
245 list2.Add(member);
246 }
247 }
249 {
253 }
254 }
256 {
264 }
266 {
268 }
270 {
272 {
274 }
275 else
276 {
278 }
279 }
281 {
283 }
285 {
288 {
290 {
292 {
293 flag = true;
294 }
295 }
296 }
297 if (flag)
298 {
299 bool flag2 = false;
301 {
303 {
304 flag2 = true;
305 break;
306 }
307 }
308 if (flag2)
309 {
311 if (num >= 20000)
312 {
313 num = 20000;
314 }
316 int num2 = num / 200;
318 {
319 if (!(value2.
source.category !=
"skill"))
320 {
324 }
325 }
329 }
330 }
331 }
333 {
335 if (randomPointInRadius != null)
336 {
338 if (randomPointInRadius.
IsValid)
339 {
341 {
342 pos = randomPointInRadius
343 });
344 }
345 }
346 }
347 }
349 {
352 {
354 }
356 {
358 {
360 }
363 {
365 {
367 }
369 continue;
370 }
371 }
372 }
374 {
376 }
379 {
380 break;
381 }
383 {
385 continue;
386 }
388 {
390 continue;
391 }
393 {
397 {
400 }
401 }
402 else
403 {
405 }
407 }
409 {
411 }
413 {
415 }
417 {
419 }
421 {
423 {
424 case "azzrasizzle":
425 case "geist":
426 {
428 {
429 break;
430 }
432 if (nearestPoint == null)
433 {
434 break;
435 }
437 {
439 }
441 {
443 {
445 }
447 }
449 break;
450 }
451 case "spider_queen":
452 {
454 {
455 break;
456 }
457 int i = 0;
459 {
461 {
462 i++;
463 }
464 });
465 if (i < 2)
466 {
468 if (randomPoint2 != null)
469 {
473 }
474 }
475 break;
476 }
477 case "mech_scarab":
478 {
480 {
481 break;
482 }
483 int j = 0;
485 {
487 {
488 j++;
489 }
490 });
491 if (j >= 2)
492 {
493 break;
494 }
496 if (randomPoint != null)
497 {
500 {
502 }
503 }
504 break;
505 }
506 }
507 }
509 {
512 }
514 {
516 if (room != null)
517 {
520 {
522 }
524 {
526 }
527 if (point != null)
528 {
529 yield
return DoGoto(point);
530 }
531 }
532 }
534 {
536 {
538 {
541 }
543 }
545 {
547 {
549 }
551 {
553 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
554 if (!text.IsEmpty())
555 {
557 }
559 {
561 AI_PlayMusic.ignoreDamage = true;
563 AI_PlayMusic.ignoreDamage = false;
564 }
565 }
566 else
567 {
569 }
571 }
572 }
574 {
576 {
578 }
580 if (tC ==
null || tC.
pop.
items.Count == 0)
581 {
583 {
585 {
587 {
591 }
592 }
593 }
595 {
597 }
599 {
601 }
603 {
605 {
607 }
609 {
611 }
612 }
613 }
614 }
616 {
618 }
620 {
622 }
624 {
625 float mtp = 1f;
628 if (room2 != room3 && room3 != null)
629 {
630 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
631 }
633 }
634 if (
EClass.
rnd(2000) == 0 && owner.IsHuman && (owner.host ==
null || owner.host.ride !=
owner))
635 {
638 {
639 thing4 = null;
640 }
643 {
644 flag5 = true;
645 }
646 if (thing4 == null && !flag5)
647 {
650 }
652 {
655 }
656 }
658 {
660 {
665 {
666 flag6 = false;
667 }
669 {
671 c.
Talk(
"drunk_counter");
673 }
674 });
675 }
677 {
680 {
682 {
683 pos = fishingPoint
684 });
685 }
686 }
689 {
691 }
693 {
695 {
698 if (chara4 !=
owner && thing5 !=
null)
699 {
701 {
702 churyu = thing5,
703 slave = chara4
704 });
705 }
706 }
708 {
710 }
711 }
713 {
715 {
717 });
719 }
721 {
723 if (chara5 != null)
724 {
726 {
727 target = chara5,
728 variation = AI_Fuck.Variation.Bitch
729 });
730 }
731 }
733 {
735 }
737 {
739 }
741 {
743 }
744 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
745 {
747 {
749 {
750 owner.Talk("snail");
751 Thing t4 = ThingGen.Create("1142");
752 ActThrow.Throw(owner, c.pos, t4);
753 }
754 });
756 }
758 {
761 {
763 {
764 shackle = traitShackle2
765 });
767 }
768 }
770 {
772 }
774 {
776 if (cleanPoint != null)
777 {
779 {
780 pos = cleanPoint
781 });
782 }
783 }
785 {
787 {
789 {
792 break;
793 }
794 }
795 }
797 {
799 if (thing6 == null)
800 {
802 {
804 {
806 if (card2 != null)
807 {
809 }
810 });
811 }
812 }
813 else
814 {
816 {
818 {
820 break;
821 }
822 }
823 }
824 }
826 {
828 }
830 {
832 }
835 {
836 owner.idleActTimer = 10 +
EClass.
rnd(50);
837 switch (idAct)
838 {
839 case "torture_snail":
841 {
847 });
848 break;
849 case "buffMage":
851 {
853 }
854 else
855 {
857 }
858 break;
859 case "buffThief":
861 break;
862 case "buffGuildWatch":
864 break;
865 case "buffHealer":
867 break;
868 case "readBook":
869 {
871 {
872 break;
873 }
876 if (list3.Count > 0)
877 {
878 thing7 = list3.RandomItem();
880 {
881 thing7 = null;
882 }
883 }
884 if (thing7 == null)
885 {
887 {
888 break;
889 }
891 thing7.isNPCProperty = true;
892 }
894 {
896 {
898 }
900 {
901 target = thing7
902 });
903 }
904 break;
905 }
906 default:
908 {
910 }
911 break;
912 }
914 }
916 {
918 }
920 {
922 {
924 }
926 }
928 {
930 }
932 {
934 {
937 {
939 }
940 else
941 {
943 if (room4 != null)
944 {
946 }
947 }
948 }
950 {
952 {
953 if (!EClass._zone.IsPCFaction)
954 {
955 owner.Teleport(owner.orgPos, silent: false, force: true);
956 }
958 });
959 }
960 }
962 {
964 if (thing8 != null)
965 {
967 }
968 }
970 {
971 for (int m = 0; m < 100; m++)
972 {
975 {
976 yield
return DoGoto(randomPoint3);
977 break;
978 }
979 }
980 }
982 if (!(aiIdle == "stand") && !(aiIdle == "root"))
983 {
985 {
987 }
989 {
991 }
992 }
994 {
996 if (aI_Haul != null)
997 {
998 yield
return Do(aI_Haul);
999 }
1000 }
1003 {
1004 for (int n = 0; n < 20; n++)
1005 {
1008 {
1009 return randomPoint4;
1010 }
1011 }
1012 return null;
1013 }
1014 }
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)
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, 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, 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.