Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.vscode/
.vs/
/*.code-workspace
.idea
.idea
.venv/
6 changes: 6 additions & 0 deletions schemas/Manual.items.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
}
}
},
"classification": {
"description": "(Optional) The classification of this item.",
"type": "string",
"enum": ["filler", "trap", "useful", "progression", "progression_skip_balancing", "trap,useful", "trap,progression", "trap,progression_skip_balancing"],
"default": "filler"
},
"progression": {
"description": "(Optional) Is this item needed to unlock locations? For more information on item classifications, see: https://github.com/ArchipelagoMW/Archipelago/blob/main/docs/world%20api.md#items",
"type": "boolean",
Expand Down
4 changes: 4 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from base64 import b64encode
from functools import reduce
import logging
import os
import json
Expand Down Expand Up @@ -270,6 +271,9 @@ def create_item(self, name: str, class_override: Optional['ItemClassification']=
else:
classification = ItemClassification.filler

if "classification" in item and item["classification"]:
classification = reduce((lambda a, b: a | b), {ItemClassification[str_classification] for str_classification in item["classification"].split(",")})

if "trap" in item and item["trap"]:
classification |= ItemClassification.trap

Expand Down
Loading