mechanic: clump stat gains on prime stats only

This commit is contained in:
Dash committed 2026-10-17 15:55:45 +02:00
1 parent ab179c1eb0
commit 17e1b91a18
5 files changed
+2864 -2869

No files matched your search

+761 -775
View File
File diff suppressed because it is too large. Load diff
+976 -980
View File
File diff suppressed because it is too large. Load diff
+1106 -1110
View File
File diff suppressed because it is too large. Load diff
+18 -1
View File
@@ -1,7 +1,9 @@
import datetime
import pytest
from pqcli import random
from pqcli.config import StatType
from pqcli.config import PRIME_STATS, StatType
from pqcli.game_data import load_game_data
from pqcli.mechanic import Player, Simulation, Stats, level_up_time
@@ -36,3 +38,18 @@ def test_quest_length_matches_upstream() -> None:
lengths.add(simulation.player.quest_book.quest_bar.max_)
assert min(lengths) == 50
assert max(lengths) == 149
def test_weighted_stat_gain_skips_hp_and_mp(
monkeypatch: pytest.MonkeyPatch,
) -> None:
# the "favor the best stat" branch only covers prime stats, pq-web 48c42e6
monkeypatch.setattr(random, "odds", lambda chance, out_of: False)
random.seed("stats")
player = make_simulation().player
player.stats.increment(StatType.hp_max, 1000)
for _ in range(500):
player.win_stat()
assert player.stats[StatType.hp_max] == 1010
assert player.stats[StatType.mp_max] == 10
assert sum(player.stats[stat] for stat in PRIME_STATS) == 60 + 500