11 public override bool IsIdle
15 return !base.IsChildRunning;
21 public override bool InformCancel
31 public override int MaxRestart
35 return this.maxRepeat;
40 public override void OnStart()
42 this.owner.SetTempHand(-1, -1);
43 this.owner.ShowEmo(Emo.none, 0f,
true);
47 public unsafe
override IEnumerable<
AIAct.Status> Run()
51 if (this.owner.held !=
null)
53 this.owner.PickHeld(
false);
55 if (this.owner.nextUse !=
null)
57 Thing nextUse = this.owner.nextUse;
58 this.owner.nextUse =
null;
59 if (nextUse.parent ==
this.owner && !nextUse.isDestroyed)
61 this.owner.TryUse(nextUse);
63 yield
return base.KeepRunning();
65 if (
EClass.rnd(100) == 0 &&
this.owner.hunger.GetPhase() >= 3)
67 Thing thing = this.owner.things.Find((
Thing a) => this.owner.CanEat(a,
this.owner.IsPCFaction),
false);
68 if (thing ==
null && this.owner.IsPCFaction)
70 thing = this.owner.things.Find((
Thing a) => this.owner.CanEat(a,
false),
false);
72 if (thing ==
null && this.owner.IsPCFaction &&
EClass._zone.IsPCFaction)
74 thing =
EClass._zone.branch.GetMeal(this.owner);
77 this.owner.Pick(thing,
true,
true);
80 if (thing ==
null && !this.owner.IsPCParty)
82 if (!this.owner.IsPCFaction &&
EClass.rnd(8) != 0)
84 this.owner.hunger.Mod(-30);
89 thing.isNPCProperty =
true;
90 if ((thing.ChildrenAndSelfWeight < 5000 || !
this.owner.IsPCParty) && thing.trait.CanEat(
this.owner))
92 thing = this.owner.AddThing(thing,
true, -1, -1);
98 yield
return base.Do(
new AI_Eat
104 if (
EClass.rnd(3) == 0 &&
this.owner.mana.value > 0)
107 Act actRevive =
null;
108 foreach (
ActList.
Item item in
this.owner.ability.list.items)
115 string[] abilityType = act2.source.abilityType;
116 if (!abilityType.IsEmpty() && (abilityType[0] ==
"heal" || abilityType[0] ==
"hot"))
124 if (!this.owner.IsPCParty)
126 (list =
new List<Chara>()).Add(this.owner);
130 list =
EClass.pc.party.members;
132 List<Chara> list2 = list;
133 foreach (
Chara chara
in list2)
135 if ((
float)chara.hp <= (
float)chara.MaxHP * 0.75f &&
this.owner.CanSeeLos(chara, -1,
false) && (!(act.source.abilityType[0] ==
"hot") || !chara.HasCondition<
ConHOT>()))
137 this.owner.UseAbility(act, chara,
null,
false);
138 yield
return base.KeepRunning();
142 List<Chara>.Enumerator enumerator2 =
default(List<Chara>.Enumerator);
144 if (actRevive !=
null)
146 if ((from a in
EClass.game.cards.globalCharas
147 where a.Value.isDead && a.Value.faction ==
EClass.pc.faction && !a.Value.isSummon && a.Value.GetInt(103,
null) != 0
148 select a).ToList<KeyValuePair<int, Chara>>().Count > 0 &&
this.owner.UseAbility(actRevive.source.alias,
this.owner,
null,
false))
150 yield
return base.KeepRunning();
155 if (this.owner.IsPCFaction &&
EClass._zone.IsPCFaction)
157 this.owner.sharedCheckTurn--;
158 if (this.owner.sharedCheckTurn < 0 &&
EClass.rnd(
EClass.debug.enable ? 2 : 20) == 0)
160 this.owner.TryTakeSharedItems(
true);
161 this.owner.TryPutSharedItems(
true);
162 this.owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
167 Thing thing2 = this.owner.things.Find(
"polish_powder", -1, -1);
170 foreach (
Thing thing3
in this.owner.things)
172 if (thing3.IsEquipment && thing3.encLV < 0)
175 while (num < 5 && thing3.encLV < 0)
177 this.owner.Say(
"polish", this.owner, thing3,
null,
null);
179 thing2.ModNum(-1,
true);
180 if (thing2.isDestroyed)
186 if (thing2.isDestroyed)
194 if (this.owner.IsPCParty)
196 if (this.owner.IsRestrainedResident &&
this.owner.stamina.value >
this.owner.stamina.max / 2)
202 yield
return base.Restart();
204 if (
EClass.rnd(100) == 0 && !
EClass._zone.IsRegion &&
this.owner.HasElement(1227, 1))
206 List<Chara> list3 =
new List<Chara>();
209 if (chara2.Evalue(1227) > 0)
216 list3.Remove(this.owner);
217 this.owner.SetEnemy(list3.RandomItem<
Chara>());
218 yield
return base.Success(
null);
221 if (
EClass.rnd(150) == 0 &&
this.owner.host !=
null &&
this.owner.host.parasite ==
this.owner &&
this.owner.GetInt(108,
null) == 1)
223 this.owner.host.PlaySound(
"whip", 1f,
true);
224 this.owner.host.Say(
"use_whip3", this.owner, this.owner.host,
null,
null);
225 this.owner.Talk(
"insult",
null,
null,
false);
226 this.owner.host.PlayAnime(AnimeID.Shiver,
false);
227 this.owner.host.DamageHP(5 +
EClass.rndHalf(
this.owner.host.MaxHP / 5), 919, 100, AttackSource.Condition,
null,
true);
228 this.owner.host.OnInsulted();
229 yield
return base.KeepRunning();
233 this.owner.TryTakeSharedItems(
EClass.pc.things.List((
Thing t) => t.IsSharedContainer,
false),
true,
false);
235 if (this.owner.isSynced &&
EClass.rnd((
this.owner.host ==
null) ? 200 : 150) == 0 &&
this.owner.GetInt(106,
null) == 0)
237 if (
EClass.rnd(2) == 0 &&
this.owner.GetInt(108,
null) == 1)
239 this.owner.Talk(
"insult",
null,
null,
false);
243 this.owner.TalkTopic(
"calm");
248 this.owner.ClearInventory(ClearInventoryType.Party);
250 if ((
EClass.rnd(20) == 0 ||
EClass.debug.enable) &&
this.owner.GetCurrency(
"money") >= 500)
252 bool flag =
EClass._zone.IsTown;
253 if (
EClass._zone.IsPCFaction)
255 foreach (
Chara chara3
in EClass._zone.branch.members)
266 foreach (
Element element
in this.owner.elements.dict.Values)
268 if (!(element.source.category !=
"skill") && element.vTempPotential < 900)
276 int num2 = this.owner.GetCurrency(
"money");
281 this.owner.PlaySound(
"pay", 1f,
true);
282 int num3 = num2 / 200;
283 foreach (
Element element2
in this.owner.elements.dict.Values)
285 if (!(element2.source.category !=
"skill"))
287 int num4 = num3 * 100 / (100 + (100 + element2.vTempPotential / 2 + element2.ValueWithoutLink) * (100 + element2.vTempPotential / 2 + element2.ValueWithoutLink) / 100);
288 num4 += 1 +
EClass.rnd(3);
289 this.owner.elements.ModTempPotential(element2.id, Mathf.Max(1, num4), 9999);
292 Msg.Say(
"party_train", this.owner, Lang._currency(num2,
false, 14),
null,
null);
293 this.owner.PlaySound(
"ding_potential", 1f,
true);
294 this.owner.ModCurrency(-num2,
"money");
299 if (this.owner.c_uidMaster != 0)
301 Chara chara4 = this.owner.master;
302 if (chara4 ==
null || !chara4.IsAliveInCurrentZone)
304 chara4 = this.owner.FindMaster();
306 if (chara4 !=
null && chara4.IsAliveInCurrentZone)
308 if (this.owner.enemy ==
null)
310 this.owner.SetEnemy(chara4.enemy);
312 int num5 = this.owner.Dist(chara4.pos);
313 if (this.owner.source.aiIdle !=
"root" && num5 >
EClass.game.config.tactics.AllyDistance(
this.owner) &&
EClass._zone.PetFollow &&
this.owner.c_minionType == MinionType.Default)
315 this.owner.TryMoveTowards(chara4.pos);
316 yield
return base.KeepRunning();
321 Party party = this.owner.party;
322 if (party ==
null || party.leader ==
this.owner || !party.leader.IsAliveInCurrentZone ||
this.owner.host !=
null || !
EClass._zone.PetFollow)
326 if (this.owner.source.aiIdle ==
"root")
328 yield
return base.KeepRunning();
330 else if (this.owner.Dist(party.leader.pos) <=
EClass.game.config.tactics.AllyDistance(
this.owner))
332 yield
return base.KeepRunning();
336 if (this.owner.TryMoveTowards(party.leader.pos) ==
Card.MoveResult.Fail &&
this.owner.Dist(party.leader) > 4)
338 this.moveFailCount++;
340 if (this.moveFailCount >= (flag3 ? 100 : 10))
342 this.owner.Teleport(party.leader.pos.GetNearestPoint(
false,
false,
true,
true),
false,
true);
343 this.moveFailCount = 0;
348 this.moveFailCount = 0;
350 yield
return base.KeepRunning();
353 if (((this.owner.homeBranch !=
null &&
this.owner.homeBranch ==
EClass.Branch &&
EClass.rnd(100) == 0) || (
this.owner.IsGuest() &&
EClass.rnd(50) == 0)) &&
this.owner.FindBed() ==
null)
355 this.owner.TryAssignBed();
357 if (this.owner.isSynced && !
this.owner.IsPCParty)
359 if (this.owner.IsPCFaction &&
this.owner.GetInt(32,
null) + 4320 <
EClass.world.date.GetRaw(0))
361 if (this.owner.GetInt(32,
null) != 0 &&
Zone.okaerinko < 10)
363 this.owner.Talk(
"welcomeBack",
null,
null,
false);
366 this.owner.SetInt(32,
EClass.world.date.GetRaw(0));
368 else if (
EClass.player.stats.turns >
this.owner.turnLastSeen + 50 &&
Los.IsVisible(
EClass.pc,
this.owner) &&
this.owner.CanSee(
EClass.pc))
370 if (
EClass._zone.IsTown &&
EClass.rnd(15) == 0 &&
this.owner.hostility >= Hostility.Neutral && !
this.owner.IsPCFaction && !
EClass.pc.HasCondition<
ConIncognito>())
373 string text = (EClass.player.karma <= 10) ? (flag4 ?
"rumor_good" :
"rumor_bad") : ((EClass.player.karma >= 90) ? (flag4 ?
"rumor_bad" :
"rumor_good") :
"");
376 this.owner.Talk(text,
null,
null,
false);
378 if ((flag4 ? (
EClass.player.karma >= 90) : (
EClass.player.karma <= 10)) &&
EClass.rnd(10) == 0)
381 AI_PlayMusic.ignoreDamage =
true;
382 ActThrow.Throw(this.owner,
EClass.pc.pos, t3, ThrowMethod.Punish, 0f);
383 AI_PlayMusic.ignoreDamage =
false;
388 this.owner.TalkTopic(
"fov");
390 this.owner.turnLastSeen =
EClass.player.stats.turns;
393 if (
EClass.rnd(25) == 0 &&
this.owner.IsInMutterDistance(10))
395 if (this.owner.isRestrained)
397 this.owner.PlayAnime(AnimeID.Shiver,
false);
400 if (tc ==
null || tc.pop.items.Count == 0)
402 if (this.owner.noMove)
404 foreach (
Thing thing4
in this.owner.pos.Things)
408 this.owner.Talk(
"labor",
null,
null,
false);
409 this.owner.PlayAnime(AnimeID.Shiver,
false);
410 yield
return base.Restart();
413 List<Thing>.Enumerator enumerator6 =
default(List<Thing>.Enumerator);
415 if (this.owner.isDrunk && (
this.owner.race.id ==
"cat" ||
this.owner.id ==
"sailor"))
417 this.owner.Talk(
"drunk_cat",
null,
null,
false);
419 else if (this.owner.isRestrained)
421 this.owner.Talk(
"restrained",
null,
null,
false);
423 else if (this.owner.GetInt(106,
null) == 0 && !
this.owner.IsPCParty)
425 if (this.owner.HasElement(1232, 1) &&
EClass.rnd(4) == 0)
427 this.owner.Talk(
"baby",
null,
null,
false);
429 else if (
EClass.rnd((
this.owner.host ==
null) ? 2 : 10) == 0 &&
this.owner.isSynced &&
this.owner.TalkTopic(
"calm").IsEmpty())
431 this.owner.Talk(
"idle",
null,
null,
false);
436 if (
EClass.rnd(8) == 0 &&
this.owner.race.id ==
"chicken")
438 this.owner.PlaySound(
"Animal/Chicken/chicken", 1f,
true);
440 if (
EClass.rnd(80) == 0 &&
this.owner.race.id ==
"cat")
442 this.owner.PlaySound(
"Animal/Cat/cat", 1f,
true);
444 if (this.owner.trait.IdAmbience !=
null &&
this.owner.IsInMutterDistance(15))
447 Room room = this.owner.Cell.room;
449 if (room != room2 && room2 !=
null)
451 if (((room !=
null) ? room.lot :
null) == ((room2 !=
null) ? room2.lot :
null))
460 EClass.Sound.PlayAmbience(this.owner.trait.IdAmbience, *
this.owner.pos.Position(), mtp);
462 if (
EClass.rnd(2000) == 0 &&
this.owner.IsHuman && (
this.owner.host ==
null ||
this.owner.host.ride !=
this.owner))
464 Thing thing5 = this.owner.things.Find((
Thing a) => !a.IsNegativeGift && a.trait.CanDrink(
this.owner),
false);
465 if (thing5 !=
null && thing5.trait is
TraitPotion &&
this.owner.IsPCParty)
469 if (thing5 ==
null && (this.owner.homeBranch ==
null || !
this.owner.homeBranch.policies.IsActive(2503, -1)))
471 thing5 =
ThingGen.Create(
"crimAle", -1, -1);
472 this.owner.Drink(thing5);
474 if (thing5 !=
null && !thing5.isDestroyed)
476 this.owner.TryUse(thing5);
477 yield
return base.Restart();
480 if (
EClass.rnd(
this.owner.IsPCParty ? 1000 : 200) == 0 &&
this.owner.isDrunk && (
this.owner.isSynced ||
EClass.rnd(5) == 0))
482 this.DoSomethingToCharaInRadius(3,
null, delegate(
Chara c)
484 this.owner.Say(
"drunk_mess", this.owner, c,
null,
null);
485 this.owner.Talk(
"drunk_mess",
null,
null,
false);
486 bool flag5 =
EClass.rnd(5) == 0 && !c.IsPC;
487 if (c.IsPCParty &&
this.owner.hostility >= Hostility.Friend)
493 this.owner.Say(
"drunk_counter", c, this.owner,
null,
null);
494 c.Talk(
"drunk_counter",
null,
null,
false);
495 c.DoHostileAction(this.owner,
false);
499 if (
EClass.rnd(100) == 0 &&
this.owner.trait.CanFish)
501 Point fishingPoint =
AI_Fish.GetFishingPoint(this.owner.pos);
502 if (fishingPoint.IsValid)
504 yield
return base.Do(
new AI_Fish
510 string idAct = this.owner.source.actIdle.RandomItem<
string>();
511 if (
EClass.rnd(
EClass.world.date.IsNight ? 1500 : 15000) == 0 && !
this.owner.IsPCFaction && !
this.owner.noMove)
515 if (
EClass.rnd(40) == 0 &&
this.owner.IsHuman)
517 this.DoSomethingToNearChara((
Chara c) => (!c.IsPCParty ||
EClass.rnd(5) == 0) && c.IsMofuable && !
this.owner.IsHostile(c) && !c.IsInCombat, delegate(
Chara c)
519 this.owner.Cuddle(c,
false);
524 Chara chara5 = this.DoSomethingToNearChara((
Chara c) => c.IsIdle && !c.IsPCParty && !(c.trait is
TraitBitch),
null);
527 yield
return base.Do(
new AI_Fuck
538 if (
EClass.rnd(4) == 0 &&
this.TryPerformIdleUse())
540 yield
return base.Restart();
542 if (
EClass.rnd(20) == 0 &&
this.owner.trait.IdleAct())
544 yield
return base.Restart();
546 if (idAct ==
"janitor" &&
EClass.rnd(5) == 0)
548 this.DoSomethingToCharaInRadius(4,
null, delegate(
Chara c)
552 this.owner.Talk(
"snail",
null,
null,
false);
554 ActThrow.Throw(this.owner, c.pos, t4, ThrowMethod.Default, 0f);
557 yield
return base.Restart();
559 if (this.owner.IsRestrainedResident &&
this.owner.stamina.value >
this.owner.stamina.max / 2)
565 yield
return base.Restart();
567 if (!this.owner.IsPCFactionOrMinion &&
EClass.rnd(
this.owner.isSynced ? 50 : 2000) == 0 &&
this.owner.hostility == Hostility.Neutral &&
EClass.pc.party.HasElement(1563) && !
this.owner.race.tag.Contains(
"animal") &&
EClass._zone.IsTown && !
EClass._zone.IsPCFaction)
569 EClass.pc.DoHostileAction(this.owner,
false);
573 Point cleanPoint =
AI_Clean.GetCleanPoint(this.owner, 4, 10);
574 if (cleanPoint !=
null)
582 if (
EClass.rnd(35) == 0 &&
this.owner.id ==
"child" &&
this.owner.pos.cell.IsSnowTile)
586 if (
EClass.rnd(3) != 0 && chara6 !=
this.owner && chara6.pos.cell.IsSnowTile && chara6.Dist(
this.owner) <= 6 &&
Los.IsVisible(chara6,
this.owner))
589 ActThrow.Throw(this.owner, chara6.pos, t2, ThrowMethod.Default, 0f);
599 this.owner.pos.ForeachNeighbor(delegate(
Point p)
602 Card card = (traitBall !=
null) ? traitBall.owner :
null;
605 this.owner.Pick(card.Thing,
true,
true);
613 if (
EClass.rnd(3) != 0 && chara7 !=
this.owner && chara7.Dist(
this.owner) <= 6 && chara7.Dist(
this.owner) >= 3 &&
Los.IsVisible(chara7,
this.owner))
615 ActThrow.Throw(this.owner, chara7.pos, thing6, ThrowMethod.Default, 0f);
623 yield
return base.Restart();
625 if (
EClass.rnd(20) == 0 &&
this.owner.IsPCFaction &&
AI_Shopping.TryRestock(
this.owner,
true))
627 yield
return base.Restart();
629 this.owner.idleActTimer--;
631 if (this.owner.idleActTimer <= 0 && !
this.owner.source.actIdle.IsEmpty())
633 this.owner.idleActTimer = 10 +
EClass.rnd(50);
635 if (!(a2 ==
"torture_snail"))
637 if (!(a2 ==
"buffMage"))
639 if (!(a2 ==
"buffThief"))
641 if (!(a2 ==
"buffGuildWatch"))
643 if (!(a2 ==
"buffHealer"))
645 if (!(a2 ==
"readBook"))
647 if (LangGame.Has(
"idle_" + idAct))
649 this.IdleActText(idAct);
652 else if (
EClass.rnd(2) != 0 && (!
this.owner.IsPCParty ||
EClass.rnd(20) == 0))
654 List<Thing> list4 = this.owner.things.List((
Thing a) => a.parent ==
this.owner && (a.category.id ==
"spellbook" || a.category.id ==
"ancientbook"),
false);
658 thing7 = list4.RandomItem<
Thing>();
659 if (!thing7.trait.CanRead(
this.owner))
666 thing7 =
ThingGen.CreateFromCategory((
EClass.rnd(5) != 0) ?
"spellbook" :
"ancientbook", -1);
667 thing7.isNPCProperty =
true;
669 if (!(thing7.id ==
"1084") || !
this.owner.IsPCFaction)
671 if (!this.owner.HasElement(285, 1))
673 this.owner.elements.ModBase(285, 1);
675 yield
return base.Do(
new AI_Read
684 this.TryCast(EffectId.Heal, 100);
689 this.TryCast<ConGravity>(EffectId.Gravity, 300 +
EClass.rnd(300));
694 this.TryCast<ConNightVision>(EffectId.CatsEye, 100 +
EClass.rnd(100));
697 else if (
EClass.rnd(2) == 0)
699 this.TryCast<ConHolyVeil>(EffectId.HolyVeil, 300 +
EClass.rnd(300));
703 this.TryCast<ConLevitate>(EffectId.Levitate, 300 +
EClass.rnd(300));
708 this.DoSomethingToNearChara((
Chara c) => c.race.id ==
"snail", delegate(
Chara c)
710 this.owner.Say(
"use_whip3", this.owner, c,
null,
null);
711 this.owner.PlaySound(
"whip", 1f,
true);
712 this.owner.Talk(
"insult",
null,
null,
false);
713 c.PlayAnime(AnimeID.Shiver,
false);
717 yield
return base.Restart();
719 if (this.owner.host !=
null)
721 yield
return base.Restart();
723 if (this.owner.HasEditorTag(EditorTag.AINoMove) ||
this.owner.trait.IdleBehaviour ==
AI_Idle.Behaviour.NoMove ||
this.owner.noMove)
725 if (this.owner.orgPos !=
null && !
this.owner.pos.Equals(
this.owner.orgPos) && !
this.owner.orgPos.IsBlocked && !
this.owner.orgPos.HasChara)
727 yield
return base.DoGoto(this.owner.orgPos, 0,
false,
null);
729 yield
return base.Restart();
731 if (this.owner.HasEditorTag(EditorTag.AIFollow) &&
this.owner.pos.Distance(
EClass.pc.GetDestination()) > 1)
733 yield
return base.DoGoto(
EClass.pc,
null);
735 if (
EClass.rnd(100) == 0 && !
this.owner.IsPCFaction)
737 if (this.owner.id ==
"ashland" ||
this.owner.id ==
"fiama")
739 Trait trait =
EClass._map.Installed.traits.restSpots.RandomItem<int,
Trait>();
742 yield
return base.DoGotoSpot(trait.owner,
null);
746 Room room3 = this.owner.FindRoom();
749 yield
return base.DoGoto(room3.GetRandomPoint(
true,
true).GetNearestPoint(
false,
true,
true,
false), 0,
false,
null);
753 else if (this.owner.orgPos !=
null && !
this.owner.pos.Equals(
this.owner.orgPos) && !
this.owner.orgPos.IsBlocked && !
this.owner.orgPos.HasChara)
755 yield
return base.DoGoto(this.owner.orgPos, 0,
false,
null);
758 if (
EClass.rnd(100) == 0 &&
this.owner.id ==
"bee")
761 Thing thing8 = (list5 !=
null) ? list5.RandomItem<
Thing>() :
null;
764 yield
return base.DoGoto(thing8.pos, 0,
false,
null);
767 a2 = this.owner.source.aiIdle;
768 if (!(a2 ==
"stand") && !(a2 ==
"root"))
772 this.owner.MoveRandom();
774 if (this.owner ==
null)
776 yield
return this.Cancel();
779 if (
EClass._zone.IsPCFaction &&
this.owner.IsPCFaction && !
this.owner.IsPCParty && (
this.owner.GetWork(
"Clean") !=
null ||
this.owner.GetWork(
"Chore") !=
null) && !(
EClass.pc.ai is
AI_UseCrafter))
784 yield
return base.Do(ai_Haul,
null);
787 yield
return base.Restart();
793 public void IdleActText(
string id)
795 string text =
"idle_" + id;
796 this.owner.PlaySound(text, 1f,
true);
797 if (Lang.Game.map.ContainsKey(text))
799 this.owner.Say(text, this.owner,
null,
null);
804 public void TryCast<T>(EffectId
id,
int power = 100) where T :
Condition
806 if (!this.owner.HasCondition<T>())
808 this.TryCast(
id, power);
813 public void TryCast(EffectId
id,
int power = 100)
815 this.owner.Say(
"idle_cast", this.owner,
null,
null);
816 ActEffect.Proc(
id, power, BlessedState.Normal,
this.owner,
null,
default(
ActRef));
820 public BaseArea GetRandomAssignedRoom()
825 if (baseArea.type !=
null && baseArea.type.uidCharas.Contains(
this.owner.uid))
827 AI_Idle._listRoom.Add(baseArea);
834 public Chara DoSomethingToNearChara(Func<Chara, bool> funcPickChara, Action<Chara> action =
null)
836 List<Chara> list = this.owner.pos.ListCharasInNeighbor((
Chara c) => c != this.owner && this.owner.CanSee(c) && (funcPickChara ==
null || funcPickChara(c)));
850 public Chara DoSomethingToCharaInRadius(
int radius, Func<Chara, bool> funcPickChara, Action<Chara> action =
null)
852 List<Chara> list = this.owner.pos.ListCharasInRadius(this.owner, radius, (
Chara c) => c != this.owner && this.owner.CanSee(c) && (funcPickChara ==
null || funcPickChara(c)));
866 public bool TryPerformIdleUse()
868 for (
int i = 0; i < 10; i++)
870 Point randomPoint = this.owner.pos.GetRandomPoint(7,
true,
true,
true, 100);
871 if (randomPoint !=
null && randomPoint.detail !=
null)
873 foreach (
Thing thing
in randomPoint.detail.things)
875 if (thing.IsInstalled)
877 int num = this.owner.Dist(thing);
878 if (
EClass.rnd((
this.owner.memberType == FactionMemberType.Guest) ? 5 : 50) == 0 && thing.HasTag(CTAG.tourism) && num <= 2)
880 this.owner.LookAt(thing);
881 this.owner.Talk(
"nice_statue",
null,
null,
false);
884 if (
EClass.rnd(thing.trait.IdleUseChance) == 0 && thing.trait.IdleUse(
this.owner, num))
886 this.owner.LookAt(thing);
897 public int maxRepeat = 10;
900 public int moveFailCount;
903 private static List<BaseArea> _listRoom =
new List<BaseArea>();
906 public enum Behaviour