AI helper tweaks and fixes.
Type changes.
Simple AI.
Moved AI logic.
Advanced AI.