Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Grab.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020001DF RID: 479
5public class AI_Grab : AIAct
6{
7 // Token: 0x06000DD5 RID: 3541 RVA: 0x0006A661 File Offset: 0x00068861
8 public virtual Card GetTarget()
9 {
10 return this.target;
11 }
12
13 // Token: 0x06000DD6 RID: 3542 RVA: 0x0006A669 File Offset: 0x00068869
14 public virtual bool IsValidTarget(Card c)
15 {
16 return c != null && c == this.target;
17 }
18
19 // Token: 0x06000DD7 RID: 3543 RVA: 0x0006A679 File Offset: 0x00068879
20 public override IEnumerable<AIAct.Status> Run()
21 {
22 if (this.IsValidTarget(this.owner.held))
23 {
24 yield return base.Success(null);
25 }
26 this.target = this.GetTarget();
27 if (this.target == null)
28 {
29 yield return this.Cancel();
30 }
31 Card root = this.target.GetRootCard();
32 if (!root.ExistsOnMap)
33 {
34 yield return this.Cancel();
35 }
36 yield return base.DoGoto(root, 1, null);
37 if (!this.owner.TryHoldCard(this.target, (this.num == -1) ? this.target.Num : this.num, false))
38 {
39 yield return this.Cancel();
40 }
41 yield break;
42 }
43
44 // Token: 0x04000D26 RID: 3366
45 public Card target;
46
47 // Token: 0x04000D27 RID: 3367
48 public int num = -1;
49
50 // Token: 0x04000D28 RID: 3368
51 public bool pickHeld;
52}
Definition AIAct.cs:7
Definition Card.cs:13