diff --git a/GeneralMods/StardustCore/DataNodes/PlacementNode.cs b/GeneralMods/StardustCore/DataNodes/PlacementNode.cs
new file mode 100644
index 00000000..0968812a
--- /dev/null
+++ b/GeneralMods/StardustCore/DataNodes/PlacementNode.cs
@@ -0,0 +1,25 @@
+using StardewValley;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StardustCore.DataNodes
+{
+ public class PlacementNode
+ {
+ public CoreObject cObj;
+ public GameLocation location;
+ public int x;
+ public int y;
+
+ public PlacementNode(CoreObject C, GameLocation Location, int X, int Y) {
+ cObj = C;
+ location = Location;
+ x = X;
+ y = Y;
+ }
+
+ }
+}
diff --git a/GeneralMods/StardustCore/ModCore.cs b/GeneralMods/StardustCore/ModCore.cs
index 0fe1ccd3..8c9509f7 100644
--- a/GeneralMods/StardustCore/ModCore.cs
+++ b/GeneralMods/StardustCore/ModCore.cs
@@ -36,6 +36,7 @@ namespace StardustCore
StardewModdingAPI.Events.SaveEvents.BeforeSave += SaveEvents_BeforeSave;
StardewModdingAPI.Events.SaveEvents.AfterLoad += SaveEvents_AfterLoad;
+
IlluminateFramework.Colors.initializeColors();
}
diff --git a/GeneralMods/StardustCore/Serialization/Serialization.cs b/GeneralMods/StardustCore/Serialization/Serialization.cs
index c0dfe13c..0f74b34a 100644
--- a/GeneralMods/StardustCore/Serialization/Serialization.cs
+++ b/GeneralMods/StardustCore/Serialization/Serialization.cs
@@ -700,5 +700,16 @@ namespace StardustCore.Serialization
return new Microsoft.Xna.Framework.Rectangle(Convert.ToInt32(parsed[2]), Convert.ToInt32(parsed[4]), Convert.ToInt32(parsed[6]), Convert.ToInt32(parsed[8]));
}
+ public void removeObjectWithCopy(CoreObject c)
+ {
+ foreach(var v in StardustCore.ModCore.SerializationManager.trackedObjectList)
+ {
+ if(c.tileLocation==v.tileLocation && c.thisLocation == v.thisLocation)
+ {
+ StardustCore.ModCore.SerializationManager.trackedObjectList.Remove(v);
+ }
+ }
+ }
+
}
}
diff --git a/GeneralMods/StardustCore/StardustCore.csproj b/GeneralMods/StardustCore/StardustCore.csproj
index 9b44ed11..303c8f95 100644
--- a/GeneralMods/StardustCore/StardustCore.csproj
+++ b/GeneralMods/StardustCore/StardustCore.csproj
@@ -44,6 +44,7 @@
+
diff --git a/GeneralMods/StardustCore/Utilities.cs b/GeneralMods/StardustCore/Utilities.cs
index d76aea91..94f688f0 100644
--- a/GeneralMods/StardustCore/Utilities.cs
+++ b/GeneralMods/StardustCore/Utilities.cs
@@ -8,6 +8,7 @@ using StardewValley.Objects;
using StardewValley.TerrainFeatures;
using StardewValley.Tools;
using StardustCore;
+using StardustCore.DataNodes;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -17,13 +18,19 @@ using xTile.Dimensions;
namespace StardustCore
{
+
+
public class Utilities
{
+
+
+
public static int sellToStorePrice(CoreObject c)
{
return (int)((double)c.price * (1.0 + (double)c.quality * 0.25));
}
+
public static void createObjectDebris(Item I, int xTileOrigin, int yTileOrigin, int xTileTarget, int yTileTarget, int groundLevel = -1, int itemQuality = 0, float velocityMultiplyer = 1f, GameLocation location = null)
{
Debris debris = new Debris(I, new Vector2(xTileOrigin, yTileOrigin), new Vector2(xTileTarget, yTileTarget))
diff --git a/StarAI/StarAI/StarAI/Commands.cs b/StarAI/StarAI/StarAI/Commands.cs
index 70867f01..2aa180ee 100644
--- a/StarAI/StarAI/StarAI/Commands.cs
+++ b/StarAI/StarAI/StarAI/Commands.cs
@@ -25,6 +25,7 @@ namespace StarAI
//ModCore.CoreHelper.ConsoleCommands.Add("execute", "Run tasks", new Action(Commands.runTasks));
ModCore.CoreHelper.ConsoleCommands.Add("runTasks", "Run tasks", new Action(Commands.runTasks));
ModCore.CoreHelper.ConsoleCommands.Add("Water", "Water the crops", new Action(Commands.waterCrops));
+ ModCore.CoreHelper.ConsoleCommands.Add("Harvest", "Harvest the crops", new Action(Commands.harvestCrops));
pathfind("Initialize Delay 0", new string[] {
"setDelay",
@@ -34,6 +35,8 @@ namespace StarAI
public static void runTasks(string s, string[] args)
{
+ ExecutionCore.TaskList.runTaskList();
+ /*
ModCore.CoreMonitor.Log("EXECUTE TASKS");
PathFindingLogic.source = null;
PathFindingLogic.currentGoal = null;
@@ -77,6 +80,7 @@ namespace StarAI
return;
}
+ */
}
@@ -86,6 +90,11 @@ namespace StarAI
PathFindingCore.CropLogic.CropLogic.getAllCropsNeededToBeWatered();
}
+ public static void harvestCrops(string s,string[] args)
+ {
+ PathFindingCore.CropLogic.CropLogic.getAllCropsNeededToBeHarvested();
+ }
+
///
/// 1.Set start position
/// 2.set goal
@@ -297,34 +306,7 @@ namespace StarAI
ModCore.CoreMonitor.Log("NO VALID START SET FOR PATH FINDING!", LogLevel.Error);
}
- if (ModCore.fun.Status == TaskStatus.Running)
- {
- ModCore.CoreMonitor.Log("TASK IS RUNNING CAN'T PATHFIND AT THE MOMENT", LogLevel.Alert);
- return;
- }
- if (ModCore.fun.Status == TaskStatus.RanToCompletion)
- {
-
- ModCore.CoreMonitor.Log("TASK IS Finished PATHFINDING", LogLevel.Warn);
- ModCore.fun = new Task(new Action(PathFindingLogic.pathFindToAllGoals));
- // return;
- }
-
- if (ModCore.fun.Status == TaskStatus.Created)
- {
- ModCore.CoreMonitor.Log("CREATE AND RUN A TASK!!! PATHFINDING!");
- ModCore.fun = new Task(new Action(PathFindingLogic.pathFindToAllGoals));
-
- ModCore.fun.Start();
- return;
- }
- ModCore.CoreMonitor.Log(ModCore.fun.Status.ToString());
- if (ModCore.fun.Status == TaskStatus.Faulted)
- {
- ModCore.CoreMonitor.Log(ModCore.fun.Exception.ToString());
- ModCore.CoreMonitor.Log("CREATE AND RUN A TASK!!! PATHFINDING!");
- ModCore.fun = new Task(new Action(PathFindingLogic.pathFindToAllGoals));
- }
+ PathFindingLogic.pathFindToAllGoals();
}
#endregion
@@ -352,7 +334,8 @@ namespace StarAI
obj[1] = PathFindingLogic.currentGoal;
PathFindingLogic.queue = new List();
obj[2] = PathFindingLogic.queue;
- ExecutionCore.TaskList.taskList.Add(new Task(new Action
+
+