Does a guy's friend affect how they act?

me and my (now) ex were great in the beginning. and I've always thought maybe his guy friends had an affect on how he behaves. they're all single military "boys" and all they do is party and sleep with random girls. after a while, my ex then started partying a lot more with them and I realized he was turning more like them. does a guys friends really affect how they act? example: if they're friends are sleeping around with random girls, will he also do that too?