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 }
107 }
109 {
111 {
114 }
116 {
118 Act actRevive =
null;
120 {
123 {
124 actRevive = act2;
125 }
126 string[] abilityType = act2.
source.abilityType;
127 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
128 {
130 }
131 }
133 {
134 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
135 foreach (
Chara item2
in list)
136 {
138 {
141 break;
142 }
143 }
144 }
146 {
148 }
149 }
150 }
152 {
155 {
158 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
159 }
160 }
162 {
165 {
167 {
169 {
170 continue;
171 }
172 for (int j = 0; j < 5; j++)
173 {
174 if (thing9.
encLV >= 0)
175 {
176 break;
177 }
182 {
183 break;
184 }
185 }
187 {
188 break;
189 }
190 }
191 }
192 }
194 {
196 {
199 {
201 {
202 shackle = traitShackle
203 });
204 }
206 }
208 {
211 {
213 {
214 target = thing3
215 });
216 }
217 }
219 {
220 List<Chara> list2 = new List<Chara>();
222 {
223 if (member.
Evalue(1227) > 0)
224 {
225 list2.Add(member);
226 }
227 }
228 if (list2.Count > 2)
229 {
233 }
234 }
236 {
244 }
246 {
248 }
250 {
252 {
254 }
255 else
256 {
258 }
259 }
261 {
263 }
265 {
268 {
270 {
272 {
273 flag = true;
274 }
275 }
276 }
277 if (flag)
278 {
279 bool flag2 = false;
281 {
283 {
284 flag2 = true;
285 break;
286 }
287 }
288 if (flag2)
289 {
291 if (num >= 20000)
292 {
293 num = 20000;
294 }
296 int num2 = num / 200;
298 {
299 if (!(value2.
source.category !=
"skill"))
300 {
304 }
305 }
309 }
310 }
311 }
312 }
314 {
317 {
319 }
321 {
323 {
325 }
328 {
330 {
332 }
334 continue;
335 }
336 }
337 }
340 {
341 break;
342 }
344 {
346 continue;
347 }
349 {
351 continue;
352 }
354 {
358 {
361 }
362 }
363 else
364 {
366 }
368 }
370 {
372 }
374 {
376 }
378 {
380 }
381 string text;
383 {
385 if (!(text == "geist"))
386 {
388 {
389 int i = 0;
391 {
393 {
394 i++;
395 }
396 });
397 if (i < 2)
398 {
400 if (randomPoint != null)
401 {
404 {
406 }
407 }
408 }
409 }
410 }
412 {
414 if (nearestPoint != null)
415 {
417 {
419 }
421 {
423 {
425 }
427 }
429 }
430 }
431 }
433 {
435 if (room != null)
436 {
439 {
441 }
443 {
445 }
446 if (point != null)
447 {
448 yield
return DoGoto(point);
449 }
450 }
451 }
453 {
455 {
457 {
460 }
462 }
464 {
466 {
468 }
470 {
472 string text2 = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
473 if (!text2.IsEmpty())
474 {
476 }
478 {
480 AI_PlayMusic.ignoreDamage = true;
482 AI_PlayMusic.ignoreDamage = false;
483 }
484 }
485 else
486 {
488 }
490 }
491 }
493 {
495 {
497 }
499 if (tC ==
null || tC.
pop.
items.Count == 0)
500 {
502 {
504 {
506 {
510 }
511 }
512 }
514 {
516 }
518 {
520 }
522 {
524 {
526 }
528 {
530 }
531 }
532 }
533 }
535 {
537 }
539 {
541 }
543 {
544 float mtp = 1f;
547 if (room2 != room3 && room3 != null)
548 {
549 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
550 }
552 }
553 if (
EClass.
rnd(2000) == 0 && owner.IsHuman && (owner.host ==
null || owner.host.ride !=
owner))
554 {
557 {
558 thing4 = null;
559 }
562 {
563 flag5 = true;
564 }
565 if (thing4 == null && !flag5)
566 {
569 }
571 {
574 }
575 }
577 {
579 {
584 {
585 flag6 = false;
586 }
588 {
590 c.
Talk(
"drunk_counter");
592 }
593 });
594 }
596 {
599 {
601 {
602 pos = fishingPoint
603 });
604 }
605 }
608 {
610 }
612 {
614 {
617 if (chara2 !=
owner && thing5 !=
null)
618 {
620 {
621 churyu = thing5,
622 slave = chara2
623 });
624 }
625 }
627 {
629 }
630 }
632 {
634 {
636 });
638 }
640 {
642 if (chara3 != null)
643 {
645 {
646 target = chara3,
647 bitch = true
648 });
649 }
650 }
652 {
654 }
656 {
658 }
660 {
662 }
663 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
664 {
666 {
668 {
669 owner.Talk("snail");
670 Thing t4 = ThingGen.Create("1142");
671 ActThrow.Throw(owner, c.pos, t4);
672 }
673 });
675 }
677 {
680 {
682 {
683 shackle = traitShackle2
684 });
686 }
687 }
689 {
691 }
693 {
695 if (cleanPoint != null)
696 {
698 {
699 pos = cleanPoint
700 });
701 }
702 }
704 {
706 {
708 {
711 break;
712 }
713 }
714 }
716 {
718 if (thing6 == null)
719 {
721 {
723 if (card2 != null)
724 {
726 }
727 });
728 }
729 else
730 {
732 {
734 {
736 break;
737 }
738 }
739 }
740 }
742 {
744 }
746 {
748 }
751 {
752 owner.idleActTimer = 10 +
EClass.
rnd(50);
753 switch (idAct)
754 {
755 case "torture_snail":
757 {
763 });
764 break;
765 case "buffMage":
767 {
769 }
770 else
771 {
773 }
774 break;
775 case "buffThief":
777 break;
778 case "buffGuildWatch":
780 break;
781 case "buffHealer":
783 break;
784 case "readBook":
785 {
787 {
788 break;
789 }
792 if (list3.Count > 0)
793 {
794 thing7 = list3.RandomItem();
796 {
797 thing7 = null;
798 }
799 }
800 if (thing7 == null)
801 {
803 {
804 break;
805 }
807 thing7.isNPCProperty = true;
808 }
810 {
812 {
814 }
816 {
817 target = thing7
818 });
819 }
820 break;
821 }
822 default:
824 {
826 }
827 break;
828 }
830 }
832 {
834 }
836 {
838 {
840 }
842 }
844 {
846 }
848 {
850 {
853 {
855 }
856 else
857 {
859 if (room4 != null)
860 {
862 }
863 }
864 }
866 {
868 {
869 if (!EClass._zone.IsPCFaction)
870 {
871 owner.Teleport(owner.orgPos, silent: false, force: true);
872 }
874 });
875 }
876 }
878 {
880 if (thing8 != null)
881 {
883 }
884 }
886 {
887 for (int k = 0; k < 100; k++)
888 {
891 {
892 yield
return DoGoto(randomPoint2);
893 break;
894 }
895 }
896 }
898 if (!(text == "stand") && !(text == "root"))
899 {
901 {
903 }
905 {
907 }
908 }
910 {
912 if (aI_Haul != null)
913 {
914 yield
return Do(aI_Haul);
915 }
916 }
919 {
920 for (int l = 0; l < 20; l++)
921 {
924 {
925 return randomPoint3;
926 }
927 }
928 return null;
929 }
930 }
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
bool HasElement(int ele, int req=1)
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 UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
bool HasHobbyOrWork(string alias)
override bool IsAliveInCurrentZone
Thing FindBestFoodToEat()
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()
MoveResult TryMoveTowards(Point p)
Chara SetEnemy(Chara c=null)
void DoHostileAction(Card _tg, bool immediate=false)
void TryTakeSharedItems(bool msg=true)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
int AllyDistance(Chara c)
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)
static bool Has(string id)
static string _currency(object a, string IDCurrency)
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)
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)
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)
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(), Zone.Boss, EClass.Branch, Zone.branch, Card.c_isImportant, 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(), Card.ExistsOnMap, Chara.faction, 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(), Card.GetHearingRadius(), BaseCard.GetInt(), FactionBranch.GetMeal(), Chara.GetNearbyCatToSniff(), Point.GetNearestPoint(), Stats.GetPhase(), BaseArea.GetRandomPoint(), Point.GetRandomPoint(), Date.GetRaw(), CardRenderer.GetTC(), CardManager.globalCharas, 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, 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.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(), Point.ListCharasInRadius(), 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, 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, AIAct.Restart(), TraitManager.restSpots, EClass.rnd(), EClass.rndHalf(), Cell.room, Msg.Say(), Card.Say(), Chara.SetAI(), Chara.SetEnemy(), BaseCard.SetInt(), Chara.sharedCheckTurn, Chara.Sniff(), EClass.Sound, Chara.source, Element.source, 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.