Finished first EA Version #1

Merged
Nicola merged 110 commits from dev into main 2026-05-19 20:01:13 +02:00
2 changed files with 22 additions and 8 deletions
Showing only changes of commit 5eab205a9c - Show all commits
+6 -2
View File
@@ -169,19 +169,23 @@ public partial class UIHandler : Control
{
currentLayer.Text = $"Current layer: {GameData.currentLayer}/{GameData.ruinSize}";
deepestLayer.Text = $"Deepest layer: {GameData.lowestLayer}";
unlockLayer.TooltipText = "Needed items: \r" + GameData.map[GameData.lowestLayer].DisplayGateIngredients();
unlockLayer.Disabled = !GameData.inventory.CanCraft(GameData.map[GameData.lowestLayer].gateIngredients, 1);
}
public void UnlockLayer()
{
if (GameData.inventory.CanCraft(GameData.map[GameData.lowestLayer].gateIngredients, 1))
{
foreach (Ingredient ingredient in GameData.map[GameData.lowestLayer].gateIngredients)
{
GD.Print($"{ingredient.Item} ({ingredient.Amount})");
GameData.inventory.RemoveItem(ingredient.Item, ingredient.Amount);
}
GD.Print("------------------------");
GameData.lowestLayer++;
if (GameData.lowestLayer == GameData.ruinSize)
{
GD.Print("GAME WON!");
}
}
}
}
+10
View File
@@ -264,4 +264,14 @@ public partial class Layer : Node3D
}
return result;
}
public string DisplayGateIngredients()
{
string result = "";
foreach (Ingredient ingredient in gateIngredients)
{
result += $"{ItemData.GetReadableName(ingredient.Item)} ({ingredient.Amount})\r";
}
return result;
}
}