From d15dc203007ea25d5f92c1e206290f078e9cb925 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 11 Mar 2022 17:46:35 +0900 Subject: [PATCH] crafting system wip --- assets/mods/basegame/crafting/doc.md | 39 +++++++++++++++++++ assets/mods/basegame/crafting/testrecipe.json | 9 +++++ 2 files changed, 48 insertions(+) create mode 100644 assets/mods/basegame/crafting/doc.md create mode 100644 assets/mods/basegame/crafting/testrecipe.json diff --git a/assets/mods/basegame/crafting/doc.md b/assets/mods/basegame/crafting/doc.md new file mode 100644 index 000000000..58a111118 --- /dev/null +++ b/assets/mods/basegame/crafting/doc.md @@ -0,0 +1,39 @@ +Multiple JSON files can exist under this directory. + +### Ingredient Querying Language + +An ingredient can refer one exact item or items that matches the conditions. + +To specify single exact item: + + ID IS item@basegame:1 + +To specify using tags: + + TAG HASALLOF a_tag,b_tag,c_tag OR TAG IS s_tag + TAG IS one_tag + TAG HASALLOF a_tag,b_tag + +The query can have one or more terms. The terms are always either one of: + + TERM OPERATOR TERM + TAG_LITERAL + +Since "TAG" is a valid term to operate against, said word can frequently appear for complex queries. + +#### List of Operators + +- IS : Exactly this +- HASALLOF : Has all of these +- HASSOMEOF : Has one or more of these +- HASNONEOF : Has none of these +- ISNOT : Exactly not this +- AND : Both left and right terms are truthy +- OR : One or more hands are truthy +- , : Creates an array containing two or more words separated by this operator + +#### List of Predefined Operands + +- TAG : Tags assigned to the blocks or items +- ID : Item ID + diff --git a/assets/mods/basegame/crafting/testrecipe.json b/assets/mods/basegame/crafting/testrecipe.json new file mode 100644 index 000000000..207da27ab --- /dev/null +++ b/assets/mods/basegame/crafting/testrecipe.json @@ -0,0 +1,9 @@ +{ + "basegame:176": { /* A recipe for Wooden Platform */ + "workbench": "", /* Optional workbench TAGS separated by commas (e.g. smelter, saw) */ + "ingredients": [ /* Multiple ingredients denotes alternative recipes */ + [1, "tag is WOOD"] /* This recipe only requires one Wooden Plank */ + ], + "moq": 2 /* Number of products per unit ingredients */ + } +} \ No newline at end of file