Moved LifeType, DrainType, and BatteryLives from Song Options to Player Options. Added ScreenGameplay:FailFadeRemovePlayer lua function.

This commit is contained in:
Kyzentun
2014-08-06 23:26:05 -06:00
parent 6aad3c8f75
commit 7e73892e6e
19 changed files with 445 additions and 397 deletions
+2
View File
@@ -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
----------
+90 -89
View File
@@ -999,98 +999,101 @@
<Function name='GetStepsQueueWrapped'/>
</Class>
<Class name='PlayerOptions'>
<Function name='IsEasierForSongAndSteps'/>
<Function name='IsEasierForCourseAndTrail'/>
<Function name='TimeSpacing'/>
<Function name='MaxScrollBPM'/>
<Function name='ScrollSpeed'/>
<Function name='ScrollBPM'/>
<Function name='Boost'/>
<Function name='Brake'/>
<Function name='Wave'/>
<Function name='Expand'/>
<Function name='Boomerang'/>
<Function name='Drunk'/>
<Function name='Dizzy'/>
<Function name='Confusion'/>
<Function name='Mini'/>
<Function name='Tiny'/>
<Function name='Flip'/>
<Function name='Invert'/>
<Function name='Tornado'/>
<Function name='Tipsy'/>
<Function name='Bumpy'/>
<Function name='Beat'/>
<Function name='Xmode'/>
<Function name='Twirl'/>
<Function name='Roll'/>
<Function name='Hidden'/>
<Function name='HiddenOffset'/>
<Function name='Sudden'/>
<Function name='SuddenOffset'/>
<Function name='Stealth'/>
<Function name='Blink'/>
<Function name='RandomVanish'/>
<Function name='Reverse'/>
<Function name='Split'/>
<Function name='Alternate'/>
<Function name='Cross'/>
<Function name='Centered'/>
<Function name='Dark'/>
<Function name='Blind'/>
<Function name='Cover'/>
<Function name='RandAttack'/>
<Function name='NoAttack'/>
<Function name='PlayerAutoPlay'/>
<Function name='Tilt'/>
<Function name='Skew'/>
<Function name='Passmark'/>
<Function name='RandomSpeed'/>
<Function name='TurnNone'/>
<Function name='Mirror'/>
<Function name='Backwards'/>
<Function name='Left'/>
<Function name='Right'/>
<Function name='Shuffle'/>
<Function name='SoftShuffle'/>
<Function name='SuperShuffle'/>
<Function name='NoHolds'/>
<Function name='NoRolls'/>
<Function name='NoMines'/>
<Function name='Little'/>
<Function name='Wide'/>
<Function name='Big'/>
<Function name='Quick'/>
<Function name='BMRize'/>
<Function name='Skippy'/>
<Function name='Mines'/>
<Function name='AttackMines'/>
<Function name='Echo'/>
<Function name='Stomp'/>
<Function name='Planted'/>
<Function name='Floored'/>
<Function name='Twister'/>
<Function name='HoldRolls'/>
<Function name='NoJumps'/>
<Function name='NoHands'/>
<Function name='NoLifts'/>
<Function name='NoFakes'/>
<Function name='NoQuads'/>
<Function name='NoStretch'/>
<Function name='MuteOnError'/>
<Function name='NoteSkin'/>
<Function name='FailSetting'/>
<Function name='Backwards'/>
<Function name='BatteryLives'/>
<Function name='Beat'/>
<Function name='Big'/>
<Function name='Blind'/>
<Function name='Blink'/>
<Function name='Boomerang'/>
<Function name='Boost'/>
<Function name='BMRize'/>
<Function name='Brake'/>
<Function name='Bumpy'/>
<Function name='Centered'/>
<Function name='CMod'/>
<Function name='XMod'/>
<Function name='MMod'/>
<Function name='Overhead'/>
<Function name='Incoming'/>
<Function name='Space'/>
<Function name='Hallway'/>
<Function name='Confusion'/>
<Function name='Cover'/>
<Function name='Cross'/>
<Function name='Dark'/>
<Function name='Dizzy'/>
<Function name='Distant'/>
<Function name='UsingReverse'/>
<Function name='DrainSetting'/>
<Function name='Drunk'/>
<Function name='Echo'/>
<Function name='Expand'/>
<Function name='FailSetting'/>
<Function name='Flip'/>
<Function name='Floored'/>
<Function name='GetReversePercentForColumn'/>
<Function name='GetStepAttacks'/>
<Function name='IsEasierForSongAndSteps'/>
<Function name='IsEasierForCourseAndTrail'/>
<Function name='Incoming'/>
<Function name='Hallway'/>
<Function name='Hidden'/>
<Function name='HiddenOffset'/>
<Function name='HoldRolls'/>
<Function name='Invert'/>
<Function name='Left'/>
<Function name='LifeSetting'/>
<Function name='Little'/>
<Function name='MaxScrollBPM'/>
<Function name='Mines'/>
<Function name='Mini'/>
<Function name='Mirror'/>
<Function name='MMod'/>
<Function name='MuteOnError'/>
<Function name='NoAttack'/>
<Function name='NoFakes'/>
<Function name='NoHands'/>
<Function name='NoHolds'/>
<Function name='NoJumps'/>
<Function name='NoLifts'/>
<Function name='NoMines'/>
<Function name='NoQuads'/>
<Function name='NoRolls'/>
<Function name='NoStretch'/>
<Function name='NoteSkin'/>
<Function name='Overhead'/>
<Function name='Passmark'/>
<Function name='Planted'/>
<Function name='PlayerAutoPlay'/>
<Function name='Quick'/>
<Function name='RandAttack'/>
<Function name='RandomSpeed'/>
<Function name='RandomVanish'/>
<Function name='Reverse'/>
<Function name='Right'/>
<Function name='Roll'/>
<Function name='ScrollBPM'/>
<Function name='ScrollSpeed'/>
<Function name='Shuffle'/>
<Function name='Skew'/>
<Function name='Skippy'/>
<Function name='SoftShuffle'/>
<Function name='Space'/>
<Function name='Split'/>
<Function name='Stealth'/>
<Function name='Stomp'/>
<Function name='Sudden'/>
<Function name='SuddenOffset'/>
<Function name='SuperShuffle'/>
<Function name='TimeSpacing'/>
<Function name='Tilt'/>
<Function name='Tiny'/>
<Function name='Tipsy'/>
<Function name='Tornado'/>
<Function name='TurnNone'/>
<Function name='Twirl'/>
<Function name='Twister'/>
<Function name='UsingReverse'/>
<Function name='Wave'/>
<Function name='Wide'/>
<Function name='XMod'/>
<Function name='Xmode'/>
</Class>
<Class name='PlayerStageStats'>
<Function name='FailPlayer'/>
@@ -1323,6 +1326,7 @@
</Class>
<Class base='ScreenWithMenuElements' name='ScreenGameplay'>
<Function name='Center1Player'/>
<Function name='FailFadeRemovePlayer'/>
<Function name='GetDummyPlayerInfo'/>
<Function name='GetHasteRate'/>
<Function name='GetLifeMeter'/>
@@ -1513,10 +1517,7 @@
<Function name='AssistClap'/>
<Function name='AssistMetronome'/>
<Function name='AutosyncSetting'/>
<Function name='BatteryLives'/>
<Function name='DrainSetting'/>
<Function name='Haste'/>
<Function name='LifeSetting'/>
<Function name='MusicRate'/>
<Function name='RandomBGOnly'/>
<Function name='SaveReplay'/>
+149 -149
View File
@@ -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.<br />
For brevity, the functions are only given a description if the option requires careful handling or does not follow the float or bool interfaces.<br />
</Description>
<Function name='Alternate' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='AttackMines' return='bool' arguments='bool value'> </Function>
<Function name='BatteryLives' return='int' arguments='int num'> </Function>
<Function name='Backwards' return='bool' arguments='bool value'> </Function>
<Function name='Beat' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Big' return='bool' arguments='bool value'> </Function>
<Function name='Blink' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Blind' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='BMRize' return='bool' arguments='bool value'> </Function>
<Function name='Boomerang' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Boost' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Brake' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Bumpy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Centered' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='CMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a CMod set, returns the value of that CMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the CMod to the value and disables any XMod or MMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.
</Function>
<Function name='Confusion' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Cover' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Cross' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Dark' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Dizzy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Distant' return='float, float' arguments='float value, float approach_speed'>
If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to value and skew to zero.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='DrainSetting' return= 'DrainType' arguments='DrainType type'> </Function>
<Function name='Drunk' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Echo' return='bool' arguments='bool value'> </Function>
<Function name='Expand' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='FailSetting' return='FailType' arguments='FailType'>
Sets the <Link class='ENUM' function='FailType' /> for the player, if the optional argument is provided. Returns the <Link class='ENUM' function='FailType' /> that was previously set.
</Function>
<Function name='Flip' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Floored' return='bool' arguments='bool value'> </Function>
<Function name='GetStepAttacks' return='bool' argument=''>
Returns true if step attacks or random attacks are enabled.
</Function>
<Function name='IsEasierForCourseAndTrail' return='bool' arguments='Course c, Trail t'>
Returns <code>true</code> if the current PlayerOptions makes the current Course/Trail easier.
</Function>
<Function name='IsEasierForSongAndSteps' return='bool' arguments='Song so, Steps st'>
Returns <code>true</code> if the current PlayerOptions makes the current Song/Steps easier.
</Function>
<Function name='TimeSpacing' return='float, float' arguments='float value, float approach_speed'>
TimeSpacing is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
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.
<Function name='Hallway' return='float, float' arguments='float value, float approach_speed'>
If the player is using Hallway (zero skew and negative tilt), returns the value of tilt and its approach_speed.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to negative value and skew to zero.<br />
Pass in a positive value for the familiar meaning of Hallway.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Hidden' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='HiddenOffset' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='HoldRolls' return='bool' arguments='bool value'> </Function>
<Function name='Incoming' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to negative value and skew to value.<br />
Pass in a positive value for the familiar meaning of Incoming.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Invert' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Left' return='bool' arguments='bool value'> </Function>
<Function name='LifeSetting' return='LifeType' arguments='LifeType type'> </Function>
<Function name='Little' return='bool' arguments='bool value'> </Function>
<Function name='MaxScrollBPM' return='float, float' arguments='float value, float approach_speed'>
MaxScrollBPM is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
It is the setting for the MMod.<br />
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
</Function>
<Function name='ScrollSpeed' return='float, float' arguments='float value, float approach_speed'>
ScrollSpeed is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
It is the setting for the XMod.
</Function>
<Function name='ScrollBPM' return='float, float' arguments='float value, float approach_speed'>
ScrollBPM is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
It is the setting for the CMod.
</Function>
<Function name='Boost' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Brake' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Wave' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Expand' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Boomerang' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Drunk' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Dizzy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Confusion' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Mini' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tiny' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Flip' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Invert' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tornado' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tipsy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Bumpy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Beat' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Xmode' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Twirl' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Roll' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Hidden' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='HiddenOffset' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Sudden' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='SuddenOffset' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Stealth' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Blink' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='RandomVanish' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Reverse' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Split' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Alternate' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Cross' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Centered' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Dark' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Blind' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Cover' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='RandAttack' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='NoAttack' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='PlayerAutoPlay' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tilt' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Tilt tilts the note field forward and back.
</Function>
<Function name='Skew' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Skew moves the vanishing point for the note field away from the center of the screen.<br />
Skew has no effect in single mode if Center1Player is true.<br />
Skew has no effect in double mode.<br />
</Function>
<Function name='Passmark' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='RandomSpeed' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='TurnNone' return='bool' arguments='bool value'> </Function>
<Function name='Mirror' return='bool' arguments='bool value'> </Function>
<Function name='Backwards' return='bool' arguments='bool value'> </Function>
<Function name='Left' return='bool' arguments='bool value'> </Function>
<Function name='Right' return='bool' arguments='bool value'> </Function>
<Function name='Shuffle' return='bool' arguments='bool value'> </Function>
<Function name='SoftShuffle' return='bool' arguments='bool value'> </Function>
<Function name='SuperShuffle' return='bool' arguments='bool value'> </Function>
<Function name='NoHolds' return='bool' arguments='bool value'> </Function>
<Function name='NoRolls' return='bool' arguments='bool value'> </Function>
<Function name='NoMines' return='bool' arguments='bool value'> </Function>
<Function name='Little' return='bool' arguments='bool value'> </Function>
<Function name='Wide' return='bool' arguments='bool value'> </Function>
<Function name='Big' return='bool' arguments='bool value'> </Function>
<Function name='Quick' return='bool' arguments='bool value'> </Function>
<Function name='BMRize' return='bool' arguments='bool value'> </Function>
<Function name='Skippy' return='bool' arguments='bool value'> </Function>
<Function name='Mines' return='bool' arguments='bool value'> </Function>
<Function name='AttackMines' return='bool' arguments='bool value'> </Function>
<Function name='Echo' return='bool' arguments='bool value'> </Function>
<Function name='Stomp' return='bool' arguments='bool value'> </Function>
<Function name='Planted' return='bool' arguments='bool value'> </Function>
<Function name='Floored' return='bool' arguments='bool value'> </Function>
<Function name='Twister' return='bool' arguments='bool value'> </Function>
<Function name='HoldRolls' return='bool' arguments='bool value'> </Function>
<Function name='Mini' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Mirror' return='bool' arguments='bool value'> </Function>
<Function name='MMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the MMod to the value and disables any CMod or XMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.<br />
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
</Function>
<Function name='MuteOnError' return='bool' arguments='bool value'> </Function>
<Function name='NoAttack' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='NoFakes' return='bool' arguments='bool value'> </Function>
<Function name='NoHolds' return='bool' arguments='bool value'> </Function>
<Function name='NoJumps' return='bool' arguments='bool value'> </Function>
<Function name='NoHands' return='bool' arguments='bool value'> </Function>
<Function name='NoLifts' return='bool' arguments='bool value'> </Function>
<Function name='NoFakes' return='bool' arguments='bool value'> </Function>
<Function name='NoQuads' return='bool' arguments='bool value'> </Function>
<Function name='NoStretch' return='bool' arguments='bool value'> </Function>
<Function name='MuteOnError' return='bool' arguments='bool value'> </Function>
<Function name='UsingReverse' return='bool' arguments=''>
Returns <code>true</code> if the player is using reverse. (equivalent to <code>GetReverse() == 1.0</code>)
</Function>
<Function name='NoMines' return='bool' arguments='bool value'> </Function>
<Function name='NoRolls' return='bool' arguments='bool value'> </Function>
<Function name='NoteSkin' return='string, bool' arguments='string name'>
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.<br />
Changing the noteskin during a song is not supported.<br />
@@ -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.<br />
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.<br />
</Function>
<Function name='FailSetting' return='FailType' arguments='FailType'>
Sets the <Link class='ENUM' function='FailType' /> for the player, if the optional argument is provided. Returns the <Link class='ENUM' function='FailType' /> that was previously set.
<Function name='Overhead' return='bool' arguments='bool'>
If the player is using Overhead (0 tilt, 0 skew), returns true.<br />
If true is passed, sets the tilt and skew to 0.
</Function>
<Function name='CMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a CMod set, returns the value of that CMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the CMod to the value and disables any XMod or MMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.
</Function>
<Function name='XMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a XMod set, returns the value of that XMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the XMod to the value and disables any CMod or MMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.
</Function>
<Function name='MMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a MMod set, returns the value of that MMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the MMod to the value and disables any CMod or XMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.<br />
MMods are not tweenable or settable on ScreenGameplay. Use XMods if you need such an effect.
</Function>
<Function name='Overhead' return='bool' arguments='bool'>
If the player is using Overhead (0 tilt, 0 skew), returns true.<br />
If true is passed, sets the tilt and skew to 0.
</Function>
<Function name='Incoming' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to negative value and skew to value.<br />
Pass in a positive value for the familiar meaning of Incoming.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Space' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to value and skew to value.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Hallway' return='float, float' arguments='float value, float approach_speed'>
If the player is using Hallway (zero skew and negative tilt), returns the value of tilt and its approach_speed.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to negative value and skew to zero.<br />
Pass in a positive value for the familiar meaning of Hallway.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Distant' return='float, float' arguments='float value, float approach_speed'>
If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to value and skew to zero.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='GetStepAttacks' return='bool' argument=''>
Returns true if step attacks or random attacks are enabled.
</Function>
<Function name='Passmark' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Planted' return='bool' arguments='bool value'> </Function>
<Function name='PlayerAutoPlay' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Quick' return='bool' arguments='bool value'> </Function>
<Function name='RandAttack' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='RandomSpeed' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='RandomVanish' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Reverse' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Right' return='bool' arguments='bool value'> </Function>
<Function name='Roll' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='ScrollBPM' return='float, float' arguments='float value, float approach_speed'>
ScrollBPM is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
It is the setting for the CMod.
</Function>
<Function name='ScrollSpeed' return='float, float' arguments='float value, float approach_speed'>
ScrollSpeed is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
It is the setting for the XMod.
</Function>
<Function name='Shuffle' return='bool' arguments='bool value'> </Function>
<Function name='Skew' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Skew moves the vanishing point for the note field away from the center of the screen.<br />
Skew has no effect in single mode if Center1Player is true.<br />
Skew has no effect in double mode.<br />
</Function>
<Function name='Skippy' return='bool' arguments='bool value'> </Function>
<Function name='SoftShuffle' return='bool' arguments='bool value'> </Function>
<Function name='Space' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Returns nil otherwise.<br />
If the optional first argument is passed, sets tilt to value and skew to value.<br />
If the optional second argument is passed, sets the approach_speed for skew and tilt to it.
</Function>
<Function name='Split' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Stealth' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Stomp' return='bool' arguments='bool value'> </Function>
<Function name='Sudden' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='SuddenOffset' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='SuperShuffle' return='bool' arguments='bool value'> </Function>
<Function name='TimeSpacing' return='float, float' arguments='float value, float approach_speed'>
TimeSpacing is one of the variables for controlling the speed mod.<br />
Use CMod, XMod, or MMod to set the speed mod unless you have a good reason not to.<br />
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.
</Function>
<Function name='Tilt' return='float, float' arguments='float value, float approach_speed'>
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.<br />
Tilt tilts the note field forward and back.
</Function>
<Function name='Tiny' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tipsy' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Tornado' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='TurnNone' return='bool' arguments='bool value'> </Function>
<Function name='Twirl' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Twister' return='bool' arguments='bool value'> </Function>
<Function name='UsingReverse' return='bool' arguments=''>
Returns <code>true</code> if the player is using reverse. (equivalent to <code>GetReverse() == 1.0</code>)
</Function>
<Function name='Wave' return='float, float' arguments='float value, float approach_speed'> </Function>
<Function name='Wide' return='bool' arguments='bool value'> </Function>
<Function name='XMod' return='float, float' arguments='float value, float approach_speed'>
If the player has a XMod set, returns the value of that XMod and its associated approach speed. Returns nil otherwise.<br />
If the optional first argument is passed, sets the XMod to the value and disables any CMod or MMod that is set.<br />
If the optional second argument is passed, sets the speed at which the transition occurs.
</Function>
<Function name='Xmode' return='float, float' arguments='float value, float approach_speed'> </Function>
</Class>
<Class name='PlayerStageStats'>
<Function name='FailPlayer' return='bool' arguments=''>
@@ -3788,6 +3791,9 @@ save yourself some time, copy this for undocumented things:
<Function name='Center1Player' return='bool' arguments=''>
Returns <code>true</code> if a single <Link class='Player' /> has its NoteField centered.
</Function>
<Function name='FailFadeRemovePlayer' return='void' arguments='PlayerNumber pn'>
Removes the notes for the specified player.
</Function>
<Function name='GetDummyPlayerInfo' return='PlayerInfo' arguments='int index'>
Returns a dummy PlayerInfo for the specified index.
</Function>
@@ -4300,14 +4306,8 @@ save yourself some time, copy this for undocumented things:
<Description>
See the description for PlayerOptions. The functions follow the same design.
</Description>
<Function name='LifeSetting' return='LifeType' arguments='LifeType type'>
</Function>
<Function name='DrainSetting' return= 'DrainType' arguments='DrainType type'>
</Function>
<Function name='AutosyncSetting' return='AutosyncType' arguments='AutosyncType type'>
</Function>
<Function name='BatteryLives' return='int' arguments='int num'>
</Function>
<Function name='AssistClap' return='bool' arguments='bool b'>
</Function>
<Function name='AssistMetronome' return='bool' arguments='bool b'>
+4 -4
View File
@@ -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"
+7 -4
View File
@@ -868,11 +868,14 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &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);
}
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
#include "PlayerNumber.h"
#include "GameConstantsAndTypes.h"
#include "ActorFrame.h"
#include "SongOptions.h"
#include "PlayerOptions.h"
class PlayerState;
class PlayerStageStats;
+18 -19
View File
@@ -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:
+17 -9
View File
@@ -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<LifeMeterBattery>
{
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()
+1
View File
@@ -32,6 +32,7 @@ public:
void Refresh();
int GetLivesLeft() { return m_iLivesLeft; }
int GetTotalLives();
void ChangeLives(int iLifeDiff);
// Lua
+2 -2
View File
@@ -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; \
}
+2 -2
View File
@@ -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 )
+67
View File
@@ -12,6 +12,24 @@
#include "CommonMetrics.h"
#include <float.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 );
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<RString> &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);
+31 -1
View File
@@ -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
+37 -15
View File
@@ -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<LifeMeterBar*>(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<PlayerNumber>(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 );
}
};
+3
View File
@@ -172,6 +172,9 @@ public:
bool IsPaused() const { return m_bPaused; }
float GetHasteRate();
void FailFadeRemovePlayer(PlayerInfo* pi);
void FailFadeRemovePlayer(PlayerNumber pn);
vector<float> m_HasteTurningPoints; // Values at which the meaning of GAMESTATE->m_fHasteRate changes.
vector<float> m_HasteAddAmounts; // Amounts that are added to speed depending on what turning point has been passed.
float m_fHasteTimeBetweenUpdates; // Seconds between haste updates.
+1 -1
View File
@@ -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 )
+11 -3
View File
@@ -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
{
+1 -69
View File
@@ -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<RString> &AddTo, float level, RString name )
void SongOptions::GetMods( vector<RString> &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<RString> 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<SongOptions>
{
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);
+1 -29
View File
@@ -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),