Drugs and sex

If I am on drugs then have sex and my boyfriend cums in me will it effect the baby ?