ScoreKeeperNormal double shot.

1) convert toasty trigger from a single number to a Lua table. Only problem is, the toasty only triggers on the first one. Since this makes it equivalent to how it was set up before, I'm okay with this.
2) FSX submitted a patch that supposedly fixes the broken combo problem. I can't fully test this, so I'm committing it in the hopes that someone else tests it too.
----
Various theme fixes/changes as well.
This commit is contained in:
AJ Kelly
2010-03-14 19:24:17 -05:00
parent 04317c14ae
commit 5ef1c42e3b
8 changed files with 105 additions and 60 deletions
+1 -1
View File
@@ -1550,7 +1550,7 @@ Error adding file '%s'.=Error adding file '%s'.
Loading courses...=Loading courses... Loading courses...=Loading courses...
Loading songs...=Loading songs... Loading songs...=Loading songs...
Reloading...=Reloading... Reloading...=Reloading...
The folder "%s" appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song".=The folder "%s"appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song" will contain the music file (MP3, OGG...), the steps file (.sm, .dwi, .ksf...) and other related files. The folder "%s" appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song".=The folder "%s" appears to be a song folder. All song folders must reside in a group folder. For example, "Songs/Originals/My Song" will contain the music file (MP3, OGG...), the steps file (.sm, .dwi, .ksf...) and other related files.
[SongUtil] [SongUtil]
You must supply a name for your new edit.=You must supply a name for your new edit. You must supply a name for your new edit.=You must supply a name for your new edit.
+3 -3
View File
@@ -352,7 +352,7 @@ ComboIsPerRow=ComboPerRow()
MinScoreToContinueCombo=ComboContinue() MinScoreToContinueCombo=ComboContinue()
MinScoreToMaintainCombo=ComboMaintain() MinScoreToMaintainCombo=ComboMaintain()
# When you hit it, you know. # When you hit it, you know.
ToastyTriggersAt=250 ToastyTriggersAt={ 250 }
[GameState] [GameState]
# Default song and sort. these don't really matter # Default song and sort. these don't really matter
@@ -725,9 +725,9 @@ Fallback="MusicWheel"
# #
ModeMenuChoiceNames="AllCourses,Nonstop,Oni,Endless,Survival" ModeMenuChoiceNames="AllCourses,Nonstop,Oni,Endless,Survival"
# xxx: force nonstop on all courses? sounds lame but meh # xxx: force nonstop on all courses? sounds lame but meh
ChoiceAllCourses="sort,AllCourses;playmode,nonstop;;mod,bar" ChoiceAllCourses="sort,AllCourses;playmode,nonstop;mod,bar"
ChoiceNonstop="sort,Nonstop;playmode,nonstop;mod,bar" ChoiceNonstop="sort,Nonstop;playmode,nonstop;mod,bar"
ChoiceOni="sort,Oni;playmode,oni;mod,bar" ChoiceOni="sort,Oni;playmode,oni;mod,battery"
ChoiceEndless="sort,Endless;playmode,endless;mod,bar" ChoiceEndless="sort,Endless;playmode,endless;mod,bar"
ChoiceSurvival="sort,Oni;playmode,oni;mod,lifetime" ChoiceSurvival="sort,Oni;playmode,oni;mod,lifetime"
[MusicWheelItem] [MusicWheelItem]
@@ -8,7 +8,7 @@ end --]]
local t = Def.ActorFrame { local t = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
}; };
for indx=1,iTilesX do --[[ for indx=1,iTilesX do
for indy=1,iTilesY do for indy=1,iTilesY do
t[#t+1] = Def.Quad { t[#t+1] = Def.Quad {
InitCommand=cmd(zoom,fTileSize-2; InitCommand=cmd(zoom,fTileSize-2;
@@ -18,7 +18,7 @@ for indx=1,iTilesX do
OnCommand=cmd(diffuse,Color("Black");diffusealpha,1;zoom,fTileSize-2;sleep,(iTilesX+iTilesY)*(1/60);linear,0.0325 + ( indx / 60 );diffusealpha,0;zoom,fTileSize*1.25); OnCommand=cmd(diffuse,Color("Black");diffusealpha,1;zoom,fTileSize-2;sleep,(iTilesX+iTilesY)*(1/60);linear,0.0325 + ( indx / 60 );diffusealpha,0;zoom,fTileSize*1.25);
}; };
end end
end end --]]
t[#t+1] = Def.Quad { t[#t+1] = Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,1");sleep,0.0325 + ( ( iTilesX/2 ) / 60 );linear,0.15;diffusealpha,0); OnCommand=cmd(diffuse,color("0,0,0,1");sleep,0.0325 + ( ( iTilesX/2 ) / 60 );linear,0.15;diffusealpha,0);
@@ -8,7 +8,7 @@ end --]]
local t = Def.ActorFrame { local t = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y); InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
}; };
for indx=1,iTilesX do --[[ for indx=1,iTilesX do
for indy=1,iTilesY do for indy=1,iTilesY do
t[#t+1] = Def.Quad { t[#t+1] = Def.Quad {
InitCommand=cmd(zoom,fTileSize-2; InitCommand=cmd(zoom,fTileSize-2;
@@ -18,7 +18,7 @@ for indx=1,iTilesX do
OnCommand=cmd(diffuse,Color("Black");diffusealpha,0;zoom,fTileSize*1.25;linear,0.0325 + ( indx / 60 );diffusealpha,1;zoom,fTileSize-2); OnCommand=cmd(diffuse,Color("Black");diffusealpha,0;zoom,fTileSize*1.25;linear,0.0325 + ( indx / 60 );diffusealpha,1;zoom,fTileSize-2);
}; };
end end
end end --]]
t[#t+1] = Def.Quad { t[#t+1] = Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT); InitCommand=cmd(zoomto,SCREEN_WIDTH+1,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,0");sleep,0.0325 + ( ( iTilesX/2 ) / 60 );linear,0.15;diffusealpha,1); OnCommand=cmd(diffuse,color("0,0,0,0");sleep,0.0325 + ( ( iTilesX/2 ) / 60 );linear,0.15;diffusealpha,1);
+1 -1
View File
@@ -969,7 +969,7 @@ DifficultyListOffCommand=bouncebegin,0.15;zoomx,0;
DifficultyListShowCommand=stoptweening;bounceend,0.135;zoomx,1 DifficultyListShowCommand=stoptweening;bounceend,0.135;zoomx,1
DifficultyListHideCommand=stoptweening;bouncebegin,0.135;zoomx,0 DifficultyListHideCommand=stoptweening;bouncebegin,0.135;zoomx,0
# Shrink the difficultylist for viewing panedisplays; # Shrink the difficultylist for viewing panedisplays;
# DifficultyListSelectMenuOpenedMessageCommand=stoptweening;decelerate,0.125;zoom,0.5 # DifficultyListSelectMenuOpenedMessageCommand=stoptweening;decelerate,0.125;zoom,0.5;
# DifficultyListSelectMenuClosedMessageCommand=stoptweening;accelerate,0.0725;zoom,1; # DifficultyListSelectMenuClosedMessageCommand=stoptweening;accelerate,0.0725;zoom,1;
# #
ShowCourseContentsList=false ShowCourseContentsList=false
+85 -43
View File
@@ -15,6 +15,7 @@
#include "ProfileManager.h" #include "ProfileManager.h"
#include "NetworkSyncManager.h" #include "NetworkSyncManager.h"
#include "PlayerState.h" #include "PlayerState.h"
#include "Game.h"
#include "Style.h" #include "Style.h"
#include "Song.h" #include "Song.h"
#include "NoteDataWithScoring.h" #include "NoteDataWithScoring.h"
@@ -77,7 +78,7 @@ void ScoreKeeperNormal::Load(
ASSERT( apSongs.size() == apSteps.size() ); ASSERT( apSongs.size() == apSteps.size() );
ASSERT( apSongs.size() == asModifiers.size() ); ASSERT( apSongs.size() == asModifiers.size() );
/* True if a jump is one to combo, false if combo is purely based on tap count. */ // True if a jump is one to combo, false if combo is purely based on tap count.
m_ComboIsPerRow.Load( "Gameplay", "ComboIsPerRow" ); m_ComboIsPerRow.Load( "Gameplay", "ComboIsPerRow" );
m_MinScoreToContinueCombo.Load( "Gameplay", "MinScoreToContinueCombo" ); m_MinScoreToContinueCombo.Load( "Gameplay", "MinScoreToContinueCombo" );
m_MinScoreToMaintainCombo.Load( "Gameplay", "MinScoreToMaintainCombo" ); m_MinScoreToMaintainCombo.Load( "Gameplay", "MinScoreToMaintainCombo" );
@@ -85,9 +86,9 @@ void ScoreKeeperNormal::Load(
// Toasty triggers (ported from 3.9+) // Toasty triggers (ported from 3.9+)
// todo: Needs to be a table of ints to be properly implemented 1:1, // todo: Needs to be a table of ints to be properly implemented 1:1,
// though the original implementation was a comma separated string. // though the original implementation was a comma separated string.
// I prefer the new Lua method but it may be a pain to code; it's a // At this point, only one trigger seems to be playing, though the logic
// single int for now. // looks okay. -aj
m_ToastyTriggers.Load( "Gameplay", "ToastyTriggersAt" ); m_vToastyTriggers.Load( "Gameplay", "ToastyTriggersAt" );
// Custom Scoring // Custom Scoring
m_CustomComboMultiplier.Load( "CustomScoring", "ComboMultiplier" ); m_CustomComboMultiplier.Load( "CustomScoring", "ComboMultiplier" );
@@ -113,9 +114,7 @@ void ScoreKeeperNormal::Load(
m_TripleNoteMultiplier.Load( "CustomScoring", "TripleNoteScoreMultiplier" ); m_TripleNoteMultiplier.Load( "CustomScoring", "TripleNoteScoreMultiplier" );
m_QuadPlusNoteMultiplier.Load( "CustomScoring", "QuadOrHigherNoteScoreMultiplier" ); m_QuadPlusNoteMultiplier.Load( "CustomScoring", "QuadOrHigherNoteScoreMultiplier" );
//
// Fill in STATSMAN->m_CurStageStats, calculate multiplier // Fill in STATSMAN->m_CurStageStats, calculate multiplier
//
int iTotalPossibleDancePoints = 0; int iTotalPossibleDancePoints = 0;
int iTotalPossibleGradePoints = 0; int iTotalPossibleGradePoints = 0;
for( unsigned i=0; i<apSteps.size(); i++ ) for( unsigned i=0; i<apSteps.size(); i++ )
@@ -128,17 +127,16 @@ void ScoreKeeperNormal::Load(
NoteData ndTemp; NoteData ndTemp;
pSteps->GetNoteData( ndTemp ); pSteps->GetNoteData( ndTemp );
/* We might have been given lots of songs; don't keep them in memory uncompressed. */ // We might have been given lots of songs; don't keep them in memory uncompressed.
pSteps->Compress(); pSteps->Compress();
const Style* pStyle = GAMESTATE->GetCurrentStyle(); const Style* pStyle = GAMESTATE->GetCurrentStyle();
NoteData nd; NoteData nd;
pStyle->GetTransformedNoteDataForStyle( m_pPlayerState->m_PlayerNumber, ndTemp, nd ); pStyle->GetTransformedNoteDataForStyle( m_pPlayerState->m_PlayerNumber, ndTemp, nd );
/* Compute RadarValues before applying any user-selected mods. Apply /* Compute RadarValues before applying any user-selected mods. Apply
* Course mods and count them in the "pre" RadarValues because they're * Course mods and count them in the "pre" RadarValues because they're
* forced and not chosen by the user. * forced and not chosen by the user. */
*/
NoteDataUtil::TransformNoteData( nd, aa, pSteps->m_StepsType, pSong ); NoteDataUtil::TransformNoteData( nd, aa, pSteps->m_StepsType, pSong );
RadarValues rvPre; RadarValues rvPre;
NoteDataUtil::CalculateRadarValues( nd, pSong->m_fMusicLengthSeconds, rvPre ); NoteDataUtil::CalculateRadarValues( nd, pSong->m_fMusicLengthSeconds, rvPre );
@@ -163,6 +161,8 @@ void ScoreKeeperNormal::Load(
m_iScoreRemainder = 0; m_iScoreRemainder = 0;
m_iCurToastyCombo = 0; m_iCurToastyCombo = 0;
m_iCurToastyTrigger = 0;
m_iNextToastyAt = 0;
m_iMaxScoreSoFar = 0; m_iMaxScoreSoFar = 0;
m_iPointBonus = 0; m_iPointBonus = 0;
m_iNumTapsAndHolds = 0; m_iNumTapsAndHolds = 0;
@@ -214,9 +214,7 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps,
We also keep track of this scoring type in endless, with 100mil per iteration We also keep track of this scoring type in endless, with 100mil per iteration
of all songs, though this score isn't actually seen anywhere right now. of all songs, though this score isn't actually seen anywhere right now.
*/ */
//
// Calculate the score multiplier // Calculate the score multiplier
//
m_iMaxPossiblePoints = 0; m_iMaxPossiblePoints = 0;
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
{ {
@@ -258,8 +256,8 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps,
m_iMaxPossiblePoints = (iMeter * iLengthMultiplier + 1) * 5000000; m_iMaxPossiblePoints = (iMeter * iLengthMultiplier + 1) * 5000000;
break; break;
case SCORING_CUSTOM: case SCORING_CUSTOM:
/* This is just simple additive/subtractive scoring, but cap the score at the size of the /* This is just simple additive/subtractive scoring, but cap the
* score counter */ * score at the size of the score counter */
m_iMaxPossiblePoints = 10 * 10000000 * iLengthMultiplier; m_iMaxPossiblePoints = 10 * 10000000 * iLengthMultiplier;
break; break;
DEFAULT_FAIL( int(PREFSMAN->m_ScoringType) ); DEFAULT_FAIL( int(PREFSMAN->m_ScoringType) );
@@ -274,8 +272,8 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps,
m_iPointBonus = m_iMaxPossiblePoints; m_iPointBonus = m_iMaxPossiblePoints;
m_pPlayerStageStats->m_iMaxScore = m_iMaxScoreSoFar; m_pPlayerStageStats->m_iMaxScore = m_iMaxScoreSoFar;
/* MercifulBeginner shouldn't clamp weights in course mode, even if a beginner song /* MercifulBeginner shouldn't clamp weights in course mode, even if a beginner
* is in a course, since that makes PlayerStageStats::GetGrade hard. */ * song is in a course, since that makes PlayerStageStats::GetGrade hard. */
m_bIsBeginner = pSteps->GetDifficulty() == Difficulty_Beginner && !GAMESTATE->IsCourseMode(); m_bIsBeginner = pSteps->GetDifficulty() == Difficulty_Beginner && !GAMESTATE->IsCourseMode();
ASSERT( m_iPointBonus >= 0 ); ASSERT( m_iPointBonus >= 0 );
@@ -285,8 +283,8 @@ void ScoreKeeperNormal::OnNextSong( int iSongInCourseIndex, const Steps* pSteps,
static int GetScore(int p, int Z, int S, int n) static int GetScore(int p, int Z, int S, int n)
{ {
/* There's a problem with the scoring system described below. Z/S is truncated /* There's a problem with the scoring system described below. Z/S is truncated
* to an int. However, in some cases we can end up with very small base scores. * to an int. However, in some cases we can end up with very small base scores.
* Each song in a 50-song nonstop course will be worth 2mil, which is a base of * Each song in a 50-song nonstop course will be worth 2mil, which is a base of
* 200k; Z/S will end up being zero. * 200k; Z/S will end up being zero.
* *
@@ -297,13 +295,13 @@ static int GetScore(int p, int Z, int S, int n)
*/ */
#if 0 #if 0
/* This is the actual method described below. */ // This is the actual method described below.
return p * (Z / S) * n; return p * (Z / S) * n;
#elif 1 #elif 1
/* This doesn't round down Z/S. */ // This doesn't round down Z/S.
return int(int64_t(p) * n * Z / S); return int(int64_t(p) * n * Z / S);
#else #else
/* This also doesn't round down Z/S. Use this if you don't have 64-bit ints. */ // This also doesn't round down Z/S. Use this if you don't have 64-bit ints.
return int(p * n * (float(Z) / S)); return int(p * n * (float(Z) / S));
#endif #endif
@@ -443,9 +441,9 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
iScore += m_ComboBonusFactor[score] * iCurrentCombo; iScore += m_ComboBonusFactor[score] * iCurrentCombo;
} }
/* Subtract the maximum this step could have been worth from the bonus. */ // Subtract the maximum this step could have been worth from the bonus.
m_iPointBonus -= GetScore(10, Z, sum, m_iTapNotesHit); m_iPointBonus -= GetScore(10, Z, sum, m_iTapNotesHit);
/* And add the maximum this step could have been worth to the max score up to now. */ // And add the maximum this step could have been worth to the max score up to now.
iCurMaxScore += GetScore(10, Z, sum, m_iTapNotesHit); iCurMaxScore += GetScore(10, Z, sum, m_iTapNotesHit);
if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_W2 ) if ( m_iTapNotesHit == m_iNumTapsAndHolds && score >= TNS_W2 )
@@ -467,7 +465,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
// Custom Scoring // Custom Scoring
else else
{ {
int p = 0; // score value int p = 0; // score value
switch( score ) switch( score )
{ {
@@ -510,7 +508,7 @@ void ScoreKeeperNormal::AddScoreInternal( TapNoteScore score )
ASSERT( iScore >= 0 ); ASSERT( iScore >= 0 );
/* Undo rounding from the last tap, and re-round. */ // Undo rounding from the last tap, and re-round.
iScore += m_iScoreRemainder; iScore += m_iScoreRemainder;
m_iScoreRemainder = (iScore % m_iRoundTo); m_iScoreRemainder = (iScore % m_iRoundTo);
iScore = iScore - m_iScoreRemainder; iScore = iScore - m_iScoreRemainder;
@@ -551,7 +549,6 @@ void ScoreKeeperNormal::HandleTapScore( const TapNote &tn )
msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber );
msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp ); msg.SetParam( "MultiPlayer", m_pPlayerState->m_mp );
MESSAGEMAN->Broadcast( msg ); MESSAGEMAN->Broadcast( msg );
} }
AddTapScore( tns ); AddTapScore( tns );
@@ -591,9 +588,7 @@ void ScoreKeeperNormal::HandleTapNoteScoreInternal( TapNoteScore tns, TapNoteSco
void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumHitMaintainCombo, int iNumBreakCombo ) void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumHitMaintainCombo, int iNumBreakCombo )
{ {
//
// Regular combo // Regular combo
//
if( m_ComboIsPerRow ) if( m_ComboIsPerRow )
{ {
iNumHitContinueCombo = min( iNumHitContinueCombo, 1 ); iNumHitContinueCombo = min( iNumHitContinueCombo, 1 );
@@ -602,7 +597,9 @@ void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumH
} }
if( iNumHitContinueCombo > 0 || iNumHitMaintainCombo > 0 ) if( iNumHitContinueCombo > 0 || iNumHitMaintainCombo > 0 )
{
m_pPlayerStageStats->m_iCurMissCombo = 0; m_pPlayerStageStats->m_iCurMissCombo = 0;
}
if( iNumBreakCombo == 0 ) if( iNumBreakCombo == 0 )
{ {
@@ -615,6 +612,24 @@ void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumH
} }
} }
void ScoreKeeperNormal::HandleRowComboInternal( TapNoteScore tns, int iNumTapsInRow )
{
if( m_ComboIsPerRow )
{
iNumTapsInRow = min( iNumTapsInRow, 1);
}
if ( tns >= m_MinScoreToContinueCombo )
{
m_pPlayerStageStats->m_iCurMissCombo = 0;
m_pPlayerStageStats->m_iCurCombo += iNumTapsInRow;
}
else if ( tns < m_MinScoreToMaintainCombo )
{
m_pPlayerStageStats->m_iCurCombo = 0;
m_pPlayerStageStats->m_iCurMissCombo += iNumTapsInRow;
}
}
void ScoreKeeperNormal::GetRowCounts( const NoteData &nd, int iRow, void ScoreKeeperNormal::GetRowCounts( const NoteData &nd, int iRow,
int &iNumHitContinueCombo, int &iNumHitMaintainCombo, int &iNumHitContinueCombo, int &iNumHitMaintainCombo,
int &iNumBreakCombo ) int &iNumBreakCombo )
@@ -650,7 +665,14 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
TapNoteScore scoreOfLastTap = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.tns; TapNoteScore scoreOfLastTap = NoteDataWithScoring::LastTapNoteWithResult( nd, iRow ).result.tns;
HandleTapNoteScoreInternal( scoreOfLastTap, TNS_W1 ); HandleTapNoteScoreInternal( scoreOfLastTap, TNS_W1 );
HandleComboInternal( iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo ); if ( GAMESTATE->GetCurrentGame()->m_bCountNotesSeparately )
{
HandleComboInternal( iNumHitContinueCombo, iNumHitMaintainCombo, iNumBreakCombo );
}
else
{
HandleRowComboInternal( scoreOfLastTap, iNumTapsInRow ); //This should work?
}
if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID ) if( m_pPlayerState->m_PlayerNumber != PLAYER_INVALID )
MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) ); MESSAGEMAN->Broadcast( enum_add2(Message_CurrentComboChangedP1,m_pPlayerState->m_PlayerNumber) );
@@ -668,23 +690,45 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
#endif //DEBUG #endif //DEBUG
// Toasty combo // Toasty combo
vector<int> iToastyMilestones;
switch( scoreOfLastTap ) switch( scoreOfLastTap )
{ {
case TNS_W1: case TNS_W1:
case TNS_W2: case TNS_W2:
m_iCurToastyCombo += iNumTapsInRow; m_iCurToastyCombo += iNumTapsInRow;
if( m_iCurToastyCombo >= m_ToastyTriggers && // compile the list of toasty triggers
m_iCurToastyCombo - iNumTapsInRow < m_ToastyTriggers && {
Lua *L = LUA->Get();
m_vToastyTriggers.PushSelf(L);
LuaHelpers::ReadArrayFromTable(iToastyMilestones, L);
lua_pop( L, 1 );
LUA->Release(L);
}
// find out which one we're at.
if(m_iCurToastyTrigger <= int(iToastyMilestones.size()))
{
m_iNextToastyAt = iToastyMilestones[m_iCurToastyTrigger];
}
else // out of index value? then don't make it toasty!
{
m_iNextToastyAt = -1;
}
if( m_iCurToastyCombo >= m_iNextToastyAt &&
m_iCurToastyCombo - iNumTapsInRow < m_iNextToastyAt &&
!GAMESTATE->m_bDemonstrationOrJukebox ) !GAMESTATE->m_bDemonstrationOrJukebox )
{ {
SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 ); SCREENMAN->PostMessageToTopScreen( SM_PlayToasty, 0 );
Message msg("ToastyAchieved"); Message msg("ToastyAchieved");
msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber ); msg.SetParam( "PlayerNumber", m_pPlayerState->m_PlayerNumber );
msg.SetParam( "ToastyCombo", m_iCurToastyCombo );
MESSAGEMAN->Broadcast(msg); MESSAGEMAN->Broadcast(msg);
// TODO: keep a pointer to the Profile. Don't index with m_PlayerNumber // TODO: keep a pointer to the Profile. Don't index with m_PlayerNumber
PROFILEMAN->IncrementToastiesCount( m_pPlayerState->m_PlayerNumber ); PROFILEMAN->IncrementToastiesCount( m_pPlayerState->m_PlayerNumber );
m_iCurToastyTrigger++;
} }
break; break;
default: default:
@@ -742,7 +786,7 @@ void ScoreKeeperNormal::HandleHoldScore( const TapNote &tn )
int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& radars ) int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& radars )
{ {
/* Note that, if W1 timing is disabled or not active (not course mode), /* Note: If W1 timing is disabled or not active (not course mode),
* W2 will be used instead. */ * W2 will be used instead. */
int NumTaps = int(radars[RadarCategory_TapsAndHolds]); int NumTaps = int(radars[RadarCategory_TapsAndHolds]);
@@ -756,10 +800,9 @@ int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& radars )
int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars ) int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars )
{ {
/* /* The logic here is that if you use a modifier that adds notes, you should
* The logic here is that if you use a modifier that adds notes, you should have to * have to hit the new notes to get a high grade. However, if you use one
* hit the new notes to get a high grade. However, if you use one that removes notes, * that removes notes, they should simply be counted as misses. */
* they should simply be counted as misses. */
return max( return max(
GetPossibleDancePoints(fOriginalRadars), GetPossibleDancePoints(fOriginalRadars),
GetPossibleDancePoints(fPostRadars) ); GetPossibleDancePoints(fPostRadars) );
@@ -767,7 +810,7 @@ int ScoreKeeperNormal::GetPossibleDancePoints( const RadarValues& fOriginalRadar
int ScoreKeeperNormal::GetPossibleGradePoints( const RadarValues& radars ) int ScoreKeeperNormal::GetPossibleGradePoints( const RadarValues& radars )
{ {
/* Note that, if W1 timing is disabled or not active (not course mode), /* Note: if W1 timing is disabled or not active (not course mode),
* W2 will be used instead. */ * W2 will be used instead. */
int NumTaps = int(radars[RadarCategory_TapsAndHolds]); int NumTaps = int(radars[RadarCategory_TapsAndHolds]);
@@ -781,10 +824,9 @@ int ScoreKeeperNormal::GetPossibleGradePoints( const RadarValues& radars )
int ScoreKeeperNormal::GetPossibleGradePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars ) int ScoreKeeperNormal::GetPossibleGradePoints( const RadarValues& fOriginalRadars, const RadarValues& fPostRadars )
{ {
/* /* The logic here is that if you use a modifier that adds notes, you should
* The logic here is that if you use a modifier that adds notes, you should have to * have to hit the new notes to get a high grade. However, if you use one
* hit the new notes to get a high grade. However, if you use one that removes notes, * that removes notes, they should simply be counted as misses. */
* they should simply be counted as misses. */
return max( return max(
GetPossibleGradePoints(fOriginalRadars), GetPossibleGradePoints(fOriginalRadars),
GetPossibleGradePoints(fPostRadars) ); GetPossibleGradePoints(fPostRadars) );
@@ -814,7 +856,7 @@ int ScoreKeeperNormal::TapNoteScoreToDancePoints( TapNoteScore tns, bool bBeginn
if( !GAMESTATE->ShowW1() && tns == TNS_W1 ) if( !GAMESTATE->ShowW1() && tns == TNS_W1 )
tns = TNS_W2; tns = TNS_W2;
/* This is used for Oni percentage displays. Grading values are currently in /* This is used for Oni percentage displays. Grading values are currently in
* StageStats::GetGrade. */ * StageStats::GetGrade. */
int iWeight = 0; int iWeight = 0;
switch( tns ) switch( tns )
@@ -856,7 +898,7 @@ int ScoreKeeperNormal::TapNoteScoreToGradePoints( TapNoteScore tns, bool bBeginn
if( !GAMESTATE->ShowW1() && tns == TNS_W1 ) if( !GAMESTATE->ShowW1() && tns == TNS_W1 )
tns = TNS_W2; tns = TNS_W2;
/* This is used for Oni percentage displays. Grading values are currently in /* This is used for Oni percentage displays. Grading values are currently in
* StageStats::GetGrade. */ * StageStats::GetGrade. */
int iWeight = 0; int iWeight = 0;
switch( tns ) switch( tns )
+5 -2
View File
@@ -24,7 +24,9 @@ class ScoreKeeperNormal: public ScoreKeeper
int m_iNumTapsAndHolds; int m_iNumTapsAndHolds;
int m_iMaxScoreSoFar; // for nonstop scoring int m_iMaxScoreSoFar; // for nonstop scoring
int m_iPointBonus; // the difference to award at the end int m_iPointBonus; // the difference to award at the end
int m_iCurToastyCombo; int m_iCurToastyCombo;
int m_iCurToastyTrigger;
int m_iNextToastyAt;
bool m_bIsLastSongInCourse; bool m_bIsLastSongInCourse;
bool m_bIsBeginner; bool m_bIsBeginner;
@@ -58,7 +60,7 @@ class ScoreKeeperNormal: public ScoreKeeper
ThemeMetric<float> m_QuadPlusNoteMultiplier; ThemeMetric<float> m_QuadPlusNoteMultiplier;
ThemeMetric<float> m_CustomComboMultiplier; ThemeMetric<float> m_CustomComboMultiplier;
ThemeMetric<int> m_ToastyTriggers; ThemeMetric<LuaReference> m_vToastyTriggers;
vector<Steps*> m_apSteps; vector<Steps*> m_apSteps;
@@ -108,6 +110,7 @@ public:
private: private:
void HandleTapNoteScoreInternal( TapNoteScore tns, TapNoteScore maximum ); void HandleTapNoteScoreInternal( TapNoteScore tns, TapNoteScore maximum );
void HandleComboInternal( int iNumHitContinueCombo, int iNumHitMaintainCombo, int iNumBreakCombo ); void HandleComboInternal( int iNumHitContinueCombo, int iNumHitMaintainCombo, int iNumBreakCombo );
void HandleRowComboInternal( TapNoteScore tns, int iNumTapsInRow );
void GetRowCounts( const NoteData &nd, int iRow, int &iNumHitContinueCombo, int &iNumHitMaintainCombo, int &iNumBreakCombo ); void GetRowCounts( const NoteData &nd, int iRow, int &iNumHitContinueCombo, int &iNumHitMaintainCombo, int &iNumBreakCombo );
}; };
+1 -1
View File
@@ -2571,7 +2571,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
} }
else if( SM == SM_PlayToasty ) else if( SM == SM_PlayToasty )
{ {
// todo: make multiple toasties a theme option -aj // todo: make multiple toasties work -aj
if( g_bEasterEggs ) if( g_bEasterEggs )
if( !m_Toasty.IsTransitioning() && !m_Toasty.IsFinished() ) // don't play if we've already played it once if( !m_Toasty.IsTransitioning() && !m_Toasty.IsFinished() ) // don't play if we've already played it once
m_Toasty.StartTransitioning(); m_Toasty.StartTransitioning();