Skip to content

Commit

Permalink
Revert "[Enhancement] Addresses recharging bots with batteries: issue J…
Browse files Browse the repository at this point in the history
…oeStrout#25"

This reverts commit 17d15e0.
  • Loading branch information
arannya committed May 11, 2024
1 parent ea72b7f commit 80bd324
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
15 changes: 0 additions & 15 deletions Farmtronics/Bot/BotObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
10 changes: 0 additions & 10 deletions Farmtronics/M1/M1API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>();
foreach (Value key in meModule.Keys) {
Expand Down

0 comments on commit 80bd324

Please # to comment.