mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
crafting system wip
This commit is contained in:
39
assets/mods/basegame/crafting/doc.md
Normal file
39
assets/mods/basegame/crafting/doc.md
Normal file
@@ -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
|
||||||
|
|
||||||
9
assets/mods/basegame/crafting/testrecipe.json
Normal file
9
assets/mods/basegame/crafting/testrecipe.json
Normal file
@@ -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 */
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user