add taglia

This commit is contained in:
Alberto Xamin 2023-01-07 12:11:18 +00:00
parent 4958a2c7dc
commit 1ea91af237
4 changed files with 22 additions and 4 deletions

View File

@ -62,7 +62,18 @@ class Taglia(Card):
super().__init__(suit, 'Taglia', number, is_equipment=True)
self.need_target = True
self.icon = '💰' # chiunque colpisca il giocatore con la taglia pesca una carta dal mazzo, si toglie solo con panico, cat balou, dalton
#TODO
def play_card(self, player, against, _with=None):
if (player.game.check_event(ce.IlGiudice)):
return False
if against != None:
self.reset_card()
player.sio.emit('chat_message', room=player.game.name,
data=f'_play_card_against|{player.name}|{self.name}|{against}')
player.game.get_player_named(against).equipment.append(self)
player.game.get_player_named(against).notify_self()
return True
return False
class UltimoGiro(Card):
def __init__(self, suit, number):
@ -196,7 +207,7 @@ def get_starting_deck() -> List[Card]:
# Lemat(Suit.DIAMONDS, 4),
SerpenteASonagli(Suit.HEARTS, 7),
Shotgun(Suit.SPADES, 'K'),
# Taglia(Suit.CLUBS, 9),
Taglia(Suit.CLUBS, 9),
UltimoGiro(Suit.DIAMONDS, 8),
Tomahawk(Suit.DIAMONDS, 'A'),
# Sventagliata(Suit.SPADES, 2),

View File

@ -1152,6 +1152,11 @@ class Player:
self.sio.emit('chat_message', room=self.game.name,
data=f'_special_el_gringo|{self.name}|{self.attacker.name}')
self.attacker.notify_self()
if self.attacker and any((isinstance(c, tvosc.Taglia) for c in self.equipment)):
self.attacker.hand.append(self.game.deck.draw(True))
self.sio.emit('chat_message', room=self.game.name,
data=f'_taglia_reward|{self.name}|{self.attacker.name}')
self.attacker.notify_self()
if self.attacker and len(self.hand) > 0 and any((isinstance(c, tvosc.Shotgun) for c in self.attacker.equipment)):
c = self.hand.pop(randrange(0, len(self.hand)))
self.game.deck.scrap(c, True)

View File

@ -133,7 +133,8 @@
"use_special": "{0} used the special ability of their character ({1})",
"gold_rush_pay_discard": "{0} discarded {2} from {1}.",
"choose_emporio": "{0} has chosen {1} from General Store.",
"shotgun_scrap": "When the shotgun hit {0} a card flew away from his hand ({1})"
"shotgun_scrap": "When the shotgun hit {0} a card flew away from his hand ({1})",
"taglia_reward": "{1} got a card from the bounty on {0}"
},
"foc": {
"leggedelwest": "He must play this card on this turn if possible."

View File

@ -133,7 +133,8 @@
"use_special": "{0} ha usato l'abilità speciale del suo personaggio ({1})",
"gold_rush_pay_discard": "{0} ha fatto scartare {2} a {1}.",
"choose_emporio": "{0} ha scelto {1} da Emporio.",
"shotgun_scrap": "Quando lo shotgun ha colpito {0} gli ha tolto una carta ({1})"
"shotgun_scrap": "Quando lo shotgun ha colpito {0} gli ha tolto una carta ({1})",
"taglia_reward": "{1} ha ottenuto ricompensa dalla taglia su {0}"
},
"foc": {
"leggedelwest": "Ed è obbligato a usarla nel suo turno, se possibile"