With an opener like that, what matters is attitude and confidence. If you deliver it completely normal, as if you couldn't possibly imagine it could be offensive, then most likely they will just start by laughing it off or throwing some test in your face, expecting you to fall apart.
If you show you can handle what they throw back at you, you've both demonstrated confidence, that you're the kind of guy that expects women to fall over themselves to sleep with you and so you really are honest and can say what you like, and you've made it clear to them from the start that you're after sex; you're "dangerous", not some potential guy to amuse them while they have a few drinks.
Sexual intent, confidence and the perception that you're very successful with women and don't need to by shy about what you're after means far more than looks.
Personally I'd expect that line to work better on "good quality" girls, actually. Especially pretty girls that know they look good.
If you try it on girls that don't look good enough or that seem insecure etc., you might very easily come off as thinking they're easy.
With really beautiful and/or confident girls you're more likely for them to expect guys to be shy and deferential or just plain creepy.
Of course the chance of coming off as creepy with a line like that if not delivered with the perfect attitude is pretty high.