Files
itgmania212121/stepmania/src/ScreenGameplay.h
T

200 lines
6.1 KiB
C++
Raw Normal View History

2004-06-08 05:22:33 +00:00
/* ScreenGameplay - The music plays, the notes scroll, and the Player is pressing buttons. */
2002-05-20 08:59:37 +00:00
2004-06-08 05:22:33 +00:00
#ifndef SCREEN_GAMEPLAY_H
#define SCREEN_GAMEPLAY_H
2002-05-20 08:59:37 +00:00
#include "Screen.h"
#include "Sprite.h"
2003-04-13 01:09:19 +00:00
#include "Transition.h"
2002-05-20 08:59:37 +00:00
#include "BitmapText.h"
#include "Player.h"
#include "RandomSample.h"
2002-12-29 00:20:57 +00:00
#include "RageSound.h"
2002-05-20 08:59:37 +00:00
#include "Background.h"
2004-01-07 00:13:32 +00:00
#include "Foreground.h"
2002-07-23 01:41:40 +00:00
#include "LifeMeter.h"
#include "ScoreDisplay.h"
2002-10-06 16:56:58 +00:00
#include "DifficultyIcon.h"
#include "DifficultyMeter.h"
#include "BPMDisplay.h"
class Inventory;
#include "BeginnerHelper.h"
2003-03-19 19:58:22 +00:00
#include "LyricDisplay.h"
#include "Character.h"
2003-10-25 22:00:58 +00:00
#include "Attack.h"
2004-03-17 06:01:17 +00:00
#include "ActiveAttackList.h"
2004-08-13 08:24:11 +00:00
#include "NetworkSyncManager.h"
2004-10-24 10:45:30 +00:00
#include "AutoKeysounds.h"
#include "ThemeMetric.h"
2002-05-20 08:59:37 +00:00
class LyricsLoader;
2002-05-20 08:59:37 +00:00
class ScreenGameplay : public Screen
{
public:
2005-01-03 23:20:11 +00:00
ScreenGameplay( CString sName );
2005-01-03 22:44:19 +00:00
virtual void Init();
2002-05-20 08:59:37 +00:00
virtual ~ScreenGameplay();
2003-01-19 04:44:22 +00:00
2002-05-20 08:59:37 +00:00
virtual void Update( float fDeltaTime );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
2004-12-11 10:23:06 +00:00
virtual bool UsesBackground() const { return false; }
2002-05-20 08:59:37 +00:00
protected:
2005-03-12 00:04:27 +00:00
ThemeMetric<CString> PLAYER_TYPE;
ThemeMetric<CString> GIVE_UP_TEXT;
ThemeMetric<CString> GIVE_UP_ABORTED_TEXT;
ThemeMetric<bool> START_GIVES_UP;
ThemeMetric<bool> BACK_GIVES_UP;
ThemeMetric<bool> GIVING_UP_FAILS;
2002-06-14 22:25:22 +00:00
void TweenOnScreen();
void TweenOffScreen();
2002-07-23 01:41:40 +00:00
2002-07-28 20:28:37 +00:00
bool IsLastSong();
void SetupSong( PlayerNumber p, int iSongIndex );
void LoadNextSong();
2004-02-14 00:39:24 +00:00
void LoadCourseSongNumber( int SongNumber );
2003-01-25 08:32:57 +00:00
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
void PauseGame( bool bPause );
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
2004-02-16 05:29:33 +00:00
void PlayAnnouncer( CString type, float fSeconds );
void UpdateLights();
void BackOutFromGameplay();
2002-05-20 08:59:37 +00:00
2004-01-12 09:36:01 +00:00
void PlayTicks();
void UpdateSongPosition( float fDeltaTime );
void UpdateLyrics( float fDeltaTime );
void SongFinished();
void StageFinished( bool bBackedOut );
2002-05-20 08:59:37 +00:00
2005-01-03 23:29:40 +00:00
virtual void InitSongQueues();
2002-07-27 19:29:51 +00:00
enum DancingState {
STATE_INTRO = 0, // not allowed to press Back
STATE_DANCING,
STATE_OUTRO, // not allowed to press Back
NUM_DANCING_STATES
} m_DancingState;
bool m_bPaused;
2003-03-26 23:08:05 +00:00
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
2004-05-24 03:41:39 +00:00
vector<Steps*> m_vpStepsQueue[NUM_PLAYERS]; // size may be >1 if playing a course
2003-10-25 22:00:58 +00:00
vector<AttackArray> m_asModifiersQueue[NUM_PLAYERS];// size may be >1 if playing a course
bool m_bChangedOffsetOrBPM;
2004-02-16 05:29:33 +00:00
float m_fTimeSinceLastDancingComment; // this counter is only running while STATE_DANCING
2002-05-20 08:59:37 +00:00
2003-03-19 19:58:22 +00:00
LyricDisplay m_LyricDisplay;
2002-05-20 08:59:37 +00:00
Background m_SongBackground;
Foreground m_SongForeground;
2002-05-20 08:59:37 +00:00
2003-04-13 01:09:19 +00:00
Transition m_NextSongIn; // shows between songs in a course
Transition m_NextSongOut; // shows between songs in a course
Transition m_SongFinished; // shows after each song, course or not
2002-08-01 03:15:27 +00:00
2003-10-08 23:32:08 +00:00
Sprite m_sprStaticBackground;
Sprite m_sprLifeFrame;
LifeMeter* m_pLifeMeter[NUM_PLAYERS];
2003-06-30 18:08:27 +00:00
CombinedLifeMeter* m_pCombinedLifeMeter;
Sprite m_sprStage;
2003-12-18 23:19:02 +00:00
Sprite m_sprCourseSongNumber;
2004-02-15 00:48:24 +00:00
AutoActor m_sprStageFrame;
BitmapText m_textCourseSongNumber[NUM_PLAYERS];
BitmapText m_textStepsDescription[NUM_PLAYERS];
2002-06-14 22:25:22 +00:00
BPMDisplay m_BPMDisplay;
2004-12-18 08:15:19 +00:00
float m_fLastBPS;
Sprite m_sprScoreFrame;
2003-11-26 06:40:03 +00:00
ScoreDisplay* m_pPrimaryScoreDisplay[NUM_PLAYERS];
ScoreDisplay* m_pSecondaryScoreDisplay[NUM_PLAYERS];
2003-06-30 18:08:27 +00:00
ScoreKeeper* m_pPrimaryScoreKeeper[NUM_PLAYERS];
ScoreKeeper* m_pSecondaryScoreKeeper[NUM_PLAYERS];
BitmapText m_textPlayerOptions[NUM_PLAYERS];
BitmapText m_textSongOptions;
2004-03-17 06:01:17 +00:00
ActiveAttackList m_ActiveAttackList[NUM_PLAYERS];
2004-08-13 08:24:11 +00:00
BitmapText m_Scoreboard[NUM_NSSB_CATEGORIES]; // for NSMAN, so we can have a scoreboard
2002-05-20 08:59:37 +00:00
bool m_ShowScoreboard;
BitmapText m_textDebug;
RageTimer m_GiveUpTimer;
void AbortGiveUp();
BitmapText m_textAutoPlay; // for AutoPlay, AutoAdjust
void UpdateAutoPlayText();
BitmapText m_MaxCombo;
2002-05-20 08:59:37 +00:00
2003-04-13 01:09:19 +00:00
Transition m_Ready;
Transition m_Go;
Transition m_Cleared;
Transition m_Failed;
Transition m_Extra;
Transition m_Toasty; // easter egg
2003-04-14 22:12:54 +00:00
Transition m_Win[NUM_PLAYERS];
Transition m_Draw;
2003-04-13 01:09:19 +00:00
Transition m_In;
Transition m_Back;
2005-02-26 09:16:34 +00:00
AutoActor m_Overlay;
2002-05-20 08:59:37 +00:00
2003-03-30 18:12:57 +00:00
BitmapText m_textSurviveTime; // used in extra stage
2002-08-01 13:42:56 +00:00
2002-06-14 22:25:22 +00:00
Player m_Player[NUM_PLAYERS];
2002-05-20 08:59:37 +00:00
2004-10-24 10:45:30 +00:00
AutoKeysounds m_AutoKeysounds;
2003-04-07 05:14:27 +00:00
// used in PLAY_MODE_BATTLE
Inventory* m_pInventory[NUM_PLAYERS];
2003-04-07 05:14:27 +00:00
2002-10-06 16:56:58 +00:00
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
DifficultyMeter m_DifficultyMeter[NUM_PLAYERS];
2002-05-27 08:23:27 +00:00
2002-08-01 21:55:40 +00:00
Sprite m_sprOniGameOver[NUM_PLAYERS];
void ShowOniGameOver( PlayerNumber pn );
2002-08-01 21:55:40 +00:00
2003-11-20 06:50:05 +00:00
RageSound m_soundBattleTrickLevel1;
RageSound m_soundBattleTrickLevel2;
RageSound m_soundBattleTrickLevel3;
2002-05-20 08:59:37 +00:00
2003-04-13 00:44:50 +00:00
bool m_bZeroDeltaOnNextUpdate;
2003-01-02 08:13:34 +00:00
RageSound m_soundAssistTick;
2004-10-25 03:47:22 +00:00
RageSound *m_pSoundMusic;
BeginnerHelper m_BeginnerHelper;
2004-03-30 07:44:29 +00:00
2004-04-20 02:35:30 +00:00
NoteData m_CabinetLightsNoteData;
2002-05-20 08:59:37 +00:00
};
2003-02-14 22:25:14 +00:00
#endif
2004-06-08 05:22:33 +00:00
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/