mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-14 05:06:55 +01:00
module 7 ex 3
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user