Question: Creating a python 3 program that creates a monster import abc class monster(metaclass=abc.ABCMeta): def __init__(self): return def __str__(self): return Generic Monster Class #Methods that need
Creating a python 3 program that "creates a monster"
import abc
class monster(metaclass=abc.ABCMeta):
def __init__(self):
return
def __str__(self):
return "Generic Monster Class"
#Methods that need to be implemented
#The description is printed at the start to give additional details
#Name the monster
#The description is printed at the start to give
#additional details
@abc.abstractmethod
def getName(self):
pass
@abc.abstractmethod
def getDescription(self):
pass
#Basic Attack Move
#This will be the most common attack the monster makes
#You are passed the monster you are fighting
@abc.abstractmethod
def basicAttack(self,enemy):
pass
#Print the name of the attack used
@abc.abstractmethod
def basicName(self):
pass
#Defense Move
#This move is used less frequently to
#let the monster defend itself
@abc.abstractmethod
def defenseAttack(self,enemy):
pass
#Print out the name of the attack used
@abc.abstractmethod
def defenseName(self):
pass
#Special Attack
#This move is used less frequently
#but is the most powerful move the monster has
@abc.abstractmethod
def specialAttack(self,enemy):
pass
@abc.abstractmethod
def specialName(self):
pass
#Health Management
#A monster at health <= 0 is unconscious
#This returns the current health level
@abc.abstractmethod
def getHealth(self):
pass
#This function is used by the other monster to
#either do damage (positive int) or heal (negative int)
@abc.abstractmethod
def doDamage(self,damage):
pass
#Reset Health for next match
@abc.abstractmethod
def resetHealth(self):
pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
