Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Offer.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4
5// Token: 0x020001FB RID: 507
6public class AI_Offer : AIAct
7{
8 // Token: 0x06000E7E RID: 3710 RVA: 0x0006D40A File Offset: 0x0006B60A
9 public bool IsValidTarget(Card c)
10 {
11 return this.altar != null && this.altar.trait.CanOffer(c);
12 }
13
14 // Token: 0x06000E7F RID: 3711 RVA: 0x0006D427 File Offset: 0x0006B627
15 public override IEnumerable<AIAct.Status> Run()
16 {
17 if (this.target != null && this.target.ExistsOnMap)
18 {
19 yield return base.DoGoto(this.target, null);
20 }
21 this.altar = EClass._map.Installed.traits.altars.GetRandomInstalled();
22 if (this.altar == null)
23 {
24 yield return this.Cancel();
25 }
26 if (!this.IsValidTarget(this.owner.held))
27 {
28 yield return base.DoGrab(EClass._map.charas.Where(new Func<Chara, bool>(this.IsValidTarget)).RandomItem<Chara>(), -1, false, null);
29 if (!this.IsValidTarget(this.owner.held))
30 {
31 yield return this.Cancel();
32 }
33 }
34 yield return base.DoGoto(this.altar, null);
35 if (!this.IsValidTarget(this.owner.held))
36 {
37 yield return this.Cancel();
38 }
39 this.owner.DropHeld(this.altar.pos);
41 {
42 canProgress = (() => this.altar.ExistsOnMap),
43 onProgress = delegate(Progress_Custom p)
44 {
45 this.altar.trait.OfferProcess(this.owner);
46 },
47 onProgressComplete = delegate()
48 {
49 this.altar.trait.Offer(this.owner);
50 }
51 }.SetDuration(15, 5);
52 yield return base.Do(seq, null);
53 yield break;
54 }
55
56 // Token: 0x04000D52 RID: 3410
57 public Card target;
58
59 // Token: 0x04000D53 RID: 3411
60 public Card altar;
61}
Definition AIAct.cs:7
Definition Card.cs:13
Definition Chara.cs:12