From b16df174ed6603ba2a221b67285837f14d1b033d Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 10 Nov 2021 18:00:43 -0500 Subject: [PATCH] update game_view to handle targeting --- PROTOCOL.md | 1 + game_view.go | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index acf0f2e..ff2c9a4 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -61,6 +61,7 @@ Action commands return either an empty list of cards or the relevant list of car p : Play the card at position X in the current players hand to position Y on the current player's side of the board. Return nothing if the card cannot be played, otherwise return the current players side of the board. m : Move the card at position X to position Y, with both positions being on the current players side of the board. Return nothing if the card cannot be moved, otherwise return the current players side of the board. a : Attack with the card at position X on the current players side of the board at position Y on the opponents side of the board. Returns nothing if the attack can not be made, or the current players side of the board. + t : Apply a targeted effect to card on board X (Either SentinalID or ScourgeID) at position Y. Returns the effected board on success and nothing on failure. Requires a card with a targeted effect to be played first ### GameView diff --git a/game_view.go b/game_view.go index 4dd6cad..52e3a52 100644 --- a/game_view.go +++ b/game_view.go @@ -3,16 +3,18 @@ package tome_lib import "fmt" type GameView struct { - Board *Board `json:"board"` - Player *Player `json:"player"` - DeckSize int `json:"deck_size"` - EnemyLife int `json:"enemy_life"` - EnemyDeckSize int `json:"enemy_deck_size"` - EnemyHandSize int `json:"enemy_hand_size"` - CurrentTurn int `json:"current_turn"` - CanDraw bool `json:"can_draw"` - HasDrawn bool `json:"has_drawn"` - Status GameStatus `json:"game_status"` + Board *Board `json:"board"` + Player *Player `json:"player"` + DeckSize int `json:"deck_size"` + EnemyLife int `json:"enemy_life"` + EnemyDeckSize int `json:"enemy_deck_size"` + EnemyHandSize int `json:"enemy_hand_size"` + CurrentTurn int `json:"current_turn"` + CanDraw bool `json:"can_draw"` + HasDrawn bool `json:"has_drawn"` + QueuedEffect *Effect `json:"queued_effect"` + TargetReq TargetStatus `json:"target_required"` + Status GameStatus `json:"game_status"` } func (v *GameView) String() string {