8170b700b2
Features: Sacrifice-Node, Maintain-Node, Options for screen type, lightcolor and soundvolume, tied in sound effects, game pause when menu is open, visibly open up gate when opening it.
92 lines
2.7 KiB
C#
92 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Godot;
|
|
|
|
public partial class GameData
|
|
{
|
|
public static bool debugMode = false;
|
|
public static Random rand = new Random(seed);
|
|
public static Layer[] map;
|
|
|
|
public static int currentLayer = 0;
|
|
public static int visibleLayer = 0;
|
|
public static int lowestLayer = 0;
|
|
|
|
public static bool canMove = true;
|
|
public static int maxRobotCount = 10;
|
|
public static List<Robot> robots = new List<Robot>();
|
|
public static float robotSpeed = 10f;
|
|
public static float tileWidth = 6;
|
|
public static float tileHeight = 4;
|
|
public static Dictionary<string, Research> availableResearch = ResourceLoader.LoadResearch();
|
|
public static SortedDictionary<string, ItemData> availableItems = ResourceLoader.LoadItems();
|
|
public static SurvivalState survival = new SurvivalState();
|
|
public static RobotStats robotStats = new RobotStats();
|
|
public static Dictionary<int, List<Ingredient>> gateUnlocks;
|
|
public static bool loadSaveOnStart = false;
|
|
public static bool showTutorial = true;
|
|
public static bool isPaused = false;
|
|
|
|
public static Color primaryColor = new Color("#276ac2");
|
|
public static Color lightColor = new Color("#7efff5");
|
|
public static int screenMode = 2;
|
|
public static float soundVolume = 0.8f;
|
|
|
|
public static int ruinSize = 10;
|
|
public static int layerSize = 20;
|
|
public static int seed = 12345;
|
|
|
|
public static Inventory inventory = new Inventory();
|
|
|
|
public static void ResetRunState()
|
|
{
|
|
ruinSize = 10;
|
|
layerSize = 20;
|
|
rand = new Random(seed);
|
|
survival = new SurvivalState();
|
|
robotStats = new RobotStats();
|
|
inventory = new Inventory();
|
|
availableResearch = ResourceLoader.LoadResearch();
|
|
map = null;
|
|
robots.Clear();
|
|
currentLayer = 0;
|
|
visibleLayer = 0;
|
|
lowestLayer = 0;
|
|
maxRobotCount = 10;
|
|
canMove = true;
|
|
isPaused = false;
|
|
}
|
|
|
|
public static void RebuildRobotStatsFromResearch()
|
|
{
|
|
robotStats = new RobotStats();
|
|
maxRobotCount = 10;
|
|
|
|
foreach (Research research in availableResearch.Values)
|
|
{
|
|
if (research.state == ResearchState.RESEARCHED)
|
|
{
|
|
robotStats.Apply(research.data.Effects);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static bool HasSpawnableRobotInInventory()
|
|
{
|
|
foreach (Item item in inventory.items)
|
|
{
|
|
if (robotStats.RobotTypes.ContainsKey(item.data.Id) && item.currentAmount > 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public static bool HasNoRobotRecovery()
|
|
{
|
|
return robots.Count <= 0 && !HasSpawnableRobotInInventory();
|
|
}
|
|
}
|