feat(api): add luck (LUK) stat to character system

Add new Luck stat to the character stats system with class-specific values:
- Assassin: 12 (highest - critical specialists)
- Luminary: 11 (divine favor)
- Wildstrider/Lorekeeper: 10 (average)
- Arcanist/Oathkeeper: 9 (modest)
- Vanguard: 8 (default - relies on strength)
- Necromancer: 7 (lowest - dark arts cost)

Changes:
- Add luck field to Stats dataclass with default of 8
- Add LUCK to StatType enum
- Update all 8 class YAML files with luck values
- Display LUK in character panel (play page) and detail page
- Update DATA_MODELS.md documentation

Backward compatible: existing characters without luck default to 8.
This commit is contained in:
2025-11-26 12:27:18 -06:00
parent d789b5df65
commit 30c3b800e6
13 changed files with 62 additions and 27 deletions

View File

@@ -49,6 +49,7 @@ class StatType(Enum):
INTELLIGENCE = "intelligence" # Magical power
WISDOM = "wisdom" # Perception and insight
CHARISMA = "charisma" # Social influence
LUCK = "luck" # Fortune and fate
class AbilityType(Enum):

View File

@@ -21,6 +21,7 @@ class Stats:
intelligence: Magical power, affects spell damage and MP
wisdom: Perception and insight, affects magical resistance
charisma: Social influence, affects NPC interactions
luck: Fortune and fate, affects critical hits, loot, and random outcomes
Computed Properties:
hit_points: Maximum HP = 10 + (constitution × 2)
@@ -35,6 +36,7 @@ class Stats:
intelligence: int = 10
wisdom: int = 10
charisma: int = 10
luck: int = 8
@property
def hit_points(self) -> int:
@@ -111,6 +113,7 @@ class Stats:
intelligence=data.get("intelligence", 10),
wisdom=data.get("wisdom", 10),
charisma=data.get("charisma", 10),
luck=data.get("luck", 8),
)
def copy(self) -> 'Stats':
@@ -127,6 +130,7 @@ class Stats:
intelligence=self.intelligence,
wisdom=self.wisdom,
charisma=self.charisma,
luck=self.luck,
)
def __repr__(self) -> str:
@@ -134,7 +138,7 @@ class Stats:
return (
f"Stats(STR={self.strength}, DEX={self.dexterity}, "
f"CON={self.constitution}, INT={self.intelligence}, "
f"WIS={self.wisdom}, CHA={self.charisma}, "
f"WIS={self.wisdom}, CHA={self.charisma}, LUK={self.luck}, "
f"HP={self.hit_points}, MP={self.mana_points}, "
f"DEF={self.defense}, RES={self.resistance})"
)