Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Clean.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020001EF RID: 495
5public class AI_Clean : AIAct
6{
7 // Token: 0x06000E31 RID: 3633 RVA: 0x0006B770 File Offset: 0x00069970
8 public static Point GetCleanPoint(Chara c, int r = -1, int tries = 10)
9 {
10 Point point = new Point();
11 if (r != -1)
12 {
13 for (int i = 0; i < tries; i++)
14 {
15 if (i == 0)
16 {
17 point.Set(c.pos);
18 }
19 else
20 {
21 point.Set(c._x - r + EClass.rnd(r * 2 + 1), c.pos.z - r + EClass.rnd(r * 2 + 1));
22 }
23 if (point.IsValid)
24 {
25 if (point.HasDirt || point.cell.HasLiquid)
26 {
27 return point;
28 }
29 foreach (Card card in point.ListCards(false))
30 {
31 }
32 }
33 }
34 }
35 return null;
36 }
37
38 // Token: 0x06000E32 RID: 3634 RVA: 0x0006B840 File Offset: 0x00069A40
39 public override IEnumerable<AIAct.Status> Run()
40 {
41 for (;;)
42 {
43 if (this.pos == null)
44 {
45 this.pos = AI_Clean.GetCleanPoint(this.owner, 4, 10);
46 }
47 if (this.pos != null)
48 {
49 break;
50 }
51 yield return base.DoIdle(10);
52 }
53 yield return base.DoGoto(this.pos, 0, false, null);
54 if (this.owner.pos.HasDirt || this.owner.pos.cell.HasLiquid)
55 {
56 EClass._map.SetDecal(this.pos.x, this.pos.z, 0, 1, true);
57 EClass._map.SetLiquid(this.pos.x, this.pos.z, 0, 0);
58 this.pos.PlayEffect("vanish");
59 this.owner.Say("clean", this.owner, null, null);
60 this.owner.PlaySound("clean_floor", 1f, true);
61 yield return base.KeepRunning();
62 }
63 List<Card> list = this.owner.pos.ListCards(false);
64 bool flag = false;
65 foreach (Card card in list)
66 {
67 if (card.isThing)
68 {
69 bool isInstalled = card.IsInstalled;
70 }
71 }
72 if (flag)
73 {
74 this.owner.Talk("clean", null, null, false);
75 }
76 yield return base.Success(null);
77 yield break;
78 }
79
80 // Token: 0x04000D3E RID: 3390
81 public Point pos;
82
83 // Token: 0x04000D3F RID: 3391
84 public int maxRadius = -1;
85}
Definition AIAct.cs:7
Definition Card.cs:13
Definition Chara.cs:12
Definition Point.cs:11