8 public override bool CanProgress()
10 return base.CanProgress() && !this.pos.IsFarmField;
15 public override CursorInfo CursorIcon
19 return CursorSystem.Dig;
25 public override bool CanPressRepeat
36 p.textHint = this.Name;
37 p.maxProgress = Mathf.Max((15 +
EClass.rnd(20)) * 100 / (100 +
this.owner.Tool.material.hardness * 3), 2);
38 p.onProgressBegin = delegate()
40 if (this.owner.Tool !=
null)
42 this.owner.Say(
"till_start", this.owner, this.owner.Tool,
null,
null);
47 SourceMaterial.Row row = this.pos.cell.HasBridge ? this.pos.cell.matBridge : this.pos.cell.matFloor;
48 row.PlayHitEffect(this.pos);
49 row.AddBlood(this.pos, 1);
50 this.pos.PlaySound(row.GetSoundImpact(
null),
true, 1f,
true);
51 if (!(this.pos.HasBridge ?
this.pos.sourceBridge :
this.pos.sourceFloor).tag.Contains(
"soil"))
53 this.owner.Say(
"till_invalid",
null,
null);
58 p.onProgressComplete = delegate()
60 this.owner.PlaySound(this.pos.cell.HasBridge ?
this.pos.cell.matBridge.GetSoundDead(
this.pos.sourceBridge) :
this.pos.cell.matFloor.GetSoundDead(
this.pos.sourceFloor), 1f,
true);
61 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));
62 this.pos.Animate(AnimeID.Dig,
true);
63 if (this.pos.HasBridge)
65 this.pos.cell._bridge = 4;
69 this.pos.SetFloor(this.pos.matFloor.id, 4);
71 this.owner.elements.ModExp(286, 30,
false);
72 this.owner.stamina.Mod(-1);
77 public override HitResult GetHitResult()
79 if (this.pos.cell.IsTopWater ||
this.pos.HasObj ||
this.pos.cell.blocked ||
this.pos.IsFarmField)
81 return HitResult.Invalid;
83 return HitResult.Valid;