From 80bd3245e61fc6c271ff74287e05db115017f190 Mon Sep 17 00:00:00 2001 From: arannya Date: Sat, 11 May 2024 20:57:32 +0600 Subject: [PATCH] Revert "[Enhancement] Addresses recharging bots with batteries: issue #25" This reverts commit 17d15e0c991d47be1083eaab3c749cdbf6f9024f. --- Farmtronics/Bot/BotObject.cs | 15 --------------- Farmtronics/M1/M1API.cs | 10 ---------- 2 files changed, 25 deletions(-) diff --git a/Farmtronics/Bot/BotObject.cs b/Farmtronics/Bot/BotObject.cs index c1f9831..ee2ef7d 100644 --- a/Farmtronics/Bot/BotObject.cs +++ b/Farmtronics/Bot/BotObject.cs @@ -5,8 +5,6 @@ This class is a stardew valley Object subclass that represents a Bot. using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Threading; using Farmtronics.M1; using Farmtronics.Utils; using Microsoft.Xna.Framework; @@ -165,20 +163,7 @@ public override bool placementAction(GameLocation location, int x, int y, Farmer location.playSound("hammer"); return true; } - - public bool UseBattery() { - if (farmer == null || inventory == null || farmer.CurrentTool == null) - return false; - if (farmer.Items.Any(b => b is not null && b.QualifiedItemId.Equals("(O)787"))) - { - farmer.stamina = Math.Min(Farmer.startingStamina, farmer.stamina + 100); - farmer.removeFirstOfThisItemFromInventory("(O)787"); - return true; - } - return false; - } - // Apply the currently-selected item as a tool (or weapon) on // the square in front of the bot. public void UseTool() { diff --git a/Farmtronics/M1/M1API.cs b/Farmtronics/M1/M1API.cs index 5f0d227..3e1a4fc 100644 --- a/Farmtronics/M1/M1API.cs +++ b/Farmtronics/M1/M1API.cs @@ -720,16 +720,6 @@ public static ValMap MeModule() { return result ? Intrinsic.Result.True : Intrinsic.Result.False; }; meModule["harvest"] = f.GetFunc(); - - f = Intrinsic.Create(""); - f.code = (context, partialResult) => { - Shell sh = context.interpreter.hostData as Shell; - if (RequireBot(sh, "useBattery")) return Intrinsic.Result.Null; - - bool result = sh.bot.UseBattery(); - return result ? Intrinsic.Result.True : Intrinsic.Result.False; - }; - meModule["useBattery"] = f.GetFunc(); botProtectedKeys = new HashSet(); foreach (Value key in meModule.Keys) {