Files
itgmania212121/stepmania/src/PlayerOptions.h
T

202 lines
6.2 KiB
C++
Raw Normal View History

2004-05-31 21:55:14 +00:00
/* PlayerOptions - Per-player options that are not saved between sessions. */
2002-07-27 19:29:51 +00:00
2004-05-31 21:55:14 +00:00
#ifndef PLAYER_OPTIONS_H
#define PLAYER_OPTIONS_H
2002-07-27 19:29:51 +00:00
2006-11-29 14:57:21 +00:00
class Course;
class Song;
class Steps;
2004-06-03 08:22:02 +00:00
class Trail;
#include "GameConstantsAndTypes.h"
2007-06-09 07:49:40 +00:00
#include "PlayerNumber.h"
class PlayerOptions
2002-07-27 19:29:51 +00:00
{
public:
PlayerOptions() { Init(); };
void Init();
void Approach( const PlayerOptions& other, float fDeltaSeconds );
2006-08-18 00:09:09 +00:00
RString GetString( bool bForceNoteSkin = false ) const;
2006-01-22 01:00:06 +00:00
RString GetSavedPrefsString() const; // only the basic options that players would want for every song
2004-11-14 05:25:30 +00:00
void ResetSavedPrefs();
2006-08-18 00:09:09 +00:00
void GetMods( vector<RString> &AddTo, bool bForceNoteSkin = false ) const;
2006-01-29 22:17:54 +00:00
void GetLocalizedMods( vector<RString> &AddTo ) const;
void FromString( const RString &sMultipleMods );
bool FromOneModString( const RString &sOneMod, RString &sErrorDetailOut ); // On error, return false and optionally set sErrorDetailOut
void ChooseRandomModifiers();
bool ContainsTransformOrTurn() const;
2004-01-18 07:44:39 +00:00
bool operator==( const PlayerOptions &other ) const;
bool operator!=( const PlayerOptions &other ) const { return !operator==(other); }
2004-01-11 04:33:21 +00:00
enum Accel {
2003-01-25 11:05:12 +00:00
ACCEL_BOOST,
2003-04-01 19:31:27 +00:00
ACCEL_BRAKE,
2003-01-25 11:05:12 +00:00
ACCEL_WAVE,
ACCEL_EXPAND,
ACCEL_BOOMERANG,
NUM_ACCELS
};
enum Effect {
2002-09-30 02:19:02 +00:00
EFFECT_DRUNK,
EFFECT_DIZZY,
2008-05-06 00:19:54 +00:00
EFFECT_CONFUSION,
2002-09-30 02:19:02 +00:00
EFFECT_MINI,
2006-04-05 02:59:16 +00:00
EFFECT_TINY,
2002-09-30 02:19:02 +00:00
EFFECT_FLIP,
2005-05-05 21:40:54 +00:00
EFFECT_INVERT,
2002-09-30 02:19:02 +00:00
EFFECT_TORNADO,
EFFECT_TIPSY,
2003-07-09 01:34:48 +00:00
EFFECT_BUMPY,
2003-07-09 10:40:34 +00:00
EFFECT_BEAT,
NUM_EFFECTS
};
enum Appearance {
2003-01-25 11:05:12 +00:00
APPEARANCE_HIDDEN,
2005-04-20 08:54:12 +00:00
APPEARANCE_HIDDEN_OFFSET,
2003-01-25 11:05:12 +00:00
APPEARANCE_SUDDEN,
2005-04-20 08:54:12 +00:00
APPEARANCE_SUDDEN_OFFSET,
2003-01-25 11:05:12 +00:00
APPEARANCE_STEALTH,
APPEARANCE_BLINK,
APPEARANCE_RANDOMVANISH,
NUM_APPEARANCES
};
enum Turn {
2003-01-25 11:05:12 +00:00
TURN_NONE=0,
TURN_MIRROR,
TURN_LEFT,
TURN_RIGHT,
TURN_SHUFFLE,
TURN_SUPER_SHUFFLE,
NUM_TURNS
};
enum Transform {
2003-11-07 08:45:21 +00:00
TRANSFORM_NOHOLDS,
2005-04-25 09:42:26 +00:00
TRANSFORM_NOROLLS,
2003-11-07 08:45:21 +00:00
TRANSFORM_NOMINES,
TRANSFORM_LITTLE,
2003-02-19 22:58:14 +00:00
TRANSFORM_WIDE,
2003-02-20 00:57:52 +00:00
TRANSFORM_BIG,
TRANSFORM_QUICK,
TRANSFORM_BMRIZE,
2003-03-13 09:25:57 +00:00
TRANSFORM_SKIPPY,
2003-08-10 10:12:50 +00:00
TRANSFORM_MINES,
2003-11-07 05:17:41 +00:00
TRANSFORM_ECHO,
TRANSFORM_STOMP,
2004-08-29 21:26:52 +00:00
TRANSFORM_PLANTED,
TRANSFORM_FLOORED,
2003-11-07 08:45:21 +00:00
TRANSFORM_TWISTER,
2004-01-11 06:34:30 +00:00
TRANSFORM_NOJUMPS,
2004-01-02 11:25:21 +00:00
TRANSFORM_NOHANDS,
2004-01-12 03:47:55 +00:00
TRANSFORM_NOQUADS,
TRANSFORM_NOSTRETCH,
NUM_TRANSFORMS
};
2003-08-17 00:15:54 +00:00
enum Scroll {
SCROLL_REVERSE=0,
SCROLL_SPLIT,
SCROLL_ALTERNATE,
2004-02-23 05:33:33 +00:00
SCROLL_CROSS,
2004-08-29 07:12:37 +00:00
SCROLL_CENTERED,
2003-08-17 00:15:54 +00:00
NUM_SCROLLS
};
2005-01-09 07:47:38 +00:00
enum ScoreDisplay {
SCORING_ADD=0,
SCORING_SUBTRACT,
SCORING_AVERAGE,
NUM_SCOREDISPLAYS
};
float GetReversePercentForColumn( int iCol ) const; // accounts for all Directions
2003-08-17 00:15:54 +00:00
2003-10-26 08:37:48 +00:00
/* All floats have a corresponding speed setting, which determines how fast
* PlayerOptions::Approach approaches. */
bool m_bSetScrollSpeed; // true if the scroll speed was set by FromString
float m_fTimeSpacing, m_SpeedfTimeSpacing; // instead of Beat spacing
float m_fScrollSpeed, m_SpeedfScrollSpeed; // used if !m_bTimeSpacing
float m_fScrollBPM, m_SpeedfScrollBPM; // used if m_bTimeSpacing
float m_fAccels[NUM_ACCELS], m_SpeedfAccels[NUM_ACCELS];
float m_fEffects[NUM_EFFECTS], m_SpeedfEffects[NUM_EFFECTS];
float m_fAppearances[NUM_APPEARANCES],m_SpeedfAppearances[NUM_APPEARANCES];
float m_fScrolls[NUM_SCROLLS], m_SpeedfScrolls[NUM_SCROLLS];
float m_fDark, m_SpeedfDark;
float m_fBlind, m_SpeedfBlind;
float m_fCover, m_SpeedfCover; // hide the background per-player--can't think of a good name
2005-04-17 00:55:12 +00:00
bool m_bSetTiltOrSkew; // true if the tilt or skew was set by FromString
float m_fPerspectiveTilt, m_SpeedfPerspectiveTilt; // -1 = near, 0 = overhead, +1 = space
float m_fSkew, m_SpeedfSkew; // 0 = vanish point is in center of player, 1 = vanish point is in center of screen
2003-10-26 08:37:48 +00:00
float m_fRandomSpeed, m_SpeedfRandomSpeed;
/* If this is > 0, then the player must have life above this value at the end of
* the song to pass. This is independent of SongOptions::m_FailType. */
float m_fPassmark, m_SpeedfPassmark;
2005-01-09 07:47:38 +00:00
2004-03-01 00:09:07 +00:00
bool m_bTurns[NUM_TURNS];
2003-11-07 08:45:21 +00:00
bool m_bTransforms[NUM_TRANSFORMS];
2007-01-16 02:23:12 +00:00
bool m_bMuteOnError;
ScoreDisplay m_ScoreDisplay;
enum FailType {
FAIL_IMMEDIATE=0, // fail immediately when life touches 0
FAIL_IMMEDIATE_CONTINUE, // fail immediately when life touches 0, but allow playing the rest of the song
FAIL_AT_END, // fail if life is at 0 when the song ends
FAIL_OFF // never fail
};
FailType m_FailType;
2005-01-09 07:47:38 +00:00
RString m_sNoteSkin; // "" means "no change"
2003-04-10 08:49:25 +00:00
void NextAccel();
void NextEffect();
void NextAppearance();
void NextTurn();
void NextTransform();
2003-04-01 19:31:27 +00:00
void NextPerspective();
2003-08-17 00:15:54 +00:00
void NextScroll();
Accel GetFirstAccel();
Effect GetFirstEffect();
Appearance GetFirstAppearance();
2003-08-17 00:15:54 +00:00
Scroll GetFirstScroll();
void SetOneAccel( Accel a );
void SetOneEffect( Effect e );
void SetOneAppearance( Appearance a );
2003-08-17 00:15:54 +00:00
void SetOneScroll( Scroll s );
2004-03-01 00:09:07 +00:00
void ToggleOneTurn( Turn t );
// return true if any mods being used will make the song(s) easier
bool IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerNumber pn ) const;
2006-03-26 17:48:39 +00:00
bool IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) const;
2002-07-27 19:29:51 +00:00
};
#endif
2004-05-31 21:55:14 +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.
*/