choice = 1
potion = 0
counter = 0
selectory3 = 188
y = 194
choice_box = Image.load("./choicebox.png")
while potion == 0 do
counter = counter + 1
pad = Controls.read()
screen:blit(376, 173,choice_box)
screen:blit(388, selectory3, selector)
for pokemonchoice = 1, 6 do
	if pokemon[pokemonchoice].C_HP > 0 then
		screen:print(404, y, pokemon[pokemonchoice].name, blue)
		
	end

end
if pad:down() and oldpad:down() ~=pad:down() and selectory3 < 233 then
	selectory3 = selectory3 + 20
	choice = choice +1
end
if pad:up() and oldpad:up() ~= pad:up() and selectory3 > 188 then
	selectory3 = selectory3 -20
	choice = choice -1
end
if pad:r() and oldpad:r() ~= pad:r() and selectory3 == 188 and counter > 5 then
pokemon[choice].C_HP = pokemon[choice].C_HP +20
	if pokemon[choice].C_HP > pokemon[choice].MAX_HP then
		pokemon[choice].C_HP = pokemon[choice].MAX_HP
	end
items[1].amount = items[1].amount - 1
potion = nil
end

screen.waitVblankStart()
screen.flip()



oldpad = pad
end