Missing a jump in Oni now takes away only one life

This commit is contained in:
Chris Danford
2002-10-02 05:42:59 +00:00
parent e3d962cde2
commit 192bfd5ff5
9 changed files with 96 additions and 91 deletions
+1
View File
@@ -3,6 +3,7 @@ CHANGE: Name changed to "beta 7" to avoid confusion with the numerous beta 6
release candidates release candidates
------------------------CVS after 3.00 beta 6---------------- ------------------------CVS after 3.00 beta 6----------------
CHANGE: Missing a jump with the Oni life meter now subtracts only 1 life
CHANGE: Judge difficulty strictness increased slightly. CHANGE: Judge difficulty strictness increased slightly.
CHANGE: Initial sort order now sorts by meter of Easy notes, ala MAX. CHANGE: Initial sort order now sorts by meter of Easy notes, ala MAX.
BUG FIX: DWI music sample info now read correctly - again. BUG FIX: DWI music sample info now read correctly - again.
+42 -41
View File
@@ -45,7 +45,7 @@ Combo::Combo()
} }
void Combo::UpdateScore( TapNoteScore score ) void Combo::UpdateScore( TapNoteScore score, int iNumNotesInThisRow )
{ {
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration ) // cheaters never prosper if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration ) // cheaters never prosper
{ {
@@ -58,52 +58,53 @@ void Combo::UpdateScore( TapNoteScore score )
{ {
case TNS_PERFECT: case TNS_PERFECT:
case TNS_GREAT: case TNS_GREAT:
// continue combo
m_iCurCombo++;
if( score == TNS_PERFECT ) m_iCurComboOfPerfects++;
else m_iCurComboOfPerfects = 0;
if( m_iCurComboOfPerfects>=150 && (m_iCurComboOfPerfects%150)==0 && RandomFloat(0,1) > 0.5 && !GAMESTATE->m_bDemonstration )
SCREENMAN->SendMessageToTopScreen( SM_BeginToasty, 0 );
switch( m_iCurCombo )
{ {
case 100: SCREENMAN->SendMessageToTopScreen( SM_100Combo, 0 ); break; int iOldCombo = m_iCurCombo;
case 200: SCREENMAN->SendMessageToTopScreen( SM_200Combo, 0 ); break;
case 300: SCREENMAN->SendMessageToTopScreen( SM_300Combo, 0 ); break;
case 400: SCREENMAN->SendMessageToTopScreen( SM_400Combo, 0 ); break;
case 500: SCREENMAN->SendMessageToTopScreen( SM_500Combo, 0 ); break;
case 600: SCREENMAN->SendMessageToTopScreen( SM_600Combo, 0 ); break;
case 700: SCREENMAN->SendMessageToTopScreen( SM_700Combo, 0 ); break;
case 800: SCREENMAN->SendMessageToTopScreen( SM_800Combo, 0 ); break;
case 900: SCREENMAN->SendMessageToTopScreen( SM_900Combo, 0 ); break;
case 1000: SCREENMAN->SendMessageToTopScreen( SM_1000Combo, 0 ); break;
}
// new max combo m_iCurCombo += iNumNotesInThisRow; // continue combo
m_iMaxCombo = max(m_iMaxCombo, m_iCurCombo);
if( score == TNS_PERFECT ) m_iCurComboOfPerfects += iNumNotesInThisRow;
else m_iCurComboOfPerfects = 0;
if( m_iCurComboOfPerfects>=150 && (m_iCurComboOfPerfects%150)==0 && RandomFloat(0,1) > 0.5 && !GAMESTATE->m_bDemonstration )
SCREENMAN->SendMessageToTopScreen( SM_BeginToasty, 0 );
if( m_iCurCombo <= 4 ) #define CROSSED( i ) (iOldCombo<i && i<=m_iCurCombo)
{
m_textComboNumber.SetDiffuse( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuse( D3DXCOLOR(1,1,1,0) ); // invisible
}
else
{
m_textComboNumber.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // visible
m_sprCombo.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // visible
m_textComboNumber.SetText( ssprintf("%d", m_iCurCombo) ); if ( CROSSED(100) ) SCREENMAN->SendMessageToTopScreen( SM_100Combo, 0 );
float fNewZoom = min( 0.5f + m_iCurCombo/800.0f, 1.0f ); else if( CROSSED(200) ) SCREENMAN->SendMessageToTopScreen( SM_200Combo, 0 );
m_textComboNumber.SetZoom( fNewZoom ); else if( CROSSED(300) ) SCREENMAN->SendMessageToTopScreen( SM_300Combo, 0 );
else if( CROSSED(400) ) SCREENMAN->SendMessageToTopScreen( SM_400Combo, 0 );
else if( CROSSED(500) ) SCREENMAN->SendMessageToTopScreen( SM_500Combo, 0 );
else if( CROSSED(600) ) SCREENMAN->SendMessageToTopScreen( SM_600Combo, 0 );
else if( CROSSED(700) ) SCREENMAN->SendMessageToTopScreen( SM_700Combo, 0 );
else if( CROSSED(800) ) SCREENMAN->SendMessageToTopScreen( SM_800Combo, 0 );
else if( CROSSED(900) ) SCREENMAN->SendMessageToTopScreen( SM_900Combo, 0 );
else if( CROSSED(1000)) SCREENMAN->SendMessageToTopScreen( SM_1000Combo, 0 );
//this->SetZoom( 1.2f ); // new max combo
//this->BeginTweening( 0.3f ); m_iMaxCombo = max(m_iMaxCombo, m_iCurCombo);
//this->SetTweenZoom( 1 );
if( m_iCurCombo <= 4 )
{
m_textComboNumber.SetDiffuse( D3DXCOLOR(1,1,1,0) ); // invisible
m_sprCombo.SetDiffuse( D3DXCOLOR(1,1,1,0) ); // invisible
}
else
{
m_textComboNumber.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // visible
m_sprCombo.SetDiffuse( D3DXCOLOR(1,1,1,1) ); // visible
m_textComboNumber.SetText( ssprintf("%d", m_iCurCombo) );
float fNewZoom = min( 0.5f + m_iCurCombo/800.0f, 1.0f );
m_textComboNumber.SetZoom( fNewZoom );
//this->SetZoom( 1.2f );
//this->BeginTweening( 0.3f );
//this->SetTweenZoom( 1 );
}
} }
break; break;
case TNS_GOOD: case TNS_GOOD:
+1 -1
View File
@@ -22,7 +22,7 @@ class Combo : public ActorFrame
public: public:
Combo(); Combo();
void UpdateScore( TapNoteScore score ); void UpdateScore( TapNoteScore score, int iNumNotesInThisRow );
int GetCurrentCombo() const { return m_iCurCombo; } int GetCurrentCombo() const { return m_iCurCombo; }
int GetMaxCombo() const { return m_iMaxCombo; } int GetMaxCombo() const { return m_iMaxCombo; }
+43 -31
View File
@@ -458,8 +458,7 @@ void Player::Step( int col )
void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn ) void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
{ {
//LOG->Trace( "fBeatsUntilStep: %f, fPercentFromPerfect: %f", LOG->Trace( "Player::OnRowDestroyed" );
// fBeatsUntilStep, fPercentFromPerfect );
// find the minimum score of the row // find the minimum score of the row
TapNoteScore score = TNS_PERFECT; TapNoteScore score = TNS_PERFECT;
@@ -485,14 +484,18 @@ void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
for( int c=0; c<m_iNumTracks; c++ ) // for each column for( int c=0; c<m_iNumTracks; c++ ) // for each column
{ {
int iNumNotesInThisRow = 0;
if( m_TapNotes[c][iIndexThatWasSteppedOn] != '0' ) // if there is a note in this col if( m_TapNotes[c][iIndexThatWasSteppedOn] != '0' ) // if there is a note in this col
{ {
iNumNotesInThisRow++;
m_GhostArrowRow.TapNote( c, score, m_Combo.GetCurrentCombo()>g_iBrightGhostThreshold ); // show the ghost arrow for this column m_GhostArrowRow.TapNote( c, score, m_Combo.GetCurrentCombo()>g_iBrightGhostThreshold ); // show the ghost arrow for this column
}
HandleNoteScore( score ); // update score - called once per note in this row if( iNumNotesInThisRow > 0 )
{
// update combo - called once per note in this row HandleNoteScore( score, iNumNotesInThisRow ); // update score - called once per note in this row
m_Combo.UpdateScore( score ); m_Combo.UpdateScore( score, iNumNotesInThisRow );
GAMESTATE->m_iMaxCombo[m_PlayerNumber] = max( GAMESTATE->m_iMaxCombo[m_PlayerNumber], m_Combo.GetCurrentCombo() ); GAMESTATE->m_iMaxCombo[m_PlayerNumber] = max( GAMESTATE->m_iMaxCombo[m_PlayerNumber], m_Combo.GetCurrentCombo() );
} }
} }
@@ -535,25 +538,28 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat )
int iStartCheckingAt = max( 0, iMissIfOlderThanThisIndex-10 ); int iStartCheckingAt = max( 0, iMissIfOlderThanThisIndex-10 );
//LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex ); //LOG->Trace( "iStartCheckingAt: %d iMissIfOlderThanThisIndex: %d", iStartCheckingAt, iMissIfOlderThanThisIndex );
for( int t=0; t<m_iNumTracks; t++ ) for( int r=iStartCheckingAt; r<iMissIfOlderThanThisIndex; r++ )
{ {
for( int r=iStartCheckingAt; r<iMissIfOlderThanThisIndex; r++ ) int iNumMissesThisRow = 0;
for( int t=0; t<m_iNumTracks; t++ )
{ {
bool bFoundAMissInThisRow = false;
if( m_TapNotes[t][r] != '0' && m_TapNoteScores[t][r] == TNS_NONE ) if( m_TapNotes[t][r] != '0' && m_TapNoteScores[t][r] == TNS_NONE )
{ {
m_TapNoteScores[t][r] = TNS_MISS; m_TapNoteScores[t][r] = TNS_MISS;
iNumMissesFound++; iNumMissesFound++;
bFoundAMissInThisRow = true; iNumMissesThisRow++;
HandleNoteScore( TNS_MISS );
} }
} }
if( iNumMissesThisRow > 0 )
{
HandleNoteScore( TNS_MISS, iNumMissesThisRow );
m_Combo.UpdateScore( TNS_MISS, iNumMissesThisRow );
}
} }
if( iNumMissesFound > 0 ) if( iNumMissesFound > 0 )
{ {
m_Judgement.SetJudgement( TNS_MISS ); m_Judgement.SetJudgement( TNS_MISS );
m_Combo.UpdateScore( TNS_MISS );
} }
return iNumMissesFound; return iNumMissesFound;
@@ -575,19 +581,21 @@ void Player::CrossedRow( int iNoteRow )
void Player::HandleNoteScore( TapNoteScore score ) void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
{ {
ASSERT( iNumTapsInRow >= 1 );
// don't accumulate points if AutoPlay is on. // don't accumulate points if AutoPlay is on.
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration ) if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration )
return; return;
// update dance points for Oni lifemeter // update dance points for Oni lifemeter
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( score ); GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score );
GAMESTATE->m_TapNoteScores[m_PlayerNumber][score]++; GAMESTATE->m_TapNoteScores[m_PlayerNumber][score] += iNumTapsInRow;
if( m_pLifeMeter ) if( m_pLifeMeter )
m_pLifeMeter->ChangeLife( score ); m_pLifeMeter->ChangeLife( score );
if( m_pLifeMeter ) if( m_pLifeMeter )
m_pLifeMeter->OnDancePointsChange(); m_pLifeMeter->OnDancePointsChange(); // update oni life meter
//A single step's points are calculated as follows: //A single step's points are calculated as follows:
@@ -617,6 +625,10 @@ void Player::HandleNoteScore( TapNoteScore score )
// //
//Note: if you got all Perfect on this song, you would get (p=10)*B, which is 80,000,000. In fact, the maximum possible score for any song is the number of feet difficulty X 10,000,000. //Note: if you got all Perfect on this song, you would get (p=10)*B, which is 80,000,000. In fact, the maximum possible score for any song is the number of feet difficulty X 10,000,000.
float& fScore = GAMESTATE->m_fScore[m_PlayerNumber];
ASSERT( fScore >= 0 );
int p; // score multiplier int p; // score multiplier
switch( score ) switch( score )
{ {
@@ -625,21 +637,23 @@ void Player::HandleNoteScore( TapNoteScore score )
default: p = 0; break; default: p = 0; break;
} }
int N = m_iNumTapNotes; for( int i=0; i<iNumTapsInRow; i++ )
int n = m_iTapNotesHit+1; {
int B = m_iMeter * 1000000;
float S = (1+N)*N/2.0f;
// printf( "m_iNumTapNotes %d, m_iTapNotesHit %d\n", m_iNumTapNotes, m_iTapNotesHit ); int N = m_iNumTapNotes;
int n = m_iTapNotesHit+1;
int B = m_iMeter * 1000000;
float S = (1+N)*N/2.0f;
float one_step_score = p * (B/S) * n; // printf( "m_iNumTapNotes %d, m_iTapNotesHit %d\n", m_iNumTapNotes, m_iTapNotesHit );
float& fScore = GAMESTATE->m_fScore[m_PlayerNumber]; float one_step_score = p * (B/S) * n;
ASSERT( fScore >= 0 );
fScore += one_step_score; fScore += one_step_score;
m_iTapNotesHit++;
}
m_iTapNotesHit++;
ASSERT( m_iTapNotesHit <= m_iNumTapNotes ); ASSERT( m_iTapNotesHit <= m_iNumTapNotes );
// HACK: Correct for rounding errors that cause a 100% perfect score to be slightly off // HACK: Correct for rounding errors that cause a 100% perfect score to be slightly off
@@ -657,16 +671,14 @@ void Player::HandleNoteScore( HoldNoteScore score )
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration ) if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration )
return; return;
// update dance points for Oni lifemeter // update dance points totals
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score ); GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score );
GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score]++; GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score] ++;
if( m_pLifeMeter ) if( m_pLifeMeter )
m_pLifeMeter->ChangeLife( score ); m_pLifeMeter->ChangeLife( score );
if( m_pLifeMeter ) if( m_pLifeMeter )
m_pLifeMeter->OnDancePointsChange(); m_pLifeMeter->OnDancePointsChange(); // refresh Oni life meter
// HoldNoteScores don't effect m_fScore
} }
float Player::GetMaxBeatDifference() float Player::GetMaxBeatDifference()
+1 -1
View File
@@ -52,7 +52,7 @@ public:
protected: protected:
int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowDestroyed( int col, int iStepIndex ); void OnRowDestroyed( int col, int iStepIndex );
void HandleNoteScore( TapNoteScore score ); void HandleNoteScore( TapNoteScore score, int iNumTapsInRow );
void HandleNoteScore( HoldNoteScore score ); void HandleNoteScore( HoldNoteScore score );
static float GetMaxBeatDifference(); static float GetMaxBeatDifference();
-2
View File
@@ -10,8 +10,6 @@
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
const int NUM_EFFECT_TYPES = 9;
struct PlayerOptions struct PlayerOptions
{ {
float m_fArrowScrollSpeed; float m_fArrowScrollSpeed;
+3 -1
View File
@@ -50,7 +50,9 @@ CString SecondsToTime( float fSecs )
int iMinsDisplay = (int)fSecs/60; int iMinsDisplay = (int)fSecs/60;
int iSecsDisplay = (int)fSecs - iMinsDisplay*60; int iSecsDisplay = (int)fSecs - iMinsDisplay*60;
float fLeftoverDisplay = (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100; float fLeftoverDisplay = (fSecs - iMinsDisplay*60 - iSecsDisplay) * 100;
return ssprintf( "%02d:%02d:%02.0f", iMinsDisplay, iSecsDisplay, fLeftoverDisplay ); CString sReturn = ssprintf( "%02d:%02d:%02.0f", iMinsDisplay, iSecsDisplay, min(99.0f,fLeftoverDisplay) );
ASSERT( sReturn.GetLength() <= 8 );
return sReturn;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
+1
View File
@@ -339,6 +339,7 @@ void ScreenSelectCourse::AfterCourseChange()
} }
break; break;
case TYPE_SECTION: // if we get here, there are no courses case TYPE_SECTION: // if we get here, there are no courses
m_Banner.SetFromGroup( "" );
break; break;
default: default:
ASSERT(0); ASSERT(0);
+1 -11
View File
@@ -259,17 +259,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
if( RandomFloat(0,1)>0.8f ) if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = 1.5f; GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = 1.5f;
GAMESTATE->m_PlayerOptions[p].m_bEffects[ rand()%PlayerOptions::NUM_EFFECT_TYPES ] = true;
/* This is a bitfield; choose a bit. 1<<0 chooses the first
* option, 1<<1 the second, and so on. NUM_EFFECT_TYPES is one
* greater than the number of options (since it includes NONE);
* we'll actually NONE if we choose NUM_EFFECT_TYPES, since that'll
* do 1<<(NUM_EFFECT_TYPES-1), which will turn on a bit that doesn't
* do anything.
*
* It's simple, but it's a hack. FIXME -glenn */
GAMESTATE->m_PlayerOptions[p].m_bEffects[ rand()%NUM_EFFECT_TYPES ] = true;
if( RandomFloat(0,1)>0.9f ) if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN; GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN;
if( RandomFloat(0,1)>0.9f ) if( RandomFloat(0,1)>0.9f )