changes to hybrid and sn2 scoring by A.C/@waiei: http://kokuru.com/GBJxPu/
This commit is contained in:
@@ -131,6 +131,7 @@ end;
|
|||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
--HYBRID Scoring, contributed by @waiei
|
--HYBRID Scoring, contributed by @waiei
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
local hyb_Steps=0;
|
||||||
r['HYBRID'] = function(params, pss)
|
r['HYBRID'] = function(params, pss)
|
||||||
local multLookup =
|
local multLookup =
|
||||||
{
|
{
|
||||||
@@ -140,19 +141,29 @@ r['HYBRID'] = function(params, pss)
|
|||||||
};
|
};
|
||||||
setmetatable(multLookup, ZeroIfNotFound);
|
setmetatable(multLookup, ZeroIfNotFound);
|
||||||
local radarValues = GetDirectRadar(params.Player);
|
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/の値
|
-- 1+2+3+...+totalItems value/の値
|
||||||
local sTotal = (totalItems+1)*totalItems/2;
|
local sTotal = (totalItems+1)*totalItems/2;
|
||||||
-- [en] Score for one song
|
-- [en] Score for one song
|
||||||
-- [ja] 1つあたりのスコア
|
-- [ja] 1ステップあたりのスコア
|
||||||
local sOne = math.floor(100000000/sTotal);
|
local sOne = math.floor(100000000/sTotal);
|
||||||
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
|
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
|
||||||
local sLast = 100000000-(sOne*sTotal);
|
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);
|
pss:SetCurMaxScore(pss:GetCurMaxScore()+1);
|
||||||
-- [en] current score
|
-- [en] current score
|
||||||
-- [ja] 今回のスコア
|
-- [ja] 今回加算するスコア(W1の時)
|
||||||
local vScore = sOne*(pss:GetCurMaxScore());
|
local vScore = sOne*hyb_Steps;
|
||||||
|
pss:SetCurMaxScore(pss:GetCurMaxScore()+vScore);
|
||||||
|
-- [ja] 判定によって加算量を変更
|
||||||
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
|
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
|
||||||
vScore = vScore;
|
vScore = vScore;
|
||||||
else
|
else
|
||||||
@@ -162,10 +173,12 @@ r['HYBRID'] = function(params, pss)
|
|||||||
vScore = vScore*multLookup[params.TapNoteScore]/10;
|
vScore = vScore*multLookup[params.TapNoteScore]/10;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if ((vScore > 0) and (pss:GetCurMaxScore() == totalItems)) then
|
|
||||||
vScore = vScore+sLast;
|
|
||||||
end;
|
|
||||||
pss:SetScore(pss:GetScore()+vScore);
|
pss:SetScore(pss:GetScore()+vScore);
|
||||||
|
|
||||||
|
-- [ja] 最後の1ステップの場合、端数を加算する
|
||||||
|
if ((vScore > 0) and (hyb_Steps == totalItems)) then
|
||||||
|
pss:SetScore(pss:GetScore()+sLast);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
@@ -191,6 +204,9 @@ end;
|
|||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
--DDR SuperNOVA 2(-esque) scoring
|
--DDR SuperNOVA 2(-esque) scoring
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
local sn2tmp_Sub=0;
|
||||||
|
local sn2tmp_Score=0;
|
||||||
|
local sn2tmp_Steps=0;
|
||||||
r['DDR SuperNOVA 2'] = function(params, pss)
|
r['DDR SuperNOVA 2'] = function(params, pss)
|
||||||
local multLookup =
|
local multLookup =
|
||||||
{
|
{
|
||||||
@@ -200,35 +216,46 @@ r['DDR SuperNOVA 2'] = function(params, pss)
|
|||||||
};
|
};
|
||||||
setmetatable(multLookup, ZeroIfNotFound);
|
setmetatable(multLookup, ZeroIfNotFound);
|
||||||
local radarValues = GetDirectRadar(params.Player);
|
local radarValues = GetDirectRadar(params.Player);
|
||||||
|
-- [ja] GetTotalItems(radarValues) に Liftも含まれているので 引いておく
|
||||||
local totalItems = GetTotalItems(radarValues) - radarValues:GetValue('RadarCategory_Lifts');
|
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;
|
local maxAdd = 0;
|
||||||
|
-- [ja] O.K.判定時は問答無用で満点
|
||||||
if params.HoldNoteScore == 'HoldNoteScore_Held' then
|
if params.HoldNoteScore == 'HoldNoteScore_Held' then
|
||||||
maxAdd = 10;
|
maxAdd = 10;
|
||||||
else
|
else
|
||||||
|
-- [ja] N.G.判定時は問答無用で0点
|
||||||
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
|
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
|
||||||
maxAdd = 0;
|
maxAdd = 0;
|
||||||
|
-- [ja] それ以外ということは、ロングノート以外の判定である
|
||||||
else
|
else
|
||||||
maxAdd = multLookup[params.TapNoteScore];
|
maxAdd = multLookup[params.TapNoteScore];
|
||||||
if (params.TapNoteScore == 'TapNoteScore_W2') or (params.TapNoteScore=='TapNoteScore_W3') then
|
if (params.TapNoteScore == 'TapNoteScore_W2') or (params.TapNoteScore=='TapNoteScore_W3') then
|
||||||
-- [ja] 超最終手段
|
-- [ja] W2とW3の数を記録
|
||||||
pss:SetCurMaxScore( pss:GetCurMaxScore() + 1000000 );
|
sn2tmp_Sub=sn2tmp_Sub+1;
|
||||||
end;
|
end;
|
||||||
end
|
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] 計算して代入
|
||||||
[ja] パフェ数取得 この方法で取得するとロングノートの場合2つカウントされる そのため使えない
|
pss:SetScore((math.floor(10000*sn2tmp_Score/totalItems) * 10) - (sn2tmp_Sub*10) );
|
||||||
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) );
|
|
||||||
end;
|
end;
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
--Radar Master (disabled; todo: get this working with StepMania 5)
|
--Radar Master (disabled; todo: get this working with StepMania 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user