Augments: Tier aus Icon-Suffix, eine Stufe pro Runde, Evergreen-Pool, Beschreibungen gerendert, Karten-UI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
team3
2026-07-23 09:03:59 +02:00
parent c450841822
commit f53f1e5c14
8 changed files with 112 additions and 11 deletions

View File

@@ -208,3 +208,16 @@ def test_natural_level_progression(art, cfg):
assert checks["2-1"] == (3, 2)
assert checks["2-5"] == (4, 2)
assert checks["3-2"] == (5, 0)
def test_augment_offer_single_tier(art, cfg):
game = Game(art, cfg, seed=9)
mixed = {f"AUG_T{t}_{i}": {"tier": t} for t in (1, 2, 3) for i in range(4)}
game.artifact = {**art, "static": {**art["static"], "augments": mixed},
"augment_pool": []}
game.idx = next(i for i, r in enumerate(game.rounds) if r["augment"])
game.player.augment_offer = []
game._maybe_offer_augment()
tiers = {mixed[a]["tier"] for a in game.player.augment_offer}
assert len(game.player.augment_offer) == 3
assert len(tiers) == 1 # alle Angebote aus derselben Stufe

View File

@@ -75,3 +75,18 @@ def test_resolve_spell_adaptive_and_fallback():
utility = {"desc": "Grant a shield.", "variables": [
{"name": "Shield", "value": [0, 300, 400, 500, 0, 0, 0]}]}
assert resolve_spell(utility)["spell_damage"] is None
def test_augment_tier_from_icon():
from tft.staticdata.parse import augment_tier
assert augment_tier("ASSETS/x/GodAugmentEkko_II.TFT_Set17.tex") == 2
assert augment_tier("ASSETS/x/LeonaHero_I.TFT_Set17.tex") == 1
assert augment_tier("ASSETS/x/Big_III.tex") == 3
assert augment_tier("ASSETS/x/NoSuffix.tex") is None
def test_render_desc():
from tft.staticdata.parse import render_desc
desc = "Gain <TFTBonus>@Gold@</TFTBonus> gold and @ADAP*100@% AD.<br>Rest."
assert render_desc(desc, {"Gold": 4, "ADAP": 0.15}) == "Gain 4 gold and 15% AD. Rest."
assert render_desc("@Unknown@ gold", {}) == "? gold"