(Underdepths) Prepare for Pass 2
This commit is contained in:
34 files changed
+61
-3569
No files matched your search
@@ -1,22 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from entities.entity import Entity
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Enemy(Entity):
|
||||
hp: int
|
||||
max_hp: int
|
||||
power: int
|
||||
armor: int
|
||||
accuracy: int
|
||||
evasion: int
|
||||
crit_chance: float
|
||||
speed: int
|
||||
behavior: str
|
||||
xp_reward: int
|
||||
last_known_position: tuple[int, int] | None = None
|
||||
ranged_power: int = 0
|
||||
has_split: bool = False
|
||||
@@ -1,16 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Entity:
|
||||
x: int
|
||||
y: int
|
||||
glyph: str
|
||||
color: tuple[int, int, int]
|
||||
name: str
|
||||
|
||||
@property
|
||||
def position(self) -> tuple[int, int]:
|
||||
return self.x, self.y
|
||||
@@ -1,18 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from entities.entity import Entity
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Item(Entity):
|
||||
category: str
|
||||
power_bonus: int = 0
|
||||
armor_bonus: int = 0
|
||||
crit_bonus: float = 0.0
|
||||
evasion_bonus: float = 0.0
|
||||
effect: str = ""
|
||||
amount: int = 0
|
||||
duration: int = 0
|
||||
radius: int = 0
|
||||
@@ -1,56 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
from data.constants import (
|
||||
PLAYER_ACCURACY,
|
||||
PLAYER_ARMOR,
|
||||
PLAYER_COLOR,
|
||||
PLAYER_CRIT_CHANCE,
|
||||
PLAYER_EVASION,
|
||||
PLAYER_GLYPH,
|
||||
PLAYER_MAX_HP,
|
||||
PLAYER_POWER,
|
||||
PLAYER_SPEED,
|
||||
)
|
||||
from entities.entity import Entity
|
||||
from entities.item import Item
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Player(Entity):
|
||||
hp: int
|
||||
max_hp: int
|
||||
power: int
|
||||
armor: int
|
||||
accuracy: int
|
||||
evasion: int
|
||||
crit_chance: float
|
||||
speed: int
|
||||
level: int
|
||||
xp: int
|
||||
inventory: list[Item] = field(default_factory=list)
|
||||
weapon: Item | None = None
|
||||
armor_item: Item | None = None
|
||||
strength_turns: int = 0
|
||||
invisibility_turns: int = 0
|
||||
|
||||
|
||||
def create_player(x: int, y: int) -> Player:
|
||||
return Player(
|
||||
x=x,
|
||||
y=y,
|
||||
glyph=PLAYER_GLYPH,
|
||||
color=PLAYER_COLOR,
|
||||
name="You",
|
||||
hp=PLAYER_MAX_HP,
|
||||
max_hp=PLAYER_MAX_HP,
|
||||
power=PLAYER_POWER,
|
||||
armor=PLAYER_ARMOR,
|
||||
accuracy=PLAYER_ACCURACY,
|
||||
evasion=PLAYER_EVASION,
|
||||
crit_chance=PLAYER_CRIT_CHANCE,
|
||||
speed=PLAYER_SPEED,
|
||||
level=1,
|
||||
xp=0,
|
||||
)
|
||||
Reference in new issue
Block a user