Augment-Effekte wirken: Gold/XP/Komponenten/Units/Spieler-HP bei Auswahl, Team-Buffs im Score, Junk gefiltert

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
team3
2026-07-23 10:30:56 +02:00
parent 28fb667005
commit f7e569e519
7 changed files with 249 additions and 3 deletions

View File

@@ -243,14 +243,49 @@ def test_loot_drops_components(art, cfg):
def test_bot_leveling_follows_targets(art, cfg):
from tft.sim import policy as policy_mod
game = Game(art, cfg, seed=12)
levels_at = {}
while not game.over and game.round["label"] != "4-3":
label = game.round["label"]
if label in ("2-6", "3-3", "4-2"):
levels_at[label] = [b.level for b in game.bots if b.alive]
policy_mod.act(game.player, game.pool, game.artifact, game.cfg, game.rng,
game.round, policy_mod.ARCHETYPES["fast8"])
game.step()
assert all(lvl >= 5 for lvl in levels_at["2-6"]) # L5 ab 2-5
# L6 ab 3-1/3-2 — goldarme Bots dürfen 1-2 Runden nachhinken
assert sum(1 for lvl in levels_at["3-3"] if lvl >= 6) >= len(levels_at["3-3"]) - 2
assert any(lvl >= 7 for lvl in levels_at["4-2"]) # fast8/streaker auf 7
def test_augment_effects_apply(art, cfg):
game = Game(art, cfg, seed=3)
game.artifact = {**art, "augment_specs": {
"AUG_GOLD": {"atoms": [{"kind": "gold_now", "amount": 7},
{"kind": "gold_per_stage", "amount": 7}], "offerable": True},
"AUG_UNIT": {"atoms": [{"kind": "unit_grant", "cost": 2, "count": 2}], "offerable": True},
}}
gold_before = game.player.gold
game.player.augment_offer = ["AUG_GOLD"]
game.pick_augment(0)
assert game.player.gold == gold_before + 7
assert game.player.gold_per_stage == 7
bench_before = len(game.player.bench)
pool_before = sum(game.pool.available(a) for a in game.pool.copies)
game.player.augment_offer = ["AUG_UNIT"]
game.pick_augment(0)
assert len(game.player.bench) == bench_before + 2
assert sum(game.pool.available(a) for a in game.pool.copies) == pool_before - 2
def test_team_buff_augment_raises_score(art, cfg):
from tft.model.score import score_mechanical
buffed_art = {**art, "augment_specs": {
"AUG_BUFF": {"atoms": [{"kind": "team_buff", "stat": "hp_pct", "value": 0.3}],
"offerable": True}}}
board = [{"api_name": "U2_0", "stars": 2, "items": []}]
assert score_mechanical(board, ["AUG_BUFF"], buffed_art) > \
score_mechanical(board, [], buffed_art)