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:
@@ -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})"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user