Implemented take damage functionality.