add peyote

This commit is contained in:
Alberto Xamin 2020-12-20 12:55:56 +01:00
parent 37f5ddd755
commit 20e4ea5196
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
4 changed files with 75 additions and 48 deletions

View File

@ -7,93 +7,93 @@ class CardEvent(ABC):
class Agguato(CardEvent): class Agguato(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Agguato', '🛁') super().__init__("Agguato", "🛁")
self.desc = 'La distanza base di tra 2 qualsiasi giocatori è 1' self.desc = "La distanza base di tra 2 qualsiasi giocatori è 1"
self.desc_eng = 'The base distance from any 2 players is 1' self.desc_eng = "The base distance from any 2 players is 1"
class Cecchino(CardEvent): class Cecchino(CardEvent):
def __init__(self): #TODO def __init__(self): #TODO
super().__init__('Cecchino', '👁') super().__init__("Cecchino", "👁")
self.desc = 'Nel proprio turno i giocatori possono scartare 2 Bang assieme per sparare un bang a cui servono 2 mancato' self.desc = "Nel proprio turno i giocatori possono scartare 2 Bang assieme per sparare un bang a cui servono 2 mancato"
self.desc_eng = 'During their turn, players can discard 2 Bang! to shoot a bang that requires 2 missed' self.desc_eng = "During their turn, players can discard 2 Bang! to shoot a bang that requires 2 missed"
class DeadMan(CardEvent): class DeadMan(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Dead Man', '⚰️') super().__init__("Dead Man", "⚰️")
self.desc = 'Al proprio turno il giocatore che è morto per primo torna in vita con 2 vite e 2 carte' self.desc = "Al proprio turno il giocatore che è morto per primo torna in vita con 2 vite e 2 carte"
self.desc_eng = 'The first player that died return back to life with 2 hp and 2 cards' self.desc_eng = "The first player that died return back to life with 2 hp and 2 cards"
class FratelliDiSangue(CardEvent): class FratelliDiSangue(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Fratelli Di Sangue', '💉') super().__init__("Fratelli Di Sangue", "💉")
self.desc = 'All\'inizio del proprio turno i giocatori possono perdere 1 vita per darla a un altro giocatore' self.desc = "All'inizio del proprio turno i giocatori possono perdere 1 vita per darla a un altro giocatore"
self.desc_eng = 'At the begin of their turn, payers can lose 1 hp to give it to another player' self.desc_eng = "At the begin of their turn, payers can lose 1 hp to give it to another player"
class IlGiudice(CardEvent): class IlGiudice(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Il Giudice', '👨‍⚖️') super().__init__("Il Giudice", "👨‍⚖️")
self.desc = 'Non si possono equipaggiare carte a se stessi o agli altri' self.desc = "Non si possono equipaggiare carte a se stessi o agli altri"
self.desc_eng = 'You can\'t equip cards on your or other players' self.desc_eng = "You can't equip cards on your or other players"
class Lazo(CardEvent): class Lazo(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Lazo', '📿') super().__init__("Lazo", "📿")
self.desc = 'Le carte equipaggiate non hanno effetto' self.desc = "Le carte equipaggiate non hanno effetto"
self.desc_eng = 'Cards in the equipment slot do not work' self.desc_eng = "Cards in the equipment slot do not work"
class LeggeDelWest(CardEvent): class LeggeDelWest(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Legge Del West', '⚖️') super().__init__("Legge Del West", "⚖️")
self.desc = 'I giocatori mostrano la seconda carta che pescano e sono obbligati a usarla in quel turno (se possibile)' self.desc = "I giocatori mostrano la seconda carta che pescano e sono obbligati a usarla in quel turno (se possibile)"
self.desc_eng = 'Every player shows the second card that they draw and must use it in that round' self.desc_eng = "Every player shows the second card that they draw and must use it in that round"
class LiquoreForte(CardEvent): class LiquoreForte(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Liquore Forte', '🥃') super().__init__("Liquore Forte", "🥃")
self.desc = 'I giocatori possono evitare di pescare per recuperare 1 vita (clicca sulla carta evento per farlo)' self.desc = "I giocatori possono evitare di pescare per recuperare 1 vita (clicca sulla carta evento per farlo)"
self.desc_eng = 'Players can skip drawing to regain 1 HP (click on the event card to use)' self.desc_eng = "Players can skip drawing to regain 1 HP (click on the event card to use)"
class MinieraAbbandonata(CardEvent): class MinieraAbbandonata(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Miniera Abbandonata', '') super().__init__("Miniera Abbandonata", "")
self.desc = 'I giocatori pescano dagli scarti e scartano in cima al mazzo' self.desc = "I giocatori pescano dagli scarti e scartano in cima al mazzo"
self.desc_eng = 'Players draw from the discarded pile and discard to the deck' self.desc_eng = "Players draw from the discarded pile and discard to the deck"
class PerUnPugnoDiCarte(CardEvent): class PerUnPugnoDiCarte(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Per Un Pugno Di Carte', '🎴') super().__init__("Per Un Pugno Di Carte", "🎴")
self.desc = 'Il giocatore subisce tanti bang quante carte ha in mano' self.desc = "Il giocatore subisce tanti bang quante carte ha in mano"
self.desc_eng = 'On his turn the player is target of as many Bang as how many cards he has in his hand' self.desc_eng = "On his turn the player is target of as many Bang as how many cards he has in his hand"
class Peyote(CardEvent): class Peyote(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Peyote', '🌵') super().__init__("Peyote", "🌵")
self.desc = 'Invece che pescare il giocatore prova a indovinare il colore del seme, se lo indovina continua' self.desc = "Invece che pescare il giocatore prova a indovinare il colore del seme, se lo indovina continua"
self.desc_eng = 'Instead of drawing, the player tries to guess the color of the suit, if he\'s right he repeats' self.desc_eng = "Instead of drawing, the player tries to guess the color of the suit, if he's right he repeats"
class Ranch(CardEvent): class Ranch(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Ranch', '🐮') super().__init__("Ranch", "🐮")
self.desc = 'Dopo aver pescato il giocatore può scartare quante carte vuole dalla mano e pescarne altrettante dal mazzo' self.desc = "Dopo aver pescato il giocatore può scartare quante carte vuole dalla mano e pescarne altrettante dal mazzo"
self.desc_eng = 'After drawing, the player can discard as many cards as he wants from his hand and draw as many from the deck' self.desc_eng = "After drawing, the player can discard as many cards as he wants from his hand and draw as many from the deck"
class Rimbalzo(CardEvent): class Rimbalzo(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Rimbalzo', '') super().__init__("Rimbalzo", "")
self.desc = 'Il giocatore di turno può giocare bang contro le carte equipaggiate dagli altri giocatori, se non giocano mancato vengono scartate' self.desc = "Il giocatore di turno può giocare bang contro le carte equipaggiate dagli altri giocatori, se non giocano mancato vengono scartate"
self.desc_eng = 'The player can play bang against the cards equipped by the other players, if they do not play miss they are discarded' self.desc_eng = "The player can play bang against the cards equipped by the other players, if they do not play miss they are discarded"
class RouletteRussa(CardEvent): class RouletteRussa(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
super().__init__('Roulette Russa', '🇷🇺') super().__init__("Roulette Russa", "🇷🇺")
self.desc = 'A partire dallo sceriffo, ogni giocatore scarta 1 mancato, il primo che non lo fa perde 2 vite' self.desc = "A partire dallo sceriffo, ogni giocatore scarta 1 mancato, il primo che non lo fa perde 2 vite"
self.desc_eng = 'Starting from the sheriff, every player discards 1 missed, the first one that doesn\'t loses 2 HP' self.desc_eng = "Starting from the sheriff, every player discards 1 missed, the first one that doesn't loses 2 HP"
class Vendetta(CardEvent): class Vendetta(CardEvent):
def __init__(self): def __init__(self):
super().__init__('Vendetta', '😤') super().__init__("Vendetta", "😤")
self.desc = 'Alla fine del proprio turno il giocatore estrae, se esce ♥️ gioca un altro turno' self.desc = "Alla fine del proprio turno il giocatore estrae, se esce ♥️ gioca un altro turno"
self.desc_eng = 'When ending the turn, the player flips a card, if it\'s ♥️ he plays another turn' self.desc_eng = "When ending the turn, the player flips a card, if it's ♥️ he plays another turn"
def get_all_events(): def get_all_events():
return [ return [
@ -107,7 +107,7 @@ def get_all_events():
LiquoreForte(), LiquoreForte(),
# MinieraAbbandonata(), # MinieraAbbandonata(),
# PerUnPugnoDiCarte(), # PerUnPugnoDiCarte(),
# Peyote(), Peyote(),
# Ranch(), # Ranch(),
# Rimbalzo(), # Rimbalzo(),
# RouletteRussa(), # RouletteRussa(),

View File

@ -146,6 +146,14 @@ class Player:
self.sio.emit('notify_card', room=self.sid, data=mess) self.sio.emit('notify_card', room=self.sid, data=mess)
def notify_self(self): def notify_self(self):
if self.pending_action == PendingAction.DRAW and self.game.check_event(ce.Peyote):
self.available_cards = [{
'icon': '🔴'
},{
'icon': ''
}]
self.is_drawing = True
self.pending_action = PendingAction.CHOOSE
if isinstance(self.character, chars.CalamityJanet): if isinstance(self.character, chars.CalamityJanet):
if cs.Mancato(0, 0).name not in self.expected_response: if cs.Mancato(0, 0).name not in self.expected_response:
self.expected_response.append(cs.Mancato(0, 0).name) self.expected_response.append(cs.Mancato(0, 0).name)
@ -486,6 +494,19 @@ class Player:
while self.target_p == self.name or len(self.game.players[self.game.players_map[self.target_p]].hand) + len(self.game.players[self.game.players_map[self.target_p]].equipment) == 0: while self.target_p == self.name or len(self.game.players[self.game.players_map[self.target_p]].hand) + len(self.game.players[self.game.players_map[self.target_p]].equipment) == 0:
self.target_p = self.game.players[self.game.players_map[self.target_p]+1].name self.target_p = self.game.players[self.game.players_map[self.target_p]+1].name
self.notify_self() self.notify_self()
elif self.is_drawing and self.game.check_event(ce.Peyote):
self.is_drawing = False
card = self.game.deck.draw()
self.hand.append(card)
self.sio.emit('chat_message', room=self.game.name, data=f"_guess|{self.name}|{self.available_cards[card_index]['icon']}")
self.available_cards = []
if card_index == card.suit%2:
self.sio.emit('chat_message', room=self.game.name, data=f"_guess_right|{self.name}")
self.pending_action = PendingAction.DRAW
else:
self.sio.emit('chat_message', room=self.game.name, data=f"_guess_wrong|{self.name}")
self.pending_action = PendingAction.PLAY
self.notify_self()
# specifico per personaggio # specifico per personaggio
elif self.is_drawing and isinstance(self.character, chars.KitCarlson): elif self.is_drawing and isinstance(self.character, chars.KitCarlson):
self.hand.append(self.available_cards.pop(card_index)) self.hand.append(self.available_cards.pop(card_index))

View File

@ -80,7 +80,10 @@
"special_bart_cassidy": "{0} received a compensation because he was injured.", "special_bart_cassidy": "{0} received a compensation because he was injured.",
"special_el_gringo": "{0} stole a card from {1} when he was was injured.", "special_el_gringo": "{0} stole a card from {1} when he was was injured.",
"special_calamity": "{0} played {1} as Bang! against {2}.", "special_calamity": "{0} played {1} as Bang! against {2}.",
"allroles": "In the game there are: {0}." "allroles": "In the game there are: {0}.",
"guess": "{0} guesses {1}.",
"guess_right": "{0} was right.",
"guess_wrong": "{0} was wrong."
}, },
"foc": { "foc": {
"leggedelwest": "He must play this card on this turn if possible." "leggedelwest": "He must play this card on this turn if possible."

View File

@ -80,7 +80,10 @@
"special_bart_cassidy": "{0} ha ricevuto un risarcimento perchè è stato ferito.", "special_bart_cassidy": "{0} ha ricevuto un risarcimento perchè è stato ferito.",
"special_el_gringo": "{0} rubato una carta a {1} mentre veniva colpito.", "special_el_gringo": "{0} rubato una carta a {1} mentre veniva colpito.",
"special_calamity": "{0} ha giovato {1} come un Bang! contro {2}.", "special_calamity": "{0} ha giovato {1} come un Bang! contro {2}.",
"allroles": "Nella partita ci sono: {0}." "allroles": "Nella partita ci sono: {0}.",
"guess": "{0} pensa sia {1}.",
"guess_right": "{0} ha indovinato.",
"guess_wrong": "{0} ha sbagliato."
}, },
"foc": { "foc": {
"leggedelwest": "Ed è obbligato a usarla nel suo turno, se possibile" "leggedelwest": "Ed è obbligato a usarla nel suo turno, se possibile"