From 1be52bf71f691333bce863888d304b42cd281c73 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 13 Jan 2011 21:08:01 -0500 Subject: [PATCH] Converting most of DDR Extreme scoring to lua. There is a bit more to do...refactoring may be worth looking into. --- Themes/default/Scripts/04 SpecialScoring.lua | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Themes/default/Scripts/04 SpecialScoring.lua b/Themes/default/Scripts/04 SpecialScoring.lua index ff32f2217d..6e2979eddc 100644 --- a/Themes/default/Scripts/04 SpecialScoring.lua +++ b/Themes/default/Scripts/04 SpecialScoring.lua @@ -23,6 +23,42 @@ r['DDR 4thMIX'] = function(params, pss) pss:SetScore(pss:GetScore()+scoreLookupTable[params.TapNoteScore]+(scoreLookupTable[params.TapNoteScore] and comboBonusForThisStep or 0)); end; ----------------------------------------------------------- +--DDR MAX2/Extreme Scoring +----------------------------------------------------------- +r['DDR Extreme'] = function(params, pss) + local judgmentBase = { + ['TapNoteScore_W1'] = 10, + ['TapNoteScore_W2'] = 9, + ['TapNoteScore_W3'] = 5 + }; + setmetatable(judgmentBase, ZeroIfNotFound); + local steps = GAMESTATE:GetCurrentSteps(params.Player); + local radarValues = steps:GetRadarValues(params.Player); + local baseScore = (steps:IsAnEdit() and + 5 or steps:GetMeter()) * 10000000; + local currentStep = 0; -- TODO: Get current step/hold. + local totalItems = radarValues:GetValue('RadarCategory_TapsAndHolds') + + radarValues:GetValue('RadarCategory_Holds') + + radarValues:GetValue('RadarCategory_Rolls'); + local singleStep = (1 + totalItems) * totalItems / 2; + local stepLast = math.floor(baseScore / singleStep) * currentStep); + local judgeScore = 0; + if (params.HoldNoteScore == 'HoldNoteScore_Held') then + judgeScore = judgmentBase['TapNoteScore_W1']; + else + judgeScore = judgmentBase[params.TapNoteScore]; + if (params.TapNoteScore == 'TapNoteScore_W2' + and (PREFSMAN:GetPreference("AllowW1") ~= 'AllowW1_Never' + or not (GAMESTATE:IsCourseMode() and + PREFSMAN:GetPreference("AllowW1") == 'AllowW1_CoursesOnly'))) then + judgeScore = judgmentBase['TapNoteScore_W1']; + end; + end; + local stepScore = judgeScore * stepLast; + + pss:SetScore(pss:GetScore() + stepScore); +end; +----------------------------------------------------------- --DDR SuperNOVA(-esque) scoring ----------------------------------------------------------- r['DDR SuperNOVA'] = function(params, pss)