(Underdepths) Prepare for Pass 7

This commit is contained in:
AlexKucera committed 2026-08-15 19:39:24 +02:00
1 parent 03dbe778aa
commit e0ea5bb034
30 files changed
+183 -5713

No files matched your search

-75
View File
@@ -1,75 +0,0 @@
from __future__ import annotations
from dataclasses import dataclass
from typing import Final
@dataclass(frozen=True, slots=True)
class ItemDef:
key: str
name: str
category: str # "weapon" | "armor" | "potion" | "scroll"
power: int = 0
armor: int = 0
crit_modifier: float = 0.0
evasion_modifier: int = 0 # flat points; 2 points == 10% hit chance
effect: str = "" # heal | strength | invisibility | fireball | teleport | mapping
min_floor: int = 0
max_floor: int = 9
sprite_key: str = ""
ITEM_CATALOG: Final[dict[str, ItemDef]] = {
d.key: d
for d in (
ItemDef("rusty_dagger", "Rusty Dagger", "weapon", power=2, sprite_key="item_weapon"),
ItemDef("short_sword", "Short Sword", "weapon", power=4, min_floor=1, sprite_key="item_weapon"),
ItemDef("battle_axe", "Battle Axe", "weapon", power=7, min_floor=4, sprite_key="item_weapon"),
ItemDef(
"war_hammer",
"War Hammer",
"weapon",
power=10,
crit_modifier=-0.05,
min_floor=6,
sprite_key="item_weapon",
),
ItemDef("leather_armor", "Leather Armor", "armor", armor=2, sprite_key="item_armor"),
ItemDef("chain_mail", "Chain Mail", "armor", armor=4, min_floor=2, sprite_key="item_armor"),
ItemDef(
"plate_armor",
"Plate Armor",
"armor",
armor=7,
evasion_modifier=-2,
min_floor=5,
sprite_key="item_armor",
),
ItemDef("healing_potion", "Healing Potion", "potion", effect="heal", sprite_key="item_potion"),
ItemDef(
"strength_potion", "Strength Potion", "potion", effect="strength", sprite_key="item_potion"
),
ItemDef(
"invisibility_potion",
"Invisibility Potion",
"potion",
effect="invisibility",
sprite_key="item_potion",
),
ItemDef(
"scroll_fireball",
"Scroll of Fireball",
"scroll",
effect="fireball",
sprite_key="item_scroll",
),
ItemDef(
"scroll_teleport", "Scroll of Teleport", "scroll", effect="teleport", sprite_key="item_scroll"
),
ItemDef("scroll_mapping", "Scroll of Mapping", "scroll", effect="mapping", sprite_key="item_scroll"),
)
}
def items_for_floor(floor_index: int) -> list[ItemDef]:
return [d for d in ITEM_CATALOG.values() if d.min_floor <= floor_index <= d.max_floor]