Added resource weights and layer unlock UI to the game.

This commit is contained in:
2026-05-09 13:53:00 +02:00
parent 677d8595db
commit 9fa1909dcb
7 changed files with 101 additions and 29 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ using Godot;
public partial class GameData
{
public static bool debugMode = false;
public static bool debugMode = true;
public static Random rand = new Random(seed);
public static Layer[] map;
@@ -22,6 +22,7 @@ public partial class GameData
public static Dictionary<string, Research> availableResearch = ResourceLoader.LoadResearch();
public static SurvivalState survival = new SurvivalState();
public static RobotStats robotStats = new RobotStats();
public static Dictionary<int, List<Ingredient>> gateUnlocks;
public static Color primaryColor = new Color("#276ac2");
public static Color lightColor = new Color("#7efff5");
+16
View File
@@ -90,6 +90,22 @@ public partial class ResourceLoader
return symbols;
}
public static Dictionary<string, float[]> LoadResourceWeights()
{
Dictionary<string, float[]> weights = new Dictionary<string, float[]>()
{
{ "iron_ore", [0.05f,1] },
{ "tin_ore", [0.3f,0.7f] },
{ "copper_ore", [0.3f,0.7f] },
{ "mushroom", [0.3f,0.1f] },
{ "spider_silk", [0.8f,0.4f] },
{ "coal", [1,0.3f] },
{ "water", [0.4f,0.2f] },
{ "stone", [1,0.5f] },
};
return weights;
}
public static SortedDictionary<string, ItemData> LoadItems()
{