Elin Modding Docs Doc
Loading...
Searching...
No Matches
TaskPlow.cs
1using System;
2using UnityEngine;
3
4// Token: 0x0200025B RID: 603
6{
7 // Token: 0x060010F4 RID: 4340 RVA: 0x00075D8A File Offset: 0x00073F8A
8 public override bool CanProgress()
9 {
10 return base.CanProgress() && !this.pos.IsFarmField;
11 }
12
13 // Token: 0x1700048D RID: 1165
14 // (get) Token: 0x060010F5 RID: 4341 RVA: 0x00075DA4 File Offset: 0x00073FA4
15 public override CursorInfo CursorIcon
16 {
17 get
18 {
19 return CursorSystem.Dig;
20 }
21 }
22
23 // Token: 0x1700048E RID: 1166
24 // (get) Token: 0x060010F6 RID: 4342 RVA: 0x00075DAB File Offset: 0x00073FAB
25 public override bool CanPressRepeat
26 {
27 get
28 {
29 return true;
30 }
31 }
32
33 // Token: 0x060010F7 RID: 4343 RVA: 0x00075DB0 File Offset: 0x00073FB0
34 public override void OnCreateProgress(Progress_Custom p)
35 {
36 p.textHint = this.Name;
37 p.maxProgress = Mathf.Max((15 + EClass.rnd(20)) * 100 / (100 + this.owner.Tool.material.hardness * 3), 2);
38 p.onProgressBegin = delegate()
39 {
40 if (this.owner.Tool != null)
41 {
42 this.owner.Say("till_start", this.owner, this.owner.Tool, null, null);
43 }
44 };
45 p.onProgress = delegate(Progress_Custom _p)
46 {
47 SourceMaterial.Row row = this.pos.cell.HasBridge ? this.pos.cell.matBridge : this.pos.cell.matFloor;
48 row.PlayHitEffect(this.pos);
49 row.AddBlood(this.pos, 1);
50 this.pos.PlaySound(row.GetSoundImpact(null), true, 1f, true);
51 if (!(this.pos.HasBridge ? this.pos.sourceBridge : this.pos.sourceFloor).tag.Contains("soil"))
52 {
53 this.owner.Say("till_invalid", null, null);
54 _p.Cancel();
55 return;
56 }
57 };
58 p.onProgressComplete = delegate()
59 {
60 this.owner.PlaySound(this.pos.cell.HasBridge ? this.pos.cell.matBridge.GetSoundDead(this.pos.sourceBridge) : this.pos.cell.matFloor.GetSoundDead(this.pos.sourceFloor), 1f, true);
61 Effect.Get("mine").Play(this.pos, 0f, null, null).SetParticleColor(this.pos.cell.HasBridge ? this.pos.matBridge.GetColor() : this.pos.matFloor.GetColor()).Emit(10 + EClass.rnd(10));
62 this.pos.Animate(AnimeID.Dig, true);
63 if (this.pos.HasBridge)
64 {
65 this.pos.cell._bridge = 4;
66 }
67 else
68 {
69 this.pos.SetFloor(this.pos.matFloor.id, 4);
70 }
71 this.owner.elements.ModExp(286, 30, false);
72 this.owner.stamina.Mod(-1);
73 };
74 }
75
76 // Token: 0x060010F8 RID: 4344 RVA: 0x00075E34 File Offset: 0x00074034
77 public override HitResult GetHitResult()
78 {
79 if (this.pos.cell.IsTopWater || this.pos.HasObj || this.pos.cell.blocked || this.pos.IsFarmField)
80 {
81 return HitResult.Invalid;
82 }
83 return HitResult.Valid;
84 }
85}