from pokemon import Pokemon from pokeball import Pokeball import time import random def adventure(route): print("Adventure start!") pokeballs = [] party = [] party = rec_starter(party) time.sleep(2) print("You receive 5 Pokeballs!") for i in range(5): pokeballs.append(Pokeball(40)) wild = encounter(route) print(f"You encounter a wild {wild}!") answer = input(f"Do you wish to try and catch the wild {wild}?") if answer == "y": catch(wild, party, pokeballs) else: print(f"The wild {wild} ran away...") def rec_starter(party): mudkip = Pokemon("Mudkip", 20, "Water") torchic = Pokemon("Torchic", 20, "Fire") treecko = Pokemon("Treecko", 20, "Grass") starter = [mudkip.get_species(), torchic.get_species(), treecko.get_species()] print(f"Choose your starter: {starter}") choice = input() choice = choice.capitalize() if choice == mudkip.get_species(): print("You have chosen the water type, Mudkip!") new = mudkip elif choice == torchic.get_species(): print("You have chosen the fire type, Torchic!") new = torchic elif choice == treecko.get_species(): print("You have chosen the Grass type, Treecko!") new = treecko else: print("That's not a choice.") ball = Pokeball(100) ball.catch(new) party = add_new_member(party, ball) time.sleep(2) print(f"Take good care of {choice}!") time.sleep(2) def catch(wild, party, pokeballs): pass def add_new_member(party, ball): pass def nickname(pokemon): pass def release(party, pokemon): if len(party) <= 1: print("You need to keep at least 1 Pokemon!") else: print("Releasing", pokemon) pokemon.pop(pokemon) ''' Utility ''' def rnd(len): return random.randrange(len) def encounter(route): return route[rnd(len(route))] def read_file(): pokefile = open("pokelist.txt", "r") route1 = [] for line in pokefile: l = line.split(";") new_pokemon = Pokemon(l[0], int(l[3]), l[1], l[2]) route1.append(new_pokemon) return route1 if __name__ == '__main__': route1 = read_file() adventure(route1)