diff --git a/Themes/_fallback/Scripts/04 Scoring.lua b/Themes/_fallback/Scripts/04 Scoring.lua index 51e826512a..5b573738c4 100644 --- a/Themes/_fallback/Scripts/04 Scoring.lua +++ b/Themes/_fallback/Scripts/04 Scoring.lua @@ -131,6 +131,7 @@ end; ----------------------------------------------------------- --HYBRID Scoring, contributed by @waiei ----------------------------------------------------------- +local hyb_Steps=0; r['HYBRID'] = function(params, pss) local multLookup = { @@ -140,19 +141,29 @@ r['HYBRID'] = function(params, pss) }; setmetatable(multLookup, ZeroIfNotFound); local radarValues = GetDirectRadar(params.Player); - local totalItems = GetTotalItems(radarValues); + -- [ja] GetTotalItems(radarValues) に Liftも含まれているので 引いておく + local totalItems = GetTotalItems(radarValues) - radarValues:GetValue('RadarCategory_Lifts'); -- 1+2+3+...+totalItems value/の値 local sTotal = (totalItems+1)*totalItems/2; -- [en] Score for one song - -- [ja] 1つあたりのスコア + -- [ja] 1ステップあたりのスコア local sOne = math.floor(100000000/sTotal); -- [ja] 端数は最後の1ステップで加算するのでその値を取得 local sLast = 100000000-(sOne*sTotal); - -- [ja] 現在何個目の譜面か + + -- [ja] スコアが0の時に初期化 + if pss:GetScore()==0 then + hyb_Steps=0; + end; + + -- [ja] 現在のステップ数 + hyb_Steps=hyb_Steps+1; pss:SetCurMaxScore(pss:GetCurMaxScore()+1); -- [en] current score - -- [ja] 今回のスコア - local vScore = sOne*(pss:GetCurMaxScore()); + -- [ja] 今回加算するスコア(W1の時) + local vScore = sOne*hyb_Steps; + pss:SetCurMaxScore(pss:GetCurMaxScore()+vScore); + -- [ja] 判定によって加算量を変更 if (params.HoldNoteScore == 'HoldNoteScore_Held') then vScore = vScore; else @@ -162,10 +173,12 @@ r['HYBRID'] = function(params, pss) vScore = vScore*multLookup[params.TapNoteScore]/10; end; end; - if ((vScore > 0) and (pss:GetCurMaxScore() == totalItems)) then - vScore = vScore+sLast; - end; pss:SetScore(pss:GetScore()+vScore); + + -- [ja] 最後の1ステップの場合、端数を加算する + if ((vScore > 0) and (hyb_Steps == totalItems)) then + pss:SetScore(pss:GetScore()+sLast); + end; end; ----------------------------------------------------------- @@ -191,6 +204,9 @@ end; ----------------------------------------------------------- --DDR SuperNOVA 2(-esque) scoring ----------------------------------------------------------- +local sn2tmp_Sub=0; +local sn2tmp_Score=0; +local sn2tmp_Steps=0; r['DDR SuperNOVA 2'] = function(params, pss) local multLookup = { @@ -200,35 +216,46 @@ r['DDR SuperNOVA 2'] = function(params, pss) }; setmetatable(multLookup, ZeroIfNotFound); local radarValues = GetDirectRadar(params.Player); + -- [ja] GetTotalItems(radarValues) に Liftも含まれているので 引いておく local totalItems = GetTotalItems(radarValues) - radarValues:GetValue('RadarCategory_Lifts'); + -- [ja] 0除算対策(しなくても動作するけど満点になっちゃうんで) + if totalItems <= 0 then + totalItems=1 + end; - -- handle holds + -- [ja] スコアが0の時に初期化 + if pss:GetScore() == 0 then + sn2tmp_Sub=0; + sn2tmp_Score=0; + sn2tmp_Steps=0; + end; + + -- [ja] maxAdd は 加算する最高点を 10 とした時の値(つまり、10=100% / 5=50%) local maxAdd = 0; + -- [ja] O.K.判定時は問答無用で満点 if params.HoldNoteScore == 'HoldNoteScore_Held' then maxAdd = 10; else + -- [ja] N.G.判定時は問答無用で0点 if params.HoldNoteScore == 'HoldNoteScore_LetGo' then maxAdd = 0; + -- [ja] それ以外ということは、ロングノート以外の判定である else maxAdd = multLookup[params.TapNoteScore]; if (params.TapNoteScore == 'TapNoteScore_W2') or (params.TapNoteScore=='TapNoteScore_W3') then - -- [ja] 超最終手段 - pss:SetCurMaxScore( pss:GetCurMaxScore() + 1000000 ); + -- [ja] W2とW3の数を記録 + sn2tmp_Sub=sn2tmp_Sub+1; end; end end; - pss:SetCurMaxScore(pss:GetCurMaxScore() + maxAdd); + sn2tmp_Score=sn2tmp_Score+maxAdd; + -- [ja] 踏み踏みしたステップ数 + sn2tmp_Steps=sn2tmp_Steps+1; + -- [ja] 現時点での、All W1判定の時のスコア + pss:SetCurMaxScore(math.floor(10000*sn2tmp_Steps/totalItems) * 10); - --[[ - [ja] パフェ数取得 この方法で取得するとロングノートの場合2つカウントされる そのため使えない - pss:GetTapNoteScores('TapNoteScore_W2') - 仕方がないのでパフェ数を 1000000 単位で GetCurMaxScore に記録 - その後、情報を分解して取り出す - --]] - - local vScore = pss:GetCurMaxScore() % 1000000 - local vSub = math.floor( pss:GetCurMaxScore()/1000000 ) - pss:SetScore( math.floor(10000*vScore/totalItems) * 10 - (vSub*10) ); + -- [ja] 計算して代入 + pss:SetScore((math.floor(10000*sn2tmp_Score/totalItems) * 10) - (sn2tmp_Sub*10) ); end; ----------------------------------------------------------- --Radar Master (disabled; todo: get this working with StepMania 5)