2011-03-28 23:22:25 -04:00
|
|
|
|
--internals table
|
|
|
|
|
|
local Shared = {};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
--Special Scoring types.
|
|
|
|
|
|
local r = {};
|
2011-03-28 15:14:48 -04:00
|
|
|
|
local DisabledScoringModes = { '[SSC] Radar Master' };
|
2011-03-17 01:47:30 -04:00
|
|
|
|
--the following metatable makes any missing value in a table 0 instead of nil.
|
|
|
|
|
|
local ZeroIfNotFound = { __index = function() return 0 end; };
|
|
|
|
|
|
|
|
|
|
|
|
-- Retrieve the amount of taps/holds/rolls involved. Used for some formulas.
|
|
|
|
|
|
function GetTotalItems(radars)
|
2011-05-10 09:11:44 -05:00
|
|
|
|
local total = radars:GetValue('RadarCategory_TapsAndHolds')
|
|
|
|
|
|
total = total + radars:GetValue('RadarCategory_Holds')
|
|
|
|
|
|
total = total + radars:GetValue('RadarCategory_Rolls')
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [ja] Liftを加えると一部二重加算になるため除外する。
|
|
|
|
|
|
-- total = total + radars:GetValue('RadarCategory_Lifts')
|
|
|
|
|
|
|
|
|
|
|
|
-- [en] prevent divide by 0
|
|
|
|
|
|
-- [ja] 0除算対策(しなくても動作するけど満点になっちゃうんで)
|
|
|
|
|
|
if total <= 0 then
|
|
|
|
|
|
total = 1
|
|
|
|
|
|
end;
|
2011-05-10 09:11:44 -05:00
|
|
|
|
return total
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
-- Determine whether marvelous timing is to be considered.
|
|
|
|
|
|
function IsW1Allowed(tapScore)
|
|
|
|
|
|
return tapScore == 'TapNoteScore_W2'
|
|
|
|
|
|
and (PREFSMAN:GetPreference("AllowW1") ~= 'AllowW1_Never'
|
|
|
|
|
|
or not (GAMESTATE:IsCourseMode() and
|
|
|
|
|
|
PREFSMAN:GetPreference("AllowW1") == 'AllowW1_CoursesOnly'));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
-- Get the radar values directly. The individual steps aren't used much.
|
|
|
|
|
|
function GetDirectRadar(player)
|
|
|
|
|
|
return GAMESTATE:GetCurrentSteps(player):GetRadarValues(player);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 21:10:55 +00:00
|
|
|
|
--Oldschool scoring, best described as a modified 4th mix scheme
|
|
|
|
|
|
--with a little 1st mix influence
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 21:10:55 +00:00
|
|
|
|
r['Oldschool'] = function(params, pss)
|
|
|
|
|
|
local bestPoints = 999
|
2011-04-12 15:29:33 -04:00
|
|
|
|
local scoreLookupTable =
|
|
|
|
|
|
{
|
2011-10-06 21:10:55 +00:00
|
|
|
|
['TapNoteScore_W1']=999,
|
2011-10-07 08:39:21 -05:00
|
|
|
|
['TapNoteScore_W2']=IsW1Allowed('TapNoteScore_W2') and 888 or 999,
|
2011-10-06 21:10:55 +00:00
|
|
|
|
['TapNoteScore_W3']=777,
|
2011-10-07 08:39:21 -05:00
|
|
|
|
['TapNoteScore_W4']=555,
|
|
|
|
|
|
['TapNoteScore_W5']=111,
|
2011-04-12 15:29:33 -04:00
|
|
|
|
};
|
|
|
|
|
|
setmetatable(scoreLookupTable, ZeroIfNotFound);
|
2011-10-07 08:39:21 -05:00
|
|
|
|
local comboBonusForThisStep = (pss:GetCurrentCombo()*111)^1.1;
|
2011-10-06 21:10:55 +00:00
|
|
|
|
local capScore = 1000000000;
|
2011-10-07 08:39:21 -05:00
|
|
|
|
pss:SetCurMaxScore(capScore); --i don't really care about weird scoring modes -fsx
|
|
|
|
|
|
local pointsGot = comboBonusForThisStep + scoreLookupTable[params.TapNoteScore] + (params.HoldNoteScore == 'HoldNoteScore_Held' and 777 or 0);
|
2011-10-06 21:10:55 +00:00
|
|
|
|
pss:SetScore(clamp(pss:GetScore()+pointsGot,0,capScore));
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
--DDR MAX2/Extreme(-esque) Scoring by @sakuraponila
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local ext_Steps = {0,0};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
r['DDR Extreme'] = function(params, pss)
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local multLookup =
|
|
|
|
|
|
{
|
2011-03-17 01:47:30 -04:00
|
|
|
|
['TapNoteScore_W1'] = 10,
|
|
|
|
|
|
['TapNoteScore_W2'] = 9,
|
|
|
|
|
|
['TapNoteScore_W3'] = 5
|
|
|
|
|
|
};
|
2011-10-06 15:38:19 -05:00
|
|
|
|
setmetatable(multLookup, ZeroIfNotFound);
|
2011-03-17 01:47:30 -04:00
|
|
|
|
local steps = GAMESTATE:GetCurrentSteps(params.Player);
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local radarValues = GetDirectRadar(params.Player);
|
|
|
|
|
|
local totalItems = GetTotalItems(radarValues);
|
|
|
|
|
|
-- 1 + 2 + 3 + ... + totalItems value/の値
|
|
|
|
|
|
local sTotal = (totalItems + 1) * totalItems / 2;
|
2011-06-20 00:51:28 -04:00
|
|
|
|
local meter = steps:GetMeter();
|
|
|
|
|
|
if (steps:IsAnEdit()) then
|
2011-10-28 03:16:24 +00:00
|
|
|
|
meter = 5; end;
|
|
|
|
|
|
meter = math.min(10,meter);
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [en] score for one step
|
|
|
|
|
|
-- [ja] 1ステップあたりのスコア
|
|
|
|
|
|
local baseScore = meter * 1000000
|
2011-06-05 03:03:16 -04:00
|
|
|
|
if (GAMESTATE:GetCurrentSong():IsMarathon()) then
|
|
|
|
|
|
baseScore = baseScore * 3;
|
2011-06-20 00:51:28 -04:00
|
|
|
|
elseif (GAMESTATE:GetCurrentSong():IsLong()) then
|
|
|
|
|
|
baseScore = baseScore * 2;
|
2011-06-05 03:03:16 -04:00
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local sOne = math.floor(baseScore / sTotal);
|
|
|
|
|
|
-- [en] measures for 5 points of units
|
|
|
|
|
|
-- [ja] 5点単位のための処置
|
|
|
|
|
|
sOne = sOne - sOne % 5;
|
|
|
|
|
|
-- [en] because fractions are added by the last step, get value
|
|
|
|
|
|
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
|
|
|
|
|
|
local sLast = baseScore - (sOne * sTotal);
|
|
|
|
|
|
|
2011-11-27 21:53:57 -06:00
|
|
|
|
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [en] initialized when score is 0
|
|
|
|
|
|
-- [ja] スコアが0の時に初期化
|
|
|
|
|
|
if pss:GetScore() == 0 then
|
|
|
|
|
|
ext_Steps[p] = 0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
-- [en] now step count
|
|
|
|
|
|
-- [ja] 現在のステップ数
|
|
|
|
|
|
ext_Steps[p] = ext_Steps[p] + 1;
|
|
|
|
|
|
-- [en] current score
|
|
|
|
|
|
-- [ja] 今回加算するスコア(W1の時)
|
|
|
|
|
|
local vScore = sOne * ext_Steps[p];
|
|
|
|
|
|
pss:SetCurMaxScore(pss:GetCurMaxScore() + vScore);
|
|
|
|
|
|
-- [ja] 判定によって加算量を変更
|
2011-03-17 01:47:30 -04:00
|
|
|
|
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [ja] O.K.判定時は問答無用で満点
|
|
|
|
|
|
vScore = vScore;
|
2011-03-17 01:47:30 -04:00
|
|
|
|
else
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [ja] N.G.判定時は問答無用で0点
|
|
|
|
|
|
if (params.HoldNoteScore == 'HoldNoteScore_LetGo') then
|
|
|
|
|
|
vScore = 0;
|
|
|
|
|
|
-- [en] non-long note scoring
|
|
|
|
|
|
-- [ja] それ以外ということは、ロングノート以外の判定である
|
|
|
|
|
|
else
|
|
|
|
|
|
vScore = vScore * multLookup[params.TapNoteScore] / 10
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [en] measures for 5 points of units
|
|
|
|
|
|
-- [ja] ここでも5点単位のための処置
|
|
|
|
|
|
vScore = vScore - vScore % 5
|
|
|
|
|
|
pss:SetScore(pss:GetScore() + vScore);
|
|
|
|
|
|
-- if one of the last step, add the fractions
|
|
|
|
|
|
-- [ja] 最後の1ステップの場合、端数を加算する
|
|
|
|
|
|
if ((vScore > 0) and (ext_Steps[p] == totalItems)) then
|
|
|
|
|
|
pss:SetScore(pss:GetScore() + sLast);
|
2011-04-10 01:51:39 -04:00
|
|
|
|
end;
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
2011-06-08 14:36:24 -05:00
|
|
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
2011-08-18 13:32:08 -05:00
|
|
|
|
--HYBRID Scoring, contributed by @waiei
|
2011-06-08 14:36:24 -05:00
|
|
|
|
-----------------------------------------------------------
|
2011-09-02 15:53:27 -05:00
|
|
|
|
local hyb_Steps={0,0};
|
2011-10-06 21:10:55 +00:00
|
|
|
|
r['Hybrid'] = function(params, pss)
|
2011-06-08 14:36:24 -05:00
|
|
|
|
local multLookup =
|
|
|
|
|
|
{
|
|
|
|
|
|
['TapNoteScore_W1'] = 10,
|
|
|
|
|
|
['TapNoteScore_W2'] = 9,
|
|
|
|
|
|
['TapNoteScore_W3'] = 5
|
|
|
|
|
|
};
|
|
|
|
|
|
setmetatable(multLookup, ZeroIfNotFound);
|
|
|
|
|
|
local radarValues = GetDirectRadar(params.Player);
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local totalItems = GetTotalItems(radarValues);
|
2011-08-18 13:32:08 -05:00
|
|
|
|
-- 1+2+3+...+totalItems value/の値
|
2011-06-08 14:36:24 -05:00
|
|
|
|
local sTotal = (totalItems+1)*totalItems/2;
|
|
|
|
|
|
-- [en] Score for one song
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] 1ステップあたりのスコア
|
2011-06-08 14:36:24 -05:00
|
|
|
|
local sOne = math.floor(100000000/sTotal);
|
2011-07-02 00:05:14 -04:00
|
|
|
|
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
|
2011-06-08 14:36:24 -05:00
|
|
|
|
local sLast = 100000000-(sOne*sTotal);
|
2011-08-24 13:59:32 -05:00
|
|
|
|
|
2011-11-27 21:53:57 -06:00
|
|
|
|
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
|
2011-09-02 15:53:27 -05:00
|
|
|
|
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] スコアが0の時に初期化
|
|
|
|
|
|
if pss:GetScore()==0 then
|
2011-09-02 15:53:27 -05:00
|
|
|
|
hyb_Steps[p]=0;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
-- [ja] 現在のステップ数
|
2011-09-02 15:53:27 -05:00
|
|
|
|
hyb_Steps[p]=hyb_Steps[p]+1;
|
2011-06-08 14:36:24 -05:00
|
|
|
|
-- [en] current score
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] 今回加算するスコア(W1の時)
|
2011-09-02 15:53:27 -05:00
|
|
|
|
local vScore = sOne*hyb_Steps[p];
|
2011-08-24 13:59:32 -05:00
|
|
|
|
pss:SetCurMaxScore(pss:GetCurMaxScore()+vScore);
|
|
|
|
|
|
-- [ja] 判定によって加算量を変更
|
2011-06-08 14:36:24 -05:00
|
|
|
|
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
|
|
|
|
|
|
vScore = vScore;
|
|
|
|
|
|
else
|
|
|
|
|
|
if (params.HoldNoteScore == 'HoldNoteScore_LetGo') then
|
|
|
|
|
|
vScore = 0;
|
|
|
|
|
|
else
|
|
|
|
|
|
vScore = vScore*multLookup[params.TapNoteScore]/10;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
pss:SetScore(pss:GetScore()+vScore);
|
2011-08-24 13:59:32 -05:00
|
|
|
|
|
|
|
|
|
|
-- [ja] 最後の1ステップの場合、端数を加算する
|
2011-09-02 15:53:27 -05:00
|
|
|
|
if ((vScore > 0) and (hyb_Steps[p] == totalItems)) then
|
2011-08-24 13:59:32 -05:00
|
|
|
|
pss:SetScore(pss:GetScore()+sLast);
|
|
|
|
|
|
end;
|
2011-06-08 14:36:24 -05:00
|
|
|
|
end;
|
|
|
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
--DDR SuperNOVA scoring (Use MARVELOUS) by @sakuraponila
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local sntmp_Score = {0,0};
|
|
|
|
|
|
local sntmp_Steps = {0,0};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
r['DDR SuperNOVA'] = function(params, pss)
|
2011-04-10 02:55:16 -04:00
|
|
|
|
local multLookup =
|
|
|
|
|
|
{
|
2011-10-06 15:38:19 -05:00
|
|
|
|
['TapNoteScore_W1'] = 3,
|
|
|
|
|
|
['TapNoteScore_W2'] = 2,
|
|
|
|
|
|
['TapNoteScore_W3'] = 1
|
2011-04-10 02:55:16 -04:00
|
|
|
|
};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
setmetatable(multLookup, ZeroIfNotFound);
|
|
|
|
|
|
local radarValues = GetDirectRadar(params.Player);
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local totalItems = GetTotalItems(radarValues)
|
2011-11-27 21:53:57 -06:00
|
|
|
|
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
|
2011-09-02 15:53:27 -05:00
|
|
|
|
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- initialized when score is 0
|
2011-09-02 15:53:27 -05:00
|
|
|
|
-- [ja] スコアが0の時に初期化
|
2011-10-06 15:38:19 -05:00
|
|
|
|
if pss:GetScore() == 0 then
|
|
|
|
|
|
sntmp_Score[p] = 0;
|
|
|
|
|
|
sntmp_Steps[p] = 0;
|
2011-09-02 15:53:27 -05:00
|
|
|
|
end;
|
|
|
|
|
|
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [ja] 判定によって加算量を変更
|
2011-09-02 15:53:27 -05:00
|
|
|
|
local maxAdd = 0;
|
|
|
|
|
|
-- [ja] O.K.判定時は問答無用で満点
|
|
|
|
|
|
if params.HoldNoteScore == 'HoldNoteScore_Held' then
|
2011-10-06 15:38:19 -05:00
|
|
|
|
maxAdd = 3;
|
2011-09-02 15:53:27 -05:00
|
|
|
|
else
|
|
|
|
|
|
-- [ja] N.G.判定時は問答無用で0点
|
|
|
|
|
|
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
|
|
|
|
|
|
maxAdd = 0;
|
|
|
|
|
|
-- [ja] それ以外ということは、ロングノート以外の判定である
|
|
|
|
|
|
else
|
|
|
|
|
|
maxAdd = multLookup[params.TapNoteScore];
|
|
|
|
|
|
end
|
2011-10-06 15:38:19 -05:00
|
|
|
|
end;
|
|
|
|
|
|
sntmp_Score[p] = sntmp_Score[p] + maxAdd;
|
2011-11-27 21:53:57 -06:00
|
|
|
|
|
2011-09-02 15:53:27 -05:00
|
|
|
|
-- [ja] 踏み踏みしたステップ数
|
2011-10-06 15:38:19 -05:00
|
|
|
|
sntmp_Steps[p] = sntmp_Steps[p] + 1;
|
2011-09-02 15:53:27 -05:00
|
|
|
|
-- [ja] 現時点での、All W1判定の時のスコア
|
2011-10-06 15:38:19 -05:00
|
|
|
|
pss:SetCurMaxScore(math.floor(10000000 * sntmp_Steps[p] / totalItems / 3));
|
2011-09-02 15:53:27 -05:00
|
|
|
|
-- [ja] 計算して代入
|
2011-10-06 15:38:19 -05:00
|
|
|
|
pss:SetScore(math.floor(10000000 * sntmp_Score[p] / totalItems / 3));
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
--DDR SuperNOVA 2 scoring by @waiei
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local sn2tmp_Sub={0,0};
|
|
|
|
|
|
local sn2tmp_Score={0,0};
|
|
|
|
|
|
local sn2tmp_Steps={0,0};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
r['DDR SuperNOVA 2'] = function(params, pss)
|
2011-04-10 02:55:16 -04:00
|
|
|
|
local multLookup =
|
|
|
|
|
|
{
|
2011-06-08 12:38:36 -05:00
|
|
|
|
['TapNoteScore_W1'] = 10,
|
|
|
|
|
|
['TapNoteScore_W2'] = 10,
|
|
|
|
|
|
['TapNoteScore_W3'] = 5
|
2011-04-10 02:55:16 -04:00
|
|
|
|
};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
setmetatable(multLookup, ZeroIfNotFound);
|
|
|
|
|
|
local radarValues = GetDirectRadar(params.Player);
|
2011-10-06 15:38:19 -05:00
|
|
|
|
local totalItems = GetTotalItems(radarValues);
|
2011-11-27 21:53:57 -06:00
|
|
|
|
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
|
2011-06-08 12:38:36 -05:00
|
|
|
|
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] スコアが0の時に初期化
|
2011-10-06 15:38:19 -05:00
|
|
|
|
if pss:GetScore()==0 then
|
|
|
|
|
|
sn2tmp_Sub[p]=0;
|
|
|
|
|
|
sn2tmp_Score[p]=0;
|
|
|
|
|
|
sn2tmp_Steps[p]=0;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
-- [ja] maxAdd は 加算する最高点を 10 とした時の値(つまり、10=100% / 5=50%)
|
2011-07-02 00:05:14 -04:00
|
|
|
|
local maxAdd = 0;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] O.K.判定時は問答無用で満点
|
2011-06-08 12:38:36 -05:00
|
|
|
|
if params.HoldNoteScore == 'HoldNoteScore_Held' then
|
2011-07-02 00:05:14 -04:00
|
|
|
|
maxAdd = 10;
|
2011-06-08 12:38:36 -05:00
|
|
|
|
else
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] N.G.判定時は問答無用で0点
|
2011-08-05 16:15:42 -05:00
|
|
|
|
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
|
|
|
|
|
|
maxAdd = 0;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] それ以外ということは、ロングノート以外の判定である
|
2011-08-05 16:15:42 -05:00
|
|
|
|
else
|
|
|
|
|
|
maxAdd = multLookup[params.TapNoteScore];
|
2011-08-20 19:19:21 -05:00
|
|
|
|
if (params.TapNoteScore == 'TapNoteScore_W2') or (params.TapNoteScore=='TapNoteScore_W3') then
|
2011-10-06 15:38:19 -05:00
|
|
|
|
-- [ja] W2とW3の数を記録
|
|
|
|
|
|
sn2tmp_Sub[p]=sn2tmp_Sub[p]+1;
|
2011-08-05 18:53:12 -05:00
|
|
|
|
end;
|
|
|
|
|
|
end
|
2011-07-02 00:05:14 -04:00
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
sn2tmp_Score[p]=sn2tmp_Score[p]+maxAdd;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] 踏み踏みしたステップ数
|
2011-10-06 15:38:19 -05:00
|
|
|
|
sn2tmp_Steps[p]=sn2tmp_Steps[p]+1;
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] 現時点での、All W1判定の時のスコア
|
2011-10-06 15:38:19 -05:00
|
|
|
|
pss:SetCurMaxScore(math.floor(10000*sn2tmp_Steps[p]/totalItems) * 10);
|
2011-07-02 00:05:14 -04:00
|
|
|
|
|
2011-08-24 13:59:32 -05:00
|
|
|
|
-- [ja] 計算して代入
|
2011-10-06 15:38:19 -05:00
|
|
|
|
pss:SetScore((math.floor(10000*sn2tmp_Score[p]/totalItems) * 10) - (sn2tmp_Sub[p]*10) );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
2011-10-06 15:38:19 -05:00
|
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
2011-08-18 13:32:08 -05:00
|
|
|
|
--Radar Master (disabled; todo: get this working with StepMania 5)
|
2011-03-17 01:47:30 -04:00
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
|
r['[SSC] Radar Master'] = function(params, pss)
|
|
|
|
|
|
local masterTable = {
|
|
|
|
|
|
['RadarCategory_Stream'] = 0,
|
|
|
|
|
|
['RadarCategory_Voltage'] = 0,
|
|
|
|
|
|
['RadarCategory_Air'] = 0,
|
|
|
|
|
|
['RadarCategory_Freeze'] = 0,
|
|
|
|
|
|
['RadarCategory_Chaos'] = 0
|
|
|
|
|
|
};
|
|
|
|
|
|
local totalRadar = 0;
|
|
|
|
|
|
local finalScore = 0;
|
|
|
|
|
|
for k,v in pairs(masterTable) do
|
|
|
|
|
|
local firstRadar = GetDirectRadar(params.Player):GetValue(k);
|
|
|
|
|
|
if firstRadar == 0 then
|
|
|
|
|
|
masterTable[k] = nil;
|
|
|
|
|
|
else
|
|
|
|
|
|
masterTable[k] = firstRadar;
|
|
|
|
|
|
totalRadar = totalRadar + firstRadar;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
--two loops are needed because we need to calculate totalRadar
|
|
|
|
|
|
--to actually calculate any part of the score
|
|
|
|
|
|
for k,v in pairs(masterTable) do
|
|
|
|
|
|
local curPortion = pss:GetRadarActual():GetValue(k) / v;
|
|
|
|
|
|
finalScore = finalScore + curPortion*(500000000*(v/totalRadar));
|
|
|
|
|
|
end;
|
|
|
|
|
|
pss:SetScore(finalScore);
|
|
|
|
|
|
end;
|
|
|
|
|
|
------------------------------------------------------------
|
|
|
|
|
|
--Marvelous Incorporated Grading System (or MIGS for short)
|
|
|
|
|
|
--basically like DP scoring with locked DP values
|
|
|
|
|
|
------------------------------------------------------------
|
|
|
|
|
|
r['MIGS'] = function(params,pss)
|
|
|
|
|
|
local curScore = 0;
|
2011-04-12 15:29:33 -04:00
|
|
|
|
local tapScoreTable =
|
|
|
|
|
|
{
|
|
|
|
|
|
['TapNoteScore_W1'] = 3,
|
|
|
|
|
|
['TapNoteScore_W2'] = 2,
|
|
|
|
|
|
['TapNoteScore_W3'] = 1,
|
|
|
|
|
|
['TapNoteScore_W5'] = -4,
|
|
|
|
|
|
['TapNoteScore_Miss'] = -8
|
|
|
|
|
|
};
|
2011-03-17 01:47:30 -04:00
|
|
|
|
for k,v in pairs(tapScoreTable) do
|
|
|
|
|
|
curScore = curScore + ( pss:GetTapNoteScores(k) * v );
|
|
|
|
|
|
end;
|
2011-08-28 16:43:50 +00:00
|
|
|
|
curScore = math.max(0,curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 ));
|
2011-10-07 01:05:36 +00:00
|
|
|
|
pss:SetScore(curScore);
|
2011-03-17 01:47:30 -04:00
|
|
|
|
end;
|
2011-04-10 02:55:16 -04:00
|
|
|
|
|
2011-08-28 16:43:50 +00:00
|
|
|
|
--------------------------------------------------------------
|
|
|
|
|
|
--1bilDP scoring because I can.
|
|
|
|
|
|
--------------------------------------------------------------
|
2011-10-06 21:10:55 +00:00
|
|
|
|
r['Billions DP']= function(params,pss)
|
2011-08-28 16:59:22 +00:00
|
|
|
|
local poss = pss:GetPossibleDancePoints()
|
|
|
|
|
|
pss:SetScore(math.floor((pss:GetActualDancePoints()/poss)*1000000000))
|
|
|
|
|
|
pss:SetCurMaxScore(math.floor((pss:GetCurrentPossibleDancePoints()/poss)*1000000000))
|
2011-08-28 16:43:50 +00:00
|
|
|
|
end
|
2011-08-18 13:32:08 -05:00
|
|
|
|
-------------------------------------------------------------------------------
|
2011-04-10 02:55:16 -04:00
|
|
|
|
-- Formulas end here.
|
2011-08-28 16:43:50 +00:00
|
|
|
|
for v in ivalues(DisabledScoringModes) do r[v] = nil end
|
2011-10-07 01:16:21 +00:00
|
|
|
|
Scoring = r;
|
2011-10-07 01:20:49 +00:00
|
|
|
|
|
|
|
|
|
|
function UserPrefScoringMode()
|
|
|
|
|
|
local baseChoices = {}
|
|
|
|
|
|
for k,v in pairs(Scoring) do table.insert(baseChoices,k) end
|
2011-10-07 01:23:26 +00:00
|
|
|
|
if next(baseChoices) == nil then UndocumentedFeature "No scoring modes available" end
|
2011-10-07 01:20:49 +00:00
|
|
|
|
local t = {
|
|
|
|
|
|
Name = "UserPrefScoringMode";
|
|
|
|
|
|
LayoutType = "ShowAllInRow";
|
|
|
|
|
|
SelectType = "SelectOne";
|
|
|
|
|
|
OneChoiceForAllPlayers = true;
|
|
|
|
|
|
ExportOnChange = false;
|
|
|
|
|
|
Choices = baseChoices;
|
|
|
|
|
|
LoadSelections = function(self, list, pn)
|
|
|
|
|
|
if ReadPrefFromFile("UserPrefScoringMode") ~= nil then
|
2011-11-27 05:51:42 +00:00
|
|
|
|
--Load the saved scoring mode from UserPrefs.
|
2011-10-07 01:20:49 +00:00
|
|
|
|
local theValue = ReadPrefFromFile("UserPrefScoringMode");
|
2011-11-27 05:51:42 +00:00
|
|
|
|
local success = false;
|
|
|
|
|
|
--HACK: Preview 4 took out 1st and 4th scoring. Replace with a close equivalent.
|
|
|
|
|
|
if theValue == "DDR 1stMIX" or theValue == "DDR 4thMIX" then theValue = "Oldschool" end
|
|
|
|
|
|
--Search the list of scoring modes for the saved scoring mode.
|
2011-10-07 01:20:49 +00:00
|
|
|
|
for k,v in ipairs(baseChoices) do if v == theValue then list[k] = true success = true break end end;
|
2011-11-27 05:51:42 +00:00
|
|
|
|
--We couldn't find it, pick the first available scoring mode as a sane default.
|
2011-10-07 01:20:49 +00:00
|
|
|
|
if success == false then list[1] = true end;
|
|
|
|
|
|
else
|
2011-10-07 01:23:26 +00:00
|
|
|
|
WritePrefToFile("UserPrefScoringMode", baseChoices[1]);
|
2011-10-07 01:20:49 +00:00
|
|
|
|
list[1] = true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SaveSelections = function(self, list, pn)
|
|
|
|
|
|
for k,v in ipairs(list) do if v then WritePrefToFile("UserPrefScoringMode", baseChoices[k]) break end end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
};
|
|
|
|
|
|
setmetatable( t, t );
|
|
|
|
|
|
return t;
|
|
|
|
|
|
end
|