Holy shit got that AI working and everything.

Needs a fuckton of bugtesting, but I get to hand this in.