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:
MrThatKid
2017-08-30 11:57:23 -07:00
committed by GitHub
parent 1e5979fe14
commit cf2b25fdcc
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -1366,6 +1366,7 @@
<Function name='IsDisqualified'/>
<Function name='MaxCombo'/>
<Function name='SetCurMaxScore'/>
<Function name='SetDancePointLimits'/>
<Function name='SetScore'/>
</Class>
<Class name='PlayerState'>
+3
View File
@@ -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=''>
+20
View File
@@ -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 );