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

@@ -62,3 +62,27 @@ def test_unit_multipliers_learned():
learned = learn(rows)
assert learned["units"]["TFT17_Strong"] > 1.05
assert learned["units"]["TFT17_Weak"] < 0.95
def test_augment_spec_builder():
from tft.model.augments import build_spec
units = {"TFT17_Briar": {"name": "Briar", "cost": 1}}
gold = build_spec({"desc": "Gain 6 gold now.", "effects": {"Gold": 6.0}}, units)
assert gold["atoms"] == [{"kind": "gold_now", "amount": 6}]
buff = build_spec({"desc": "Your team gains 35 Health and 10% Attack Speed.",
"effects": {"Health": 35.0, "AS": 0.10}}, units)
kinds = {(a["kind"], a.get("stat")) for a in buff["atoms"]}
assert ("team_buff", "hp_flat") in kinds
assert ("team_buff", "as_pct") in kinds
cond = build_spec({"desc": "Your team gains 10 Health for each item.",
"effects": {"Health": 10.0}}, units)
assert not any(a["kind"] == "team_buff" for a in cond["atoms"])
unit = build_spec({"desc": "Gain a Briar and 2 gold.", "effects": {"Gold": 2.0}}, units)
assert {"kind": "unit_grant", "units": ["TFT17_Briar"]} in unit["atoms"]
junk = build_spec({"desc": "", "effects": {}}, units)
assert junk["offerable"] is False