@ags16edev/

# Pocket monster battle

## No description

Files
• main.py
main.py
```1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
```
```var1 = 40
atk1 = 10
atk2 = 5
atk3 = 20
atk4 = 5
potion = 20
aerialacePP = 10
CloseCombatPP = 5
FlyPP = 15
PeckPP = 10
Userpotions = 4
playerhp = 130  #The different variables
NPChp = 130
NPCatk1 = 10
NPCatk2 = 5
NPCatk3 = 20
NPCatk4 = 10
NPCatk1PP = 20
NPCatk2PP = 5
NPCatk3PP = 15
NPCatk4PP = 35
EnemyPotions = 4

import random as ran
pslice1 = ["1", "2", "3", "4", "5"]

print("It was a quiet day on Route 21. As you walk along the road you encounter a trainer!")
print("Hey! I like shorts! They are comfy and easy to wear!")
print("Bug catcher Timmy sends out Golisopod! Go staraptor! Timmy: 'Alright! Let's enjoy this battle!") #Prints a text

def aerialace (): #This defines the function for one of the attacks
global NPChp, aerialacePP
if aerialacePP >= 0:
aerialacePP = aerialacePP-1
NPChp = NPChp - 10
print("The enemy has", NPChp)
def CloseCombat ():
global NPChp, CloseCombatPP
if CloseCombatPP >= 0:
CloseCombatPP = CloseCombatPP-1
NPChp = NPChp - 5
print(NPChp)
def Fly ():
global NPChp, FlyPP
if FlyPP >= 0:
FlyPP = FlyPP-1
NPChp = NPChp - 20
print(NPChp)
def Peck ():
global NPChp, PeckPP
if PeckPP >= 0:
PeckPP = PeckPP-1
NPChp = NPChp - 10
print("NPChp")

def potion (): #This defines the health point increase for one oif the attack options
global playerhp, UserPotions
if Userpotions >= 0:
Userpotions = Userpotions
playerhp = 130
print("Staraptor is at", playerhp)

while NPChp >= 0 or playerhp >=0:
choice = input("Do you want to use 1) Aerial Ace 2) Close Combat 3) Fly 4) Peck  5) Potion? ")#This enables the options to attack
if choice=="1" and aerialacePP >= 0:
aerialace()#This is the word that was defined before and is placed into this code.
print("Aerial Ace was super effective! You dealt",atk1, "The enemy has" , NPChp)#This is the move input

elif choice == "2" and CloseCombatPP >= 0:
CloseCombat()
print("Close Combat was effective! You dealt", atk2, "The enemy has" , NPChp )#This is the move input

elif choice == "3" and FlyPP >= 0:
Fly()
print("Fly was super effective! You dealt", atk3, "The enemy has" , NPChp)#This is the move input
elif choice == "4" and PeckPP >= 0:
Peck()
print("Peck was super effective! You dealt", atk4,"The enemy has" , NPChp) #This is the move input
elif choice == "5" and Userpotions >= 0:
playerhp = playerhp + 20

EnemyAI = ran.choice(pslice1)

if EnemyAI == "1":
playerhp = playerhp - 10
print("The enemy has dealt 10 damage. You have ", playerhp) #All of the enemy attacks come from these three lines of code
if EnemyAI == "2":
playerhp = playerhp - 5
print("The enemy has dealt 5 damage. You have ", playerhp)
if EnemyAI == "3":
playerhp = playerhp - 20
print("The enemy has dealt 20 damage. You have ", playerhp)
if EnemyAI == "4":
playerhp = playerhp - 10
print("The enemy has dealt 10 damage. You have ", playerhp)
if EnemyAI == "5":
NPChp = NPChp + 40
print("The enemy has used a potion! The enemy now has ", NPChp)

if aerialacePP <=0:
print("You cannot use this move!")

if CloseCombatPP <=0:
print("You cannot use this move!")

if FlyPP <=0:
print("You cannot use this move!")

if PeckPP <=0:
print("You cannot use this move!")

if Userpotions <=0:
print("You cannot use this move!")

if NPChp<=0:
print("You won! Timmy has given you \$10000")
break

if playerhp<=0:
print("You lost! You gave away \$10000")
break
```
Fetching token