Improved recipes and added resources to it. Changed how ingredients and items work.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
using Godot;
|
||||
|
||||
public class GameResource : Ingredient
|
||||
public class GameResource
|
||||
{
|
||||
public string name;
|
||||
int currentAmount;
|
||||
int maxAmount;
|
||||
bool isEndless;
|
||||
float extractionSpeed;
|
||||
double timeSinceLastExtraction;
|
||||
ItemData item;
|
||||
|
||||
public GameResource(string name)
|
||||
{
|
||||
@@ -14,6 +17,7 @@ public class GameResource : Ingredient
|
||||
currentAmount = maxAmount;
|
||||
isEndless = false;
|
||||
extractionSpeed = 1f;
|
||||
item = GameData.availableItems[name];
|
||||
}
|
||||
|
||||
public bool Extract(double delta)
|
||||
@@ -25,6 +29,7 @@ public class GameResource : Ingredient
|
||||
if (currentAmount > 0)
|
||||
{
|
||||
currentAmount--;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user