feat(ability-prompts): wire all 8 pending pick types end-to-end
Server:
- GameMessages.cs: add push DTOs for CostGroupPick, ActionGroupPick,
BranchPick, TargetPick, TilePick, PlayerPick, RevealChoicePick
- GameHandlerBase.PushStateToPlayersAsync: push all 8 pending types
(including existing CostPick which was missing its push) to the
chooser player after every state update and on reconnect
Client:
- Game.gd: add 8 signals, 8 send functions, 8 push routes matching
game.ability.{cost,cost_group,action_group,branch,target,tile,player,
reveal_choice}_pick_request
- game_screen.gd: add handlers for all 8 types:
- cost_pick: hand-card selection panel with confirm
- cost_group_pick / action_group_pick: option-button panels
- branch_pick: same UI as local ChooseOne but sends game.branch_pick
- target_pick: reuses ABILITY_TARGET mode, flag routes to game.target_pick
- tile_pick: highlights valid tiles, click sends game.tile_pick
- player_pick: player-button panel from server-supplied validPlayerIds
- reveal_choice_pick: click-to-order card list, sends game.reveal_choice_pick
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -50,6 +50,39 @@ signal game_activity(event_type: String, session_id: String)
|
||||
## Payload keys: requestId, sourceInstanceId, abilityName, actionJson, rangeJson
|
||||
signal triggered_target_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when an interactive cost requires the player to select cards/units.
|
||||
## Payload keys: requestId, sourceInstanceId, costType, amount, pickMode, filtersJson
|
||||
signal cost_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when a CostGroup OR/XOR requires the chooser to pick an option.
|
||||
## Payload keys: requestId, sourceInstanceId, costGroupJson
|
||||
signal cost_group_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when an ActionGroup OR/XOR requires the chooser to pick a branch.
|
||||
## Payload keys: requestId, sourceInstanceId, actionGroupJson
|
||||
signal action_group_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when a ChooseOne (Opponent/Ally chooser) requires a branch selection.
|
||||
## Payload keys: requestId, sourceInstanceId, branchCount, branchesJson
|
||||
signal branch_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when an action needs the Opponent/Ally to pick targets.
|
||||
## Payload keys: requestId, sourceInstanceId, actionJson, rangeJson
|
||||
signal target_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when an effect requires a tile selection.
|
||||
## Payload keys: requestId, sourceInstanceId, effectType, requireEmpty, requireOccupied,
|
||||
## occupantOwnership, maxRange, targetInstanceId
|
||||
signal tile_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when an effect requires a player selection.
|
||||
## Payload keys: requestId, sourceInstanceId, effectType, ownership, validPlayerIds, targetInstanceId
|
||||
signal player_pick_request(request_data: Dictionary)
|
||||
|
||||
## Emitted when cards are revealed and must be ordered by the chooser.
|
||||
## Payload keys: requestId, sourceInstanceId, effectType, revealedCardsJson, count
|
||||
signal reveal_choice_pick_request(request_data: Dictionary)
|
||||
|
||||
# ── State ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
var session_id : String = ""
|
||||
@@ -360,6 +393,59 @@ func send_triggered_target_response(request_id: String, targets: Array) -> void:
|
||||
payload["targets"] = targets
|
||||
_game_request("game.triggered_target", payload)
|
||||
|
||||
|
||||
func send_cost_pick_response(request_id: String, selected_instance_ids: Array) -> void:
|
||||
_game_request("game.cost_pick", {
|
||||
"requestId": request_id,
|
||||
"selectedInstanceIds": selected_instance_ids
|
||||
})
|
||||
|
||||
|
||||
func send_cost_group_pick_response(request_id: String, choice_index: int) -> void:
|
||||
_game_request("game.cost_group_pick", {
|
||||
"requestId": request_id,
|
||||
"choiceIndex": choice_index
|
||||
})
|
||||
|
||||
|
||||
func send_action_group_pick_response(request_id: String, choice_index: int) -> void:
|
||||
_game_request("game.action_group_pick", {
|
||||
"requestId": request_id,
|
||||
"choiceIndex": choice_index
|
||||
})
|
||||
|
||||
|
||||
func send_branch_pick_response(request_id: String, branch_index: int) -> void:
|
||||
_game_request("game.branch_pick", {
|
||||
"requestId": request_id,
|
||||
"branchIndex": branch_index
|
||||
})
|
||||
|
||||
|
||||
func send_target_pick_response(request_id: String, targets: Array) -> void:
|
||||
var payload : Dictionary = { "requestId": request_id }
|
||||
if not targets.is_empty():
|
||||
payload["targets"] = targets
|
||||
_game_request("game.target_pick", payload)
|
||||
|
||||
|
||||
func send_tile_pick_response(request_id: String, x: int, y: int) -> void:
|
||||
_game_request("game.tile_pick", { "requestId": request_id, "x": x, "y": y })
|
||||
|
||||
|
||||
func send_player_pick_response(request_id: String, picked_player_id: String) -> void:
|
||||
_game_request("game.player_pick", {
|
||||
"requestId": request_id,
|
||||
"pickedPlayerId": picked_player_id
|
||||
})
|
||||
|
||||
|
||||
func send_reveal_choice_pick_response(request_id: String, ordered_indices: Array) -> void:
|
||||
_game_request("game.reveal_choice_pick", {
|
||||
"requestId": request_id,
|
||||
"orderedIndices": ordered_indices
|
||||
})
|
||||
|
||||
# ── Private ───────────────────────────────────────────────────────────────────
|
||||
|
||||
func _game_request(msg_type: String, extra: Dictionary) -> void:
|
||||
@@ -709,3 +795,27 @@ func _on_server_push(type: String, payload: Variant) -> void:
|
||||
|
||||
"game.ability.triggered_target_request":
|
||||
triggered_target_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.cost_pick_request":
|
||||
cost_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.cost_group_pick_request":
|
||||
cost_group_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.action_group_pick_request":
|
||||
action_group_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.branch_pick_request":
|
||||
branch_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.target_pick_request":
|
||||
target_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.tile_pick_request":
|
||||
tile_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.player_pick_request":
|
||||
player_pick_request.emit(payload as Dictionary)
|
||||
|
||||
"game.ability.reveal_choice_pick_request":
|
||||
reveal_choice_pick_request.emit(payload as Dictionary)
|
||||
|
||||
Reference in New Issue
Block a user