diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index e544c5b02f..efdeb157b5 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -10,11 +10,13 @@ supported but exist anyways.) _____________________________________________________________________________ ================================================================================ -sm-ssc v1.2.1 | 20110??? +sm-ssc v1.2.1 | 2011011? -------------------------------------------------------------------------------- 20110112 -------- +* [SpecialScoring] MIGS scoring, improved SN and SN2 scoring. [FSX] +* [RageFile] Added ReadBytes() Lua binding. [FSX] * [NetworkSyncManager] Added CloseConnection() Lua binding. [freem] * [ScreenTextEntry] Added Load(TextEntrySettings) Lua binding. [freem] TextEntrySettings is implemented similar to the Attributes in BitmapText. diff --git a/Themes/default/Scripts/04 SpecialScoring.lua b/Themes/default/Scripts/04 SpecialScoring.lua index bd17d92b17..b30840f55e 100644 --- a/Themes/default/Scripts/04 SpecialScoring.lua +++ b/Themes/default/Scripts/04 SpecialScoring.lua @@ -25,17 +25,23 @@ end; --DDR SuperNOVA(-esque) scoring ----------------------------------------------------------- r['DDR SuperNOVA'] = function(params, pss) - local dp = pss:GetPossibleDancePoints(); - if dp == 0 then pss:SetScore(0) return nil end - pss:SetScore(math.round((pss:GetActualDancePoints()/dp)*1000000)); + local multLookup = { ['TapNoteScore_W1'] = 1, ['TapNoteScore_W2'] = 1, ['TapNoteScore_W3'] = 0.5 }; + setmetatable(multLookup, ZeroIfNotFound); + local radarValues = GAMESTATE:GetCurrentSteps(params.Player):GetRadarValues(params.Player); + local totalItems = radarValues:GetValue('RadarCategory_TapsAndHolds') + radarValues:GetValue('RadarCategory_Holds') + radarValues:GetValue('RadarCategory_Rolls'); + local buildScore = (10000000 / totalItems * multLookup[params.TapNoteScore]) + (10000000 / totalItems * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0)); + pss:SetScore(pss:GetScore() + math.round(buildScore)); end; ----------------------------------------------------------- --DDR SuperNOVA 2(-esque) scoring ----------------------------------------------------------- r['DDR SuperNOVA 2'] = function(params, pss) - local dp = pss:GetPossibleDancePoints(); - if dp == 0 then pss:SetScore(0) return nil end - pss:SetScore(math.round((pss:GetActualDancePoints()/dp)*100000)*10); + local multLookup = { ['TapNoteScore_W1'] = 1, ['TapNoteScore_W2'] = 1, ['TapNoteScore_W3'] = 0.5 }; + setmetatable(multLookup, ZeroIfNotFound); + local radarValues = GAMESTATE:GetCurrentSteps(params.Player):GetRadarValues(params.Player); + local totalItems = radarValues:GetValue('RadarCategory_TapsAndHolds') + radarValues:GetValue('RadarCategory_Holds') + radarValues:GetValue('RadarCategory_Rolls'); + local buildScore = (100000 / totalItems * multLookup[params.TapNoteScore] - ((params.TapNoteScore == 'TapNoteScore_W2' and (PREFSMAN:GetPreference("AllowW1") ~= 'AllowW1_Never' or not (GAMESTATE:IsCourseMode() and PREFSMAN:GetPreference("AllowW1") == 'AllowW1_CoursesOnly'))) and 10 or 0)) + (100000 / totalItems * (params.HoldNoteScore == 'HoldNoteScore_Held' and 1 or 0)); + pss:SetScore(pss:GetScore() + (math.round(buildScore) * 10)); end; ----------------------------------------------------------- --Radar Master (doesn't work in 1.2, disabled) diff --git a/src/RageFile.cpp b/src/RageFile.cpp index 4a56b1a66a..471e39c34e 100644 --- a/src/RageFile.cpp +++ b/src/RageFile.cpp @@ -351,6 +351,14 @@ public: return 1; } + static int ReadBytes( T* p, lua_State *L ) + { + RString string; + p->Read( string, IArg(1) ); + lua_pushstring( L, string ); + return 1; + } + static int Seek( T* p, lua_State *L ) { lua_pushinteger( L, p->Seek( IArg(1) ) ); @@ -403,6 +411,7 @@ public: ADD_METHOD( Close ); ADD_METHOD( Write ); ADD_METHOD( Read ); + ADD_METHOD( ReadBytes ); ADD_METHOD( Seek ); ADD_METHOD( Tell ); ADD_METHOD( GetLine );