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
8 changes: 8 additions & 0 deletions worlds/ff6wc/item_rewards.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections.abc import Mapping
from functools import cache
from random import Random

from BaseClasses import ItemClassification, Location
Expand Down Expand Up @@ -91,6 +92,7 @@ def build_ir_from_placements(wc_event_locations: list[Location]) -> list[str]:
return []


@cache
def item_qualities() -> Mapping[int, int]:
""" to be able to sort items by quality """
from . import FF6WCWorld
Expand All @@ -109,6 +111,12 @@ def item_qualities() -> Mapping[int, int]:
for item_tier, key in zip(tiers, sort_keys, strict=True):
for wc_id in item_tier:
qualities[wc_id] = key

# Add items not present in chest_item_tiers
qualities[Rom.item_name_id["Cursed Shld"]] = 1
qualities[Rom.item_name_id["ArchplgoItem"]] = 1
qualities[Rom.item_name_id["Empty"]] = 10

return qualities


Expand Down
11 changes: 11 additions & 0 deletions worlds/ff6wc/test/test_item_rewards.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from worlds.ff6wc.item_rewards import item_qualities
from worlds.ff6wc import Rom


def test_qualities_has_all_ids() -> None:
""" All the Worlds Collide item IDs should be in the item qualities mapping. """
qualities = item_qualities()

assert all(item_id in qualities for item_id in Rom.item_name_id.values()), [
item_name for item_name, item_id in Rom.item_name_id.items() if item_id not in qualities
]
Loading