Elin Modding Docs Doc
Loading...
Searching...
No Matches
TaskCut.cs
1using System;
2
3// Token: 0x0200025C RID: 604
4public class TaskCut : TaskDesignation
5{
6 // Token: 0x1700048F RID: 1167
7 // (get) Token: 0x060010FD RID: 4349 RVA: 0x000760CF File Offset: 0x000742CF
8 public override CursorInfo CursorIcon
9 {
10 get
11 {
12 return CursorSystem.IconCut;
13 }
14 }
15
16 // Token: 0x17000490 RID: 1168
17 // (get) Token: 0x060010FE RID: 4350 RVA: 0x000760D6 File Offset: 0x000742D6
18 public override int destDist
19 {
20 get
21 {
22 return 1;
23 }
24 }
25
26 // Token: 0x060010FF RID: 4351 RVA: 0x000760D9 File Offset: 0x000742D9
27 public override void OnStart()
28 {
29 if (this.pos.cell.CanMakeStraw())
30 {
31 this.owner.ShowEmo(Emo.straw, 0f, true);
32 return;
33 }
34 this.owner.ShowEmo(Emo.cut, 0f, true);
35 }
36
37 // Token: 0x06001100 RID: 4352 RVA: 0x00076114 File Offset: 0x00074314
38 public override HitResult GetHitResult()
39 {
40 if (this.pos.HasObj && !this.pos.HasMinableBlock)
41 {
42 return HitResult.Valid;
43 }
44 if (this.pos.HasDecal && EClass.debug.godBuild && BuildMenu.Instance)
45 {
46 return HitResult.Valid;
47 }
48 return HitResult.Default;
49 }
50
51 // Token: 0x06001101 RID: 4353 RVA: 0x00076165 File Offset: 0x00074365
52 public override void OnCreateProgress(Progress_Custom p)
53 {
54 p.maxProgress = this.pos.cell.sourceObj.hp / 10 + 1;
55 }
56
57 // Token: 0x06001102 RID: 4354 RVA: 0x00076188 File Offset: 0x00074388
58 public override void OnProgress()
59 {
60 SourceObj.Row sourceObj = this.pos.cell.sourceObj;
61 if (this.pos.cell.CanMakeStraw())
62 {
63 this.owner.SetTempHand(1006, -1);
64 }
65 else if (this.pos.cell.matObj.UseAxe)
66 {
67 this.owner.SetTempHand(1100, -1);
68 }
69 else if (this.pos.cell.matObj.UsePick)
70 {
71 this.owner.SetTempHand(1004, -1);
72 }
73 else
74 {
75 this.owner.SetTempHand(1000, -1);
76 }
77 this.owner.LookAt(this.pos);
78 this.pos.PlaySound(this.pos.cell.matObj.GetSoundImpact(null), true, 1f, true);
79 this.pos.cell.matObj.PlayHitEffect(this.pos);
80 this.pos.cell.matObj.AddBlood(this.pos, 1);
81 this.pos.Animate(AnimeID.HitObj, false);
82 if (this.IsToolValid() && EClass.setting.toolConsumeHP)
83 {
84 Act.TOOL.DamageHP(1, AttackSource.None, null);
85 }
86 }
87
88 // Token: 0x06001103 RID: 4355 RVA: 0x000762D0 File Offset: 0x000744D0
89 public override void OnProgressComplete()
90 {
91 string text = this.pos.sourceObj.reqHarvest[0];
92 EClass._map.MineObj(this.pos, null, null);
93 EClass._map.SetDecal(this.pos.x, this.pos.z, 0, 1, true);
94 }
95}
Definition Act.2.cs:7