2004-06-08 01:24:17 +00:00
|
|
|
/* GameState - Holds game data that is not saved between sessions. */
|
|
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
#ifndef GAMESTATE_H
|
|
|
|
|
#define GAMESTATE_H
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-10-25 22:00:58 +00:00
|
|
|
#include "Attack.h"
|
2005-01-22 19:36:39 +00:00
|
|
|
#include "Difficulty.h"
|
2006-11-29 14:57:21 +00:00
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "Grade.h"
|
2005-02-24 12:27:30 +00:00
|
|
|
#include "MessageManager.h"
|
2006-08-05 02:38:05 +00:00
|
|
|
#include "ModsGroup.h"
|
2006-11-29 14:57:21 +00:00
|
|
|
#include "RageTimer.h"
|
2007-05-12 23:48:29 +00:00
|
|
|
#include "PlayerOptions.h"
|
2006-11-29 14:57:21 +00:00
|
|
|
#include "SongOptions.h"
|
2008-05-27 20:51:18 +00:00
|
|
|
#include "Preference.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-09-12 06:23:51 +00:00
|
|
|
#include <map>
|
2004-03-07 04:34:49 +00:00
|
|
|
#include <deque>
|
2004-07-11 01:58:55 +00:00
|
|
|
#include <set>
|
2003-09-12 06:23:51 +00:00
|
|
|
|
2003-06-09 19:22:04 +00:00
|
|
|
class Character;
|
2006-11-29 14:57:21 +00:00
|
|
|
class Course;
|
|
|
|
|
class Game;
|
2005-02-12 21:07:13 +00:00
|
|
|
struct lua_State;
|
2005-03-18 22:47:44 +00:00
|
|
|
class LuaTable;
|
2006-11-29 14:57:21 +00:00
|
|
|
class PlayerState;
|
2005-11-29 23:15:11 +00:00
|
|
|
class PlayerOptions;
|
2006-11-29 14:57:21 +00:00
|
|
|
class Profile;
|
|
|
|
|
class Song;
|
|
|
|
|
class Steps;
|
|
|
|
|
class StageStats;
|
|
|
|
|
class Style;
|
|
|
|
|
class TimingData;
|
|
|
|
|
class Trail;
|
2005-02-24 12:27:30 +00:00
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
class GameState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
GameState();
|
|
|
|
|
~GameState();
|
|
|
|
|
void Reset();
|
2007-04-27 21:14:50 +00:00
|
|
|
void ResetPlayer( PlayerNumber pn );
|
2004-04-30 07:48:02 +00:00
|
|
|
void ApplyCmdline(); // called by Reset
|
2006-01-22 01:00:06 +00:00
|
|
|
void ApplyGameCommand( const RString &sCommand, PlayerNumber pn=PLAYER_INVALID );
|
2003-12-08 04:02:43 +00:00
|
|
|
void BeginGame(); // called when first player joins
|
2004-04-30 07:48:02 +00:00
|
|
|
void JoinPlayer( PlayerNumber pn );
|
2007-03-25 09:37:14 +00:00
|
|
|
void UnjoinPlayer( PlayerNumber pn );
|
2006-11-21 19:57:58 +00:00
|
|
|
bool JoinInput( PlayerNumber pn );
|
2008-05-27 20:51:18 +00:00
|
|
|
bool JoinPlayers();
|
2007-04-24 16:30:23 +00:00
|
|
|
void LoadProfiles( bool bLoadEdits = true );
|
2007-04-17 22:27:25 +00:00
|
|
|
void SaveProfiles();
|
2007-05-06 05:15:26 +00:00
|
|
|
void SaveProfile( PlayerNumber pn );
|
2007-04-17 22:27:25 +00:00
|
|
|
bool HaveProfileToLoad();
|
|
|
|
|
bool HaveProfileToSave();
|
2007-04-19 13:59:38 +00:00
|
|
|
void SaveLocalData();
|
2007-04-16 21:17:26 +00:00
|
|
|
void LoadCurrentSettingsFromProfile( PlayerNumber pn );
|
2004-03-30 03:55:54 +00:00
|
|
|
void SaveCurrentSettingsToProfile( PlayerNumber pn ); // called at the beginning of each stage
|
2005-08-03 03:28:13 +00:00
|
|
|
Song* GetDefaultSong() const;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-02-26 23:26:57 +00:00
|
|
|
void Update( float fDelta );
|
|
|
|
|
|
2003-07-03 06:38:57 +00:00
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
//
|
2003-07-03 06:38:57 +00:00
|
|
|
// Main state info
|
2002-07-28 20:28:37 +00:00
|
|
|
//
|
2005-10-28 01:44:19 +00:00
|
|
|
void SetCurGame( const Game *pGame ); // Call this instead of m_pCurGame.Set to make sure PREFSMAN->m_sCurrentGame stays in sync
|
|
|
|
|
BroadcastOnChangePtr<const Game> m_pCurGame;
|
2005-05-07 08:34:20 +00:00
|
|
|
BroadcastOnChangePtr<const Style> m_pCurStyle;
|
2006-04-21 00:43:32 +00:00
|
|
|
bool m_bSideIsJoined[NUM_PLAYERS]; // left side, right side
|
|
|
|
|
MultiPlayerStatus m_MultiPlayerStatus[NUM_MultiPlayer];
|
|
|
|
|
BroadcastOnChange<PlayMode> m_PlayMode; // many screens display different info depending on this value
|
|
|
|
|
int m_iCoins; // not "credits"
|
2006-04-29 00:41:30 +00:00
|
|
|
PlayerNumber m_MasterPlayerNumber; // used in Styles where one player controls both sides
|
2006-04-21 00:43:32 +00:00
|
|
|
bool m_bMultiplayer;
|
2007-10-23 18:09:41 +00:00
|
|
|
int m_iNumMultiplayerNoteFields;
|
2006-08-06 08:50:24 +00:00
|
|
|
bool DifficultiesLocked() const;
|
2007-05-15 19:32:39 +00:00
|
|
|
bool ChangePreferredDifficultyAndStepsType( PlayerNumber pn, Difficulty dc, StepsType st );
|
2004-06-03 08:22:02 +00:00
|
|
|
bool ChangePreferredDifficulty( PlayerNumber pn, int dir );
|
2007-05-15 19:32:39 +00:00
|
|
|
bool ChangePreferredCourseDifficultyAndStepsType( PlayerNumber pn, CourseDifficulty cd, StepsType st );
|
2004-06-03 08:22:02 +00:00
|
|
|
bool ChangePreferredCourseDifficulty( PlayerNumber pn, int dir );
|
2004-05-20 22:23:44 +00:00
|
|
|
bool IsCourseDifficultyShown( CourseDifficulty cd );
|
2006-03-29 02:54:11 +00:00
|
|
|
Difficulty GetClosestShownDifficulty( PlayerNumber pn ) const;
|
2005-04-24 10:47:44 +00:00
|
|
|
Difficulty GetEasiestStepsDifficulty() const;
|
2004-03-13 22:18:09 +00:00
|
|
|
RageTimer m_timeGameStarted; // from the moment the first player pressed Start
|
2005-03-18 22:47:44 +00:00
|
|
|
LuaTable *m_Environment;
|
2003-07-30 20:34:16 +00:00
|
|
|
|
|
|
|
|
/* This is set to a random number per-game/round; it can be used for a random seed. */
|
2005-03-11 18:09:34 +00:00
|
|
|
int m_iGameSeed, m_iStageSeed;
|
2003-07-30 20:34:16 +00:00
|
|
|
|
2006-04-21 00:43:32 +00:00
|
|
|
bool PlayersCanJoin() const; // true if it's not too late for a player to join
|
|
|
|
|
int GetCoinsNeededToJoin() const;
|
2007-05-08 01:49:45 +00:00
|
|
|
bool EnoughCreditsToJoin() const { return m_iCoins >= GetCoinsNeededToJoin(); }
|
2006-04-21 00:43:32 +00:00
|
|
|
int GetNumSidesJoined() const;
|
2002-09-29 05:06:18 +00:00
|
|
|
|
2004-07-25 17:07:32 +00:00
|
|
|
const Game* GetCurrentGame();
|
2004-06-28 07:26:00 +00:00
|
|
|
const Style* GetCurrentStyle() const;
|
2006-09-30 22:15:22 +00:00
|
|
|
void SetCurrentStyle( const Style *pStyle );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-04-07 03:25:44 +00:00
|
|
|
void GetPlayerInfo( PlayerNumber pn, bool& bIsEnabledOut, bool& bIsHumanOut );
|
2004-01-22 02:15:55 +00:00
|
|
|
bool IsPlayerEnabled( PlayerNumber pn ) const;
|
2005-08-23 20:55:58 +00:00
|
|
|
bool IsMultiPlayerEnabled( MultiPlayer mp ) const;
|
|
|
|
|
bool IsPlayerEnabled( const PlayerState* pPlayerState ) const;
|
2004-01-22 02:15:55 +00:00
|
|
|
int GetNumPlayersEnabled() const;
|
|
|
|
|
|
|
|
|
|
bool IsHumanPlayer( PlayerNumber pn ) const;
|
2004-03-20 17:45:34 +00:00
|
|
|
int GetNumHumanPlayers() const;
|
2004-01-22 02:15:55 +00:00
|
|
|
PlayerNumber GetFirstHumanPlayer() const;
|
2004-12-01 20:42:15 +00:00
|
|
|
PlayerNumber GetFirstDisabledPlayer() const;
|
2004-01-22 02:15:55 +00:00
|
|
|
bool IsCpuPlayer( PlayerNumber pn ) const;
|
|
|
|
|
bool AnyPlayersAreCpu() const;
|
|
|
|
|
|
2003-04-07 21:24:14 +00:00
|
|
|
|
2003-02-28 07:26:43 +00:00
|
|
|
bool IsCourseMode() const;
|
2003-07-09 20:23:44 +00:00
|
|
|
bool IsBattleMode() const; /* not Rave */
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2005-10-09 04:30:59 +00:00
|
|
|
bool ShowW1() const;
|
2003-07-25 08:05:29 +00:00
|
|
|
|
2006-04-29 00:41:30 +00:00
|
|
|
BroadcastOnChange<RString> m_sPreferredSongGroup; // GROUP_ALL denotes no preferred group
|
2006-01-22 01:00:06 +00:00
|
|
|
BroadcastOnChange<RString> m_sPreferredCourseGroup; // GROUP_ALL denotes no preferred group
|
2006-04-29 00:41:30 +00:00
|
|
|
bool m_bChangedFailTypeOnScreenSongOptions; // true if FailType was changed in the song options screen
|
2007-05-15 19:32:39 +00:00
|
|
|
BroadcastOnChange<StepsType> m_PreferredStepsType;
|
2006-04-29 00:41:30 +00:00
|
|
|
BroadcastOnChange1D<Difficulty,NUM_PLAYERS> m_PreferredDifficulty;
|
2005-10-18 20:30:20 +00:00
|
|
|
BroadcastOnChange1D<CourseDifficulty,NUM_PLAYERS> m_PreferredCourseDifficulty;// used in nonstop
|
2006-04-29 00:41:30 +00:00
|
|
|
BroadcastOnChange<SortOrder> m_SortOrder; // set by MusicWheel
|
|
|
|
|
SortOrder m_PreferredSortOrder; // used by MusicWheel
|
|
|
|
|
EditMode m_EditMode;
|
2006-10-07 04:25:28 +00:00
|
|
|
bool IsEditing() const { return m_EditMode != EditMode_Invalid; }
|
2006-04-29 00:41:30 +00:00
|
|
|
bool m_bDemonstrationOrJukebox; // ScreenGameplay does special stuff when this is true
|
|
|
|
|
bool m_bJukeboxUsesModifiers;
|
2004-01-22 03:11:40 +00:00
|
|
|
int m_iNumStagesOfThisSong;
|
2007-03-25 09:37:14 +00:00
|
|
|
// Increases every stage, doesn't reset when player continues. It's cosmetic and not used in Stage or Screen branching logic.
|
2004-01-22 03:11:40 +00:00
|
|
|
int m_iCurrentStageIndex;
|
2007-04-25 03:50:17 +00:00
|
|
|
// Num stages available for player. Resets when player joins/continues.
|
|
|
|
|
int m_iPlayerStageTokens[NUM_PLAYERS];
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2007-03-12 01:47:03 +00:00
|
|
|
static int GetNumStagesMultiplierForSong( const Song* pSong );
|
2007-03-17 23:05:34 +00:00
|
|
|
static int GetNumStagesForSongAndStyleType( const Song* pSong, StyleType st );
|
2007-05-05 11:08:50 +00:00
|
|
|
int GetNumStagesForCurrentSongAndStepsOrCourse() const;
|
2007-02-23 21:13:45 +00:00
|
|
|
|
2006-08-05 02:38:05 +00:00
|
|
|
void BeginStage();
|
|
|
|
|
void CancelStage();
|
|
|
|
|
void CommitStageStats();
|
|
|
|
|
void FinishStage();
|
2007-03-25 09:37:14 +00:00
|
|
|
int GetNumStagesLeft( PlayerNumber pn ) const;
|
|
|
|
|
int GetSmallestNumStagesLeftForAnyHumanPlayer() const;
|
2008-03-29 15:13:52 +00:00
|
|
|
bool IsFinalStageForAnyHumanPlayer() const;
|
2006-08-06 02:36:23 +00:00
|
|
|
bool IsAnExtraStage() const;
|
2008-06-12 04:30:51 +00:00
|
|
|
bool IsAnExtraStageAndSelectionLocked() const;
|
2006-08-05 02:38:05 +00:00
|
|
|
bool IsExtraStage() const;
|
|
|
|
|
bool IsExtraStage2() const;
|
|
|
|
|
Stage GetCurrentStage() const;
|
|
|
|
|
int GetCourseSongIndex() const;
|
|
|
|
|
RString GetPlayerDisplayName( PlayerNumber pn ) const;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2006-08-05 02:38:05 +00:00
|
|
|
bool m_bLoadingNextSong;
|
|
|
|
|
int GetLoadingCourseSongIndex() const;
|
2003-02-24 03:26:00 +00:00
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
//
|
|
|
|
|
// State Info used during gameplay
|
|
|
|
|
//
|
2004-05-26 05:50:22 +00:00
|
|
|
|
|
|
|
|
// NULL on ScreenSelectMusic if the currently selected wheel item isn't a Song.
|
2005-02-25 05:27:28 +00:00
|
|
|
BroadcastOnChangePtr<Song> m_pCurSong;
|
2004-05-26 05:50:22 +00:00
|
|
|
// The last Song that the user manually changed to.
|
|
|
|
|
Song* m_pPreferredSong;
|
2005-02-25 05:27:28 +00:00
|
|
|
BroadcastOnChangePtr1D<Steps,NUM_PLAYERS> m_pCurSteps;
|
2004-05-26 05:50:22 +00:00
|
|
|
|
|
|
|
|
// NULL on ScreenSelectMusic if the currently selected wheel item isn't a Course.
|
2005-05-18 07:14:19 +00:00
|
|
|
BroadcastOnChangePtr<Course> m_pCurCourse;
|
2004-05-26 05:50:22 +00:00
|
|
|
// The last Course that the user manually changed to.
|
|
|
|
|
Course* m_pPreferredCourse;
|
2005-05-18 07:14:19 +00:00
|
|
|
BroadcastOnChangePtr1D<Trail,NUM_PLAYERS> m_pCurTrail;
|
2002-07-28 20:28:37 +00:00
|
|
|
|
2005-06-29 07:57:15 +00:00
|
|
|
bool m_bBackedOutOfFinalStage;
|
|
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
//
|
2003-01-24 02:43:07 +00:00
|
|
|
// Music statistics: Arcade: the current stage (one song). Oni/Endles: a single song in a course
|
2002-08-01 05:11:11 +00:00
|
|
|
//
|
|
|
|
|
// Let a lot of classes access this info here so the don't have to keep their own copies.
|
|
|
|
|
//
|
2006-11-30 12:29:01 +00:00
|
|
|
float m_fMusicSeconds; // time into the current song, not scaled by music rate
|
2002-07-28 20:28:37 +00:00
|
|
|
float m_fSongBeat;
|
2006-04-09 15:54:53 +00:00
|
|
|
float m_fSongBeatNoOffset;
|
2002-07-28 20:28:37 +00:00
|
|
|
float m_fCurBPS;
|
2005-05-04 20:32:31 +00:00
|
|
|
float m_fLightSongBeat; // g_fLightsFalloffSeconds ahead
|
2002-07-28 20:28:37 +00:00
|
|
|
bool m_bFreeze; // in the middle of a freeze
|
2004-01-12 01:10:25 +00:00
|
|
|
RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update
|
2005-10-10 04:36:04 +00:00
|
|
|
BroadcastOnChange<bool> m_bGameplayLeadIn;
|
2003-09-12 06:23:51 +00:00
|
|
|
|
2007-03-09 01:22:09 +00:00
|
|
|
float m_fMusicSecondsVisible;
|
|
|
|
|
float m_fSongBeatVisible;
|
|
|
|
|
|
2006-01-22 01:00:06 +00:00
|
|
|
void GetAllUsedNoteSkins( vector<RString> &out ) const;
|
2003-09-12 06:23:51 +00:00
|
|
|
|
2003-02-07 23:49:07 +00:00
|
|
|
static const float MUSIC_SECONDS_INVALID;
|
2002-07-28 20:28:37 +00:00
|
|
|
|
2003-07-03 06:38:57 +00:00
|
|
|
void ResetMusicStatistics(); // Call this when it's time to play a new song. Clears the values above.
|
2004-01-18 04:43:56 +00:00
|
|
|
void UpdateSongPosition( float fPositionSeconds, const TimingData &timing, const RageTimer ×tamp = RageZeroTimer );
|
2003-10-23 06:16:29 +00:00
|
|
|
float GetSongPercent( float beat ) const;
|
2003-02-06 17:40:06 +00:00
|
|
|
|
2003-12-07 20:29:42 +00:00
|
|
|
bool AllAreInDangerOrWorse() const;
|
|
|
|
|
bool OneIsHot() const;
|
2003-07-03 06:38:57 +00:00
|
|
|
|
2007-04-26 00:56:37 +00:00
|
|
|
//
|
|
|
|
|
// Haste
|
|
|
|
|
//
|
|
|
|
|
float m_fHasteRate; // [-1,+1]; 0 = normal speed
|
|
|
|
|
float m_fLastHasteUpdateMusicSeconds;
|
|
|
|
|
float m_fAccumulatedHasteSeconds;
|
|
|
|
|
|
2008-05-16 04:00:13 +00:00
|
|
|
//
|
|
|
|
|
// Random Attacks & Attack Mines
|
|
|
|
|
//
|
|
|
|
|
vector<RString> m_RandomAttacks;
|
|
|
|
|
|
2003-07-03 06:38:57 +00:00
|
|
|
// used in PLAY_MODE_BATTLE
|
|
|
|
|
float m_fOpponentHealthPercent;
|
|
|
|
|
|
|
|
|
|
// used in PLAY_MODE_RAVE
|
|
|
|
|
float m_fTugLifePercentP1;
|
2005-04-09 09:34:54 +00:00
|
|
|
|
|
|
|
|
// used in workout
|
|
|
|
|
bool m_bGoalComplete[NUM_PLAYERS];
|
2007-10-28 00:02:44 +00:00
|
|
|
bool m_bWorkoutGoalComplete;
|
2003-07-03 06:38:57 +00:00
|
|
|
|
2004-01-22 02:15:55 +00:00
|
|
|
void RemoveAllActiveAttacks(); // called on end of song
|
2004-02-07 22:14:36 +00:00
|
|
|
PlayerNumber GetBestPlayer() const;
|
|
|
|
|
StageResult GetStageResult( PlayerNumber pn ) const;
|
2003-07-03 06:38:57 +00:00
|
|
|
|
|
|
|
|
void ResetStageStatistics(); // Call this when it's time to play a new stage.
|
2002-08-01 05:11:11 +00:00
|
|
|
|
2003-02-26 23:26:57 +00:00
|
|
|
//
|
|
|
|
|
// Options stuff
|
|
|
|
|
//
|
|
|
|
|
|
2006-08-05 02:38:05 +00:00
|
|
|
ModsGroup<SongOptions> m_SongOptions;
|
2002-12-02 05:25:44 +00:00
|
|
|
|
2006-11-30 19:29:15 +00:00
|
|
|
// True if the current mode has changed the default NoteSkin, such as Edit/Sync Songs does.
|
|
|
|
|
// Note: any mode that wants to use it must set it
|
|
|
|
|
bool m_bDidModeChangeNoteSkin;
|
|
|
|
|
|
2005-10-27 07:51:37 +00:00
|
|
|
void GetDefaultPlayerOptions( PlayerOptions &po );
|
|
|
|
|
void GetDefaultSongOptions( SongOptions &so );
|
2007-04-06 15:44:39 +00:00
|
|
|
void ResetToDefaultSongOptions( ModsLevel l );
|
2006-08-05 02:38:05 +00:00
|
|
|
void ApplyPreferredModifiers( PlayerNumber pn, RString sModifiers );
|
|
|
|
|
void ApplyStageModifiers( PlayerNumber pn, RString sModifiers );
|
2008-05-20 21:42:08 +00:00
|
|
|
void ClearStageModifiersIllegalForCourse();
|
2006-08-05 02:38:05 +00:00
|
|
|
void ResetOptions();
|
2003-02-26 23:26:57 +00:00
|
|
|
|
2007-04-25 20:00:18 +00:00
|
|
|
bool CurrentOptionsDisqualifyPlayer( PlayerNumber pn );
|
2006-01-22 01:00:06 +00:00
|
|
|
bool PlayerIsUsingModifier( PlayerNumber pn, const RString &sModifier );
|
2004-03-09 08:19:55 +00:00
|
|
|
|
2007-05-12 23:48:29 +00:00
|
|
|
PlayerOptions::FailType GetPlayerFailType( const PlayerState *pPlayerState ) const;
|
2003-02-26 23:26:57 +00:00
|
|
|
|
2003-07-03 06:38:57 +00:00
|
|
|
// character stuff
|
2003-06-09 19:22:04 +00:00
|
|
|
Character* m_pCurCharacters[NUM_PLAYERS];
|
|
|
|
|
|
2003-04-07 05:14:27 +00:00
|
|
|
|
2007-08-11 20:43:01 +00:00
|
|
|
bool HasEarnedExtraStage() const { return m_bEarnedExtraStage; }
|
2003-01-26 02:21:47 +00:00
|
|
|
|
|
|
|
|
|
2003-02-26 23:26:57 +00:00
|
|
|
//
|
|
|
|
|
// Ranking Stuff
|
|
|
|
|
//
|
2004-03-08 02:21:22 +00:00
|
|
|
struct RankingFeat
|
2003-10-15 01:09:29 +00:00
|
|
|
{
|
2003-12-10 11:35:34 +00:00
|
|
|
enum { SONG, COURSE, CATEGORY } Type;
|
2004-03-08 02:21:22 +00:00
|
|
|
Song* pSong; // valid if Type == SONG
|
|
|
|
|
Steps* pSteps; // valid if Type == SONG
|
|
|
|
|
Course* pCourse; // valid if Type == COURSE
|
2003-12-10 11:35:34 +00:00
|
|
|
Grade grade;
|
|
|
|
|
int iScore;
|
|
|
|
|
float fPercentDP;
|
2006-01-22 01:00:06 +00:00
|
|
|
RString Banner;
|
|
|
|
|
RString Feat;
|
|
|
|
|
RString *pStringToFill;
|
2003-10-15 01:09:29 +00:00
|
|
|
};
|
|
|
|
|
|
2004-03-08 02:21:22 +00:00
|
|
|
void GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &vFeatsOut ) const;
|
2005-03-21 12:21:58 +00:00
|
|
|
bool AnyPlayerHasRankingFeats() const;
|
2006-01-22 01:00:06 +00:00
|
|
|
void StoreRankingName( PlayerNumber pn, RString name ); // Called by name entry screens
|
|
|
|
|
vector<RString*> m_vpsNamesThatWereFilled; // filled on StoreRankingName,
|
2003-10-14 01:23:16 +00:00
|
|
|
|
2004-03-07 04:34:49 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Award stuff
|
|
|
|
|
//
|
|
|
|
|
// lowest priority in front, highest priority at the back.
|
|
|
|
|
deque<PerDifficultyAward> m_vLastPerDifficultyAwards[NUM_PLAYERS];
|
|
|
|
|
deque<PeakComboAward> m_vLastPeakComboAwards[NUM_PLAYERS];
|
|
|
|
|
|
|
|
|
|
|
2003-12-28 19:46:50 +00:00
|
|
|
//
|
|
|
|
|
// Attract stuff
|
|
|
|
|
//
|
2004-03-20 19:15:06 +00:00
|
|
|
int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting
|
2005-10-04 06:51:06 +00:00
|
|
|
bool IsTimeToPlayAttractSounds() const;
|
2006-01-22 01:00:06 +00:00
|
|
|
void VisitAttractScreen( const RString sScreenName );
|
2004-07-11 01:58:55 +00:00
|
|
|
|
2004-12-20 06:25:59 +00:00
|
|
|
//
|
|
|
|
|
// PlayerState
|
|
|
|
|
//
|
|
|
|
|
PlayerState* m_pPlayerState[NUM_PLAYERS];
|
2005-08-23 20:55:58 +00:00
|
|
|
PlayerState* m_pMultiPlayerState[NUM_MultiPlayer];
|
2005-01-31 02:00:00 +00:00
|
|
|
|
2005-02-21 17:29:49 +00:00
|
|
|
//
|
2008-05-27 20:51:18 +00:00
|
|
|
// Preferences
|
|
|
|
|
//
|
|
|
|
|
static Preference<bool> m_bAutoJoin;
|
|
|
|
|
|
2005-02-21 17:29:49 +00:00
|
|
|
//
|
|
|
|
|
// These options have weird interactions depending on m_bEventMode,
|
|
|
|
|
// so wrap them
|
2008-05-27 20:51:18 +00:00
|
|
|
//
|
2005-02-21 17:29:49 +00:00
|
|
|
bool m_bTemporaryEventMode;
|
2005-04-05 08:30:57 +00:00
|
|
|
bool IsEventMode() const;
|
2006-08-06 02:58:55 +00:00
|
|
|
CoinMode GetCoinMode() const;
|
|
|
|
|
Premium GetPremium() const;
|
2005-02-21 17:29:49 +00:00
|
|
|
|
2005-02-24 11:36:19 +00:00
|
|
|
//
|
|
|
|
|
// Edit stuff
|
|
|
|
|
//
|
2005-02-25 05:27:28 +00:00
|
|
|
BroadcastOnChange<StepsType> m_stEdit;
|
2006-02-20 04:25:53 +00:00
|
|
|
BroadcastOnChange<CourseDifficulty> m_cdEdit;
|
2005-02-25 05:27:28 +00:00
|
|
|
BroadcastOnChangePtr<Steps> m_pEditSourceSteps;
|
|
|
|
|
BroadcastOnChange<StepsType> m_stEditSource;
|
2005-06-26 21:31:07 +00:00
|
|
|
BroadcastOnChange<int> m_iEditCourseEntryIndex;
|
2006-01-22 01:00:06 +00:00
|
|
|
BroadcastOnChange<RString> m_sEditLocalProfileID;
|
2005-08-04 21:13:29 +00:00
|
|
|
Profile* GetEditLocalProfile();
|
2008-03-12 23:17:39 +00:00
|
|
|
int8_t m_iEditMidiNote;
|
2005-02-24 11:36:19 +00:00
|
|
|
|
2005-04-09 09:34:54 +00:00
|
|
|
// Workout stuff
|
|
|
|
|
float GetGoalPercentComplete( PlayerNumber pn );
|
|
|
|
|
bool IsGoalComplete( PlayerNumber pn ) { return GetGoalPercentComplete( pn ) >= 1; }
|
|
|
|
|
|
2005-02-12 21:07:13 +00:00
|
|
|
// Lua
|
2005-02-13 04:12:02 +00:00
|
|
|
void PushSelf( lua_State *L );
|
2007-08-11 20:43:01 +00:00
|
|
|
|
|
|
|
|
// Keep extra stage logic internal to GameState.
|
|
|
|
|
private:
|
|
|
|
|
bool HasEarnedExtraStageInternal() const;
|
|
|
|
|
int m_iAwardedExtraStages[NUM_PLAYERS];
|
|
|
|
|
bool m_bEarnedExtraStage;
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
};
|
|
|
|
|
|
2006-11-21 01:32:05 +00:00
|
|
|
PlayerNumber GetNextHumanPlayer( PlayerNumber pn );
|
|
|
|
|
PlayerNumber GetNextEnabledPlayer( PlayerNumber pn );
|
|
|
|
|
PlayerNumber GetNextCpuPlayer( PlayerNumber pn );
|
|
|
|
|
PlayerNumber GetNextPotentialCpuPlayer( PlayerNumber pn );
|
|
|
|
|
|
|
|
|
|
#define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) )
|
|
|
|
|
#define FOREACH_EnabledPlayer( pn ) for( PlayerNumber pn=GetNextEnabledPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextEnabledPlayer(pn) )
|
|
|
|
|
#define FOREACH_CpuPlayer( pn ) for( PlayerNumber pn=GetNextCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextCpuPlayer(pn) )
|
|
|
|
|
#define FOREACH_PotentialCpuPlayer( pn ) for( PlayerNumber pn=GetNextPotentialCpuPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextPotentialCpuPlayer(pn) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MultiPlayer GetNextEnabledMultiPlayer( MultiPlayer mp );
|
|
|
|
|
#define FOREACH_EnabledMultiPlayer( mp ) for( MultiPlayer mp=GetNextEnabledMultiPlayer((MultiPlayer)-1); mp!=MultiPlayer_Invalid; mp=GetNextEnabledMultiPlayer(mp) )
|
2002-07-23 01:41:40 +00:00
|
|
|
|
|
|
|
|
extern GameState* GAMESTATE; // global and accessable from anywhere in our program
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2004-06-08 01:24:17 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 Chris Danford, Glenn Maynard, Chris Gomez
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|