Elin Modding Docs Doc
Loading...
Searching...
No Matches
TaskDrawWater.cs
1using System;
2using System.Runtime.CompilerServices;
3
4// Token: 0x0200025A RID: 602
6{
7 // Token: 0x060010E7 RID: 4327 RVA: 0x000759A8 File Offset: 0x00073BA8
8 public override bool CanProgress()
9 {
10 return base.CanProgress() && this.pos.cell.IsTopWater && this.pot.owner.c_charges < this.pot.MaxCharge;
11 }
12
13 // Token: 0x17000489 RID: 1161
14 // (get) Token: 0x060010E8 RID: 4328 RVA: 0x000759E3 File Offset: 0x00073BE3
15 public override int destDist
16 {
17 get
18 {
19 return 1;
20 }
21 }
22
23 // Token: 0x060010E9 RID: 4329 RVA: 0x000759E6 File Offset: 0x00073BE6
24 public override bool CanManualCancel()
25 {
26 return true;
27 }
28
29 // Token: 0x1700048A RID: 1162
30 // (get) Token: 0x060010EA RID: 4330 RVA: 0x000759E9 File Offset: 0x00073BE9
31 public override bool CanPressRepeat
32 {
33 get
34 {
35 return true;
36 }
37 }
38
39 // Token: 0x1700048B RID: 1163
40 // (get) Token: 0x060010EB RID: 4331 RVA: 0x000759EC File Offset: 0x00073BEC
41 public override bool Loop
42 {
43 get
44 {
45 return this.CanProgress();
46 }
47 }
48
49 // Token: 0x1700048C RID: 1164
50 // (get) Token: 0x060010EC RID: 4332 RVA: 0x000759F4 File Offset: 0x00073BF4
51 public override CursorInfo CursorIcon
52 {
53 get
54 {
55 return CursorSystem.Hand;
56 }
57 }
58
59 // Token: 0x060010ED RID: 4333 RVA: 0x000759FC File Offset: 0x00073BFC
60 public override void OnCreateProgress(Progress_Custom p)
61 {
62 p.textHint = this.Name;
63 p.maxProgress = 6;
64 p.onProgressBegin = delegate()
65 {
66 if (this.owner.Tool != null)
67 {
68 this.owner.Say("drawWater_start", this.owner, this.owner.Tool, null, null);
69 }
70 };
71 p.onProgress = delegate(Progress_Custom _p)
72 {
73 SourceMaterial.Row row = this.pos.cell.HasBridge ? this.pos.cell.matBridge : this.pos.cell.matFloor;
74 row.PlayHitEffect(this.pos);
75 this.owner.PlaySound(row.GetSoundImpact(null), 1f, true);
76 };
77 p.onProgressComplete = delegate()
78 {
79 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));
80 this.pos.Animate(AnimeID.Dig, true);
81 this.owner.PlaySound("water", 1f, true);
82 this.pot.owner.Dye(this.pos.HasBridge ? this.pos.matBridge : this.pos.matFloor);
83 string alias = (this.pos.HasBridge ? this.pos.sourceBridge : this.pos.sourceFloor).alias;
84 if (!(alias == "floor_water_shallow"))
85 {
86 if (!(alias == "floor_water"))
87 {
88 if (!(alias == "floor_water_deep"))
89 {
90 this.<OnCreateProgress>g__ChangeFloor|11_3("floor_raw3");
91 }
92 else
93 {
94 this.<OnCreateProgress>g__ChangeFloor|11_3("floor_water");
95 }
96 }
97 else
98 {
99 this.<OnCreateProgress>g__ChangeFloor|11_3("floor_water_shallow");
100 }
101 }
102 else
103 {
104 this.<OnCreateProgress>g__ChangeFloor|11_3("floor_water_shallow2");
105 }
106 this.pot.owner.ModCharge(1, false);
107 this.owner.elements.ModExp(286, 5, false);
108 if (EClass.rnd(3) == 0)
109 {
110 this.owner.stamina.Mod(-1);
111 }
112 };
113 }
114
115 // Token: 0x060010EE RID: 4334 RVA: 0x00075A52 File Offset: 0x00073C52
116 public override HitResult GetHitResult()
117 {
118 if (!this.pos.cell.IsTopWater || this.pos.HasObj || this.pos.cell.blocked)
119 {
120 return HitResult.Invalid;
121 }
122 return HitResult.Valid;
123 }
124
125 // Token: 0x060010F3 RID: 4339 RVA: 0x00075CC0 File Offset: 0x00073EC0
126 [CompilerGenerated]
127 private void <OnCreateProgress>g__ChangeFloor|11_3(string id)
128 {
129 SourceFloor.Row row = EClass.sources.floors.alias[id];
130 if (this.pos.HasBridge)
131 {
132 this.pos.cell._bridge = (byte)row.id;
133 if (id == "floor_raw3")
134 {
135 this.pos.cell._bridgeMat = 45;
136 }
137 }
138 else
139 {
140 this.pos.cell._floor = (byte)row.id;
141 if (id == "floor_raw3")
142 {
143 this.pos.cell._floorMat = 45;
144 }
145 }
146 EClass._map.SetLiquid(this.pos.x, this.pos.z, null);
147 this.pos.RefreshNeighborTiles();
148 }
149
150 // Token: 0x04000DD1 RID: 3537
151 public TraitToolWaterPot pot;
152}