def NotVeryEffectiveFrom(Type, Pokemon): array = PokemonType(Type, Pokemon).half_damage_from array1 = PokemonType(Type, Pokemon).quarter_damage_from string = "" string1 = "" for a in array1: if len(array1) > 1 and a == array1[-1]: string1 += "and " + a else: string1 += a + " " for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a else: string += a + " " if len(array1) > 1 and len(array) > 1: return question(string + "are not very effective against " + Type + " and" + string1 + "are quarter effective " "against " + Type) elif len(array1) > 1: return question(string + "is not very effective against " + Type + " and" + string1 + "are quarter effective " "against " + Type) elif len(array) > 1: return question(string + "are not very effective against " + Type + " and" + string1 + "is quarter effective " "against " + Type) else: return question(string + "is not very effective against " + Type + " and" + string1 + "is quarter effective " "against " + Type)
def NoEffectOn(Type, Pokemon): array = PokemonType(Type, Pokemon).no_damage_to string = "" for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a else: string += a + " " if len(array) > 1: return question(string + "have no effect on " + Type) else: return question(string + "has no effect on " + Type)
def pokemon_description(Pokemon, Generation): global g_skill, g_poke if not Generation: g_skill, g_poke = "description", Pokemon.split("'s")[0] return question("what game are you playing") name = Pokemon.split("'s")[0] poke = requests.get("https://pokeapi.co/api/v2/pokemon-species/" + name) x = "Please repeat the generation" for a in poke.json()["flavor_text_entries"]: if a["language"]["name"] == "en" and a["version"]["name"] == Generation: x = a["flavor_text"].replace("\\n", " ") return question(x)
def how_move(Pokemon, Move): global g_poke, g_move, g_skill g_skill = "how_learn()" g_poke = Pokemon g_move = name_split(Move) return question("Which game are you playing?")
def pokemon_ID(Pokemon): name = Pokemon.split("'s")[0] poke = requests.get("https://pokeapi.co/api/v2/pokemon/" + name) i = poke.json()["id"] return question(Pokemon + " 's ID is {}".format(i))
def NoEffectFrom(Type, Pokemon): array = PokemonType(Type, Pokemon).no_damage_from string = "" for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a else: string += a + " " return question(Type + "has no effect on " + string)
def SuperEffectiveFrom(Type, Pokemon): a = PokemonType(Type, Pokemon) array = a.double_damage_from array1 = a.quad_damage_from string = "" string1 = "" for a in array1: if len(array1) > 1 and a == array1[-1]: string1 += "and " + a else: string1 += a + " " for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a + " " else: string += a + ", " # is lengthy for spoken language purposes from Alexa, she can't be speaking in array if len(array1) > 1 and len(array) > 1: return question(string + "are super effective against " + Type if not Pokemon else Pokemon + " and" + string1 + "are quadruple effective " "against " + Type if not Pokemon else Pokemon) elif len(array1) > 1: return question(string + "is super effective against " + Type if not Pokemon else Pokemon + " and" + string1 + "are quadruple effective " "against " + Type if not Pokemon else Pokemon) elif len(array) > 1: return question(string + "are super effective against " + Type if not Pokemon else Pokemon + " and" + string1 + "is quadruple effective " "against " + Type if not Pokemon else Pokemon) else: return question(string + "is super effective against " + Type if not Pokemon else Pokemon + " and" + string1 + "is quadruple effective " "against " + Type if not Pokemon else Pokemon)
def game_version(Generation): global g_poke, g_move, g_skill if Generation == "sword" or Generation == "shield": Generation = "ultra sun" if g_skill == "description": poke = requests.get("https://pokeapi.co/api/v2/pokemon-species/" + g_poke) msg = "Please repeat the generation" for a in poke.json()["flavor_text_entries"]: if a["language"]["name"] == "en" and a["version"][ "name"] == Generation: msg = a["flavor_text"].replace("\\n", " ") return question(msg) else: Gen = name_split(Generation) print(Gen) a = Poke_move(g_poke, g_move, Gen) return question(a.how_learn())
def NotVeryEffectiveTo(Type, Pokemon): array = PokemonType(Type, Pokemon).half_damage_to array1 = PokemonType(Type, Pokemon).quarter_damage_to string = "" string1 = "" for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a else: string += a + " " for a in array1: if len(array1) > 1 and a == array1[-1]: string1 += "and " + a else: string1 += a + " " return question(Type + "is not very effective against " + string + "and quarter effective against " + string1)
def SuperEffectiveTo(Type, Pokemon): array = PokemonType(Type, Pokemon).double_damage_to array1 = PokemonType(Type, Pokemon).quad_damage_to string = "" string1 = "" for a in array: if len(array) > 1 and a == array[-1]: string += "and " + a else: string += a + " " for a in array1: if len(array1) > 1 and a == array1[-1]: string1 += "and " + a else: string1 += a + " " return question(Type + " is super effective against " + string + "and quadruple effective against " + string1)
def help_intent(): help_text = "You can ask me how a pokemon learns a move, its type effectiveness, or it's evolution process." return question(help_text)
def boolean_move(Pokemon, Move): move = name_split(Move) a = Poke_move(Pokemon, move, None) return question(a.moves_learned())
def poke_type(Pokemon): poke = get_type(Pokemon) headline_msg = Pokemon + "'s type is {}".format(poke) return question(headline_msg)
def test(Pokemona): if not Pokemona: return question("yup this works") return question("Here is " + Pokemona)
def start_skill(): welcome_message = "Hello, welcome to Michael's pokedex skill" return question(welcome_message)