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
------------------------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: Initial sort order now sorts by meter of Easy notes, ala MAX.
BUG FIX: DWI music sample info now read correctly - again.
+43 -42
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
{
@@ -58,52 +58,53 @@ void Combo::UpdateScore( TapNoteScore score )
{
case TNS_PERFECT:
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;
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;
}
int iOldCombo = m_iCurCombo;
// new max combo
m_iMaxCombo = max(m_iMaxCombo, m_iCurCombo);
m_iCurCombo += iNumNotesInThisRow; // continue combo
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 )
{
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
#define CROSSED( i ) (iOldCombo<i && i<=m_iCurCombo)
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 );
if ( CROSSED(100) ) SCREENMAN->SendMessageToTopScreen( SM_100Combo, 0 );
else if( CROSSED(200) ) SCREENMAN->SendMessageToTopScreen( SM_200Combo, 0 );
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 );
// new max combo
m_iMaxCombo = max(m_iMaxCombo, m_iCurCombo);
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;
case TNS_GOOD:
+1 -1
View File
@@ -22,7 +22,7 @@ class Combo : public ActorFrame
public:
Combo();
void UpdateScore( TapNoteScore score );
void UpdateScore( TapNoteScore score, int iNumNotesInThisRow );
int GetCurrentCombo() const { return m_iCurCombo; }
int GetMaxCombo() const { return m_iMaxCombo; }
+44 -32
View File
@@ -458,8 +458,7 @@ void Player::Step( int col )
void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn )
{
//LOG->Trace( "fBeatsUntilStep: %f, fPercentFromPerfect: %f",
// fBeatsUntilStep, fPercentFromPerfect );
LOG->Trace( "Player::OnRowDestroyed" );
// find the minimum score of the row
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
{
int iNumNotesInThisRow = 0;
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
HandleNoteScore( score ); // update score - called once per note in this row
// update combo - called once per note in this row
m_Combo.UpdateScore( score );
}
if( iNumNotesInThisRow > 0 )
{
HandleNoteScore( score, iNumNotesInThisRow ); // update score - called once per note in this row
m_Combo.UpdateScore( score, iNumNotesInThisRow );
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 );
//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 )
{
m_TapNoteScores[t][r] = TNS_MISS;
iNumMissesFound++;
bFoundAMissInThisRow = true;
HandleNoteScore( TNS_MISS );
iNumMissesThisRow++;
}
}
if( iNumMissesThisRow > 0 )
{
HandleNoteScore( TNS_MISS, iNumMissesThisRow );
m_Combo.UpdateScore( TNS_MISS, iNumMissesThisRow );
}
}
if( iNumMissesFound > 0 )
{
m_Judgement.SetJudgement( TNS_MISS );
m_Combo.UpdateScore( TNS_MISS );
}
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.
if( PREFSMAN->m_bAutoPlay && !GAMESTATE->m_bDemonstration )
return;
// update dance points for Oni lifemeter
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += TapNoteScoreToDancePoints( score );
GAMESTATE->m_TapNoteScores[m_PlayerNumber][score]++;
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += iNumTapsInRow * TapNoteScoreToDancePoints( score );
GAMESTATE->m_TapNoteScores[m_PlayerNumber][score] += iNumTapsInRow;
if( m_pLifeMeter )
m_pLifeMeter->ChangeLife( score );
if( m_pLifeMeter )
m_pLifeMeter->OnDancePointsChange();
m_pLifeMeter->OnDancePointsChange(); // update oni life meter
//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.
float& fScore = GAMESTATE->m_fScore[m_PlayerNumber];
ASSERT( fScore >= 0 );
int p; // score multiplier
switch( score )
{
@@ -625,21 +637,23 @@ void Player::HandleNoteScore( TapNoteScore score )
default: p = 0; break;
}
int N = m_iNumTapNotes;
int n = m_iTapNotesHit+1;
int B = m_iMeter * 1000000;
float S = (1+N)*N/2.0f;
for( int i=0; i<iNumTapsInRow; i++ )
{
// 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];
ASSERT( fScore >= 0 );
float one_step_score = p * (B/S) * n;
fScore += one_step_score;
fScore += one_step_score;
m_iTapNotesHit++;
}
m_iTapNotesHit++;
ASSERT( m_iTapNotesHit <= m_iNumTapNotes );
// 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 )
return;
// update dance points for Oni lifemeter
// update dance points totals
GAMESTATE->m_iActualDancePoints[m_PlayerNumber] += HoldNoteScoreToDancePoints( score );
GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score]++;
GAMESTATE->m_HoldNoteScores[m_PlayerNumber][score] ++;
if( m_pLifeMeter )
m_pLifeMeter->ChangeLife( score );
if( m_pLifeMeter )
m_pLifeMeter->OnDancePointsChange();
// HoldNoteScores don't effect m_fScore
m_pLifeMeter->OnDancePointsChange(); // refresh Oni life meter
}
float Player::GetMaxBeatDifference()
+1 -1
View File
@@ -52,7 +52,7 @@ public:
protected:
int UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
void OnRowDestroyed( int col, int iStepIndex );
void HandleNoteScore( TapNoteScore score );
void HandleNoteScore( TapNoteScore score, int iNumTapsInRow );
void HandleNoteScore( HoldNoteScore score );
static float GetMaxBeatDifference();
-2
View File
@@ -10,8 +10,6 @@
-----------------------------------------------------------------------------
*/
const int NUM_EFFECT_TYPES = 9;
struct PlayerOptions
{
float m_fArrowScrollSpeed;
+3 -1
View File
@@ -50,7 +50,9 @@ CString SecondsToTime( float fSecs )
int iMinsDisplay = (int)fSecs/60;
int iSecsDisplay = (int)fSecs - iMinsDisplay*60;
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;
case TYPE_SECTION: // if we get here, there are no courses
m_Banner.SetFromGroup( "" );
break;
default:
ASSERT(0);
+2 -12
View File
@@ -259,17 +259,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
if( RandomFloat(0,1)>0.8f )
GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = 1.5f;
/* 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;
GAMESTATE->m_PlayerOptions[p].m_bEffects[ rand()%PlayerOptions::NUM_EFFECT_TYPES ] = true;
if( RandomFloat(0,1)>0.9f )
GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::APPEARANCE_HIDDEN;
if( RandomFloat(0,1)>0.9f )
@@ -281,7 +271,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
}
GAMESTATE->m_SongOptions.m_LifeType = (randomf(0,1)>0.7f) ? SongOptions::LIFE_BATTERY : SongOptions::LIFE_BAR;
GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_OFF;
GAMESTATE->m_bDemonstration = true;
m_Fade.CloseWipingRight( SM_GoToDemonstration );
}