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 )
|
||||
{
|
||||
m_iDCState = AS2D_IDLE;
|
||||
m_LastTapNoteScore = TNS_NONE;
|
||||
|
||||
m_iRowLastCrossed = 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 );
|
||||
}
|
||||
|
||||
if( score == TNS_MISS || score == TNS_BOO )
|
||||
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 :)
|
||||
}
|
||||
m_LastTapNoteScore = score;
|
||||
}
|
||||
|
||||
if( m_pNoteField )
|
||||
@@ -1205,8 +1196,8 @@ void Player::HandleTapRowScore( unsigned row )
|
||||
|
||||
case TNS_MISS:
|
||||
++iCurMissCombo;
|
||||
m_iDCState = AS2D_MISS; // update dancing 2d characters that may have missed a note
|
||||
|
||||
m_LastTapNoteScore = TNS_MISS;
|
||||
|
||||
case TNS_GOOD:
|
||||
case TNS_BOO:
|
||||
if( iCurCombo > 50 )
|
||||
|
||||
@@ -48,8 +48,7 @@ public:
|
||||
void Step( int col, const RageTimer &tm );
|
||||
void RandomizeNotes( int iNoteRow );
|
||||
void FadeToFail();
|
||||
int GetDancingCharacterState() const { return m_iDCState; };
|
||||
void SetCharacterState(int iDCState) { m_iDCState = iDCState; };
|
||||
TapNoteScore GetLastTapNoteScore() const { return m_LastTapNoteScore; }
|
||||
void ApplyWaitingTransforms();
|
||||
|
||||
static float GetMaxStepDistanceSeconds();
|
||||
@@ -87,7 +86,7 @@ protected:
|
||||
|
||||
AttackDisplay m_AttackDisplay;
|
||||
|
||||
int m_iDCState;
|
||||
TapNoteScore m_LastTapNoteScore;
|
||||
LifeMeter* m_pLifeMeter;
|
||||
CombinedLifeMeter* m_pCombinedLifeMeter;
|
||||
ScoreDisplay* m_pScoreDisplay;
|
||||
|
||||
@@ -1458,7 +1458,27 @@ void ScreenGameplay::Update( float fDeltaTime )
|
||||
{
|
||||
DancingCharacters *pCharacter = m_Background.GetDancingCharacters();
|
||||
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