update
This commit is contained in:
1 parent
1d563b9eec
commit
04fe9716e8
22 files changed
+764
-151
No files matched your search
+70
-7
@@ -91,6 +91,7 @@ func _initialize() -> void:
|
||||
test_kapitel_zwei_und_merkmalwahl()
|
||||
test_einzelspieler_gegner()
|
||||
test_skilltree()
|
||||
test_werkstatt()
|
||||
test_ki_zeitbudget()
|
||||
test_englische_karten()
|
||||
test_uebersetzung_vollstaendig()
|
||||
@@ -115,7 +116,7 @@ func test_kartenpool() -> void:
|
||||
check(C("f_10_10").cost == 10 and C("n_6_1").name == "Eiserner Knappe" and C("w_0_10").name == "Stiller Urleviathan", "10/10 kostet 10; neue Eigenschaften und Wesen ab 6")
|
||||
check(C("n_3_2").is_neutral() and C("n_3_2").text() == "Neutral." and not C("f_3_2").is_neutral(), "neutrale Karten tragen die Eigenschaft Neutral")
|
||||
check(C("f_0_2").cost == 0 and C("f_2_1").cost == 1 and C("f_3_2").cost == 2 and C("f_5_5").cost == 5 and C("e_0_4").cost == 1, "Kostenbeispiele, 0/2 kostet nichts")
|
||||
check(Cards.cost_of(20, 20) == 10, "Kosten enden bei 10")
|
||||
check(Cards.cost_of(20, 20) == 20, "Kosten ohne Obergrenze")
|
||||
check(C("f_3_2").name == "Brennender Kobold" and C("w_4_5").name == "Flutender Leviathan", "Namen aus Eigenschaft und Wesen")
|
||||
var a := C("f_3_2")
|
||||
var b := C("f_3_2")
|
||||
@@ -201,7 +202,7 @@ func test_stapel() -> void:
|
||||
# Kartenwert: Grundkarten 100, je Stufe +100; Fusionen aus ihren Werten
|
||||
check(Cards.all().all(func(c): return c.value() == 100), "jede Grundkarte ist 100 wert")
|
||||
check(C("l_1_1").leveled(4).value() == 500 and C("w_4_5").leveled(2).value() == 300, "Ultimate Rare 500, Super Rare 300")
|
||||
check(Cards.fused(C("f_3_2"), C("w_4_5")).value() == 100 and Cards.fused(C("f_3_2"), C("w_4_5"), 3).value() == 400, "Dampf: 100, in Stufe 3 400")
|
||||
check(Cards.fused(C("f_3_2"), C("w_4_5")).value() == 200 and Cards.fused(C("f_3_2"), C("w_4_5"), 3).value() == 500, "Dampf: 200 (zweites Element umsonst), in Stufe 3 500")
|
||||
check(DeckGen.strength(["f_0_1", "l_1_1", "w_4_5"], {"l_1_1": 4, "w_4_5": 2}) == 300 and DeckGen.strength([], {}) == 0 and DeckGen.strength(DeckGen.element_deck(Cards.NEUTRAL), {}) == 100, "Stärke: Mittelwert 300, leer 0, Startsammlung 100")
|
||||
|
||||
|
||||
@@ -826,7 +827,7 @@ func test_spielstand_migration() -> void:
|
||||
func test_kampagne() -> void:
|
||||
var r := RandomNumberGenerator.new()
|
||||
r.seed = 4
|
||||
check(Campaign.STAGES_PER_CHAPTER == 10 and Campaign.total() == 50, "fünf Kapitel mit je zehn Stufen")
|
||||
check(Campaign.STAGES_PER_CHAPTER == 10 and Campaign.total() == 100, "zehn Kapitel mit je zehn Stufen")
|
||||
var boss := Campaign.opponent(4)
|
||||
check(boss.name == "Vulkar" and boss.title == "Söldnerfürst" and boss.life == 24, "Stufe 5: Vulkar mit 24 Leben")
|
||||
check(boss.deck.size() == Game.DECK_MIN and boss.looks.values().all(func(l): return l == 0), "Kapitel 1: Stapel in Common")
|
||||
@@ -861,6 +862,7 @@ func test_zufallssamen() -> void:
|
||||
Game.test_seed = 0
|
||||
check(a == b, "fester Samen wiederholbar")
|
||||
var c := Game.make_rng().randi()
|
||||
OS.delay_usec(50) # randomize() hängt an der Uhr: zwei Aufrufe in derselben Mikrosekunde wären gleich
|
||||
var d := Game.make_rng().randi()
|
||||
check(c != d, "ohne Samen echter Zufall")
|
||||
|
||||
@@ -940,7 +942,7 @@ func test_ki_zwei_schritte() -> void:
|
||||
|
||||
|
||||
func test_kapitel_zwei_und_merkmalwahl() -> void:
|
||||
check(Campaign.total() == 50 and Campaign.chapter(9) == 1 and Campaign.chapter(10) == 2 and Campaign.chapter(49) == 5, "fünfzig Stufen in fünf Kapiteln")
|
||||
check(Campaign.total() == 100 and Campaign.chapters() == 10 and Campaign.chapter(9) == 1 and Campaign.chapter(10) == 2 and Campaign.chapter(49) == 5 and Campaign.chapter(99) == 10, "hundert Stufen in zehn Kapiteln")
|
||||
check(Campaign.stage(25).perks.size() == 2 and Campaign.stage(25).name == "Nyx" and Campaign.stage(25).element == "Wasser", "Kapitel 3: Wasser, zwei Merkmale")
|
||||
check(Campaign.stage(45).perks.size() == 3 and Campaign.stage(40).element == "Erde" and Campaign.stage(49).reward == 1500 and Campaign.stage(10).reward == 350 and Campaign.stage(9).reward == 500, "Kapitel 5: Erde, drei Merkmale; Belohnungen 350 bis 1500, Boss 1 gibt 500")
|
||||
check(Campaign.stage(0).perks == ["feuer_angriff"] and Campaign.stage(23).perks == ["ziehen_gratis", "kein_nachteil"] and Campaign.stage(49).perks == ["start_energie", "wesen_angriff", "extra_mana"], "Merkmale je drei Plätze versetzt, nichts doppelt")
|
||||
@@ -1009,6 +1011,7 @@ func test_skilltree() -> void:
|
||||
check(p.player_level() == 0 and p.skill_points() == 0 and p.learn("packglueck") == "Kein Skillpunkt frei", "Start: Level 0, kein Punkt")
|
||||
var reward := p.record_battle(true, 380)
|
||||
check(reward == 380 and p.xp == 380 and p.player_level() == 2 and p.skill_points() == 2 and p.take_notices() == ["Level 2 erreicht: +2 Skillpunkte"], "380 Münzen: Level 2, zwei Punkte, Meldung")
|
||||
check(p.learn("garantie") == "Erst den Skill davor lernen" and Skills.previous("garantie") == "packglueck" and Skills.previous("packglueck") == "", "Garantie braucht erst Packglück")
|
||||
check(p.learn("packglueck") == "" and p.skill("packglueck") == 1 and p.skill_points() == 1, "Packglück gelernt")
|
||||
check(p.learn("gratisziehen") == "" and p.learn("gratisziehen") == "Schon auf der höchsten Stufe" and p.skill_points() == 0, "Freies Ziehen hat nur eine Stufe")
|
||||
check(p.battle_perks() == ["ziehen_gratis"], "Kampfskill wird im Kampf zum Merkmal")
|
||||
@@ -1016,11 +1019,11 @@ func test_skilltree() -> void:
|
||||
p.campaign_stage = Campaign.STAGES_PER_CHAPTER
|
||||
check(p.battle_perks() == ["leben_35", "ziehen_gratis"], "das gewählte Merkmal kommt dazu")
|
||||
p.xp = 100000
|
||||
p.learn("packpreis")
|
||||
p.learn("packpreis")
|
||||
for i in 3:
|
||||
p.learn("muenzen")
|
||||
p.learn("staub")
|
||||
p.learn("packpreis")
|
||||
p.learn("packpreis")
|
||||
check(is_equal_approx(p.coin_factor(), 1.3) and p.pack_price(Cards.NEUTRAL) == 80 and p.pack_price("Feuer") == 160 and p.dust_gain(100) == 175, "Münzsegen ×1,3, Händler −20 %, Staubsammler +75 %")
|
||||
var coins := p.coins
|
||||
check(p.record_battle(false, 200) == 260 and p.coins == coins + 260, "260 statt 200 Münzen")
|
||||
@@ -1042,7 +1045,67 @@ func test_skilltree() -> void:
|
||||
var bad := Profile.from_dict({"version": Profile.SAVE_VERSION, "xp": 100, "skills": {"gibt_es_nicht": 2, "packglueck": 9}})
|
||||
check(bad.skill("packglueck") == 3 and bad.skills.size() == 1 and bad.player_level() == 1, "unbekannte Skills fliegen raus, Stufen gedeckelt")
|
||||
check(Skills.pack_weights(0) == PackedFloat32Array([45, 25, 15, 10, 5]) and Skills.pack_weights(3) == PackedFloat32Array([21, 34, 21, 16, 8]), "Packglück 3: Chancen 21/34/21/16/8")
|
||||
check(Skills.effect("packglueck", 1) == "Chancen 37/28/17/12/6 %" and Skills.effect("packpreis", 2) == "Neutral 80, Element 160 Münzen" and Skills.effect("startmana", 1) == "erster Zug: 3 Mana" and Skills.effect("gratisziehen", 0) == "eine Karte je Zug gratis", "Wirkungstexte in Zahlen")
|
||||
check(Skills.cheap_from(0) == 99 and Skills.cheap_from(1) == 7 and Skills.cheap_from(3) == 3 and Skills.pack_floor(0) == "Rare" and Skills.pack_floor(1) == "Super Rare", "Sparsam ab 7/5/3 Mana, Garantie Super Rare")
|
||||
var floors := true
|
||||
for i in 50:
|
||||
floors = floors and Profile.roll_booster(rr, Cards.NEUTRAL, 0, "Super Rare").any(func(x): return Cards.RARITIES.find(x.rarity) >= 2)
|
||||
check(floors, "mit Garantie hat jeder Booster eine Super Rare oder besser")
|
||||
var r2 := RandomNumberGenerator.new()
|
||||
r2.seed = 4
|
||||
var g := Game.new_battle_with(Campaign.opponent(0, r2), r2, true, {"deck": DeckGen.element_deck(Cards.NEUTRAL).slice(0, 30), "bonus_attack": 2, "bonus_health": 1, "cheap_from": 3})
|
||||
check(g.human.hand.all(func(c): return c.attack == Cards.by_id(c.id).attack + 2 and c.health == Cards.by_id(c.id).health + 1 and c.cost == Cards.by_id(c.id).cost - (1 if Cards.by_id(c.id).cost >= 3 else 0)), "Stark 2, Zäh 1, Sparsam 3: Handkarten +2/+1, ab 3 Mana 1 billiger")
|
||||
check(g.opponent.hand.all(func(c): return c.attack == Cards.by_id(c.id).attack and c.cost == Cards.by_id(c.id).cost) and g.human.clone().bonus_attack == 2 and g.human.clone().cheap_from == 3, "der Gegner bleibt wie er ist; der Klon für die Vorausschau trägt die Boni")
|
||||
var h := g.human
|
||||
var a0 := Cards.by_id(h.hand[0].id)
|
||||
var b0 := Cards.by_id(h.hand[1].id)
|
||||
var f := Game.fusion_result(h, h.hand[0], h.hand[1])
|
||||
var fa := Cards.fusion_value(a0.attack, b0.attack)
|
||||
var fh := Cards.fusion_value(a0.health, b0.health)
|
||||
check(h.hand[0].base_attack() == a0.attack and f.base_attack() == fa and f.attack == fa + 2 and f.health == fh + 1 and f.cost == Cards.cost_of(fa, fh) - (1 if Cards.cost_of(fa, fh) >= 3 else 0), "Fusion rechnet ohne Kraft und bekommt Kraft und Sparsam danach")
|
||||
check(Skills.effect("packglueck", 1) == "Chancen 37/28/17/12/6 %" and Skills.effect("packpreis", 2) == "Neutral 80, Element 160" and Skills.effect("startmana", 1) == "erster Zug: 3 Mana" and Skills.effect("gratisziehen", 0) == "eine Karte je Zug gratis", "Wirkungstexte in Zahlen")
|
||||
|
||||
|
||||
## Werkstatt und Kapitel 6 bis 10: Eigenbauten mit Eigenschaften, Effektkarten der Gegner.
|
||||
func test_werkstatt() -> void:
|
||||
check(Cards.cost_with(3, 2, [], ["Feuer"]) == 2 and Cards.cost_with(3, 2, ["Spott"], ["Feuer"]) == 3 and Cards.cost_with(3, 2, ["Spott", "Flink"], ["Feuer", "Wasser"]) == 5 and Cards.cost_with(10, 10, ["Spott", "Flink"], ["Feuer", "Wasser"]) == 15, "Kosten: Spott 1, Flink Angriff/3, zweites Element 1, über 10 hinaus")
|
||||
check(Cards.keyword_cost("Doppelschlag", 10, 10) == 6 and Cards.keyword_cost("Doppelschlag", 1, 1) == 1 and Cards.keyword_cost("Regeneration", 3, 9) == 3 and Cards.element_cost(1) == 0 and Cards.element_cost(3) == 3 and Cards.cost_with(10, 10, ["Doppelschlag", "Flink"], Cards.ELEMENTS + [Cards.NEUTRAL]) == 10 + 6 + 3 + 10, "Doppelschlag 2·Angriff/3, Regeneration Leben/3, Elemente 1+2+3+4; zusammen 29")
|
||||
check(Cards.strongest_element(["Feuer", "Wasser"], 0) == "Wasser" and Cards.strongest_element(["Luft", "Feuer"], 5) == "Feuer" and Cards.strongest_element(["Feuer", "Erde"], 0) == "Feuer" and Cards.strongest_element(["Feuer", "Erde"], 1) == "Erde" and Cards.strongest_element([Cards.NEUTRAL], 3) == Cards.NEUTRAL, "stärkstes Element: schlägt die meisten anderen, Gleichstand nach seed")
|
||||
var c := Cards.custom("c_test", "Testdrache", ["Feuer"], 3, 2, ["Spott"])
|
||||
check(c.cost == 3 and c.value() == 200 and c.is_custom() and c.text() == "Spott." and not C("f_3_2").is_custom(), "Eigenbau: Kosten 3, Wert 200, Eigenschaft im Text")
|
||||
Cards.register(c)
|
||||
check(Cards.by_id("c_test") == c and Cards.has_id("c_test") and Cards.all().size() == 550, "registriert, aber nicht im Pool")
|
||||
check(Cards.custom("c_y", "Y", ["Feuer", "Wasser"], 3, 2, []).value() == 100 and c.leveled(2).value() == 400, "zweites Element fair bezahlt: 100; Stufe 2 mit Eigenschaft: 400")
|
||||
var p := Profile.starter()
|
||||
check(not p.workshop_unlocked() and p.build_card("X", ["Feuer"], 3, 2, ["Spott"]) == "Werkstatt noch gesperrt", "Werkstatt erst nach Kapitel 5")
|
||||
p.campaign_stage = 5 * Campaign.STAGES_PER_CHAPTER
|
||||
check(p.workshop_unlocked() and p.unlocked_elements().size() == 5, "nach Kapitel 5 offen, alle Elemente")
|
||||
check(p.build_card("", ["Feuer"], 3, 2, []) == "Name fehlt" and p.build_card("X", [], 3, 2, []) == "Mindestens ein Element" and p.build_card("X", ["Feuer"], 11, 2, []) == "Angriff 0 bis 10, Leben 1 bis 10", "Prüfungen")
|
||||
var price := p.build_price(Cards.custom("c_x", "X", ["Feuer", "Wasser"], 3, 2, ["Spott"]))
|
||||
check(price == 2 * 200 + 100, "Preis: doppelter Wert plus 100 fürs zweite Element")
|
||||
p.dust = price - 1
|
||||
check(p.build_card("X", ["Feuer", "Wasser"], 3, 2, ["Spott"]) == "Nicht genug Staub (%d nötig)" % price, "zu wenig Staub")
|
||||
p.dust = price
|
||||
check(p.build_card("Dampfwächter", ["Feuer", "Wasser"], 3, 2, ["Spott"]) == "" and p.dust == 0 and p.owns("c_1") and "c_1" in p.deck and Cards.by_id("c_1").name == "Dampfwächter" and Cards.by_id("c_1").cost == 4, "gebaut: in Sammlung und Stapel, Kosten 2 + 1 + 1")
|
||||
check(p.unlocked_cards().any(func(x): return x.id == "c_1") and p.customs.size() == 1, "Eigenbau in der Sammlung sichtbar")
|
||||
p.dust = 200
|
||||
check(p.build_card("Kiesel", ["Erde"], 1, 1, []) == "" and p.owns("c_2") and p.dust == 0, "zweiter Eigenbau: c_2 für 200")
|
||||
p.dust = 1400
|
||||
check(p.build_card("Alles", Cards.ELEMENTS + [Cards.NEUTRAL], 1, 1, Cards.KEYWORDS) == "" and p.dust == 0 and Cards.by_id("c_3").cost == 1 + 10 + 4 and Cards.by_id("c_3").elements.size() == 5, "alle Elemente und Eigenschaften erlaubt: Kosten 15, Preis 1400")
|
||||
var d := Profile.from_dict(JSON.parse_string(JSON.stringify(p.to_dict())))
|
||||
check(d.owns("c_1") and d.customs.size() == 3 and Cards.by_id("c_1").keywords == ["Spott"] and Cards.by_id("c_1").elements == ["Feuer", "Wasser"], "Eigenbauten gespeichert und wieder registriert")
|
||||
check(DeckGen.strength(["c_1", "c_2"], {}) == 150, "Deckstärke zählt Eigenschaften: (200 + 100) / 2")
|
||||
# Kapitel 6 bis 10
|
||||
check(Campaign.element_of(6) == Cards.NEUTRAL and Campaign.element_of(10) == "Erde" and Campaign.keyword_count(5) == 0 and Campaign.keyword_count(6) == 1 and Campaign.keyword_count(8) == 2, "Elemente wiederholen sich; ab Kapitel 6 eine, ab 8 zwei Eigenschaften")
|
||||
check(Campaign.rarity_of(5) == 3 and Campaign.rarity_of(6) == 3 and Campaign.rarity_of(9) == 3 and Campaign.rarity_of(10) == 4 and Campaign.perk_count(9) == 3, "Ultra Rare ab Kapitel 5, Kapitel 10 Ultimate; höchstens drei Merkmale")
|
||||
check(Campaign.stage(50).title.ends_with(" II") and Campaign.stage(50).keywords == 1 and Campaign.stage(99).reward == 100 + 250 * 9 + 400 and Campaign.stage(99).name == "Archimagier", "zweite Runde: Titel II, Belohnung 2750")
|
||||
var r := RandomNumberGenerator.new()
|
||||
r.seed = 33
|
||||
var o := Campaign.opponent(75, r)
|
||||
check(o.deck.size() == Game.DECK_MIN and o.deck.all(func(id): return Cards.by_id(id).id.begins_with("g_") and Cards.by_id(id).keywords.size() == 2 and Cards.by_id(id).elements == ["Wasser"] and Cards.by_id(id).cost <= 6) and o.looks.values().all(func(l): return l == 3), "Kapitel 8, Stufe 6: Wasser-Effektkarten mit zwei Eigenschaften bis Kosten 6, Ultra Rare")
|
||||
var g := Game.new_battle_with(o, r, false, {"deck": DeckGen.element_deck(Cards.NEUTRAL).slice(0, 30)})
|
||||
check(g.opponent.hand.all(func(k): return k.keywords.size() == 2 and k.look == 3) and g.opponent.hand[0].attack == g.opponent.hand[0].base_attack() + 3, "im Kampf tragen die Karten ihre Eigenschaften und die Stufe")
|
||||
var cr := Game.Creature.new(g.opponent.hand[0], g.opponent, 7777)
|
||||
check(g.opponent.hand[0].keywords.all(func(k): return cr.has(k)), "das Wesen hat die Eigenschaften der Karte")
|
||||
|
||||
|
||||
func test_ki_zeitbudget() -> void:
|
||||
|
||||
+49
-6
@@ -185,7 +185,7 @@ func _ready() -> void:
|
||||
main.sfx.muted = true # Tests bleiben still
|
||||
await frames(3)
|
||||
var suite := [test_start, test_menu, test_gamepad_menue, test_booster, test_gegnerauswahl, test_einstellungen,
|
||||
test_kampagne, test_sammlung, test_skilltree, test_cheats, test_deck, test_sprache, test_kampf_steuerung, test_kampf_elemente_und_verschmelzen, test_kampf_grenzen]
|
||||
test_kampagne, test_sammlung, test_skilltree, test_cheats, test_werkstatt, test_deck, test_sprache, test_kampf_steuerung, test_kampf_elemente_und_verschmelzen, test_kampf_grenzen]
|
||||
suite += [test_kampf.bind(3), test_kampf_abbrechen]
|
||||
suite.append(test_profil_zuruecksetzen)
|
||||
var only := OS.get_environment("DINGER_ONLY") # z. B. DINGER_ONLY=test_sammlung,test_kampf
|
||||
@@ -501,13 +501,15 @@ func test_skilltree() -> void:
|
||||
main.save()
|
||||
await click(find_button("Skilltree"))
|
||||
var scr = screen()
|
||||
check(scr is SkillScreen and scr.level_label.text == "Level 3" and scr.points_label.text == "Skillpunkte: 3", "Skilltree: Level 3, drei Punkte")
|
||||
check(scr.learn_buttons.size() == Skills.SKILLS.size() and not scr.learn_buttons["packglueck"].disabled and scr.xp_label.text == "0 / 400 EP bis Level 4", "alle Skills mit Lernen-Knopf, Fortschritt bis Level 4")
|
||||
check(scr.now_labels["packglueck"].text == "Jetzt: Chancen 45/25/15/10/5 %" and scr.next_labels["packglueck"].text == "Nächste Stufe: Chancen 37/28/17/12/6 %", "Wirkung jetzt und nächste Stufe in Zahlen")
|
||||
check(scr is SkillScreen and scr.level_label.text == "Level 3" and scr.points_label.text == "Skillpunkte: 3" and scr.xp_label.text == "0 / 400 EP bis Level 4" and scr.xp_bar.value == 0 and scr.xp_bar.max_value == 400, "Skilltree: Level 3, drei Punkte, Balken leer")
|
||||
check(scr.nodes.size() == Skills.SKILLS.size() and scr.learn_buttons["packglueck"].visible and not scr.learn_buttons["garantie"].visible and scr.state_labels["garantie"].text == "Erst Packglück lernen" and not scr.nodes["garantie"].open, "erste Knoten lernbar, Garantie gesperrt")
|
||||
check(scr.now_labels["packglueck"].text == "Jetzt: Chancen 45/25/15/10/5 %" and scr.next_labels["packglueck"].text == "Nächste: Chancen 37/28/17/12/6 %", "Wirkung jetzt und nächste Stufe in Zahlen")
|
||||
await click(scr.learn_buttons["packglueck"])
|
||||
check(main.profile.skill("packglueck") == 1 and scr.points_label.text == "Skillpunkte: 2" and scr.rank_labels["packglueck"].text == "Stufe 1 / 3", "Packglück gelernt, Punkt verbraucht")
|
||||
check(main.profile.skill("packglueck") == 1 and scr.points_label.text == "Skillpunkte: 2" and scr.nodes["packglueck"].rank == 1 and scr.learn_buttons["garantie"].visible and scr.nodes["garantie"].open, "Packglück gelernt, Garantie offen")
|
||||
await click(scr.learn_buttons["gratisziehen"])
|
||||
check(scr.learn_buttons["gratisziehen"].disabled and scr.rank_labels["gratisziehen"].text == "Stufe 1 / 1" and scr.next_labels["gratisziehen"].text == "Höchste Stufe erreicht", "Freies Ziehen voll: Knopf aus")
|
||||
check(not scr.learn_buttons["gratisziehen"].visible and scr.state_labels["gratisziehen"].text == "Gelernt" and scr.next_labels["gratisziehen"].text == "", "Freies Ziehen voll: Gelernt statt Knopf")
|
||||
await click(scr.learn_buttons["startmana"])
|
||||
check(scr.points_label.text == "Skillpunkte: 0" and not scr.learn_buttons["garantie"].visible and scr.state_labels["garantie"].text == "Kein Skillpunkt frei", "ohne Punkte kein Knopf")
|
||||
await shot("28_skilltree")
|
||||
check(Profile.load_or_new(SAVE).skill("packglueck") == 1, "gespeichert")
|
||||
await click(find_button("Zurück"))
|
||||
@@ -541,6 +543,47 @@ func test_cheats() -> void:
|
||||
check(screen() is MenuScreen, "zurück im Menü")
|
||||
|
||||
|
||||
## Werkstatt: nach Kapitel 5 im Menü; Elemente, Werte, Eigenschaften und Name ergeben Vorschau und Preis.
|
||||
func test_werkstatt() -> void:
|
||||
check(find_button("Werkstatt") == null, "vor Kapitel 5 keine Werkstatt im Menü")
|
||||
main.profile.campaign_stage = 5 * Campaign.STAGES_PER_CHAPTER
|
||||
main.profile.dust = 1000
|
||||
main.save()
|
||||
main.show_screen(MenuScreen.new())
|
||||
await frames(2)
|
||||
check(find_button("Werkstatt") != null, "nach Kapitel 5 steht die Werkstatt im Menü")
|
||||
await click(find_button("Werkstatt"))
|
||||
var scr = screen()
|
||||
check(scr is WorkshopScreen and scr.dust_label.text == "Staub: 1000" and scr.name_box.text == "Eigenbau 1", "Werkstatt geöffnet, Vorschlagsname")
|
||||
await click(scr.element_buttons["Feuer"])
|
||||
await click(scr.element_buttons["Wasser"])
|
||||
scr.attack_slider.value = 3
|
||||
scr.health_slider.value = 2
|
||||
await click(scr.keyword_boxes["Spott"])
|
||||
scr.name_box.text = "Dampfwächter"
|
||||
scr.name_box.text_changed.emit("Dampfwächter")
|
||||
await frames(1)
|
||||
check(scr.elements == ["Feuer", "Wasser"] and scr.keywords == ["Spott"] and scr.info_label.text == "Kosten 4 Mana · Wert 200 · Preis 500 Staub", "Vorschau: Kosten 4, Wert 200, Preis 500: " + scr.info_label.text)
|
||||
check(scr.preview_holder.get_child(0).card.name == "Dampfwächter" and scr.preview_holder.get_child(0).card.cost == 4, "Vorschaukarte zeigt Name und Kosten")
|
||||
await click(scr.element_buttons["Erde"])
|
||||
await click(scr.keyword_boxes["Doppelschlag"])
|
||||
await click(scr.keyword_boxes["Flink"])
|
||||
check(scr.elements == ["Feuer", "Wasser", "Erde"] and scr.keywords == ["Spott", "Flink", "Doppelschlag"] and scr.info_label.text == "Kosten 9 Mana · Wert 400 · Preis 1000 Staub", "drei Elemente, drei Eigenschaften in fester Reihenfolge: " + scr.info_label.text)
|
||||
await shot("30_werkstatt")
|
||||
await click(scr.element_buttons["Erde"])
|
||||
await click(scr.keyword_boxes["Doppelschlag"])
|
||||
await click(scr.keyword_boxes["Flink"])
|
||||
check(scr.elements == ["Feuer", "Wasser"] and scr.keywords == ["Spott"], "wieder abgewählt")
|
||||
await click(find_button("Bauen"))
|
||||
var p: Profile = main.profile
|
||||
check(p.owns("c_1") and p.dust == 500 and "c_1" in p.deck and scr.msg_label.text == "Gebaut: Dampfwächter" and scr.name_box.text == "Eigenbau 2", "gebaut: 500 Staub weg, Karte in Sammlung und Stapel")
|
||||
check(Profile.load_or_new(SAVE).owns("c_1") and Cards.by_id("c_1").keywords == ["Spott"] and Cards.by_id("c_1").elements == ["Feuer", "Wasser"], "gespeichert")
|
||||
await click(find_button("Zurück"))
|
||||
check(screen() is MenuScreen, "zurück im Menü")
|
||||
main.profile.campaign_stage = 0
|
||||
main.save()
|
||||
|
||||
|
||||
## Deck: eigene Karten rein und raus, Auffüllen nach Filter, Speichern. Beginnt mit einem frischen Profil.
|
||||
func test_deck() -> void:
|
||||
main.reset_profile()
|
||||
|
||||
Reference in new issue
Block a user