use panico and cat balou on itself
This commit is contained in:
parent
7f81276052
commit
1ce16a0753
@ -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 = "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.desc_eng = "Choose and discard a card from any other player."
|
||||||
self.need_target = True
|
self.need_target = True
|
||||||
|
self.can_target_self = True
|
||||||
|
|
||||||
def play_card(self, player, against, _with=None):
|
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':
|
if self.name == 'Cat Balou':
|
||||||
super().play_card(player, against=against)
|
super().play_card(player, against=against)
|
||||||
from bang.players import PendingAction
|
from bang.players import PendingAction
|
||||||
@ -393,11 +394,12 @@ class Panico(Card):
|
|||||||
super().__init__(suit, 'Panico!', number, range=1)
|
super().__init__(suit, 'Panico!', number, range=1)
|
||||||
self.icon = '😱'
|
self.icon = '😱'
|
||||||
self.need_target = True
|
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 = "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"
|
# self.desc_eng = "Steal a card from a player at distance 1"
|
||||||
|
|
||||||
def play_card(self, player, against, _with=None):
|
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)
|
super().play_card(player, against=against)
|
||||||
from bang.players import PendingAction
|
from bang.players import PendingAction
|
||||||
player.pending_action = PendingAction.CHOOSE
|
player.pending_action = PendingAction.CHOOSE
|
||||||
|
@ -594,7 +594,7 @@ class Player:
|
|||||||
did_play_card = False
|
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))
|
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 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
|
did_play_card = False
|
||||||
else:
|
else:
|
||||||
did_play_card = card.play_card(self, against, withCard)
|
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
|
if self.target_p and self.target_p != '': # panico, cat balou
|
||||||
target = self.game.get_player_named(self.target_p)
|
target = self.game.get_player_named(self.target_p)
|
||||||
card = None
|
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))
|
card = target.equipment.pop(card_index - len(target.hand))
|
||||||
else:
|
else:
|
||||||
card = target.hand.pop(card_index)
|
card = target.hand.pop(card_index)
|
||||||
|
@ -302,12 +302,13 @@ export default {
|
|||||||
if (Vue.config.devtools)
|
if (Vue.config.devtools)
|
||||||
console.log(pl)
|
console.log(pl)
|
||||||
let arr = []
|
let arr = []
|
||||||
for (let i=0; i<pl.ncards; i++)
|
if (this.username != player_name)
|
||||||
arr.push({
|
for (let i=0; i<pl.ncards; i++)
|
||||||
name: 'PewPew!',
|
arr.push({
|
||||||
icon: '💥',
|
name: 'PewPew!',
|
||||||
is_back: true,
|
icon: '💥',
|
||||||
})
|
is_back: true,
|
||||||
|
})
|
||||||
pl.equipment.forEach(x=>arr.push(x))
|
pl.equipment.forEach(x=>arr.push(x))
|
||||||
this.chooseCards = arr
|
this.chooseCards = arr
|
||||||
this.hasToChoose = true
|
this.hasToChoose = true
|
||||||
|
Loading…
Reference in New Issue
Block a user