calculate the damage