forked from mirror/Archipelago
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
65 lines
1.5 KiB
Python
65 lines
1.5 KiB
Python
from typing import TYPE_CHECKING
|
|
try:
|
|
from typing import final
|
|
except ImportError:
|
|
if TYPE_CHECKING:
|
|
from typing import final
|
|
else:
|
|
from typing_extensions import final
|
|
|
|
from BaseClasses import Item
|
|
from .addresses import RAM
|
|
|
|
BASE_SPYRO_ITEM_ID: int = 1000
|
|
|
|
|
|
@final
|
|
class SpyroItem(Item):
|
|
game: str = "Spyro the Dragon"
|
|
|
|
|
|
homeworld_access: list[str] = []
|
|
level_access: list[str] = []
|
|
|
|
for hub in RAM.hub_environments:
|
|
if hub.name != "Gnasty's World":
|
|
homeworld_access.append(hub.name)
|
|
for level in hub.child_environments:
|
|
level_access.append(level.name)
|
|
|
|
boss_items: list[str] = [
|
|
"Toasty's Stilts",
|
|
"Shemp's Staff",
|
|
"Blowhard's Beard",
|
|
"Metalhead's Mohawk",
|
|
"Jacques' Ribbon"
|
|
]
|
|
|
|
goal_item: list[str] = ["Victory"]
|
|
|
|
# TODO: useful items: progressive Sparx?
|
|
|
|
trap_items: list[str] = [
|
|
"Flop Trap",
|
|
"Roll Trap",
|
|
"Faint Trap"
|
|
]
|
|
|
|
filler_items: list[str] = [
|
|
"Extra Life",
|
|
"Butterfly"
|
|
]
|
|
|
|
full_item_list: list[str] = homeworld_access + level_access + boss_items + goal_item
|
|
full_item_list += trap_items + filler_items
|
|
item_id_to_name: dict[int, str] = dict(enumerate(full_item_list, start=BASE_SPYRO_ITEM_ID))
|
|
item_name_to_id: dict[str, int] = {v: k for k, v in item_id_to_name.items()}
|
|
|
|
grouped_items: dict[str, set[str]] = {
|
|
"worlds": set(homeworld_access),
|
|
"boss items": set(boss_items),
|
|
"levels": set(level_access),
|
|
"traps": set(trap_items),
|
|
"filler": set(filler_items)
|
|
}
|