cap at 20 credits for locations with time cards so that players can't load the machine up with an unlimited number of credits
This commit is contained in:
@@ -1396,6 +1396,7 @@ CreditsCardRemoved=CARD GONE
|
|||||||
CreditsCardTestFailed=CARD WRITE ERROR
|
CreditsCardTestFailed=CARD WRITE ERROR
|
||||||
CreditsCardTooLate=CARD TOO LATE
|
CreditsCardTooLate=CARD TOO LATE
|
||||||
CreditsCredits=CREDIT(S)
|
CreditsCredits=CREDIT(S)
|
||||||
|
CreditsMax=(MAX)
|
||||||
CreditsFreePlay=FREE PLAY
|
CreditsFreePlay=FREE PLAY
|
||||||
CreditsInsertCard=INSERT CARD
|
CreditsInsertCard=INSERT CARD
|
||||||
CreditsLoadFailed=SIGNATURE FAILED
|
CreditsLoadFailed=SIGNATURE FAILED
|
||||||
|
|||||||
@@ -13,6 +13,11 @@
|
|||||||
const int MAX_METER = 13;
|
const int MAX_METER = 13;
|
||||||
const int MIN_METER = 1;
|
const int MIN_METER = 1;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Credits
|
||||||
|
//
|
||||||
|
const int MAX_NUM_CREDITS = 20;
|
||||||
|
|
||||||
|
|
||||||
/* This is just cached song data. Not all of it may actually be displayed
|
/* This is just cached song data. Not all of it may actually be displayed
|
||||||
* in the radar. */
|
* in the radar. */
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace
|
|||||||
LocalizedString CREDITS_CARD_REMOVED("ScreenSystemLayer","CreditsCardRemoved");
|
LocalizedString CREDITS_CARD_REMOVED("ScreenSystemLayer","CreditsCardRemoved");
|
||||||
LocalizedString CREDITS_FREE_PLAY("ScreenSystemLayer","CreditsFreePlay");
|
LocalizedString CREDITS_FREE_PLAY("ScreenSystemLayer","CreditsFreePlay");
|
||||||
LocalizedString CREDITS_CREDITS("ScreenSystemLayer","CreditsCredits");
|
LocalizedString CREDITS_CREDITS("ScreenSystemLayer","CreditsCredits");
|
||||||
|
LocalizedString CREDITS_MAX("ScreenSystemLayer","CreditsMax");
|
||||||
LocalizedString CREDITS_NOT_PRESENT("ScreenSystemLayer","CreditsNotPresent");
|
LocalizedString CREDITS_NOT_PRESENT("ScreenSystemLayer","CreditsNotPresent");
|
||||||
LocalizedString CREDITS_LOAD_FAILED("ScreenSystemLayer","CreditsLoadFailed");
|
LocalizedString CREDITS_LOAD_FAILED("ScreenSystemLayer","CreditsLoadFailed");
|
||||||
LocalizedString CREDITS_LOADED_FROM_LAST_GOOD_APPEND("ScreenSystemLayer","CreditsLoadedFromLastGoodAppend");
|
LocalizedString CREDITS_LOADED_FROM_LAST_GOOD_APPEND("ScreenSystemLayer","CreditsLoadedFromLastGoodAppend");
|
||||||
@@ -49,6 +50,7 @@ namespace
|
|||||||
const Profile* pProfile = PROFILEMAN->GetProfile( pn );
|
const Profile* pProfile = PROFILEMAN->GetProfile( pn );
|
||||||
switch( mcs )
|
switch( mcs )
|
||||||
{
|
{
|
||||||
|
DEFAULT_FAIL( mcs );
|
||||||
case MemoryCardState_NoCard:
|
case MemoryCardState_NoCard:
|
||||||
// this is a local machine profile
|
// this is a local machine profile
|
||||||
if( PROFILEMAN->LastLoadWasFromLastGood(pn) )
|
if( PROFILEMAN->LastLoadWasFromLastGood(pn) )
|
||||||
@@ -90,8 +92,6 @@ namespace
|
|||||||
else
|
else
|
||||||
return CREDITS_CARD_NO_NAME.GetValue();
|
return CREDITS_CARD_NO_NAME.GetValue();
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
FAIL_M( ssprintf("%i",mcs) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // bShowCreditsMessage
|
else // bShowCreditsMessage
|
||||||
@@ -106,13 +106,15 @@ namespace
|
|||||||
|
|
||||||
case CoinMode_Pay:
|
case CoinMode_Pay:
|
||||||
{
|
{
|
||||||
int Credits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
||||||
int Coins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
|
int iCoins = GAMESTATE->m_iCoins % PREFSMAN->m_iCoinsPerCredit;
|
||||||
RString sCredits = CREDITS_CREDITS;
|
RString sCredits = CREDITS_CREDITS;
|
||||||
if( Credits > 0 || PREFSMAN->m_iCoinsPerCredit == 1 )
|
if( iCredits > 0 || PREFSMAN->m_iCoinsPerCredit == 1 )
|
||||||
sCredits += ssprintf(" %d", Credits);
|
sCredits += ssprintf(" %d", iCredits);
|
||||||
if( PREFSMAN->m_iCoinsPerCredit > 1 )
|
if( PREFSMAN->m_iCoinsPerCredit > 1 )
|
||||||
sCredits += ssprintf(" %d/%d", Coins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
sCredits += ssprintf(" %d/%d", iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||||
|
if( iCredits >= MAX_NUM_CREDITS )
|
||||||
|
sCredits += " " + CREDITS_MAX.GetValue();
|
||||||
return sCredits;
|
return sCredits;
|
||||||
}
|
}
|
||||||
case CoinMode_Free:
|
case CoinMode_Free:
|
||||||
|
|||||||
@@ -1187,12 +1187,25 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
|
|||||||
LIGHTSMAN->PulseCoinCounter();
|
LIGHTSMAN->PulseCoinCounter();
|
||||||
BOOKKEEPER->CoinInserted();
|
BOOKKEEPER->CoinInserted();
|
||||||
}
|
}
|
||||||
|
int iNumCoinsOld = GAMESTATE->m_iCoins;
|
||||||
GAMESTATE->m_iCoins += iNum;
|
GAMESTATE->m_iCoins += iNum;
|
||||||
|
|
||||||
|
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
||||||
|
bool bMaxCredits = iCredits >= MAX_NUM_CREDITS;
|
||||||
|
if( bMaxCredits )
|
||||||
|
GAMESTATE->m_iCoins = MAX_NUM_CREDITS * PREFSMAN->m_iCoinsPerCredit;
|
||||||
|
|
||||||
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins, PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||||
SCREENMAN->PlayCoinSound();
|
if( iNumCoinsOld != GAMESTATE->m_iCoins )
|
||||||
|
SCREENMAN->PlayCoinSound();
|
||||||
|
else
|
||||||
|
SCREENMAN->PlayInvalidSound();
|
||||||
|
|
||||||
Message msg( "CoinInserted" );
|
Message msg( "CoinInserted" );
|
||||||
msg.SetParam( "Coins", GAMESTATE->m_iCoins );
|
// below params are unused
|
||||||
msg.SetParam( "Inserted", iNum );
|
//msg.SetParam( "Coins", GAMESTATE->m_iCoins );
|
||||||
|
//msg.SetParam( "Inserted", iNum );
|
||||||
|
//msg.SetParam( "MaxCredits", bMaxCredits );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1207,8 +1220,9 @@ void StepMania::ClearCredits()
|
|||||||
GAMESTATE->m_iCoins = 0;
|
GAMESTATE->m_iCoins = 0;
|
||||||
SCREENMAN->PlayInvalidSound();
|
SCREENMAN->PlayInvalidSound();
|
||||||
Message msg( "CoinInserted" );
|
Message msg( "CoinInserted" );
|
||||||
msg.SetParam( "Coins", GAMESTATE->m_iCoins );
|
// below params are unused
|
||||||
msg.SetParam( "Clear", true );
|
//msg.SetParam( "Coins", GAMESTATE->m_iCoins );
|
||||||
|
//msg.SetParam( "Clear", true );
|
||||||
MESSAGEMAN->Broadcast( msg );
|
MESSAGEMAN->Broadcast( msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user