mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
FF1 - classify some items as useful (#669)
This commit is contained in:
@@ -9,8 +9,7 @@ class ItemData(NamedTuple):
|
||||
name: str
|
||||
code: int
|
||||
item_type: str
|
||||
progression: bool
|
||||
|
||||
classification: ItemClassification
|
||||
|
||||
FF1_BRIDGE = 'Bridge'
|
||||
|
||||
@@ -27,6 +26,11 @@ FF1_PROGRESSION_LIST = [
|
||||
"EarthOrb", "FireOrb", "WaterOrb", "AirOrb"
|
||||
]
|
||||
|
||||
FF1_USEFUL_LIST = [
|
||||
"Tail", "Masamune", "Xcalber", "Katana", "Vorpal",
|
||||
"DragonArmor", "Opal", "AegisShield", "Ribbon"
|
||||
]
|
||||
|
||||
|
||||
class FF1Items:
|
||||
_item_table: List[ItemData] = []
|
||||
@@ -38,8 +42,9 @@ class FF1Items:
|
||||
with open(file_path) as file:
|
||||
items = json.load(file)
|
||||
# Hardcode progression and categories for now
|
||||
self._item_table = [ItemData(name, code, "FF1Item", name in FF1_PROGRESSION_LIST)
|
||||
for name, code in items.items()]
|
||||
self._item_table = [ItemData(name, code, "FF1Item", ItemClassification.progression if name in
|
||||
FF1_PROGRESSION_LIST else ItemClassification.useful if name in FF1_USEFUL_LIST else
|
||||
ItemClassification.filler) for name, code in items.items()]
|
||||
self._item_table_lookup = {item.name: item for item in self._item_table}
|
||||
|
||||
def _get_item_table(self) -> List[ItemData]:
|
||||
@@ -62,7 +67,7 @@ class FF1Items:
|
||||
|
||||
def generate_item(self, name: str, player: int) -> Item:
|
||||
item = self._get_item_table_lookup().get(name)
|
||||
return Item(name, ItemClassification.progression if item.progression else ItemClassification.filler,
|
||||
return Item(name, item.classification,
|
||||
item.code, player)
|
||||
|
||||
def get_item_name_to_code_dict(self) -> Dict[str, int]:
|
||||
|
Reference in New Issue
Block a user