change attack function

change the attack function to attack with different units