Hey, I've looked into the code and it looks great but I have a few things you should check on
1) this happened twice but Gary sometimes doesn't have a Pokemon when I fight so I can just do the same attack over and over again and can win.
2) I would play till misty and something screws up and I can't play anymore.
otherwise this looks good. Keep up the good work