Made an ai for avoiding threats

Next up is probably riding the horse, since it's causing technical
issues regarding speed of movement.