8 public override BaseTaskHarvest.HarvestType harvestType
18 public override int destDist
28 public override bool isBlock
38 public override int RightHand
48 public override bool destIgnoreConnection
58 public override bool ShowMapHighlightBlock
68 public override CursorInfo CursorIcon
72 return CursorSystem.Mine;
78 public override bool IsHostileAct
87 public static bool CanMine(
Point pos,
Card t)
89 if (t !=
null && pos.HasBlock && (!pos.HasObj || !pos.sourceObj.tileType.IsBlockMount))
91 if (t.HasElement(220, 1))
95 if ((pos.matBlock.category ==
"wood" || pos.matBlock.category ==
"grass") && t.HasElement(225, 1))
104 public override string GetTextSmall(
Card c)
106 if (!this.pos.cell.HasBlock)
108 return this.pos.cell.GetFloorName();
110 return this.pos.cell.GetBlockName();
116 base.SetTarget(this.owner,
null);
117 p.textHint = this.pos.cell.GetBlockName();
118 p.maxProgress = this.maxProgress;
119 p.onProgressBegin = delegate()
121 if (!
TaskMine.CanMine(
this.pos,
this.owner.Tool))
128 this.owner.Say(
"tooHardToMine", this.owner, this.pos.cell.GetBlockName(),
null);
132 if (this.owner.Tool !=
null)
134 this.owner.Say(
"mine_start", this.owner, this.owner.Tool,
null,
null);
139 this.owner.LookAt(this.pos);
140 this.owner.PlaySound(this.pos.matBlock.GetSoundImpact(
null), 1f,
true);
141 this.pos.Animate(AnimeID.HitObj,
true);
142 this.pos.matBlock.PlayHitEffect(this.pos);
143 this.pos.matBlock.AddBlood(this.pos, 1);
144 this.owner.renderer.NextFrame();
145 this.owner.elements.ModExp(220, 5,
false);
146 if (
EClass._zone.IsCrime(
this.owner,
this))
148 this.owner.pos.TryWitnessCrime(this.owner,
null, 4,
null);
154 public override void DrawMarker(
int x,
int z,
RenderParam p)
156 if (
ActionMode.Mine.IsRoofEditMode(
null) &&
this.pos.HasWallOrFence)
158 EClass.screen.guide.DrawWall(this.pos, this.Working ?
EClass.Colors.blockColors.ActiveOpacity :
EClass.Colors.blockColors.InactiveOpacity,
false, 0f);
161 base.DrawMarker(x, z, p);
165 public override HitResult GetHitResult()
169 if (this.pos.cell._roofBlock == 0)
171 return HitResult.Default;
173 return HitResult.Valid;
175 else if (this.pos.cell.HasBlock || !
this.pos.cell.isSeen)
177 if (this.pos.sourceBlock.tileType.Invisible && !
ActionMode.Mine.IsActive)
179 return HitResult.Default;
181 if (this.mode ==
TaskMine.Mode.Ramp && (
this.pos.cell.HasRamp ||
EClass._map.GetRampDir(
this.pos.x,
this.pos.z,
EClass.sources.blocks.rows[
this.ramp].tileType) == -1))
183 return HitResult.Default;
185 return HitResult.Valid;
189 if (!this.mined && !this.pos.HasObj &&
this.owner !=
null && !
this.owner.IsAgent &&
this.pos.Equals(
this.owner.pos) &&
this.pos.Installed ==
null &&
EClass._zone.CanDigUnderground)
191 return HitResult.Valid;
193 return HitResult.Default;
198 public override void OnProgressComplete()
200 string recipeID = this.pos.sourceBlock.RecipeID;
201 TaskMine.Mode mode = this.mode;
206 EClass._map.MineRamp(this.pos, (this.ramp == 3) ? this.pos.matBlock.ramp :
this.ramp,
false);
209 else if (this.pos.HasBlock ||
ActionMode.Mine.IsRoofEditMode(
null))
213 EClass.player.stats.digs++;
215 EClass._map.MineBlock(this.pos,
false, this.owner);
217 else if (this.pos.Installed ==
null)
219 EClass._zone.AddThing(
"stairsDown_cave", this.pos.x,
this.pos.z).Install();
222 if (!this.owner.IsAgent)
224 this.owner.elements.ModExp(220, 50,
false);
227 EClass._map.TrySmoothPick(this.pos,
ThingGen.Create(
"pebble", -1, -1),
this.owner);
231 EClass._map.TrySmoothPick(this.pos,
ThingGen.Create(
"stone", -1, -1),
this.owner);
233 if (
EClass._zone.IsCrime(
this.owner,
this))
235 EClass.player.ModKarma(-1);
239 this.owner.stamina.Mod(-1);
242 if (this.owner !=
null && this.owner.IsPC)
244 EClass.player.recipes.ComeUpWithRecipe(recipeID, 30);
250 public TaskMine.Mode mode;