This commit is contained in:
team3
2026-09-16 16:15:13 +02:00
parent b9d6b115c0
commit f1c78f66f4
17 changed files with 676 additions and 458 deletions

View File

@@ -18,6 +18,9 @@ var hud: CanvasLayer
## setzen 0, sonst dauert eine Bot-Partie Minuten statt Sekunden. Kein
## class_name dafür: den Klassencache baut nur der Editor, headless fehlt er.
var tempo := 1.0
## Würfel je Platz zu Beginn. Bonuswürfel (Nachschub, Genau) füllen nur bis
## hierhin auf - so wird der Tisch über die Partie sicher leerer.
var dice_start := START_DICE
var rng := RandomNumberGenerator.new()
var seats: Array = [] ## [{peer, name, ai, count, alive}]
@@ -65,11 +68,13 @@ func setup(cfg: Dictionary) -> void:
if cfg.has("seats"):
# Rückkehrer: die laufende Aufstellung, Platz für Platz, in der
# Reihenfolge des Servers - daran hängen alle Indizes im Zustand.
dice_start = int(cfg.get("dice", START_DICE))
for s in cfg.seats:
seats.append({"peer": int(s.peer), "name": String(s.name), "ai": bool(s.ai),
"count": int(s.count), "alive": bool(s.alive), "verwaist": false})
else:
var dice := int(cfg.get("dice", START_DICE)) # Tests spielen mit weniger
dice_start = dice
var peers: Array = cfg.peers
for p in peers:
seats.append({"peer": int(p), "name": String(cfg.names[p]), "ai": false,
@@ -146,7 +151,7 @@ func wiedereinstieg(peer: int, pname: String) -> Dictionary:
aufstellung.append({"peer": t.peer, "name": t.name, "ai": t.ai,
"count": t.count, "alive": t.alive})
_nachliefern(i)
return {"seats": aufstellung, "stufe": DiceAI.stufe}
return {"seats": aufstellung, "stufe": DiceAI.stufe, "dice": dice_start}
return {}
@@ -628,6 +633,7 @@ func _state_for(seat: int) -> Dictionary:
"bids": _seat_bids(),
"verlauf": verlauf.duplicate(true),
"topf_an": _topf_ziel,
"voll": seats[seat].count >= dice_start,
"log": log_lines.duplicate(),
"hand": (hand.get(seat, []) as Array).duplicate(),
}