def create_hero(self): '''Prompt user for Hero information return Hero with values from user input. ''' hero_name = input("Hero's name: ") hero = Hero(hero_name) add_item = None while add_item != "4": add_item = input("[1] Add ability\n[2] Add weapon\n[3] Add armor\n[4] Done adding items\n\nYour choice: ") if add_item == "1": ability = self.create_ability() hero.create_ability() elif add_item == "2": weapon = self.create_weapon() hero.create_weapon() elif add_item == "3": armor = self.create_armor() hero.create_armor() return hero
def create_hero(self): hero_name = input("Hero's name: ") hero = Hero(hero_name) add_item = None while add_item != "4": add_item = input( "[1] Add ability\n[2] Add weapon\n[3] Add armor\n[4] Done adding items\n\nYour choice: " ) if add_item == "1": # HINT: First create the ability, then add it to the hero ability = self.create_ability() hero.create_ability() elif add_item == "2": # HINT: First create the weapon, then add it to the hero weapon = self.create_weapon() hero.create_weapon() elif add_item == "3": # HINT: First create the armor, then add it to the hero armor = self.create_armor() hero.create_armor() return hero