can't play card message

This commit is contained in:
Alberto Xamin 2021-07-01 17:46:16 +02:00
parent bab5e47041
commit 276e1c8275
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
4 changed files with 11 additions and 0 deletions

View File

@ -592,6 +592,7 @@ class Player:
self.hand.insert(hand_index, card) self.hand.insert(hand_index, card)
if withCard: if withCard:
self.hand.insert(_with, withCard) self.hand.insert(_with, withCard)
self.sio.emit('cant_play_card', room=self.sid)
elif (card.usable_next_turn and card.can_be_used_now) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK): elif (card.usable_next_turn and card.can_be_used_now) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK):
if did_play_card: if did_play_card:
self.game.deck.scrap(card, True) self.game.deck.scrap(card, True)

View File

@ -55,6 +55,7 @@
<Chooser v-if="win_status !== undefined" :text="win_status?$t('you_win'):$t('you_lose')" /> <Chooser v-if="win_status !== undefined" :text="win_status?$t('you_win'):$t('you_lose')" />
<Chooser v-if="show_role" :text="$t('you_are')" :cards="[my_role]" :hintText="($i18n.locale=='it'?my_role.goal:my_role.goal_eng)" :select="() => {show_role=false}" :cancel="() => {show_role=false}" :cancelText="$t('ok')" /> <Chooser v-if="show_role" :text="$t('you_are')" :cards="[my_role]" :hintText="($i18n.locale=='it'?my_role.goal:my_role.goal_eng)" :select="() => {show_role=false}" :cancel="() => {show_role=false}" :cancelText="$t('ok')" />
<Chooser v-if="notifycard" :key="notifycard.card" :text="`${notifycard.player} ${$t('did_pick_as')}:`" :cards="[notifycard.card]" :hintText="$t(notifycard.message)" class="turn-notify-4s"/> <Chooser v-if="notifycard" :key="notifycard.card" :text="`${notifycard.player} ${$t('did_pick_as')}:`" :cards="[notifycard.card]" :hintText="$t(notifycard.message)" class="turn-notify-4s"/>
<Chooser v-if="cantplaycard" :key="cantplaycard" :text="`${$t('cantplaycard')}`" class="turn-notify-4s"/>
<Chooser v-if="!show_role && is_my_turn && pending_action < 2" :text="$t('play_your_turn')" :key="is_my_turn" class="turn-notify" /> <Chooser v-if="!show_role && is_my_turn && pending_action < 2" :text="$t('play_your_turn')" :key="is_my_turn" class="turn-notify" />
<Chooser v-if="!show_role && availableCharacters.length > 0" :text="$t('choose_character')" :cards="availableCharacters" :select="setCharacter"/> <Chooser v-if="!show_role && availableCharacters.length > 0" :text="$t('choose_character')" :cards="availableCharacters" :select="setCharacter"/>
<Chooser v-if="hasToPickResponse" :playAudio="true" :text="`${$t('pick_a_card')} ${attacker?($t('to_defend_from')+' '+attacker):''}`" :key="hasToPickResponse" class="turn-notify" /> <Chooser v-if="hasToPickResponse" :playAudio="true" :text="`${$t('pick_a_card')} ${attacker?($t('to_defend_from')+' '+attacker):''}`" :key="hasToPickResponse" class="turn-notify" />
@ -129,6 +130,7 @@ export default {
noStar: false, noStar: false,
committed_suit_manette: null, committed_suit_manette: null,
gold_nuggets: 0, gold_nuggets: 0,
cantplaycard: false,
}), }),
sockets: { sockets: {
role(role) { role(role) {
@ -198,6 +200,12 @@ export default {
this.notifycard = null this.notifycard = null
}.bind(this), 4000) }.bind(this), 4000)
}, },
cant_play_card() {
this.cantplaycard = true
setTimeout(function(){
this.cantplaycard = false
}.bind(this), 1000)
},
event_card(card) { event_card(card) {
this.eventCard = card this.eventCard = card
}, },

View File

@ -82,6 +82,7 @@
"submit": "Submit", "submit": "Submit",
"copy": "Copy invite", "copy": "Copy invite",
"no_players_in_range": "You can't see the other players, equip a weapon or a scope!", "no_players_in_range": "You can't see the other players, equip a weapon or a scope!",
"cantplaycard": "You can't play this card like that!",
"chat": { "chat": {
"spectators": " | A spectator is watching the game | {n} spectators are watching the game", "spectators": " | A spectator is watching the game | {n} spectators are watching the game",
"chat": "Chat", "chat": "Chat",

View File

@ -82,6 +82,7 @@
"submit": "Invia", "submit": "Invia",
"copy": "Copia invito", "copy": "Copia invito",
"no_players_in_range": "Non vedi nessun giocatore, equipaggia un arma o un mirino!", "no_players_in_range": "Non vedi nessun giocatore, equipaggia un arma o un mirino!",
"cantplaycard": "Non puoi giocare questa carta in questo modo!",
"chat": { "chat": {
"spectators": " | Uno spettatore sta guardando la partita | {n} spettatori stanno guardando la partita", "spectators": " | Uno spettatore sta guardando la partita | {n} spettatori stanno guardando la partita",
"chat": "Chat", "chat": "Chat",