update
This commit is contained in:
@@ -73,22 +73,20 @@ func _act_host() -> void:
|
||||
_decide(game.players[seat])
|
||||
|
||||
|
||||
## Einfache Züge mit kurzer Bedenkzeit: erst das billigste bezahlbare Angebot kaufen, dann das
|
||||
## erste spielbare Wesen ohne Ziel, dann angreifen, sonst Zug beenden.
|
||||
## Einfache Züge mit kurzer Bedenkzeit: erst eine offene Wahl treffen, dann das erste
|
||||
## spielbare Wesen ohne Ziel legen, dann angreifen, dann ziehen, sonst Zug beenden.
|
||||
func _decide(me: Game.Player) -> void:
|
||||
var g := game
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
if game != g or (hosting and (net.game == null or net.game.current_idx != seat)):
|
||||
return # inzwischen ein neuer Zustand
|
||||
for i in me.shop.size():
|
||||
var offer = me.shop[i]
|
||||
if offer != null and me.energy >= offer.cost and me.hand.size() < Game.MAX_HAND:
|
||||
net.send_action({"type": "buy", "slot": i})
|
||||
return
|
||||
if not me.offer.is_empty():
|
||||
net.send_action({"type": "pick", "index": 0})
|
||||
return
|
||||
for i in me.hand.size():
|
||||
var card: Cards.Card = me.hand[i]
|
||||
if game.can_play(me, card)[0] and card.target_type() == "":
|
||||
net.send_action({"type": "play", "hand": i, "target": null})
|
||||
if game.can_play(me, card)[0]:
|
||||
net.send_action({"type": "play", "hand": i})
|
||||
return
|
||||
for cr in me.board:
|
||||
if cr.can_attack():
|
||||
@@ -100,4 +98,7 @@ func _decide(me: Game.Player) -> void:
|
||||
if game.can_attack(cr, c)[0]:
|
||||
net.send_action({"type": "attack", "uid": cr.uid, "target": {"kind": "creature", "uid": c.uid}})
|
||||
return
|
||||
if game.can_draw(me)[0]:
|
||||
net.send_action({"type": "draw"})
|
||||
return
|
||||
net.send_action({"type": "end"})
|
||||
|
||||
Reference in New Issue
Block a user