Stage refactoring:

- m_iPlayerCurrentStageIndexForCurrentCredit is changed to m_iPlayerStageTokens,
   counting the number of stages left.  This can be incremented and decremented
   (as a bonus or penalty) with no weird side-effects; it is not used to determine
   whether the player is on an extra stage.  This is less brittle; it eliminates
   special cases to avoid incrementing the counter and skipping into an extra stage.
 - Stage tokens are subtracted for each song played, and a player is unjoined
   when he runs out.
 - Stage tokens are subtracted at the start of gameplay.  If the player cancels,
   they're "refunded".  This differs from before, where the stage was incremented
   at the end of gameplay.  This makes the stage token counter meaningful during
   gameplay; if this is done at the end, then it would be too high during gameplay.
 - IsFinalStage is gone.  If needed, use GetSmallestNumStagesLeftForAnyHumanPlayer.
 - Extra stages are awarded by adding a stage token and incrementing
   m_iAwardedExtraStages.  If m_iAwardedExtraStages is 1, the player is
   on his first extra stage; if 2, his second.
This commit is contained in:
Glenn Maynard
2007-04-25 03:50:17 +00:00
parent c5dd045f8a
commit 713c95b2b0
8 changed files with 49 additions and 73 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ void ScreenGameplayLesson::Init()
// Reset stage number (not relevant in lessons)
GAMESTATE->m_iCurrentStageIndex = 0;
FOREACH_ENUM( PlayerNumber, p )
GAMESTATE->m_iPlayerCurrentStageIndexForCurrentCredit[p] = 0;
GAMESTATE->m_iPlayerStageTokens[p] = 1;
// Autoplay during demonstration
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )