Add calculate damage function