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 }
69 {
71 if (thing != null)
72 {
74 }
75 }
77 {
79 {
81 }
83 {
85 thing.isNPCProperty = true;
87 {
89 }
90 }
91 }
92 if (thing != null)
93 {
95 {
98 }
100 {
102 {
103 target = thing
104 });
105 }
106 }
107 }
109 {
111 Act actRevive =
null;
113 {
116 {
117 actRevive = act2;
118 }
119 string[] abilityType = act2.
source.abilityType;
120 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
121 {
123 }
124 }
126 {
127 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members :
new List<Chara> {
owner });
128 foreach (
Chara item2
in list)
129 {
131 {
134 break;
135 }
136 }
137 }
139 {
141 }
142 }
144 {
147 {
150 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
151 }
152 }
154 {
157 {
159 {
161 {
162 continue;
163 }
164 for (int i = 0; i < 5; i++)
165 {
166 if (thing8.
encLV >= 0)
167 {
168 break;
169 }
174 {
175 break;
176 }
177 }
179 {
180 break;
181 }
182 }
183 }
184 }
186 {
188 {
191 {
193 {
194 shackle = traitShackle
195 });
196 }
198 }
200 {
203 {
205 {
206 target = thing3
207 });
208 }
209 }
211 {
212 List<Chara> list2 = new List<Chara>();
214 {
215 if (member.
Evalue(1227) > 0)
216 {
217 list2.Add(member);
218 }
219 }
220 if (list2.Count > 2)
221 {
225 }
226 }
228 {
236 }
238 {
240 }
242 {
244 {
246 }
247 else
248 {
250 }
251 }
253 {
255 }
257 {
260 {
262 {
264 {
265 flag = true;
266 }
267 }
268 }
269 if (flag)
270 {
271 bool flag2 = false;
273 {
275 {
276 flag2 = true;
277 break;
278 }
279 }
280 if (flag2)
281 {
283 if (num >= 20000)
284 {
285 num = 20000;
286 }
288 int num2 = num / 200;
290 {
291 if (!(value2.
source.category !=
"skill"))
292 {
296 }
297 }
301 }
302 }
303 }
304 }
306 {
309 {
311 }
313 {
315 {
317 }
320 {
322 {
324 }
326 continue;
327 }
328 }
329 }
332 {
333 break;
334 }
336 {
338 continue;
339 }
341 {
343 continue;
344 }
346 {
350 {
353 }
354 }
355 else
356 {
358 }
360 }
362 {
364 }
366 {
368 }
370 {
372 }
374 {
376 if (nearestPoint != null)
377 {
379 {
381 }
383 {
385 }
387 }
388 }
390 {
392 if (room != null)
393 {
396 {
398 }
400 {
402 }
403 if (point != null)
404 {
405 yield
return DoGoto(point);
406 }
407 }
408 }
410 {
412 {
414 {
417 }
419 }
421 {
423 {
425 }
427 {
429 string text = ((EClass.player.karma > 10) ? ((
EClass.
player.
karma < 90) ?
"" : (flag4 ?
"rumor_bad" :
"rumor_good")) : (flag4 ?
"rumor_good" :
"rumor_bad"));
430 if (!text.IsEmpty())
431 {
433 }
435 {
437 AI_PlayMusic.ignoreDamage = true;
439 AI_PlayMusic.ignoreDamage = false;
440 }
441 }
442 else
443 {
445 }
447 }
448 }
450 {
452 {
454 }
456 if (tC ==
null || tC.
pop.
items.Count == 0)
457 {
459 {
461 {
463 {
467 }
468 }
469 }
471 {
473 }
475 {
477 }
479 {
481 {
483 }
485 {
487 }
488 }
489 }
490 }
492 {
494 }
496 {
498 }
500 {
501 float mtp = 1f;
504 if (room2 != room3 && room3 != null)
505 {
506 mtp = ((room2?.
lot != room3?.
lot) ? 0.4f : 0.7f);
507 }
509 }
510 if (
EClass.
rnd(2000) == 0 && owner.IsHuman && (owner.host ==
null || owner.host.ride !=
owner))
511 {
514 {
515 thing4 = null;
516 }
519 {
520 flag5 = true;
521 }
522 if (thing4 == null && !flag5)
523 {
526 }
528 {
531 }
532 }
534 {
536 {
541 {
542 flag6 = false;
543 }
545 {
547 c.
Talk(
"drunk_counter");
549 }
550 });
551 }
553 {
556 {
558 {
559 pos = fishingPoint
560 });
561 }
562 }
565 {
567 }
569 {
571 {
573 });
575 }
577 {
579 if (chara2 != null)
580 {
582 {
583 target = chara2,
584 bitch = true
585 });
586 }
587 }
589 {
591 }
593 {
595 }
597 {
599 }
600 if (idAct ==
"janitor" &&
EClass.
rnd(5) == 0)
601 {
603 {
605 {
606 owner.Talk("snail");
607 Thing t4 = ThingGen.Create("1142");
608 ActThrow.Throw(owner, c.pos, t4);
609 }
610 });
612 }
614 {
617 {
619 {
620 shackle = traitShackle2
621 });
623 }
624 }
626 {
628 }
630 {
632 if (cleanPoint != null)
633 {
635 {
636 pos = cleanPoint
637 });
638 }
639 }
641 {
643 {
645 {
648 break;
649 }
650 }
651 }
653 {
655 if (thing5 == null)
656 {
658 {
660 if (card2 != null)
661 {
663 }
664 });
665 }
666 else
667 {
669 {
671 {
673 break;
674 }
675 }
676 }
677 }
679 {
681 }
683 {
685 }
688 {
689 owner.idleActTimer = 10 +
EClass.
rnd(50);
690 switch (idAct)
691 {
692 case "torture_snail":
694 {
700 });
701 break;
702 case "buffMage":
704 {
706 }
707 else
708 {
710 }
711 break;
712 case "buffThief":
714 break;
715 case "buffGuildWatch":
717 break;
718 case "buffHealer":
720 break;
721 case "readBook":
722 {
724 {
725 break;
726 }
729 if (list3.Count > 0)
730 {
731 thing6 = list3.RandomItem();
733 {
734 thing6 = null;
735 }
736 }
737 if (thing6 == null)
738 {
740 {
741 break;
742 }
744 thing6.isNPCProperty = true;
745 }
747 {
749 {
751 }
753 {
754 target = thing6
755 });
756 }
757 break;
758 }
759 default:
761 {
763 }
764 break;
765 }
767 }
769 {
771 }
773 {
775 {
777 }
779 }
781 {
783 }
785 {
787 {
790 {
792 }
793 else
794 {
796 if (room4 != null)
797 {
799 }
800 }
801 }
803 {
805 {
806 if (!EClass._zone.IsPCFaction)
807 {
808 owner.Teleport(owner.orgPos, silent: false, force: true);
809 }
811 });
812 }
813 }
815 {
817 if (thing7 != null)
818 {
820 }
821 }
823 {
824 for (int j = 0; j < 100; j++)
825 {
828 {
829 yield
return DoGoto(randomPoint);
830 break;
831 }
832 }
833 }
835 if (!(aiIdle == "stand") && !(aiIdle == "root"))
836 {
838 {
840 }
842 {
844 }
845 }
847 {
849 if (aI_Haul != null)
850 {
851 yield
return Do(aI_Haul);
852 }
853 }
856 {
857 for (int k = 0; k < 20; k++)
858 {
861 {
862 return randomPoint2;
863 }
864 }
865 return null;
866 }
867 }
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
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
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")
bool HasEditorTag(EditorTag tag)
int ChildrenAndSelfWeight
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)
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)
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)
bool Equals(int _x, int _z)
Thing FindThing(Func< Thing, bool > func)
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
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
References Lang._currency(), EClass._map, EClass._zone, Chara.ability, AreaData.accessType, Element.act, Chara.AddCondition(), Card.AddThing(), Chara.ai, TraitShackle.AllowTraining, ConfigTactics.AllyDistance(), Zone.Boss, EClass.Branch, Zone.branch, Card.c_isImportant, Card.c_uidMaster, Trait.CanDrink(), Trait.CanEat(), Chara.CanEat(), TraitChara.CanFish, Trait.CanRead(), Chara.CanSee(), Chara.CanSeeLos(), card, Game.cards, Card.category, Card.Cell, Point.cell, Map.charas, Card.ChildrenAndSelfWeight, 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(), 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.ForeachNeighbor(), EClass.game, AI_Clean.GetCleanPoint(), Card.GetCurrency(), Chara.GetDestination(), AI_Fish.GetFishingPoint(), BaseCard.GetInt(), FactionBranch.GetMeal(), Point.GetNearestPoint(), Stats.GetPhase(), BaseArea.GetRandomPoint(), Date.GetRaw(), CardRenderer.GetTC(), CardManager.globalCharas, LangGame.Has(), Chara.HasAccess(), Point.HasChara, Chara.HasCondition(), Card.HasEditorTag(), Party.HasElement(), Card.HasElement(), Cell.HasFire, 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, 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, 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, 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.