add desc and bug fixes

Co-authored-by: GM <giulio.migani@studenti.unitn.it>
This commit is contained in:
Alberto Xamin 2021-06-19 18:48:39 +02:00
parent a3d33827a7
commit cb1824c0e4
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
6 changed files with 220 additions and 18 deletions

View File

@ -87,7 +87,7 @@ class Card(ABC):
pass pass
def is_duplicate_card(self, player): def is_duplicate_card(self, player):
return self.name in [c.name for c in player.equipment] return self.name in [c.name for c in player.equipment] or self.name in [c.name for c in player.gold_rush_equipment]
def check_suit(self, game, accepted): def check_suit(self, game, accepted):
import bang.expansions.high_noon.card_events as ceh import bang.expansions.high_noon.card_events as ceh
@ -240,11 +240,11 @@ class Birra(Card):
return False return False
if not skipChecks: if not skipChecks:
import bang.expansions.gold_rush.characters as grch import bang.expansions.gold_rush.characters as grch
madamYto = [p for p in player.game.get_alive_players() if p.character.check(player.game, grch.MadamYto)] madamYto = [p for p in player.game.get_alive_players() if p.character.check(player.game, grch.MadamYto) and self.number != 42]
for p in madamYto: for p in madamYto:
p.hand.append(player.game.deck.draw()) p.hand.append(player.game.deck.draw())
p.notify_self() p.notify_self()
if 'gold_rush' in player.game.expansions: if 'gold_rush' in player.game.expansions and self.number != 42:
from bang.players import PendingAction from bang.players import PendingAction
player.available_cards = [{ player.available_cards = [{
'name': '', 'name': '',
@ -256,7 +256,7 @@ class Birra(Card):
player.pending_action = PendingAction.CHOOSE player.pending_action = PendingAction.CHOOSE
player.notify_self() player.notify_self()
return True return True
if len(player.game.get_alive_players()) != 2: if len(player.game.get_alive_players()) != 2 or self.number == 42:
super().play_card(player, against=against) super().play_card(player, against=against)
player.lives = min(player.lives+1, player.max_lives) player.lives = min(player.lives+1, player.max_lives)
import bang.expansions.dodge_city.characters as chd import bang.expansions.dodge_city.characters as chd

View File

@ -17,7 +17,6 @@ class ShopCard(Card):
pass # use it now pass # use it now
return False return False
elif self.kind == ShopCardKind.BLACK: # equip it elif self.kind == ShopCardKind.BLACK: # equip it
self.reset_card()
if not self.is_duplicate_card(player): if not self.is_duplicate_card(player):
self.reset_card() self.reset_card()
self.can_be_used_now = True self.can_be_used_now = True
@ -80,7 +79,7 @@ class Complice(ShopCard):
class CorsaAllOro(ShopCard): class CorsaAllOro(ShopCard):
def __init__(self): def __init__(self):
super().__init__("Corsa All'Oro", 5, ShopCardKind.BROWN) super().__init__("Corsa All Oro_gr", 5, ShopCardKind.BROWN)
self.icon = '🤑️' self.icon = '🤑️'
def play_card(self, player, against=None, _with=None): def play_card(self, player, against=None, _with=None):

View File

@ -1143,7 +1143,7 @@ class Player:
if picked.check_suit(self.game, [cs.Suit.HEARTS]): if picked.check_suit(self.game, [cs.Suit.HEARTS]):
self.play_turn(can_play_vendetta=False) self.play_turn(can_play_vendetta=False)
return return
if not forced and self.character.check(self.game, grch.DonBell): if not forced and self.character.check(self.game, grch.DonBell) and self.can_play_again_don_bell:
picked: cs.Card = self.game.deck.pick_and_scrap() picked: cs.Card = self.game.deck.pick_and_scrap()
self.sio.emit('chat_message', room=self.game.name, data=f'_flipped|{self.name}|{picked.name}|{picked.num_suit()}') self.sio.emit('chat_message', room=self.game.name, data=f'_flipped|{self.name}|{picked.name}|{picked.num_suit()}')
if picked.check_suit(self.game, [cs.Suit.HEARTS, cs.Suit.DIAMONDS]): if picked.check_suit(self.game, [cs.Suit.HEARTS, cs.Suit.DIAMONDS]):

View File

@ -3,9 +3,9 @@
<div class="deck"> <div class="deck">
<card v-if="endTurnAction && isPlaying" :donotlocalize="true" v-show="pending_action == 2" :card="endTurnCard" class="end-turn" @click.native="endTurnAction"/> <card v-if="endTurnAction && isPlaying" :donotlocalize="true" v-show="pending_action == 2" :card="endTurnCard" class="end-turn" @click.native="endTurnAction"/>
<div class="deck" style="position:relative" v-if="goldRushCards.length > 0" > <div class="deck" style="position:relative" v-if="goldRushCards.length > 0" >
<card :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(-15deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 0" :key="goldRushCards[0].name" :card="goldRushCards[0]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[0].number}" @click.native="() => {buy_gold_rush_card(0)}"/> <card @pointerenter.native="()=>{setGoldRushDesc(goldRushCards[0])}" @pointerleave.native="goldRushDesc=''" :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(-15deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 0" :key="goldRushCards[0].name" :card="goldRushCards[0]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[0].number}" @click.native="() => {buy_gold_rush_card(0)}"/>
<card :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(+0deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 1" :key="goldRushCards[1].name" :card="goldRushCards[1]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[1].number}" @click.native="() => {buy_gold_rush_card(1)}"/> <card @pointerenter.native="()=>{setGoldRushDesc(goldRushCards[1])}" @pointerleave.native="goldRushDesc=''" :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(+0deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 1" :key="goldRushCards[1].name" :card="goldRushCards[1]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[1].number}" @click.native="() => {buy_gold_rush_card(1)}"/>
<card :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(+15deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 2" :key="goldRushCards[2].name" :card="goldRushCards[2]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[2].number}" @click.native="() => {buy_gold_rush_card(2)}"/> <card @pointerenter.native="()=>{setGoldRushDesc(goldRushCards[2])}" @pointerleave.native="goldRushDesc=''" :style="goldRushShopOpen?``:`position:absolute; top:0; right:0; transform: rotate(+15deg) translate(0, -50px) scale(0.6)`" v-if="goldRushCards.length > 2" :key="goldRushCards[2].name" :card="goldRushCards[2]" :class="{'shop-open':goldRushShopOpen, 'cant-play': pending_action !==2 || gold_nuggets < goldRushCards[2].number}" @click.native="() => {buy_gold_rush_card(2)}"/>
<div style="position:relative"> <div style="position:relative">
<div class="card gold-rush back" style="position:relative; bottom:-3pt;right:-3pt;"/> <div class="card gold-rush back" style="position:relative; bottom:-3pt;right:-3pt;"/>
<div class="card gold-rush back" style="position:absolute; bottom:-1.5pt;right:-1.5pt;"/> <div class="card gold-rush back" style="position:absolute; bottom:-1.5pt;right:-1.5pt;"/>
@ -30,7 +30,10 @@
</div> </div>
</div> </div>
<transition name="list"> <transition name="list">
<p v-if="eventCard" class="center-stuff"><i>{{eventDesc}}</i></p> <p v-if="eventCard" class="center-stuff"><b>{{eventDesc}}</b></p>
</transition>
<transition name="list">
<p v-if="goldRushDesc" class="center-stuff">🤑 <i>{{goldRushDesc}}</i> 🤑</p>
</transition> </transition>
<transition name="list"> <transition name="list">
<p v-if="desc" class="center-stuff"><i>{{desc}}</i></p> <p v-if="desc" class="center-stuff"><i>{{desc}}</i></p>
@ -67,6 +70,7 @@ export default {
goldRushShopOpen: true, goldRushShopOpen: true,
goldRushCards: [], goldRushCards: [],
gold_nuggets: 0, gold_nuggets: 0,
goldRushDesc: "",
}), }),
sockets: { sockets: {
self(self){ self(self){
@ -137,7 +141,10 @@ export default {
this.desc = (this.$i18n.locale=='it'?this.lastScrap.desc:this.lastScrap.desc_eng) this.desc = (this.$i18n.locale=='it'?this.lastScrap.desc:this.lastScrap.desc_eng)
else else
this.desc = this.$t(`cards.${this.lastScrap.name}.desc`) this.desc = this.$t(`cards.${this.lastScrap.name}.desc`)
} },
setGoldRushDesc(card) {
this.goldRushDesc = this.$t(`cards.${card.name}.desc`)
},
}, },
watch: { watch: {
lastScrap(newVal, old) { lastScrap(newVal, old) {

View File

@ -48,6 +48,10 @@
"choose_rimbalzo_player": "Choose the target of the bang", "choose_rimbalzo_player": "Choose the target of the bang",
"choose_rimbalzo_card": "Choose the card to discard the bang to", "choose_rimbalzo_card": "Choose the card to discard the bang to",
"choose_nuova_identita": "Choose if you want to keep your current character, or if you want to change it and start from 2 HP", "choose_nuova_identita": "Choose if you want to keep your current character, or if you want to change it and start from 2 HP",
"choose_bicchierino": "A player of your choice regains 1 hp",
"choose_bottiglia": "Choose how you will play Bottle!",
"choose_complice": "Choose how you will play Pardner!",
"choose_ricercato": "Choose who you will play Wanted against.",
"emporio_others": "{0} is choosing which card to get from the General Store", "emporio_others": "{0} is choosing which card to get from the General Store",
"you_died": "YOU DIED", "you_died": "YOU DIED",
"spectate": "SPECTATE", "spectate": "SPECTATE",
@ -84,6 +88,7 @@
"explode": "{0} blew up the dynamite.", "explode": "{0} blew up the dynamite.",
"beer_save": "{0} used a beer to save his life.", "beer_save": "{0} used a beer to save his life.",
"play_card": "{0} played {1}.", "play_card": "{0} played {1}.",
"purchase_card": "{0} purchased {1}.",
"play_card_against": "{0} played {1} against {2}.", "play_card_against": "{0} played {1} against {2}.",
"play_card_for": "{0} played {1} for {2}.", "play_card_for": "{0} played {1} for {2}.",
"spilled_beer": "{0} spilled a {1}.", "spilled_beer": "{0} spilled a {1}.",
@ -106,7 +111,8 @@
"prison_free": "{0} got out of prison", "prison_free": "{0} got out of prison",
"prison_turn": "{0} stayed in prison this turn", "prison_turn": "{0} stayed in prison this turn",
"flip_event": "🎴 EVENT: {0} 🎴", "flip_event": "🎴 EVENT: {0} 🎴",
"choose_manette": "{0} committed to play only cards of suit {1} in this turn." "choose_manette": "{0} committed to play only cards of suit {1} in this turn.",
"UnionPacific": "{0} played Union Pacific and draws 4 cards from the deck"
}, },
"foc": { "foc": {
"leggedelwest": "He must play this card on this turn if possible." "leggedelwest": "He must play this card on this turn if possible."
@ -546,13 +552,105 @@
"name": "Handcuffs", "name": "Handcuffs",
"desc": "After drawing in phase 1, the player declares a suit. He will be able to use only cards of that suit for that turn" "desc": "After drawing in phase 1, the player declares a suit. He will be able to use only cards of that suit for that turn"
}, },
"Mezzogiorno di Fuoco":{ "Mezzogiorno di Fuoco": {
"name": "High Noon", "name": "High Noon",
"desc": "Every player loses 1 HP when their turn starts" "desc": "Every player loses 1 HP when their turn starts"
}, },
"Per Un Pugno Di Carte":{ "Per Un Pugno Di Carte": {
"name": "A Fistful of Cards", "name": "A Fistful of Cards",
"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"
},
"Bicchierino": {
"name": "Shot Glass",
"desc": "You can choose a player that regains 1 HP (even you)"
},
"Bottiglia": {
"name": "Bottle",
"desc": "Can be played as Panic!, Beer or BANG!"
},
"Complice": {
"name": "Pardner",
"desc": "Can be played as General Store, Duel or Cat Balou."
},
"Corsa All Oro_gr": {
"name": "Gold Rush",
"desc": "You end your turn, regain all your HP and start a new turn."
},
"Rum": {
"name": "Rhum",
"desc": "Flip 4 cards, for each different suit you gain 1 HP."
},
"Union Pacific": {
"name": "Union Pacific",
"desc": "Draw 4 cards from the deck."
},
"Calumet": {
"name": "Calumet",
"desc": "Cards of diamonds played by other players have no effect on you."
},
"Cinturone": {
"name": "Gun Belt",
"desc": "You can keep up to 8 cards when you end your turn."
},
"Ferro di Cavallo": {
"name": "Horseshoe",
"desc": "Every time you have to flip a card you flip twice!"
},
"Piccone": {
"name": "Pickaxe",
"desc": "You get 1 more card when you draw at the beginning of the turn."
},
"Ricercato": {
"name": "Wanted",
"desc": "Play it on another player, who kills the target gets 2 extra cards and 1 gold nugget."
},
"Setaccio": {
"name": "Gold Pan",
"desc": "Pay 1 gold nugget to draw 1 card from the deck, up to twice per turn. (Click on the equipped card to use)"
},
"Stivali": {
"name": "Boots",
"desc": "Each time you lose 1 hp, you draw 1 card from the deck."
},
"Talismano": {
"name": "Lucky Charm",
"desc": "Each time you lose 1 hp, you get 1 gold nugget."
},
"Zaino": {
"name": "Rucksack",
"desc": "Pay 2 gold nugget to heal 1 HP. (Click on the equipped card to use)"
},
"Don Bell": {
"name": "Don Bell",
"desc": "When he ends his turn, he flips a card, if it flips Hearts ❤️ or Diamonds ♦️ he plays again."
},
"Dutch Will": {
"name": "Dutch Will",
"desc": "He draws 2 cards, discards 1 and takes 1 gold nugget."
},
"Jacky Murieta": {
"name": "Jacky Murieta",
"desc": "During his turn he can pay 2 gold nuggets to shoot another BANG!"
},
"Josh McCloud": {
"name": "Josh McCloud",
"desc": "He can pay 2 gold nuggets to get the first card from the Gold Rush deck."
},
"Madam Yto": {
"name": "Madam Yto",
"desc": "She draws 1 card from the deck each time a beer is played."
},
"Pretty Luzena": {
"name": "Pretty Luzena",
"desc": "Once per turn she can have a discount of 1 on the gold rush cards shop."
},
"Raddie Snake": {
"name": "Raddie Snake",
"desc": "He can throw away 1 gold nugget to draw 1 card from the deck during his turn (2 times max per turn)."
},
"Simeon Picos": {
"name": "Simeon Picos",
"desc": "He gets 1 gold nugget every time he loses 1 hp."
} }
}, },
"help": { "help": {

View File

@ -48,6 +48,10 @@
"choose_rimbalzo_player": "Scegli contro chi scartare il bang", "choose_rimbalzo_player": "Scegli contro chi scartare il bang",
"choose_rimbalzo_card": "Scegli contro che carta scartare il bang", "choose_rimbalzo_card": "Scegli contro che carta scartare il bang",
"choose_nuova_identita": "Scegli se rimanere con il tuo personaggio corrente o se cambiarlo e ripartire con 2 vite.", "choose_nuova_identita": "Scegli se rimanere con il tuo personaggio corrente o se cambiarlo e ripartire con 2 vite.",
"choose_bicchierino": "Scegli a chi far recuperare 1 punto vita",
"choose_bottiglia": "Scegli come giocare Bottiglia!",
"choose_complice": "Scegli come giocare Complice!",
"choose_ricercato": "Scegli il giocatore su cui vuoi giocare Ricercato",
"emporio_others": "{0} sta scegliendo che carta prendere dall'emporio", "emporio_others": "{0} sta scegliendo che carta prendere dall'emporio",
"you_died": "SEI MORTO", "you_died": "SEI MORTO",
"spectate": "SPETTATORE", "spectate": "SPETTATORE",
@ -84,6 +88,7 @@
"explode": "{0} ha fatto esplodere la dinamite.", "explode": "{0} ha fatto esplodere la dinamite.",
"beer_save": "{0} ha usato una birra per recuperare una vita.", "beer_save": "{0} ha usato una birra per recuperare una vita.",
"play_card": "{0} ha giocato {1}.", "play_card": "{0} ha giocato {1}.",
"purchase_card": "{0} ha comprato {1}.",
"play_card_against": "{0} ha giocato {1} contro {2}.", "play_card_against": "{0} ha giocato {1} contro {2}.",
"play_card_for": "{0} ha giocato {1} per {2}.", "play_card_for": "{0} ha giocato {1} per {2}.",
"spilled_beer": "{0} ha rovesciato una {1}.", "spilled_beer": "{0} ha rovesciato una {1}.",
@ -106,7 +111,8 @@
"prison_free": "{0} è uscito di prigione", "prison_free": "{0} è uscito di prigione",
"prison_turn": "{0} rimane in prigione questo turno", "prison_turn": "{0} rimane in prigione questo turno",
"flip_event": "🎴 EVENTO: {0} 🎴", "flip_event": "🎴 EVENTO: {0} 🎴",
"choose_manette": "{0} si è impegnato ad usare solo carte di seme {1} in questo turno." "choose_manette": "{0} si è impegnato ad usare solo carte di seme {1} in questo turno.",
"UnionPacific": "{0} ha giocato Union Pacific e ha pescato 4 carte"
}, },
"foc": { "foc": {
"leggedelwest": "Ed è obbligato a usarla nel suo turno, se possibile" "leggedelwest": "Ed è obbligato a usarla nel suo turno, se possibile"
@ -546,13 +552,105 @@
"name": "Manette", "name": "Manette",
"desc": "Dopo aver pescato in fase 1, il giocatore di turno dichiara un seme: potrà usare solamente carte di quel seme nel suo turno" "desc": "Dopo aver pescato in fase 1, il giocatore di turno dichiara un seme: potrà usare solamente carte di quel seme nel suo turno"
}, },
"Mezzogiorno di Fuoco":{ "Mezzogiorno di Fuoco": {
"name": "Mezzogiorno di Fuoco", "name": "Mezzogiorno di Fuoco",
"desc": "Ogni giocatore perde 1 punto vita all'inizio del turno" "desc": "Ogni giocatore perde 1 punto vita all'inizio del turno"
}, },
"Per Un Pugno Di Carte":{ "Per Un Pugno Di Carte": {
"name": "Per Un Pugno Di Carte", "name": "Per Un Pugno Di Carte",
"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"
},
"Bicchierino": {
"name": "Bicchierino",
"desc": "Un giocatore a scelta recupera una vita (anche se stessi)"
},
"Bottiglia": {
"name": "Bottiglia",
"desc": "Usa questa carta come Panico!, Birra o Bang!"
},
"Complice": {
"name": "Complice",
"desc": "Usa questa carta come Emporio, Duello o Cat Balou"
},
"Corsa All Oro_gr": {
"name": "Corsa All'Oro",
"desc": "Il tuo turno termina subito. Recuperi tutti i tuoi punti vita, poi gioca un altro turno"
},
"Rum": {
"name": "Rum",
"desc": "Estrai 4 carte dal mazzo, guadagni 1 vita per ogni seme diverso"
},
"Union Pacific": {
"name": "Union Pacific",
"desc": "Pesca 4 carte dal mazzo"
},
"Calumet": {
"name": "Calumet",
"desc": "Le carte di quadri giocate dagli altri giocatori non hanno effetto su di te"
},
"Cinturone": {
"name": "Cinturone",
"desc": "Alla fine del tuo turno puoi tenere in mano fino a 8 carte"
},
"Ferro di Cavallo": {
"name": "Ferro di Cavallo",
"desc": "Ogni volta che estrai scegli la migliore tra due carte"
},
"Piccone": {
"name": "Piccone",
"desc": "Pesca una carta in più nella tua fase 1"
},
"Ricercato": {
"name": "Ricercato",
"desc": "Scegli un giocatore qualsiasi, chi elimina quel giocatore pesca 2 carte in più e pesca una pepita"
},
"Setaccio": {
"name": "Setaccio",
"desc": "Fino a due volte in un turno puoi pagare una pepita per pescare una carta dal mazzo (Clicca sulla carta per usare l'abilità)"
},
"Stivali": {
"name": "Stivali",
"desc": "Ogni volta che perdi un punto vita pesci una carta dal mazzo"
},
"Talismano": {
"name": "Talismano",
"desc": "Ogni volta che perdi un punto vita pendi una pepita"
},
"Zaino": {
"name": "Zaino",
"desc": "Paga 2 pepite per recuperare un punto vita"
},
"Don Bell": {
"name": "Don Bell",
"desc": "Alla fine del suo turno estrae, se esce Cuori ❤️ o Quadri ♦️ gioca un altro turno"
},
"Dutch Will": {
"name": "Dutch Will",
"desc": "Pesca 2 carte, ne scarta 1 e pesca una pepita."
},
"Jacky Murieta": {
"name": "Jacky Murieta",
"desc": "Durante il suo turno può pagare 2 pepite per sparare un bang, può farlo più volte per turno"
},
"Josh McCloud": {
"name": "Josh McCloud",
"desc": "Può pescare la prima carta del mazzetto pagando solo due pepite"
},
"Madam Yto": {
"name": "Madam Yto",
"desc": "Ogni volta che viene giocata una Birra pesca 1 carta dal mazzo"
},
"Pretty Luzena": {
"name": "Pretty Luzena",
"desc": "Una volta per turno può pagare una carta del mazzetto a costo diminuito di 1"
},
"Raddie Snake": {
"name": "Raddie Snake",
"desc": "Durante il suo turno, può pagare una pepita per pescare 1 carta dal mazzo (fino a due volte per turno)"
},
"Simeon Picos": {
"name": "Simeon Picos",
"desc": "Ogni volta che viene ferito, prende una pepita"
} }
}, },
"help": { "help": {