Moved training, maneuver, attack and sleep creatures logic into separate functions.

I also simplified them a bit along the way.