use panico and cat balou on itself

This commit is contained in:
Giulio 2021-06-27 16:17:23 +02:00
parent 7f81276052
commit 1ce16a0753
3 changed files with 15 additions and 10 deletions

View File

@ -277,9 +277,10 @@ class CatBalou(Card):
# self.desc = "Fai scartare una carta a un qualsiasi giocatore, scegli a caso dalla mano, oppure fra quelle che ha in gioco"
# self.desc_eng = "Choose and discard a card from any other player."
self.need_target = True
self.can_target_self = True
def play_card(self, player, against, _with=None):
if against != None and (len(player.game.get_player_named(against).hand) + len(player.game.get_player_named(against).equipment)) > 0:
if against != None and (len(player.game.get_player_named(against).hand) + len(player.game.get_player_named(against).equipment)) > 0 and (player.name != against or len(player.equipment) > 0):
if self.name == 'Cat Balou':
super().play_card(player, against=against)
from bang.players import PendingAction
@ -393,11 +394,12 @@ class Panico(Card):
super().__init__(suit, 'Panico!', number, range=1)
self.icon = '😱'
self.need_target = True
self.can_target_self = True
# self.desc = "Pesca una carta da un giocatore a distanza 1, scegli a caso dalla mano, oppure fra quelle che ha in gioco"
# self.desc_eng = "Steal a card from a player at distance 1"
def play_card(self, player, against, _with=None):
if against != None and (len(player.game.get_player_named(against).hand) + len(player.game.get_player_named(against).equipment)) > 0:
if against != None and (len(player.game.get_player_named(against).hand) + len(player.game.get_player_named(against).equipment)) > 0 and (player.name != against or len(player.equipment) > 0):
super().play_card(player, against=against)
from bang.players import PendingAction
player.pending_action = PendingAction.CHOOSE

View File

@ -594,7 +594,7 @@ class Player:
did_play_card = False
event_blocks_card = (self.game.check_event(ce.IlGiudice) and (card.is_equipment or (card.usable_next_turn and not card.can_be_used_now))) or (self.game.check_event(ce.Lazo) and card.usable_next_turn and card.can_be_used_now) or (self.game.check_event(ceh.Manette) and card.suit != self.committed_suit_manette and not (card.usable_next_turn and card.can_be_used_now))
if not(against != None and (isinstance(self.game.get_player_named(against).character, chd.ApacheKid) or len([c for c in self.game.get_player_named(against).gold_rush_equipment if isinstance(c, grc.Calumet)]) > 0) and card.check_suit(self.game, [cs.Suit.DIAMONDS])) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK) and not event_blocks_card:
if against == self.name and not isinstance(card, csd.Tequila):
if against == self.name and not isinstance(card, csd.Tequila) and not isinstance(card, cs.Panico) and not isinstance(card, cs.CatBalou):
did_play_card = False
else:
did_play_card = card.play_card(self, against, withCard)
@ -626,7 +626,9 @@ class Player:
if self.target_p and self.target_p != '': # panico, cat balou
target = self.game.get_player_named(self.target_p)
card = None
if card_index >= len(target.hand):
if (target.name == self.name):
card = self.equipment.pop(card_index)
elif card_index >= len(target.hand):
card = target.equipment.pop(card_index - len(target.hand))
else:
card = target.hand.pop(card_index)

View File

@ -302,6 +302,7 @@ export default {
if (Vue.config.devtools)
console.log(pl)
let arr = []
if (this.username != player_name)
for (let i=0; i<pl.ncards; i++)
arr.push({
name: 'PewPew!',