Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Drink.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020001F5 RID: 501
5public class AI_Drink : AIAct
6{
7 // Token: 0x06000E5D RID: 3677 RVA: 0x0006CF36 File Offset: 0x0006B136
8 public bool IsValidTarget(Card c)
9 {
10 return c != null && c.trait is TraitDrink;
11 }
12
13 // Token: 0x170003AC RID: 940
14 // (get) Token: 0x06000E5E RID: 3678 RVA: 0x0006CF4B File Offset: 0x0006B14B
15 public override bool LocalAct
16 {
17 get
18 {
19 return false;
20 }
21 }
22
23 // Token: 0x170003AD RID: 941
24 // (get) Token: 0x06000E5F RID: 3679 RVA: 0x0006CF4E File Offset: 0x0006B14E
25 public override bool IsHostileAct
26 {
27 get
28 {
29 return this.target != null && this.target.isNPCProperty;
30 }
31 }
32
33 // Token: 0x06000E60 RID: 3680 RVA: 0x0006CF68 File Offset: 0x0006B168
34 public override void OnSetOwner()
35 {
36 if (this.target != null && (this.target.GetRootCard() == this.owner || this.target.parent == null))
37 {
38 this.owner.Drink(this.target);
39 base.Success(null);
40 }
41 }
42
43 // Token: 0x06000E61 RID: 3681 RVA: 0x0006CFB6 File Offset: 0x0006B1B6
44 public override IEnumerable<AIAct.Status> Run()
45 {
46 if (this.target != null && (this.target.GetRootCard() == this.owner || this.target.parent == null))
47 {
48 this.owner.HoldCard(this.target, 1);
49 }
50 else if (this.target != null)
51 {
52 yield return base.DoGrab(this.target, 1, false, null);
53 }
54 else
55 {
56 yield return base.DoGrab<TraitDrink>();
57 }
58 this.target = this.owner.held;
59 if (this.target == null)
60 {
61 yield return this.Cancel();
62 }
63 yield return base.Success(delegate
64 {
65 this.owner.Drink(this.target);
66 });
67 yield break;
68 }
69
70 // Token: 0x04000D4A RID: 3402
71 public Card target;
72}
Definition AIAct.cs:7
Definition Card.cs:13