From 07903f06ee84c137bc10485d9d7e5454430ac12b Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 28 Aug 2011 16:43:50 +0000 Subject: [PATCH 1/5] some scoring changes, new 1bilDP scoring type. --- Themes/_fallback/Scripts/04 Scoring.lua | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 5b573738c4..442ffc6496 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -304,20 +304,18 @@ r['MIGS'] = function(params,pss) for k,v in pairs(tapScoreTable) do curScore = curScore + ( pss:GetTapNoteScores(k) * v ); end; - curScore = curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 ); - pss:SetScore(clamp(curScore,0,math.huge)); + curScore = math.max(0,curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 )); end; +-------------------------------------------------------------- +--1bilDP scoring because I can. +-------------------------------------------------------------- +r['1bilDP']= function(params,pss) + local score = math.floor((pss:GetActualDancePoints()/pss:GetPossibleDancePoints())*1000000000) + pss:SetScore(score) + pss:SetCurMaxScore(score) +end ------------------------------------------------------------------------------- -- Formulas end here. +for v in ivalues(DisabledScoringModes) do r[v] = nil end Scoring = {}; -setmetatable(Scoring, { - __metatable = { "Letting you change the metatable sort of defeats the purpose." }, - __index = function(tbl, key) - for v in ivalues(DisabledScoringModes) do - if key == v then return r['DDR Extreme'] end - end - return r[key] - end, - } -); From a2dcc9b7ebcfe78be068a9cf376e68f273574129 Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 28 Aug 2011 16:45:47 +0000 Subject: [PATCH 2/5] fix problems caused by me forgetting how my own code worked derp --- Themes/_fallback/Scripts/04 Scoring.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 442ffc6496..8c5e02655f 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -318,4 +318,4 @@ end ------------------------------------------------------------------------------- -- Formulas end here. for v in ivalues(DisabledScoringModes) do r[v] = nil end -Scoring = {}; +Scoring = r From 9a9d427902d93b8c6ceb63f0e914b2fdca96512b Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 28 Aug 2011 16:54:47 +0000 Subject: [PATCH 3/5] scoring junk --- Themes/_fallback/Scripts/04 Scoring.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 8c5e02655f..8cc2e39cd1 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -318,4 +318,9 @@ end ------------------------------------------------------------------------------- -- Formulas end here. for v in ivalues(DisabledScoringModes) do r[v] = nil end -Scoring = r +Scoring = {} +setmetatable(Scoring, { __index = function(...) return function(params,pss) +--put any code here that should run before every scoring function +if not GAMESTATE:IsHumanPlayer(params.Player) and r[key] +then return r[key](...) end +end } From 12fb90f9d310b8bb912e0f1f4fda60821dcce0ec Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 28 Aug 2011 16:55:58 +0000 Subject: [PATCH 4/5] be safer. --- Themes/_fallback/Scripts/04 Scoring.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 8cc2e39cd1..95d2f21666 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -321,6 +321,6 @@ for v in ivalues(DisabledScoringModes) do r[v] = nil end Scoring = {} setmetatable(Scoring, { __index = function(...) return function(params,pss) --put any code here that should run before every scoring function -if not GAMESTATE:IsHumanPlayer(params.Player) and r[key] -then return r[key](...) end + if not GAMESTATE:IsHumanPlayer(params.Player) and type(r[key]) == "function" then + return r[key](...) end end } From 19181165545de372d9eed851b56eed3187e2eefb Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 28 Aug 2011 16:59:22 +0000 Subject: [PATCH 5/5] fix 1bilDP calculation --- Themes/_fallback/Scripts/04 Scoring.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 95d2f21666..38e928da60 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -311,9 +311,9 @@ end; --1bilDP scoring because I can. -------------------------------------------------------------- r['1bilDP']= function(params,pss) - local score = math.floor((pss:GetActualDancePoints()/pss:GetPossibleDancePoints())*1000000000) - pss:SetScore(score) - pss:SetCurMaxScore(score) + local poss = pss:GetPossibleDancePoints() + pss:SetScore(math.floor((pss:GetActualDancePoints()/poss)*1000000000)) + pss:SetCurMaxScore(math.floor((pss:GetCurrentPossibleDancePoints()/poss)*1000000000)) end ------------------------------------------------------------------------------- -- Formulas end here.