diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt
index 42aa62444b..a8cf1eb9b6 100644
--- a/Docs/Changelog_sm5.txt
+++ b/Docs/Changelog_sm5.txt
@@ -14,6 +14,8 @@ StepMania current development
P2's lifemeter. Use LifeMeterChangedP2. "Life" and "StepsSecond" are passed
in the params table for the message.
* [LifeMeterBattery] CourseSongRewardLives metric added.
+* [LifeMeter] LifeType, DrainType, and BatteryLives moved to PlayerOptions so
+ the players can have different settings.
2013/10/09
----------
diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml
index a06025a9f1..e9d4837441 100644
--- a/Docs/Luadoc/Lua.xml
+++ b/Docs/Luadoc/Lua.xml
@@ -999,98 +999,101 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1323,6 +1326,7 @@
+
@@ -1513,10 +1517,7 @@
-
-
-
diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml
index 0f9b57048b..1678836a71 100644
--- a/Docs/Luadoc/LuaDocumentation.xml
+++ b/Docs/Luadoc/LuaDocumentation.xml
@@ -2983,117 +2983,101 @@ save yourself some time, copy this for undocumented things:
Enum type options are almost identical to bool type. They take and return an enum value.
For brevity, the functions are only given a description if the option requires careful handling or does not follow the float or bool interfaces.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the player has a CMod set, returns the value of that CMod and its associated approach speed. Returns nil otherwise.
+ If the optional first argument is passed, sets the CMod to the value and disables any XMod or MMod that is set.
+ If the optional second argument is passed, sets the speed at which the transition occurs.
+
+
+
+
+
+
+
+ If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.
+ Returns nil otherwise.
+ If the optional first argument is passed, sets tilt to value and skew to zero.
+ If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
+
+
+
+
+
+
+ Sets the for the player, if the optional argument is provided. Returns the that was previously set.
+
+
+
+
+ Returns true if step attacks or random attacks are enabled.
+
Returns true if the current PlayerOptions makes the current Course/Trail easier.
Returns true if the current PlayerOptions makes the current Song/Steps easier.
-
- TimeSpacing is one of the variables for controlling the speed mod.
- Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
- It controls whether the speed mod is in X mode or C mode. It should only be set to 0 or 1, and is only a float value to allow tweening between the two states.
+
+ If the player is using Hallway (zero skew and negative tilt), returns the value of tilt and its approach_speed.
+ Returns nil otherwise.
+ If the optional first argument is passed, sets tilt to negative value and skew to zero.
+ Pass in a positive value for the familiar meaning of Hallway.
+ If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
+
+
+
+
+ If the player is using Incoming ((positive skew and negative tilt) or (negative skew and positive tilt)), returns the value of skew and its approach_speed.
+ Returns nil otherwise.
+ If the optional first argument is passed, sets tilt to negative value and skew to value.
+ Pass in a positive value for the familiar meaning of Incoming.
+ If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
+
+
+
+
+
MaxScrollBPM is one of the variables for controlling the speed mod.
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
It is the setting for the MMod.
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
-
- ScrollSpeed is one of the variables for controlling the speed mod.
- Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
- It is the setting for the XMod.
-
-
- ScrollBPM is one of the variables for controlling the speed mod.
- Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
- It is the setting for the CMod.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tilt is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
- Tilt tilts the note field forward and back.
-
-
- Skew is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
- Skew moves the vanishing point for the note field away from the center of the screen.
- Skew has no effect in single mode if Center1Player is true.
- Skew has no effect in double mode.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.
+ If the optional first argument is passed, sets the MMod to the value and disables any CMod or XMod that is set.
+ If the optional second argument is passed, sets the speed at which the transition occurs.
+ MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
+
+
+
+
+
-
-
-
- Returns true if the player is using reverse. (equivalent to GetReverse() == 1.0)
-
+
+
Sets the NoteSkin to the named noteskin, unless name is nil or the noteskin does not exist. Returns the name of the previous noteskin and whether the set attempt succeeded.
Changing the noteskin during a song is not supported.
@@ -3101,58 +3085,77 @@ save yourself some time, copy this for undocumented things:
note_name= options:NoteSkin() -- Sets note_name to the player's current noteskin.
prev_note_name, succeeded= options:NoteSkin("cel") -- Sets prev_note_name to the noteskin the player had set, changes the current noteskin to "cel", sets succeeded to true if the the "cel" noteskin exists.
-
- Sets the for the player, if the optional argument is provided. Returns the that was previously set.
+
+ If the player is using Overhead (0 tilt, 0 skew), returns true.
+ If true is passed, sets the tilt and skew to 0.
-
- If the player has a CMod set, returns the value of that CMod and its associated approach speed. Returns nil otherwise.
- If the optional first argument is passed, sets the CMod to the value and disables any XMod or MMod that is set.
- If the optional second argument is passed, sets the speed at which the transition occurs.
-
-
- If the player has a XMod set, returns the value of that XMod and its associated approach speed. Returns nil otherwise.
- If the optional first argument is passed, sets the XMod to the value and disables any CMod or MMod that is set.
- If the optional second argument is passed, sets the speed at which the transition occurs.
-
-
- If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.
- If the optional first argument is passed, sets the MMod to the value and disables any CMod or XMod that is set.
- If the optional second argument is passed, sets the speed at which the transition occurs.
- MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
-
-
- If the player is using Overhead (0 tilt, 0 skew), returns true.
- If true is passed, sets the tilt and skew to 0.
-
-
- If the player is using Incoming ((positive skew and negative tilt) or (negative skew and positive tilt)), returns the value of skew and its approach_speed.
- Returns nil otherwise.
- If the optional first argument is passed, sets tilt to negative value and skew to value.
- Pass in a positive value for the familiar meaning of Incoming.
- If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
-
-
- If the player is using Space ((positive skew and positive tilt) or (negative skew and negative tilt)), returns the value of skew and its approach_speed.
- Returns nil otherwise.
- If the optional first argument is passed, sets tilt to value and skew to value.
- If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
-
-
- If the player is using Hallway (zero skew and negative tilt), returns the value of tilt and its approach_speed.
- Returns nil otherwise.
- If the optional first argument is passed, sets tilt to negative value and skew to zero.
- Pass in a positive value for the familiar meaning of Hallway.
- If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
-
-
- If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.
- Returns nil otherwise.
- If the optional first argument is passed, sets tilt to value and skew to zero.
- If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
-
-
- Returns true if step attacks or random attacks are enabled.
-
+
+
+
+
+
+
+
+
+
+
+
+ ScrollBPM is one of the variables for controlling the speed mod.
+ Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
+ It is the setting for the CMod.
+
+
+ ScrollSpeed is one of the variables for controlling the speed mod.
+ Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
+ It is the setting for the XMod.
+
+
+
+ Skew is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
+ Skew moves the vanishing point for the note field away from the center of the screen.
+ Skew has no effect in single mode if Center1Player is true.
+ Skew has no effect in double mode.
+
+
+
+
+ If the player is using Space ((positive skew and positive tilt) or (negative skew and negative tilt)), returns the value of skew and its approach_speed.
+ Returns nil otherwise.
+ If the optional first argument is passed, sets tilt to value and skew to value.
+ If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
+
+
+
+
+
+
+
+
+ TimeSpacing is one of the variables for controlling the speed mod.
+ Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.
+ It controls whether the speed mod is in X mode or C mode. It should only be set to 0 or 1, and is only a float value to allow tweening between the two states.
+
+
+ Tilt is one of the mods for controlling the perspective. Use Overhead, Distant, Incoming, Space, Distant, or Hallway for controlling the perspective in the old way.
+ Tilt tilts the note field forward and back.
+
+
+
+
+
+
+
+
+ Returns true if the player is using reverse. (equivalent to GetReverse() == 1.0)
+
+
+
+
+ If the player has a XMod set, returns the value of that XMod and its associated approach speed. Returns nil otherwise.
+ If the optional first argument is passed, sets the XMod to the value and disables any CMod or MMod that is set.
+ If the optional second argument is passed, sets the speed at which the transition occurs.
+
+
@@ -3788,6 +3791,9 @@ save yourself some time, copy this for undocumented things:
Returns true if a single has its NoteField centered.
+
+ Removes the notes for the specified player.
+
Returns a dummy PlayerInfo for the specified index.
@@ -4300,14 +4306,8 @@ save yourself some time, copy this for undocumented things:
See the description for PlayerOptions. The functions follow the same design.
-
-
-
-
-
-
diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini
index cca33326ee..893ffa12a1 100644
--- a/Themes/_fallback/metrics.ini
+++ b/Themes/_fallback/metrics.ini
@@ -2539,20 +2539,20 @@ Persp,4="mod,hallway;name,Hallway"
Persp,5="mod,distant;name,Distant"
# Song options
-# LifeType="3;together"
-LifeType=(GAMESTATE:IsCourseMode() and 3 or 2)..";together"
+# LifeType="3"
+LifeType=(GAMESTATE:IsCourseMode() and 3 or 2)..""
LifeTypeDefault=""
LifeType,1="mod,bar;name,Bar"
LifeType,2="mod,battery;name,Battery"
LifeType,3="mod,lifetime;name,LifeTime"
#
-BarDrain="3;together"
+BarDrain="3"
BarDrainDefault=""
BarDrain,1="mod,normal-drain;name,Normal"
BarDrain,2="mod,norecover;name,NoRecover"
BarDrain,3="mod,suddendeath;name,SuddenDeath"
#
-BatLives="10;together"
+BatLives="10"
BatLivesDefault=""
BatLives,1="mod,1 life;name,1"
BatLives,2="mod,2 lives;name,2"
diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp
index ddcd21271e..60d788df96 100644
--- a/src/GameCommand.cpp
+++ b/src/GameCommand.cpp
@@ -868,11 +868,14 @@ void GameCommand::ApplySelf( const vector &vpns ) const
}
// HACK: Set life type to BATTERY just once here so it happens once and
// we don't override the user's changes if they back out.
- if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI &&
- GAMESTATE->m_PlayMode != OldPlayMode &&
- GAMESTATE->m_SongOptions.GetStage().m_LifeType == LifeType_Bar )
+ FOREACH_PlayerNumber(pn)
{
- SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery );
+ if(GAMESTATE->m_PlayMode == PLAY_MODE_ONI &&
+ GAMESTATE->m_PlayMode != OldPlayMode &&
+ GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetStage().m_LifeType ==LifeType_Bar)
+ {
+ PO_GROUP_ASSIGN(GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery);
+ }
}
}
diff --git a/src/LifeMeter.h b/src/LifeMeter.h
index 1f45c68bea..7f56e1e756 100644
--- a/src/LifeMeter.h
+++ b/src/LifeMeter.h
@@ -4,7 +4,7 @@
#include "PlayerNumber.h"
#include "GameConstantsAndTypes.h"
#include "ActorFrame.h"
-#include "SongOptions.h"
+#include "PlayerOptions.h"
class PlayerState;
class PlayerStageStats;
diff --git a/src/LifeMeterBar.cpp b/src/LifeMeterBar.cpp
index 09f56eea70..3dda562e5f 100644
--- a/src/LifeMeterBar.cpp
+++ b/src/LifeMeterBar.cpp
@@ -31,21 +31,6 @@ LifeMeterBar::LifeMeterBar()
m_pPlayerState = NULL;
- DrainType dtype = GAMESTATE->m_SongOptions.GetStage().m_DrainType;
- switch( dtype )
- {
- case DrainType_Normal:
- m_fLifePercentage = INITIAL_VALUE;
- break;
-
- /* These types only go down, so they always start at full. */
- case DrainType_NoRecover:
- case DrainType_SuddenDeath:
- m_fLifePercentage = 1.0f; break;
- default:
- FAIL_M(ssprintf("Invalid DrainType: %i", dtype));
- }
-
const RString sType = "LifeMeterBar";
m_fPassingAlpha = 0;
@@ -97,6 +82,20 @@ void LifeMeterBar::Load( const PlayerState *pPlayerState, PlayerStageStats *pPla
PlayerNumber pn = pPlayerState->m_PlayerNumber;
+ DrainType dtype = pPlayerState->m_PlayerOptions.GetStage().m_DrainType;
+ switch( dtype )
+ {
+ case DrainType_Normal:
+ m_fLifePercentage = INITIAL_VALUE;
+ break;
+ /* These types only go down, so they always start at full. */
+ case DrainType_NoRecover:
+ case DrainType_SuddenDeath:
+ m_fLifePercentage = 1.0f; break;
+ default:
+ FAIL_M(ssprintf("Invalid DrainType: %i", dtype));
+ }
+
// Change life difficulty to really easy if merciful beginner on
m_bMercifulBeginnerInEffect =
GAMESTATE->m_PlayMode == PLAY_MODE_REGULAR &&
@@ -129,9 +128,9 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
if( IsHot() && fDeltaLife < 0 )
fDeltaLife = min( fDeltaLife, -0.10f ); // make it take a while to get back to "hot"
- switch( GAMESTATE->m_SongOptions.GetSong().m_DrainType )
+ switch(m_pPlayerState->m_PlayerOptions.GetSong().m_DrainType)
{
- DEFAULT_FAIL( GAMESTATE->m_SongOptions.GetSong().m_DrainType );
+ DEFAULT_FAIL(m_pPlayerState->m_PlayerOptions.GetSong().m_DrainType);
case DrainType_Normal:
break;
case DrainType_NoRecover:
@@ -151,7 +150,7 @@ void LifeMeterBar::ChangeLife( TapNoteScore score )
void LifeMeterBar::ChangeLife( HoldNoteScore score, TapNoteScore tscore )
{
float fDeltaLife=0.f;
- DrainType dtype = GAMESTATE->m_SongOptions.GetSong().m_DrainType;
+ DrainType dtype = m_pPlayerState->m_PlayerOptions.GetSong().m_DrainType;
switch( dtype )
{
case DrainType_Normal:
@@ -219,7 +218,7 @@ void LifeMeterBar::ChangeLife( float fDeltaLife )
if( m_pPlayerStageStats->m_bFailed )
return;
- switch( GAMESTATE->m_SongOptions.GetSong().m_DrainType )
+ switch(m_pPlayerState->m_PlayerOptions.GetSong().m_DrainType)
{
case DrainType_Normal:
case DrainType_NoRecover:
diff --git a/src/LifeMeterBattery.cpp b/src/LifeMeterBattery.cpp
index 4279c85f9b..d95b1f52bb 100644
--- a/src/LifeMeterBattery.cpp
+++ b/src/LifeMeterBattery.cpp
@@ -9,7 +9,7 @@
LifeMeterBattery::LifeMeterBattery()
{
- m_iLivesLeft = GAMESTATE->m_SongOptions.GetStage().m_iBatteryLives;
+ m_iLivesLeft= 4;
m_iTrailingLivesLeft = m_iLivesLeft;
m_soundGainLife.Load( THEME->GetPathS("LifeMeterBattery","gain") );
@@ -20,6 +20,9 @@ void LifeMeterBattery::Load( const PlayerState *pPlayerState, PlayerStageStats *
{
LifeMeter::Load( pPlayerState, pPlayerStageStats );
+ m_iLivesLeft = m_pPlayerState->m_PlayerOptions.GetStage().m_BatteryLives;
+ m_iTrailingLivesLeft = m_iLivesLeft;
+
const RString sType = "LifeMeterBattery";
PlayerNumber pn = pPlayerState->m_PlayerNumber;
@@ -81,7 +84,7 @@ void LifeMeterBattery::OnSongEnded()
if( m_pPlayerStageStats->m_bFailed || m_iLivesLeft == 0 )
return;
- if( m_iLivesLeft < GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives )
+ if( m_iLivesLeft < m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives )
{
m_iTrailingLivesLeft = m_iLivesLeft;
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
@@ -96,12 +99,12 @@ void LifeMeterBattery::OnSongEnded()
PushSelf(L);
LuaHelpers::Push(L, pn);
RString error= "Error running CourseSongRewardLives callback: ";
- LuaHelpers::RunScriptOnStack(L, error, 1, 1, true);
+ LuaHelpers::RunScriptOnStack(L, error, 2, 1, true);
m_iLivesLeft += luaL_optnumber(L, -1, 0);
lua_settop(L, 0);
LUA->Release(L);
}
- m_iLivesLeft = min( m_iLivesLeft, GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives );
+ m_iLivesLeft = min( m_iLivesLeft, m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives );
if( m_iTrailingLivesLeft < m_iLivesLeft )
m_soundGainLife.Play();
@@ -213,7 +216,7 @@ bool LifeMeterBattery::IsInDanger() const
bool LifeMeterBattery::IsHot() const
{
- return m_iLivesLeft == GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives;
+ return m_iLivesLeft == m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives;
}
bool LifeMeterBattery::IsFailing() const
@@ -223,14 +226,14 @@ bool LifeMeterBattery::IsFailing() const
float LifeMeterBattery::GetLife() const
{
- if( !GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives )
+ if(!m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives)
return 1;
- return float(m_iLivesLeft) / GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives;
+ return float(m_iLivesLeft) / m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives;
}
int LifeMeterBattery::GetRemainingLives() const
{
- if( !GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives )
+ if( !m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives )
return 1;
return m_iLivesLeft;
@@ -246,6 +249,11 @@ void LifeMeterBattery::Refresh()
//update m_sprBattery
}
+int LifeMeterBattery::GetTotalLives()
+{
+ return m_pPlayerState->m_PlayerOptions.GetSong().m_BatteryLives;
+}
+
void LifeMeterBattery::Update( float fDeltaTime )
{
LifeMeter::Update( fDeltaTime );
@@ -259,7 +267,7 @@ class LunaLifeMeterBattery: public Luna
{
public:
static int GetLivesLeft( T* p, lua_State *L ) { lua_pushnumber( L, p->GetLivesLeft() ); return 1; }
- static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber( L, GAMESTATE->m_SongOptions.GetSong().m_iBatteryLives ); return 1; }
+ static int GetTotalLives( T* p, lua_State *L ) { lua_pushnumber(L, p->GetTotalLives()); return 1; }
static int ChangeLives( T* p, lua_State *L ) { p->ChangeLives(IArg(1)); return 0; }
LunaLifeMeterBattery()
diff --git a/src/LifeMeterBattery.h b/src/LifeMeterBattery.h
index 6d20b59a1f..e56e87822e 100644
--- a/src/LifeMeterBattery.h
+++ b/src/LifeMeterBattery.h
@@ -32,6 +32,7 @@ public:
void Refresh();
int GetLivesLeft() { return m_iLivesLeft; }
+ int GetTotalLives();
void ChangeLives(int iLifeDiff);
// Lua
diff --git a/src/OptionsBinding.h b/src/OptionsBinding.h
index be979ab7bb..d3db401c9b 100644
--- a/src/OptionsBinding.h
+++ b/src/OptionsBinding.h
@@ -53,10 +53,10 @@
static int func_name(T* p, lua_State* L) \
{ \
DefaultNilArgs(L, 1); \
- lua_pushnumber(L, p->m_i ## member); \
+ lua_pushnumber(L, p->m_ ## member); \
if(lua_isnumber(L, 1)) \
{ \
- p->m_i ## member = IArg(1); \
+ p->m_ ## member = IArg(1); \
} \
return 1; \
}
diff --git a/src/Player.cpp b/src/Player.cpp
index fe57053f31..9c4b6786f3 100644
--- a/src/Player.cpp
+++ b/src/Player.cpp
@@ -626,7 +626,7 @@ void Player::Load()
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
- bool bOniDead = GAMESTATE->m_SongOptions.GetStage().m_LifeType == LifeType_Battery &&
+ bool bOniDead = m_pPlayerState->m_PlayerOptions.GetStage().m_LifeType == LifeType_Battery &&
(m_pPlayerStageStats == NULL || m_pPlayerStageStats->m_bFailed);
/* The editor reuses Players ... so we really need to make sure everything
@@ -1776,7 +1776,7 @@ int Player::GetClosestNonEmptyRow( int iNoteRow, int iMaxRowsAhead, int iMaxRows
bool Player::IsOniDead() const
{
// If we're playing on oni and we've died, do nothing.
- return GAMESTATE->m_SongOptions.GetCurrent().m_LifeType == LifeType_Battery && m_pPlayerStageStats && m_pPlayerStageStats->m_bFailed;
+ return m_pPlayerState->m_PlayerOptions.GetStage().m_LifeType == LifeType_Battery && m_pPlayerStageStats && m_pPlayerStageStats->m_bFailed;
}
void Player::Fret( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease )
diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp
index c25ddb2672..7c7c946de4 100644
--- a/src/PlayerOptions.cpp
+++ b/src/PlayerOptions.cpp
@@ -12,6 +12,24 @@
#include "CommonMetrics.h"
#include
+static const char *LifeTypeNames[] = {
+ "Bar",
+ "Battery",
+ "Time",
+};
+XToString( LifeType );
+XToLocalizedString( LifeType );
+LuaXType( LifeType );
+
+static const char *DrainTypeNames[] = {
+ "Normal",
+ "NoRecover",
+ "SuddenDeath",
+};
+XToString( DrainType );
+XToLocalizedString( DrainType );
+LuaXType( DrainType );
+
void NextFloat( float fValues[], int size );
void NextBool( bool bValues[], int size );
@@ -31,6 +49,9 @@ static const float CMOD_DEFAULT= 200.0f;
void PlayerOptions::Init()
{
+ m_LifeType = LifeType_Bar;
+ m_DrainType = DrainType_Normal;
+ m_BatteryLives = 4;
m_bSetScrollSpeed = false;
m_fMaxScrollBPM = 0; m_SpeedfMaxScrollBPM = 1.0f;
m_fTimeSpacing = 0; m_SpeedfTimeSpacing = 1.0f;
@@ -64,6 +85,9 @@ void PlayerOptions::Approach( const PlayerOptions& other, float fDeltaSeconds )
#define DO_COPY( x ) \
x = other.x;
+ DO_COPY( m_LifeType );
+ DO_COPY( m_DrainType );
+ DO_COPY( m_BatteryLives );
APPROACH( fTimeSpacing );
APPROACH( fScrollSpeed );
APPROACH( fMaxScrollBPM );
@@ -120,6 +144,26 @@ void PlayerOptions::GetMods( vector &AddTo, bool bForceNoteSkin ) const
{
//RString sReturn;
+ switch(m_LifeType)
+ {
+ case LifeType_Bar:
+ switch(m_DrainType)
+ {
+ case DrainType_Normal: break;
+ case DrainType_NoRecover: AddTo.push_back("NoRecover"); break;
+ case DrainType_SuddenDeath: AddTo.push_back("SuddenDeath"); break;
+ }
+ break;
+ case LifeType_Battery:
+ AddTo.push_back(ssprintf("%dLives", m_BatteryLives));
+ break;
+ case LifeType_Time:
+ AddTo.push_back("LifeTime");
+ break;
+ default:
+ FAIL_M(ssprintf("Invalid LifeType: %i", m_LifeType));
+ }
+
if( !m_fTimeSpacing )
{
if( m_fMaxScrollBPM )
@@ -390,6 +434,17 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
level= CMOD_DEFAULT;
SET_FLOAT(fScrollBPM)
}
+ else if( sBit == "life" || sBit == "lives" )
+ {
+ // level is a percentage for every other option, so multiply by 100. -Kyz
+ m_BatteryLives= level * 100.0f;
+ }
+ else if( sBit == "bar" ) { m_LifeType= LifeType_Bar; }
+ else if( sBit == "battery" ) { m_LifeType= LifeType_Battery; }
+ else if( sBit == "lifetime" ) { m_LifeType= LifeType_Time; }
+ else if( sBit == "norecover" || sBit == "power-drop" ) { m_DrainType= DrainType_NoRecover; }
+ else if( sBit == "suddendeath" || sBit == "death" ) { m_DrainType= DrainType_SuddenDeath; }
+ else if( sBit == "normal-drain" ) { m_DrainType= DrainType_Normal; }
else if( sBit == "boost" ) SET_FLOAT( fAccels[ACCEL_BOOST] )
else if( sBit == "brake" || sBit == "land" ) SET_FLOAT( fAccels[ACCEL_BRAKE] )
else if( sBit == "wave" ) SET_FLOAT( fAccels[ACCEL_WAVE] )
@@ -688,6 +743,9 @@ float PlayerOptions::GetReversePercentForColumn( int iCol ) const
bool PlayerOptions::operator==( const PlayerOptions &other ) const
{
#define COMPARE(x) { if( x != other.x ) return false; }
+ COMPARE(m_LifeType);
+ COMPARE(m_DrainType);
+ COMPARE(m_BatteryLives);
COMPARE(m_fTimeSpacing);
COMPARE(m_fScrollSpeed);
COMPARE(m_fScrollBPM);
@@ -889,6 +947,9 @@ void PlayerOptions::ResetPrefs( ResetPrefsType type )
case saved_prefs_invalid_for_course:
break;
}
+ CPY(m_LifeType);
+ CPY(m_DrainType);
+ CPY(m_BatteryLives);
CPY( m_fPerspectiveTilt );
CPY( m_bTransforms[TRANSFORM_NOHOLDS] );
@@ -932,6 +993,9 @@ public:
// Direct control functions, for themes that can handle it.
+ ENUM_INTERFACE(LifeSetting, LifeType, LifeType);
+ ENUM_INTERFACE(DrainSetting, DrainType, DrainType);
+ INT_INTERFACE(BatteryLives, BatteryLives);
FLOAT_INTERFACE(TimeSpacing, TimeSpacing, true);
FLOAT_INTERFACE(MaxScrollBPM, MaxScrollBPM, true);
FLOAT_INTERFACE(ScrollSpeed, ScrollSpeed, true);
@@ -1298,6 +1362,9 @@ public:
ADD_METHOD( IsEasierForSongAndSteps );
ADD_METHOD( IsEasierForCourseAndTrail );
+ ADD_METHOD(LifeSetting);
+ ADD_METHOD(DrainSetting);
+ ADD_METHOD(BatteryLives);
ADD_METHOD(TimeSpacing);
ADD_METHOD(MaxScrollBPM);
ADD_METHOD(ScrollSpeed);
diff --git a/src/PlayerOptions.h b/src/PlayerOptions.h
index f923531880..f4f56806d6 100644
--- a/src/PlayerOptions.h
+++ b/src/PlayerOptions.h
@@ -11,6 +11,31 @@ struct lua_State;
#include "GameConstantsAndTypes.h"
#include "PlayerNumber.h"
+
+enum LifeType
+{
+ LifeType_Bar,
+ LifeType_Battery,
+ LifeType_Time,
+ NUM_LifeType,
+ LifeType_Invalid
+};
+const RString& LifeTypeToString( LifeType cat );
+const RString& LifeTypeToLocalizedString( LifeType cat );
+LuaDeclareType( LifeType );
+
+enum DrainType
+{
+ DrainType_Normal,
+ DrainType_NoRecover,
+ DrainType_SuddenDeath,
+ NUM_DrainType,
+ DrainType_Invalid
+};
+const RString& DrainTypeToString( DrainType cat );
+const RString& DrainTypeToLocalizedString( DrainType cat );
+LuaDeclareType( DrainType );
+
/** @brief Per-player options that are not saved between sessions. */
class PlayerOptions
{
@@ -19,7 +44,9 @@ public:
* @brief Set up the PlayerOptions with some reasonable defaults.
*
* This code was taken from Init() to use proper initialization. */
- PlayerOptions(): m_bSetScrollSpeed(false),
+ PlayerOptions(): m_LifeType(LifeType_Bar), m_DrainType(DrainType_Normal),
+ m_BatteryLives(4),
+ m_bSetScrollSpeed(false),
m_fTimeSpacing(0), m_SpeedfTimeSpacing(1.0f),
m_fMaxScrollBPM(0), m_SpeedfMaxScrollBPM(1.0f),
m_fScrollSpeed(1.0f), m_SpeedfScrollSpeed(1.0f),
@@ -154,6 +181,9 @@ public:
float GetReversePercentForColumn( int iCol ) const; // accounts for all Directions
+ LifeType m_LifeType;
+ DrainType m_DrainType; // only used with LifeBar
+ int m_BatteryLives;
/* 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
diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp
index 689eeffc63..82108082c4 100644
--- a/src/ScreenGameplay.cpp
+++ b/src/ScreenGameplay.cpp
@@ -135,7 +135,7 @@ void PlayerInfo::Load( PlayerNumber pn, MultiPlayer mp, bool bShowNoteField, int
break;
case PLAY_MODE_ONI:
case PLAY_MODE_ENDLESS:
- if( GAMESTATE->m_SongOptions.GetStage().m_LifeType == LifeType_Time )
+ if( GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetStage().m_LifeType == LifeType_Time )
m_pPrimaryScoreDisplay = new ScoreDisplayLifeTime;
else
m_pPrimaryScoreDisplay = new ScoreDisplayOni;
@@ -573,7 +573,7 @@ void ScreenGameplay::Init()
if( !GAMESTATE->IsPlayerEnabled(pi->m_pn) && !SHOW_LIFE_METER_FOR_DISABLED_PLAYERS )
continue; // skip
- pi->m_pLifeMeter = LifeMeter::MakeLifeMeter( GAMESTATE->m_SongOptions.GetStage().m_LifeType );
+ pi->m_pLifeMeter = LifeMeter::MakeLifeMeter( pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType );
pi->m_pLifeMeter->Load( pi->GetPlayerState(), pi->GetPlayerStageStats() );
pi->m_pLifeMeter->SetName( ssprintf("Life%s",pi->GetName().c_str()) );
LOAD_ALL_COMMANDS_AND_SET_XY( pi->m_pLifeMeter );
@@ -585,7 +585,7 @@ void ScreenGameplay::Init()
// not 100% sure of that. -freem
if( !GAMESTATE->IsPlayerEnabled(pi->m_pn) && SHOW_LIFE_METER_FOR_DISABLED_PLAYERS )
{
- if(GAMESTATE->m_SongOptions.GetStage().m_LifeType == LifeType_Bar)
+ if(pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType == LifeType_Bar)
static_cast(pi->m_pLifeMeter)->ChangeLife(-1.0f);
}
}
@@ -1097,10 +1097,12 @@ void ScreenGameplay::LoadNextSong()
/* If we're in battery mode, force FailImmediate. We assume in Player::Step
* that failed players can't step. */
- if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType == LifeType_Battery )
+ FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
{
- FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
- PO_GROUP_ASSIGN( pi->GetPlayerState()->m_PlayerOptions, ModsLevel_Song, m_FailType, FailType_Immediate );
+ if(pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType == LifeType_Battery)
+ {
+ PO_GROUP_ASSIGN(pi->GetPlayerState()->m_PlayerOptions, ModsLevel_Song, m_FailType, FailType_Immediate);
+ }
}
m_textSongOptions.SetText( GAMESTATE->m_SongOptions.GetCurrent().GetString() );
@@ -1133,10 +1135,10 @@ void ScreenGameplay::LoadNextSong()
// reset oni game over graphic
SET_XY_AND_ON_COMMAND( pi->m_sprOniGameOver );
- if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==LifeType_Battery && pi->GetPlayerStageStats()->m_bFailed ) // already failed
+ if(pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType==LifeType_Battery && pi->GetPlayerStageStats()->m_bFailed) // already failed
pi->ShowOniGameOver();
- if( GAMESTATE->m_SongOptions.GetCurrent().m_LifeType==LifeType_Bar && pi->m_pLifeMeter )
+ if(pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType==LifeType_Bar && pi->m_pLifeMeter )
pi->m_pLifeMeter->UpdateNonstopLifebar();
if( pi->m_pStepsDisplay )
@@ -1649,7 +1651,7 @@ void ScreenGameplay::Update( float fDeltaTime )
PlayerNumber pn = pi->GetStepsAndTrailIndex();
FailType ft = GAMESTATE->GetPlayerFailType( pi->GetPlayerState() );
- LifeType lt = GAMESTATE->m_SongOptions.GetCurrent().m_LifeType;
+ LifeType lt = pi->GetPlayerState()->m_PlayerOptions.GetStage().m_LifeType;
if( ft == FailType_Off || ft == FailType_EndOfSong )
continue;
@@ -1683,12 +1685,7 @@ void ScreenGameplay::Update( float fDeltaTime )
if( !STATSMAN->m_CurStageStats.AllFailed() ) // if not the last one to fail
{
// kill them!
- SOUND->PlayOnceFromDir( THEME->GetPathS(m_sName,"oni die") );
- pi->ShowOniGameOver();
- int tracks = pi->m_NoteData.GetNumTracks();
- pi->m_NoteData.Init(); // remove all notes and scoring
- pi->m_NoteData.SetNumTracks(tracks); // reset the number of tracks.
- pi->m_pPlayer->FadeToFail(); // tell the NoteField to fade to white
+ FailFadeRemovePlayer(&*pi);
}
}
}
@@ -1919,6 +1916,24 @@ void ScreenGameplay::Update( float fDeltaTime )
}
}
+void ScreenGameplay::FailFadeRemovePlayer(PlayerInfo* pi)
+{
+ SOUND->PlayOnceFromDir( THEME->GetPathS(m_sName,"oni die") );
+ pi->ShowOniGameOver();
+ int tracks = pi->m_NoteData.GetNumTracks();
+ pi->m_NoteData.Init(); // remove all notes and scoring
+ pi->m_NoteData.SetNumTracks(tracks); // reset the number of tracks.
+ pi->m_pPlayer->FadeToFail(); // tell the NoteField to fade to white
+}
+
+void ScreenGameplay::FailFadeRemovePlayer(PlayerNumber pn)
+{
+ if(pn < m_vPlayerInfo.size())
+ {
+ FailFadeRemovePlayer(&m_vPlayerInfo[pn]);
+ }
+}
+
float ScreenGameplay::GetHasteRate()
{
return m_fCurrHasteRate;
@@ -2989,6 +3004,12 @@ public:
lua_pushnumber(L, true_bps);
return 1;
}
+ static int FailFadeRemovePlayer(T* p, lua_State* L)
+ {
+ PlayerNumber pn= Enum::Check(L, 1);
+ p->FailFadeRemovePlayer(pn);
+ return 0;
+ }
LunaScreenGameplay()
{
@@ -3006,6 +3027,7 @@ public:
ADD_METHOD( HasteTimeBetweenUpdates );
ADD_METHOD( HasteLifeSwitchPoint );
ADD_METHOD( GetTrueBPS );
+ ADD_METHOD( FailFadeRemovePlayer );
}
};
diff --git a/src/ScreenGameplay.h b/src/ScreenGameplay.h
index bd385cb9cb..9b0d4de83c 100644
--- a/src/ScreenGameplay.h
+++ b/src/ScreenGameplay.h
@@ -172,6 +172,9 @@ public:
bool IsPaused() const { return m_bPaused; }
float GetHasteRate();
+ void FailFadeRemovePlayer(PlayerInfo* pi);
+ void FailFadeRemovePlayer(PlayerNumber pn);
+
vector m_HasteTurningPoints; // Values at which the meaning of GAMESTATE->m_fHasteRate changes.
vector m_HasteAddAmounts; // Amounts that are added to speed depending on what turning point has been passed.
float m_fHasteTimeBetweenUpdates; // Seconds between haste updates.
diff --git a/src/ScreenJukebox.cpp b/src/ScreenJukebox.cpp
index 925e9fb209..17b3349c3b 100644
--- a/src/ScreenJukebox.cpp
+++ b/src/ScreenJukebox.cpp
@@ -197,8 +197,8 @@ void ScreenJukebox::Init()
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fScrollSpeed, .25f );
PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fPerspectiveTilt, -1.0f );
PO_GROUP_ASSIGN_N( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_fEffects, PlayerOptions::EFFECT_TINY, 1.0f );
+ PO_GROUP_ASSIGN( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery );
}
- SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery );
}
FOREACH_EnabledPlayer( p )
diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp
index fa3e5d870f..92da13a25b 100644
--- a/src/ScreenSelectMusic.cpp
+++ b/src/ScreenSelectMusic.cpp
@@ -1254,11 +1254,19 @@ bool ScreenSelectMusic::MenuStart( const InputEventPlus &input )
// apply #LIVES
if( pCourse->m_iLives != -1 )
{
- SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery );
- SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_iBatteryLives, pCourse->m_iLives );
+ FOREACH_EnabledPlayer(pn)
+ {
+ PO_GROUP_ASSIGN(GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Stage, m_LifeType, LifeType_Battery);
+ PO_GROUP_ASSIGN(GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Stage, m_BatteryLives, pCourse->m_iLives);
+ }
}
if( pCourse->GetCourseType() == COURSE_TYPE_SURVIVAL)
- SO_GROUP_ASSIGN( GAMESTATE->m_SongOptions, ModsLevel_Stage, m_LifeType, LifeType_Time );
+ {
+ FOREACH_EnabledPlayer(pn)
+ {
+ PO_GROUP_ASSIGN(GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions, ModsLevel_Stage, m_LifeType, LifeType_Time);
+ }
+ }
}
else
{
diff --git a/src/SongOptions.cpp b/src/SongOptions.cpp
index 8e67f5e545..c7af4286b6 100644
--- a/src/SongOptions.cpp
+++ b/src/SongOptions.cpp
@@ -4,24 +4,6 @@
#include "GameState.h"
#include "CommonMetrics.h"
-static const char *LifeTypeNames[] = {
- "Bar",
- "Battery",
- "Time",
-};
-XToString( LifeType );
-XToLocalizedString( LifeType );
-LuaXType( LifeType );
-
-static const char *DrainTypeNames[] = {
- "Normal",
- "NoRecover",
- "SuddenDeath",
-};
-XToString( DrainType );
-XToLocalizedString( DrainType );
-LuaXType( DrainType );
-
static const char *AutosyncTypeNames[] = {
"Off",
"Song",
@@ -43,9 +25,6 @@ LuaXType( SoundEffectType );
void SongOptions::Init()
{
- m_LifeType = LifeType_Bar;
- m_DrainType = DrainType_Normal;
- m_iBatteryLives = 4;
m_bAssistClap = false;
m_bAssistMetronome = false;
m_fMusicRate = 1.0f;
@@ -67,9 +46,6 @@ void SongOptions::Approach( const SongOptions& other, float fDeltaSeconds )
#define DO_COPY( x ) \
x = other.x;
- DO_COPY( m_LifeType );
- DO_COPY( m_DrainType );
- DO_COPY( m_iBatteryLives );
APPROACH( fMusicRate );
APPROACH( fHaste );
DO_COPY( m_bAssistClap );
@@ -96,27 +72,6 @@ static void AddPart( vector &AddTo, float level, RString name )
void SongOptions::GetMods( vector &AddTo ) const
{
- switch( m_LifeType )
- {
- case LifeType_Bar:
- switch( m_DrainType )
- {
- case DrainType_Normal: break;
- case DrainType_NoRecover: AddTo.push_back("NoRecover"); break;
- case DrainType_SuddenDeath: AddTo.push_back("SuddenDeath"); break;
- }
- break;
- case LifeType_Battery:
- AddTo.push_back( ssprintf( "%dLives", m_iBatteryLives ) );
- break;
- case LifeType_Time:
- AddTo.push_back( "LifeTime" );
- break;
- default:
- FAIL_M(ssprintf("Invalid LifeType: %i", m_LifeType));
- }
-
-
if( m_fMusicRate != 1 )
{
RString s = ssprintf( "%2.2f", m_fMusicRate );
@@ -210,12 +165,6 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut )
}
matches.clear();
- Regex lives("^([0-9]+) ?(lives|life)$");
- if( lives.Compare(sBit, matches) )
- {
- m_iBatteryLives = StringToInt( matches[0] );
- return true;
- }
vector asParts;
split( sBit, " ", asParts, true );
@@ -227,12 +176,7 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut )
on = false;
}
- if( sBit == "norecover" ) m_DrainType = DrainType_NoRecover;
- else if( sBit == "suddendeath" || sBit == "death" ) m_DrainType = DrainType_SuddenDeath;
- else if( sBit == "power-drop" ) m_DrainType = DrainType_NoRecover;
- else if( sBit == "normal-drain" ) m_DrainType = DrainType_Normal;
-
- else if( sBit == "clap" ) m_bAssistClap = on;
+ if( sBit == "clap" ) m_bAssistClap = on;
else if( sBit == "metronome" ) m_bAssistMetronome = on;
else if( sBit == "autosync" || sBit == "autosyncsong" ) m_AutosyncType = on ? AutosyncType_Song : AutosyncType_Off;
else if( sBit == "autosyncmachine" ) m_AutosyncType = on ? AutosyncType_Machine : AutosyncType_Off;
@@ -244,9 +188,6 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut )
else if( sBit == "randombg" ) m_bRandomBGOnly = on;
else if( sBit == "savescore" ) m_bSaveScore = on;
else if( sBit == "savereplay" ) m_bSaveReplay = on;
- else if( sBit == "bar" ) m_LifeType = LifeType_Bar;
- else if( sBit == "battery" ) m_LifeType = LifeType_Battery;
- else if( sBit == "lifetime" ) m_LifeType = LifeType_Time;
else if( sBit == "haste" ) m_fHaste = on? 1.0f:0.0f;
else
return false;
@@ -257,9 +198,6 @@ bool SongOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut )
bool SongOptions::operator==( const SongOptions &other ) const
{
#define COMPARE(x) { if( x != other.x ) return false; }
- COMPARE( m_LifeType );
- COMPARE( m_DrainType );
- COMPARE( m_iBatteryLives );
COMPARE( m_fMusicRate );
COMPARE( m_fHaste );
COMPARE( m_bAssistClap );
@@ -283,12 +221,9 @@ class LunaSongOptions: public Luna
{
public:
- ENUM_INTERFACE(LifeSetting, LifeType, LifeType);
- ENUM_INTERFACE(DrainSetting, DrainType, DrainType);
ENUM_INTERFACE(AutosyncSetting, AutosyncType, AutosyncType);
//ENUM_INTERFACE(SoundEffectSetting, SoundEffectType, SoundEffectType);
// Broken, SoundEffectType_Speed disables rate mod, other settings have no effect. -Kyz
- INT_INTERFACE(BatteryLives, BatteryLives);
BOOL_INTERFACE(AssistClap, AssistClap);
BOOL_INTERFACE(AssistMetronome, AssistMetronome);
BOOL_INTERFACE(StaticBackground, StaticBackground);
@@ -300,11 +235,8 @@ public:
LunaSongOptions()
{
- ADD_METHOD(LifeSetting);
- ADD_METHOD(DrainSetting);
ADD_METHOD(AutosyncSetting);
//ADD_METHOD(SoundEffectSetting);
- ADD_METHOD(BatteryLives);
ADD_METHOD(AssistClap);
ADD_METHOD(AssistMetronome);
ADD_METHOD(StaticBackground);
diff --git a/src/SongOptions.h b/src/SongOptions.h
index 9d2c93d911..34de874cb0 100644
--- a/src/SongOptions.h
+++ b/src/SongOptions.h
@@ -5,30 +5,6 @@
#include "EnumHelper.h"
-enum LifeType
-{
- LifeType_Bar,
- LifeType_Battery,
- LifeType_Time,
- NUM_LifeType,
- LifeType_Invalid
-};
-const RString& LifeTypeToString( LifeType cat );
-const RString& LifeTypeToLocalizedString( LifeType cat );
-LuaDeclareType( LifeType );
-
-enum DrainType
-{
- DrainType_Normal,
- DrainType_NoRecover,
- DrainType_SuddenDeath,
- NUM_DrainType,
- DrainType_Invalid
-};
-const RString& DrainTypeToString( DrainType cat );
-const RString& DrainTypeToLocalizedString( DrainType cat );
-LuaDeclareType( DrainType );
-
enum AutosyncType
{
AutosyncType_Off,
@@ -57,9 +33,6 @@ LuaDeclareType( SoundEffectType );
class SongOptions
{
public:
- LifeType m_LifeType;
- DrainType m_DrainType; // only used with LifeBar
- int m_iBatteryLives;
bool m_bAssistClap;
bool m_bAssistMetronome;
float m_fMusicRate, m_SpeedfMusicRate;
@@ -76,8 +49,7 @@ public:
*
* This is taken from Init(), but uses the intended
* initialization lists. */
- SongOptions(): m_LifeType(LifeType_Bar), m_DrainType(DrainType_Normal),
- m_iBatteryLives(4), m_bAssistClap(false),
+ SongOptions(): m_bAssistClap(false),
m_bAssistMetronome(false), m_fMusicRate(1.0f),
m_SpeedfMusicRate(1.0f), m_fHaste(0.0f),
m_SpeedfHaste(1.0f), m_AutosyncType(AutosyncType_Off),