Archived
69 lines
1.2 KiB
Python
69 lines
1.2 KiB
Python
from enum import Enum
|
|
from model import Serializable
|
|
|
|
|
|
class CardRole(str, Enum):
|
|
PERSONAL = "personal"
|
|
MARKET = "market"
|
|
FIRE_GEM = "fire_gem"
|
|
|
|
|
|
class CardType(str, Enum):
|
|
"""Playable card types"""
|
|
|
|
HERO = "hero"
|
|
HERO_ABILITY = "hero_ability"
|
|
CURRENCY = "currency"
|
|
WEAPON = "weapon"
|
|
CHAMPION = "champion"
|
|
ACTION = "action"
|
|
ITEM = "item"
|
|
|
|
|
|
class CardFaction(str, Enum):
|
|
"""Playable card factions"""
|
|
|
|
BASE = "base"
|
|
|
|
BLUE = "blue"
|
|
RED = "red"
|
|
GREEN = "green"
|
|
YELLOW = "yellow"
|
|
|
|
|
|
class Card(Serializable):
|
|
"""Represents any playable card"""
|
|
|
|
object_type = "card"
|
|
sprite: str
|
|
name: str
|
|
text: str
|
|
cost: int
|
|
role: CardRole
|
|
card_type: CardType
|
|
faction: CardFaction
|
|
|
|
def __init__(
|
|
self,
|
|
sprite: str,
|
|
name: str,
|
|
text: str,
|
|
cost: int,
|
|
card_type: CardType,
|
|
faction: CardFaction,
|
|
):
|
|
super().__init__()
|
|
self.sprite = sprite
|
|
self.name = name
|
|
self.text = text
|
|
self.cost = cost
|
|
self.card_type = card_type
|
|
self.faction = faction
|
|
|
|
|
|
class CardChampion(Card):
|
|
"""Represents any champion card"""
|
|
|
|
defense: int
|
|
guard: bool
|