Files
itgmania212121/stepmania/src/ScreenGameplay.h
T

209 lines
6.5 KiB
C++
Raw Normal View History

#ifndef SCREENGAMEPLAY_H
#define SCREENGAMEPLAY_H
2002-05-20 08:59:37 +00:00
/*
-----------------------------------------------------------------------------
Class: ScreenGameplay
Desc: The music plays, the notes scroll, and the Player is pressing buttons.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#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 "BPMDisplay.h"
class Inventory;
#include "BeginnerHelper.h"
2003-03-19 19:58:22 +00:00
#include "LyricDisplay.h"
2003-03-27 00:51:57 +00:00
#include "TimingAssist.h"
#include "Character.h"
2003-10-25 22:00:58 +00:00
#include "Attack.h"
2003-12-25 05:53:30 +00:00
#include "MeterDisplay.h"
2002-05-20 08:59:37 +00:00
2002-07-11 19:02:26 +00:00
// messages sent by Combo
2003-03-16 19:11:51 +00:00
const ScreenMessage SM_PlayToasty = ScreenMessage(SM_User+104);
2002-07-11 19:02:26 +00:00
const ScreenMessage SM_100Combo = ScreenMessage(SM_User+200);
const ScreenMessage SM_200Combo = ScreenMessage(SM_User+201);
const ScreenMessage SM_300Combo = ScreenMessage(SM_User+202);
const ScreenMessage SM_400Combo = ScreenMessage(SM_User+203);
const ScreenMessage SM_500Combo = ScreenMessage(SM_User+204);
const ScreenMessage SM_600Combo = ScreenMessage(SM_User+205);
const ScreenMessage SM_700Combo = ScreenMessage(SM_User+206);
const ScreenMessage SM_800Combo = ScreenMessage(SM_User+207);
const ScreenMessage SM_900Combo = ScreenMessage(SM_User+208);
const ScreenMessage SM_1000Combo = ScreenMessage(SM_User+209);
const ScreenMessage SM_ComboStopped = ScreenMessage(SM_User+210);
2003-08-25 17:15:47 +00:00
const ScreenMessage SM_ComboContinuing = ScreenMessage(SM_User+211);
const ScreenMessage SM_MissComboAborted = ScreenMessage(SM_User+212);
2002-07-11 19:02:26 +00:00
2003-07-10 11:47:45 +00:00
const ScreenMessage SM_BattleTrickLevel1 = ScreenMessage(SM_User+301);
const ScreenMessage SM_BattleTrickLevel2 = ScreenMessage(SM_User+302);
const ScreenMessage SM_BattleTrickLevel3 = ScreenMessage(SM_User+303);
const ScreenMessage SM_BattleDamageLevel1 = ScreenMessage(SM_User+304);
const ScreenMessage SM_BattleDamageLevel2 = ScreenMessage(SM_User+305);
const ScreenMessage SM_BattleDamageLevel3 = ScreenMessage(SM_User+306);
2003-05-13 13:35:32 +00:00
class LyricsLoader;
2002-05-20 08:59:37 +00:00
class ScreenGameplay : public Screen
{
public:
2003-09-27 22:30:51 +00:00
ScreenGameplay( CString sName, bool bDemonstration = false );
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 DrawPrimitives();
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI );
virtual void HandleScreenMessage( const ScreenMessage SM );
protected:
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();
2003-12-23 02:18:27 +00:00
void SetupSong( int p, int iSongIndex );
void LoadNextSong();
2003-01-25 08:32:57 +00:00
float StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic);
void ShowSavePrompt( ScreenMessage SM_SendWhenDone );
2002-05-20 08:59:37 +00:00
2004-01-12 09:36:01 +00:00
void PlayTicks();
void UpdateLyrics( float fDeltaTime );
2003-09-15 21:00:59 +00:00
void UpdateCheckFail();
void SongFinished();
2003-12-23 02:18:27 +00:00
void StageFinished();
2002-05-20 08:59:37 +00:00
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;
2003-03-26 23:08:05 +00:00
vector<Song*> m_apSongsQueue; // size may be >1 if playing a course
2003-08-03 00:13:55 +00:00
vector<Steps*> m_apNotesQueue[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;
float m_fTimeLeftBeforeDancingComment; // 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
2003-03-27 00:51:57 +00:00
TimingAssist m_TimingAssist;
Background m_Background;
2004-01-07 00:13:32 +00:00
Foreground m_Foreground;
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
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;
BitmapText m_textCourseSongNumber[NUM_PLAYERS];
2003-12-17 10:21:31 +00:00
BitmapText m_textPlayerName[NUM_PLAYERS];
2002-06-14 22:25:22 +00:00
BPMDisplay m_BPMDisplay;
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;
2002-05-20 08:59:37 +00:00
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;
2002-05-20 08:59:37 +00:00
2003-03-30 18:12:57 +00:00
BitmapText m_textSurviveTime; // used in extra stage
BitmapText m_textSongTitle;
2003-12-25 05:53:30 +00:00
MeterDisplay m_meterSongPosition;
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
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];
2002-05-27 08:23:27 +00:00
BGAnimation m_bgaBH;
Sprite m_sprBH;
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
RandomSample m_soundOniDie;
2002-05-20 08:59:37 +00:00
RandomSample m_announcerReady;
RandomSample m_announcerHereWeGo;
2002-06-24 22:04:31 +00:00
RandomSample m_announcerDanger;
RandomSample m_announcerGood;
RandomSample m_announcerHot;
RandomSample m_announcerOni;
2002-07-11 19:02:26 +00:00
RandomSample m_announcer100Combo;
RandomSample m_announcer200Combo;
RandomSample m_announcer300Combo;
RandomSample m_announcer400Combo;
RandomSample m_announcer500Combo;
RandomSample m_announcer600Combo;
RandomSample m_announcer700Combo;
RandomSample m_announcer800Combo;
RandomSample m_announcer900Combo;
RandomSample m_announcer1000Combo;
RandomSample m_announcerComboStopped;
2003-08-25 17:15:47 +00:00
RandomSample m_announcerComboContinuing;
2003-05-13 13:35:32 +00:00
RandomSample m_announcerBattleTrickLevel1;
RandomSample m_announcerBattleTrickLevel2;
RandomSample m_announcerBattleTrickLevel3;
2003-11-20 06:50:05 +00:00
RageSound m_soundBattleTrickLevel1;
RageSound m_soundBattleTrickLevel2;
RageSound m_soundBattleTrickLevel3;
2003-05-13 13:35:32 +00:00
RandomSample m_announcerBattleDamageLevel1;
RandomSample m_announcerBattleDamageLevel2;
RandomSample m_announcerBattleDamageLevel3;
2003-07-09 02:27:05 +00:00
RandomSample m_announcerBattleDie;
2002-05-20 08:59:37 +00:00
2003-04-13 00:44:50 +00:00
bool m_bZeroDeltaOnNextUpdate;
bool m_bDemonstration;
2003-01-02 08:13:34 +00:00
RageSound m_soundAssistTick;
2002-12-27 23:16:16 +00:00
RageSound m_soundMusic;
BeginnerHelper m_BeginnerHelper;
2002-05-20 08:59:37 +00:00
};
2003-02-14 22:25:14 +00:00
#endif