162 void SetPaused(
bool bPaused,
int nPad,
int nReason)
override;
179 void OnFinish([[maybe_unused]]
bool bWon)
override {
282 void LoopTrack(
int nStartBar,
int nNumBars,
int nBarsAhead);
449 std::vector<Ptr<PlayScriptCmd> > mScriptCmds;
453 float mProgressLength;
454 float mProgressOffset;
455 int mPowerupsDisabled;
456 int mManualEnableNext;
457 std::vector<Ptr<Command> > mDeactivators;
459 int mSavedNoDeactivate;
461 int mSavedStreaksEnabled;
462 int mSavedGuideTicks;
463 int mSavedStrandBars;
496 static void OnMidiCommand(
DataArray *pCommand,
void *pUserData);
506 static void OnSchedDeactivateTrackCommand(
DataArray *pCommand,
void *pUserData);
516 static void OnStreamCommand(
DataArray *pCommand,
void *pUserData);
526 static void OnLoopTrackCommand(
DataArray *pCommand,
void *pUserData);
536 static void OnDisableRotCommand(
DataArray *pCommand,
void *pUserData);
546 static void OnDisableInputCommand(
DataArray *pCommand,
void *pUserData);
556 static void OnTutorialPrintCommand(
DataArray *pCommand,
void *pUserData);
566 static void OnDisablePowerupsCommand(
DataArray *pCommand,
void *pUserData);
576 static void OnActivateBarsCommand(
DataArray *pCommand,
void *pUserData);
586 static void OnSetSongPosParamsCommand(
DataArray *pCommand,
void *pUserData);
596 static void OnCaptureTrackCommand(
DataArray *pCommand,
void *pUserData);
606 static void OnCaptureAllTracksCommand(
DataArray *pCommand,
void *pUserData);
616 static void OnSetPowerupCommand(
DataArray *pCommand,
void *pUserData);
626 static void OnMoveTrackCommand(
DataArray *pCommand,
void *pUserData);
636 static void OnSetNoCaptureCommand(
DataArray *pCommand,
void *pUserData);
646 static void OnSetNoDeactivateCommand(
DataArray *pCommand,
void *pUserData);
656 static void OnSetNoSeekerCommand(
DataArray *pCommand,
void *pUserData);
666 static void OnSetNoStreaksCommand(
DataArray *pCommand,
void *pUserData);
676 static void OnSetStrandBarsCommand(
DataArray *pCommand,
void *pUserData);
686 static void OnShowStreakArrowCommand(
DataArray *pCommand,
void *pUserData);
696 static void OnSchedSetJuiceCommand(
DataArray *pCommand,
void *pUserData);
706 static void OnSetAutopilotCommand(
DataArray *pCommand,
void *pUserData);
716 static void OnSetManualEnableNextCommand(
DataArray *pCommand,
void *pUserData);
726 static void OnEnableNextCommand(
DataArray *pCommand,
void *pUserData);
736 static void OnSchedStageCompleteCommand(
DataArray *pCommand,
void *pUserData);
738#ifdef VIDEO_STANDARD_PAL
749 static void OnShowDemoMsgCommand(
DataArray *pCommand,
void *pUserData);
Input event of a button press that names only the player.
Definition btnevent.h:15
Track whose phrases a player captures by playing them.
Definition catchtrack.h:33
Reference-counted array of script data nodes.
Definition dataarray.h:20
GameLogic(Song *pSong, DataArray *pConfig, int nSeed)
Construct the logic of a song.
void HandleInput(const RotateEvent &event) override
Move a playing player to the next or previous catch track.
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Input event that plays a note on one of the three gem buttons.
Definition playnoteevent.h:10
One participant in a song: the track the participant plays, the score, and the streak.
Definition player.h:19
Input event that rotates a player's view of the tracks by one track.
Definition rotateevent.h:11
Task that runs a list of tasks one after another.
Definition serialtasks.h:14
One song: its configuration from the song text file and the tracks its MIDI file builds.
Definition song.h:38
Queue of narration streams that plays one stream at a time.
Definition streamqueue.h:16
Object a task can ask to report when a named piece of work is done.
Definition taskdonenotifier.h:10
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9
One instrument track of the song that a player can play.
Definition track.h:18
void SetNoSeeker(bool bNoSeeker)
Hide or show the seeker of the first player's track.
float GetProgress() override
Report how far the tutorial has played, from the span set_songpos_params sets.
void SetAutopilot(bool bAutopilot)
Turn on or off the automatic play of the first player's track.
void CaptureAllTracks()
Capture the phrase of the current bar on every catch track for the first player.
void EnableNext()
Enable the next catch tracks from the bar after the current one.
~TutorialGameLogic() override
Cancel the scheduled deactivations, restore the song speed, the game settings, and the controller bin...
void MoveTrack(int nTrack)
Move the first player to a catch track.
void OnSection() override
Ignore the start of a section.
Definition tutorialgamelogic.h:197
void NotifyWhenDone(Task *pTask, const char *pszName) override
Arrange for a task to learn when the commands of a track named "SCRIPT" ran out.
void CaptureTrack()
Capture the phrase of the recorded bar on the first player's track.
void SetPowerupsDisabled(bool bDisabled)
Disable or enable the power-ups.
void ShowStreakArrow(int nTrack, int nBarsAhead, int nUnused)
Point at the next phrase of a catch track from a number of bars after the clock's bar.
void SetRotateMode(int nMode)
Set the rotations that pass.
void ScheduleStageComplete(int nBarsAhead)
Schedule the stage completion display at the start of a later bar.
RotateMode
Values of mRotateMode, the disable_rot argument.
Definition tutorialgamelogic.h:39
@ kRotateModeNone
Definition tutorialgamelogic.h:42
@ kRotateModeNextOnly
Definition tutorialgamelogic.h:40
@ kRotateModeAll
Definition tutorialgamelogic.h:43
@ kRotateModePreviousOnly
Definition tutorialgamelogic.h:41
bool DispatchPriv(Message *pMsg) override
Report the type of a message and pass it to WorldLogic::DispatchPriv().
void HandleInput(const BtnEvent< 5 > &event) override
Deploy a power-up, unless the input or the power-ups are disabled.
void Poll() override
Advance the song, the steps, and the narration.
void SetInputDisabled(bool bDisabled)
Disable or enable the input.
bool IsPhraseAbsent()
Report whether no phrase of the first player's track plays at or after the current bar.
void HandleInput(const PlayNoteEvent &event) override
Pass a note, unless the input is disabled.
void ScheduleSetJuice(int nBarsAhead, float fJuice)
Schedule the first player's energy meter to change at the start of a later bar.
TutorialGameLogic(Song *pSong, DataArray *pSongConfig)
Construct the logic of the tutorial song with a random seed.
float GetTime() override
Report the song position on the song clock.
void HandleInput(const BtnEvent< 4 > &event) override
Ignore the event.
void OnBar(int nBar) override
Record the bar, unless it precedes bar 0.
void PlacePowerup(int nPowerup, int nTrack, int nBar)
Place a power-up in a bar of a catch track.
void SetManualEnableNext(bool bManual)
Leave the enabling of the next catch tracks to the script, or return it to the captures.
void OnPhraseCaptured(CatchTrack *pTrack, Player *pPlayer, int nBar, bool bStreak) override
Enable the next catch tracks, unless set_manual_enable_next asked for the script to do it.
int GetTick() override
Report the song position in ticks.
void PlayScriptTrack(const char *pszName)
Start the commands of a track named "SCRIPT" from the current tick.
void SetPaused(bool bPaused, int nPad, int nReason) override
Pause or resume the song and the narration, and show the pause menu while paused.
void OnPhraseMissed(Track *pTrack) override
Ignore a missed phrase.
Definition tutorialgamelogic.h:228
void QueueStream(const char *pszName, bool bSkipIfBusy)
Queue a narration stream.
void OnStart() override
Enable the first catch tracks and start the steps.
void SetSongPosParams(int nPlayedBars, int nTotalBars)
Set the span GetProgress() measures.
void ScheduleDeactivateTrack(int nBarsAhead, int nBar, int nBars)
Schedule the deactivation of a run of bars of the first player's track.
void LoopTrack(int nStartBar, int nNumBars, int nBarsAhead)
Loop a range of bars of the song from a number of bars after the recorded bar.
void OnPhraseEnded(Track *pTrack) override
Ignore the end of a phrase.
void HandleInput(const RotateEvent &event) override
Pass a rotation that mRotateMode allows, unless the input is disabled.
void OnFinish(bool bWon) override
Ignore the end of the song.
Definition tutorialgamelogic.h:179
void ActivateBars(int nBar, int nBars, int nTrack)
Give a run of bars of a catch track to the first player.