Hotfix for some DSL bugs (For node not working, Exploration not taking next layers into account)

This commit is contained in:
2026-05-19 20:59:15 +02:00
parent dc3912fa70
commit 121cc1eb03
8 changed files with 11 additions and 5 deletions
+1 -2
View File
@@ -41,14 +41,13 @@ public class ExploreNode : ProgramNode
private bool TrySelectTarget()
{
int safetyCounter = 0;
int layerRange = Math.Max(GameData.lowestLayer, 1);
int maximumAttempts = (int)Math.Pow(GameData.layerSize, 2) * 2;
while (safetyCounter <= maximumAttempts)
{
targetPosition = new Vector3I(
GameData.rand.Next(GameData.layerSize),
GameData.rand.Next(layerRange),
GameData.rand.Next(GameData.lowestLayer + 1),
GameData.rand.Next(GameData.layerSize)
);
if (!GameData.map[targetPosition.Y].tiles[targetPosition.X, targetPosition.Z].wasVisited)
+2 -2
View File
@@ -14,12 +14,12 @@ public class ForNode : ProgramNode
public override NodeResult Execute(Robot robot, double delta)
{
bool isConditionFulfilled = DetermineCondition();
amountExecuted++;
if (isConditionFulfilled)
{
amountExecuted = 0;
}
return isConditionFulfilled ? NodeResult.SUCCESS : NodeResult.CONDITIONFALSE;
amountExecuted++;
return isConditionFulfilled ? NodeResult.CONDITIONFALSE : NodeResult.SUCCESS;
}
private bool DetermineCondition()
+1 -1
View File
@@ -24,7 +24,7 @@ public class SurvivalState
public void Update(double delta)
{
if (isDead) return;
if (isDead || GameData.debugMode) return;
elapsedSeconds += delta;
float drainModifier = IsInGracePeriod() ? 0.35f : 1f;
+1
View File
@@ -39,6 +39,7 @@ public partial class CodingWindow : PanelContainer
if (focused is LineEdit || focused is TextEdit) return;
if (selectedNode == null) return;
if (selectedNode == highlightedNode) highlightedNode = null;
editorWindow.RemoveChild(selectedNode);
selectedNode.QueueFree();
}
+1
View File
@@ -49,6 +49,7 @@ public partial class TutorialBubble : PanelContainer
"The inventory (Default: [I]) stores everything your robots collect. Gates and research both consume items from it.",
"Each gate blocks the next layer. When you have the required items, use Open Gate in the top bar.",
"The required ingredients can be found by hovering over the Open Gate button.",
"You can swap between layers using the [Q] (up one layer) and [E] (down one layer) keys.",
"The map (Default: [M]) shows what your robots have discovered. Exploration matters because resources are hidden in the ruin.",
"Deeper layers contain more advanced resources. Unlocking the gate at the lowest point allows you to leave the ruin.",
"Be careful: resources are not endless at the beginning. Converting a robot to a drill unit with Sacrifice makes them endless.",
+5
View File
@@ -270,6 +270,11 @@ public partial class Map : PanelContainer
tooltipText += GetRobotTooltip(robotsOnTile, tooltipText.Length > 0);
}
if (tile.collapsedMesh == "gate" && tile.wasVisited)
{
tileTexture = AddBorder(tileTexture, Colors.Red, RobotBorderWidth);
}
texture.Texture = tileTexture;
texture.TooltipText = tooltipText;
}