diff --git a/src/dnd.py b/src/dnd.py index 659ff7e..c8a0241 100644 --- a/src/dnd.py +++ b/src/dnd.py @@ -168,7 +168,11 @@ class DnDCharacter: return self.base_ac + self.armor_bonus + self.shield_bonus def _calc_prof_bonus(self) -> int: - return 2 + ((self.level - 1) // 4) + # 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)."""