Files
itgmania212121/stepmania/src/GameConstantsAndTypes.h
T

411 lines
10 KiB
C
Raw Normal View History

2004-05-31 22:42:12 +00:00
/* GameConstantsAndTypes - Things used in many places that don't change often. */
2002-11-16 07:36:02 +00:00
#ifndef GAME_CONSTANTS_AND_TYPES_H
#define GAME_CONSTANTS_AND_TYPES_H
#include "PlayerNumber.h" // TODO: Get rid of this dependency. -Chris
2004-03-29 09:44:00 +00:00
#include "EnumHelper.h"
2002-07-27 19:29:51 +00:00
2004-02-10 09:42:01 +00:00
//
2002-05-27 08:23:27 +00:00
// Note definitions
//
2004-08-18 02:58:53 +00:00
const int MAX_METER = 13;
2003-12-09 10:20:18 +00:00
const int MIN_METER = 1;
2003-08-11 06:09:57 +00:00
2004-07-11 07:21:33 +00:00
2003-11-26 04:21:59 +00:00
/* This is just cached song data. Not all of it may actually be displayed
* in the radar. */
enum RadarCategory
2002-05-27 08:23:27 +00:00
{
RADAR_STREAM = 0,
RADAR_VOLTAGE,
RADAR_AIR,
2002-06-23 11:43:53 +00:00
RADAR_FREEZE,
2002-06-24 22:04:31 +00:00
RADAR_CHAOS,
2003-11-26 04:21:59 +00:00
RADAR_NUM_TAPS_AND_HOLDS,
RADAR_NUM_JUMPS,
RADAR_NUM_HOLDS,
RADAR_NUM_MINES,
RADAR_NUM_HANDS,
2005-04-25 09:35:22 +00:00
RADAR_NUM_ROLLS,
2003-01-30 07:18:33 +00:00
NUM_RADAR_CATEGORIES // leave this at the end
2002-05-27 08:23:27 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RADAR_CATEGORIES, rc )
2004-03-12 08:31:40 +00:00
const CString& RadarCategoryToString( RadarCategory cat );
2005-02-03 03:11:30 +00:00
const CString& RadarCategoryToThemedString( RadarCategory cat );
2002-05-27 08:23:27 +00:00
2003-04-22 08:43:12 +00:00
2003-08-07 06:16:17 +00:00
enum StepsType
2002-05-27 08:23:27 +00:00
{
2003-08-07 06:16:17 +00:00
STEPS_TYPE_DANCE_SINGLE = 0,
STEPS_TYPE_DANCE_DOUBLE,
STEPS_TYPE_DANCE_COUPLE,
STEPS_TYPE_DANCE_SOLO,
STEPS_TYPE_PUMP_SINGLE,
STEPS_TYPE_PUMP_HALFDOUBLE,
STEPS_TYPE_PUMP_DOUBLE,
STEPS_TYPE_PUMP_COUPLE,
STEPS_TYPE_EZ2_SINGLE,
STEPS_TYPE_EZ2_DOUBLE,
STEPS_TYPE_EZ2_REAL,
STEPS_TYPE_PARA_SINGLE,
2004-07-10 18:22:26 +00:00
STEPS_TYPE_PARA_VERSUS,
2003-08-07 06:16:17 +00:00
STEPS_TYPE_DS3DDX_SINGLE,
2004-09-25 17:41:31 +00:00
STEPS_TYPE_BM_SINGLE5,
STEPS_TYPE_BM_DOUBLE5,
STEPS_TYPE_BM_SINGLE7,
STEPS_TYPE_BM_DOUBLE7,
STEPS_TYPE_MANIAX_SINGLE,
2003-09-03 04:30:29 +00:00
STEPS_TYPE_MANIAX_DOUBLE,
STEPS_TYPE_TECHNO_SINGLE4,
STEPS_TYPE_TECHNO_SINGLE5,
2003-09-03 04:30:29 +00:00
STEPS_TYPE_TECHNO_SINGLE8,
STEPS_TYPE_TECHNO_DOUBLE4,
STEPS_TYPE_TECHNO_DOUBLE5,
2003-10-07 00:01:32 +00:00
STEPS_TYPE_PNM_FIVE,
STEPS_TYPE_PNM_NINE,
2004-04-20 02:35:30 +00:00
STEPS_TYPE_LIGHTS_CABINET,
2003-08-07 06:38:18 +00:00
NUM_STEPS_TYPES, // leave this at the end
2003-08-07 06:16:17 +00:00
STEPS_TYPE_INVALID,
2002-05-27 08:23:27 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_StepsType( st ) FOREACH_ENUM( StepsType, NUM_STEPS_TYPES, st )
2002-05-27 08:23:27 +00:00
//
2002-05-27 08:23:27 +00:00
// Play mode stuff
//
2002-05-27 08:23:27 +00:00
enum PlayMode
{
PLAY_MODE_REGULAR,
PLAY_MODE_NONSTOP, // DDR EX Nonstop
PLAY_MODE_ONI, // DDR EX Challenge
PLAY_MODE_ENDLESS, // DDR PlayStation Endless
2003-08-19 04:27:50 +00:00
PLAY_MODE_BATTLE, // manually launched attacks
PLAY_MODE_RAVE, // automatically launched attacks - DDR Disney Rave "Dance Magic"
2002-06-24 22:04:31 +00:00
NUM_PLAY_MODES,
PLAY_MODE_INVALID
2002-05-27 08:23:27 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PLAY_MODES, pm )
2004-03-12 08:31:40 +00:00
const CString& PlayModeToString( PlayMode pm );
2005-02-03 03:11:30 +00:00
const CString& PlayModeToThemedString( PlayMode pm );
2004-03-12 08:31:40 +00:00
PlayMode StringToPlayMode( const CString& s );
2002-05-27 08:23:27 +00:00
2002-05-01 19:14:55 +00:00
2004-03-12 08:31:40 +00:00
enum SortOrder {
SORT_PREFERRED,
2002-05-01 19:14:55 +00:00
SORT_GROUP,
SORT_TITLE,
SORT_BPM,
2005-04-15 07:18:40 +00:00
SORT_POPULARITY,
SORT_TOP_GRADES,
2003-06-16 20:23:07 +00:00
SORT_ARTIST,
2005-03-02 01:48:38 +00:00
SORT_GENRE,
2003-06-27 08:06:22 +00:00
SORT_EASY_METER,
SORT_MEDIUM_METER,
SORT_HARD_METER,
2004-01-27 05:37:43 +00:00
SORT_CHALLENGE_METER,
SORT_MODE_MENU,
SORT_ALL_COURSES,
SORT_NONSTOP_COURSES,
SORT_ONI_COURSES,
SORT_ENDLESS_COURSES,
2003-02-17 20:38:57 +00:00
SORT_ROULETTE,
2003-06-16 17:28:58 +00:00
NUM_SORT_ORDERS,
SORT_INVALID
2002-05-01 19:14:55 +00:00
};
2004-03-12 08:31:40 +00:00
const SortOrder MAX_SELECTABLE_SORT = (SortOrder)(SORT_ROULETTE-1);
#define FOREACH_SortOrder( so ) FOREACH_ENUM( SortOrder, NUM_SORT_ORDERS, so )
const CString& SortOrderToString( SortOrder so );
SortOrder StringToSortOrder( const CString& str );
2002-05-01 19:14:55 +00:00
2004-03-12 08:31:40 +00:00
inline bool IsSongSort( SortOrder so ) { return so >= SORT_PREFERRED && so <= SORT_CHALLENGE_METER; }
2002-05-01 19:14:55 +00:00
//
2002-06-24 22:04:31 +00:00
// Scoring stuff
//
2002-06-24 22:04:31 +00:00
enum TapNoteScore {
TNS_NONE,
2004-01-02 08:43:14 +00:00
TNS_HIT_MINE,
TNS_AVOIDED_MINE,
2002-06-24 22:04:31 +00:00
TNS_MISS,
TNS_BOO,
TNS_GOOD,
TNS_GREAT,
2002-07-28 20:28:37 +00:00
TNS_PERFECT,
TNS_MARVELOUS,
NUM_TAP_NOTE_SCORES,
TNS_INVALID,
2002-06-24 22:04:31 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TAP_NOTE_SCORES, tns )
2004-03-12 08:31:40 +00:00
const CString& TapNoteScoreToString( TapNoteScore tns );
2005-02-03 03:11:30 +00:00
const CString& TapNoteScoreToThemedString( TapNoteScore tns );
TapNoteScore StringToTapNoteScore( const CString& str );
2002-06-24 22:04:31 +00:00
enum HoldNoteScore
{
HNS_NONE, // this HoldNote has not been scored yet
2002-07-28 20:28:37 +00:00
HNS_NG, // the HoldNote has passed and they missed it
HNS_OK, // the HoldNote has passed and was successfully held all the way through
2002-07-28 20:28:37 +00:00
NUM_HOLD_NOTE_SCORES
2002-06-24 22:04:31 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HOLD_NOTE_SCORES, hns )
2004-07-19 08:05:14 +00:00
const CString& HoldNoteScoreToString( HoldNoteScore hns );
2005-02-03 03:11:30 +00:00
const CString& HoldNoteScoreToThemedString( HoldNoteScore hns );
HoldNoteScore StringToHoldNoteScore( const CString& str );
2002-06-24 22:04:31 +00:00
//
2004-02-08 01:05:53 +00:00
// Profile and MemCard stuff
//
2004-02-08 01:05:53 +00:00
enum ProfileSlot
{
2004-02-08 01:05:53 +00:00
PROFILE_SLOT_PLAYER_1,
PROFILE_SLOT_PLAYER_2,
PROFILE_SLOT_MACHINE,
NUM_PROFILE_SLOTS,
PROFILE_SLOT_INVALID
};
2004-02-10 09:42:01 +00:00
#define FOREACH_ProfileSlot( slot ) FOREACH_ENUM( ProfileSlot, NUM_PROFILE_SLOTS, slot )
enum MemoryCardState
{
MEMORY_CARD_STATE_READY,
MEMORY_CARD_STATE_CHECKING,
MEMORY_CARD_STATE_TOO_LATE,
MEMORY_CARD_STATE_ERROR,
MEMORY_CARD_STATE_REMOVED,
MEMORY_CARD_STATE_NO_CARD,
NUM_MEMORY_CARD_STATES,
MEMORY_CARD_STATE_INVALID,
};
2004-03-12 08:31:40 +00:00
const CString& MemoryCardStateToString( MemoryCardState mcs );
2003-01-22 05:29:27 +00:00
//
2003-01-27 02:00:38 +00:00
// Ranking stuff
2003-01-22 05:29:27 +00:00
//
2003-01-26 07:33:03 +00:00
enum RankingCategory
2003-01-22 05:29:27 +00:00
{
2003-01-26 07:33:03 +00:00
RANKING_A, // 1-3 meter per song avg.
RANKING_B, // 4-6 meter per song avg.
RANKING_C, // 7-9 meter per song avg.
RANKING_D, // 10+ meter per song avg. // doesn't count extra stage!
NUM_RANKING_CATEGORIES,
RANKING_INVALID
2003-01-22 05:29:27 +00:00
};
2004-02-10 09:42:01 +00:00
#define FOREACH_RankingCategory( rc ) FOREACH_ENUM( RankingCategory, NUM_RANKING_CATEGORIES, rc )
2004-03-12 08:31:40 +00:00
const CString& RankingCategoryToString( RankingCategory rc );
RankingCategory StringToRankingCategory( const CString& rc );
const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"};
2004-03-12 08:31:40 +00:00
inline bool IsRankingToFillIn( const CString& sName ) { return !sName.empty() && sName[0]=='#'; }
2004-08-30 06:41:56 +00:00
RankingCategory AverageMeterToRankingCategory( int iAverageMeter );
2003-01-27 02:00:38 +00:00
const int NUM_RANKING_LINES = 5;
2003-02-25 00:33:42 +00:00
//
// Group stuff
//
#define GROUP_ALL_MUSIC CString("--ALL MUSIC--")
2003-02-25 00:33:42 +00:00
2003-04-07 21:24:14 +00:00
//
//
//
enum PlayerController
{
PC_HUMAN,
PC_CPU,
PC_AUTOPLAY,
2003-04-07 21:24:14 +00:00
NUM_PLAYER_CONTROLLERS
};
const int MIN_SKILL = 0;
const int MAX_SKILL = 10;
2003-04-07 21:24:14 +00:00
2003-06-30 18:08:27 +00:00
enum StageResult
{
RESULT_WIN,
RESULT_LOSE,
RESULT_DRAW
};
2003-02-25 02:51:04 +00:00
//
// Battle stuff
//
const int NUM_INVENTORY_SLOTS = 3;
enum AttackLevel
{
ATTACK_LEVEL_1,
ATTACK_LEVEL_2,
ATTACK_LEVEL_3,
NUM_ATTACK_LEVELS
};
const int NUM_ATTACKS_PER_LEVEL = 3;
const int ITEM_NONE = -1;
2003-12-10 09:26:05 +00:00
#define BG_ANIMS_DIR CString("BGAnimations/")
#define VISUALIZATIONS_DIR CString("Visualizations/")
#define RANDOMMOVIES_DIR CString("RandomMovies/")
2004-07-11 01:58:55 +00:00
#define DATA_DIR CString("Data/")
//
// Coin stuff
//
2003-04-19 19:05:25 +00:00
enum CoinMode { COIN_HOME, COIN_PAY, COIN_FREE, NUM_COIN_MODES };
2004-03-12 08:31:40 +00:00
const CString& CoinModeToString( CoinMode cm );
//
// Premium
//
enum Premium { PREMIUM_NONE, PREMIUM_DOUBLES, PREMIUM_JOINT, NUM_PREMIUMS };
const CString& PremiumToString( Premium p );
2004-03-07 04:34:49 +00:00
//
// Award stuff
//
enum PerDifficultyAward
{
AWARD_FULL_COMBO_GREATS,
AWARD_SINGLE_DIGIT_GREATS,
2004-03-25 08:32:47 +00:00
AWARD_ONE_GREAT,
2004-06-22 08:41:25 +00:00
AWARD_FULL_COMBO_PERFECTS,
AWARD_SINGLE_DIGIT_PERFECTS,
2004-03-25 08:32:47 +00:00
AWARD_ONE_PERFECT,
2004-06-22 08:41:25 +00:00
AWARD_FULL_COMBO_MARVELOUSES,
2004-03-07 04:34:49 +00:00
AWARD_GREATS_80_PERCENT,
AWARD_GREATS_90_PERCENT,
AWARD_GREATS_100_PERCENT,
NUM_PER_DIFFICULTY_AWARDS,
PER_DIFFICULTY_AWARD_INVALID,
};
#define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS, pma )
2004-03-12 08:31:40 +00:00
const CString& PerDifficultyAwardToString( PerDifficultyAward pma );
2005-02-03 03:11:30 +00:00
const CString& PerDifficultyAwardToThemedString( PerDifficultyAward pma );
2004-03-12 08:31:40 +00:00
PerDifficultyAward StringToPerDifficultyAward( const CString& pma );
2004-03-07 04:34:49 +00:00
enum PeakComboAward
{
AWARD_1000_PEAK_COMBO,
AWARD_2000_PEAK_COMBO,
AWARD_3000_PEAK_COMBO,
AWARD_4000_PEAK_COMBO,
AWARD_5000_PEAK_COMBO,
AWARD_6000_PEAK_COMBO,
AWARD_7000_PEAK_COMBO,
AWARD_8000_PEAK_COMBO,
AWARD_9000_PEAK_COMBO,
AWARD_10000_PEAK_COMBO,
NUM_PEAK_COMBO_AWARDS,
PEAK_COMBO_AWARD_INVALID,
};
#define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PEAK_COMBO_AWARDS, pca )
2004-03-12 08:31:40 +00:00
const CString& PeakComboAwardToString( PeakComboAward pma );
2005-02-03 03:11:30 +00:00
const CString& PeakComboAwardToThemedString( PeakComboAward pma );
2004-03-12 08:31:40 +00:00
PeakComboAward StringToPeakComboAward( const CString& pma );
2004-03-07 04:34:49 +00:00
struct DisplayBpms
{
void Add( float f );
float GetMin() const;
float GetMax() const;
bool BpmIsConstant() const;
2005-03-10 22:54:55 +00:00
bool IsSecret() const;
vector<float> vfBpms;
};
enum StyleType
{
ONE_PLAYER_ONE_SIDE, // e.g. single
TWO_PLAYERS_TWO_SIDES, // e.g. versus
ONE_PLAYER_TWO_SIDES, // e.g. double
NUM_STYLE_TYPES
};
const CString& StyleTypeToString( StyleType s );
StyleType StringToStyleType( const CString& s );
2005-02-06 05:15:57 +00:00
enum MenuDir
{
MENU_DIR_UP,
MENU_DIR_DOWN,
MENU_DIR_LEFT,
MENU_DIR_RIGHT,
MENU_DIR_AUTO, // when players join and the selection becomes invalid
NUM_MENU_DIRS
};
#define FOREACH_MenuDir( md ) FOREACH_ENUM( MenuDir, NUM_MENU_DIRS, md )
const CString& MenuDirToString( MenuDir md );
2005-02-17 19:36:10 +00:00
enum GoalType
{
GOAL_CALORIES,
GOAL_TIME,
GOAL_NONE,
NUM_GOAL_TYPES,
GOAL_INVALID,
};
#define FOREACH_GoalType( md ) FOREACH_ENUM( GoalType, NUM_GOAL_TYPES, gt )
const CString& GoalTypeToString( GoalType gt );
GoalType StringToGoalType( const CString& s );
2005-04-14 06:34:17 +00:00
enum EditMode
{
EDIT_MODE_PRACTICE, // subset of EDIT_MODE_HOME
EDIT_MODE_HOME, // subset of EDIT_MODE_FULL
EDIT_MODE_FULL, // complete
NUM_EDIT_MODES,
EDIT_MODE_INVALID,
};
2002-11-16 07:36:02 +00:00
#endif
2004-05-31 22:42:12 +00:00
/*
* (c) 2001-2004 Chris Danford, 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.
*/