add henry block
This commit is contained in:
parent
0d960390be
commit
7692c7818f
@ -2,75 +2,110 @@ from typing import List
|
|||||||
from bang.characters import Character
|
from bang.characters import Character
|
||||||
import bang.cards as cs
|
import bang.cards as cs
|
||||||
|
|
||||||
|
|
||||||
class BlackFlower(Character):
|
class BlackFlower(Character):
|
||||||
|
"""Una volta nel tuo turno, puoi usare una carta di fiori per sparare un BANG! extra."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Black Flower", max_lives=4)
|
super().__init__("Black Flower", max_lives=4)
|
||||||
# Una volta nel tuo turno, puoi usare una carta di fiori per sparare un BANG! extra.
|
self.icon = "🥀"
|
||||||
self.icon = '🥀'
|
|
||||||
|
|
||||||
def special(self, player, data): # fiori = suit.Clubs
|
def special(self, player, data): # fiori = suit.Clubs
|
||||||
if player.special_use_count > 0 or not any((c.suit == cs.Suit.CLUBS for c in player.hand)):
|
if player.special_use_count > 0 or not any(
|
||||||
|
(c.suit == cs.Suit.CLUBS for c in player.hand)
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
if any((player.get_sight() >= p['dist'] for p in player.game.get_visible_players(player))) and super().special(player, data):
|
if any(
|
||||||
|
(
|
||||||
|
player.get_sight() >= p["dist"]
|
||||||
|
for p in player.game.get_visible_players(player)
|
||||||
|
)
|
||||||
|
) and super().special(player, data):
|
||||||
from bang.players import PendingAction
|
from bang.players import PendingAction
|
||||||
|
|
||||||
player.available_cards = [c for c in player.hand if c.suit == cs.Suit.CLUBS]
|
player.available_cards = [c for c in player.hand if c.suit == cs.Suit.CLUBS]
|
||||||
player.special_use_count += 1
|
player.special_use_count += 1
|
||||||
player.pending_action = PendingAction.CHOOSE
|
player.pending_action = PendingAction.CHOOSE
|
||||||
player.choose_text = 'choose_play_as_bang'
|
player.choose_text = "choose_play_as_bang"
|
||||||
player.notify_self()
|
player.notify_self()
|
||||||
|
|
||||||
|
|
||||||
class ColoradoBill(Character):
|
class ColoradoBill(Character):
|
||||||
|
"""Ogni volta che giochi una carta BANG!, "estrai!": se è Picche, il colpo non può essere evitato.
|
||||||
|
|
||||||
|
Whenever you play a BANG! card, "draw!": if it's a Spade, the shot can't be avoided.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Colorado Bill", max_lives=4)
|
super().__init__("Colorado Bill", max_lives=4)
|
||||||
# Ogni volta che giochi una carta BANG!, "estrai!": se è Picche, il colpo non può essere evitato.
|
self.icon = "♠️"
|
||||||
self.icon = '♠️'
|
|
||||||
|
|
||||||
class DerSpotBurstRinger(Character):
|
class DerSpotBurstRinger(Character):
|
||||||
|
"""Una volta nel tuo turno, puoi usare una carta BANG! come Gatling.
|
||||||
|
|
||||||
|
Once per turn, you can use a BANG! card as a Gatling."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Der Spot Burst Ringer", max_lives=4)
|
super().__init__("Der Spot Burst Ringer", max_lives=4)
|
||||||
# Una volta nel tuo turno, puoi usare una carta BANG! come Gatling.
|
self.icon = "🫧"
|
||||||
self.icon = '🫧'
|
|
||||||
|
|
||||||
def special(self, player, data):
|
def special(self, player, data):
|
||||||
if player.special_use_count == 0 and \
|
if (
|
||||||
any((c.name == 'Bang!' for c in player.hand)) and super().special(player, data):
|
player.special_use_count == 0
|
||||||
|
and any((c.name == "Bang!" for c in player.hand))
|
||||||
|
and super().special(player, data)
|
||||||
|
):
|
||||||
player.special_use_count += 1
|
player.special_use_count += 1
|
||||||
# get cards from hand of type Bang and sort them by suit
|
# get cards from hand of type Bang and sort them by suit
|
||||||
cards = sorted([c for c in player.hand if c.name == 'Bang!'], key=lambda c: c.suit)
|
cards = sorted(
|
||||||
|
[c for c in player.hand if c.name == "Bang!"], key=lambda c: c.suit
|
||||||
|
)
|
||||||
player.hand.remove(cards[0])
|
player.hand.remove(cards[0])
|
||||||
player.game.deck.scrap(cards[0], True, player=player)
|
player.game.deck.scrap(cards[0], True, player=player)
|
||||||
player.notify_self()
|
player.notify_self()
|
||||||
player.game.attack_others(player, cs.Gatling(0, 0).name)
|
player.game.attack_others(player, cs.Gatling(0, 0).name)
|
||||||
|
|
||||||
|
|
||||||
class EvelynShebang(Character):
|
class EvelynShebang(Character):
|
||||||
|
"""Puoi rinunciare a pescare carte nella tua fase di pesca. Per ogni carta non pescata, spari un BANG! a distanza raggiungibile, a un diverso bersaglio."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Evelyn Shebang", max_lives=4)
|
super().__init__("Evelyn Shebang", max_lives=4)
|
||||||
# Puoi rinunciare a pescare carte nella tua fase di pesca. Per ogni carta non pescata, spari un BANG! a distanza raggiungibile, a un diverso bersaglio.
|
self.icon = "📵"
|
||||||
self.icon = '📵'
|
|
||||||
|
|
||||||
class HenryBlock(Character):
|
class HenryBlock(Character):
|
||||||
|
"""Chiunque peschi o scarti una tua cartain gioco o in mano) è bersaglio di un BANG!"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Henry Block", max_lives=4)
|
super().__init__("Henry Block", max_lives=4)
|
||||||
# Chiunque peschi o scarti una tua cartain gioco o in mano) è bersaglio di un BANG!.
|
self.icon = "🚯"
|
||||||
self.icon = '🚯'
|
|
||||||
|
|
||||||
class LemonadeJim(Character):
|
class LemonadeJim(Character):
|
||||||
|
"""Ogni volta che un altro giocatore gioca una Birra, puoi scartare una carta dalla mano per riguadagnare anche tu 1 punto vita."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Lemonade Jim", max_lives=4)
|
super().__init__("Lemonade Jim", max_lives=4)
|
||||||
# Ogni volta che un altro giocatore gioca una Birra, puoi scartare una carta dalla mano per riguadagnare anche tu 1 punto vita.
|
self.icon = "🍋"
|
||||||
self.icon = '🍋'
|
|
||||||
|
|
||||||
class MickDefender(Character):
|
class MickDefender(Character):
|
||||||
|
"""Se sei bersaglio di una carta marrone (non BANG!), puoi usare una carta Mancato! evitarne 1 gli effetti."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Mick Defender", max_lives=4)
|
super().__init__("Mick Defender", max_lives=4)
|
||||||
# Se sei bersaglio di una carta marrone (non BANG!), puoi usare una carta Mancato! evitarne 1 gli effetti.
|
self.icon = "⛔"
|
||||||
self.icon = '⛔'
|
|
||||||
|
|
||||||
class TucoFranziskaner(Character):
|
class TucoFranziskaner(Character):
|
||||||
|
"""Durante la tua fase di pesca, se non hai carte blu in gioco, pesca 2 carte extra."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Tuco Franziskaner", max_lives=4)
|
super().__init__("Tuco Franziskaner", max_lives=4)
|
||||||
# Durante la tua fase di pesca, se non hai carte blu in gioco, pesca 2 carte extra.
|
self.icon = "🥬"
|
||||||
self.icon = '🥬'
|
|
||||||
|
|
||||||
def all_characters() -> List[Character]:
|
def all_characters() -> List[Character]:
|
||||||
cards = [
|
cards = [
|
||||||
@ -78,12 +113,14 @@ def all_characters() -> List[Character]:
|
|||||||
ColoradoBill(),
|
ColoradoBill(),
|
||||||
DerSpotBurstRinger(),
|
DerSpotBurstRinger(),
|
||||||
# EvelynShebang(),
|
# EvelynShebang(),
|
||||||
# HenryBlock(),
|
HenryBlock(),
|
||||||
# LemonadeJim(),
|
# LemonadeJim(),
|
||||||
MickDefender(),
|
MickDefender(),
|
||||||
TucoFranziskaner(),
|
TucoFranziskaner(),
|
||||||
]
|
]
|
||||||
for c in cards:
|
for card in cards:
|
||||||
c.expansion_icon = '👻️'
|
card.expansion_icon = "👻️" # pylint: disable=attribute-defined-outside-init
|
||||||
c.expansion = 'the_valley_of_shadows'
|
card.expansion = ( # pylint: disable=attribute-defined-outside-init
|
||||||
|
"the_valley_of_shadows"
|
||||||
|
)
|
||||||
return cards
|
return cards
|
||||||
|
@ -530,7 +530,7 @@ class Game:
|
|||||||
attacker.pending_action = pl.PendingAction.WAIT
|
attacker.pending_action = pl.PendingAction.WAIT
|
||||||
attacker.notify_self()
|
attacker.notify_self()
|
||||||
self.get_player_named(target_username).notify_self()
|
self.get_player_named(target_username).notify_self()
|
||||||
elif not attacker.is_my_turn:
|
elif not attacker.is_my_turn or len(self.attack_queue) == 0:
|
||||||
self.players[self.turn].pending_action = pl.PendingAction.PLAY
|
self.players[self.turn].pending_action = pl.PendingAction.PLAY
|
||||||
|
|
||||||
def steal_discard(self, attacker: pl.Player, target_username: str, card: cs.Card):
|
def steal_discard(self, attacker: pl.Player, target_username: str, card: cs.Card):
|
||||||
|
@ -1385,6 +1385,8 @@ class Player:
|
|||||||
self.target_p = ""
|
self.target_p = ""
|
||||||
self.choose_action = ""
|
self.choose_action = ""
|
||||||
self.pending_action = PendingAction.PLAY
|
self.pending_action = PendingAction.PLAY
|
||||||
|
if target.character.check(self.game, tvosch.HenryBlock):
|
||||||
|
self.game.attack(target, self.name, card_name="Henry Block")
|
||||||
else:
|
else:
|
||||||
self.target_p = self.rissa_targets.pop(0).name
|
self.target_p = self.rissa_targets.pop(0).name
|
||||||
print(f"rissa targets: {self.rissa_targets}")
|
print(f"rissa targets: {self.rissa_targets}")
|
||||||
|
Loading…
Reference in New Issue
Block a user