Files
pirate-dice/tests/nochmal_laeufer.gd
2026-09-16 13:21:56 +02:00

23 lines
949 B
GDScript

extends "res://tests/basis.gd"
var game: Node
var neu: Node
func _ready() -> void:
get_tree().change_scene_to_file("res://scenes/main.tscn")
await get_tree().create_timer(0.5).timeout
Net.start_singleplayer("Tester", 2, 0)
await _warte(func(): game = _find(get_tree().root, "Game"); return game != null, 20.0)
await _warte(func(): return game.phase == "bid", 40.0)
_pruef("Erste Partie läuft, Stufe leicht", DiceAI.stufe == 0 and game.seats.size() == 3)
game._on_rematch()
await _warte(func(): neu = _find(get_tree().root, "Game"); return neu != null and is_instance_valid(neu) and neu != game, 15.0)
_pruef("Nochmal startet eine neue Partie", neu != null)
if neu != null:
await _warte(func(): return neu.phase == "bid", 40.0)
_pruef("Gleiche Bots, gleiche Stufe, Wunsch gelöscht",
neu.seats.size() == 3 and DiceAI.stufe == 0 and Net.rematch.is_empty())
_pruef("Kein Endbildschirm", not neu.hud.over_slot.visible)
_fertig()