add descriptions and wait handle death
This commit is contained in:
parent
ab25d38a99
commit
9777742e08
@ -22,7 +22,7 @@ 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 returns back to life with 2 hp and 2 cards"
|
||||||
|
|
||||||
class FratelliDiSangue(CardEvent):
|
class FratelliDiSangue(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -5,67 +5,67 @@ class Benedizione(CardEvent):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Benedizione", "🙏")
|
super().__init__("Benedizione", "🙏")
|
||||||
self.desc = "Tutte le carte sono considerate di cuori ♥️"
|
self.desc = "Tutte le carte sono considerate di cuori ♥️"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "All cards are of hearts ♥️"
|
||||||
|
|
||||||
class Maledizione(CardEvent):
|
class Maledizione(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Maledizione", "🤬")
|
super().__init__("Maledizione", "🤬")
|
||||||
self.desc = "Tutte le carte sono considerate di picche ♠"
|
self.desc = "Tutte le carte sono considerate di picche ♠"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "All cards are of spades ♠"
|
||||||
|
|
||||||
class Sbornia(CardEvent):
|
class Sbornia(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sbornia", "🥴")
|
super().__init__("Sbornia", "🥴")
|
||||||
self.desc = "I personaggi perdono le loro abilità speciali"
|
self.desc = "I personaggi perdono le loro abilità speciali"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "The characters lose their special abilities"
|
||||||
|
|
||||||
class Sete(CardEvent):
|
class Sete(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sete", "🥵")
|
super().__init__("Sete", "🥵")
|
||||||
self.desc = "I giocatori pescano 1 carta in meno nella loro fase 1"
|
self.desc = "I giocatori pescano 1 carta in meno nella loro fase 1"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Players only draw 1 card at the start of their turn"
|
||||||
|
|
||||||
class IlTreno(CardEvent):
|
class IlTreno(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Il Treno", "🚂")
|
super().__init__("Il Treno", "🚂")
|
||||||
self.desc = "I giocatori pescano 1 carta extra nella loro fase 1"
|
self.desc = "I giocatori pescano 1 carta extra nella loro fase 1"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Players draw 1 extra card"
|
||||||
|
|
||||||
class IlReverendo(CardEvent):
|
class IlReverendo(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Il Reverendo", "⛪️")
|
super().__init__("Il Reverendo", "⛪️")
|
||||||
self.desc = "Non si possono giocare le carte Birra"
|
self.desc = "Non si possono giocare le carte Birra"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Beers can't be played"
|
||||||
|
|
||||||
class IlDottore(CardEvent):
|
class IlDottore(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Il Dottore", "👨⚕️")
|
super().__init__("Il Dottore", "👨⚕️")
|
||||||
self.desc = "Il/i giocatore/i con meno vite ne recupera/no una"
|
self.desc = "Il/i giocatore/i con meno vite ne recupera/no una"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "The player with the least amount of HP gets healed 1"
|
||||||
|
|
||||||
class Sermone(CardEvent):
|
class Sermone(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sermone", "✝️")
|
super().__init__("Sermone", "✝️")
|
||||||
self.desc = "I giocatori non possono giocare Bang! durante il loro turno"
|
self.desc = "I giocatori non possono giocare Bang! durante il loro turno"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Players can't play Bang! during their turn"
|
||||||
|
|
||||||
class Sparatoria(CardEvent):
|
class Sparatoria(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sparatoria", "🔫🔫")
|
super().__init__("Sparatoria", "🔫🔫")
|
||||||
self.desc = "Il limite di Bang! per turno è 2 invece che 1"
|
self.desc = "Il limite di Bang! per turno è 2 invece che 1"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "The turn Bang! limit is 2"
|
||||||
|
|
||||||
class CorsaAllOro(CardEvent):
|
class CorsaAllOro(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Corsa All'Oro", "🌟")
|
super().__init__("Corsa All'Oro", "🌟")
|
||||||
self.desc = "Si gioca per un intero giro in senso antiorario, tuttavia gli effetti delle carte rimangono invariati"
|
self.desc = "Si gioca per un intero giro in senso antiorario, tuttavia gli effetti delle carte rimangono invariati"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Turns are played counter clockwise"
|
||||||
|
|
||||||
class IDalton(CardEvent):
|
class IDalton(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("I Dalton", "🙇♂️")
|
super().__init__("I Dalton", "🙇♂️")
|
||||||
self.desc = "Chi ha carte blu in gioco ne scarta 1 a sua scelta"
|
self.desc = "Chi ha carte blu in gioco ne scarta 1 a sua scelta"
|
||||||
self.desc_eng = ""
|
self.desc_eng = "Players that have blue cards equipped, discard 1 of those card of their choice"
|
||||||
|
|
||||||
class Manette(CardEvent):
|
class Manette(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -83,7 +83,7 @@ class CittaFantasma(CardEvent):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Città Fantasma", "👻")
|
super().__init__("Città Fantasma", "👻")
|
||||||
self.desc = "Tutti i giocatori morti tornano in vita al proprio turno, non possono morire e pescano 3 carte invece che 2. Quando terminano il turno tornano morti."
|
self.desc = "Tutti i giocatori morti tornano in vita al proprio turno, non possono morire e pescano 3 carte invece che 2. Quando terminano il turno tornano morti."
|
||||||
self.desc_eng = ""
|
self.desc_eng = "All dead players come back to life in their turn, they can't die and draw 3 cards instead of 2. When they end their turn the die."
|
||||||
|
|
||||||
class MezzogiornoDiFuoco(CardEvent):
|
class MezzogiornoDiFuoco(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -36,6 +36,7 @@ class Game:
|
|||||||
self.bot_speed = 1.5
|
self.bot_speed = 1.5
|
||||||
self.incremental_turn = 0
|
self.incremental_turn = 0
|
||||||
self.did_resuscitate_deadman = False
|
self.did_resuscitate_deadman = False
|
||||||
|
self.is_handling_death = False
|
||||||
|
|
||||||
def notify_room(self, sid=None):
|
def notify_room(self, sid=None):
|
||||||
if len([p for p in self.players if p.character == None]) != 0 or sid:
|
if len([p for p in self.players if p.character == None]) != 0 or sid:
|
||||||
@ -244,18 +245,18 @@ class Game:
|
|||||||
elif self.is_russian_roulette_on and self.check_event(ce.RouletteRussa):
|
elif self.is_russian_roulette_on and self.check_event(ce.RouletteRussa):
|
||||||
pls = self.get_alive_players()
|
pls = self.get_alive_players()
|
||||||
if did_lose:
|
if did_lose:
|
||||||
pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)]
|
target_pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)]
|
||||||
print('stop roulette')
|
print('stop roulette')
|
||||||
pl.lives -= 1
|
target_pl.lives -= 1
|
||||||
pl.notify_self()
|
target_pl.notify_self()
|
||||||
self.is_russian_roulette_on = False
|
self.is_russian_roulette_on = False
|
||||||
self.players[self.turn].play_turn()
|
self.players[self.turn].play_turn()
|
||||||
else:
|
else:
|
||||||
self.player_bangs += 1
|
self.player_bangs += 1
|
||||||
pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)]
|
target_pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)]
|
||||||
print(f'next in line {pl.name}')
|
print(f'next in line {target_pl.name}')
|
||||||
if pl.get_banged(self.deck.event_cards[0]):
|
if target_pl.get_banged(self.deck.event_cards[0]):
|
||||||
pl.notify_self()
|
target_pl.notify_self()
|
||||||
else:
|
else:
|
||||||
self.responders_did_respond_resume_turn(did_lose=True)
|
self.responders_did_respond_resume_turn(did_lose=True)
|
||||||
else:
|
else:
|
||||||
@ -383,6 +384,7 @@ class Game:
|
|||||||
|
|
||||||
def player_death(self, player: pl.Player, disconnected=False):
|
def player_death(self, player: pl.Player, disconnected=False):
|
||||||
if not player in self.players or player.is_ghost: return
|
if not player in self.players or player.is_ghost: return
|
||||||
|
self.is_handling_death = True
|
||||||
import bang.expansions.dodge_city.characters as chd
|
import bang.expansions.dodge_city.characters as chd
|
||||||
print(player.attacker)
|
print(player.attacker)
|
||||||
if player.attacker and player.attacker in self.players and isinstance(player.attacker.role, roles.Sheriff) and isinstance(player.role, roles.Vice):
|
if player.attacker and player.attacker in self.players and isinstance(player.attacker.role, roles.Sheriff) and isinstance(player.role, roles.Vice):
|
||||||
@ -473,7 +475,7 @@ class Game:
|
|||||||
herb[0].hand.append(self.deck.draw(True))
|
herb[0].hand.append(self.deck.draw(True))
|
||||||
herb[0].hand.append(self.deck.draw(True))
|
herb[0].hand.append(self.deck.draw(True))
|
||||||
herb[0].notify_self()
|
herb[0].notify_self()
|
||||||
|
self.is_handling_death = False
|
||||||
if corpse.is_my_turn:
|
if corpse.is_my_turn:
|
||||||
self.next_turn()
|
self.next_turn()
|
||||||
|
|
||||||
@ -484,6 +486,7 @@ class Game:
|
|||||||
self.players = [p for p in self.players if not p.is_bot]
|
self.players = [p for p in self.players if not p.is_bot]
|
||||||
print(self.players)
|
print(self.players)
|
||||||
self.started = False
|
self.started = False
|
||||||
|
self.is_handling_death = False
|
||||||
self.waiting_for = 0
|
self.waiting_for = 0
|
||||||
self.incremental_turn = 0
|
self.incremental_turn = 0
|
||||||
for p in self.players:
|
for p in self.players:
|
||||||
|
@ -516,7 +516,7 @@ class Player:
|
|||||||
return s
|
return s
|
||||||
|
|
||||||
def play_card(self, hand_index: int, against=None, _with=None):
|
def play_card(self, hand_index: int, against=None, _with=None):
|
||||||
if not self.is_my_turn or self.pending_action != PendingAction.PLAY:
|
if not self.is_my_turn or self.pending_action != PendingAction.PLAY or self.game.is_handling_death:
|
||||||
return
|
return
|
||||||
if not (0 <= hand_index < len(self.hand) + len(self.equipment)):
|
if not (0 <= hand_index < len(self.hand) + len(self.equipment)):
|
||||||
return
|
return
|
||||||
@ -662,6 +662,7 @@ class Player:
|
|||||||
if self.game.check_event(ceh.Sete): pickable_stop = 2
|
if self.game.check_event(ceh.Sete): pickable_stop = 2
|
||||||
if self.game.check_event(ceh.IlTreno): pickable_stop = 0
|
if self.game.check_event(ceh.IlTreno): pickable_stop = 0
|
||||||
if len(self.available_cards) == pickable_stop:
|
if len(self.available_cards) == pickable_stop:
|
||||||
|
if len(self.available_cards) > 0:
|
||||||
self.game.deck.put_on_top(self.available_cards.pop())
|
self.game.deck.put_on_top(self.available_cards.pop())
|
||||||
self.is_drawing = False
|
self.is_drawing = False
|
||||||
self.pending_action = PendingAction.PLAY
|
self.pending_action = PendingAction.PLAY
|
||||||
@ -787,7 +788,7 @@ class Player:
|
|||||||
if len(equipments) == 0:
|
if len(equipments) == 0:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
self.sio.emit('chat_message', room=self.game.name, data=f"_dalton|{self.name}")
|
self.choose_text = 'choose_dalton'
|
||||||
self.pending_action = PendingAction.CHOOSE
|
self.pending_action = PendingAction.CHOOSE
|
||||||
self.available_cards = equipments
|
self.available_cards = equipments
|
||||||
return True
|
return True
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
"choose_card_to_get": "Choose a card",
|
"choose_card_to_get": "Choose a card",
|
||||||
"choose_guess": "Guess the color of the suit",
|
"choose_guess": "Guess the color of the suit",
|
||||||
"choose_ranch": "Choose the cards to replace",
|
"choose_ranch": "Choose the cards to replace",
|
||||||
|
"choose_dalton": "Choose which equipment to discard",
|
||||||
"choose_fratelli_di_sangue": "Choose who you want to donate one of your lives",
|
"choose_fratelli_di_sangue": "Choose who you want to donate one of your lives",
|
||||||
"choose_cecchino": "Choose who to shoot",
|
"choose_cecchino": "Choose who to shoot",
|
||||||
"choose_rimbalzo_player": "Choose the target of the bang",
|
"choose_rimbalzo_player": "Choose the target of the bang",
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
"choose_card_to_get": "Scegli che carta pescare",
|
"choose_card_to_get": "Scegli che carta pescare",
|
||||||
"choose_guess": "Indovina il colore del seme",
|
"choose_guess": "Indovina il colore del seme",
|
||||||
"choose_ranch": "Scegli le carte da sostituire",
|
"choose_ranch": "Scegli le carte da sostituire",
|
||||||
|
"choose_dalton": "Scegli che equipaggiamento scartare",
|
||||||
"choose_fratelli_di_sangue": "Scegli a chi donare una delle tue vite",
|
"choose_fratelli_di_sangue": "Scegli a chi donare una delle tue vite",
|
||||||
"choose_cecchino": "Scegli contro chi sparare",
|
"choose_cecchino": "Scegli contro chi sparare",
|
||||||
"choose_rimbalzo_player": "Scegli contro chi scartare il bang",
|
"choose_rimbalzo_player": "Scegli contro chi scartare il bang",
|
||||||
|
Loading…
Reference in New Issue
Block a user