Add MVP resource tool rules
This commit is contained in:
@@ -33,6 +33,9 @@ BLUEPRINTS = [
|
||||
"yield_item_definition": WOOD_ITEM_PATH,
|
||||
"remaining_harvests": 16,
|
||||
"quantity_per_harvest": 2,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 900.0,
|
||||
"max_harvests": 16,
|
||||
@@ -48,6 +51,9 @@ BLUEPRINTS = [
|
||||
"yield_item_definition": FIBER_ITEM_PATH,
|
||||
"remaining_harvests": 10,
|
||||
"quantity_per_harvest": 3,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 600.0,
|
||||
"max_harvests": 10,
|
||||
@@ -63,6 +69,9 @@ BLUEPRINTS = [
|
||||
"yield_item_definition": STONE_ITEM_PATH,
|
||||
"remaining_harvests": 12,
|
||||
"quantity_per_harvest": 2,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": False,
|
||||
"respawn_delay_seconds": 1800.0,
|
||||
"max_harvests": 12,
|
||||
@@ -78,6 +87,8 @@ BLUEPRINTS = [
|
||||
"yield_item_definition": FOOD_ITEM_PATH,
|
||||
"remaining_harvests": 8,
|
||||
"quantity_per_harvest": 1,
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 0,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 1200.0,
|
||||
"max_harvests": 8,
|
||||
|
||||
@@ -6,6 +6,9 @@ EXPECTED = {
|
||||
"properties": {
|
||||
"remaining_harvests": 16,
|
||||
"quantity_per_harvest": 2,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 900.0,
|
||||
"max_harvests": 16,
|
||||
@@ -16,6 +19,9 @@ EXPECTED = {
|
||||
"properties": {
|
||||
"remaining_harvests": 10,
|
||||
"quantity_per_harvest": 3,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 600.0,
|
||||
"max_harvests": 10,
|
||||
@@ -26,6 +32,9 @@ EXPECTED = {
|
||||
"properties": {
|
||||
"remaining_harvests": 12,
|
||||
"quantity_per_harvest": 2,
|
||||
"required_tool_item_id": "basic_tool",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 1,
|
||||
"respawns_for_mvp": False,
|
||||
"respawn_delay_seconds": 1800.0,
|
||||
"max_harvests": 12,
|
||||
@@ -36,6 +45,9 @@ EXPECTED = {
|
||||
"properties": {
|
||||
"remaining_harvests": 8,
|
||||
"quantity_per_harvest": 1,
|
||||
"required_tool_item_id": "None",
|
||||
"allow_bare_hand_gathering": True,
|
||||
"tool_quantity_bonus": 0,
|
||||
"respawns_for_mvp": True,
|
||||
"respawn_delay_seconds": 1200.0,
|
||||
"max_harvests": 8,
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
FILES = {
|
||||
"AgrarianResourceNode.h": ROOT / "Source" / "AgrarianGame" / "AgrarianResourceNode.h",
|
||||
"AgrarianResourceNode.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianResourceNode.cpp",
|
||||
"setup_playable_blueprints.py": ROOT / "Scripts" / "setup_playable_blueprints.py",
|
||||
"verify_playable_blueprints.py": ROOT / "Scripts" / "verify_playable_blueprints.py",
|
||||
"TechnicalDesignDocument.md": ROOT / "Docs" / "TechnicalDesignDocument.md",
|
||||
"GroundZeroResourcePass.md": ROOT / "Docs" / "Terrain" / "GroundZeroResourcePass.md",
|
||||
"Roadmap": ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md",
|
||||
}
|
||||
|
||||
REQUIRED_SNIPPETS = {
|
||||
"AgrarianResourceNode.h": [
|
||||
"FName RequiredToolItemId;",
|
||||
"bool bAllowBareHandGathering = true;",
|
||||
"int32 ToolQuantityBonus = 0;",
|
||||
"bool HasRequiredTool",
|
||||
"int32 GetHarvestQuantityFor",
|
||||
],
|
||||
"AgrarianResourceNode.cpp": [
|
||||
"Gather by hand",
|
||||
"RequiredToolItemId == NAME_None || bAllowBareHandGathering || HasRequiredTool(Interactor)",
|
||||
"Inventory->HasItem(RequiredToolItemId, 1)",
|
||||
"QuantityPerHarvest + ToolBonus",
|
||||
"MakeYieldStack(Interactor)",
|
||||
],
|
||||
"setup_playable_blueprints.py": [
|
||||
'"required_tool_item_id": "basic_tool"',
|
||||
'"allow_bare_hand_gathering": True',
|
||||
'"tool_quantity_bonus": 1',
|
||||
'"tool_quantity_bonus": 0',
|
||||
],
|
||||
"verify_playable_blueprints.py": [
|
||||
'"required_tool_item_id": "basic_tool"',
|
||||
'"allow_bare_hand_gathering": True',
|
||||
'"tool_quantity_bonus": 1',
|
||||
'"required_tool_item_id": "None"',
|
||||
],
|
||||
"TechnicalDesignDocument.md": [
|
||||
"Tool requirement rules remain inventory-based",
|
||||
"`basic_tool` in inventory",
|
||||
],
|
||||
"GroundZeroResourcePass.md": [
|
||||
"Wood, fiber, and stone nodes declare `basic_tool`",
|
||||
"Edible plant nodes remain pure bare-hand gathering",
|
||||
],
|
||||
"Roadmap": [
|
||||
"[x] Add tool requirement rules.",
|
||||
"basic tool in\n inventory improves yields",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
missing = []
|
||||
for label, path in FILES.items():
|
||||
text = path.read_text(encoding="utf-8")
|
||||
for snippet in REQUIRED_SNIPPETS[label]:
|
||||
if snippet not in text:
|
||||
missing.append(f"{label}: missing {snippet!r}")
|
||||
|
||||
if missing:
|
||||
raise SystemExit("Resource tool requirement verification failed:\n" + "\n".join(missing))
|
||||
|
||||
print(
|
||||
"PASS: MVP resource tool requirement rules are inventory-based, "
|
||||
"preserve bare-hand gathering, and add basic-tool yield bonuses."
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user