Switched the affiliation and distance checks

That means the instanceof EnemyShip and the distance < 500 checks.