CoinMode_Pay->CoinMode_Free, step 1.
CoinMode_Pay is still a value for the CoinMode enum but is now the same as CoinMode_Free. Any code that checks for CoinMode_Pay is gone.
This commit is contained in:
@@ -493,50 +493,6 @@ bool GameCommand::IsPlayable( RString *why ) const
|
|||||||
|
|
||||||
if ( m_pStyle )
|
if ( m_pStyle )
|
||||||
{
|
{
|
||||||
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
|
||||||
const int iNumCreditsPaid = GetNumCreditsPaid();
|
|
||||||
const int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
|
|
||||||
|
|
||||||
switch( GAMESTATE->GetCoinMode() )
|
|
||||||
{
|
|
||||||
case CoinMode_Home:
|
|
||||||
case CoinMode_Free:
|
|
||||||
iCredits = NUM_PLAYERS; // not iNumCreditsPaid
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* With PREFSMAN->m_bDelayedCreditsReconcile disabled, enough credits must
|
|
||||||
* be paid. (This means that enough sides must be joined.) Enabled, simply
|
|
||||||
* having enough credits lying in the machine is sufficient; we'll deduct the
|
|
||||||
* extra in Apply(). */
|
|
||||||
int iNumCreditsAvailable = iNumCreditsPaid;
|
|
||||||
if( PREFSMAN->m_bDelayedCreditsReconcile )
|
|
||||||
iNumCreditsAvailable += iCredits;
|
|
||||||
|
|
||||||
if( iNumCreditsAvailable < iNumCreditsRequired )
|
|
||||||
{
|
|
||||||
if( why )
|
|
||||||
*why = ssprintf( "need %i credits, have %i", iNumCreditsRequired, iNumCreditsAvailable );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If you've paid too much already, don't allow the mode. (If we allow this,
|
|
||||||
* the credits will be "refunded" in Apply(), but that's confusing.) */
|
|
||||||
/* Do allow the mode if they've already joined in more credits than
|
|
||||||
* are required. Otherwise, people who put in two credits to play
|
|
||||||
* doubles on a doubles-premium machiune will get locked out.
|
|
||||||
* the refund logic isn't that awkward because you never see the
|
|
||||||
* credits number jump up - the credits display is hidden if both
|
|
||||||
* sides are joined. -Chris */
|
|
||||||
/*
|
|
||||||
if( PREFSMAN->m_iCoinMode == COIN_PAY && iNumCreditsPaid > iNumCreditsRequired )
|
|
||||||
{
|
|
||||||
if( why )
|
|
||||||
*why = ssprintf( "too many credits paid (%i > %i)", iNumCreditsPaid, iNumCreditsRequired );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* If both sides are joined, disallow singles modes, since easy to select
|
/* If both sides are joined, disallow singles modes, since easy to select
|
||||||
* them accidentally, instead of versus mode. */
|
* them accidentally, instead of versus mode. */
|
||||||
if( m_pStyle->m_StyleType == StyleType_OnePlayerOneSide &&
|
if( m_pStyle->m_StyleType == StyleType_OnePlayerOneSide &&
|
||||||
@@ -662,19 +618,6 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
|
|||||||
{
|
{
|
||||||
GAMESTATE->SetCurrentStyle( m_pStyle );
|
GAMESTATE->SetCurrentStyle( m_pStyle );
|
||||||
|
|
||||||
// It's possible to choose a style that didn't have enough players joined.
|
|
||||||
// If enough players aren't joined, then we need to subtract credits
|
|
||||||
// for the sides that will be joined as a result of applying this option.
|
|
||||||
if( GAMESTATE->GetCoinMode() == CoinMode_Pay )
|
|
||||||
{
|
|
||||||
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
|
|
||||||
int iNumCreditsPaid = GetNumCreditsPaid();
|
|
||||||
int iNumCreditsOwed = iNumCreditsRequired - iNumCreditsPaid;
|
|
||||||
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins - iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit );
|
|
||||||
LOG->Trace( "Deducted %i coins, %i remaining",
|
|
||||||
iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit, GAMESTATE->m_iCoins.Get() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// If only one side is joined and we picked a style that requires both
|
// If only one side is joined and we picked a style that requires both
|
||||||
// sides, join the other side.
|
// sides, join the other side.
|
||||||
switch( m_pStyle->m_StyleType )
|
switch( m_pStyle->m_StyleType )
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ LuaXType( StageResult );
|
|||||||
|
|
||||||
static const char *CoinModeNames[] = {
|
static const char *CoinModeNames[] = {
|
||||||
"Home",
|
"Home",
|
||||||
"Pay",
|
|
||||||
"Free",
|
"Free",
|
||||||
};
|
};
|
||||||
XToString( CoinMode );
|
XToString( CoinMode );
|
||||||
|
|||||||
@@ -432,8 +432,8 @@ const int ITEM_NONE = -1;
|
|||||||
enum CoinMode
|
enum CoinMode
|
||||||
{
|
{
|
||||||
CoinMode_Home, /**< The full range of options are available. */
|
CoinMode_Home, /**< The full range of options are available. */
|
||||||
CoinMode_Pay, /**< Coins must be inserted before a game can begin. */
|
CoinMode_Free, /**< Players cannot access the options menu. */
|
||||||
CoinMode_Free, /**< It costs no money to play, but otherwise is similar to Pay mode. */
|
CoinMode_Pay = 1, /**< For backwards compatibility only. Identical to CoinMode_Free. */
|
||||||
NUM_CoinMode,
|
NUM_CoinMode,
|
||||||
CoinMode_Invalid
|
CoinMode_Invalid
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-22
@@ -361,13 +361,7 @@ void GameState::Reset()
|
|||||||
|
|
||||||
void GameState::JoinPlayer( PlayerNumber pn )
|
void GameState::JoinPlayer( PlayerNumber pn )
|
||||||
{
|
{
|
||||||
/* If joint premium and we're not taking away a credit for the 2nd join,
|
m_iPlayerStageTokens[pn] = PREFSMAN->m_iSongsPerPlay;
|
||||||
* give the new player the same number of stage tokens that the old player
|
|
||||||
* has. */
|
|
||||||
if( GetCoinMode() == CoinMode_Pay && GetPremium() == Premium_2PlayersFor1Credit && GetNumSidesJoined() == 1 )
|
|
||||||
m_iPlayerStageTokens[pn] = m_iPlayerStageTokens[this->GetMasterPlayerNumber()];
|
|
||||||
else
|
|
||||||
m_iPlayerStageTokens[pn] = PREFSMAN->m_iSongsPerPlay;
|
|
||||||
|
|
||||||
m_bSideIsJoined[pn] = true;
|
m_bSideIsJoined[pn] = true;
|
||||||
|
|
||||||
@@ -489,17 +483,7 @@ bool GameState::JoinPlayers()
|
|||||||
|
|
||||||
int GameState::GetCoinsNeededToJoin() const
|
int GameState::GetCoinsNeededToJoin() const
|
||||||
{
|
{
|
||||||
int iCoinsToCharge = 0;
|
return 0;
|
||||||
|
|
||||||
if( GetCoinMode() == CoinMode_Pay )
|
|
||||||
iCoinsToCharge = PREFSMAN->m_iCoinsPerCredit;
|
|
||||||
|
|
||||||
// If joint premium, don't take away a credit for the second join.
|
|
||||||
if( GetPremium() == Premium_2PlayersFor1Credit &&
|
|
||||||
GetNumSidesJoined() == 1 )
|
|
||||||
iCoinsToCharge = 0;
|
|
||||||
|
|
||||||
return iCoinsToCharge;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Game flow:
|
/* Game flow:
|
||||||
@@ -2055,10 +2039,7 @@ bool GameState::IsEventMode() const
|
|||||||
|
|
||||||
CoinMode GameState::GetCoinMode() const
|
CoinMode GameState::GetCoinMode() const
|
||||||
{
|
{
|
||||||
if( IsEventMode() && GamePreferences::m_CoinMode == CoinMode_Pay )
|
return GamePreferences::m_CoinMode;
|
||||||
return CoinMode_Free;
|
|
||||||
else
|
|
||||||
return GamePreferences::m_CoinMode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeMetric<bool> DISABLE_PREMIUM_IN_EVENT_MODE("GameState","DisablePremiumInEventMode");
|
ThemeMetric<bool> DISABLE_PREMIUM_IN_EVENT_MODE("GameState","DisablePremiumInEventMode");
|
||||||
|
|||||||
@@ -85,14 +85,6 @@ bool ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
|
|||||||
case GAME_BUTTON_COIN:
|
case GAME_BUTTON_COIN:
|
||||||
switch( GAMESTATE->GetCoinMode() )
|
switch( GAMESTATE->GetCoinMode() )
|
||||||
{
|
{
|
||||||
case CoinMode_Pay:
|
|
||||||
LOG->Trace("ScreenAttract::AttractInput: COIN_PAY (%i/%i, %i)",
|
|
||||||
GAMESTATE->m_iCoins.Get(),
|
|
||||||
PREFSMAN->m_iCoinsPerCredit.Get(),
|
|
||||||
GAMESTATE->GetNumSidesJoined() );
|
|
||||||
if( GAMESTATE->m_iCoins < PREFSMAN->m_iCoinsPerCredit && GAMESTATE->GetNumSidesJoined() == 0 )
|
|
||||||
return true;
|
|
||||||
// fall through
|
|
||||||
case CoinMode_Home:
|
case CoinMode_Home:
|
||||||
case CoinMode_Free:
|
case CoinMode_Free:
|
||||||
if( pScreen->IsTransitioning() )
|
if( pScreen->IsTransitioning() )
|
||||||
|
|||||||
@@ -714,8 +714,8 @@ static void InitializeConfOptions()
|
|||||||
|
|
||||||
// Machine options
|
// Machine options
|
||||||
ADD( ConfOption( "MenuTimer", MovePref<bool>, "Off","On" ) );
|
ADD( ConfOption( "MenuTimer", MovePref<bool>, "Off","On" ) );
|
||||||
ADD( ConfOption( "CoinMode", MovePref<CoinMode>, "Home","Pay","Free Play" ) );
|
ADD( ConfOption( "CoinMode", MovePref<CoinMode>, "Home","Free Play" ) );
|
||||||
ADD( ConfOption( "CoinModeNoHome", CoinModeNoHome, "Pay","Free Play" ) );
|
ADD( ConfOption( "CoinModeNoHome", CoinModeNoHome, "Free Play" ) );
|
||||||
g_ConfOptions.back().m_sPrefName = "CoinMode";
|
g_ConfOptions.back().m_sPrefName = "CoinMode";
|
||||||
|
|
||||||
ADD( ConfOption( "SongsPerPlay", SongsPerPlay, "|1","|2","|3","|4","|5" ) );
|
ADD( ConfOption( "SongsPerPlay", SongsPerPlay, "|1","|2","|3","|4","|5" ) );
|
||||||
|
|||||||
@@ -106,20 +106,6 @@ namespace
|
|||||||
else
|
else
|
||||||
return CREDITS_NOT_PRESENT.GetValue();
|
return CREDITS_NOT_PRESENT.GetValue();
|
||||||
|
|
||||||
case CoinMode_Pay:
|
|
||||||
{
|
|
||||||
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
|
||||||
int iCoins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
|
|
||||||
RString sCredits = CREDITS_CREDITS;
|
|
||||||
// todo: allow themers to change these strings -aj
|
|
||||||
if( iCredits > 0 || PREFSMAN->m_iCoinsPerCredit == 1 )
|
|
||||||
sCredits += ssprintf(" %d", iCredits);
|
|
||||||
if( PREFSMAN->m_iCoinsPerCredit > 1 )
|
|
||||||
sCredits += ssprintf(" %d/%d", iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
|
||||||
if( iCredits >= MAX_NUM_CREDITS )
|
|
||||||
sCredits += " " + CREDITS_MAX.GetValue();
|
|
||||||
return sCredits;
|
|
||||||
}
|
|
||||||
case CoinMode_Free:
|
case CoinMode_Free:
|
||||||
if( GAMESTATE->PlayersCanJoin() )
|
if( GAMESTATE->PlayersCanJoin() )
|
||||||
return CREDITS_FREE_PLAY.GetValue();
|
return CREDITS_FREE_PLAY.GetValue();
|
||||||
|
|||||||
@@ -135,13 +135,6 @@ void ScreenWithMenuElements::BeginScreen()
|
|||||||
/* Evaluate FirstUpdateCommand. */
|
/* Evaluate FirstUpdateCommand. */
|
||||||
this->PlayCommand( "FirstUpdate" );
|
this->PlayCommand( "FirstUpdate" );
|
||||||
|
|
||||||
/* If AutoJoin and a player is already joined, then try to join a player. (If no players
|
|
||||||
* are joined, they'll join on the first JoinInput.) */
|
|
||||||
if( GAMESTATE->GetCoinMode() == CoinMode_Pay && GAMESTATE->m_bAutoJoin.Get() )
|
|
||||||
{
|
|
||||||
if( GAMESTATE->GetNumSidesJoined() > 0 && GAMESTATE->JoinPlayers() )
|
|
||||||
SCREENMAN->PlayStartSound();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenWithMenuElements::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenWithMenuElements::HandleScreenMessage( const ScreenMessage SM )
|
||||||
|
|||||||
Reference in New Issue
Block a user