Elin Decompiled Documentation EA 23.236 Nightly Patch 1
Loading...
Searching...
No Matches
AI_Idle.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6public class AI_Idle : AIAct
7{
8 public enum Behaviour
9 {
10 Default,
11 NoMove
12 }
13
14 public int maxRepeat = 10;
15
16 public int moveFailCount;
17
18 private static List<BaseArea> _listRoom = new List<BaseArea>();
19
20 public override bool IsIdle => !base.IsChildRunning;
21
22 public override bool InformCancel => false;
23
24 public override int MaxRestart => maxRepeat;
25
26 public override void OnStart()
27 {
28 owner.SetTempHand(-1, -1);
29 owner.ShowEmo();
30 }
31
32 public override IEnumerable<Status> Run()
33 {
34 while (true)
35 {
36 if (owner.held != null)
37 {
39 }
40 if (owner.nextUse != null)
41 {
42 Thing nextUse = owner.nextUse;
43 owner.nextUse = null;
44 if (nextUse.parent == owner && !nextUse.isDestroyed)
45 {
46 owner.TryUse(nextUse);
47 }
48 yield return KeepRunning();
49 }
51 {
52 if (EClass.rnd(5) == 0)
53 {
54 owner.Talk("onFire");
55 }
57 {
58 yield return Restart();
59 }
60 }
61 if (EClass.rnd(owner.IsPCParty ? 10 : 100) == 0 && owner.hunger.GetPhase() >= 3)
62 {
63 Thing thing = (owner.IsPCFaction ? owner.FindBestFoodToEat() : owner.things.Find((Thing a) => owner.CanEat(a, owner.IsPCFaction) && !a.c_isImportant, recursive: false));
64 if (thing == null && owner.IsPCFaction && EClass._zone.IsPCFaction)
65 {
67 if (thing != null)
68 {
69 owner.Pick(thing);
70 }
71 }
72 if (thing == null && !owner.IsPCParty)
73 {
74 if (!owner.IsPCFaction && EClass.rnd(8) != 0)
75 {
76 owner.hunger.Mod(-30);
77 }
78 else if (!owner.things.IsFull())
79 {
80 thing = ThingGen.CreateFromCategory("food", EClass.rnd(EClass.rnd(60) + 1) + 10);
81 if (thing.trait.CanEat(owner))
82 {
83 thing.isNPCProperty = true;
84 thing = owner.AddThing(thing);
85 }
86 else
87 {
88 thing = null;
89 }
90 }
91 }
92 if (thing != null)
93 {
95 {
96 owner.InstantEat(thing, sound: false);
97 yield return Restart();
98 }
99 else if (thing.Num == 1 || !owner.things.IsFull())
100 {
101 yield return Do(new AI_Eat
102 {
103 target = thing
104 });
105 }
106 }
107 }
108 if (!EClass._zone.IsRegion)
109 {
110 if (EClass.rnd(10) == 0 && owner.ability.Has(6627) && ((float)owner.hp < (float)owner.MaxHP * 0.8f || EClass.rnd(10) == 0) && owner.GetNearbyCatToSniff() != null && !owner.HasCondition<ConHOT>())
111 {
113 yield return KeepRunning();
114 }
115 if (EClass.rnd(3) == 0 && owner.mana.value > 0)
116 {
117 Act act = null;
118 Act actRevive = null;
119 foreach (ActList.Item item in owner.ability.list.items)
120 {
121 Act act2 = item.act;
122 if (act2.id == 8430)
123 {
124 actRevive = act2;
125 }
126 string[] abilityType = act2.source.abilityType;
127 if (!abilityType.IsEmpty() && (abilityType[0] == "heal" || abilityType[0] == "hot"))
128 {
129 act = item.act;
130 }
131 }
132 if (act != null)
133 {
134 List<Chara> list = (owner.IsPCParty ? EClass.pc.party.members : new List<Chara> { owner });
135 foreach (Chara item2 in list)
136 {
137 if (!((float)item2.hp > (float)item2.MaxHP * 0.75f) && owner.CanSeeLos(item2) && (!(act.source.abilityType[0] == "hot") || !item2.HasCondition<ConHOT>()))
138 {
139 owner.UseAbility(act, item2);
140 yield return KeepRunning();
141 break;
142 }
143 }
144 }
145 if (actRevive != null && owner.IsPCFaction && EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon && a.Value.c_wasInPcParty).ToList().Count > 0 && owner.UseAbility(actRevive.source.alias, owner))
146 {
147 yield return KeepRunning();
148 }
149 }
150 }
152 {
154 if (owner.sharedCheckTurn < 0 && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
155 {
158 owner.sharedCheckTurn += (EClass.debug.enable ? 20 : 200);
159 }
160 }
161 if ((EClass._zone is Zone_Civilized || EClass._zone.IsPCFaction) && (owner.IsPCParty ? 10 : (owner.IsPCFaction ? 2 : 0)) > EClass.rnd(100))
162 {
163 Thing thing2 = owner.things.Find("polish_powder");
164 if (thing2 != null && EClass._map.props.installed.Find<TraitGrindstone>() != null)
165 {
166 foreach (Thing thing9 in owner.things)
167 {
168 if (!thing9.IsEquipment || thing9.encLV >= 0)
169 {
170 continue;
171 }
172 for (int j = 0; j < 5; j++)
173 {
174 if (thing9.encLV >= 0)
175 {
176 break;
177 }
178 owner.Say("polish", owner, thing9);
179 thing9.ModEncLv(1);
180 thing2.ModNum(-1);
181 if (thing2.isDestroyed)
182 {
183 break;
184 }
185 }
186 if (thing2.isDestroyed)
187 {
188 break;
189 }
190 }
191 }
192 }
193 if (owner.IsPCParty)
194 {
196 {
197 TraitShackle traitShackle = owner.pos.FindThing<TraitShackle>();
198 if (traitShackle != null && traitShackle.AllowTraining)
199 {
201 {
202 shackle = traitShackle
203 });
204 }
205 yield return Restart();
206 }
207 if (EClass.rnd(20) == 0)
208 {
209 Thing thing3 = owner.things.Find((Thing a) => a.parent == owner && a.isGifted && (a.category.id == "skillbook" || a.category.id == "ancientbook"));
210 if (thing3 != null && thing3.trait.CanRead(owner) && (thing3.Num == 1 || !owner.things.IsFull()))
211 {
212 yield return Do(new AI_Read
213 {
214 target = thing3
215 });
216 }
217 }
218 if (EClass.rnd(100) == 0 && !EClass._zone.IsRegion && owner.HasElement(1227))
219 {
220 List<Chara> list2 = new List<Chara>();
221 foreach (Chara member in EClass.pc.party.members)
222 {
223 if (member.Evalue(1227) > 0)
224 {
225 list2.Add(member);
226 }
227 }
228 if (list2.Count > 2 + EClass.pc.party.EvalueTotal(1272, (Chara c) => c.IsPC || c.faith == EClass.game.religions.Harmony))
229 {
230 list2.Remove(owner);
231 owner.SetEnemy(list2.RandomItem());
232 yield return Success();
233 }
234 }
235 if (EClass.rnd(150) == 0 && owner.host != null && owner.host.parasite == owner && owner.GetInt(108) == 1)
236 {
237 owner.host.PlaySound("whip");
238 owner.host.Say("use_whip3", owner, owner.host);
239 owner.Talk("insult");
240 owner.host.PlayAnime(AnimeID.Shiver);
241 owner.host.DamageHP(5 + EClass.rndHalf(owner.host.MaxHP / 5), 919, 100, AttackSource.Condition);
243 yield return KeepRunning();
244 }
245 if (EClass.rnd(EClass.debug.enable ? 2 : 20) == 0 && owner.CanSee(EClass.pc) && !(EClass.pc.ai is AI_Eat))
246 {
248 }
249 if (owner.isSynced && EClass.rnd((owner.host == null) ? 200 : 150) == 0 && owner.GetInt(106) == 0)
250 {
251 if (EClass.rnd(2) == 0 && owner.GetInt(108) == 1)
252 {
253 owner.Talk("insult");
254 }
255 else
256 {
258 }
259 }
260 if (EClass.rnd(100) == 0 && EClass._zone.IsTown)
261 {
263 }
264 if ((EClass.rnd(20) == 0 || EClass.debug.enable) && owner.GetCurrency() >= 500)
265 {
266 bool flag = EClass._zone.IsTown;
268 {
269 foreach (Chara member2 in EClass._zone.branch.members)
270 {
271 if (member2.ExistsOnMap && member2.trait is TraitTrainer)
272 {
273 flag = true;
274 }
275 }
276 }
277 if (flag)
278 {
279 bool flag2 = false;
280 foreach (Element value in owner.elements.dict.Values)
281 {
282 if (!(value.source.category != "skill") && value.vTempPotential < 900)
283 {
284 flag2 = true;
285 break;
286 }
287 }
288 if (flag2)
289 {
290 int num = owner.GetCurrency();
291 if (num >= 20000)
292 {
293 num = 20000;
294 }
295 owner.PlaySound("pay");
296 int num2 = num / 200;
297 foreach (Element value2 in owner.elements.dict.Values)
298 {
299 if (!(value2.source.category != "skill"))
300 {
301 int num3 = num2 * 100 / (100 + (100 + value2.vTempPotential / 2 + value2.ValueWithoutLink) * (100 + value2.vTempPotential / 2 + value2.ValueWithoutLink) / 100);
302 num3 += 1 + EClass.rnd(3);
303 owner.elements.ModTempPotential(value2.id, Mathf.Max(1, num3), 9999);
304 }
305 }
306 Msg.Say("party_train", owner, Lang._currency(num));
307 owner.PlaySound("ding_potential");
308 owner.ModCurrency(-num);
309 }
310 }
311 }
312 if (EClass.rnd(100) == 0 && EClass.pc.ai is AI_Fish && owner.stamina.value > 0 && owner.things.Find<TraitToolFishing>() != null)
313 {
314 Point randomPointInRadius = EClass.pc.pos.GetRandomPointInRadius(0, 3);
315 if (randomPointInRadius != null)
316 {
317 randomPointInRadius = AI_Fish.GetFishingPoint(randomPointInRadius);
318 if (randomPointInRadius.IsValid)
319 {
320 yield return Do(new AI_Fish
321 {
322 pos = randomPointInRadius
323 });
324 }
325 }
326 }
327 }
328 if (owner.c_uidMaster != 0)
329 {
330 Chara chara = owner.master;
331 if (chara == null || !chara.IsAliveInCurrentZone)
332 {
333 chara = owner.FindMaster();
334 }
335 if (chara != null && chara.IsAliveInCurrentZone)
336 {
337 if (owner.enemy == null)
338 {
339 owner.SetEnemy(chara.enemy);
340 }
341 int num4 = owner.Dist(chara.pos);
342 if (owner.source.aiIdle != "root" && num4 > EClass.game.config.tactics.AllyDistance(owner) && EClass._zone.PetFollow && owner.c_minionType == MinionType.Default)
343 {
344 if (owner.HasAccess(chara.pos))
345 {
346 owner.TryMoveTowards(chara.pos);
347 }
348 yield return KeepRunning();
349 continue;
350 }
351 }
352 }
353 Party party = owner.party;
354 if (party == null || party.leader == owner || !party.leader.IsAliveInCurrentZone || owner.host != null || !EClass._zone.PetFollow)
355 {
356 break;
357 }
358 if (owner.source.aiIdle == "root")
359 {
360 yield return KeepRunning();
361 continue;
362 }
364 {
365 yield return KeepRunning();
366 continue;
367 }
368 if (owner.HasAccess(party.leader.pos) && owner.TryMoveTowards(party.leader.pos) == Card.MoveResult.Fail && owner.Dist(party.leader) > 4)
369 {
371 bool flag3 = (EClass._zone is Zone_Civilized || EClass._zone.IsPCFaction) && (EClass.pc.enemy == null || !EClass.pc.enemy.IsAliveInCurrentZone);
372 if (moveFailCount >= (flag3 ? 100 : 10))
373 {
374 owner.Teleport(party.leader.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), silent: false, force: true);
375 moveFailCount = 0;
376 }
377 }
378 else
379 {
380 moveFailCount = 0;
381 }
382 yield return KeepRunning();
383 }
384 if (EClass._zone.IsNefia && EClass._zone.Boss == owner && EClass.rnd(20) == 0)
385 {
387 }
388 if (EClass._zone.IsRegion && EClass.rnd(10) != 0)
389 {
390 yield return Restart();
391 }
392 if (((owner.homeBranch != null && owner.homeBranch == EClass.Branch && EClass.rnd(100) == 0) || (owner.IsGuest() && EClass.rnd(50) == 0)) && owner.FindBed() == null)
393 {
395 }
396 string text;
397 if (!EClass._zone.IsRegion)
398 {
399 text = owner.id;
400 if (!(text == "geist"))
401 {
402 if (text == "mech_scarab" && EClass.rnd(20) == 0 && owner.CanDuplicate() && !EClass._zone.IsUserZone)
403 {
404 int i = 0;
405 owner.pos.ForeachNeighbor(delegate(Point p)
406 {
407 if (p.HasChara && p.FirstChara.id == "mech_scarab")
408 {
409 i++;
410 }
411 });
412 if (i < 2)
413 {
414 Point randomPoint = owner.pos.GetRandomPoint(1, requireLos: false, allowChara: false, allowBlocked: false, 20);
415 if (randomPoint != null)
416 {
417 Card c2 = EClass._zone.AddCard(owner.Duplicate(), randomPoint);
418 if (randomPoint.Distance(EClass.pc.pos) < EClass.pc.GetHearingRadius())
419 {
420 Msg.Say("self_dupe", owner, c2);
421 }
422 }
423 }
424 }
425 }
426 else if (EClass.rnd(20) == 0)
427 {
428 Point nearestPoint = EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false);
429 if (nearestPoint != null)
430 {
431 foreach (Chara item3 in nearestPoint.ListCharasInRadius(owner, 6, (Chara _c) => _c != owner && !_c.IsPCFactionOrMinion))
432 {
433 item3.Teleport(nearestPoint.GetNearestPoint(allowBlock: false, allowChara: false) ?? nearestPoint);
434 }
435 if (owner != null)
436 {
438 {
439 EClass.pc.ai.Cancel();
440 }
441 owner.Teleport(nearestPoint);
442 }
443 yield return Success();
444 }
445 }
446 }
447 if (owner.IsMinion && owner.master != null && owner.master.id == "keeper_garden" && !(owner.master.ai is GoalCombat))
448 {
450 yield return Success();
451 }
453 {
454 Room room = owner.pos.cell.room;
455 if (room != null)
456 {
457 Point point = null;
458 if (owner.memberType == FactionMemberType.Guest && room.data.accessType != 0)
459 {
460 point = FindMovePoint(BaseArea.AccessType.Public);
461 }
462 else if (owner.memberType == FactionMemberType.Default && room.data.accessType == BaseArea.AccessType.Private)
463 {
464 point = FindMovePoint(BaseArea.AccessType.Resident) ?? FindMovePoint(BaseArea.AccessType.Public);
465 }
466 if (point != null)
467 {
468 yield return DoGoto(point);
469 }
470 }
471 }
473 {
474 if (owner.IsPCFaction && owner.GetInt(32) + 4320 < EClass.world.date.GetRaw())
475 {
476 if (owner.GetInt(32) != 0 && Zone.okaerinko < 10)
477 {
478 owner.Talk("welcomeBack");
479 Zone.okaerinko++;
480 }
482 }
484 {
485 if (EClass.rnd(5) == 0 && owner.hostility >= Hostility.Neutral && EClass.pc.IsPCC && EClass.pc.pccData.state == PCCState.Undie && !EClass.pc.pos.cell.IsTopWaterAndNoSnow)
486 {
487 owner.Talk("pervert3");
488 }
489 else if (EClass.rnd(15) == 0 && EClass._zone.IsTown && owner.hostility >= Hostility.Neutral && !owner.IsPCFaction && !EClass.pc.HasCondition<ConIncognito>())
490 {
491 bool flag4 = EClass._zone is Zone_Derphy;
492 string text2 = ((EClass.player.karma > 10) ? ((EClass.player.karma < 90) ? "" : (flag4 ? "rumor_bad" : "rumor_good")) : (flag4 ? "rumor_good" : "rumor_bad"));
493 if (!text2.IsEmpty())
494 {
495 owner.Talk(text2);
496 }
497 if ((flag4 ? (EClass.player.karma >= 90) : (EClass.player.karma <= 10)) && EClass.rnd(10) == 0)
498 {
499 Thing t2 = ThingGen.Create("stone");
500 AI_PlayMusic.ignoreDamage = true;
502 AI_PlayMusic.ignoreDamage = false;
503 }
504 }
505 else
506 {
507 owner.TalkTopic("fov");
508 }
509 owner.turnLastSeen = EClass.player.stats.turns;
510 }
511 }
512 if (EClass.rnd(25) == 0 && owner.IsInMutterDistance())
513 {
515 {
516 owner.PlayAnime(AnimeID.Shiver);
517 }
519 if (tC == null || tC.pop.items.Count == 0)
520 {
521 if (owner.noMove)
522 {
523 foreach (Thing thing10 in owner.pos.Things)
524 {
525 if (thing10.IsInstalled && thing10.trait is TraitGeneratorWheel)
526 {
527 owner.Talk("labor");
528 owner.PlayAnime(AnimeID.Shiver);
529 yield return Restart();
530 }
531 }
532 }
533 if (owner.isDrunk && (owner.race.id == "cat" || owner.id == "sailor"))
534 {
535 owner.Talk("drunk_cat");
536 }
537 else if (owner.isRestrained)
538 {
539 owner.Talk("restrained");
540 }
541 else if (owner.GetInt(106) == 0 && !owner.IsPCParty)
542 {
543 if (owner.HasElement(1232) && EClass.rnd(4) == 0)
544 {
545 owner.Talk("baby");
546 }
547 else if (EClass.rnd((owner.host == null) ? 2 : 10) == 0 && owner.isSynced && owner.TalkTopic().IsEmpty())
548 {
549 owner.Talk(owner.pos.IsHotSpring ? "hotspring" : "idle");
550 }
551 }
552 }
553 }
554 if (EClass.rnd(8) == 0 && owner.race.id == "chicken")
555 {
556 owner.PlaySound("Animal/Chicken/chicken");
557 }
558 if (EClass.rnd(80) == 0 && owner.race.id == "cat")
559 {
560 owner.PlaySound("Animal/Cat/cat");
561 }
562 if (owner.trait.IdAmbience != null && owner.IsInMutterDistance(15))
563 {
564 float mtp = 1f;
565 Room room2 = owner.Cell.room;
566 Room room3 = EClass.pc.Cell.room;
567 if (room2 != room3 && room3 != null)
568 {
569 mtp = ((room2?.lot != room3?.lot) ? 0.4f : 0.7f);
570 }
571 EClass.Sound.PlayAmbience(owner.trait.IdAmbience, owner.pos.Position(), mtp);
572 }
573 if (EClass.rnd(2000) == 0 && owner.IsHuman && (owner.host == null || owner.host.ride != owner))
574 {
575 Thing thing4 = owner.things.Find((Thing a) => !a.IsNegativeGift && a.trait.CanDrink(owner), recursive: false);
576 if (thing4 != null && thing4.trait is TraitPotion && owner.IsPCParty)
577 {
578 thing4 = null;
579 }
580 bool flag5 = EClass.Branch != null && EClass.Branch.policies.IsActive(2503);
581 if (owner.homeBranch != null && owner.homeBranch.policies.IsActive(2503))
582 {
583 flag5 = true;
584 }
585 if (thing4 == null && !flag5)
586 {
587 thing4 = ThingGen.Create("crimAle");
588 owner.Drink(thing4);
589 }
590 if (thing4 != null && !thing4.isDestroyed)
591 {
592 owner.TryUse(thing4);
593 yield return Restart();
594 }
595 }
596 if (EClass.rnd(owner.IsPCParty ? 1000 : 200) == 0 && owner.isDrunk && (owner.isSynced || EClass.rnd(5) == 0))
597 {
598 DoSomethingToCharaInRadius(3, null, delegate(Chara c)
599 {
600 owner.Say("drunk_mess", owner, c);
601 owner.Talk("drunk_mess");
602 bool flag6 = EClass.rnd(5) == 0 && !c.IsPC;
603 if (c.IsPCParty && owner.hostility >= Hostility.Friend)
604 {
605 flag6 = false;
606 }
607 if (flag6)
608 {
609 owner.Say("drunk_counter", c, owner);
610 c.Talk("drunk_counter");
612 }
613 });
614 }
615 if (EClass.rnd(100) == 0 && owner.trait.CanFish && owner.stamina.value > 0)
616 {
617 Point fishingPoint = AI_Fish.GetFishingPoint(owner.pos);
618 if (fishingPoint.IsValid)
619 {
620 yield return Do(new AI_Fish
621 {
622 pos = fishingPoint
623 });
624 }
625 }
626 string idAct = owner.source.actIdle.RandomItem();
627 if (EClass.rnd(EClass.world.date.IsNight ? 1500 : 15000) == 0 && !owner.IsPCFaction && !owner.noMove)
628 {
629 owner.AddCondition<ConSleep>(1000 + EClass.rnd(1000), force: true);
630 }
631 if (!owner.noMove)
632 {
633 if (EClass.rnd(3) == 0 && owner.IsCat)
634 {
635 Chara chara2 = ((EClass.rnd(5) == 0) ? EClass.pc.party.members.RandomItem() : EClass._map.charas.RandomItem());
636 Thing thing5 = chara2.things.Find<TraitFoodChuryu>();
637 if (chara2 != owner && thing5 != null)
638 {
639 yield return Do(new AI_Churyu
640 {
641 churyu = thing5,
642 slave = chara2
643 });
644 }
645 }
646 if (EClass.rnd(100) == 0 && (owner.HasHobbyOrWork("Pet") || owner.HasHobbyOrWork("Fluffy")))
647 {
648 yield return Do(new AI_Mofu());
649 }
650 }
651 if (EClass.rnd((owner.host != null && owner.GetInt(106) != 0) ? 1000 : 40) == 0 && owner.IsHuman)
652 {
653 DoSomethingToNearChara((Chara c) => (!c.IsPCParty || EClass.rnd(5) == 0) && c.IsMofuable && !owner.IsHostile(c) && !c.IsInCombat && owner.CanSee(c), delegate(Chara c)
654 {
655 owner.Cuddle(c);
656 });
657 yield return KeepRunning();
658 }
659 if (EClass.rnd(100) == 0 && owner.trait is TraitBitch)
660 {
661 Chara chara3 = DoSomethingToNearChara((Chara c) => c.IsIdle && !c.IsPCParty && !(c.trait is TraitBitch) && c.Evalue(418) <= 0);
662 if (chara3 != null)
663 {
664 yield return Do(new AI_Fuck
665 {
666 target = chara3,
667 variation = AI_Fuck.Variation.Bitch
668 });
669 }
670 }
671 if (EClass.rnd(50) == 0 && owner.trait is TraitBard)
672 {
673 yield return Do(new AI_PlayMusic());
674 }
675 if (EClass.rnd(4) == 0 && TryPerformIdleUse())
676 {
677 yield return Restart();
678 }
679 if (EClass.rnd(20) == 0 && owner.trait.IdleAct())
680 {
681 yield return Restart();
682 }
683 if (idAct == "janitor" && EClass.rnd(5) == 0)
684 {
685 DoSomethingToCharaInRadius(4, null, delegate(Chara c)
686 {
687 if (c.HasElement(1211) && !(EClass._zone is Zone_Casino))
688 {
689 owner.Talk("snail");
690 Thing t4 = ThingGen.Create("1142");
691 ActThrow.Throw(owner, c.pos, t4);
692 }
693 });
694 yield return Restart();
695 }
697 {
698 TraitShackle traitShackle2 = owner.pos.FindThing<TraitShackle>();
699 if (traitShackle2 != null && traitShackle2.AllowTraining)
700 {
702 {
703 shackle = traitShackle2
704 });
705 yield return Restart();
706 }
707 }
708 if (!owner.IsPCFactionOrMinion && EClass.rnd(owner.isSynced ? 50 : 2000) == 0 && owner.hostility == Hostility.Neutral && EClass.pc.party.HasElement(1563) && !owner.race.tag.Contains("animal") && EClass._zone.IsTown && !EClass._zone.IsPCFaction && !owner.HasCondition<ConIncognito>())
709 {
711 }
712 if (EClass.rnd(200) == 0 && !owner.noMove)
713 {
714 Point cleanPoint = AI_Clean.GetCleanPoint(owner, 4);
715 if (cleanPoint != null)
716 {
717 yield return Do(new AI_Clean
718 {
719 pos = cleanPoint
720 });
721 }
722 }
723 if (EClass.rnd(35) == 0 && owner.id == "child" && owner.pos.cell.IsSnowTile)
724 {
725 foreach (Chara chara4 in EClass._map.charas)
726 {
727 if (EClass.rnd(3) != 0 && chara4 != owner && chara4.pos.cell.IsSnowTile && chara4.Dist(owner) <= 6 && Los.IsVisible(chara4, owner))
728 {
729 Thing t3 = ThingGen.Create("snow");
730 ActThrow.Throw(owner, chara4.pos, t3);
731 break;
732 }
733 }
734 }
735 if (EClass.rnd(EClass.debug.enable ? 3 : 30) == 0)
736 {
737 Thing thing6 = owner.things.Find<TraitBall>();
738 if (thing6 == null)
739 {
741 {
742 owner.pos.ForeachNeighbor(delegate(Point p)
743 {
744 Card card2 = p.FindThing<TraitBall>()?.owner;
745 if (card2 != null)
746 {
747 owner.Pick(card2.Thing);
748 }
749 });
750 }
751 }
752 else
753 {
754 foreach (Chara chara5 in EClass._map.charas)
755 {
756 if (EClass.rnd(3) != 0 && chara5 != owner && chara5.Dist(owner) <= 6 && chara5.Dist(owner) >= 3 && Los.IsVisible(chara5, owner))
757 {
758 ActThrow.Throw(owner, chara5.pos, thing6);
759 break;
760 }
761 }
762 }
763 }
764 if (EClass.rnd(20) == 0 && AI_Shopping.TryShop(owner, realtime: true))
765 {
766 yield return Restart();
767 }
768 if (EClass.rnd(20) == 0 && owner.IsPCFaction && AI_Shopping.TryRestock(owner, realtime: true))
769 {
770 yield return Restart();
771 }
773 if (owner.idleActTimer <= 0 && !owner.source.actIdle.IsEmpty())
774 {
775 owner.idleActTimer = 10 + EClass.rnd(50);
776 switch (idAct)
777 {
778 case "torture_snail":
779 DoSomethingToNearChara((Chara c) => c.race.id == "snail", delegate(Chara c)
780 {
781 owner.Say("use_whip3", owner, c);
782 owner.PlaySound("whip");
783 owner.Talk("insult");
784 c.PlayAnime(AnimeID.Shiver);
785 c.OnInsulted();
786 });
787 break;
788 case "buffMage":
789 if (EClass.rnd(2) == 0)
790 {
791 TryCast<ConHolyVeil>(EffectId.HolyVeil, 300 + EClass.rnd(300));
792 }
793 else
794 {
795 TryCast<ConLevitate>(EffectId.Levitate, 300 + EClass.rnd(300));
796 }
797 break;
798 case "buffThief":
799 TryCast<ConNightVision>(EffectId.CatsEye, 100 + EClass.rnd(100));
800 break;
801 case "buffGuildWatch":
802 TryCast<ConGravity>(EffectId.Gravity, 300 + EClass.rnd(300));
803 break;
804 case "buffHealer":
805 TryCast(EffectId.Heal);
806 break;
807 case "readBook":
808 {
809 if (EClass.rnd(2) == 0 || (owner.IsPCParty && EClass.rnd(20) != 0))
810 {
811 break;
812 }
813 List<Thing> list3 = owner.things.List((Thing a) => a.parent == owner && (a.category.id == "spellbook" || a.category.id == "ancientbook" || a.category.id == "skillbook"), onlyAccessible: true);
814 Thing thing7 = null;
815 if (list3.Count > 0)
816 {
817 thing7 = list3.RandomItem();
818 if (!thing7.trait.CanRead(owner))
819 {
820 thing7 = null;
821 }
822 }
823 if (thing7 == null)
824 {
825 if (owner.things.IsFull())
826 {
827 break;
828 }
829 thing7 = ThingGen.CreateFromCategory((EClass.rnd(5) != 0) ? "spellbook" : "ancientbook");
830 thing7.isNPCProperty = true;
831 }
832 if (!(thing7.id == "1084") || !owner.IsPCFaction)
833 {
834 if (!owner.HasElement(285))
835 {
836 owner.elements.ModBase(285, 1);
837 }
838 yield return Do(new AI_Read
839 {
840 target = thing7
841 });
842 }
843 break;
844 }
845 default:
846 if (LangGame.Has("idle_" + idAct))
847 {
848 IdleActText(idAct);
849 }
850 break;
851 }
852 yield return Restart();
853 }
854 if (owner.host != null)
855 {
856 yield return Restart();
857 }
859 {
861 {
862 yield return DoGoto(owner.orgPos);
863 }
864 yield return Restart();
865 }
867 {
868 yield return DoGoto(EClass.pc);
869 }
870 if (EClass.rnd(100) == 0 && !owner.IsPCFaction)
871 {
872 if (owner.id == "ashland" || owner.id == "fiama")
873 {
875 if (card != null)
876 {
877 yield return DoGotoSpot(card);
878 }
879 else
880 {
881 Room room4 = owner.FindRoom();
882 if (room4 != null)
883 {
884 yield return DoGoto(room4.GetRandomPoint().GetNearestPoint());
885 }
886 }
887 }
889 {
890 yield return DoGoto(owner.orgPos, 0, ignoreConnection: false, delegate
891 {
892 if (!EClass._zone.IsPCFaction)
893 {
894 owner.Teleport(owner.orgPos, silent: false, force: true);
895 }
896 return Status.Success;
897 });
898 }
899 }
900 if (EClass.rnd(100) == 0 && owner.id == "bee")
901 {
902 Thing thing8 = EClass._map.ListThing<TraitBeekeep>()?.RandomItem();
903 if (thing8 != null)
904 {
905 yield return DoGoto(thing8.pos);
906 }
907 }
908 if (EClass.rnd(10) == 0 && !EClass._zone.IsUnderwater && (owner.race.tag.Contains("water") || owner.source.tag.Contains("water")) && !owner.pos.IsDeepWater)
909 {
910 for (int k = 0; k < 100; k++)
911 {
912 Point randomPoint2 = EClass._map.GetRandomPoint();
913 if (randomPoint2.IsDeepWater && !randomPoint2.IsBlocked)
914 {
915 yield return DoGoto(randomPoint2);
916 break;
917 }
918 }
919 }
920 text = owner.source.aiIdle;
921 if (!(text == "stand") && !(text == "root"))
922 {
923 if (EClass.rnd(15) == 0)
924 {
926 }
927 if (owner == null)
928 {
929 yield return Cancel();
930 }
931 }
932 if (EClass._zone.IsPCFaction && owner.IsPCFaction && !owner.IsPCParty && (owner.GetWork("Clean") != null || owner.GetWork("Chore") != null) && !(EClass.pc.ai is AI_UseCrafter))
933 {
934 AI_Haul aI_Haul = AI_Haul.TryGetAI(owner);
935 if (aI_Haul != null)
936 {
937 yield return Do(aI_Haul);
938 }
939 }
940 yield return Restart();
941 Point FindMovePoint(BaseArea.AccessType type)
942 {
943 for (int l = 0; l < 20; l++)
944 {
945 Point randomPoint3 = owner.pos.GetRandomPoint(5 + l, requireLos: false);
946 if (randomPoint3 != null && randomPoint3.IsInBounds && (randomPoint3.cell.room == null || randomPoint3.cell.room.data.accessType == type))
947 {
948 return randomPoint3;
949 }
950 }
951 return null;
952 }
953 }
954
955 public void IdleActText(string id)
956 {
957 string text = "idle_" + id;
958 owner.PlaySound(text);
959 if (Lang.Game.map.ContainsKey(text))
960 {
961 owner.Say(text, owner);
962 }
963 }
964
965 public void TryCast<T>(EffectId id, int power = 100) where T : Condition
966 {
967 if (!owner.HasCondition<T>())
968 {
969 TryCast(id, power);
970 }
971 }
972
973 public void TryCast(EffectId id, int power = 100)
974 {
975 owner.Say("idle_cast", owner);
976 ActEffect.Proc(id, power, BlessedState.Normal, owner);
977 }
978
980 {
981 _listRoom.Clear();
982 foreach (BaseArea item in ((IEnumerable<BaseArea>)EClass._map.rooms.listRoom).Concat((IEnumerable<BaseArea>)EClass._map.rooms.listArea))
983 {
984 if (item.type != null && item.type.uidCharas.Contains(owner.uid))
985 {
986 _listRoom.Add(item);
987 }
988 }
989 return _listRoom.RandomItem();
990 }
991
992 public Chara DoSomethingToNearChara(Func<Chara, bool> funcPickChara, Action<Chara> action = null)
993 {
994 List<Chara> list = owner.pos.ListCharasInNeighbor(delegate(Chara c)
995 {
996 if (c == owner || !owner.CanSee(c))
997 {
998 return false;
999 }
1000 return funcPickChara == null || funcPickChara(c);
1001 });
1002 if (list.Count > 0)
1003 {
1004 Chara chara = list.RandomItem();
1005 action?.Invoke(chara);
1006 return chara;
1007 }
1008 return null;
1009 }
1010
1011 public Chara DoSomethingToCharaInRadius(int radius, Func<Chara, bool> funcPickChara, Action<Chara> action = null)
1012 {
1013 List<Chara> list = owner.pos.ListCharasInRadius(owner, radius, delegate(Chara c)
1014 {
1015 if (c == owner || !owner.CanSee(c))
1016 {
1017 return false;
1018 }
1019 return funcPickChara == null || funcPickChara(c);
1020 });
1021 if (list.Count > 0)
1022 {
1023 Chara chara = list.RandomItem();
1024 action?.Invoke(chara);
1025 return chara;
1026 }
1027 return null;
1028 }
1029
1030 public bool TryPerformIdleUse()
1031 {
1032 for (int i = 0; i < 10; i++)
1033 {
1034 Point randomPoint = owner.pos.GetRandomPoint(7, requireLos: true, allowChara: true, allowBlocked: true);
1035 if (randomPoint == null || randomPoint.detail == null)
1036 {
1037 continue;
1038 }
1039 foreach (Thing thing in randomPoint.detail.things)
1040 {
1041 if (thing.IsInstalled)
1042 {
1043 int num = owner.Dist(thing);
1044 if (EClass.rnd((owner.memberType == FactionMemberType.Guest) ? 5 : 50) == 0 && thing.HasTag(CTAG.tourism) && num <= 2)
1045 {
1046 owner.LookAt(thing);
1047 owner.Talk("nice_statue");
1048 return true;
1049 }
1050 if (EClass.rnd(thing.trait.IdleUseChance) == 0 && thing.trait.IdleUse(owner, num))
1051 {
1052 owner.LookAt(thing);
1053 return true;
1054 }
1055 }
1056 }
1057 }
1058 return false;
1059 }
1060}
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
ClearInventoryType
EditorTag
Definition: EditorTag.cs:2
EffectId
Definition: EffectId.cs:2
FactionMemberType
Hostility
Definition: Hostility.cs:2
MinionType
Definition: MinionType.cs:2
ThrowMethod
Definition: ThrowMethod.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
Definition: AIAct.cs:6
Status Do(AIAct _seq, Func< Status > _onChildFail=null)
Definition: AIAct.cs:416
virtual Status Cancel()
Definition: AIAct.cs:291
new Chara owner
Definition: AIAct.cs:14
Status
Definition: AIAct.cs:8
Status DoGotoSpot(Card card, Func< Status > _onChildFail=null)
Definition: AIAct.cs:461
Status DoGoto(Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
Definition: AIAct.cs:432
Status KeepRunning()
Definition: AIAct.cs:321
Status Restart()
Definition: AIAct.cs:237
static Point GetCleanPoint(Chara c, int r=-1, int tries=10)
Definition: AI_Clean.cs:9
Definition: AI_Eat.cs:5
static Point GetFishingPoint(Point p)
Definition: AI_Fish.cs:276
static AI_Haul TryGetAI(Chara c)
Definition: AI_Haul.cs:76
Chara DoSomethingToNearChara(Func< Chara, bool > funcPickChara, Action< Chara > action=null)
Definition: AI_Idle.cs:992
BaseArea GetRandomAssignedRoom()
Definition: AI_Idle.cs:979
int moveFailCount
Definition: AI_Idle.cs:16
static List< BaseArea > _listRoom
Definition: AI_Idle.cs:18
override IEnumerable< Status > Run()
Definition: AI_Idle.cs:32
override bool IsIdle
Definition: AI_Idle.cs:20
override bool InformCancel
Definition: AI_Idle.cs:22
Chara DoSomethingToCharaInRadius(int radius, Func< Chara, bool > funcPickChara, Action< Chara > action=null)
Definition: AI_Idle.cs:1011
int maxRepeat
Definition: AI_Idle.cs:14
override int MaxRestart
Definition: AI_Idle.cs:24
void IdleActText(string id)
Definition: AI_Idle.cs:955
bool TryPerformIdleUse()
Definition: AI_Idle.cs:1030
override void OnStart()
Definition: AI_Idle.cs:26
void TryCast(EffectId id, int power=100)
Definition: AI_Idle.cs:973
Behaviour
Definition: AI_Idle.cs:9
static bool TryRestock(Chara c, bool realtime)
Definition: AI_Shopping.cs:94
static bool TryShop(Chara c, bool realtime)
Definition: AI_Shopping.cs:10
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:987
List< Item > items
Definition: ActList.cs:14
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
Definition: ACT.cs:62
BaseArea.AccessType accessType
Definition: AreaData.cs:42
AccessType
Definition: BaseArea.cs:9
AreaData data
Definition: BaseArea.cs:29
virtual Point GetRandomPoint(bool walkable=true, bool allowChara=true)
Definition: BaseArea.cs:88
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
GlobalCharaList globalCharas
Definition: CardManager.cs:46
TC GetTC(string id)
Definition: Card.cs:11
bool isDestroyed
Definition: Card.cs:75
MinionType c_minionType
Definition: Card.cs:988
bool IsPCFactionOrMinion
Definition: Card.cs:2260
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5820
ElementContainerCard elements
Definition: Card.cs:41
string id
Definition: Card.cs:35
bool IsRestrainedResident
Definition: Card.cs:2246
bool HasElement(int ele, int req=1)
Definition: Card.cs:5881
bool isRestrained
Definition: Card.cs:566
CardRenderer HostRenderer
Definition: Card.cs:2430
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6113
int GetHearingRadius()
Definition: Card.cs:6358
int c_uidMaster
Definition: Card.cs:1449
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3089
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6668
int hp
Definition: Card.cs:242
ICardParent parent
Definition: Card.cs:55
bool ExistsOnMap
Definition: Card.cs:2073
int GetCurrency(string id="money")
Definition: Card.cs:3960
bool HasTag(CTAG tag)
Definition: Card.cs:2583
Point pos
Definition: Card.cs:59
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7658
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6081
Trait trait
Definition: Card.cs:53
void ModCurrency(int a, string id="money")
Definition: Card.cs:3946
int encLV
Definition: Card.cs:326
bool IsEquipment
Definition: Card.cs:2161
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4048
void ModEncLv(int a)
Definition: Card.cs:3831
bool c_isImportant
Definition: Card.cs:1024
MoveResult
Definition: Card.cs:13
bool noMove
Definition: Card.cs:770
bool HasEditorTag(EditorTag tag)
Definition: Card.cs:2588
ThingContainer things
Definition: Card.cs:38
bool IsInstalled
Definition: Card.cs:2369
virtual Thing Thing
Definition: Card.cs:2046
int Evalue(int ele)
Definition: Card.cs:2559
int Dist(Card c)
Definition: Card.cs:7614
bool isGifted
Definition: Card.cs:782
Cell Cell
Definition: Card.cs:2043
int Num
Definition: Card.cs:158
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6132
SourceCategory.Row category
Definition: Card.cs:2037
void ModNum(int a, bool notify=true)
Definition: Card.cs:3500
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6765
Room room
Definition: Cell.cs:102
bool IsSnowTile
Definition: Cell.cs:782
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool HasFire
Definition: Cell.cs:676
ActList list
Definition: CharaAbility.cs:12
bool Has(int id)
Definition: Chara.cs:10
void OnInsulted()
Definition: Chara.cs:8047
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5756
bool HasHobbyOrWork(string alias)
Definition: Chara.cs:8723
override bool IsAliveInCurrentZone
Definition: Chara.cs:561
Thing FindBestFoodToEat()
Definition: Chara.cs:7434
new TraitChara trait
Definition: Chara.cs:503
Card held
Definition: Chara.cs:70
AIAct ai
Definition: Chara.cs:202
bool TryUse(Thing t)
Definition: Chara.cs:7758
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:6178
int sharedCheckTurn
Definition: Chara.cs:118
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7455
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9132
Faction faction
Definition: Chara.cs:427
override bool IsPC
Definition: Chara.cs:612
bool isDrunk
Definition: Chara.cs:124
Chara host
Definition: Chara.cs:33
Chara GetNearbyCatToSniff()
Definition: Chara.cs:7958
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1250
bool IsMofuable
Definition: Chara.cs:1099
override bool IsPCParty
Definition: Chara.cs:615
Party party
Definition: Chara.cs:43
bool IsInCombat
Definition: Chara.cs:864
TraitBed TryAssignBed()
Definition: Chara.cs:7235
void PickHeld(bool msg=false)
Definition: Chara.cs:4469
bool HasCondition(string alias)
Definition: Chara.cs:9289
void Banish(Chara owner)
Definition: Chara.cs:2319
AIAct SetAI(AIAct g)
Definition: Chara.cs:8762
bool IsIdle
Definition: Chara.cs:853
TraitBed FindBed()
Definition: Chara.cs:7223
Stats hunger
Definition: Chara.cs:1142
override bool IsMinion
Definition: Chara.cs:627
override bool isSynced
Definition: Chara.cs:691
Point orgPos
Definition: Chara.cs:21
bool IsHuman
Definition: Chara.cs:879
bool MoveRandom()
Definition: Chara.cs:2565
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
Definition: Chara.cs:7253
override bool IsPCFaction
Definition: Chara.cs:671
bool CanSee(Card c)
Definition: Chara.cs:1218
bool HasAccess(Card c)
Definition: Chara.cs:1280
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7480
Chara Duplicate()
Definition: Chara.cs:1772
override int MaxHP
Definition: Chara.cs:708
bool CanDuplicate()
Definition: Chara.cs:1755
void ClearInventory(ClearInventoryType type)
Definition: Chara.cs:8405
SourceChara.Row source
Definition: Chara.cs:158
Stats mana
Definition: Chara.cs:1154
FactionMemberType memberType
Definition: Chara.cs:46
string TalkTopic(string topic="calm")
Definition: Chara.cs:6874
Stats stamina
Definition: Chara.cs:1146
bool MoveNeighborDefinitely()
Definition: Chara.cs:2579
void SetTempHand(int right=0, int left=0)
Definition: Chara.cs:6620
Chara parasite
Definition: Chara.cs:30
Chara master
Definition: Chara.cs:88
bool IsGuest()
Definition: Chara.cs:6530
Hobby GetWork(string id)
Definition: Chara.cs:8873
Thing nextUse
Definition: Chara.cs:100
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2605
Religion faith
Definition: Chara.cs:439
Chara enemy
Definition: Chara.cs:86
CharaAbility ability
Definition: Chara.cs:424
Chara FindMaster()
Definition: Chara.cs:2374
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6217
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6266
Room FindRoom()
Definition: Chara.cs:7814
Point GetDestination()
Definition: Chara.cs:7142
int turnLastSeen
Definition: Chara.cs:110
FactionBranch homeBranch
Definition: Chara.cs:1066
void Drink(Card t)
Definition: Chara.cs:5037
Hostility hostility
Definition: Chara.cs:291
bool IsHostile()
Definition: Chara.cs:6443
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7291
PCCData pccData
Definition: Chara.cs:67
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4253
void Sniff(Chara c)
Definition: Chara.cs:7970
override bool IsPCC
Definition: Chara.cs:682
int idleActTimer
Definition: Chara.cs:112
bool IsCat
Definition: Chara.cs:987
SourceRace.Row race
Definition: Chara.cs:464
Definition: ConHOT.cs:4
int AllyDistance(Chara c)
bool enable
Definition: CoreDebug.cs:286
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
bool IsNight
Definition: Date.cs:112
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static FactionBranch Branch
Definition: EClass.cs:22
static int rndHalf(int a)
Definition: EClass.cs:87
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static SoundManager Sound
Definition: EClass.cs:46
Dictionary< int, Element > dict
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
int ValueWithoutLink
Definition: ELEMENT.cs:294
int id
Definition: ELEMENT.cs:250
SourceElement.Row source
Definition: ELEMENT.cs:273
int vTempPotential
Definition: ELEMENT.cs:258
Act act
Definition: ELEMENT.cs:394
Thing GetMeal(Chara c)
List< Chara > members
PolicyManager policies
ConfigTactics tactics
Definition: Game.cs:90
ReligionManager religions
Definition: Game.cs:158
CardManager cards
Definition: Game.cs:155
Config config
Definition: Game.cs:218
static bool Has(string id)
Definition: LangGame.cs:46
Definition: Lang.cs:6
static LangGame Game
Definition: Lang.cs:48
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
static LayerCraft Instance
Definition: LayerCraft.cs:8
static LayerDragGrid Instance
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
Point GetRandomPoint(Point center, int radius, int tries=100, bool mustBeWalkable=true, bool requireLos=true)
Definition: Map.cs:2215
PropsInstalled Installed
Definition: Map.cs:123
PropsManager props
Definition: Map.cs:91
RoomManager rooms
Definition: Map.cs:31
List< Chara > charas
Definition: Map.cs:81
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Definition: Party.cs:7
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:194
int EvalueTotal(int ele, Func< Chara, bool > funcIf=null)
Definition: Party.cs:181
Chara leader
Definition: Party.cs:31
List< Chara > members
Definition: Party.cs:19
int turns
Definition: Player.cs:84
int karma
Definition: Player.cs:878
Stats stats
Definition: Player.cs:1016
Definition: Point.cs:9
ref Vector3 Position(int height)
Definition: Point.cs:548
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397
CellDetail detail
Definition: Point.cs:71
bool IsBlocked
Definition: Point.cs:363
List< Thing > Things
Definition: Point.cs:338
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
List< Chara > ListCharasInNeighbor(Func< Chara, bool > func)
Definition: Point.cs:1200
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220
bool Equals(int _x, int _z)
Definition: Point.cs:960
bool IsValid
Definition: Point.cs:88
Point GetRandomPointInRadius(int minRadius, int maxRadius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=2000)
Definition: Point.cs:783
int Distance(Point p)
Definition: Point.cs:989
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104
Cell cell
Definition: Point.cs:51
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140
bool HasChara
Definition: Point.cs:238
bool IsHotSpring
Definition: Point.cs:375
bool IsDeepWater
Definition: Point.cs:276
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:769
bool IsActive(int id, int days=-1)
List< PopItem > items
Definition: PopManager.cs:34
PropsInstalled installed
Definition: PropsManager.cs:8
TraitManager traits
Definition: Props.cs:18
Thing Find(int uid)
Definition: Props.cs:389
ReligionHarmony Harmony
List< Room > listRoom
Definition: RoomManager.cs:13
List< Area > listArea
Definition: RoomManager.cs:10
Definition: Room.cs:4
Lot lot
Definition: Room.cs:21
virtual bool IsRegion
Definition: Spatial.cs:515
virtual void Mod(int a)
Definition: Stats.cs:135
override int GetPhase()
Definition: Stats.cs:117
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
Definition: TCText.cs:6
PopManager pop
Definition: TCText.cs:9
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
Thing Find(int uid)
bool IsFull(int y=0)
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
bool IsSharedContainer
Definition: Thing.cs:112
virtual AI_Idle.Behaviour IdleBehaviour
Definition: TraitChara.cs:17
virtual string IdAmbience
Definition: TraitChara.cs:135
virtual bool CanFish
Definition: TraitChara.cs:137
virtual bool IdleAct()
Definition: TraitChara.cs:139
TraitMap restSpots
Definition: TraitManager.cs:10
virtual bool AllowTraining
Definition: TraitShackle.cs:13
virtual bool CanRead(Chara c)
Definition: Trait.cs:968
virtual bool CanEat(Chara c)
Definition: Trait.cs:977
virtual int IdleUseChance
Definition: Trait.cs:362
virtual bool IdleUse(Chara c, int dist)
Definition: Trait.cs:646
virtual bool CanDrink(Chara c)
Definition: Trait.cs:986
GameDate date
Definition: World.cs:6
Definition: Zone.cs:12
static int okaerinko
Definition: Zone.cs:31
virtual bool IsNefia
Definition: Zone.cs:282
FactionBranch branch
Definition: Zone.cs:34
virtual bool IsUserZone
Definition: Zone.cs:268
Chara Boss
Definition: Zone.cs:83
virtual bool IsTown
Definition: Zone.cs:220
virtual bool PetFollow
Definition: Zone.cs:284
bool IsPCFaction
Definition: Zone.cs:470
virtual bool IsUnderwater
Definition: Zone.cs:266
Card AddCard(Card t, Point point)
Definition: Zone.cs:1959