attack method

add takedamage method into attack code