new battle layout
This commit is contained in:
+15
-31
@@ -122,33 +122,6 @@ void GameState::Update( float fDelta )
|
||||
|
||||
if( m_bActiveAttackEndedThisUpdate[p] )
|
||||
RebuildPlayerOptionsFromActiveAttacks( (PlayerNumber)p );
|
||||
|
||||
/* if( m_PlayerOptions[p].m_bUseScrollBPM && m_pCurSong )
|
||||
{
|
||||
float fTargetBPM = m_PlayerOptions[p].m_fScrollBPM;
|
||||
float fConstBPS = fTargetBPM/60.f;
|
||||
|
||||
// Optimization opportunity: take fewer samples where the weight is less
|
||||
|
||||
const int iNumBPSSamples = 100;
|
||||
const float fSampleStep = 0.08f; // sample over the next 8 beats
|
||||
float fSumBPS = 0;
|
||||
int iSumWeight = 0;
|
||||
for( int i=0; i<iNumBPSSamples; i++ )
|
||||
{
|
||||
int iWeight = iNumBPSSamples - i;
|
||||
float fBeatsAheadToSample = i*fSampleStep;
|
||||
float fBPS = m_pCurSong->GetBPMAtBeat( m_fSongBeat+fBeatsAheadToSample )/60.f;
|
||||
// Don't allow super low bps values, or else the scroll speed goes crazy at a stop
|
||||
CLAMP( fBPS, 60.f/60.f, 10000 );
|
||||
fSumBPS += fBPS * iWeight;
|
||||
iSumWeight += iWeight;
|
||||
}
|
||||
float fAvgBPS = fSumBPS / iSumWeight;
|
||||
|
||||
m_PlayerOptions[p].m_fScrollSpeed = fConstBPS / fAvgBPS;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +143,8 @@ void GameState::ResetMusicStatistics()
|
||||
m_fCurBPS = 10;
|
||||
m_bFreeze = false;
|
||||
m_bPastHereWeGo = false;
|
||||
|
||||
m_fOpponentHealthPercent = 1;
|
||||
}
|
||||
|
||||
void GameState::UpdateSongPosition(float fPositionSeconds)
|
||||
@@ -376,10 +351,18 @@ PlayerNumber GameState::GetWinner()
|
||||
|
||||
BattleResult GameState::GetBattleResult( PlayerNumber pn )
|
||||
{
|
||||
PlayerNumber winner = GetWinner();
|
||||
if( winner == PLAYER_INVALID )
|
||||
return RESULT_DRAW;
|
||||
return (winner==pn) ? RESULT_WIN : RESULT_LOSE;
|
||||
// PlayerNumber winner = GetWinner();
|
||||
// if( winner == PLAYER_INVALID )
|
||||
// return RESULT_DRAW;
|
||||
// return (winner==pn) ? RESULT_WIN : RESULT_LOSE;
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_BATTLE:
|
||||
return (m_fOpponentHealthPercent==0)?RESULT_WIN:RESULT_LOSE;
|
||||
default:
|
||||
ASSERT(0);
|
||||
return RESULT_WIN;
|
||||
}
|
||||
}
|
||||
|
||||
void GameState::GetFinalEvalStatsAndSongs( StageStats& statsOut, vector<Song*>& vSongsOut )
|
||||
@@ -446,6 +429,7 @@ void GameState::LaunchAttack( PlayerNumber target, Attack a )
|
||||
if( m_ActiveAttacks[target][s].fSecsRemaining <= 0 )
|
||||
{
|
||||
m_ActiveAttacks[target][s] = a;
|
||||
GAMESTATE->RebuildPlayerOptionsFromActiveAttacks( target );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user