Question
Dear student, you woke up in a mystical and magical world. You feel a strange power flowing through the veins. You are a Planeswalker! You
Dear student, you woke up in a mystical and magical world. You feel a strange power flowing through the veins. You are a Planeswalker! You are now able to control mana and creatures, and since you are a good Python programmer, you decide to write a Python class that helps you in managing duels in the Magic the Gathering world. In this first exercise, you need to create 4 classes in order to manage the different types of cards.
The first class, namely the base class for cards, has to be named Card, and it must contain the following attributes: - Name of the card --> name, a string - Tap Status --> isTapped, boolean - Type of the card --> card_type, a string
The second class, namely the card that gives mana to a PlanesWalker, is called ManaCard, and inherits attributes and methods from the Card. In addition to the latter, it has the following attributes: - Card type --> card_type = 'mana', a string - How much mana the card gives to the planeswalker --> mana_qty, a integer number
The third class, namely the class that contains creatures data, must be called Creature, and also this class inherits attributes and methods from the Card. In addition to the latter, it has the following attributes: - Card type --> card_type = 'creature', a string - Mana cost to be casted --> mana_cost, an integer number - Attack Value --> attack, an integer number - Defense Value --> defense, an integer number
The last class is the Planeswalker class. It has to be named PlanesWalker, and it contains the following attributes: - Name of the PlanesWalker --> name, a string - Mana cards list --> mana, a list of mana cards - Creatures card list --> creatures, a list of creatures card - Quantity of mana available --> mana_qty, an integer number. This attribute is NOT PASSED AS ARGUMENT, and ITS DEFAULT VALUE IS 0.
Be sure to create a correct __init__ function for each of the classes and to correctly inherits data from the base class (if necessary).
'''
import mtg
if __name__ == "__main__": pass
"by using python"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started