broadcast note crossed messages in beginner mode for BGAs
add FORCE_MODIFIERS_IN_BEGINNER
This commit is contained in:
@@ -1011,6 +1011,8 @@ BackGivesUp=0
|
|||||||
GivingUpFails=1
|
GivingUpFails=1
|
||||||
InitialBackgroundBrightness=1
|
InitialBackgroundBrightness=1
|
||||||
MusicFadeOutSeconds=0.5
|
MusicFadeOutSeconds=0.5
|
||||||
|
UseForcedModifiersInBeginner=0
|
||||||
|
ForcedModifiersInBeginner=
|
||||||
SongBackgroundOnCommand=
|
SongBackgroundOnCommand=
|
||||||
SongForegroundOnCommand=
|
SongForegroundOnCommand=
|
||||||
BPMDisplayX=-1000
|
BPMDisplayX=-1000
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ static const CString MessageNames[NUM_MESSAGES] = {
|
|||||||
"EditPreferredCourseDifficutyP2Changed",
|
"EditPreferredCourseDifficutyP2Changed",
|
||||||
"GoalCompleteP1",
|
"GoalCompleteP1",
|
||||||
"GoalCompleteP2",
|
"GoalCompleteP2",
|
||||||
|
"NoteCrossed",
|
||||||
|
"NoteWillCrossIn500Ms",
|
||||||
|
"NoteWillCrossIn1000Ms",
|
||||||
|
"NoteWillCrossIn1500Ms",
|
||||||
};
|
};
|
||||||
XToString( Message, NUM_MESSAGES );
|
XToString( Message, NUM_MESSAGES );
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ enum Message
|
|||||||
MESSAGE_EDIT_PREFERRED_COURSE_DIFFICULTY_P2_CHANGED,
|
MESSAGE_EDIT_PREFERRED_COURSE_DIFFICULTY_P2_CHANGED,
|
||||||
MESSAGE_GOAL_COMPLETE_P1,
|
MESSAGE_GOAL_COMPLETE_P1,
|
||||||
MESSAGE_GOAL_COMPLETE_P2,
|
MESSAGE_GOAL_COMPLETE_P2,
|
||||||
|
MESSAGE_NOTE_CROSSED,
|
||||||
|
MESSAGE_NOTE_WILL_CROSS_IN_500MS,
|
||||||
|
MESSAGE_NOTE_WILL_CROSS_IN_1000MS,
|
||||||
|
MESSAGE_NOTE_WILL_CROSS_IN_1500MS,
|
||||||
NUM_MESSAGES,
|
NUM_MESSAGES,
|
||||||
MESSAGE_INVALID
|
MESSAGE_INVALID
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ ScreenGameplay::ScreenGameplay( CString sName ) : ScreenWithMenuElements(sName)
|
|||||||
BACK_GIVES_UP.Load( sName, "BackGivesUp" );
|
BACK_GIVES_UP.Load( sName, "BackGivesUp" );
|
||||||
GIVING_UP_FAILS.Load( sName, "GivingUpFails" );
|
GIVING_UP_FAILS.Load( sName, "GivingUpFails" );
|
||||||
GIVING_UP_GOES_TO_NEXT_SCREEN.Load( sName, "GivingUpGoesToNextScreen" );
|
GIVING_UP_GOES_TO_NEXT_SCREEN.Load( sName, "GivingUpGoesToNextScreen" );
|
||||||
|
USE_FORCED_MODIFIERS_IN_BEGINNER.Load( sName, "UseForcedModifiersInBeginner" );
|
||||||
|
FORCED_MODIFIERS_IN_BEGINNER.Load( sName, "ForcedModifiersInBeginner" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGameplay::Init()
|
void ScreenGameplay::Init()
|
||||||
@@ -969,6 +971,12 @@ void ScreenGameplay::LoadNextSong()
|
|||||||
{
|
{
|
||||||
GAMESTATE->m_pPlayerState[p]->m_PlayerController = PC_HUMAN;
|
GAMESTATE->m_pPlayerState[p]->m_PlayerController = PC_HUMAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( pSteps->GetDifficulty() == DIFFICULTY_BEGINNER && (bool)USE_FORCED_MODIFIERS_IN_BEGINNER )
|
||||||
|
{
|
||||||
|
GAMESTATE->ApplyModifiers( p, FORCED_MODIFIERS_IN_BEGINNER );
|
||||||
|
GAMESTATE->StoreSelectedOptions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool bReverse[NUM_PLAYERS] =
|
const bool bReverse[NUM_PLAYERS] =
|
||||||
@@ -1593,16 +1601,12 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
m_BPMDisplay.SetConstantBpm( GAMESTATE->m_fCurBPS * 60.0f );
|
m_BPMDisplay.SetConstantBpm( GAMESTATE->m_fCurBPS * 60.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// play assist ticks
|
|
||||||
//
|
|
||||||
PlayTicks();
|
PlayTicks();
|
||||||
|
|
||||||
//
|
|
||||||
// update lights
|
|
||||||
//
|
|
||||||
UpdateLights();
|
UpdateLights();
|
||||||
|
|
||||||
|
SendCrossedMessages();
|
||||||
|
|
||||||
if( NSMAN->useSMserver )
|
if( NSMAN->useSMserver )
|
||||||
{
|
{
|
||||||
FOREACH_EnabledPlayer( pn2 )
|
FOREACH_EnabledPlayer( pn2 )
|
||||||
@@ -1730,6 +1734,49 @@ void ScreenGameplay::UpdateLights()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenGameplay::SendCrossedMessages()
|
||||||
|
{
|
||||||
|
const int NUM_MESSAGES_TO_SEND = 4;
|
||||||
|
const float MESSAGE_SPACING_SECONDS = 0.5f;
|
||||||
|
|
||||||
|
PlayerNumber pn = PLAYER_INVALID;
|
||||||
|
FOREACH_EnabledPlayer( p )
|
||||||
|
{
|
||||||
|
if( GAMESTATE->m_pCurSteps[p]->GetDifficulty() == DIFFICULTY_BEGINNER )
|
||||||
|
pn = p;
|
||||||
|
}
|
||||||
|
if( pn == PLAYER_INVALID )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for( int i=0; i<NUM_MESSAGES_TO_SEND; i++ )
|
||||||
|
{
|
||||||
|
float fOffsetFromCurrentSeconds = MESSAGE_SPACING_SECONDS * i;
|
||||||
|
|
||||||
|
bool bCrossedABeat = false;
|
||||||
|
{
|
||||||
|
float fPositionSeconds = GAMESTATE->m_fMusicSeconds + fOffsetFromCurrentSeconds; // trigger the light a tiny bit early
|
||||||
|
float fSongBeat = GAMESTATE->m_pCurSong->GetBeatFromElapsedTime( fPositionSeconds );
|
||||||
|
|
||||||
|
int iRowNow = BeatToNoteRowNotRounded( fSongBeat );
|
||||||
|
iRowNow = max( 0, iRowNow );
|
||||||
|
static int iRowLastCrossedAll[NUM_MESSAGES_TO_SEND] = { 0, 0, 0, 0 };
|
||||||
|
int &iRowLastCrossed = iRowLastCrossedAll[i];
|
||||||
|
|
||||||
|
FOREACH_NONEMPTY_ROW_ALL_TRACKS_RANGE( m_Player[pn].m_NoteData, r, iRowLastCrossed+1, iRowNow+1 )
|
||||||
|
{
|
||||||
|
if( m_CabinetLightsNoteData.IsThereATapOrHoldHeadAtRow(r) )
|
||||||
|
{
|
||||||
|
LOG->Trace( "r = %d", r );
|
||||||
|
MESSAGEMAN->Broadcast( (Message)(MESSAGE_NOTE_CROSSED + i) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
iRowLastCrossed = iRowNow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenGameplay::BackOutFromGameplay()
|
void ScreenGameplay::BackOutFromGameplay()
|
||||||
{
|
{
|
||||||
m_DancingState = STATE_OUTRO;
|
m_DancingState = STATE_OUTRO;
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ protected:
|
|||||||
ThemeMetric<bool> BACK_GIVES_UP;
|
ThemeMetric<bool> BACK_GIVES_UP;
|
||||||
ThemeMetric<bool> GIVING_UP_FAILS;
|
ThemeMetric<bool> GIVING_UP_FAILS;
|
||||||
ThemeMetric<bool> GIVING_UP_GOES_TO_NEXT_SCREEN;
|
ThemeMetric<bool> GIVING_UP_GOES_TO_NEXT_SCREEN;
|
||||||
|
ThemeMetric<bool> USE_FORCED_MODIFIERS_IN_BEGINNER;
|
||||||
|
ThemeMetric<CString> FORCED_MODIFIERS_IN_BEGINNER;
|
||||||
|
|
||||||
void TweenOnScreen();
|
void TweenOnScreen();
|
||||||
void TweenOffScreen();
|
void TweenOffScreen();
|
||||||
@@ -65,6 +67,7 @@ protected:
|
|||||||
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
|
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
|
||||||
void PlayAnnouncer( CString type, float fSeconds );
|
void PlayAnnouncer( CString type, float fSeconds );
|
||||||
void UpdateLights();
|
void UpdateLights();
|
||||||
|
void SendCrossedMessages();
|
||||||
void BackOutFromGameplay();
|
void BackOutFromGameplay();
|
||||||
|
|
||||||
void PlayTicks();
|
void PlayTicks();
|
||||||
|
|||||||
Reference in New Issue
Block a user