characters refactor
This commit is contained in:
parent
c76cdc4fb1
commit
cadabeb5f4
@ -1,5 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC
|
||||||
from bang.expansions import *
|
from bang.expansions import *
|
||||||
from typing import List, TYPE_CHECKING
|
from typing import List, TYPE_CHECKING
|
||||||
from globals import G
|
from globals import G
|
||||||
@ -8,8 +8,19 @@ if TYPE_CHECKING:
|
|||||||
from bang.players import Player
|
from bang.players import Player
|
||||||
from bang.game import Game
|
from bang.game import Game
|
||||||
|
|
||||||
|
|
||||||
class Character(ABC):
|
class Character(ABC):
|
||||||
def __init__(self, name: str, max_lives: int, sight_mod: int = 0, visibility_mod: int = 0, pick_mod: int = 0, desc: str = ''):
|
"""Base class for all characters"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
name: str,
|
||||||
|
max_lives: int,
|
||||||
|
sight_mod: int = 0,
|
||||||
|
visibility_mod: int = 0,
|
||||||
|
pick_mod: int = 0,
|
||||||
|
desc: str = "",
|
||||||
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = name
|
self.name = name
|
||||||
self.max_lives = max_lives
|
self.max_lives = max_lives
|
||||||
@ -18,141 +29,200 @@ class Character(ABC):
|
|||||||
self.is_character = True
|
self.is_character = True
|
||||||
self.pick_mod = pick_mod
|
self.pick_mod = pick_mod
|
||||||
self.desc = desc
|
self.desc = desc
|
||||||
self.icon = '🤷♂️'
|
self.icon = "🤷♂️"
|
||||||
self.number = ''.join(['❤️']*self.max_lives)
|
self.number = "".join(["❤️"] * self.max_lives)
|
||||||
|
|
||||||
def check(self, game:Game, character:Character):
|
def check(self, game: Game, character: Character):
|
||||||
|
"""Check character type and if Sbornia is active"""
|
||||||
import bang.expansions.high_noon.card_events as ceh
|
import bang.expansions.high_noon.card_events as ceh
|
||||||
|
|
||||||
if game.check_event(ceh.Sbornia):
|
if game.check_event(ceh.Sbornia):
|
||||||
return False
|
return False
|
||||||
return isinstance(self, character)
|
return isinstance(self, character)
|
||||||
|
|
||||||
def special(self, player:Player, data):
|
def special(self, player: Player, data):
|
||||||
|
"""Base for special actions that can be performed by a character"""
|
||||||
import bang.expansions.high_noon.card_events as ceh
|
import bang.expansions.high_noon.card_events as ceh
|
||||||
|
|
||||||
if player.game.check_event(ceh.Sbornia):
|
if player.game.check_event(ceh.Sbornia):
|
||||||
return False
|
return False
|
||||||
G.sio.emit('chat_message', room=player.game.name, data=f'_use_special|{player.name}|{self.name}')
|
G.sio.emit(
|
||||||
|
"chat_message",
|
||||||
|
room=player.game.name,
|
||||||
|
data=f"_use_special|{player.name}|{self.name}",
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class BartCassidy(Character):
|
class BartCassidy(Character):
|
||||||
|
"""Ogni volta che viene ferito, pesca una carta
|
||||||
|
|
||||||
|
Each time he is hurt, he draws a card"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Bart Cassidy", max_lives=4)
|
super().__init__("Bart Cassidy", max_lives=4)
|
||||||
# self.desc = "Ogni volta che viene ferito, pesca una carta"
|
self.icon = "💔"
|
||||||
# self.desc_eng = "Each time he is hurt, he draws a card"
|
|
||||||
self.icon = '💔'
|
|
||||||
|
|
||||||
def on_hurt(self, dmg):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class BlackJack(Character):
|
class BlackJack(Character):
|
||||||
|
"""All'inizio del suo turno, quando deve pescare, mostra a tutti la seconda carta, se è Cuori o Quadri pesca una terza carta senza farla vedere
|
||||||
|
|
||||||
|
At the beginning of his turn, when he has to draw, he shows everyone the second card, if it is Hearts or Diamonds he draws a third card without showing it
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Black Jack", max_lives=4)
|
super().__init__("Black Jack", max_lives=4)
|
||||||
# self.desc = "All'inizio del suo turno, quando deve pescare, mostra a tutti la seconda carta, se è Cuori o Quadri pesca una terza carta senza farla vedere"
|
self.icon = "🎰"
|
||||||
# self.desc_eng = "At the beginning of his turn, when he has to draw, he shows everyone the second card, if it is Hearts or Diamonds he draws a third card without showing it"
|
|
||||||
self.icon = '🎰'
|
|
||||||
|
|
||||||
class CalamityJanet(Character):
|
class CalamityJanet(Character):
|
||||||
|
"""Può usare i Mancato! come Bang! e viceversa
|
||||||
|
|
||||||
|
She can use the Missed! as Bang! and the other way around"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Calamity Janet", max_lives=4)
|
super().__init__("Calamity Janet", max_lives=4)
|
||||||
self.icon = '🔀'
|
self.icon = "🔀"
|
||||||
# self.desc = "Può usare i Mancato! come Bang! e viceversa"
|
|
||||||
# self.desc_eng = "She can use the Missed! as Bang! and the other way around"
|
|
||||||
|
|
||||||
class ElGringo(Character):
|
class ElGringo(Character):
|
||||||
|
"""Ogni volta che perde un punto vita pesca una carta dalla mano del giocatore responsabile ma solo se il giocatore in questione ha carte in mano (una carta per ogni punto vita)
|
||||||
|
|
||||||
|
Each time he is hurt, he draws a card from the hand of the attacking player"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("El Gringo", max_lives=3)
|
super().__init__("El Gringo", max_lives=3)
|
||||||
# self.desc = "Ogni volta che perde un punto vita pesca una carta dalla mano del giocatore responsabile ma solo se il giocatore in questione ha carte in mano (una carta per ogni punto vita)"
|
self.icon = "🤕"
|
||||||
# self.desc_eng = "Each time he is hurt, he draws a card from the hand of the attacking player"
|
|
||||||
self.icon = '🤕'
|
|
||||||
# ovviamente la dinamite non è considerata danno inferto da un giocatore
|
# ovviamente la dinamite non è considerata danno inferto da un giocatore
|
||||||
|
|
||||||
|
|
||||||
class JesseJones(Character):
|
class JesseJones(Character):
|
||||||
|
"""All'inizio del suo turno, quando deve pescare, può prendere la prima carta a caso dalla mano di un giocatore e la seconda dal mazzo
|
||||||
|
|
||||||
|
When he has to draw his cards, he may draw the first card from the hand of another player
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Jesse Jones", max_lives=4)
|
super().__init__("Jesse Jones", max_lives=4)
|
||||||
# self.desc = "All'inizio del suo turno, quando deve pescare, può prendere la prima carta a caso dalla mano di un giocatore e la seconda dal mazzo"
|
self.icon = "😜"
|
||||||
# self.desc_eng = "When he has to draw his cards, he may draw the first card from the hand of another player"
|
|
||||||
self.icon = '😜'
|
|
||||||
|
|
||||||
class Jourdonnais(Character):
|
class Jourdonnais(Character):
|
||||||
|
"""Gioca come se avesse un Barile sempre attivo, nel caso in cui metta in gioco un Barile 'Reale' può estrarre due volte
|
||||||
|
|
||||||
|
He plays as he had a Barrel always active, if he equips another Barrel, he can flip 2 cards
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Jourdonnais", max_lives=4)
|
super().__init__("Jourdonnais", max_lives=4)
|
||||||
# self.desc = "Gioca come se avesse un Barile sempre attivo, nel caso in cui metta in gioco un Barile 'Reale' può estrarre due volte"
|
self.icon = "🛢"
|
||||||
# self.desc_eng = "He plays as he had a Barrel always active, if he equips another Barrel, he can flip 2 cards"
|
|
||||||
self.icon = '🛢'
|
|
||||||
|
|
||||||
class KitCarlson(Character):
|
class KitCarlson(Character):
|
||||||
|
"""All'inizio del suo turno, quando deve pescare, pesca tre carte, ne sceglie due da tenere in mano e la rimanente la rimette in cima la mazzo
|
||||||
|
|
||||||
|
When he has to draw, he peeks 3 cards and chooses 2, putting the other card on the top of the deck
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Kit Carlson", max_lives=4)
|
super().__init__("Kit Carlson", max_lives=4)
|
||||||
# self.desc = "All'inizio del suo turno, quando deve pescare, pesca tre carte, ne sceglie due da tenere in mano e la rimanente la rimette in cima la mazzo"
|
self.icon = "🤔"
|
||||||
# self.desc_eng = "When he has to draw, he peeks 3 cards and chooses 2, putting the other card on the top of the deck"
|
|
||||||
self.icon = '🤔'
|
|
||||||
|
|
||||||
class LuckyDuke(Character):
|
class LuckyDuke(Character):
|
||||||
|
"""Ogni volta che deve estrarre, prende due carte dal mazzo, sceglie una delle due carte per l'estrazione, infine le scarta entrambe
|
||||||
|
|
||||||
|
Every time he has to flip a card, he can flip 2 times"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Lucky Duke", max_lives=4, pick_mod=1)
|
super().__init__("Lucky Duke", max_lives=4, pick_mod=1)
|
||||||
# self.desc = "Ogni volta che deve estrarre, prende due carte dal mazzo, sceglie una delle due carte per l'estrazione, infine le scarta entrambe"
|
self.icon = "🍀"
|
||||||
# self.desc_eng = "Every time he has to flip a card, he can flip 2 times"
|
|
||||||
self.icon = '🍀'
|
|
||||||
|
|
||||||
class PaulRegret(Character):
|
class PaulRegret(Character):
|
||||||
|
"""Gioca come se avesse una Mustang sempre attiva, nel caso in cui metta in gioco una Mustang 'Reale' l'effetto si somma tranquillamente
|
||||||
|
|
||||||
|
The other players see him at distance +1"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Paul Regret", max_lives=3, visibility_mod=1)
|
super().__init__("Paul Regret", max_lives=3, visibility_mod=1)
|
||||||
# self.desc = "Gioca come se avesse una Mustang sempre attiva, nel caso in cui metta in gioco una Mustang 'Reale' l'effetto si somma tranquillamente"
|
self.icon = "🏇"
|
||||||
# self.desc_eng = "The other players see him at distance +1"
|
|
||||||
self.icon = '🏇'
|
|
||||||
|
|
||||||
class PedroRamirez(Character):
|
class PedroRamirez(Character):
|
||||||
|
"""All'inizio del suo turno, quando deve pescare, può prendere la prima carta dalla cima degli scarti e la seconda dal mazzo
|
||||||
|
|
||||||
|
When he has to draw, he may pick the first card from the discarded cards"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Pedro Ramirez", max_lives=4)
|
super().__init__("Pedro Ramirez", max_lives=4)
|
||||||
# self.desc = "All'inizio del suo turno, quando deve pescare, può prendere la prima carta dalla cima degli scarti e la seconda dal mazzo"
|
self.icon = "🚮"
|
||||||
# self.desc_eng = "When he has to draw, he may pick the first card from the discarded cards"
|
|
||||||
self.icon = '🚮'
|
|
||||||
|
|
||||||
class RoseDoolan(Character):
|
class RoseDoolan(Character):
|
||||||
|
"""Gioca come se avesse un Mirino sempre attivo, nel caso in cui metta in gioco una Mirino 'Reale' l'effetto si somma tranquillamente
|
||||||
|
|
||||||
|
She sees the other players at distance -1"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Rose Doolan", max_lives=4, sight_mod=1)
|
super().__init__("Rose Doolan", max_lives=4, sight_mod=1)
|
||||||
self.icon = '🕵️♀️'
|
self.icon = "🕵️♀️"
|
||||||
# self.desc = "Gioca come se avesse un Mirino sempre attivo, nel caso in cui metta in gioco una Mirino 'Reale' l'effetto si somma tranquillamente"
|
|
||||||
# self.desc_eng = "She sees the other players at distance -1"
|
|
||||||
|
|
||||||
class SidKetchum(Character):
|
class SidKetchum(Character):
|
||||||
|
"""Può scartare due carte per recuperare un punto vita anche più volte di seguito a patto di avere carte da scartare, può farlo anche nel turno dell'avversario se stesse per morire
|
||||||
|
|
||||||
|
He can discard 2 cards to regain 1HP"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sid Ketchum", max_lives=4)
|
super().__init__("Sid Ketchum", max_lives=4)
|
||||||
# self.desc = "Può scartare due carte per recuperare un punto vita anche più volte di seguito a patto di avere carte da scartare, può farlo anche nel turno dell'avversario se stesse per morire"
|
self.icon = "🤤"
|
||||||
# self.desc_eng = "He can discard 2 cards to regain 1HP"
|
|
||||||
self.icon = '🤤'
|
|
||||||
|
|
||||||
class SlabTheKiller(Character):
|
class SlabTheKiller(Character):
|
||||||
|
"""Per evitare i suoi Bang servono due Mancato, un eventuale barile vale solo come un Mancato
|
||||||
|
|
||||||
|
To dodge his Bang! cards other players need 2 Missed!"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Slab The Killer", max_lives=4)
|
super().__init__("Slab The Killer", max_lives=4)
|
||||||
# self.desc = "Per evitare i suoi Bang servono due Mancato, un eventuale barile vale solo come un Mancato"
|
self.icon = "🔪"
|
||||||
# self.desc_eng = "To dodge his Bang! cards other players need 2 Missed!"
|
# vale per tutte le carte bang non solo per la carta che si chiama Bang!
|
||||||
self.icon = '🔪'
|
|
||||||
#vale per tutte le carte bang non solo per la carta che si chiama Bang!
|
|
||||||
|
|
||||||
class SuzyLafayette(Character):
|
class SuzyLafayette(Character):
|
||||||
|
"""Appena rimane senza carte in mano pesca immediatamente una carta dal mazzo
|
||||||
|
|
||||||
|
Whenever she has an empty hand, she draws a card"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Suzy Lafayette", max_lives=4)
|
super().__init__("Suzy Lafayette", max_lives=4)
|
||||||
# self.desc = "Appena rimane senza carte in mano pesca immediatamente una carta dal mazzo"
|
self.icon = "🔂"
|
||||||
# self.desc_eng = "Whenever she has an empty hand, she draws a card"
|
|
||||||
self.icon = '🔂'
|
|
||||||
|
|
||||||
class VultureSam(Character):
|
class VultureSam(Character):
|
||||||
|
"""Quando un personaggio viene eliminato prendi tutte le carte di quel giocatore e aggiungile alla tua mano, sia le carte in mano che quelle in gioco
|
||||||
|
|
||||||
|
When a player dies, he gets all the cards in the dead's hand and equipments"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Vulture Sam", max_lives=4)
|
super().__init__("Vulture Sam", max_lives=4)
|
||||||
# self.desc = "Quando un personaggio viene eliminato prendi tutte le carte di quel giocatore e aggiungile alla tua mano, sia le carte in mano che quelle in gioco"
|
self.icon = "🦉"
|
||||||
# self.desc_eng = "When a player dies, he gets all the cards in the dead's hand and equipments"
|
|
||||||
self.icon = '🦉'
|
|
||||||
|
|
||||||
class WillyTheKid(Character):
|
class WillyTheKid(Character):
|
||||||
|
"""Questo personaggio può giocare quanti bang vuole nel suo turno
|
||||||
|
|
||||||
|
He doesn't have limits to the amounts of bang he can use"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Willy The Kid", max_lives=4)
|
super().__init__("Willy The Kid", max_lives=4)
|
||||||
# self.desc = "Questo personaggio può giocare quanti bang vuole nel suo turno"
|
self.icon = "🎉"
|
||||||
# self.desc_eng = "He doesn't have limits to the amounts of bang he can use"
|
|
||||||
self.icon = '🎉'
|
|
||||||
|
|
||||||
def all_characters(expansions: List[str]):
|
def all_characters(expansions: List[str]):
|
||||||
from bang.expansions import DodgeCity, TheValleyOfShadows
|
from bang.expansions import DodgeCity, TheValleyOfShadows, WildWestShow, GoldRush
|
||||||
|
|
||||||
base_chars = [
|
base_chars = [
|
||||||
BartCassidy(),
|
BartCassidy(),
|
||||||
BlackJack(),
|
BlackJack(),
|
||||||
@ -171,12 +241,12 @@ def all_characters(expansions: List[str]):
|
|||||||
VultureSam(),
|
VultureSam(),
|
||||||
WillyTheKid(),
|
WillyTheKid(),
|
||||||
]
|
]
|
||||||
if 'dodge_city' in expansions:
|
if "dodge_city" in expansions:
|
||||||
base_chars.extend(DodgeCity.get_characters())
|
base_chars.extend(DodgeCity.get_characters())
|
||||||
if 'gold_rush' in expansions:
|
if "gold_rush" in expansions:
|
||||||
base_chars.extend(GoldRush.get_characters())
|
base_chars.extend(GoldRush.get_characters())
|
||||||
if 'the_valley_of_shadows' in expansions:
|
if "the_valley_of_shadows" in expansions:
|
||||||
base_chars.extend(TheValleyOfShadows.get_characters())
|
base_chars.extend(TheValleyOfShadows.get_characters())
|
||||||
if 'wild_west_show' in expansions:
|
if "wild_west_show" in expansions:
|
||||||
base_chars.extend(WildWestShow.get_characters())
|
base_chars.extend(WildWestShow.get_characters())
|
||||||
return base_chars
|
return base_chars
|
@ -1,89 +1,127 @@
|
|||||||
from typing import List
|
from typing import List
|
||||||
from bang.characters import *
|
from bang.characters import Character
|
||||||
|
|
||||||
|
|
||||||
class PixiePete(Character):
|
class PixiePete(Character):
|
||||||
|
"""All'inizio del turno pesca 3 carte invece che 2
|
||||||
|
|
||||||
|
He draws 3 cards instead of 2"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Pixie Pete", max_lives=3)
|
super().__init__("Pixie Pete", max_lives=3)
|
||||||
# self.desc = "All'inizio del turno pesca 3 carte invece che 2"
|
self.icon = "☘️"
|
||||||
# self.desc_eng = "He draws 3 cards instead of 2"
|
|
||||||
self.icon = '☘️'
|
|
||||||
|
|
||||||
class TequilaJoe(Character):
|
class TequilaJoe(Character):
|
||||||
|
"""Se gioca la carta Birra recupera 2 vite invece che una sola
|
||||||
|
|
||||||
|
When he plays Beer, he regains 2 Health Points"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Tequila Joe", max_lives=4)
|
super().__init__("Tequila Joe", max_lives=4)
|
||||||
# self.desc = "Se gioca la carta Birra recupera 2 vite invece che una sola"
|
self.icon = "🍻"
|
||||||
# self.desc_eng = "When he plays Beer, he regains 2 Health Points"
|
|
||||||
self.icon = '🍻'
|
|
||||||
|
|
||||||
class GregDigger(Character):
|
class GregDigger(Character):
|
||||||
|
"""Quando un giocatore muore, recupera fino a 2 vite
|
||||||
|
|
||||||
|
Whenever a player dies, he regains up to 2 lives"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Greg Digger", max_lives=4)
|
super().__init__("Greg Digger", max_lives=4)
|
||||||
# self.desc = "Quando un giocatore muore, recupera fino a 2 vite"
|
self.icon = "🦴"
|
||||||
# self.desc_eng = "Whenever a player dies, he regains up to 2 lives"
|
|
||||||
self.icon = '🦴'
|
|
||||||
|
|
||||||
class HerbHunter(Character):
|
class HerbHunter(Character):
|
||||||
|
"""Quando un giocatore muore, pesca 2 carte
|
||||||
|
|
||||||
|
Whenever a player dies, he draws 2 cards"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Herb Hunter", max_lives=4)
|
super().__init__("Herb Hunter", max_lives=4)
|
||||||
# self.desc = "Quando un giocatore muore, pesca 2 carte"
|
self.icon = "⚰️"
|
||||||
# self.desc_eng = "Whenever a player dies, he draws 2 cards"
|
|
||||||
self.icon = '⚰️'
|
|
||||||
|
|
||||||
class ElenaFuente(Character):
|
class ElenaFuente(Character):
|
||||||
|
"""Può usare una carta qualsiasi nella sua mano come mancato
|
||||||
|
|
||||||
|
She can use any card of her hand as missed"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Elena Fuente", max_lives=3)
|
super().__init__("Elena Fuente", max_lives=3)
|
||||||
# self.desc = "Può usare una carta qualsiasi nella sua mano come mancato"
|
self.icon = "🧘♀️"
|
||||||
# self.desc_eng = "She can use any card of her hand as missed"
|
|
||||||
self.icon = '🧘♀️'
|
|
||||||
|
|
||||||
class BillNoface(Character):
|
class BillNoface(Character):
|
||||||
|
"""All'inizio del turno pesca 1 carta + 1 carta per ogni ferita che ha
|
||||||
|
|
||||||
|
Draw 1 card + 1 card for each wound he has"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Bill Noface", max_lives=4)
|
super().__init__("Bill Noface", max_lives=4)
|
||||||
# self.desc = "All'inizio del turno pesca 1 carta + 1 carta per ogni ferita che ha"
|
self.icon = "🙈"
|
||||||
# self.desc_eng = "Draw 1 card + 1 card for each wound he has"
|
|
||||||
self.icon = '🙈'
|
|
||||||
|
|
||||||
class MollyStark(Character):
|
class MollyStark(Character):
|
||||||
|
"""Quando usa volontariamente una carta che ha in mano, fuori dal suo turno, ne ottiene un'altra dal mazzo
|
||||||
|
|
||||||
|
When she uses a card from her hand outside her turn, she draws a card."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Molly Stark", max_lives=4)
|
super().__init__("Molly Stark", max_lives=4)
|
||||||
# self.desc = "Quando usa volontariamente una carta che ha in mano, fuori dal suo turno, ne ottiene un'altra dal mazzo"
|
self.icon = "🙅♀️"
|
||||||
# self.desc_eng = "When she uses a card from her hand outside her turn, she draws a card."
|
|
||||||
self.icon = '🙅♀️'
|
|
||||||
|
|
||||||
class ApacheKid(Character):
|
class ApacheKid(Character):
|
||||||
|
"""Le carte di quadri ♦️ giocate contro di lui non hanno effetto (non vale durante i duelli)
|
||||||
|
|
||||||
|
Cards of diamonds ♦️ played against him, do no have effect (doesn't work in duels).
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Apache Kid", max_lives=3)
|
super().__init__("Apache Kid", max_lives=3)
|
||||||
# self.desc = "Le carte di quadri ♦️ giocate contro di lui non hanno effetto (non vale durante i duelli)"
|
self.icon = "♦️"
|
||||||
# self.desc_eng = "Cards of diamonds ♦️ played against him, do no have effect (doesn't work in duels)."
|
|
||||||
self.icon = '♦️'
|
|
||||||
|
|
||||||
class SeanMallory(Character):
|
class SeanMallory(Character):
|
||||||
|
"""Quando finisce il suo turno può tenere fino a 10 carte in mano
|
||||||
|
|
||||||
|
He can keep up to 10 cards in his hand when ending the turn."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Sean Mallory", max_lives=3)
|
super().__init__("Sean Mallory", max_lives=3)
|
||||||
# self.desc = "Quando finisce il suo turno può tenere fino a 10 carte in mano"
|
self.icon = "🍟"
|
||||||
# self.desc_eng = "He can keep up to 10 cards in his hand when ending the turn."
|
|
||||||
self.icon = '🍟'
|
|
||||||
|
|
||||||
class BelleStar(Character):
|
class BelleStar(Character):
|
||||||
|
"""Nel suo turno le carte verdi degli altri giocatori non hanno effetto.
|
||||||
|
|
||||||
|
During her turn the green cards of the other players do not work."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Belle Star", max_lives=4)
|
super().__init__("Belle Star", max_lives=4)
|
||||||
# self.desc = "Nel suo turno le carte verdi degli altri giocatori non hanno effetto."
|
self.icon = "❎"
|
||||||
# self.desc_eng = "During her turn the green cards of the other players do not work."
|
|
||||||
self.icon = '❎'
|
|
||||||
|
|
||||||
class VeraCuster(Character):
|
class VeraCuster(Character):
|
||||||
|
"""Prima di pescare le sue carte può scegliere l'abilità speciale di un altro giocatore fino al prossimo turno.
|
||||||
|
|
||||||
|
Before drawing, she may choose the special ability on another alive player. This ability is used until next turn.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Vera Custer", max_lives=3)
|
super().__init__("Vera Custer", max_lives=3)
|
||||||
# self.desc = "Prima di pescare le sue carte può scegliere l'abilità speciale di un altro giocatore fino al prossimo turno."
|
self.icon = "🎭"
|
||||||
# self.desc_eng = "Before drawing, she may choose the special ability on another alive player. This ability is used until next turn."
|
|
||||||
self.icon = '🎭'
|
|
||||||
|
|
||||||
class ChuckWengam(Character):
|
class ChuckWengam(Character):
|
||||||
|
"""Durante il suo turno può perdere una vita per pescare 2 carte dal mazzo.
|
||||||
|
|
||||||
|
On his turn he may decide to lose 1 HP to draw 2 cards from the deck."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Chuck Wengam", max_lives=4)
|
super().__init__("Chuck Wengam", max_lives=4)
|
||||||
# self.desc = "Durante il suo turno può perdere una vita per pescare 2 carte dal mazzo."
|
self.icon = "💰"
|
||||||
# self.desc_eng = "On his turn he may decide to lose 1 HP to draw 2 cards from the deck."
|
|
||||||
self.icon = '💰'
|
|
||||||
|
|
||||||
def special(self, player, data):
|
def special(self, player, data):
|
||||||
if super().special(player, data):
|
if super().special(player, data):
|
||||||
@ -95,40 +133,54 @@ class ChuckWengam(Character):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class PatBrennan(Character):
|
class PatBrennan(Character):
|
||||||
|
"""Invece di pescare può prendere una carta dall'equipaggiamento di un altro giocatore.
|
||||||
|
|
||||||
|
Instead of drawing he can steal a card from the equipment of another player."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Pat Brennan", max_lives=4)
|
super().__init__("Pat Brennan", max_lives=4)
|
||||||
# self.desc = "Invece di pescare può prendere una carta dall'equipaggiamento di un altro giocatore."
|
self.icon = "🤗"
|
||||||
# self.desc_eng = "Instead of drawing he can steal a card from the equipment of another player."
|
|
||||||
self.icon = '🤗'
|
|
||||||
|
|
||||||
class JoseDelgado(Character):
|
class JoseDelgado(Character):
|
||||||
|
"""Può scartare una carta blu per pescare 2 carte.
|
||||||
|
|
||||||
|
He can discard a blue card to draw 2 cards."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("José Delgado", max_lives=4)
|
super().__init__("José Delgado", max_lives=4)
|
||||||
# self.desc = "Può scartare una carta blu per pescare 2 carte."
|
self.icon = "🎒"
|
||||||
# self.desc_eng = "He can discard a blue card to draw 2 cards."
|
|
||||||
self.icon = '🎒'
|
|
||||||
|
|
||||||
class DocHolyday(Character):
|
class DocHolyday(Character):
|
||||||
|
"""Nel suo turno può scartare 2 carte per fare un bang.
|
||||||
|
|
||||||
|
He can discard 2 cards to play a bang."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Doc Holyday", max_lives=4)
|
super().__init__("Doc Holyday", max_lives=4)
|
||||||
# self.desc = "Nel suo turno può scartare 2 carte per fare un bang."
|
self.icon = "✌🏻"
|
||||||
# self.desc_eng = "He can discard 2 cards to play a bang."
|
|
||||||
self.icon = '✌🏻'
|
|
||||||
|
|
||||||
def special(self, player, data):
|
def special(self, player, data):
|
||||||
if super().special(player, data):
|
if super().special(player, data):
|
||||||
from bang.players import PendingAction
|
from bang.players import PendingAction
|
||||||
if player.special_use_count < 1 and player.pending_action == PendingAction.PLAY:
|
|
||||||
|
if (
|
||||||
|
player.special_use_count < 1
|
||||||
|
and player.pending_action == PendingAction.PLAY
|
||||||
|
):
|
||||||
player.special_use_count += 1
|
player.special_use_count += 1
|
||||||
cards = sorted(data['cards'], reverse=True)
|
cards = sorted(data["cards"], reverse=True)
|
||||||
for c in cards:
|
for c in cards:
|
||||||
player.game.deck.scrap(player.hand.pop(c), True)
|
player.game.deck.scrap(player.hand.pop(c), True)
|
||||||
player.notify_self()
|
player.notify_self()
|
||||||
player.game.attack(player, data['against'])
|
player.game.attack(player, data["against"])
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=function-redefined
|
# pylint: disable=function-redefined
|
||||||
def all_characters() -> List[Character]:
|
def all_characters() -> List[Character]:
|
||||||
cards = [
|
cards = [
|
||||||
@ -148,21 +200,22 @@ def all_characters() -> List[Character]:
|
|||||||
JoseDelgado(),
|
JoseDelgado(),
|
||||||
DocHolyday(),
|
DocHolyday(),
|
||||||
]
|
]
|
||||||
for c in cards:
|
for card in cards:
|
||||||
c.expansion_icon = '🐄️'
|
card.expansion_icon = "🐄️" # pylint: disable=attribute-defined-outside-init
|
||||||
c.expansion = 'dodge_city'
|
card.expansion = "dodge_city" # pylint: disable=attribute-defined-outside-init
|
||||||
return cards
|
return cards
|
||||||
|
|
||||||
#Apache Kid: il suo effetto non conta nei duelli
|
|
||||||
#belle star: vale solo per le carte blu e verdi
|
# Apache Kid: il suo effetto non conta nei duelli
|
||||||
#chuck wengam: può usarlo più volte in un turno, ma non può suicidarsi
|
# belle star: vale solo per le carte blu e verdi
|
||||||
#doc holiday: il suo effetto non conta nel limite di un bang per turno,
|
# chuck wengam: può usarlo più volte in un turno, ma non può suicidarsi
|
||||||
|
# doc holiday: il suo effetto non conta nel limite di un bang per turno,
|
||||||
# se deve sparare a Apache Kid una delle due carte scartate non deve essere di quadri
|
# se deve sparare a Apache Kid una delle due carte scartate non deve essere di quadri
|
||||||
#molly stark: le carte scartate che valgono sono solo quelle scartate volontariamente,
|
# molly stark: le carte scartate che valgono sono solo quelle scartate volontariamente,
|
||||||
# carte scartate per colpa di can can, cat balou, rissa, panico non valgono,
|
# carte scartate per colpa di can can, cat balou, rissa, panico non valgono,
|
||||||
# invece carte scartata per indiani, birra(in caso di morte), o un mancato valgono,
|
# invece carte scartata per indiani, birra(in caso di morte), o un mancato valgono,
|
||||||
# in un duello pesca solo quando il duello è finito (una carta x ogni bang scartato)
|
# in un duello pesca solo quando il duello è finito (una carta x ogni bang scartato)
|
||||||
#pat brennan: quando pesca con il suo effetto, pesca solo la carta del giocatore non anche dal mazzo
|
# pat brennan: quando pesca con il suo effetto, pesca solo la carta del giocatore non anche dal mazzo
|
||||||
#vera custer: la scelta può essere fatta solo appena prima di pescare,
|
# vera custer: la scelta può essere fatta solo appena prima di pescare,
|
||||||
# quando inizia la partita serve farle scegliere, poi può rimanere quello finchè non decide di cambiarlo
|
# quando inizia la partita serve farle scegliere, poi può rimanere quello finchè non decide di cambiarlo
|
||||||
# eventualmente fare una schermata dove vede tutti i personaggi
|
# eventualmente fare una schermata dove vede tutti i personaggi
|
Loading…
Reference in New Issue
Block a user