fix: XP-Scaling über Level 20 — quadratisch statt 999999 cap
- D&D 5e Tabelle bis Level 20 (original) - Level 21+: 355000 + (level-20)² * 50000 — quadratisches Wachstum - Proficiency Bonus skaliert weiter über Level 20 - Max Level 999: ~48 Mrd XP (machbar aber dauert lange) - Vorher: 999999 cap ab Level 20 → kein Level-Up möglich
This commit is contained in:
+10
-3
@@ -168,7 +168,11 @@ class DnDCharacter:
|
||||
return self.base_ac + self.armor_bonus + self.shield_bonus
|
||||
|
||||
def _calc_prof_bonus(self) -> int:
|
||||
# D&D 5e: +2 (1-4), +3 (5-8), +4 (9-12), +5 (13-16), +6 (17-20)
|
||||
# Beyond 20: +6 + (level-20)//4
|
||||
if self.level <= 20:
|
||||
return 2 + ((self.level - 1) // 4)
|
||||
return 6 + ((self.level - 20) // 4)
|
||||
|
||||
def _calc_spell_slots(self) -> int:
|
||||
if self.dnd_class in ("Magier", "Hexenmeister", "Barde", "Kleriker", "Druide"):
|
||||
@@ -439,11 +443,14 @@ class DnDCharacter:
|
||||
|
||||
@property
|
||||
def xp_to_next(self) -> int:
|
||||
"""D&D 5e XP thresholds."""
|
||||
thresholds = [0, 300, 900, 2700, 6500, 14000, 23000, 34000, 48000, 64000, 85000, 100000, 120000, 140000, 165000, 195000, 225000, 265000, 305000, 355000]
|
||||
"""XP für nächstes Level. D&D 5e bis Level 20, danach polynomial."""
|
||||
thresholds = [0, 300, 900, 2700, 6500, 14000, 23000, 34000, 48000, 64000,
|
||||
85000, 100000, 120000, 140000, 165000, 195000, 225000, 265000, 305000, 355000]
|
||||
if self.level < len(thresholds):
|
||||
return thresholds[self.level]
|
||||
return 999999
|
||||
# Beyond level 20: quadratic scaling — steady growth, no explosion
|
||||
# Formula: 355000 + (level-20)^2 * 50000
|
||||
return int(355000 + ((self.level - 20) ** 2) * 50000)
|
||||
|
||||
def saving_throw(self, ability: str) -> dict:
|
||||
"""Saving Throw: d20 + ability mod + prof (if proficient)."""
|
||||
|
||||
Reference in New Issue
Block a user