.inflictDamge function created