Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
GoalGraze.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
3public class GoalGraze : Goal
4{
5 public override IEnumerable<Status> Run()
6 {
7 Point pos = GetPos();
8 if (pos != null)
9 {
10 yield return DoGoto(pos);
11 }
12 yield return DoIdle(20);
13 }
14
15 public Point GetPos()
16 {
17 Thing thing = null;
19 if (thing == null)
20 {
21 thing = EClass._map.FindThing(typeof(TraitSpotRanch), owner);
22 }
23 Rand.SetSeed();
24 return thing?.trait.GetRandomPoint();
25 }
26
27 public override void OnSimulatePosition()
28 {
29 Point pos = GetPos();
30 if (pos != null)
31 {
33 }
34 }
35}
new Chara owner
Definition: AIAct.cs:14
Status DoGoto(Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
Definition: AIAct.cs:432
Status DoIdle(int repeat=3)
Definition: AIAct.cs:523
int uid
Definition: Card.cs:118
Trait trait
Definition: Card.cs:49
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5127
Definition: EClass.cs:5
static Map _map
Definition: EClass.cs:18
Point GetPos()
Definition: GoalGraze.cs:15
override IEnumerable< Status > Run()
Definition: GoalGraze.cs:5
override void OnSimulatePosition()
Definition: GoalGraze.cs:27
Definition: Goal.cs:4
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2570
Definition: Point.cs:9
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37
Definition: Thing.cs:8
Point GetRandomPoint(Func< Point, bool > func=null, Chara accessChara=null)
Definition: Trait.cs:689