public override GameObject AI_ChooseTarget() { // I admit this is some HORRIBLE code down there. Maybe i should have just made this random, since my AI code is in general SICKly bad.. It should just generally work as follows in final version (as it does now): // Just take the normal movement AI and make it find the best move from legal tiles for this ability. AI_Movement TemporaryMovementAI = new AI_Movement(myUnit.PlayerID); var dictionary = new Dictionary <Tile, float>(); foreach (Tile tile in AI_GetTheLegalMoves()) { dictionary.Add(tile, TemporaryMovementAI.EvaluateTile(myUnit, tile, TemporaryMovementAI.FindDirectionOfEnemies(myUnit), TemporaryMovementAI.GetAllEnemyMoves())); } return(TemporaryMovementAI.GetTheMove(myUnit, dictionary).Key.gameObject); }