almost done the Ranking fuction, only work when you lose the fight

Ranking after winning will be done after the Ending panel is finish