add cards and translation to help page
This commit is contained in:
parent
2e218763a7
commit
f580403e96
@ -359,14 +359,13 @@ def holyday_special(sid, data):
|
||||
ses: Player = sio.get_session(sid)
|
||||
ses.holyday_special(data)
|
||||
|
||||
# @sio.event
|
||||
# def get_cards(sid, data):
|
||||
# # if data == None or data == '':
|
||||
# import bang.cards as c
|
||||
# sio.emit('cards_info', data=json.dumps(c.get_starting_deck(['dodge_city']), default=lambda o: o.__dict__))
|
||||
# # else:
|
||||
# # import bang.expansions.dodge_city.cards as c
|
||||
# # sio.emit('cards_info', data=json.dumps(c.get_starting_deck(), default=lambda o: o.__dict__))
|
||||
@sio.event
|
||||
def get_cards(sid):
|
||||
import bang.cards as c
|
||||
cards = c.get_starting_deck([])
|
||||
cards_dict = { c.name:c for c in cards}
|
||||
cards = [cards_dict[i] for i in cards_dict]
|
||||
sio.emit('cards_info', data=json.dumps(cards, default=lambda o: o.__dict__))
|
||||
|
||||
if __name__ == '__main__':
|
||||
eventlet.wsgi.server(eventlet.listen(('', 5001)), app)
|
||||
|
@ -1,26 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Come giocare</h1>
|
||||
<h2>Personaggi</h2>
|
||||
<p>Ogni personaggio ha delle abilità speciali e un numero di vite che lo rendono unico.
|
||||
Le vite sono il numero di punti vita che puoi perdere prima di morire e indicano anche il numero massimo di carte che puoi tenere in mano.</p>
|
||||
<h1>{{$t('help.title')}}</h1>
|
||||
<h2>{{$t('help.character')}}</h2>
|
||||
<p>{{$t('help.characters_special')}}</p>
|
||||
<input type="button" value="Visualizza tutti i personaggi"/>
|
||||
<h2>Ruoli</h2>
|
||||
<ul>
|
||||
<li><p>Sceriffo ⭐️</p></li>
|
||||
<li><p>Fuorilegge 🐺️</p></li>
|
||||
<li><p>Rinnegato 🦅️</p></li>
|
||||
<li><p>Vice 🎖️</p></li>
|
||||
</ul>
|
||||
<h2>Turni</h2>
|
||||
<p>Si inizia sempre dallo Sceriffo ⭐️, e il gioco prosegue in senso orario, i turni sono divisi in 3 fasi.</p>
|
||||
<h2>{{$t('help.roles')}}</h2>
|
||||
<div style="display:flex;">
|
||||
<card :card="{name:$t('help.sheriff'), icon:'⭐️'}" :class="{back:true}"/>
|
||||
<card :card="{name:$t('help.outlaw'), icon:'🐺️'}" :class="{back:true}"/>
|
||||
<card :card="{name:$t('help.renegade'), icon:'🦅️'}" :class="{back:true}"/>
|
||||
<card :card="{name:$t('help.vice'), icon:'🎖️'}" :class="{back:true}"/>
|
||||
</div>
|
||||
<h2>{{$t('help.turns')}}</h2>
|
||||
<p>{{$t('help.turnstart')}}</p>
|
||||
<ol>
|
||||
<li><p>Pesca 2 carte ⏬️</p></li>
|
||||
<li><p>Gioca un numero qualsiasi di carte ▶️</p></li>
|
||||
<li><p>Scarta le carte in eccesso</p></li>
|
||||
<li><p>{{$t('help.turndraw')}} ⏬️</p></li>
|
||||
<li><p>{{$t('help.turnplay')}} ▶️</p></li>
|
||||
<li><p>{{$t('help.turndiscard')}}</p></li>
|
||||
</ol>
|
||||
<h3>Pescare le carte</h3>
|
||||
<p>Per pescare le carte dovrai cliccare sul mazzo quando vedi questa animazione.<p>
|
||||
<h3>{{$t('help.drawthecards')}}</h3>
|
||||
<p>{{$t('help.drawinstructions')}}<p>
|
||||
<div style="display:flex" class="center-stuff">
|
||||
<div style="position:relative">
|
||||
<div class="card back" style="position:absolute; bottom:-3pt;right:-3pt;"/>
|
||||
@ -28,37 +27,45 @@
|
||||
<card :card="cardBack" :class="{back:true, draw:true}" @click.native="action"/>
|
||||
</div>
|
||||
</div>
|
||||
<h3>Giocare le carte</h3>
|
||||
<p>Puoi giocare le tue carte per te oppure per recare danno agli altri giocatori cercando di eliminarli.</p>
|
||||
<p>Puoi giocare le carte solo nel tuo turno. Ad eccezzione delle carte usate come risposta tipo i mancato 😅️.</p>
|
||||
<p><b>Non sei obblicato a giocare carte.</b></p>
|
||||
<p>Ci sono solo 3 limitazioni:</p>
|
||||
<h3>{{$t('help.playingcards')}}</h3>
|
||||
<p>{{$t('help.playingdmg')}}</p>
|
||||
<p>{{$t('help.playingduringturn')}}</p>
|
||||
<p><b>{{$t('help.playingifyouwant')}}</b></p>
|
||||
<p>{{$t('help.playlimit')}}</p>
|
||||
<ul>
|
||||
<li><p>Puoi giocare 1 solo Bang! per turno (si riferisce solo alle carte con nome Bang!)</p></li>
|
||||
<li><p>Non puoi avere 2 carte con lo stesso nome equipaggiate.</p></li>
|
||||
<li><p>Puoi avere solo 1 arma equipaggiata.</p></li>
|
||||
<li><p>{{$t('help.playonlyonebang')}}</p></li>
|
||||
<li><p>{{$t('help.maxtwocardsequip')}}</p></li>
|
||||
<li><p>{{$t('help.justoneweapon')}}</p></li>
|
||||
</ul>
|
||||
<h3>Scartare</h3>
|
||||
<p>Quando hai terminato di giocare le tue carte, ovvero quando non vuoi o non puoi giocare altre carte, devi scartare le carte che eccedono il tuo numero di vite attuali.
|
||||
Dopodichè passi il turno al giocatore successivo cliccando su termina turno.</p>
|
||||
<h3>{{$t('help.discard')}}</h3>
|
||||
<p>{{$t('help.endingturn')}}</p>
|
||||
<card :card="endTurnCard" class="end-turn" @click.native="alert('')"/>
|
||||
<h3>Distanza</h3>
|
||||
<p>La distanza viene calcolata automaticamente dal gioco e corrisponde al percorso minimo tra la sinistra e la destra del giocatore.</p>
|
||||
<h3>La morte di un giocatore</h3>
|
||||
<p>Quando perdi l'ultimo punto vita e non hai una birra 🍺️ in mano, muori. Le tue carte vengono scartate e il tuo ruolo rivelato a tutti.</p>
|
||||
<h3>Penalità e ricompense</h3>
|
||||
<h3>{{$t('help.distance')}}</h3>
|
||||
<p>{{$t('help.distancecalc')}}</p>
|
||||
<h3>{{$t('help.playerdeath')}}</h3>
|
||||
<p>{{$t('help.deathnobeer')}}</p>
|
||||
<h3>{{$t('help.rewardspen')}}</h3>
|
||||
<ul>
|
||||
<li><p>Se lo sceriffo ⭐️ uccide un vice perde tutte le carte in mano e in gioco davanti a se.</p></li>
|
||||
<li><p>Chiunque uccida un fuorilegge 🐺️ pesca 3 carte dal mazzo (anche altri fuorilegge 🐺️).</p></li>
|
||||
<li><p>{{$t('help.sheriffkillsvice')}}</p></li>
|
||||
<li><p>{{$t('help.outlawreward')}}</p></li>
|
||||
</ul>
|
||||
<h2>Fine del gioco</h2>
|
||||
<p>Il gioco termina quando una delle seguenti condizioni si verifica:</p>
|
||||
<h2>{{$t('help.endgame')}}</h2>
|
||||
<p>{{$t('help.endgameconditions')}}</p>
|
||||
<ul>
|
||||
<li><p>Lo sceriffo ⭐️ muore. Se il rinnegato 🦅️ è l'ultimo giocatore in vita vince, altrimenti vincono i fuorilegge.</p></li>
|
||||
<li><p>Tutti i fuorilegge 🐺️ e i rinnegati 🦅️ sono morti. In tal caso vincono lo sceriffo ⭐️ e i vice 🎖️.</p></li>
|
||||
<li><p>{{$t('help.endgameshriffdeath')}}</p></li>
|
||||
<li><p>{{$t('help.endgamesheriffwin')}}</p></li>
|
||||
</ul>
|
||||
<h2>Le carte</h2>
|
||||
<input type="button" value="Visualizza tutte le carte"/>
|
||||
<h2>{{$t('help.thecards')}}</h2>
|
||||
<div >
|
||||
<div v-for="(c, i) in cards" v-bind:key="c.name ? (c.name+c.number) : i" style="display:flex">
|
||||
<Card :card="c" @pointerenter.native="''" @pointerleave.native="''"/>
|
||||
<div style="margin-left:6pt;">
|
||||
<p>{{$t(`cards.${c.name}.desc`)}}</p>
|
||||
<p v-if="c.is_equipment"><b>{{$t('help.equipment')}}</b></p>
|
||||
<p v-if="c.is_weapon"><b>{{$t('help.weapon')}}</b></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -73,6 +80,7 @@ export default {
|
||||
name: 'PewPew!',
|
||||
icon: '💥',
|
||||
},
|
||||
cards: []
|
||||
}),
|
||||
computed: {
|
||||
endTurnCard() {
|
||||
@ -82,6 +90,14 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
sockets: {
|
||||
cards_info(cardsJson) {
|
||||
this.cards = JSON.parse(cardsJson)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$socket.emit('get_cards')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
@ -293,5 +293,46 @@
|
||||
"name": "Howitzer",
|
||||
"desc": "Shoot all the other players"
|
||||
}
|
||||
},
|
||||
"help": {
|
||||
"character": "Characters",
|
||||
"characters_special": "Each character has special abilities and a number of lives that make them unique. \nLives are the number of life points you can lose before dying and also indicate the maximum number of cards you can hold in your hand.",
|
||||
"deathnobeer": "When you lose your last life point and you don't have a beer 🍺️ in your hand, you die. \nYour cards are discarded and your role revealed to everyone.",
|
||||
"discard": "To discard",
|
||||
"distance": "Distance",
|
||||
"distancecalc": "The distance is automatically calculated by the game and corresponds to the minimum distance between the player's left and right.",
|
||||
"drawinstructions": "To draw cards you will need to click on the deck when you see this animation.",
|
||||
"drawthecards": "Draw the cards",
|
||||
"endgame": "End of the game",
|
||||
"endgameconditions": "The game ends when one of the following conditions is met:",
|
||||
"endgamesheriffwin": "All the outlaws 🐺️ and renegades 🦅️ are dead. \nIn this case the sheriff ⭐️ and the deputies 🎖️ win.",
|
||||
"endgameshriffdeath": "Sheriff ⭐️ dies. \nIf the renegade 🦅️ is the last player alive he wins, otherwise the outlaws win.",
|
||||
"endingturn": "When you have finished playing your cards, that is, when you do not want or cannot play any more cards, you must discard the cards that exceed your current number of lives.\n\nThen you pass the turn to the next player by clicking on end turn.",
|
||||
"equipment": "EQUIPMENT",
|
||||
"justoneweapon": "You can only have 1 weapon equipped.",
|
||||
"maxtwocardsequip": "You cannot have 2 cards with the same name equipped.",
|
||||
"outlawreward": "Anyone who kills an outlaw 🐺️ draws 3 cards from the deck (other outlaws too 🐺️).",
|
||||
"playerdeath": "The death of a player",
|
||||
"playingcards": "Play the cards",
|
||||
"playingdmg": "You can play your cards for yourself or to harm other players by trying to eliminate them.",
|
||||
"playingduringturn": "You can only play the cards on your turn. \nWith the exception of cards used as an answer such as Missed 😅️.",
|
||||
"playingifyouwant": "You are not required to play cards.",
|
||||
"playlimit": "There are only 3 limitations:",
|
||||
"playonlyonebang": "You can only play 1 Bang! \nper turn (refers only to cards named Bang!)",
|
||||
"rewardspen": "Penalties and rewards",
|
||||
"roles": "Roles",
|
||||
"sheriffkillsvice": "If the sheriff ⭐️ kills a deputy, he loses all the cards in his hand and in play in front of him.",
|
||||
"thecards": "Cards",
|
||||
"title": "How to play",
|
||||
"turndiscard": "Discard any excess cards",
|
||||
"turndraw": "Draw 2 cards",
|
||||
"turnplay": "Play any number of cards",
|
||||
"turns": "Turns",
|
||||
"turnstart": "It always starts with the Sheriff ⭐️, and the game continues clockwise, the turns are divided into 3 phases.",
|
||||
"weapon": "WEAPON",
|
||||
"renegade": "Renegade",
|
||||
"vice": "Deputy",
|
||||
"outlaw": "Outlaw",
|
||||
"sheriff": "Sheriff"
|
||||
}
|
||||
}
|
@ -293,5 +293,46 @@
|
||||
"name": "Howitzer",
|
||||
"desc": "Spara a tutti gli altri giocatori"
|
||||
}
|
||||
},
|
||||
"help": {
|
||||
"title": "Come giocare",
|
||||
"character": "Personaggi",
|
||||
"characters_special": "Ogni personaggio ha delle abilità speciali e un numero di vite che lo rendono unico. Le vite sono il numero di punti vita che puoi perdere prima di morire e indicano anche il numero massimo di carte che puoi tenere in mano.",
|
||||
"roles": "Ruoli",
|
||||
"turns": "Turni",
|
||||
"turnstart": "Si inizia sempre dallo Sceriffo ⭐️, e il gioco prosegue in senso orario, i turni sono divisi in 3 fasi.",
|
||||
"turndraw": "Pesca 2 carte",
|
||||
"turnplay": "Gioca un numero qualsiasi di carte",
|
||||
"turndiscard": "Scarta le carte in eccesso",
|
||||
"drawthecards": "Pescare le carte",
|
||||
"drawinstructions": "Per pescare le carte dovrai cliccare sul mazzo quando vedi questa animazione.",
|
||||
"playingcards": "Giocare le carte",
|
||||
"playingdmg": "Puoi giocare le tue carte per te oppure per recare danno agli altri giocatori cercando di eliminarli.",
|
||||
"playingduringturn": "Puoi giocare le carte solo nel tuo turno. Ad eccezzione delle carte usate come risposta tipo i mancato 😅️.",
|
||||
"playingifyouwant": "Non sei obblicato a giocare carte.",
|
||||
"playlimit": "Ci sono solo 3 limitazioni:",
|
||||
"playonlyonebang": "Puoi giocare 1 solo Bang! per turno (si riferisce solo alle carte con nome Bang!)",
|
||||
"maxtwocardsequip": "Non puoi avere 2 carte con lo stesso nome equipaggiate.",
|
||||
"justoneweapon": "Puoi avere solo 1 arma equipaggiata.",
|
||||
"discard": "Scartare",
|
||||
"endingturn": "Quando hai terminato di giocare le tue carte, ovvero quando non vuoi o non puoi giocare altre carte, devi scartare le carte che eccedono il tuo numero di vite attuali.\n\t\tDopodichè passi il turno al giocatore successivo cliccando su termina turno.",
|
||||
"distance": "Distanza",
|
||||
"distancecalc": "La distanza viene calcolata automaticamente dal gioco e corrisponde al percorso minimo tra la sinistra e la destra del giocatore.",
|
||||
"playerdeath": "La morte di un giocatore",
|
||||
"deathnobeer": "Quando perdi l'ultimo punto vita e non hai una birra 🍺️ in mano, muori. Le tue carte vengono scartate e il tuo ruolo rivelato a tutti.",
|
||||
"rewardspen": "Penalità e ricompense",
|
||||
"sheriffkillsvice": "Se lo sceriffo ⭐️ uccide un vice perde tutte le carte in mano e in gioco davanti a se.",
|
||||
"outlawreward": "Chiunque uccida un fuorilegge 🐺️ pesca 3 carte dal mazzo (anche altri fuorilegge 🐺️).",
|
||||
"endgame": "Fine del gioco",
|
||||
"endgameconditions": "Il gioco termina quando una delle seguenti condizioni si verifica:",
|
||||
"endgameshriffdeath": "Lo sceriffo ⭐️ muore. Se il rinnegato 🦅️ è l'ultimo giocatore in vita vince, altrimenti vincono i fuorilegge.",
|
||||
"endgamesheriffwin": "Tutti i fuorilegge 🐺️ e i rinnegati 🦅️ sono morti. In tal caso vincono lo sceriffo ⭐️ e i vice 🎖️.",
|
||||
"thecards": "Le carte",
|
||||
"equipment": "EQUIPAGGIAMENTO",
|
||||
"weapon": "ARMA",
|
||||
"sheriff": "Sceriffo",
|
||||
"outlaw": "Fuorilegge",
|
||||
"renegade": "Rinnegato",
|
||||
"vice": "Vice"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user