Finished first EA Version #1
@@ -12,7 +12,6 @@ public class Inventory
|
|||||||
Item inventoryItem = items.Find(x => x.data.Id == item.data.Id && x.currentAmount + amount <= x.data.StackSize);
|
Item inventoryItem = items.Find(x => x.data.Id == item.data.Id && x.currentAmount + amount <= x.data.StackSize);
|
||||||
if (inventoryItem != null)
|
if (inventoryItem != null)
|
||||||
{
|
{
|
||||||
GD.Print(items.IndexOf(inventoryItem) + ": " + inventoryItem.currentAmount);
|
|
||||||
inventoryItem.currentAmount += amount;
|
inventoryItem.currentAmount += amount;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ public class ExploreNode : ProgramNode
|
|||||||
DisplayText = "Explore";
|
DisplayText = "Explore";
|
||||||
}
|
}
|
||||||
public override NodeResult Execute(Robot robot, double delta)
|
public override NodeResult Execute(Robot robot, double delta)
|
||||||
{
|
{
|
||||||
if (pathPoints == null)
|
if (pathPoints == null)
|
||||||
{
|
{
|
||||||
int safetyCounter = 0;
|
int safetyCounter = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
targetPosition = new Vector3I(GameData.rand.Next(GameData.layerSize), GameData.currentLayer, GameData.rand.Next(GameData.layerSize));
|
targetPosition = new Vector3I(GameData.rand.Next(GameData.layerSize), GameData.rand.Next(GameData.lowestLayer), GameData.rand.Next(GameData.layerSize));
|
||||||
if (!GameData.map[targetPosition.Y].tiles[targetPosition.X, targetPosition.Z].wasVisited) break;
|
if (!GameData.map[targetPosition.Y].tiles[targetPosition.X, targetPosition.Z].wasVisited) break;
|
||||||
safetyCounter++;
|
safetyCounter++;
|
||||||
if (safetyCounter > Math.Pow(GameData.layerSize, 2) * 2)
|
if (safetyCounter > Math.Pow(GameData.layerSize, 2) * 2)
|
||||||
@@ -33,7 +33,7 @@ public class ExploreNode : ProgramNode
|
|||||||
|
|
||||||
if (pathPoints.Count <= 0)
|
if (pathPoints.Count <= 0)
|
||||||
{
|
{
|
||||||
lastExecutionMessage = "No path available";
|
lastExecutionMessage = $"No path available {targetPosition}";
|
||||||
return NodeResult.FAILURE;
|
return NodeResult.FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public partial class GameData
|
|||||||
public static int currentLayer = 0;
|
public static int currentLayer = 0;
|
||||||
//The layer that is currently visible
|
//The layer that is currently visible
|
||||||
public static int visibleLayer = 0;
|
public static int visibleLayer = 0;
|
||||||
|
public static int lowestLayer = 0;
|
||||||
//Determines if the player can move the camera or not (Necessary for input and options menu)
|
//Determines if the player can move the camera or not (Necessary for input and options menu)
|
||||||
public static bool canMove = true;
|
public static bool canMove = true;
|
||||||
public static int maxRobotCount = 1000;
|
public static int maxRobotCount = 1000;
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ public partial class ResearchList : PanelContainer
|
|||||||
{
|
{
|
||||||
foreach (Research research in GameData.availableResearch.Values)
|
foreach (Research research in GameData.availableResearch.Values)
|
||||||
{
|
{
|
||||||
GD.Print(research.state);
|
|
||||||
GraphNode node = CreateResearchNode(
|
GraphNode node = CreateResearchNode(
|
||||||
research.data.Id,
|
research.data.Id,
|
||||||
research.data.Texture,
|
research.data.Texture,
|
||||||
|
|||||||
@@ -144,5 +144,6 @@ public partial class Tile
|
|||||||
{
|
{
|
||||||
wasVisited = true;
|
wasVisited = true;
|
||||||
OnTileVisited?.Invoke(this, EventArgs.Empty);
|
OnTileVisited?.Invoke(this, EventArgs.Empty);
|
||||||
|
ContentNode.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ public partial class World : Node3D
|
|||||||
|
|
||||||
HandleRenderData(BuildRenderData(0));
|
HandleRenderData(BuildRenderData(0));
|
||||||
|
|
||||||
//TODO: Remove for live build -> DEBUG ONLY
|
|
||||||
|
|
||||||
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
|
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
|
||||||
robot.Name = $"Robot #{robots.Count + 1}";
|
robot.Name = "Bob";
|
||||||
robot.Position = map[0].tiles[0, 0].Position;
|
robot.Position = map[0].tiles[0, 0].Position;
|
||||||
AddChild(robot);
|
AddChild(robot);
|
||||||
robots.Add(robot);
|
robots.Add(robot);
|
||||||
|
|||||||
Reference in New Issue
Block a user