text for card choose

This commit is contained in:
Alberto Xamin 2020-12-22 23:28:57 +01:00
parent 2a7ffcbf43
commit 25bf088c3e
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
5 changed files with 26 additions and 1 deletions

View File

@ -198,6 +198,7 @@ class Game:
def emporio(self): def emporio(self):
self.available_cards = [self.deck.draw(True) for i in range(len([p for p in self.players if p.lives > 0]))] self.available_cards = [self.deck.draw(True) for i in range(len([p for p in self.players if p.lives > 0]))]
self.players[self.turn].pending_action = pl.PendingAction.CHOOSE self.players[self.turn].pending_action = pl.PendingAction.CHOOSE
self.players[self.turn].choose_text = 'choose_card_to_get'
self.players[self.turn].available_cards = self.available_cards self.players[self.turn].available_cards = self.available_cards
self.players[self.turn].notify_self() self.players[self.turn].notify_self()
@ -212,6 +213,7 @@ class Game:
self.players[self.turn].notify_self() self.players[self.turn].notify_self()
else: else:
nextPlayer.pending_action = pl.PendingAction.CHOOSE nextPlayer.pending_action = pl.PendingAction.CHOOSE
self.players[self.turn].choose_text = 'choose_card_to_get'
nextPlayer.available_cards = self.available_cards nextPlayer.available_cards = self.available_cards
nextPlayer.notify_self() nextPlayer.notify_self()

View File

@ -51,6 +51,7 @@ class Player:
self.can_play_vendetta = True self.can_play_vendetta = True
self.is_giving_life = False self.is_giving_life = False
self.is_using_checchino = False self.is_using_checchino = False
self.choose_text = 'choose_card_to_get'
self.using_rimbalzo = 0 # 0 no, 1 scegli giocatore, 2 scegli carta self.using_rimbalzo = 0 # 0 no, 1 scegli giocatore, 2 scegli carta
self.can_play_ranch = True self.can_play_ranch = True
self.is_playing_ranch = False self.is_playing_ranch = False
@ -162,6 +163,7 @@ class Player:
'icon': '' 'icon': ''
}] }]
self.is_drawing = True self.is_drawing = True
self.choose_text = 'choose_guess'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
elif self.can_play_ranch and self.pending_action == PendingAction.PLAY and self.game.check_event(ce.Ranch): elif self.can_play_ranch and self.pending_action == PendingAction.PLAY and self.game.check_event(ce.Ranch):
self.can_play_ranch = False self.can_play_ranch = False
@ -169,6 +171,7 @@ class Player:
self.discarded_cards = [] self.discarded_cards = []
self.available_cards.append({'icon': ''}) self.available_cards.append({'icon': ''})
self.is_playing_ranch = True self.is_playing_ranch = True
self.choose_text = 'choose_ranch'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
elif isinstance(self.character, chars.SuzyLafayette) and len(self.hand) == 0 and ( not self.is_my_turn or self.pending_action == PendingAction.PLAY): elif isinstance(self.character, chars.SuzyLafayette) and len(self.hand) == 0 and ( not self.is_my_turn or self.pending_action == PendingAction.PLAY):
self.hand.append(self.game.deck.draw(True)) self.hand.append(self.game.deck.draw(True))
@ -320,6 +323,7 @@ class Player:
'alt_text': ''.join(['❤️']*p.lives)+''.join(['💀']*(p.max_lives-p.lives)) 'alt_text': ''.join(['❤️']*p.lives)+''.join(['💀']*(p.max_lives-p.lives))
} for p in self.game.players if p != self and p.lives < p.max_lives] } for p in self.game.players if p != self and p.lives < p.max_lives]
self.available_cards.append({'icon': ''}) self.available_cards.append({'icon': ''})
self.choose_text = 'choose_fratelli_di_sangue'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
self.is_giving_life = True self.is_giving_life = True
elif not self.game.check_event(ce.Lazo) and any([isinstance(c, cs.Dinamite) or isinstance(c, cs.Prigione) for c in self.equipment]): elif not self.game.check_event(ce.Lazo) and any([isinstance(c, cs.Dinamite) or isinstance(c, cs.Prigione) for c in self.equipment]):
@ -342,6 +346,7 @@ class Player:
'alt_text': ''.join(['❤️']*p['lives'])+''.join(['💀']*(p['max_lives']-p['lives'])) 'alt_text': ''.join(['❤️']*p['lives'])+''.join(['💀']*(p['max_lives']-p['lives']))
} for p in self.game.get_visible_players(self) if p['dist'] <= self.get_sight()] } for p in self.game.get_visible_players(self) if p['dist'] <= self.get_sight()]
self.available_cards.append({'icon': ''}) self.available_cards.append({'icon': ''})
self.choose_text = 'choose_cecchino'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
self.notify_self() self.notify_self()
elif self.is_my_turn and self.pending_action == PendingAction.PLAY and pile == 'event' and self.game.check_event(ce.Rimbalzo) and len([c for c in self.hand if c.name == cs.Bang(0,0).name]) > 0: elif self.is_my_turn and self.pending_action == PendingAction.PLAY and pile == 'event' and self.game.check_event(ce.Rimbalzo) and len([c for c in self.hand if c.name == cs.Bang(0,0).name]) > 0:
@ -350,6 +355,7 @@ class Player:
'icon': '⭐️' if isinstance(p.role, r.Sheriff) else '🤠' 'icon': '⭐️' if isinstance(p.role, r.Sheriff) else '🤠'
} for p in self.game.players if len(p.equipment) > 0 and p != self] } for p in self.game.players if len(p.equipment) > 0 and p != self]
self.available_cards.append({'icon': ''}) self.available_cards.append({'icon': ''})
self.choose_text = 'choose_rimbalzo_player'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
self.using_rimbalzo = 1 self.using_rimbalzo = 1
self.notify_self() self.notify_self()
@ -362,11 +368,13 @@ class Player:
elif isinstance(self.character, chars.KitCarlson): elif isinstance(self.character, chars.KitCarlson):
self.is_drawing = True self.is_drawing = True
self.available_cards = [self.game.deck.draw() for i in range(3)] self.available_cards = [self.game.deck.draw() for i in range(3)]
self.choose_text = 'choose_card_to_get'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
self.notify_self() self.notify_self()
elif isinstance(self.character, chd.PatBrennan) and type(pile) == str and pile != self.name and pile in self.game.players_map and len(self.game.get_player_named(pile).equipment) > 0: elif isinstance(self.character, chd.PatBrennan) and type(pile) == str and pile != self.name and pile in self.game.players_map and len(self.game.get_player_named(pile).equipment) > 0:
self.is_drawing = True self.is_drawing = True
self.available_cards = self.game.get_player_named(pile).equipment self.available_cards = self.game.get_player_named(pile).equipment
self.choose_text = 'choose_card_to_get'
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE
self.notify_self() self.notify_self()
else: else:
@ -569,6 +577,7 @@ class Player:
if self.using_rimbalzo == 1 and 'name' in self.available_cards[card_index]: if self.using_rimbalzo == 1 and 'name' in self.available_cards[card_index]:
self.rimbalzo_p = self.available_cards[card_index]['name'] self.rimbalzo_p = self.available_cards[card_index]['name']
self.available_cards = self.game.get_player_named(self.available_cards[card_index]['name']).equipment self.available_cards = self.game.get_player_named(self.available_cards[card_index]['name']).equipment
self.choose_text = 'choose_rimbalzo_card'
self.using_rimbalzo = 2 self.using_rimbalzo = 2
elif self.using_rimbalzo == 2 and 'name' in self.available_cards[card_index].__dict__: elif self.using_rimbalzo == 2 and 'name' in self.available_cards[card_index].__dict__:
card = next(c for c in self.hand if c.name == cs.Bang(0,0).name) card = next(c for c in self.hand if c.name == cs.Bang(0,0).name)

View File

@ -38,7 +38,7 @@
<Chooser v-if="is_my_turn && pending_action == 4" :text="$t('wait')" :cards="[]"/> <Chooser v-if="is_my_turn && pending_action == 4" :text="$t('wait')" :cards="[]"/>
<Chooser v-if="card_against" :text="$t('card_against')" :cards="visiblePlayers" :select="selectAgainst" :cancel="cancelCardAgainst"/> <Chooser v-if="card_against" :text="$t('card_against')" :cards="visiblePlayers" :select="selectAgainst" :cancel="cancelCardAgainst"/>
<Chooser v-if="pending_action == 3" :text="respondText" :cards="respondCards" :select="respond"/> <Chooser v-if="pending_action == 3" :text="respondText" :cards="respondCards" :select="respond"/>
<Chooser v-if="shouldChooseCard" :text="$t('choose_card_to_get')" :cards="available_cards" :select="choose"/> <Chooser v-if="shouldChooseCard" :text="$t(choose_text)" :cards="available_cards" :select="choose"/>
<Chooser v-if="lives <= 0 && max_lives > 0" :text="$t('you_died')" :cancelText="$t('spectate')" :cancel="()=>{max_lives = 0}"/> <Chooser v-if="lives <= 0 && max_lives > 0" :text="$t('you_died')" :cancelText="$t('spectate')" :cancel="()=>{max_lives = 0}"/>
<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')" />
@ -101,6 +101,7 @@ export default {
desc: '', desc: '',
scrapHand: [], scrapHand: [],
sidWantsScrapForHealth: false, sidWantsScrapForHealth: false,
choose_text: '',
joseScrap: false, joseScrap: false,
holydayScrap: false, holydayScrap: false,
special_use_count: 0, special_use_count: 0,
@ -128,6 +129,7 @@ export default {
this.max_lives = self.max_lives this.max_lives = self.max_lives
this.has_played_bang = self.has_played_bang this.has_played_bang = self.has_played_bang
this.special_use_count = self.special_use_count this.special_use_count = self.special_use_count
this.choose_text = self.choose_text
this.is_my_turn = self.is_my_turn this.is_my_turn = self.is_my_turn
if (this.is_my_turn) document.title = this.$t('your_turn')+' | PewPew!' if (this.is_my_turn) document.title = this.$t('your_turn')+' | PewPew!'
else if (this.pending_action == 3) document.title = this.$t('your_response')+' | PewPew!' else if (this.pending_action == 3) document.title = this.$t('your_response')+' | PewPew!'

View File

@ -38,6 +38,12 @@
"hand": "HAND", "hand": "HAND",
"card_against": "Who will you play your card against?", "card_against": "Who will you play your card against?",
"choose_card_to_get": "Choose a card", "choose_card_to_get": "Choose a card",
"choose_guess": "Guess the color of the suit",
"choose_ranch": "Choose the cards to replace",
"choose_fratelli_di_sangue": "Choose who you want to donate one of your lives",
"choose_cecchino": "Choose who to shoot",
"choose_rimbalzo_player": "Choose the target of the bang",
"choose_rimbalzo_card": "Choose the card to discard the bang to",
"you_died":"YOU DIED", "you_died":"YOU DIED",
"spectate":"SPECTATE", "spectate":"SPECTATE",
"you_win":"YOU WON", "you_win":"YOU WON",

View File

@ -38,6 +38,12 @@
"hand": "MANO", "hand": "MANO",
"card_against": "Contro chi vuoi giocare la carta", "card_against": "Contro chi vuoi giocare la carta",
"choose_card_to_get": "Scegli che carta pescare", "choose_card_to_get": "Scegli che carta pescare",
"choose_guess": "Indovina il colore del seme",
"choose_ranch": "Scegli le carte da sostituire",
"choose_fratelli_di_sangue": "Scegli a chi donare una delle tue vite",
"choose_cecchino": "Scegli contro chi sparare",
"choose_rimbalzo_player": "Scegli contro chi scartare il bang",
"choose_rimbalzo_card": "Scegli contro che carta scartare il bang",
"you_died": "SEI MORTO", "you_died": "SEI MORTO",
"spectate": "SPETTATORE", "spectate": "SPETTATORE",
"you_win": "HAI VINTO", "you_win": "HAI VINTO",