(Underdepths) Pass 5
This commit is contained in:
1 parent
05e340dec2
commit
b6d2a058e3
53 files changed
+5020
No files matched your search
@@ -0,0 +1,31 @@
|
||||
"""Item catalog per plan.md Item catalog + factory."""
|
||||
from __future__ import annotations
|
||||
|
||||
from entities.item import Item
|
||||
|
||||
# stats keys: weapons -> power (+opt crit_chance/evasion mods); armor -> armor
|
||||
# (+opt evasion mod); potions/scrolls -> effect payload consumed by actions.
|
||||
ITEM_DEFS: dict[str, dict] = {
|
||||
"rusty_dagger": dict(name="Rusty Dagger", category="weapon", stats={"power": 2}),
|
||||
"short_sword": dict(name="Short Sword", category="weapon", stats={"power": 4}),
|
||||
"battle_axe": dict(name="Battle Axe", category="weapon", stats={"power": 7}),
|
||||
"war_hammer": dict(name="War Hammer", category="weapon", stats={"power": 10, "crit_chance": -0.05}),
|
||||
"leather_armor": dict(name="Leather Armor", category="armor", stats={"armor": 2}),
|
||||
"chain_mail": dict(name="Chain Mail", category="armor", stats={"armor": 4}),
|
||||
"plate_armor": dict(name="Plate Armor", category="armor", stats={"armor": 7, "evasion": -0.10}),
|
||||
"healing_potion": dict(name="Healing Potion", category="potion", stats={"effect": "heal", "amount": 30}),
|
||||
"strength_potion": dict(name="Strength Potion", category="potion", stats={"effect": "strength", "power": 5, "duration": 20}),
|
||||
"invisibility_potion":dict(name="Invisibility Potion",category="potion",stats={"effect": "invisibility", "duration": 15}),
|
||||
"fireball_scroll": dict(name="Scroll of Fireball",category="scroll", stats={"effect": "fireball", "damage": 20, "radius": 3}),
|
||||
"teleport_scroll": dict(name="Scroll of Teleport",category="scroll", stats={"effect": "teleport"}),
|
||||
"mapping_scroll": dict(name="Scroll of Mapping", category="scroll", stats={"effect": "mapping"}),
|
||||
}
|
||||
|
||||
|
||||
def make_item(kind: str, x: int, y: int) -> Item:
|
||||
d = ITEM_DEFS[kind]
|
||||
return Item(
|
||||
x=x, y=y, kind=kind, name=d["name"],
|
||||
category=d["category"], stats=dict(d["stats"]),
|
||||
sprite_key=kind,
|
||||
)
|
||||
Reference in new issue
Block a user