this is a practice of classes, their properties, functions and loops. and a brilliant story development.
from random import randint
return '%s is a %s with a health of %d and carries %d restaurators.'%(self.name,self.type,self.health,self.restaurators)
text="""type your command.
[inspect character_name] gives you the information about the character. type [inspect myself] to obtain information about your status
[fight character_name] fights a character, but be aware the character fights back! you retrieve items from the deceased
[heal character_name] restores health unless you are out of restaurators. to heal yourself type [heal myself]
[lookaround] tells you who is around
[quit] exits the program
fights and healings affect the health randomly. if you die, the program quits.
print('you look around and see')
for names in characters:
print('your healing has left you with %d restaurators'%characters['myself'].restaurators)
print('as you have no restaurators left you can not heal anyone')
print('%s has ceased to exist'%(opponent.name))
print('you\'ve ceased to exist.')
if action in handleCharacters.keys():
print('command not found')
except Exception as e:
print('command not found',e)
playername, playertype= 'ironfist','good guy' # input('enter your name: '), input('enter your type of character: ')
print('hello %s, so you start as a %s, with a health value of %d. if you don\'t know what to to type [help].'%(characters['myself'].name,characters['myself'].type,characters['myself'].health))
print('\nyou see %s. %s'%(characters['scarface'].name,characters['scarface'].inspect()))