(Underdepths) Prepare for Pass 7
This commit is contained in:
1 parent
6a9cf959b1
commit
13512b0476
27 files changed
-5608
No files matched your search
@@ -1,34 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from data.items import ItemDef
|
||||
from entities.entity import Entity
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Item(Entity):
|
||||
key: str = "item"
|
||||
category: str = "misc"
|
||||
effect: str = ""
|
||||
power: int = 0
|
||||
armor: int = 0
|
||||
crit_modifier: float = 0.0
|
||||
evasion_modifier: int = 0
|
||||
blocks_movement: bool = False
|
||||
|
||||
@classmethod
|
||||
def from_def(cls, item_def: ItemDef, x: int = 0, y: int = 0) -> Item:
|
||||
return cls(
|
||||
x=x,
|
||||
y=y,
|
||||
key=item_def.key,
|
||||
name=item_def.name,
|
||||
sprite_key=item_def.sprite_key or "item",
|
||||
category=item_def.category,
|
||||
effect=item_def.effect,
|
||||
power=item_def.power,
|
||||
armor=item_def.armor,
|
||||
crit_modifier=item_def.crit_modifier,
|
||||
evasion_modifier=item_def.evasion_modifier,
|
||||
)
|
||||
Reference in new issue
Block a user