This commit is contained in:
team3
2026-07-24 11:24:24 +02:00
parent f41ac76b57
commit 848c8ea1aa
41 changed files with 1776 additions and 15 deletions

View File

@@ -114,6 +114,18 @@ def _pool_total(game, api):
return n
def test_step_keeps_player_board_setup(art, cfg):
"""Die manuelle Aufstellung wird nie durch stärkere Bank-Units ersetzt."""
game = Game(art, cfg, seed=8)
game.player.level = 2
game.player.board = [{"api_name": "U1_0", "stars": 1, "items": []},
{"api_name": "U1_1", "stars": 1, "items": []}]
game.player.bench = [{"api_name": "U5_0", "stars": 2, "items": []}]
before = [u["api_name"] for u in game.player.board]
game.step()
assert [u["api_name"] for u in game.player.board] == before
def test_pool_conservation(art, cfg):
for seed in (1, 2, 3):
game = Game(art, cfg, seed=seed)

View File

@@ -60,6 +60,21 @@ def test_parse_resolves_spell_damage():
assert unit["spell_scaling"] == "ap"
def test_resolve_spell_on_attack_passive():
diana_like = {
"desc": "<spellPassive>Passive:</spellPassive> Attacks deal "
"<magicDamage>@ModifiedBonusDamageToAttacks@ (%i:scaleAP%)</magicDamage> "
"bonus magic damage.",
"variables": [{"name": "BonusDamageToAttacks", "value": [0, 52, 78, 135, 230]}],
}
r = resolve_spell(diana_like)
assert r["spell_on_attack"] is True
assert r["spell_damage"] == [0, 52, 78, 135, 230]
cast = parse(RAW, set_override=17)["units"]["TFT17_Mage"]
assert cast["spell_on_attack"] is False
def test_resolve_spell_adaptive_and_fallback():
adaptive = {
"desc": "Deal <magicDamage>@TotalDamage@</magicDamage> damage. %i:scaleAP% %i:scaleAD%",

View File

@@ -45,6 +45,17 @@ def test_items_change_profile():
assert not statsheet.item_is_modeled(ITEMS["unmodeled"])
def test_on_attack_spell_scales_with_attack_speed():
# Pro-Attacke-Passive: DPS = Schaden × AS, unabhängig vom Mana-Zyklus.
spell = [0, 50, 75, 110, 0, 0, 0]
u = unit(spell=spell)
u["spell_on_attack"] = True
on_attack = statsheet.unit_stats(u, 1, [], ITEMS, None, None)
assert on_attack["spell_dps"] == pytest.approx(50 * 0.7)
cast = statsheet.unit_stats(unit(spell=spell), 1, [], ITEMS, None, None)
assert on_attack["spell_dps"] > cast["spell_dps"]
def test_frontline_casts_more():
spell = [0, 300, 450, 700, 0, 0, 0]
tank = statsheet.unit_stats(unit(spell=spell), 1, [], ITEMS, None, "frontline")