Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time, os
- import battle_function
- from os import system, name
- from random import randint
- def clear():#to clear page
- if name == 'nt':#window
- _ = system('cls')
- else:#mac linux
- _ = system('clear')
- def checkType(a):#change type if it int
- if a.isdigit():
- return int(a)
- def loading_page():#loading page to get game like feeling
- x= " . "
- for i in range(4):
- clear()
- print("Loading", end="")
- print(x)
- x += " . "
- time.sleep(1)
- clear()
- return
- def starter_poke():
- list = ["Chamander", "Squirtle", "Treecko"]
- global first_poke
- #info = [["004","Fire","Lizard Pokemon", "2′00″","18.7 pounds","Blaze, Solar Power (Hidden Ability)"],["007","Water","Tiny Turtle Pokemon","1′08″","19.8 pounds","Torrent, Rain Dish (Hidden Ability)"],["252","Grass","Wood Gecko Pokemon","1'08″,","11 pounds","vergrow, Unburden (Hidden Ability)"]]
- clear()
- print("Choose your starter Pokemon")
- x=1
- for i in range(3):
- print(x, ". ", list[i])
- x +=1
- #print("National Number:", info[i][0])
- #print("Type:", info[i][1])
- #print("Species:", info[i][2])
- #print("Height:", info[i][3])
- #print("Weight:", info[i][4])
- #print("Abilities:", info[i][5])
- #x += 1
- while True:
- choice = input("Your Choice :")
- choice = checkType(choice)
- global first_poke
- if choice == 1:
- first_poke = list[0]
- return "fire"
- elif choice == 2:
- first_poke = list[1]
- return "water"
- elif choice == 3:
- first_poke = list[2]
- return "grass"
- else:
- print("Invalid input. Please try again")
- return
- def battle(npcname):
- clear()
- pokemon_name = ["Charizard", "Blastoise", "Pikachu", "Snorlax", "Flygon", "Squirtle", "Ampharos"]
- random_no = randint(0,6)
- npc_health = 100
- print(npcname+" sent out a "+pokemon_name[random_no])
- print("What will "+first_poke+" do?")
- # print("Attack\n1.Tackle\n2.Growl\n3.Fire Fang\n4.Ember")
- # attack_choice = input("Your choice: ")
- # attack_choice = checkType(choice)
- if first_poke == "Chamander":
- while not npc_health <= 0:
- # clear()
- print("Attack\n1.Tackle\n2.Growl\n3.Fire Fang\n4.Ember")
- attack_choice = input("Your choice: ")
- attack_choice = checkType(attack_choice)
- if attack_choice == 1:
- clear()
- damage = 10
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 2:
- clear()
- damage = 5
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 3:
- clear()
- damage = 30
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 4:
- clear()
- damage = 20
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- else:
- clear()
- print("You have win the battle!")
- if first_poke == "Squirtle":
- while not npc_health <= 0:
- # clear()
- print("Attack\n1.Tackle\n2.Tail Whip\n3.Water Gun\n4.Water Pulse")
- attack_choice = input("Your choice: ")
- attack_choice = checkType(attack_choice)
- if attack_choice == 1:
- clear()
- damage = 10
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 2:
- clear()
- damage = 15
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 3:
- clear()
- damage = 25
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 4:
- clear()
- damage = 35
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))#
- else:
- clear()
- print("You have win the battle!")
- if first_poke == "Treecko":
- while not npc_health <= 0:
- # clear()
- print("Attack\n1.Leer\n2.Pound\n3.Leafage\n4.Mega Drain")
- attack_choice = input("Your choice: ")
- attack_choice = checkType(attack_choice)
- if attack_choice == 1:
- clear()
- damage = 8
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 2:
- clear()
- damage = 10
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 3:
- clear()
- damage = 30
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- if attack_choice == 4:
- clear()
- damage = 40
- print (first_poke+" has hit the opponent for " +str(damage)+" damage!")
- npc_health = npc_health - damage
- print("Opponent health : "+str(npc_health))
- else:
- clear()
- print("You have win the battle!")
- pass
- def intro():
- global name
- print("Welcome to Pokemon text-based Adventure")
- name = input("Please enter your trainer name : ")
- print("Saving Data. . . \n")
- time.sleep(2)
- loading_page()
- print("Hey there! I'm the Prof. Oak. Welcome to Pokemon Reborn!\n")
- print("Pokemon are living creatures that inhabit our pokemon world, living alongside, \nand usually helping, us humans.\n")
- print("You must be "+name+", Right? Looks like you're new here.")
- print("So.. you want to become a Pokemon Trainer? Well, lets see what you're capable of.")
- print("Now listen closely, there is this new trainer named Ash.")
- print("Now I need you to take out his pokemon, capiche?")
- next=input("Continue:")
- pokeE = starter_poke()
- clear()
- print("Woah... The",pokeE, "pokemon. A good choice.")
- print("Your pokemon is a 'normal' type pokemon, there are nine type of pokemon in the game, as shown below:")
- type = ["Normal","Shiny","Haunted","Frost","Shadow","Glitter","Golden","Demon","Eternal"]
- for idx, val in enumerate(type, start = 1):
- print(" " + str(idx) + ". " + val)
- print("To catch pokemon, you have to walk around the various maps until a wild \npokemon shows up. You will then have to throw a pokeball to capture it!")
- print("Ash is in the next room, whenever you're ready.")
- next = input("Battle Ash- I'm Ready:")
- battle("Ash")
- n = 2
- while n == 2:
- print("Who do you want to battle now?")
- opponent = str(input("Enter name: "))
- battle(opponent)
- return
- while True:
- clear()
- intro()
- break
Advertisement
Add Comment
Please, Sign In to add comment