#ifndef GAMESTATE_H #define GAMESTATE_H /* ----------------------------------------------------------------------------- Class: GameState Desc: Holds game data that is not saved between sessions. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "GameConstantsAndTypes.h" #include "PlayerOptions.h" #include "SongOptions.h" #include "Game.h" #include "Style.h" #include "Grade.h" #include "StageStats.h" class Song; class Steps; class Course; class GameDef; class StyleDef; struct ModeChoice; class NoteFieldPositioning; class Character; class UnlockSystem; class GameState { public: GameState(); ~GameState(); void Reset(); void ResetLastRanking(); void Update( float fDelta ); // // Main state info // UnlockSystem *m_pUnlockingSys; Game m_CurGame; Style m_CurStyle; bool m_bPlayersCanJoin; // true if it's not too late for a player to join - this only has an effect on the credits message bool m_bSideIsJoined[NUM_PLAYERS]; // left side, right side PlayMode m_PlayMode; // many screens display different info depending on this value int m_iCoins; // not "credits" PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides bool m_bIsOnSystemMenu; // system screens will not be effected by the operator key -- Miryokuteki bool m_bDifficultCourses; //used in nonstop /* This is set to a random number per-game/round; it can be used for a random seed. */ int m_iGameSeed, m_iRoundSeed; int GetNumSidesJoined() { int iNumSidesJoined = 0; for( int c=0; c m_TransformsToApply[NUM_PLAYERS]; // used in PLAY_MODE_BATTLE Attack m_Inventory[NUM_PLAYERS][NUM_INVENTORY_SLOTS]; float m_fOpponentHealthPercent; // used in PLAY_MODE_RAVE float m_fTugLifePercentP1; float m_fSuperMeter[NUM_PLAYERS]; // between 0 and NUM_ATTACK_LEVELS bool m_bActiveAttackEndedThisUpdate[NUM_PLAYERS]; // flag for other objects to watch (play sounds) void LaunchAttack( PlayerNumber target, Attack aa ); void RebuildPlayerOptionsFromActiveAttacks( PlayerNumber pn ); void RemoveAllActiveAttacks() // called on end of song { for( int p=0; p m_vPassedStageStats; // Only useful in Arcade for final evaluation // A song is only inserted here if at least one player passed. // StageStats are added by the Evaluation screen void GetFinalEvalStatsAndSongs( StageStats& statsOut, vector& vSongsOut ); // shown on arcade final evaluation // // Options stuff // PlayerOptions m_CurrentPlayerOptions[NUM_PLAYERS]; // current approaches destination PlayerOptions m_PlayerOptions[NUM_PLAYERS]; // change this, and current will move gradually toward it PlayerOptions m_StoredPlayerOptions[NUM_PLAYERS]; // user's choices on the PlayerOptions screen SongOptions m_SongOptions; SongOptions m_StoredSongOptions; void ApplyModifiers( PlayerNumber pn, CString sModifiers ); void StoreSelectedOptions(); void RestoreSelectedOptions(); void AdjustFailType(); // character stuff vector m_pCharacters; Character* m_pCurCharacters[NUM_PLAYERS]; void ReloadCharacters(); bool HasEarnedExtraStage(); bool m_bAllow2ndExtraStage; //only used when "Allow Selection of Extra Stage is on" // // Ranking Stuff // // Filled in by ScreenNameEntry and used by ScreenRanking to flash the recent high scores StepsType m_RankingNotesType; // meaningless if a course was played RankingCategory m_RankingCategory[NUM_PLAYERS]; // meaningless if a course was played Course* m_pRankingCourse; // meaningless unless Course was played int m_iRankingIndex[NUM_PLAYERS]; // -1 if no new high score // // Arrow positioning // NoteFieldPositioning *m_pPosition; }; extern GameState* GAMESTATE; // global and accessable from anywhere in our program #endif