From 7f9df50fcd78361ce64e21d8accccc0f42079ed1 Mon Sep 17 00:00:00 2001 From: arch_agent Date: Sun, 26 Jul 2026 08:49:38 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20XP-Scaling=20=C3=BCber=20Level=2020=20?= =?UTF-8?q?=E2=80=94=20quadratisch=20statt=20999999=20cap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/dnd.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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)."""