Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Cook.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020001F1 RID: 497
5public class AI_Cook : AIAct
6{
7 // Token: 0x170003A6 RID: 934
8 // (get) Token: 0x06000E3D RID: 3645 RVA: 0x0006BB20 File Offset: 0x00069D20
9 public override int LeftHand
10 {
11 get
12 {
13 return 1001;
14 }
15 }
16
17 // Token: 0x170003A7 RID: 935
18 // (get) Token: 0x06000E3E RID: 3646 RVA: 0x0006BB27 File Offset: 0x00069D27
19 public override int RightHand
20 {
21 get
22 {
23 return 1002;
24 }
25 }
26
27 // Token: 0x06000E3F RID: 3647 RVA: 0x0006BB2E File Offset: 0x00069D2E
28 public bool IsValidTarget(Card c)
29 {
30 return this.factory != null && this.factory.trait.CanCook(c);
31 }
32
33 // Token: 0x06000E40 RID: 3648 RVA: 0x0006BB4B File Offset: 0x00069D4B
34 public override IEnumerable<AIAct.Status> Run()
35 {
36 this.factory = EClass._map.Installed.traits.GetRandomThing<TraitCooker>();
37 if (!this.IsValidTarget(this.owner.held))
38 {
39 yield return this.Cancel();
40 }
41 yield return base.DoGoto(this.factory, null);
42 if (!this.IsValidTarget(this.owner.held))
43 {
44 yield return this.Cancel();
45 }
46 Card target = this.owner.DropHeld(this.factory.pos);
47 target.TryReserve(this);
48 Progress_Custom progress_Custom = new Progress_Custom();
49 progress_Custom.canProgress = (() => this.factory.ExistsOnMap && target.ExistsOnMap);
50 progress_Custom.onProgress = delegate(Progress_Custom p)
51 {
52 this.owner.LookAt(this.factory);
53 this.factory.trait.CookProgress();
54 };
55 progress_Custom.onProgressComplete = delegate()
56 {
57 };
58 Progress_Custom seq = progress_Custom.SetDuration(25, 5);
59 this.owner.SetTempHand(-1, -1);
60 yield return base.Do(seq, null);
61 yield return AIAct.Status.Running;
62 if (!this.owner.CanPick(target))
63 {
64 yield return this.Cancel();
65 }
66 this.owner.HoldCard(target, -1);
67 yield break;
68 }
69
70 // Token: 0x04000D42 RID: 3394
71 public Card factory;
72}
Definition AIAct.cs:7
Definition Card.cs:13