fixing leveling xp reporting

This commit is contained in:
2025-11-30 18:20:40 -06:00
parent 805d04cf4e
commit 70b2b0f124
6 changed files with 131 additions and 12 deletions

View File

@@ -401,6 +401,12 @@ XP Required = 100 × (current_level ^ 1.5)
- Level up triggers automatically when threshold reached
- Base stats remain constant (progression via skill trees & equipment)
**XP Tracking:**
- **`experience`**: Current progress toward next level (0 to required XP, resets on level-up)
- **`total_xp`**: Cumulative XP earned across all levels (never decreases)
- **UI Display**: Shows both values (e.g., "Total XP: 150 | Progress: 50/282 to Level 3")
- **Legacy data**: Characters without `total_xp` default to 0, will track from next XP gain
**Implementation:**
- Leveling logic lives in `Character` model (`add_experience()`, `level_up()` methods)
- No separate service needed (OOP design pattern)