#include "global.h" /* ----------------------------------------------------------------------------- Class: StageStats Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "StageStats.h" #include "GameState.h" #include "RageLog.h" StageStats::StageStats() { memset( this, 0, sizeof(StageStats) ); } void StageStats::operator+=( const StageStats& other ) { pSong = NULL; // meaningless memset( fAliveSeconds, 0, sizeof(fAliveSeconds) ); for( int p=0; pIsPlayerEnabled(pn) ); // should be calling this is player isn't joined! if( bFailed[pn] ) return GRADE_E; /* Based on the percentage of your total "Dance Points" to the maximum * possible number, the following rank is assigned: * * 100% - AAA * 93% - AA * 80% - A * 65% - B * 45% - C * Less - D * Fail - E */ float fPercentDancePoints = iActualDancePoints[pn] / (float)iPossibleDancePoints[pn]; fPercentDancePoints = max( 0.f, fPercentDancePoints ); LOG->Trace( "iActualDancePoints: %i", iActualDancePoints[pn] ); LOG->Trace( "iPossibleDancePoints: %i", iPossibleDancePoints[pn] ); LOG->Trace( "fPercentDancePoints: %f", fPercentDancePoints ); /* check for "AAAA". Check DP == 100%: if we're using eg. "LITTLE", we might have all * marvelouses but still not qualify for a AAAA. */ if( fPercentDancePoints > .9999 && iTapNoteScores[pn][TNS_MARVELOUS] > 0 && iTapNoteScores[pn][TNS_PERFECT] == 0 && iTapNoteScores[pn][TNS_GREAT] == 0 && iTapNoteScores[pn][TNS_GOOD] == 0 && iTapNoteScores[pn][TNS_BOO] == 0 && iTapNoteScores[pn][TNS_MISS] == 0 && iHoldNoteScores[pn][HNS_NG] == 0 ) return GRADE_AAAA; if ( fPercentDancePoints == 1.00 ) return GRADE_AAA; else if( fPercentDancePoints >= 0.93 ) return GRADE_AA; else if( fPercentDancePoints >= 0.80 ) return GRADE_A; else if( fPercentDancePoints >= 0.65 ) return GRADE_B; else if( fPercentDancePoints >= 0.45 ) return GRADE_C; else if( fPercentDancePoints >= 0 ) return GRADE_D; else return GRADE_E; }