experimental GH-style hold scoring
This commit is contained in:
@@ -41,8 +41,8 @@ struct HoldNoteResult
|
|||||||
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
||||||
* be the first index of the hold. */
|
* be the first index of the hold. */
|
||||||
int iLastHeldRow;
|
int iLastHeldRow;
|
||||||
bool bHeld;
|
bool bHeld; // Was button held during last update?
|
||||||
bool bActive;
|
bool bActive; // Is life > 0 && overlaps current beat
|
||||||
|
|
||||||
// XML
|
// XML
|
||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
|
|||||||
@@ -741,6 +741,16 @@ void Player::Update( float fDeltaTime )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Cap the active time passed to the score keeper to the actual start time and end time of the hold.
|
||||||
|
if( tn.HoldResult.bActive )
|
||||||
|
{
|
||||||
|
float fSecondsActiveSinceLastUpdate = fDeltaTime * GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
|
||||||
|
if( m_pPrimaryScoreKeeper )
|
||||||
|
m_pPrimaryScoreKeeper->HandleHoldActiveSeconds( fSecondsActiveSinceLastUpdate );
|
||||||
|
if( m_pSecondaryScoreKeeper )
|
||||||
|
m_pSecondaryScoreKeeper->HandleHoldActiveSeconds( fSecondsActiveSinceLastUpdate );
|
||||||
|
}
|
||||||
|
|
||||||
/* check for LetGo. If the head was missed completely, don't count an LetGo. */
|
/* check for LetGo. If the head was missed completely, don't count an LetGo. */
|
||||||
if( bSteppedOnTapNote && fLife == 0 ) // the player has not pressed the button for a long time!
|
if( bSteppedOnTapNote && fLife == 0 ) // the player has not pressed the button for a long time!
|
||||||
hns = HNS_LetGo;
|
hns = HNS_LetGo;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public:
|
|||||||
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
virtual void HandleTapScore( const TapNote &tn ) = 0;
|
||||||
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
|
virtual void HandleTapRowScore( const NoteData &nd, int iRow ) = 0;
|
||||||
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
virtual void HandleHoldScore( const TapNote &tn ) = 0;
|
||||||
|
virtual void HandleHoldActiveSeconds( float fMusicSecondsHeld ) = 0;
|
||||||
virtual void HandleTapScoreNone() = 0;
|
virtual void HandleTapScoreNone() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
ScoreKeeperGuitar::ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ) :
|
ScoreKeeperGuitar::ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ) :
|
||||||
ScoreKeeperNormal(pPlayerState, pPlayerStageStats)
|
ScoreKeeperNormal(pPlayerState, pPlayerStageStats)
|
||||||
{
|
{
|
||||||
|
m_fMusicSecondsHeldRemainder = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
||||||
@@ -15,10 +16,26 @@ void ScoreKeeperGuitar::AddTapScore( TapNoteScore tns )
|
|||||||
|
|
||||||
void ScoreKeeperGuitar::AddHoldScore( HoldNoteScore hns )
|
void ScoreKeeperGuitar::AddHoldScore( HoldNoteScore hns )
|
||||||
{
|
{
|
||||||
if( hns == HNS_Held )
|
}
|
||||||
AddTapScore( TNS_W1 );
|
|
||||||
else if ( hns == HNS_LetGo )
|
void ScoreKeeperGuitar::HandleHoldActiveSeconds( float fMusicSecondsHeld )
|
||||||
AddTapScore( TNS_W4 ); // required for subtractive score display to work properly
|
{
|
||||||
|
int &iScore = m_pPlayerStageStats->m_iScore;
|
||||||
|
int &iCurMaxScore = m_pPlayerStageStats->m_iCurMaxScore;
|
||||||
|
|
||||||
|
const float fPointsPerSecond = 25;
|
||||||
|
const float fMusicSecondsHeldPlusRemainer = m_fMusicSecondsHeldRemainder + fMusicSecondsHeld;
|
||||||
|
const float fPoints = fMusicSecondsHeldPlusRemainer * fPointsPerSecond;
|
||||||
|
const int iPoints = (int)floorf( fPoints );
|
||||||
|
const float fPointsRemainder = fPoints - iPoints;
|
||||||
|
m_fMusicSecondsHeldRemainder = (fPointsRemainder) / fPointsPerSecond;
|
||||||
|
|
||||||
|
if( iPoints != 0 )
|
||||||
|
{
|
||||||
|
iScore += iPoints;
|
||||||
|
iCurMaxScore += iPoints;
|
||||||
|
MESSAGEMAN->Broadcast( Message_ScoreChangedP1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreKeeperGuitar::AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow )
|
void ScoreKeeperGuitar::AddTapRowScore( TapNoteScore tns, const NoteData &nd, int iRow )
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ public:
|
|||||||
ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
ScoreKeeperGuitar( PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats );
|
||||||
virtual void AddTapScore( TapNoteScore score );
|
virtual void AddTapScore( TapNoteScore score );
|
||||||
void AddHoldScore( HoldNoteScore hns );
|
void AddHoldScore( HoldNoteScore hns );
|
||||||
|
void HandleHoldActiveSeconds( float fMusicSecondsHeld );
|
||||||
virtual void AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow );
|
virtual void AddTapRowScore( TapNoteScore score, const NoteData &nd, int iRow );
|
||||||
|
protected:
|
||||||
|
float m_fMusicSecondsHeldRemainder; // seconds from a hold note that have not yet been counted toward CurScore
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
void HandleTapScore( const TapNote &tn );
|
void HandleTapScore( const TapNote &tn );
|
||||||
void HandleTapRowScore( const NoteData &nd, int iRow );
|
void HandleTapRowScore( const NoteData &nd, int iRow );
|
||||||
void HandleHoldScore( const TapNote &tn );
|
void HandleHoldScore( const TapNote &tn );
|
||||||
|
void HandleHoldActiveSeconds( float fMusicSecondsHeld ) {};
|
||||||
|
|
||||||
// This must be calculated using only cached radar values so that we can
|
// This must be calculated using only cached radar values so that we can
|
||||||
// do it quickly.
|
// do it quickly.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
void HandleTapScore( const TapNote &tn );
|
void HandleTapScore( const TapNote &tn );
|
||||||
void HandleTapRowScore( const NoteData &nd, int iRow );
|
void HandleTapRowScore( const NoteData &nd, int iRow );
|
||||||
void HandleHoldScore( const TapNote &tn );
|
void HandleHoldScore( const TapNote &tn );
|
||||||
|
void HandleHoldActiveSeconds( float fMusicSecondsHeld ) {}
|
||||||
void HandleTapScoreNone();
|
void HandleTapScoreNone();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user