attempting to clean up Player::Step. This just shifts the stuff to
ScreenGameplay::Update, but at least it keeps this logic out of Player ...
This commit is contained in:
@@ -152,7 +152,7 @@ void Player::Init(
|
|||||||
|
|
||||||
void Player::Load( const NoteData& noteData )
|
void Player::Load( const NoteData& noteData )
|
||||||
{
|
{
|
||||||
m_iDCState = AS2D_IDLE;
|
m_LastTapNoteScore = TNS_NONE;
|
||||||
|
|
||||||
m_iRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this?
|
m_iRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this?
|
||||||
m_iMineRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this?
|
m_iMineRowLastCrossed = BeatToNoteRowNotRounded( GAMESTATE->m_fSongBeat ) - 1; // why this?
|
||||||
@@ -911,16 +911,7 @@ void Player::Step( int col, const RageTimer &tm )
|
|||||||
OnRowCompletelyJudged( iIndexOverlappingNote );
|
OnRowCompletelyJudged( iIndexOverlappingNote );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( score == TNS_MISS || score == TNS_BOO )
|
m_LastTapNoteScore = score;
|
||||||
m_iDCState = AS2D_MISS;
|
|
||||||
else if( score == TNS_GOOD || score == TNS_GREAT )
|
|
||||||
m_iDCState = AS2D_GOOD;
|
|
||||||
else if( score == TNS_PERFECT || score == TNS_MARVELOUS )
|
|
||||||
{
|
|
||||||
m_iDCState = AS2D_GREAT;
|
|
||||||
if( m_pLifeMeter && m_pLifeMeter->GetLife() == 1.0f) // full life
|
|
||||||
m_iDCState = AS2D_FEVER; // super celebrate time :)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_pNoteField )
|
if( m_pNoteField )
|
||||||
@@ -1205,7 +1196,7 @@ void Player::HandleTapRowScore( unsigned row )
|
|||||||
|
|
||||||
case TNS_MISS:
|
case TNS_MISS:
|
||||||
++iCurMissCombo;
|
++iCurMissCombo;
|
||||||
m_iDCState = AS2D_MISS; // update dancing 2d characters that may have missed a note
|
m_LastTapNoteScore = TNS_MISS;
|
||||||
|
|
||||||
case TNS_GOOD:
|
case TNS_GOOD:
|
||||||
case TNS_BOO:
|
case TNS_BOO:
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ public:
|
|||||||
void Step( int col, const RageTimer &tm );
|
void Step( int col, const RageTimer &tm );
|
||||||
void RandomizeNotes( int iNoteRow );
|
void RandomizeNotes( int iNoteRow );
|
||||||
void FadeToFail();
|
void FadeToFail();
|
||||||
int GetDancingCharacterState() const { return m_iDCState; };
|
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
|
||||||
void SetCharacterState(int iDCState) { m_iDCState = iDCState; };
|
|
||||||
void ApplyWaitingTransforms();
|
void ApplyWaitingTransforms();
|
||||||
|
|
||||||
static float GetMaxStepDistanceSeconds();
|
static float GetMaxStepDistanceSeconds();
|
||||||
@@ -87,7 +86,7 @@ protected:
|
|||||||
|
|
||||||
AttackDisplay m_AttackDisplay;
|
AttackDisplay m_AttackDisplay;
|
||||||
|
|
||||||
int m_iDCState;
|
TapNoteScore m_LastTapNoteScore;
|
||||||
LifeMeter* m_pLifeMeter;
|
LifeMeter* m_pLifeMeter;
|
||||||
CombinedLifeMeter* m_pCombinedLifeMeter;
|
CombinedLifeMeter* m_pCombinedLifeMeter;
|
||||||
ScoreDisplay* m_pScoreDisplay;
|
ScoreDisplay* m_pScoreDisplay;
|
||||||
|
|||||||
@@ -1458,7 +1458,27 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
DancingCharacters *pCharacter = m_Background.GetDancingCharacters();
|
DancingCharacters *pCharacter = m_Background.GetDancingCharacters();
|
||||||
if( pCharacter != NULL )
|
if( pCharacter != NULL )
|
||||||
pCharacter->Change2DAnimState( p, m_Player[p].GetDancingCharacterState() );
|
{
|
||||||
|
TapNoteScore tns = m_Player[p].GetLastTapNoteScore();
|
||||||
|
|
||||||
|
ANIM_STATES_2D StateMap[NUM_TAP_NOTE_SCORES] =
|
||||||
|
{
|
||||||
|
AS2D_MISS, /* TNS_NONE (shouldn't happen) */
|
||||||
|
AS2D_MISS, /* TNS_HIT_MINE (shouldn't happen) */
|
||||||
|
AS2D_MISS, /* TNS_MISS */
|
||||||
|
AS2D_MISS, /* TNS_BOO */
|
||||||
|
AS2D_GOOD, /* TNS_GOOD */
|
||||||
|
AS2D_GOOD, /* TNS_GREAT */
|
||||||
|
AS2D_GREAT, /* TNS_PERFECT */
|
||||||
|
AS2D_GREAT /* TNS_MARVELOUS */
|
||||||
|
};
|
||||||
|
|
||||||
|
ANIM_STATES_2D state = StateMap[tns];
|
||||||
|
if( state == AS2D_GREAT && m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
|
||||||
|
state = AS2D_FEVER;
|
||||||
|
|
||||||
|
pCharacter->Change2DAnimState( p, state );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user