If I have a fainted lv 39 Pokemon in the first slot of my party and a lv 100 Smeragle in slot 2, and I use a repel, does repel factor in the fainted Pokemon in slot 1 (meaning it repels up to lv 39+) or the Smeragle?
Its whoever is in your first slot of your party that matters. Even if the Pokemon is fainted, you will still be able to run into wild Pokemon regardless of whether or not its unable to battle.