Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Deconstruct.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x020001F7 RID: 503
6public class AI_Deconstruct : AIAct
7{
8 // Token: 0x06000E6D RID: 3693 RVA: 0x0006D1DA File Offset: 0x0006B3DA
9 public bool IsValidTarget()
10 {
11 return this.target != null && this.target.ExistsOnMap && this.target.isDeconstructing;
12 }
13
14 // Token: 0x06000E6E RID: 3694 RVA: 0x0006D1FE File Offset: 0x0006B3FE
15 public override IEnumerable<AIAct.Status> Run()
16 {
17 if (this.target != null)
18 {
19 this.target.SetDeconstruct(true);
20 }
21 else
22 {
23 this.target = EClass._map.props.deconstructing.RandomItem<Card>();
24 }
25 if (!this.IsValidTarget())
26 {
27 yield return this.Cancel();
28 }
29 yield return base.DoGoto(this.target, null);
30 Progress_Custom progress_Custom = new Progress_Custom();
31 progress_Custom.canProgress = (() => this.IsValidTarget());
32 progress_Custom.onProgressBegin = delegate()
33 {
34 };
35 progress_Custom.onProgress = delegate(Progress_Custom p)
36 {
37 this.owner.PlaySound(this.target.material.GetSoundImpact(null), 1f, true);
38 this.target.renderer.PlayAnime(AnimeID.Shiver, default(Vector3), false);
39 };
40 progress_Custom.onProgressComplete = delegate()
41 {
42 this.target.Deconstruct();
43 };
44 Progress_Custom seq = progress_Custom.SetDuration(30, 2);
45 yield return base.Do(seq, null);
46 yield break;
47 }
48
49 // Token: 0x04000D4C RID: 3404
50 public Card target;
51}
Definition AIAct.cs:7
Definition Card.cs:13