Implemented SetActualDancePoints & SetPossibleDancePoints (#1527)
* Implemented Dance Point setting Methods added: SetPossibleDancePoints SetActualDancePoints * Update luadocs to reflect changes * Fix possible divide by zero * Merge DP setting functions into one. (#5) * Merge DP setting functions into one. Also, ensure that scores of >100% aren't possible Function usage: SetDancePointLimits(actual, possible) Clamps to 100% if actual/possible >100% * Update the luadocs again
This commit is contained in:
@@ -1366,6 +1366,7 @@
|
||||
<Function name='IsDisqualified'/>
|
||||
<Function name='MaxCombo'/>
|
||||
<Function name='SetCurMaxScore'/>
|
||||
<Function name='SetDancePointLimits'/>
|
||||
<Function name='SetScore'/>
|
||||
</Class>
|
||||
<Class name='PlayerState'>
|
||||
|
||||
@@ -3975,6 +3975,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='IsDisqualified' return='bool' arguments=''>
|
||||
Returns <code>true</code> if the player was disqualified from ranking.
|
||||
</Function>
|
||||
<Function name='SetDancePointLimits' return='void' arguments='int actual, int possible'>
|
||||
Sets the Dance Point limits of the stage.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='PlayerState'>
|
||||
<Function name='ApplyPreferredOptionsToOtherLevels' return='void' arguments=''>
|
||||
|
||||
@@ -865,6 +865,25 @@ public:
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
static int SetDancePointLimits( T* p, lua_State *L )
|
||||
{
|
||||
int actual = IArg(1);
|
||||
int possible = IArg(2);
|
||||
if( actual >= 0 && possible > 0 )
|
||||
{
|
||||
p->m_iPossibleDancePoints = possible;
|
||||
if( actual <= possible )
|
||||
{
|
||||
p->m_iActualDancePoints = actual;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->m_iActualDancePoints = possible;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
|
||||
static int FailPlayer( T* p, lua_State *L )
|
||||
{
|
||||
@@ -915,6 +934,7 @@ public:
|
||||
ADD_METHOD( SetScore );
|
||||
ADD_METHOD( GetCurMaxScore );
|
||||
ADD_METHOD( SetCurMaxScore );
|
||||
ADD_METHOD( SetDancePointLimits );
|
||||
ADD_METHOD( FailPlayer );
|
||||
ADD_METHOD( GetSongsPassed );
|
||||
ADD_METHOD( GetSongsPlayed );
|
||||
|
||||
Reference in New Issue
Block a user