diff --git a/stepmania/src/CombinedLifeMeter.h b/stepmania/src/CombinedLifeMeter.h index 73b5d5f6fb..485e74efe9 100644 --- a/stepmania/src/CombinedLifeMeter.h +++ b/stepmania/src/CombinedLifeMeter.h @@ -19,6 +19,7 @@ public: /* Change life after receiving a hold note grade. tscore is the score * received for the initial tap note. */ virtual void ChangeLife( PlayerNumber pn, HoldNoteScore hns, TapNoteScore tns ) = 0; + virtual void HandleTapScoreNone( PlayerNumber pn ) = 0; }; diff --git a/stepmania/src/CombinedLifeMeterTug.cpp b/stepmania/src/CombinedLifeMeterTug.cpp index 8bf504f285..eff29c4d53 100644 --- a/stepmania/src/CombinedLifeMeterTug.cpp +++ b/stepmania/src/CombinedLifeMeterTug.cpp @@ -79,6 +79,11 @@ void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, TapNoteScore score ) ChangeLife( pn, fPercentToMove ); } +void CombinedLifeMeterTug::HandleTapScoreNone( PlayerNumber pn ) +{ + +} + void CombinedLifeMeterTug::ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ) { float fPercentToMove = 0; diff --git a/stepmania/src/CombinedLifeMeterTug.h b/stepmania/src/CombinedLifeMeterTug.h index a29ab3a01c..1ca2a1f23d 100644 --- a/stepmania/src/CombinedLifeMeterTug.h +++ b/stepmania/src/CombinedLifeMeterTug.h @@ -15,6 +15,7 @@ public: virtual void ChangeLife( PlayerNumber pn, TapNoteScore score ); virtual void ChangeLife( PlayerNumber pn, HoldNoteScore score, TapNoteScore tscore ); + virtual void HandleTapScoreNone( PlayerNumber pn ); protected: void ChangeLife( PlayerNumber pn, float fPercentToMove ); diff --git a/stepmania/src/LifeMeter.h b/stepmania/src/LifeMeter.h index 9a6b550089..4328869af1 100644 --- a/stepmania/src/LifeMeter.h +++ b/stepmania/src/LifeMeter.h @@ -28,6 +28,7 @@ public: /* Change life after receiving a hold note grade. tscore is the score * received for the initial tap note. */ virtual void ChangeLife( HoldNoteScore hns, TapNoteScore tns ) = 0; + virtual void HandleTapScoreNone() = 0; virtual bool IsInDanger() const = 0; virtual bool IsHot() const = 0; virtual bool IsFailing() const = 0; diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index fc6710d27f..fc2543fd24 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -134,6 +134,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) case TNS_W5: fDeltaLife = g_fLifePercentChange.GetValue(SE_W5); break; case TNS_Miss: fDeltaLife = g_fLifePercentChange.GetValue(SE_Miss); break; case TNS_HitMine: fDeltaLife = g_fLifePercentChange.GetValue(SE_HitMine); break; + case TNS_None: fDeltaLife = g_fLifePercentChange.GetValue(SE_Miss); break; } if( IsHot() && score < TNS_W4 ) fDeltaLife = -0.10f; // make it take a while to get back to "hot" @@ -240,6 +241,13 @@ void LifeMeterBar::ChangeLife( float fDeltaLife ) AfterLifeChanged(); } +extern ThemeMetric PENALIZE_TAP_SCORE_NONE; +void LifeMeterBar::HandleTapScoreNone() +{ + if( PENALIZE_TAP_SCORE_NONE ) + ChangeLife( TNS_None ); +} + void LifeMeterBar::AfterLifeChanged() { m_pStream->SetPercent( m_fLifePercentage ); diff --git a/stepmania/src/LifeMeterBar.h b/stepmania/src/LifeMeterBar.h index f51d699115..089187d038 100644 --- a/stepmania/src/LifeMeterBar.h +++ b/stepmania/src/LifeMeterBar.h @@ -21,6 +21,7 @@ public: virtual void ChangeLife( TapNoteScore score ); virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); virtual void ChangeLife( float fDeltaLifePercent ); + virtual void HandleTapScoreNone(); virtual void AfterLifeChanged(); virtual bool IsInDanger() const; virtual bool IsHot() const; diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index a0d9e87f23..88c980b1e8 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -133,6 +133,11 @@ void LifeMeterBattery::ChangeLife( HoldNoteScore score, TapNoteScore tscore ) } } +void LifeMeterBattery::HandleTapScoreNone() +{ + +} + void LifeMeterBattery::ChangeLife( float fDeltaLifePercent ) { } diff --git a/stepmania/src/LifeMeterBattery.h b/stepmania/src/LifeMeterBattery.h index ce61795658..dc7d211458 100644 --- a/stepmania/src/LifeMeterBattery.h +++ b/stepmania/src/LifeMeterBattery.h @@ -23,6 +23,7 @@ public: virtual void ChangeLife( TapNoteScore score ); virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); virtual void ChangeLife( float fDeltaLifePercent ); + virtual void HandleTapScoreNone(); virtual bool IsInDanger() const; virtual bool IsHot() const; virtual bool IsFailing() const; diff --git a/stepmania/src/LifeMeterTime.cpp b/stepmania/src/LifeMeterTime.cpp index 2c54f1e0a4..ce07fd9d54 100644 --- a/stepmania/src/LifeMeterTime.cpp +++ b/stepmania/src/LifeMeterTime.cpp @@ -154,6 +154,11 @@ void LifeMeterTime::ChangeLife( HoldNoteScore hns, TapNoteScore tns ) SendLifeChangedMessage( fOldLife, tns, hns ); } +void LifeMeterTime::HandleTapScoreNone() +{ + +} + void LifeMeterTime::SendLifeChangedMessage( float fOldLife, TapNoteScore tns, HoldNoteScore hns ) { Message msg( "LifeChanged" ); diff --git a/stepmania/src/LifeMeterTime.h b/stepmania/src/LifeMeterTime.h index e3a800aa41..8c1b27644d 100644 --- a/stepmania/src/LifeMeterTime.h +++ b/stepmania/src/LifeMeterTime.h @@ -25,6 +25,7 @@ public: virtual void OnLoadSong(); virtual void ChangeLife( TapNoteScore score ); virtual void ChangeLife( HoldNoteScore score, TapNoteScore tscore ); + virtual void HandleTapScoreNone(); virtual bool IsInDanger() const; virtual bool IsHot() const; virtual bool IsFailing() const; diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 938d15a025..ded2983f06 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -144,7 +144,7 @@ protected: void HandleHoldScore( const TapNote &tn ); void DrawTapJudgments(); void DrawHoldJudgments(); - void SendComboMessage( int iOldCombo, int iOldMissCombo ); + void SendComboMessages( int iOldCombo, int iOldMissCombo ); void SetJudgment( TapNoteScore tns, bool bEarly ); diff --git a/stepmania/src/ScoreKeeper.h b/stepmania/src/ScoreKeeper.h index 2c402d10c5..40422fcbde 100644 --- a/stepmania/src/ScoreKeeper.h +++ b/stepmania/src/ScoreKeeper.h @@ -55,6 +55,7 @@ public: virtual void HandleTapScore( const TapNote &tn ) = 0; virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0; virtual void HandleHoldScore( const TapNote &tn ) = 0; + virtual void HandleTapScoreNone() = 0; protected: void GetScoreOfLastTapInRow( const NoteData &nd, int iRow, TapNoteScore &tnsOut, int &iNumTapsInRowOut ); diff --git a/stepmania/src/ScoreKeeperNormal.cpp b/stepmania/src/ScoreKeeperNormal.cpp index a799ffbd5a..ab3a472532 100644 --- a/stepmania/src/ScoreKeeperNormal.cpp +++ b/stepmania/src/ScoreKeeperNormal.cpp @@ -74,7 +74,7 @@ void ScoreKeeperNormal::Load( ASSERT( apSongs.size() == asModifiers.size() ); /* True if a jump is one to combo, false if combo is purely based on tap count. */ - m_bComboIsPerRow = THEME->GetMetricB( "Gameplay", "ComboIsPerRow" ); + m_ComboIsPerRow.Load( "Gameplay", "ComboIsPerRow" ); m_MinScoreToContinueCombo.Load( "Gameplay", "MinScoreToContinueCombo" ); m_MinScoreToMaintainCombo.Load( "Gameplay", "MinScoreToMaintainCombo" ); @@ -279,6 +279,23 @@ void ScoreKeeperNormal::AddTapRowScore( TapNoteScore score, const NoteData &nd, AddScoreInternal( score ); } +extern ThemeMetric PENALIZE_TAP_SCORE_NONE; +void ScoreKeeperNormal::HandleTapScoreNone() +{ + if( PENALIZE_TAP_SCORE_NONE ) + { + m_pPlayerStageStats->m_iCurCombo = 0; + + if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID ) + MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) ); + + AddScoreInternal( TNS_Miss ); + } + + + // TODO: networking code +} + void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score ) { int &iScore = m_pPlayerStageStats->m_iScore; @@ -439,7 +456,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow ) // // Regular combo // - const int iComboCountIfHit = m_bComboIsPerRow? 1: iNumTapsInRow; + const int iComboCountIfHit = m_ComboIsPerRow? 1: iNumTapsInRow; if( scoreOfLastTap >= m_MinScoreToMaintainCombo ) { m_pPlayerStageStats->m_iCurMissCombo = 0; diff --git a/stepmania/src/ScoreKeeperNormal.h b/stepmania/src/ScoreKeeperNormal.h index e486f8bcd3..5a6f57db22 100644 --- a/stepmania/src/ScoreKeeperNormal.h +++ b/stepmania/src/ScoreKeeperNormal.h @@ -17,18 +17,18 @@ class ScoreKeeperNormal: public ScoreKeeper { void AddScoreInternal( TapNoteScore score ); - int m_iScoreRemainder; - int m_iMaxPossiblePoints; - int m_iTapNotesHit; // number of notes judged so far, needed by scoring + int m_iScoreRemainder; + int m_iMaxPossiblePoints; + int m_iTapNotesHit; // number of notes judged so far, needed by scoring - int m_iNumTapsAndHolds; - int m_iMaxScoreSoFar; // for nonstop scoring - int m_iPointBonus; // the difference to award at the end - int m_iCurToastyCombo; - bool m_bIsLastSongInCourse; - bool m_bIsBeginner; + int m_iNumTapsAndHolds; + int m_iMaxScoreSoFar; // for nonstop scoring + int m_iPointBonus; // the difference to award at the end + int m_iCurToastyCombo; + bool m_bIsLastSongInCourse; + bool m_bIsBeginner; - bool m_bComboIsPerRow; + ThemeMetric m_ComboIsPerRow; ThemeMetric m_MinScoreToContinueCombo; ThemeMetric m_MinScoreToMaintainCombo; @@ -37,6 +37,7 @@ class ScoreKeeperNormal: public ScoreKeeper virtual void AddTapScore( TapNoteScore tns ); virtual void AddHoldScore( HoldNoteScore hns ); virtual void AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow ); + virtual void HandleTapScoreNone(); /* Configuration: */ /* Score after each tap will be rounded to the nearest m_iRoundTo; 1 to do nothing. */ diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index 04ff83db80..4ef6171b04 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -85,6 +85,16 @@ void ScoreKeeperRave::HandleHoldScore( const TapNote &tn ) AddSuperMeterDelta( fPercentToMove ); } +extern ThemeMetric PENALIZE_TAP_SCORE_NONE; +void ScoreKeeperRave::HandleTapScoreNone() +{ + if( PENALIZE_TAP_SCORE_NONE ) + { + float fPercentToMove = g_fSuperMeterPercentChange[SE_Miss]; + AddSuperMeterDelta( fPercentToMove ); + } +} + void ScoreKeeperRave::AddSuperMeterDelta( float fUnscaledPercentChange ) { if( PREFSMAN->m_bMercifulDrain && fUnscaledPercentChange<0 ) diff --git a/stepmania/src/ScoreKeeperRave.h b/stepmania/src/ScoreKeeperRave.h index 0b122e4f5c..558d07731e 100644 --- a/stepmania/src/ScoreKeeperRave.h +++ b/stepmania/src/ScoreKeeperRave.h @@ -15,6 +15,7 @@ public: void HandleTapScore( const TapNote &tn ); void HandleTapRowScore( const NoteData &nd, int iRow ); void HandleHoldScore( const TapNote &tn ); + void HandleTapScoreNone(); protected: void LaunchAttack( AttackLevel al );