i dalton
This commit is contained in:
parent
2b5e2dd128
commit
57b9520eed
@ -43,7 +43,6 @@ class IlDottore(CardEvent):
|
|||||||
self.desc = "Il giocatore con meno vite recupera 1 vita"
|
self.desc = "Il giocatore con meno vite recupera 1 vita"
|
||||||
self.desc_eng = ""
|
self.desc_eng = ""
|
||||||
|
|
||||||
|
|
||||||
class Sermone(CardEvent):
|
class Sermone(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sermone", "✝️")
|
super().__init__("Sermone", "✝️")
|
||||||
@ -58,10 +57,16 @@ class Sparatoria(CardEvent):
|
|||||||
|
|
||||||
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 in senso antiorario!"
|
self.desc = "Si gioca in senso antiorario!"
|
||||||
self.desc_eng = ""
|
self.desc_eng = ""
|
||||||
|
|
||||||
|
class IDalton(CardEvent):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__("I Dalton", "🙇♂️")
|
||||||
|
self.desc = "Chi ha carte blu in gioco ne scarta 1 a sua scelta"
|
||||||
|
self.desc_eng = ""
|
||||||
|
|
||||||
class MezzogiornoDiFuoco(CardEvent):
|
class MezzogiornoDiFuoco(CardEvent):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Mezzogiorno di Fuoco", "🔥")
|
super().__init__("Mezzogiorno di Fuoco", "🔥")
|
||||||
@ -74,7 +79,7 @@ def get_all_events():
|
|||||||
Maledizione(),
|
Maledizione(),
|
||||||
# CittaFantasma(),
|
# CittaFantasma(),
|
||||||
CorsaAllOro(),
|
CorsaAllOro(),
|
||||||
# IDalton(),
|
IDalton(),
|
||||||
IlDottore(),
|
IlDottore(),
|
||||||
IlReverendo(),
|
IlReverendo(),
|
||||||
IlTreno(),
|
IlTreno(),
|
||||||
|
@ -32,6 +32,7 @@ class Game:
|
|||||||
self.disconnect_bot = True
|
self.disconnect_bot = True
|
||||||
self.player_bangs = 0
|
self.player_bangs = 0
|
||||||
self.is_russian_roulette_on = False
|
self.is_russian_roulette_on = False
|
||||||
|
self.dalton_on = False
|
||||||
self.bot_speed = 1.5
|
self.bot_speed = 1.5
|
||||||
|
|
||||||
def notify_room(self, sid=None):
|
def notify_room(self, sid=None):
|
||||||
@ -289,6 +290,17 @@ class Game:
|
|||||||
p.lives += 1
|
p.lives += 1
|
||||||
self.sio.emit('chat_message', room=self.name, data=f'_doctor_heal|{p.name}')
|
self.sio.emit('chat_message', room=self.name, data=f'_doctor_heal|{p.name}')
|
||||||
p.notify_self()
|
p.notify_self()
|
||||||
|
elif self.check_event(ceh.IDalton):
|
||||||
|
self.waiting_for = 0
|
||||||
|
self.readyCount = 0
|
||||||
|
self.dalton_on = True
|
||||||
|
for p in self.players:
|
||||||
|
if p.get_dalton():
|
||||||
|
self.waiting_for += 1
|
||||||
|
p.notify_self()
|
||||||
|
if self.waiting_for != 0:
|
||||||
|
return
|
||||||
|
self.dalton_on = False
|
||||||
|
|
||||||
if self.check_event(ce.PerUnPugnoDiCarte) and len(self.players[self.turn].hand) > 0:
|
if self.check_event(ce.PerUnPugnoDiCarte) and len(self.players[self.turn].hand) > 0:
|
||||||
self.player_bangs = len(self.players[self.turn].hand)
|
self.player_bangs = len(self.players[self.turn].hand)
|
||||||
|
@ -623,6 +623,13 @@ class Player:
|
|||||||
else:
|
else:
|
||||||
self.discarded_cards.append(self.available_cards.pop(card_index))
|
self.discarded_cards.append(self.available_cards.pop(card_index))
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
|
elif self.game.dalton_on and self.game.check_event(ceh.IDalton):
|
||||||
|
card = next(c for c in self.equipment if c == self.available_cards[card_index])
|
||||||
|
self.equipment.remove(card)
|
||||||
|
self.game.deck.scrap(card, True)
|
||||||
|
self.pending_action = PendingAction.WAIT
|
||||||
|
self.notify_self()
|
||||||
|
self.game.responders_did_respond_resume_turn()
|
||||||
elif self.is_drawing and self.game.check_event(ce.Peyote):
|
elif self.is_drawing and self.game.check_event(ce.Peyote):
|
||||||
self.is_drawing = False
|
self.is_drawing = False
|
||||||
card = self.game.deck.draw()
|
card = self.game.deck.draw()
|
||||||
@ -762,6 +769,16 @@ class Player:
|
|||||||
self.on_failed_response_cb = self.take_no_damage_response
|
self.on_failed_response_cb = self.take_no_damage_response
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_dalton(self):
|
||||||
|
equipments = [c for c in self.equipment if not c.usable_next_turn]
|
||||||
|
if len(equipments) == 0:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
self.sio.emit('chat_message', room=self.game.name, data=f"_dalton|{self.name}")
|
||||||
|
self.pending_action = PendingAction.CHOOSE
|
||||||
|
self.available_cards = equipments
|
||||||
|
return True
|
||||||
|
|
||||||
def get_indians(self, attacker):
|
def get_indians(self, attacker):
|
||||||
self.attacker = attacker
|
self.attacker = attacker
|
||||||
if self.character.check(self.game, chd.ApacheKid): return False
|
if self.character.check(self.game, chd.ApacheKid): return False
|
||||||
|
Loading…
Reference in New Issue
Block a user