This commit is contained in:
team3
2026-07-23 11:54:46 +02:00
parent f7e569e519
commit f41ac76b57
12 changed files with 331 additions and 386 deletions

View File

@@ -173,17 +173,24 @@ def test_pairing():
def test_ghost_source_takes_no_damage(art, cfg):
game = Game(art, cfg, seed=3)
game.bots[0].hp = 0
game.bots[0].placement = 8
game.bots[0].board, game.bots[0].bench = [], []
# 7 Lebende -> jede PvP-Runde hat einen Ghost-Kampf; HP-Summe der
# Ghost-Quelle darf nur durch ihren echten Kampf sinken (kein Doppelschaden).
hp_before = {p.name: p.hp for p in game.players}
while game.round["kind"] != "pvp":
game.step()
# Auf 3 Lebende reduzieren -> genau 1 Paar + 1 Ghost-Kampf.
for b in game.bots[2:]:
b.hp, b.placement, b.board, b.bench = 0, 8, [], []
boards = [
(game.player, [{"api_name": "U5_0", "stars": 3, "items": []}]),
(game.bots[0], [{"api_name": "U3_0", "stars": 2, "items": []}]),
(game.bots[1], [{"api_name": "U1_0", "stars": 1, "items": []}]),
]
for p, board in boards:
p.board, p.bench, p.gold = board, [], 0
game.idx = next(i for i, r in enumerate(game.rounds) if r["kind"] == "pvp")
hp_before = {p.name: p.hp for p in game._alive()}
game.step()
drops = sum(1 for p in game.players if p.hp < hp_before[p.name])
assert drops <= 4 # max. 3 Paar-Verlierer + 1 Ghost-Verlierer
# Nur Paar-Verlierer + ggf. Ghost-Verlierer nehmen Schaden; die
# Ghost-Quelle darf durch ihren Klon-Kampf nicht getroffen werden.
drops = sum(1 for p in game.players if p.name in hp_before
and p.hp < hp_before[p.name])
assert drops <= 2
def test_pve_freezes_streak_and_pays_no_win_bonus(art, cfg):
@@ -279,13 +286,3 @@ def test_augment_effects_apply(art, cfg):
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)