From 0f2ef6c219266b5ca877eef80020a0f2d14e4af7 Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Thu, 28 May 2020 09:57:13 +0200 Subject: Add server-side support for PLAY_FREE_DISCARDED special ability So far, there was no "turn" generated for the player who could play a free card from the discarded pile. --- .../src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt | 5 ++++- .../commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'sw-common-model') diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt index d5503bc9..12084539 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/Moves.kt @@ -15,6 +15,7 @@ enum class Action(val message: String) { PLAY("Pick the card you want to play or discard."), PLAY_2("Pick the first card you want to play or discard. Note that you have the ability to play these 2 last cards. You will choose how to play the last one during your next turn."), PLAY_LAST("You have the special ability to play your last card. Choose how you want to play it."), + PLAY_FREE_DISCARDED("Pick a card from the discarded deck, you can play it for free."), PICK_NEIGHBOR_GUILD("Choose a Guild card (purple) that you want to copy from one of your neighbours."), WAIT("Please wait for other players to perform extra actions."), WATCH_SCORE("The game is over! Look at the scoreboard to see the final ranking!") @@ -27,7 +28,8 @@ data class PlayerTurnInfo( val action: Action, val hand: List?, val preparedMove: PlayedMove?, - val neighbourGuildCards: List, + val neighbourGuildCards: List, + val discardedCards: List?, // only present when the player can actually see them val scoreBoard: ScoreBoard? = null ) { val currentAge: Int = table.currentAge @@ -62,6 +64,7 @@ data class PlayerMove( enum class MoveType { PLAY, PLAY_FREE, + PLAY_FREE_DISCARDED, UPGRADE_WONDER, DISCARD, COPY_GUILD; diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt index fdb4d11b..5c7616a1 100644 --- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt +++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/cards/Cards.kt @@ -55,6 +55,7 @@ data class CardBack(val image: String) enum class PlayabilityLevel(val message: String) { CHAINABLE("free because of a card on the board"), NO_REQUIREMENTS("free"), + SPECIAL_FREE("free because of a special ability"), ENOUGH_RESOURCES("free"), ENOUGH_GOLD("enough gold"), ENOUGH_GOLD_AND_RES("enough gold and resources"), -- cgit