Added final features for this release. Now only polishing (if needed) remains.
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.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
public class GameResource
|
||||
{
|
||||
private const float NormalExtractionSpeed = 1f;
|
||||
private const float EndlessExtractionSpeed = 4f;
|
||||
|
||||
public string name;
|
||||
public ItemData item;
|
||||
|
||||
@@ -15,17 +18,23 @@ public class GameResource
|
||||
maxAmount = GameData.rand.Next(1000, 10000);
|
||||
currentAmount = maxAmount;
|
||||
isEndless = false;
|
||||
extractionSpeed = 1f;
|
||||
extractionSpeed = NormalExtractionSpeed;
|
||||
item = GameData.availableItems[name];
|
||||
}
|
||||
|
||||
public static GameResource FromSaveData(ResourceSaveData saveData)
|
||||
{
|
||||
GameResource resource = new GameResource(saveData.Name);
|
||||
resource.currentAmount = saveData.CurrentAmount;
|
||||
resource.maxAmount = saveData.MaxAmount;
|
||||
resource.isEndless = saveData.IsEndless;
|
||||
resource.extractionSpeed = saveData.ExtractionSpeed;
|
||||
GameResource resource = new GameResource(saveData.Name)
|
||||
{
|
||||
currentAmount = saveData.CurrentAmount,
|
||||
maxAmount = saveData.MaxAmount,
|
||||
isEndless = saveData.IsEndless,
|
||||
extractionSpeed = saveData.ExtractionSpeed
|
||||
};
|
||||
if (resource.isEndless && resource.extractionSpeed <= NormalExtractionSpeed)
|
||||
{
|
||||
resource.extractionSpeed = EndlessExtractionSpeed;
|
||||
}
|
||||
resource.timeSinceLastExtraction = saveData.TimeSinceLastExtraction;
|
||||
return resource;
|
||||
}
|
||||
@@ -64,4 +73,20 @@ public class GameResource
|
||||
{
|
||||
return (isEndless || currentAmount > 0) && GameData.availableResearch[item.Research].state == ResearchState.RESEARCHED;
|
||||
}
|
||||
|
||||
public void MakeEndless()
|
||||
{
|
||||
isEndless = true;
|
||||
extractionSpeed = EndlessExtractionSpeed;
|
||||
}
|
||||
|
||||
public bool IsEndless()
|
||||
{
|
||||
return isEndless;
|
||||
}
|
||||
|
||||
public float GetExtractionSpeed()
|
||||
{
|
||||
return extractionSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public partial class Robot : Node3D
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (GameData.isPaused) return;
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
if (CanExecute(delta))
|
||||
@@ -155,6 +157,16 @@ public partial class Robot : Node3D
|
||||
currentMessage = "";
|
||||
}
|
||||
|
||||
public void Maintain(float amount)
|
||||
{
|
||||
maintenance = Math.Clamp(maintenance + amount, 0f, 100f);
|
||||
if (maintenance > 0f)
|
||||
{
|
||||
isBroken = false;
|
||||
}
|
||||
currentMessage = "";
|
||||
}
|
||||
|
||||
public RobotSaveData CreateSaveData()
|
||||
{
|
||||
return new RobotSaveData
|
||||
|
||||
Reference in New Issue
Block a user