we write the role of who wins

This commit is contained in:
Giulio 2021-06-28 11:05:55 +02:00
parent 8f1f8a9698
commit afe14909b0
4 changed files with 6 additions and 8 deletions

View File

@ -382,7 +382,7 @@ class Game:
if p.win_status: if p.win_status:
if not self.someone_won: if not self.someone_won:
self.someone_won = True self.someone_won = True
self.sio.emit('chat_message', room=self.name, data=f'_won|{p.name}') self.sio.emit('chat_message', room=self.name, data=f'_won|{p.name}|{p.role.name}')
p.notify_self() p.notify_self()
for i in range(5): for i in range(5):
self.sio.emit('chat_message', room=self.name, data=f'_lobby_reset|{5-i}') self.sio.emit('chat_message', room=self.name, data=f'_lobby_reset|{5-i}')

View File

@ -57,7 +57,7 @@ export default {
} }
let params = msg.split('|') let params = msg.split('|')
let type = params.shift().substring(1) let type = params.shift().substring(1)
if (["flipped", "respond", "play_card", "play_card_against", "play_card_for", "spilled_beer", "diligenza", "wellsfargo", "saloon", "special_calamity"].indexOf(type) !== -1){ if (["flipped", "respond", "play_card", "play_card_against", "play_card_for", "spilled_beer", "diligenza", "wellsfargo", "saloon", "special_calamity", 'won'].indexOf(type) !== -1){
params[1] = this.$t(`cards.${params[1]}.name`) params[1] = this.$t(`cards.${params[1]}.name`)
} else if (type === "choose_character"){ } else if (type === "choose_character"){
params.push(this.$t(`cards.${params[1]}.desc`)) params.push(this.$t(`cards.${params[1]}.desc`))

View File

@ -88,7 +88,7 @@
"joined": "{0} joined the lobby", "joined": "{0} joined the lobby",
"died": "{0} died", "died": "{0} died",
"died_role": "{0} was a {1}!", "died_role": "{0} was a {1}!",
"won": "{0} won!", "won": "{0} won! Their role was {1}",
"choose_character": "{0} has {1} as character, his special ability is: {2}!", "choose_character": "{0} has {1} as character, his special ability is: {2}!",
"starting": "The game is starting!", "starting": "The game is starting!",
"sheriff": "{0} is the sheriff!", "sheriff": "{0} is the sheriff!",
@ -576,8 +576,7 @@
"desc": "On the beginning of his turn, the player is target of as many Bang as how many cards he has in his hand" "desc": "On the beginning of his turn, the player is target of as many Bang as how many cards he has in his hand"
}, },
"Pepita": { "Pepita": {
"name": "Gold Nugget", "name": "Gold Nugget"
"desc": ""
}, },
"Bicchierino": { "Bicchierino": {
"name": "Shot Glass", "name": "Shot Glass",

View File

@ -88,7 +88,7 @@
"joined": "{0} è entrato nella stanza", "joined": "{0} è entrato nella stanza",
"died": "{0} è morto", "died": "{0} è morto",
"died_role": "{0} era {1}!", "died_role": "{0} era {1}!",
"won": "{0} ha vinto!", "won": "{0} ha vinto! Il suo ruolo era {1}",
"choose_character": "{0} ha come personaggio {1}, la sua abilità speciale è: {2}!", "choose_character": "{0} ha come personaggio {1}, la sua abilità speciale è: {2}!",
"starting": "La partita sta iniziando!", "starting": "La partita sta iniziando!",
"sheriff": "{0} è lo sceriffo!", "sheriff": "{0} è lo sceriffo!",
@ -576,8 +576,7 @@
"desc": "All'inizio del proprio turno, il giocatore subisce tanti bang quante carte ha in mano" "desc": "All'inizio del proprio turno, il giocatore subisce tanti bang quante carte ha in mano"
}, },
"Pepita": { "Pepita": {
"name": "Pepita D'oro", "name": "Pepita D'oro"
"desc": ""
}, },
"Bicchierino": { "Bicchierino": {
"name": "Bicchierino", "name": "Bicchierino",