Elin Modding Docs Doc
Loading...
Searching...
No Matches
TaskPourWater.cs
1using System;
2using System.Runtime.CompilerServices;
3
4// Token: 0x02000259 RID: 601
6{
7 // Token: 0x060010DB RID: 4315 RVA: 0x00075570 File Offset: 0x00073770
8 public override bool CanProgress()
9 {
10 return base.CanProgress() && !this.pos.HasBridge && this.pos.cell.sourceSurface.alias != "floor_water_deep" && this.pot.owner.c_charges > 0;
11 }
12
13 // Token: 0x17000486 RID: 1158
14 // (get) Token: 0x060010DC RID: 4316 RVA: 0x000755C8 File Offset: 0x000737C8
15 public override int destDist
16 {
17 get
18 {
19 return 1;
20 }
21 }
22
23 // Token: 0x060010DD RID: 4317 RVA: 0x000755CB File Offset: 0x000737CB
24 public override bool CanManualCancel()
25 {
26 return true;
27 }
28
29 // Token: 0x17000487 RID: 1159
30 // (get) Token: 0x060010DE RID: 4318 RVA: 0x000755CE File Offset: 0x000737CE
31 public override bool CanPressRepeat
32 {
33 get
34 {
35 return true;
36 }
37 }
38
39 // Token: 0x17000488 RID: 1160
40 // (get) Token: 0x060010DF RID: 4319 RVA: 0x000755D1 File Offset: 0x000737D1
41 public override bool Loop
42 {
43 get
44 {
45 return this.CanProgress();
46 }
47 }
48
49 // Token: 0x060010E0 RID: 4320 RVA: 0x000755DC File Offset: 0x000737DC
50 public override void OnCreateProgress(Progress_Custom p)
51 {
52 p.textHint = this.Name;
53 p.maxProgress = 6;
54 p.onProgressBegin = delegate()
55 {
56 if (this.owner.Tool != null)
57 {
58 this.owner.Say("pourWater_start", this.owner, this.owner.Tool, null, null);
59 }
60 };
61 p.onProgress = delegate(Progress_Custom _p)
62 {
63 (this.pos.cell.HasBridge ? this.pos.cell.matBridge : this.pos.cell.matFloor).PlayHitEffect(this.pos);
64 this.owner.PlaySound(MATERIAL.sourceWaterSea.GetSoundImpact(null), 1f, true);
65 };
66 p.onProgressComplete = delegate()
67 {
68 if (this.pot.owner.DyeMat == null)
69 {
70 this.pot.owner.Dye(MATERIAL.sourceWaterSea);
71 }
72 string alias = (this.pos.HasBridge ? this.pos.sourceBridge : this.pos.sourceFloor).alias;
73 if (!(alias == "floor_water_shallow2"))
74 {
75 if (!(alias == "floor_water_shallow"))
76 {
77 if (!(alias == "floor_water"))
78 {
79 this.<OnCreateProgress>g__ChangeFloor|9_3("floor_water_shallow2");
80 }
81 else
82 {
83 this.<OnCreateProgress>g__ChangeFloor|9_3("floor_water_deep");
84 }
85 }
86 else
87 {
88 this.<OnCreateProgress>g__ChangeFloor|9_3("floor_water");
89 }
90 }
91 else
92 {
93 this.<OnCreateProgress>g__ChangeFloor|9_3("floor_water_shallow");
94 }
95 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));
96 this.pos.Animate(AnimeID.Dig, true);
97 this.owner.PlaySound("water_farm", 1f, true);
98 this.pot.owner.ModCharge(-1, false);
99 if (this.pot.owner.c_charges <= 0)
100 {
101 this.pot.owner.Dye(EClass.sources.materials.alias["void"]);
102 }
103 this.owner.elements.ModExp(286, 5, false);
104 if (EClass.rnd(3) == 0)
105 {
106 this.owner.stamina.Mod(-1);
107 }
108 };
109 }
110
111 // Token: 0x060010E1 RID: 4321 RVA: 0x00075632 File Offset: 0x00073832
112 public override HitResult GetHitResult()
113 {
114 if (this.pos.HasBridge || this.pos.HasObj || this.pos.cell.blocked)
115 {
116 return HitResult.Invalid;
117 }
118 return HitResult.Valid;
119 }
120
121 // Token: 0x060010E6 RID: 4326 RVA: 0x000758D0 File Offset: 0x00073AD0
122 [CompilerGenerated]
123 private void <OnCreateProgress>g__ChangeFloor|9_3(string id)
124 {
125 SourceFloor.Row row = EClass.sources.floors.alias[id];
126 if (this.pos.HasBridge)
127 {
128 this.pos.cell._bridge = (byte)row.id;
129 this.pos.cell._bridgeMat = (byte)this.pot.owner.DyeMat.id;
130 }
131 else
132 {
133 this.pos.cell._floor = (byte)row.id;
134 this.pos.cell._floorMat = (byte)this.pot.owner.DyeMat.id;
135 }
136 EClass._map.SetLiquid(this.pos.x, this.pos.z, null);
137 this.pos.RefreshNeighborTiles();
138 }
139
140 // Token: 0x04000DD0 RID: 3536
141 public TraitToolWaterPot pot;
142}