Elin Modding Docs Doc
Loading...
Searching...
No Matches
GoalGraze.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x0200023B RID: 571
5public class GoalGraze : Goal
6{
7 // Token: 0x06000FEA RID: 4074 RVA: 0x000722AD File Offset: 0x000704AD
8 public override IEnumerable<AIAct.Status> Run()
9 {
10 Point pos = this.GetPos();
11 if (pos != null)
12 {
13 yield return base.DoGoto(pos, 0, false, null);
14 }
15 yield return base.DoIdle(20);
16 yield break;
17 }
18
19 // Token: 0x06000FEB RID: 4075 RVA: 0x000722C0 File Offset: 0x000704C0
20 public Point GetPos()
21 {
22 this.owner.ClearBed(null);
23 Thing thing = null;
24 Rand.SetSeed(this.owner.uid);
25 if (thing == null)
26 {
27 thing = EClass._map.FindThing(typeof(TraitSpotRanch), this.owner);
28 }
29 Rand.SetSeed(-1);
30 if (thing != null)
31 {
32 return thing.trait.GetRandomPoint(null);
33 }
34 return null;
35 }
36
37 // Token: 0x06000FEC RID: 4076 RVA: 0x00072320 File Offset: 0x00070520
38 public override void OnSimulatePosition()
39 {
40 Point pos = this.GetPos();
41 if (pos != null)
42 {
43 this.owner.MoveImmediate(pos, true, true);
44 }
45 }
46}
Definition AIAct.cs:7
Definition Goal.cs:5
Definition Point.cs:11
Definition Thing.cs:10