module 7 ex 3

This commit is contained in:
2026-03-03 16:00:55 +01:00
parent e9daee357a
commit 516ef290a7
8 changed files with 141 additions and 14 deletions

View File

@@ -4,10 +4,11 @@ from typing import Union
class SpellCard(Card):
def __init__(
self, name: str, cost: int, rarity: str, effect_type: str
self, name: str, cost: int, rarity: str, effect_type: str, mana: int
) -> None:
super().__init__(name, cost, rarity)
self.effect_type = effect_type
self.mana = mana
def play(self, game_state: dict) -> dict:
try:

View File

@@ -8,7 +8,7 @@ def main():
deck = Deck()
print("Building deck with different card types...")
deck.add_card(
SpellCard("Lightning Bolt", 5, "Common", "Deal 3 dammage to target")
SpellCard("Lightning Bolt", 5, "Common", "Deal 3 dammage to target", 5)
)
deck.add_card(
ArtifactCard(