Working on inventory and crafting system. Translated Excel-Itemlist to .json.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
using Godot;
|
||||
|
||||
public class GameResource
|
||||
public class GameResource : Ingredient
|
||||
{
|
||||
int maxAmount;
|
||||
int currentAmount;
|
||||
bool isEndless;
|
||||
float extractionSpeed;
|
||||
public string name;
|
||||
double timeSinceLastExtraction;
|
||||
|
||||
public GameResource(string name)
|
||||
{
|
||||
@@ -17,8 +16,11 @@ public class GameResource
|
||||
extractionSpeed = 1f;
|
||||
}
|
||||
|
||||
public bool Extract()
|
||||
public bool Extract(double delta)
|
||||
{
|
||||
timeSinceLastExtraction += delta;
|
||||
if (timeSinceLastExtraction < extractionSpeed) return false;
|
||||
timeSinceLastExtraction = 0;
|
||||
if(isEndless) return true;
|
||||
if (currentAmount > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user