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 {
175 {
177 }
181 }
182 }
184 {
186 {
188 }
191 }
192 }
193 }
195 {
197 }
198 }
199 }
201 {
204 {
207 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
208 }
209 }
211 {
214 {
216 {
218 {
219 continue;
220 }
221 for (int l = 0; l < 5; l++)
222 {
223 if (thing10.
encLV >= 0)
224 {
225 break;
226 }
231 {
232 break;
233 }
234 }
236 {
237 break;
238 }
239 }
240 }
241 }
243 {
245 {
248 {
250 {
251 shackle = traitShackle
252 });
253 }
255 }
257 {
260 {
262 {
263 target = thing3
264 });
265 }
266 }
268 {
270 {
271 List<Chara> list2 = new List<Chara>();
273 {
274 if (member.
Evalue(1227) > 0)
275 {
276 list2.Add(member);
277 }
278 }
280 {
284 }
285 }
287 {
288 List<Chara> list3 = new List<Chara>();
290 {
292 {
293 list3.Add(member2);
294 }
295 }
297 {
300 }
301 }
302 }
304 {
312 }
314 {
316 }
318 {
320 {
322 }
323 else
324 {
326 }
327 }
329 {
331 }
333 {
336 {
338 {
340 {
341 flag = true;
342 }
343 }
344 }
345 if (flag)
346 {
347 bool flag2 = false;
349 {
351 {
352 flag2 = true;
353 break;
354 }
355 }
356 if (flag2)
357 {
359 if (num2 >= 20000)
360 {
361 num2 = 20000;
362 }
364 int num3 = num2 / 200;
366 {
367 if (!(value2.
source.category !=
"skill"))
368 {
372 }
373 }
377 }
378 }
379 }
381 {
383 if (randomPointInRadius != null)
384 {
386 if (randomPointInRadius.
IsValid)
387 {
389 {
390 pos = randomPointInRadius
391 });
392 }
393 }
394 }
395 }
397 {
400 {
402 }
404 {
406 {
408 }
411 {
413 {
415 }
417 continue;
418 }
419 }
420 }
422 {
424 {
426 }
428 {
430 }
432 {
434 {
438 {
439 owner.mimicry.Reveal(c, surprise: true);
440 }
441 });
442 }
443 }
445 {
447 }
450 {
451 break;
452 }
454 {
456 continue;
457 }
459 {
461 continue;
462 }
464 {
468 {
471 }
472 }
473 else
474 {
476 }
478 }
480 {
482 }
484 {
486 }
488 {
490 }
492 {
494 {
495 case "azzrasizzle":
496 case "geist":
497 {
499 {
500 break;
501 }
503 if (nearestPoint == null)
504 {
505 break;
506 }
508 {
510 }
512 {
514 {
516 }
518 }
520 break;
521 }
522 case "spider_queen":
523 {
525 {
526 break;
527 }
528 int j = 0;
530 {
532 {
533 j++;
534 }
535 });
536 if (j < 2)
537 {
539 if (randomPoint != null)
540 {
544 }
545 }
546 break;
547 }
548 case "mech_scarab":
549 {
551 {
552 break;
553 }
554 int i = 0;
556 {
558 {
559 i++;
560 }
561 });
562 if (i >= 2)
563 {
564 break;
565 }
567 if (randomPoint2 != null)
568 {
571 {
573 }
574 }
575 break;
576 }
577 case "imotoroid":
578 case "marshmallow_monster":
580 {
582 }
583 break;
584 }
585 }
587 {
590 }
592 {
594 if (room != null)
595 {
598 {
600 }
602 {
604 }
605 if (point != null)
606 {
607 yield
return DoGoto(point);
608 }
609 }
610 }
612 int num;
614 {
616 {
618 {
621 }
623 }
625 {
627 {
628 id = "money";
630 string[] strs = new string[4] { "1294", "1294", "1130", "1131" };
633 {
636 SetId("stone", 1);
638 {
639 SetId("shuriken", 1);
640 }
642 {
643 SetId("explosive", 1);
644 }
646 {
647 SetId("explosive_mega", 1);
648 }
650 {
651 SetId("rock", 1);
652 }
653 }
654 else
655 {
657 {
659 }
662 {
663 SetId("money2", 1);
664 }
666 {
667 SetId("plat", 1);
668 }
670 {
671 SetId(strs.RandomItem(), 1);
672 }
673 }
678 {
680 }
681 }
683 {
685 }
687 {
689 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
690 if (!text.IsEmpty())
691 {
693 }
695 {
697 AI_PlayMusic.ignoreDamage = true;
699 AI_PlayMusic.ignoreDamage = false;
700 }
701 }
702 else
703 {
705 }
707 }
708 }
710 {
712 {
714 }
716 if (tC ==
null || tC.
pop.
items.Count == 0)
717 {
719 {
721 {
723 {
727 }
728 }
729 }
731 {
733 }
735 {
737 }
739 {
741 {
743 }
745 {
747 }
748 }
749 }
750 }
752 {
754 }
756 {
758 }
760 {
761 float mtp = 1f;
764 if (room2 != room3 && room3 != null)
765 {
766 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
767 }
769 }
771 {
774 {
775 thing5 = null;
776 }
779 {
780 flag5 = true;
781 }
782 if (thing5 == null && !flag5)
783 {
786 }
788 {
791 }
792 }
794 {
796 {
801 {
802 flag7 = false;
803 }
805 {
807 c.
Talk(
"drunk_counter");
809 }
810 });
811 }
813 {
816 {
818 {
819 pos = fishingPoint
820 });
821 }
822 }
825 {
827 }
829 {
831 {
834 if (chara4 !=
owner && thing6 !=
null)
835 {
837 {
838 churyu = thing6,
839 slave = chara4
840 });
841 }
842 }
844 {
846 }
847 }
849 {
851 {
853 });
855 }
857 {
860 {
862 if (chara5 != null)
863 {
865 {
866 target = chara5,
868 });
869 }
870 }
871 }
873 {
875 }
877 {
879 }
881 {
883 }
884 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
885 {
887 {
889 {
890 owner.Talk("snail");
891 Thing t4 = ThingGen.Create("1142");
892 ActThrow.Throw(owner, c.pos, t4);
893 }
894 });
896 }
898 {
901 {
903 {
904 shackle = traitShackle2
905 });
907 }
908 }
910 {
912 }
914 {
916 if (cleanPoint != null)
917 {
919 {
920 pos = cleanPoint
921 });
922 }
923 }
925 {
927 {
931 {
933 }
934 }
936 }
938 {
940 {
942 {
945 break;
946 }
947 }
948 }
950 {
952 if (thing7 == null)
953 {
955 {
957 {
959 if (card2 != null)
960 {
962 }
963 });
964 }
965 }
966 else
967 {
969 {
971 {
973 break;
974 }
975 }
976 }
977 }
979 {
981 }
983 {
985 }
988 {
989 owner.idleActTimer = 10 +
EClass.
rnd(50);
990 switch (idAct)
991 {
992 case "torture_snail":
994 {
999 {
1000 Steam.GetAchievement(ID_Achievement.SNAIL);
1001 }
1004 });
1005 break;
1006 case "buffMage":
1008 {
1010 }
1011 else
1012 {
1014 }
1015 break;
1016 case "buffThief":
1018 break;
1019 case "buffGuildWatch":
1021 break;
1022 case "buffHealer":
1024 break;
1025 case "readBook":
1026 {
1028 {
1029 break;
1030 }
1032 Thing thing8 =
null;
1033 if (list4.Count > 0)
1034 {
1035 thing8 = list4.RandomItem();
1037 {
1038 thing8 = null;
1039 }
1040 }
1041 if (thing8 == null)
1042 {
1044 {
1045 break;
1046 }
1048 thing8.isNPCProperty = true;
1049 }
1051 {
1053 {
1055 }
1057 {
1058 target = thing8
1059 });
1060 }
1061 break;
1062 }
1063 default:
1065 {
1067 }
1068 break;
1069 }
1071 }
1073 {
1075 }
1077 {
1079 {
1081 }
1083 }
1085 {
1087 }
1089 {
1091 {
1094 {
1096 }
1097 else
1098 {
1100 if (room4 != null)
1101 {
1103 }
1104 }
1105 }
1107 {
1109 {
1110 if (!EClass._zone.IsPCFaction)
1111 {
1112 owner.Teleport(owner.orgPos, silent: false, force: true);
1113 }
1115 });
1116 }
1117 }
1119 {
1121 if (thing9 != null)
1122 {
1124 }
1125 }
1127 {
1128 for (int m = 0; m < 100; m++)
1129 {
1132 {
1133 yield
return DoGoto(randomPoint3);
1134 break;
1135 }
1136 }
1137 }
1139 if (!(aiIdle == "stand") && !(aiIdle == "root"))
1140 {
1142 {
1144 }
1146 {
1148 }
1149 }
1151 {
1153 if (aI_Haul != null)
1154 {
1155 yield
return Do(aI_Haul);
1156 }
1157 }
1160 {
1161 for (int n = 0; n < 20; n++)
1162 {
1165 {
1166 return randomPoint4;
1167 }
1168 }
1169 return null;
1170 }
1171 void SetId(string _id, int _num)
1172 {
1173 id = _id;
1174 num = _num;
1175 }
1176 }
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.