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

@@ -50,6 +50,7 @@ All enum types are defined in `/app/models/enums.py` for type safety throughout
| `INTELLIGENCE` | Magical power |
| `WISDOM` | Perception and insight |
| `CHARISMA` | Social influence |
| `LUCK` | Fortune and fate (affects crits, loot, random outcomes) |
### AbilityType
@@ -597,14 +598,15 @@ success = service.soft_delete_message(
### Stats
| Field | Type | Description |
|-------|------|-------------|
| `strength` | int | Physical power |
| `dexterity` | int | Agility and precision |
| `constitution` | int | Endurance and health |
| `intelligence` | int | Magical power |
| `wisdom` | int | Perception and insight |
| `charisma` | int | Social influence |
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `strength` | int | 10 | Physical power |
| `dexterity` | int | 10 | Agility and precision |
| `constitution` | int | 10 | Endurance and health |
| `intelligence` | int | 10 | Magical power |
| `wisdom` | int | 10 | Perception and insight |
| `charisma` | int | 10 | Social influence |
| `luck` | int | 8 | Fortune and fate (affects crits, loot, random outcomes) |
**Derived Properties (Computed):**
- `hit_points` = 10 + (constitution × 2)
@@ -614,6 +616,8 @@ success = service.soft_delete_message(
**Note:** Defense and resistance are computed properties, not stored values. They are calculated on-the-fly from constitution and wisdom.
**Luck Stat:** The luck stat has a lower default (8) compared to other stats (10). Each class has a specific luck value ranging from 7 (Necromancer) to 12 (Assassin). Luck will influence critical hit chance, hit/miss calculations, base damage variance, NPC interactions, loot generation, and spell power in future implementations.
### SkillNode
| Field | Type | Description |
@@ -662,16 +666,26 @@ success = service.soft_delete_message(
### Initial 8 Player Classes
| Class | Theme | Skill Tree 1 | Skill Tree 2 |
|-------|-------|--------------|--------------|
| **Vanguard** | Tank/melee | Defensive (shields, armor, taunts) | Offensive (weapon mastery, heavy strikes) |
| **Assassin** | Stealth/critical | Assassination (critical hits, poisons) | Shadow (stealth, evasion) |
| **Arcanist** | Elemental spells | Pyromancy (fire spells, DoT) | Cryomancy (ice spells, crowd control) |
| **Luminary** | Healing/support | Holy (healing, buffs) | Divine Wrath (smite, undead damage) |
| **Wildstrider** | Ranged/nature | Marksmanship (bow skills, critical shots) | Beast Master (pet companion, nature magic) |
| **Oathkeeper** | Hybrid tank/healer | Protection (defensive auras, healing) | Retribution (holy damage, smites) |
| **Necromancer** | Death magic/summon | Dark Arts (curses, life drain) | Summoning (undead minions) |
| **Lorekeeper** | Support/control | Performance (buffs, debuffs via music) | Trickery (illusions, charm) |
| Class | Theme | LUK | Skill Tree 1 | Skill Tree 2 |
|-------|-------|-----|--------------|--------------|
| **Vanguard** | Tank/melee | 8 | Defensive (shields, armor, taunts) | Offensive (weapon mastery, heavy strikes) |
| **Assassin** | Stealth/critical | 12 | Assassination (critical hits, poisons) | Shadow (stealth, evasion) |
| **Arcanist** | Elemental spells | 9 | Pyromancy (fire spells, DoT) | Cryomancy (ice spells, crowd control) |
| **Luminary** | Healing/support | 11 | Holy (healing, buffs) | Divine Wrath (smite, undead damage) |
| **Wildstrider** | Ranged/nature | 10 | Marksmanship (bow skills, critical shots) | Beast Master (pet companion, nature magic) |
| **Oathkeeper** | Hybrid tank/healer | 9 | Protection (defensive auras, healing) | Retribution (holy damage, smites) |
| **Necromancer** | Death magic/summon | 7 | Dark Arts (curses, life drain) | Summoning (undead minions) |
| **Lorekeeper** | Support/control | 10 | Performance (buffs, debuffs via music) | Trickery (illusions, charm) |
**Class Luck Values:**
- **Assassin (12):** Highest luck - critical strike specialists benefit most from fortune
- **Luminary (11):** Divine favor grants above-average luck
- **Wildstrider (10):** Average luck - self-reliant nature
- **Lorekeeper (10):** Average luck - knowledge is their advantage
- **Arcanist (9):** Slight chaos magic influence
- **Oathkeeper (9):** Honorable path grants modest fortune
- **Vanguard (8):** Relies on strength and skill, not luck
- **Necromancer (7):** Lowest luck - dark arts exact a toll
**Extensibility:** Class system designed to easily add more classes in future updates.