public override Item getOne() { Pickaxe result = new Pickaxe(); result.UpgradeLevel = base.UpgradeLevel; result.additionalPower.Value = additionalPower.Value; CopyEnchantments(this, result); result._GetOneFrom(this); return(result); }
public static bool Prefix(StardewValley.Tools.Pickaxe __instance, GameLocation location, int x, int y, int power, StardewValley.Farmer who) { if (__instance.upgradeLevel == 5) { int num1 = x / Game1.tileSize; int num2 = y / Game1.tileSize; Vector2 index = new Vector2((float)num1, (float)num2); StardewValley.Object @object = (StardewValley.Object)null; location.Objects.TryGetValue(index, out @object); if (@object == null) { if (who.FacingDirection == 0 || who.FacingDirection == 2) { num1 = (x - 8) / Game1.tileSize; location.Objects.TryGetValue(new Vector2((float)num1, (float)num2), out @object); if (@object == null) { num1 = (x + 8) / Game1.tileSize; location.Objects.TryGetValue(new Vector2((float)num1, (float)num2), out @object); } } else { num2 = (y + 8) / Game1.tileSize; location.Objects.TryGetValue(new Vector2((float)num1, (float)num2), out @object); if (@object == null) { num2 = (y - 8) / Game1.tileSize; location.Objects.TryGetValue(new Vector2((float)num1, (float)num2), out @object); } } x = num1 * Game1.tileSize; y = num2 * Game1.tileSize; } index = new Vector2((float)num1, (float)num2); if (@object != null) { if (@object.Name.Equals("Stone")) { @object.minutesUntilReady -= @object.minutesUntilReady; } } } return(true); }
public static Tool getToolFromDescription(byte index, int upgradeLevel) { Tool tool = null; switch (index) { case 0: tool = new Axe(); break; case 1: tool = new Hoe(); break; case 2: tool = new FishingRod(); break; case 3: tool = new Pickaxe(); break; case 4: tool = new WateringCan(); break; case 5: tool = new MeleeWeapon(0, upgradeLevel); break; case 6: tool = new Slingshot(); break; } tool.UpgradeLevel = upgradeLevel; return(tool); }