def create_hero(self): """Prompt user for Hero information. It will 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.add_ability(ability) elif add_item == "2": weapon = self.create_weapon() hero.add_weapon(weapon) elif add_item == "3": armor = self.create_armor() hero.add_armor(armor) return hero
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": #TODO add an ability to the hero #HINT: First create the ability, then add it to the hero ability = self.create_ability() hero.add_ability(ability) elif add_item == "2": #TODO add a weapon to the hero #HINT: First create the weapon, then add it to the hero weapon = self.create_weapon() hero.add_weapon(weapon) elif add_item == "3": #TODO add an armor to the hero #HINT: First create the armor, then add it to the hero armor = self.create_armor() hero.add_armor(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": #TODO add an ability to the hero #HINT: First create the ability, then add it to the hero ability = self.create_ability() hero.add_ability(ability) elif add_item == "2": #TODO add a weapon to the hero #HINT: First create the weapon, then add it to the hero weapon = self.create_weapon() hero.add_weapon(weapon) elif add_item == "3": #TODO add an armor to the hero #HINT: First create the armor, then add it to the hero armor = self.create_armor() hero.add_armor = armor return hero
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": self.create_ability() hero.add_ability(self.create_ability()) elif add_item == "2": self.create_weapon() hero.add_weapon(self.create_weapon) elif add_item == "3": self.create_armor() hero.add_armor(self.create_armor) elif add_item == "4": break return hero
def create_hero(self): """Return Hero with value 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": hero.add_ability(self.create_ability()) elif add_item == "2": hero.add_weapon(self.create_weapon()) elif add_item == "3": hero.add_armor(self.create_armor()) return hero
def create_hero(self): hero_name = input("Hero name: ") hero_health = int(input("Hero starting health: ")) new_hero = Hero(hero_name, hero_health) num_abilities = int(input("Number of desired abilities to add:")) for i in range(0, num_abilities): new_hero.add_ability(self.create_ability()) num_weapons = int(input("Number of desired weapons to add:")) for i in range(0, num_weapons): new_hero.add_weapon(self.create_weapon()) num_armor = int(input("Number of desired armors to add:")) for i in range(0, num_armor): new_hero.add_armor(self.create_armor()) print(i) return new_hero
def create_hero(self): hero_name = input("What is the character'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_input = self.create_ability() hero.add_ability(ability_input) elif add_item == "2": weapon_input = self.create_weapon() hero.add_weapon(weapon_input) elif add_item == "3": armor_input = self.create_armor() hero.add_armor(armor_input) 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": ability = self.create_ability() hero.add_ability(ability) elif add_item == "2": weapon = self.create_weapon() hero.add_weapon(weapon) elif add_item == "3": armor self.create_armor() hero.add_armor(armor) return hero
def create_hero(self): hero_name = input("Hero's name:\n") hero_health = int(input(f"How much health does {hero_name} have?\n")) hero = Hero(hero_name, hero_health) 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:\n" ) if add_item == "1": ability = self.create_ability() hero.add_ability(ability) elif add_item == "2": weapon = self.create_weapon() hero.add_weapon(weapon) elif add_item == "3": armor = self.create_armor() hero.add_armor(armor) return hero
def create_hero(self): """Prompt for Hero information.""" hero_name = input("Hero name?: ") hero = Hero(hero_name) equip_menu = None while equip_menu != "4": equip_menu = input("\n[1] Add ability\n" "[2] Add weapon\n" "[3] Add armor\n" "[4] Done adding equips\n\n" "Your choice: ") print() if equip_menu == "1": hero.add_ability(self.create_ability()) elif equip_menu == "2": hero.add_weapon(self.create_weapon()) elif equip_menu == "3": hero.add_armor(self.create_armor()) return hero
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": new_ability = self.create_ability() hero.add_ability(new_ability) elif add_item == "2": new_weapon = self.create_weapon() hero.add_weapon(new_weapon) elif add_item == "3": new_armor = self.create_armor() hero.add_armor(new_armor) elif add_item == '4': print('Finished creating ' + hero.name) return hero
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": print("[1] Add ability\n[2] Add weapon\n[3] Add armor") add_item = input("[4] Done adding items\n\nYour choice: ") if add_item == "1": # add an ability to the hero added_ability = self.create_ability() hero.add_ability(added_ability) # print(f"_ ability added") elif add_item == "2": # add a weapon to the hero added_weapon = self.create_weapon() hero.add_weapon(added_weapon) elif add_item == "3": # add an armor to the hero added_armor = self.create_armor() hero.add_armor(added_armor) return hero