Combat moves defined as TOML content files in content/combat/, not engine code. State machine (IDLE > TELEGRAPH > WINDOW > RESOLVE) processes timing-based exchanges. Counter relationships, stamina costs, damage formulas all tunable from data files. Moves: punch right/left, roundhouse, sweep, dodge right/left, parry high/low, duck, jump. Combat ends on knockout (PL <= 0) or exhaustion (stamina <= 0).
28 lines
695 B
Python
28 lines
695 B
Python
"""Base entity class for characters in the world."""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class Entity:
|
|
"""Base class for anything with position and identity in the world."""
|
|
|
|
name: str
|
|
x: int
|
|
y: int
|
|
# Combat stats
|
|
pl: float = 100.0 # power level (health and damage multiplier)
|
|
stamina: float = 100.0 # current stamina
|
|
max_stamina: float = 100.0 # stamina ceiling
|
|
|
|
async def send(self, message: str) -> None:
|
|
"""Send a message to this entity. Base implementation is a no-op."""
|
|
pass
|
|
|
|
|
|
@dataclass
|
|
class Mob(Entity):
|
|
"""Represents a non-player character (NPC) in the world."""
|
|
|
|
description: str = ""
|
|
alive: bool = True
|