Added research state to harvest and crafting

This commit is contained in:
2026-05-08 20:15:09 +02:00
parent 032836b9ec
commit 342b6e490f
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -37,6 +37,6 @@ public class GameResource
public bool CanExtract() public bool CanExtract()
{ {
return isEndless || currentAmount > 0; return (isEndless || currentAmount > 0) && GameData.availableResearch[item.Research].state == ResearchState.RESEARCHED;
} }
} }
+1
View File
@@ -67,6 +67,7 @@ public class CraftNode : ProgramNode
options.AddItem("Select item..."); options.AddItem("Select item...");
foreach (ItemData item in GameData.availableItems.Values) foreach (ItemData item in GameData.availableItems.Values)
{ {
if(GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
if (item.Inputs.Count > 0) if (item.Inputs.Count > 0)
{ {
options.AddItem(item.GetReadableName()); options.AddItem(item.GetReadableName());
+1 -1
View File
@@ -19,7 +19,7 @@ public class HarvestNode : ProgramNode
if (!tile.resource.CanExtract()) if (!tile.resource.CanExtract())
{ {
lastExecutionMessage = "Resource is depleted and not endless"; lastExecutionMessage = "Resource is depleted and not endless or you haven't unlocked it yet";
return NodeResult.SUCCESS; return NodeResult.SUCCESS;
} }