8 public override BaseTaskHarvest.HarvestType harvestType
18 public override int RightHand
28 public override bool IsHostileAct
38 public override bool LocalAct
48 public override int destDist
52 if (
EClass._zone.IsSkyLevel)
56 if (!
EClass._zone.IsRegion)
66 public override bool destIgnoreConnection
76 public override CursorInfo CursorIcon
80 return CursorSystem.Dig;
85 public override string GetTextSmall(
Card c)
87 if (!this.pos.cell.HasBridge)
89 return this.pos.cell.GetFloorName();
91 return this.pos.cell.GetBridgeName();
97 base.SetTarget(this.owner,
null);
98 p.textHint = this.pos.cell.GetFloorName();
99 p.maxProgress = this.maxProgress;
100 p.onProgressBegin = delegate()
104 this.owner.Say(
"tooHardToDig", this.owner, this.pos.cell.HasBridge ?
this.pos.cell.GetBridgeName() :
this.pos.cell.GetFloorName(),
null);
108 if (this.owner.Tool !=
null)
110 this.owner.Say(
"dig_start", this.owner, this.owner.Tool,
null,
null);
115 SourceMaterial.Row row = this.pos.cell.HasBridge ? this.pos.cell.matBridge : this.pos.cell.matFloor;
116 this.owner.PlaySound(row.GetSoundImpact(
null), 1f,
true);
117 row.PlayHitEffect(this.pos);
118 row.AddBlood(this.pos, 1);
119 this.owner.elements.ModExp(230, 5,
false);
120 this.owner.renderer.NextFrame();
121 if (
EClass._zone.IsCrime(
this.owner,
this))
123 this.owner.pos.TryWitnessCrime(this.owner,
null, 4,
null);
129 public override HitResult GetHitResult()
131 if (
EClass._zone.IsRegion &&
this.GetTreasureMap() !=
null)
133 return HitResult.Valid;
135 if (this.mode ==
TaskDig.Mode.RemoveFloor)
137 if (
EClass._zone.IsRegion)
139 if (this.pos.matFloor.category ==
"soil")
141 return HitResult.Valid;
143 return HitResult.Default;
147 if (
EClass._zone.IsSkyLevel && (
this.pos.Installed !=
null ||
this.pos.Charas.Count >= 2 || (
this.pos.HasChara &&
this.pos.FirstChara !=
EClass.pc)))
149 return HitResult.Invalid;
151 if (this.pos.IsWater ||
this.pos.HasObj || (!
EClass._zone.IsPCFaction &&
this.pos.HasBlock))
153 return HitResult.Invalid;
155 if (!this.pos.HasBridge &&
this.pos.sourceFloor.id == 40)
157 return HitResult.Invalid;
159 return HitResult.Valid;
164 if (!this.pos.HasBridge)
166 return HitResult.Default;
170 return HitResult.Warning;
172 return HitResult.Valid;
177 public Thing GetTreasureMap()
182 if (this.pos.Equals(traitScrollMapTreasure.GetDest(
true)))
191 public override void OnProgressComplete()
193 string idRecipe = this.pos.HasBridge ? this.pos.sourceBridge.RecipeID : this.pos.sourceFloor.RecipeID;
194 if (
EClass._zone.IsRegion)
196 Thing map = this.GetTreasureMap();
197 if (map !=
null ||
EClass.debug.enable)
203 SE.Play(
"ding_skill");
204 Msg.Say(
"digTreasure");
205 Rand.UseSeed(map.refVal, delegate
207 Thing thing = ThingGen.CreateTreasure(
"chest_treasure", map.LV, TreasureType.Map);
208 EClass._zone.AddCard(thing, EClass.pc.pos);
209 ThingGen.TryLickChest(thing);
212 EClass.player.willAutoSave =
true;
219 EClass._map.SetBridge(this.pos.x,
this.pos.z, 0, 0, 0, 0);
222 EClass._map.MineFloor(this.pos, this.owner,
false,
true);
225 EClass._map.MineFloor(this.pos, this.owner,
false,
true);
226 this.pos.Animate(AnimeID.Dig,
true);
227 this.owner.elements.ModExp(230, 30,
false);
230 if (
EClass._zone.IsCrime(
this.owner,
this))
232 EClass.player.ModKarma(-1);
236 this.owner.stamina.Mod(-1);
238 if (this.owner ==
null)
244 EClass.player.recipes.ComeUpWithRecipe(idRecipe, 30);
246 if (this.owner.IsPC &&
this.owner.IsAliveInCurrentZone &&
EClass._zone.IsSkyLevel &&
this.owner.pos.IsSky)
253 public TaskDig.Mode mode;