updated battle function in player class