got the attack function to work
merge conflicts