add HandleTapScoreNone() for letting LifeMeters and ScoreKeepers handle TNS_None steps

This commit is contained in:
Chris Danford
2006-12-19 01:39:57 +00:00
parent 8638b12928
commit dd2fef4f40
16 changed files with 72 additions and 13 deletions
+1
View File
@@ -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;
};
+5
View File
@@ -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;
+1
View File
@@ -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 );
+1
View File
@@ -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;
+8
View File
@@ -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<bool> PENALIZE_TAP_SCORE_NONE;
void LifeMeterBar::HandleTapScoreNone()
{
if( PENALIZE_TAP_SCORE_NONE )
ChangeLife( TNS_None );
}
void LifeMeterBar::AfterLifeChanged()
{
m_pStream->SetPercent( m_fLifePercentage );
+1
View File
@@ -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;
+5
View File
@@ -133,6 +133,11 @@ void LifeMeterBattery::ChangeLife( HoldNoteScore score, TapNoteScore tscore )
}
}
void LifeMeterBattery::HandleTapScoreNone()
{
}
void LifeMeterBattery::ChangeLife( float fDeltaLifePercent )
{
}
+1
View File
@@ -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;
+5
View File
@@ -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" );
+1
View File
@@ -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;
+1 -1
View File
@@ -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 );
+1
View File
@@ -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 );
+19 -2
View File
@@ -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<bool> 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;
+11 -10
View File
@@ -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<bool> m_ComboIsPerRow;
ThemeMetric<TapNoteScore> m_MinScoreToContinueCombo;
ThemeMetric<TapNoteScore> 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. */
+10
View File
@@ -85,6 +85,16 @@ void ScoreKeeperRave::HandleHoldScore( const TapNote &tn )
AddSuperMeterDelta( fPercentToMove );
}
extern ThemeMetric<bool> 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 )
+1
View File
@@ -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 );