added card types

This commit is contained in:
2023-12-06 12:21:51 +01:00
parent 0b5aef794a
commit 4fbd1c6663
19 changed files with 120 additions and 26 deletions

View File

@ -0,0 +1,22 @@
import pygame
class Card:
__name:str
__artwork:pygame.image
def __init__(self, name:str, imagePath:str):
if name == "":
return ValueError.add_note("Card: name cannot be empty")
if imagePath == "":
return ValueError.add_note("Card: imagePath cannot be empty")
self.__name = name
self.__image = pygame.image.load(imagePath)
def getName(self) -> str:
return self.__name
def getArtwork(self) -> pygame.image:
return self.__image

View File

@ -0,0 +1,14 @@
import json
from Game_Client.Classes.System.Objects.Cards.Card import Card
class MonsterCard(Card):
__attacks:[]
def __init__(self, asset:str):
data = json.load(open(asset))
for attack in range(data["attacks"]):
self.__attacks.add(attack)
def attacks(self):
return self.__attacks

View File

@ -0,0 +1,17 @@
import json
from Game_Client.Classes.System.Objects.Cards.Card import Card
class SpellCard(Card):
__description:str
def __init__(self, asset:str):
data = json.load(open(asset))
super.__init__(data["name"], data["image"])
self.__description = data["description"]
def getDescription(self):
return self.__description

View File

@ -0,0 +1,17 @@
from Game_Client.Classes.System.Objects.Cards.Card import Card
import json
class SpellCard(Card):
__description:str
def __init__(self, asset:str):
data = json.load(open(asset))
super.__init__(data["name"], data["image"])
self.__description = data["description"]
def getDescription(self):
return self.__description