add Flint Westwood
This commit is contained in:
parent
035fbb161d
commit
d1bd07c717
@ -11,8 +11,19 @@ class FlintWestwood(Character):
|
||||
def __init__(self):
|
||||
super().__init__("Flint Westwood", max_lives=4)
|
||||
# Nel suo turno può scambiare una carta dalla mano con 2 carte a caso dalla mano di un altro giocatore.
|
||||
# NOTE: La carta dalla tua mano è a scelta, non a caso. Se il giocatore bersaglio ha una sola carta, ne ricevi solo una.
|
||||
self.icon = '🔫'
|
||||
|
||||
def special(self, player, data):
|
||||
if not player.is_my_turn or not any((len(p.hand) > 0 for p in player.game.get_alive_players())) or not super().special(player, data):
|
||||
return False
|
||||
from bang.players import PendingAction
|
||||
player.available_cards = player.hand.copy()
|
||||
player.choose_text = 'choose_flint_special'
|
||||
player.pending_action = PendingAction.CHOOSE
|
||||
player.special_use_count += 1
|
||||
player.notify_self()
|
||||
|
||||
class GaryLooter(Character):
|
||||
def __init__(self):
|
||||
super().__init__("Gary Looter", max_lives=5)
|
||||
@ -51,14 +62,14 @@ class YoulGrinner(Character):
|
||||
|
||||
def all_characters() -> List[Character]:
|
||||
cards = [
|
||||
BigSpencer(),
|
||||
# BigSpencer(),
|
||||
FlintWestwood(),
|
||||
GaryLooter(),
|
||||
GreygoryDeckard(),
|
||||
JohnPain(),
|
||||
LeeVanKliff(),
|
||||
TerenKill(),
|
||||
YoulGrinner(),
|
||||
# GaryLooter(),
|
||||
# GreygoryDeckard(),
|
||||
# JohnPain(),
|
||||
# LeeVanKliff(),
|
||||
# TerenKill(),
|
||||
# YoulGrinner(),
|
||||
]
|
||||
for c in cards:
|
||||
c.expansion_icon = '🎪'
|
||||
|
@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
from enum import IntEnum
|
||||
import json
|
||||
from random import random, randrange, sample, uniform
|
||||
from random import random, randrange, sample, uniform, randint
|
||||
import socketio
|
||||
import bang.deck as deck
|
||||
import bang.roles as r
|
||||
@ -918,6 +918,27 @@ class Player:
|
||||
self.pending_action = PendingAction.WAIT
|
||||
self.game.responders_did_respond_resume_turn()
|
||||
self.notify_self()
|
||||
elif 'choose_flint_special' == self.choose_text:
|
||||
if card_index < len(self.hand):
|
||||
self.available_cards = [{
|
||||
'name': p.name,
|
||||
'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠',
|
||||
'avatar': p.avatar,
|
||||
'is_character': True,
|
||||
'is_player': True
|
||||
} for p in self.game.get_alive_players() if p.name != self.name and len(p.hand) > 0]
|
||||
self.choose_text = f'choose_flint_special;{card_index}'
|
||||
self.notify_self()
|
||||
elif 'choose_flint_special' in self.choose_text:
|
||||
if card_index < len(self.available_cards):
|
||||
my_card = self.hand.pop(int(self.choose_text.split(';')[1]))
|
||||
other_player = self.game.get_player_named(self.available_cards[card_index]['name'])
|
||||
for i in range(min(2, len(other_player.hand))):
|
||||
self.hand.append(other_player.hand.pop(randint(0, len(other_player.hand)-1)))
|
||||
other_player.hand.append(my_card)
|
||||
other_player.notify_self()
|
||||
self.pending_action = PendingAction.PLAY
|
||||
self.notify_self()
|
||||
elif self.game.check_event(ceh.NuovaIdentita) and self.choose_text == 'choose_nuova_identita':
|
||||
if card_index == 1: # the other character
|
||||
self.character = self.not_chosen_character
|
||||
|
@ -36,6 +36,7 @@
|
||||
<button :class="{'btn': true, 'cant-play':(pending_action != 2)}" :disabled="pending_action != 2" v-if="!(eventCard && eventCard.name == 'Sbornia') && is_my_turn && character.name === 'Raddie Snake' && special_use_count < 2 && gold_nuggets >=1" @click="()=>{$socket.emit('special', {})}">{{$t('special_ability')}}</button>
|
||||
<button :class="{'btn': true, 'cant-play':(pending_action != 2)}" :disabled="pending_action != 2" v-if="!(eventCard && eventCard.name == 'Sbornia') && is_my_turn && character.name === 'Der Spot Burst Ringer' && special_use_count < 1" @click="()=>{$socket.emit('special', {})}">{{$t('special_ability')}}</button>
|
||||
<button :class="{'btn': true, 'cant-play':(pending_action != 2)}" :disabled="pending_action != 2" v-if="!(eventCard && eventCard.name == 'Sbornia') && is_my_turn && character.name === 'Black Flower' && special_use_count < 1" @click="()=>{$socket.emit('special', {})}">{{$t('special_ability')}}</button>
|
||||
<button :class="{'btn': true, 'cant-play':(pending_action != 2)}" :disabled="pending_action != 2" v-if="!(eventCard && eventCard.name == 'Sbornia') && is_my_turn && character.name === 'Flint Westwood' && special_use_count < 1" @click="()=>{$socket.emit('special', {})}">{{$t('special_ability')}}</button>
|
||||
</div>
|
||||
<div v-if="lives > 0 || is_ghost" style="position:relative">
|
||||
<span id="hand_text">{{$t('hand')}}</span>
|
||||
|
Loading…
Reference in New Issue
Block a user