hgeol I bet.

This commit is contained in:
Jason Felds
2012-05-10 02:02:37 -04:00
parent a8eca9c49c
commit b71caa445c
9 changed files with 889 additions and 889 deletions
+355 -355
View File
@@ -1,355 +1,355 @@
--[[DO NOT MODIFY THIS FILE.
You can add new scoring modes just by creating a different file and adding them to the
Scoring table. Replacing this file will cause additions to be lost during updates.
It's unnecessary and problematic.]]
--internals table
local Shared = {};
--Special Scoring types.
local r = {};
local DisabledScoringModes = { '[SSC] Radar Master' };
--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)
local total = radars:GetValue('RadarCategory_TapsAndHolds')
total = total + radars:GetValue('RadarCategory_Holds')
total = total + radars:GetValue('RadarCategory_Rolls')
-- [ja] Liftを加えると一部二重加算になるため除外する。
-- total = total + radars:GetValue('RadarCategory_Lifts')
-- [en] prevent divide by 0
-- [ja] 0除算対策(しなくても動作するけど満点になっちゃうんで)
return math.max(1,total);
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;
-----------------------------------------------------------
--Oldschool scoring, best described as a modified 4th mix scheme
--with a little 1st mix influence
-----------------------------------------------------------
r['Oldschool'] = function(params, pss)
local bestPoints = 999
local scoreLookupTable =
{
['TapNoteScore_W1']=999,
['TapNoteScore_W2']=IsW1Allowed('TapNoteScore_W2') and 888 or 999,
['TapNoteScore_W3']=777,
['TapNoteScore_W4']=555,
['TapNoteScore_W5']=111,
};
setmetatable(scoreLookupTable, ZeroIfNotFound);
local comboBonusForThisStep = (pss:GetCurrentCombo()*111)^1.1;
local capScore = 1000000000;
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);
pss:SetScore(clamp(pss:GetScore()+pointsGot,0,capScore));
end;
-----------------------------------------------------------
--DDR MAX2/Extreme(-esque) Scoring by @sakuraponila
-----------------------------------------------------------
local ext_Steps = {0,0};
r['DDR Extreme'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 9,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local steps = GAMESTATE:GetCurrentSteps(params.Player);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
-- 1 + 2 + 3 + ... + totalItems value/の値
local sTotal = (totalItems + 1) * totalItems / 2;
local meter = steps:GetMeter();
if (steps:IsAnEdit()) then
meter = 5;
else
meter = math.min(10,meter);
end;
-- [en] score for one step
-- [ja] 1ステップあたりのスコア
local baseScore = meter * 1000000
if (GAMESTATE:GetCurrentSong():IsMarathon()) then
baseScore = baseScore * 3;
elseif (GAMESTATE:GetCurrentSong():IsLong()) then
baseScore = baseScore * 2;
end;
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);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [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] 判定によって加算量を変更
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
-- [ja] O.K.判定時は問答無用で満点
vScore = vScore;
else
-- [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
end;
end;
-- [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);
end;
end;
-----------------------------------------------------------
--HYBRID Scoring, contributed by @waiei
-----------------------------------------------------------
local hyb_Steps={0,0};
r['Hybrid'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 9,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
-- 1+2+3+...+totalItems value/の値
local sTotal = (totalItems+1)*totalItems/2;
-- [en] Score for one song
-- [ja] 1ステップあたりのスコア
local sOne = math.floor(100000000/sTotal);
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
local sLast = 100000000-(sOne*sTotal);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [ja] スコアが0の時に初期化
if pss:GetScore()==0 then
hyb_Steps[p]=0;
end;
-- [ja] 現在のステップ数
hyb_Steps[p]=hyb_Steps[p]+1;
-- [en] current score
-- [ja] 今回加算するスコア(W1の時)
local vScore = sOne*hyb_Steps[p];
pss:SetCurMaxScore(pss:GetCurMaxScore()+vScore);
-- [ja] 判定によって加算量を変更
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);
-- [ja] 最後の1ステップの場合、端数を加算する
if ((vScore > 0) and (hyb_Steps[p] == totalItems)) then
pss:SetScore(pss:GetScore()+sLast);
end;
end;
-----------------------------------------------------------
--DDR SuperNOVA scoring (Use MARVELOUS) by @sakuraponila
-----------------------------------------------------------
local sntmp_Score = {0,0};
local sntmp_Steps = {0,0};
r['DDR SuperNOVA'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 3,
['TapNoteScore_W2'] = 2,
['TapNoteScore_W3'] = 1
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues)
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- initialized when score is 0
-- [ja] スコアが0の時に初期化
if pss:GetScore() == 0 then
sntmp_Score[p] = 0;
sntmp_Steps[p] = 0;
end;
-- [ja] 判定によって加算量を変更
local maxAdd = 0;
-- [ja] O.K.判定時は問答無用で満点
if params.HoldNoteScore == 'HoldNoteScore_Held' then
maxAdd = 3;
else
-- [ja] N.G.判定時は問答無用で0点
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
maxAdd = 0;
-- [ja] それ以外ということは、ロングノート以外の判定である
else
maxAdd = multLookup[params.TapNoteScore];
end
end;
sntmp_Score[p] = sntmp_Score[p] + maxAdd;
-- [ja] 踏み踏みしたステップ数
sntmp_Steps[p] = sntmp_Steps[p] + 1;
-- [ja] 現時点での、All W1判定の時のスコア
pss:SetCurMaxScore(math.floor(10000000 * sntmp_Steps[p] / totalItems / 3));
-- [ja] 計算して代入
pss:SetScore(math.floor(10000000 * sntmp_Score[p] / totalItems / 3));
end;
-----------------------------------------------------------
--DDR SuperNOVA 2 scoring by @waiei
-----------------------------------------------------------
local sn2tmp_Sub={0,0};
local sn2tmp_Score={0,0};
local sn2tmp_Steps={0,0};
r['DDR SuperNOVA 2'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 10,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [ja] スコアが0の時に初期化
if pss:GetScore()==0 then
sn2tmp_Sub[p]=0;
sn2tmp_Score[p]=0;
sn2tmp_Steps[p]=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] W2とW3の数を記録
sn2tmp_Sub[p]=sn2tmp_Sub[p]+1;
end;
end
end;
sn2tmp_Score[p]=sn2tmp_Score[p]+maxAdd;
-- [ja] 踏み踏みしたステップ数
sn2tmp_Steps[p]=sn2tmp_Steps[p]+1;
-- [ja] 現時点での、All W1判定の時のスコア
pss:SetCurMaxScore(math.floor(10000*sn2tmp_Steps[p]/totalItems) * 10);
-- [ja] 計算して代入
pss:SetScore((math.floor(10000*sn2tmp_Score[p]/totalItems) * 10) - (sn2tmp_Sub[p]*10) );
end;
-----------------------------------------------------------
--Radar Master (disabled; todo: get this working with StepMania 5)
-----------------------------------------------------------
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;
local tapScoreTable =
{
['TapNoteScore_W1'] = 3,
['TapNoteScore_W2'] = 2,
['TapNoteScore_W3'] = 1,
['TapNoteScore_W5'] = -4,
['TapNoteScore_Miss'] = -8
};
for k,v in pairs(tapScoreTable) do
curScore = curScore + ( pss:GetTapNoteScores(k) * v );
end;
curScore = math.max(0,curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 ));
pss:SetScore(curScore);
end;
--------------------------------------------------------------
--1bilDP scoring because I can.
--------------------------------------------------------------
r['Billions DP']= function(params,pss)
local poss = pss:GetPossibleDancePoints()
pss:SetScore(math.floor((pss:GetActualDancePoints()/poss)*1000000000))
pss:SetCurMaxScore(math.floor((pss:GetCurrentPossibleDancePoints()/poss)*1000000000))
end
-------------------------------------------------------------------------------
-- Formulas end here.
for v in ivalues(DisabledScoringModes) do r[v] = nil end
Scoring = r;
--[[DO NOT MODIFY THIS FILE.
You can add new scoring modes just by creating a different file and adding them to the
Scoring table. Replacing this file will cause additions to be lost during updates.
It's unnecessary and problematic.]]
--internals table
local Shared = {};
--Special Scoring types.
local r = {};
local DisabledScoringModes = { '[SSC] Radar Master' };
--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)
local total = radars:GetValue('RadarCategory_TapsAndHolds')
total = total + radars:GetValue('RadarCategory_Holds')
total = total + radars:GetValue('RadarCategory_Rolls')
-- [ja] Liftを加えると一部二重加算になるため除外する。
-- total = total + radars:GetValue('RadarCategory_Lifts')
-- [en] prevent divide by 0
-- [ja] 0除算対策(しなくても動作するけど満点になっちゃうんで)
return math.max(1,total);
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;
-----------------------------------------------------------
--Oldschool scoring, best described as a modified 4th mix scheme
--with a little 1st mix influence
-----------------------------------------------------------
r['Oldschool'] = function(params, pss)
local bestPoints = 999
local scoreLookupTable =
{
['TapNoteScore_W1']=999,
['TapNoteScore_W2']=IsW1Allowed('TapNoteScore_W2') and 888 or 999,
['TapNoteScore_W3']=777,
['TapNoteScore_W4']=555,
['TapNoteScore_W5']=111,
};
setmetatable(scoreLookupTable, ZeroIfNotFound);
local comboBonusForThisStep = (pss:GetCurrentCombo()*111)^1.1;
local capScore = 1000000000;
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);
pss:SetScore(clamp(pss:GetScore()+pointsGot,0,capScore));
end;
-----------------------------------------------------------
--DDR MAX2/Extreme(-esque) Scoring by @sakuraponila
-----------------------------------------------------------
local ext_Steps = {0,0};
r['DDR Extreme'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 9,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local steps = GAMESTATE:GetCurrentSteps(params.Player);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
-- 1 + 2 + 3 + ... + totalItems value/の値
local sTotal = (totalItems + 1) * totalItems / 2;
local meter = steps:GetMeter();
if (steps:IsAnEdit()) then
meter = 5;
else
meter = math.min(10,meter);
end;
-- [en] score for one step
-- [ja] 1ステップあたりのスコア
local baseScore = meter * 1000000
if (GAMESTATE:GetCurrentSong():IsMarathon()) then
baseScore = baseScore * 3;
elseif (GAMESTATE:GetCurrentSong():IsLong()) then
baseScore = baseScore * 2;
end;
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);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [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] 判定によって加算量を変更
if (params.HoldNoteScore == 'HoldNoteScore_Held') then
-- [ja] O.K.判定時は問答無用で満点
vScore = vScore;
else
-- [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
end;
end;
-- [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);
end;
end;
-----------------------------------------------------------
--HYBRID Scoring, contributed by @waiei
-----------------------------------------------------------
local hyb_Steps={0,0};
r['Hybrid'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 9,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
-- 1+2+3+...+totalItems value/の値
local sTotal = (totalItems+1)*totalItems/2;
-- [en] Score for one song
-- [ja] 1ステップあたりのスコア
local sOne = math.floor(100000000/sTotal);
-- [ja] 端数は最後の1ステップで加算するのでその値を取得
local sLast = 100000000-(sOne*sTotal);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [ja] スコアが0の時に初期化
if pss:GetScore()==0 then
hyb_Steps[p]=0;
end;
-- [ja] 現在のステップ数
hyb_Steps[p]=hyb_Steps[p]+1;
-- [en] current score
-- [ja] 今回加算するスコア(W1の時)
local vScore = sOne*hyb_Steps[p];
pss:SetCurMaxScore(pss:GetCurMaxScore()+vScore);
-- [ja] 判定によって加算量を変更
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);
-- [ja] 最後の1ステップの場合、端数を加算する
if ((vScore > 0) and (hyb_Steps[p] == totalItems)) then
pss:SetScore(pss:GetScore()+sLast);
end;
end;
-----------------------------------------------------------
--DDR SuperNOVA scoring (Use MARVELOUS) by @sakuraponila
-----------------------------------------------------------
local sntmp_Score = {0,0};
local sntmp_Steps = {0,0};
r['DDR SuperNOVA'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 3,
['TapNoteScore_W2'] = 2,
['TapNoteScore_W3'] = 1
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues)
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- initialized when score is 0
-- [ja] スコアが0の時に初期化
if pss:GetScore() == 0 then
sntmp_Score[p] = 0;
sntmp_Steps[p] = 0;
end;
-- [ja] 判定によって加算量を変更
local maxAdd = 0;
-- [ja] O.K.判定時は問答無用で満点
if params.HoldNoteScore == 'HoldNoteScore_Held' then
maxAdd = 3;
else
-- [ja] N.G.判定時は問答無用で0点
if params.HoldNoteScore == 'HoldNoteScore_LetGo' then
maxAdd = 0;
-- [ja] それ以外ということは、ロングノート以外の判定である
else
maxAdd = multLookup[params.TapNoteScore];
end
end;
sntmp_Score[p] = sntmp_Score[p] + maxAdd;
-- [ja] 踏み踏みしたステップ数
sntmp_Steps[p] = sntmp_Steps[p] + 1;
-- [ja] 現時点での、All W1判定の時のスコア
pss:SetCurMaxScore(math.floor(10000000 * sntmp_Steps[p] / totalItems / 3));
-- [ja] 計算して代入
pss:SetScore(math.floor(10000000 * sntmp_Score[p] / totalItems / 3));
end;
-----------------------------------------------------------
--DDR SuperNOVA 2 scoring by @waiei
-----------------------------------------------------------
local sn2tmp_Sub={0,0};
local sn2tmp_Score={0,0};
local sn2tmp_Steps={0,0};
r['DDR SuperNOVA 2'] = function(params, pss)
local multLookup =
{
['TapNoteScore_W1'] = 10,
['TapNoteScore_W2'] = 10,
['TapNoteScore_W3'] = 5
};
setmetatable(multLookup, ZeroIfNotFound);
local radarValues = GetDirectRadar(params.Player);
local totalItems = GetTotalItems(radarValues);
local p = (params.Player == 'PlayerNumber_P1') and 1 or 2;
-- [ja] スコアが0の時に初期化
if pss:GetScore()==0 then
sn2tmp_Sub[p]=0;
sn2tmp_Score[p]=0;
sn2tmp_Steps[p]=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] W2とW3の数を記録
sn2tmp_Sub[p]=sn2tmp_Sub[p]+1;
end;
end
end;
sn2tmp_Score[p]=sn2tmp_Score[p]+maxAdd;
-- [ja] 踏み踏みしたステップ数
sn2tmp_Steps[p]=sn2tmp_Steps[p]+1;
-- [ja] 現時点での、All W1判定の時のスコア
pss:SetCurMaxScore(math.floor(10000*sn2tmp_Steps[p]/totalItems) * 10);
-- [ja] 計算して代入
pss:SetScore((math.floor(10000*sn2tmp_Score[p]/totalItems) * 10) - (sn2tmp_Sub[p]*10) );
end;
-----------------------------------------------------------
--Radar Master (disabled; todo: get this working with StepMania 5)
-----------------------------------------------------------
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;
local tapScoreTable =
{
['TapNoteScore_W1'] = 3,
['TapNoteScore_W2'] = 2,
['TapNoteScore_W3'] = 1,
['TapNoteScore_W5'] = -4,
['TapNoteScore_Miss'] = -8
};
for k,v in pairs(tapScoreTable) do
curScore = curScore + ( pss:GetTapNoteScores(k) * v );
end;
curScore = math.max(0,curScore + ( pss:GetHoldNoteScores('HoldNoteScore_Held') * 6 ));
pss:SetScore(curScore);
end;
--------------------------------------------------------------
--1bilDP scoring because I can.
--------------------------------------------------------------
r['Billions DP']= function(params,pss)
local poss = pss:GetPossibleDancePoints()
pss:SetScore(math.floor((pss:GetActualDancePoints()/poss)*1000000000))
pss:SetCurMaxScore(math.floor((pss:GetCurrentPossibleDancePoints()/poss)*1000000000))
end
-------------------------------------------------------------------------------
-- Formulas end here.
for v in ivalues(DisabledScoringModes) do r[v] = nil end
Scoring = r;
+117 -117
View File
@@ -1,118 +1,118 @@
--ScoringEngine2 by FSX v1.41
--essentially a really chunky layer to make SetScore elegant(ish)
--arguments for scorekeepers: JudgmentMessageCommand,PlayerStageStats,PlayerNumber,State
--[[changelog
v1.41 6 May 2012
*Not really sure.
*Included in SM5 for alpha 3.
v1.4 18 Apr 2012
*Support for judgment filtering.
*Minor changes.
*First public release (in SE2 Dev Kit) (didn't happen)
v1.3 17 Apr 2012
*First complete release.
*Error reporting in FinalizeScoreKeepers()
*Bug fixes.]]
--scoring modes written for the old ad-hoc system don't work, but don't cause crashes either.
--SM5 has some glue code for them, though
local stageKey = nil
local ReadiedScoreKeepers = {}
local JudgmentFilters = {}
local function CoroutineIsGood(cr)
return coroutine.status(cr)=="suspended"
end
function InitScoreKeepers(p1Mode, p2Mode)
local newStgK = {pcall(GameState.GetStageSeed,GAMESTATE)}
assert(newStgK[1], "it's too early to initialize the ScoreKeepers, the GameState isn't ready yet")
if newStgK[2] == stageKey then
Log "[InitScoreKeepers] unnecessary call"
return true
end
ReadiedScoreKeepers={}
JudgmentFilters={}
stageKey = newStgK
local intab = {}
if p1Mode ~= nil then
intab.P1 = p1Mode
end
if p2Mode ~= nil then
intab.P2 = p2Mode
end
assert(next(intab), "InitScoreKeepers didn't get any args")
for k,v in pairs(intab) do
if not ScoringModes[v] then
--SPOILER: UndocumentedFeature crashes the game intentionally.
UndocumentedFeature(k.."'s scoring mode \""..v.."\" doesn't exist.")
end
ReadiedScoreKeepers[k] = coroutine.create(ScoringModes[v])
--call each scoring mode one time in init mode
checks={coroutine.resume(ReadiedScoreKeepers[k],nil,STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k), "PlayerNumber_"..k, "init")}
if not CoroutineIsGood(ReadiedScoreKeepers[k]) then SCREENMAN:SystemMessage("scoring init error: "..checks[2]) return false end
--very very very very safe filtering rule load code
if type(checks[2])=="table" then
if type(checks[2][1])..type(checks[2][2]) == "tabletable" then
local isGood=false
local tapscan = Enum.Reverse(TapNoteScore)
local holdscan = Enum.Reverse(HoldNoteScore)
local finaltable = {{},{}}
for i=1,2 do
for k,v in pairs(checks[2][i]) do
finaltable[i][v]=true
if (not (i==2 and holdscan[v] or tapscan[v])) or v==nil then isGood=false break end
isGood=true
end
if not isGood then break end
end
if isGood then
JudgmentFilters[k]=finaltable
end
end
end
end
return true
end
function UpdateScoreKeepers(JMC)
assert(JMC,"pass args, please")
runplayer = ToEnumShortString(JMC.Player)
if ReadiedScoreKeepers[runplayer] then
if JudgmentFilters[runplayer] and (JudgmentFilters[runplayer][1][JMC.TapNoteScore] or JudgmentFilters[runplayer][2][JMC.HoldNoteScore]) then
return true
end
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(JMC.Player)
local newscores = {coroutine.resume(ReadiedScoreKeepers[runplayer],JMC,pss,JMC.Player,"update")}
if CoroutineIsGood(ReadiedScoreKeepers[runplayer]) then
pss:SetScore(newscores[2])
pss:SetCurMaxScore(newscores[3])
return true
else
SCREENMAN:SystemMessage("scoring update error: "..newscores[2])
ReadiedScoreKeepers[runplayer]=nil
return false
end
end
end
function FinalizeScoreKeepers()
for k,v in pairs(ReadiedScoreKeepers) do
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k)
local newscores = {coroutine.resume(v,nil,pss,"PlayerNumber_"..k,"finalize")}
local status = coroutine.status(v)
--kill the scorekeeper now, we don't need it again
ReadiedScoreKeepers[k] = nil
if status=="dead" then
if newscores[1]==true then
pss:SetScore(newscores[2])
pss:SetCurMaxScore(newscores[3])
else
SCREENMAN:SystemMessage("scoring finalize error: "..newscores[2])
return false
end
else
return false
end
end
return true
--ScoringEngine2 by FSX v1.41
--essentially a really chunky layer to make SetScore elegant(ish)
--arguments for scorekeepers: JudgmentMessageCommand,PlayerStageStats,PlayerNumber,State
--[[changelog
v1.41 6 May 2012
*Not really sure.
*Included in SM5 for alpha 3.
v1.4 18 Apr 2012
*Support for judgment filtering.
*Minor changes.
*First public release (in SE2 Dev Kit) (didn't happen)
v1.3 17 Apr 2012
*First complete release.
*Error reporting in FinalizeScoreKeepers()
*Bug fixes.]]
--scoring modes written for the old ad-hoc system don't work, but don't cause crashes either.
--SM5 has some glue code for them, though
local stageKey = nil
local ReadiedScoreKeepers = {}
local JudgmentFilters = {}
local function CoroutineIsGood(cr)
return coroutine.status(cr)=="suspended"
end
function InitScoreKeepers(p1Mode, p2Mode)
local newStgK = {pcall(GameState.GetStageSeed,GAMESTATE)}
assert(newStgK[1], "it's too early to initialize the ScoreKeepers, the GameState isn't ready yet")
if newStgK[2] == stageKey then
Log "[InitScoreKeepers] unnecessary call"
return true
end
ReadiedScoreKeepers={}
JudgmentFilters={}
stageKey = newStgK
local intab = {}
if p1Mode ~= nil then
intab.P1 = p1Mode
end
if p2Mode ~= nil then
intab.P2 = p2Mode
end
assert(next(intab), "InitScoreKeepers didn't get any args")
for k,v in pairs(intab) do
if not ScoringModes[v] then
--SPOILER: UndocumentedFeature crashes the game intentionally.
UndocumentedFeature(k.."'s scoring mode \""..v.."\" doesn't exist.")
end
ReadiedScoreKeepers[k] = coroutine.create(ScoringModes[v])
--call each scoring mode one time in init mode
checks={coroutine.resume(ReadiedScoreKeepers[k],nil,STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k), "PlayerNumber_"..k, "init")}
if not CoroutineIsGood(ReadiedScoreKeepers[k]) then SCREENMAN:SystemMessage("scoring init error: "..checks[2]) return false end
--very very very very safe filtering rule load code
if type(checks[2])=="table" then
if type(checks[2][1])..type(checks[2][2]) == "tabletable" then
local isGood=false
local tapscan = Enum.Reverse(TapNoteScore)
local holdscan = Enum.Reverse(HoldNoteScore)
local finaltable = {{},{}}
for i=1,2 do
for k,v in pairs(checks[2][i]) do
finaltable[i][v]=true
if (not (i==2 and holdscan[v] or tapscan[v])) or v==nil then isGood=false break end
isGood=true
end
if not isGood then break end
end
if isGood then
JudgmentFilters[k]=finaltable
end
end
end
end
return true
end
function UpdateScoreKeepers(JMC)
assert(JMC,"pass args, please")
runplayer = ToEnumShortString(JMC.Player)
if ReadiedScoreKeepers[runplayer] then
if JudgmentFilters[runplayer] and (JudgmentFilters[runplayer][1][JMC.TapNoteScore] or JudgmentFilters[runplayer][2][JMC.HoldNoteScore]) then
return true
end
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(JMC.Player)
local newscores = {coroutine.resume(ReadiedScoreKeepers[runplayer],JMC,pss,JMC.Player,"update")}
if CoroutineIsGood(ReadiedScoreKeepers[runplayer]) then
pss:SetScore(newscores[2])
pss:SetCurMaxScore(newscores[3])
return true
else
SCREENMAN:SystemMessage("scoring update error: "..newscores[2])
ReadiedScoreKeepers[runplayer]=nil
return false
end
end
end
function FinalizeScoreKeepers()
for k,v in pairs(ReadiedScoreKeepers) do
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k)
local newscores = {coroutine.resume(v,nil,pss,"PlayerNumber_"..k,"finalize")}
local status = coroutine.status(v)
--kill the scorekeeper now, we don't need it again
ReadiedScoreKeepers[k] = nil
if status=="dead" then
if newscores[1]==true then
pss:SetScore(newscores[2])
pss:SetCurMaxScore(newscores[3])
else
SCREENMAN:SystemMessage("scoring finalize error: "..newscores[2])
return false
end
else
return false
end
end
return true
end
@@ -1,31 +1,31 @@
local t = Def.ActorFrame {};
-- Header
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_LEFT;y,SCREEN_TOP;draworder,100);
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,64;
diffuse,ThemeColor.Secondary);
};
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,48;
diffuse,ThemeColor.Background);
};
};
-- Footer
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_LEFT;y,SCREEN_BOTTOM;draworder,100);
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
zoomto,SCREEN_WIDTH,64;
diffuse,ThemeColor.Secondary);
};
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
zoomto,SCREEN_WIDTH,32;
diffuse,ThemeColor.Background);
};
};
local t = Def.ActorFrame {};
-- Header
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_LEFT;y,SCREEN_TOP;draworder,100);
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,64;
diffuse,ThemeColor.Secondary);
};
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,48;
diffuse,ThemeColor.Background);
};
};
-- Footer
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_LEFT;y,SCREEN_BOTTOM;draworder,100);
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
zoomto,SCREEN_WIDTH,64;
diffuse,ThemeColor.Secondary);
};
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
zoomto,SCREEN_WIDTH,32;
diffuse,ThemeColor.Background);
};
};
return t;
@@ -1,43 +1,43 @@
local t = LoadFallbackB();
--
t[#t+1] = StandardDecorationFromFileOptional("BannerFrame","BannerFrame");
t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay");
t[#t+1] = StandardDecorationFromFileOptional("TimeDisplay","TimeDisplay");
t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay");
t[#t+1] = StandardDecorationFromFileOptional("SortDisplay","SortDisplay");
t[#t+1] = StandardDecorationFromFileOptional("DifficultyList","DifficultyList");
-- StepsDisplay creator
local function CreateStepsDisplay( _pn )
local function set(self, _pn)
self:SetFromGameState( _pn);
end
local t = Def.StepsDisplay {
InitCommand=cmd(Load,"StepsDisplay",GAMESTATE:GetPlayerState(_pn););
};
if _pn == PLAYER_1 then
t.CurrentStepsP1ChangedMessageCommand=function(self) set(self, _pn); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) set(self, _pn); end;
else
t.CurrentStepsP2ChangedMessageCommand=function(self) set(self, _pn); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) set(self, _pn); end;
end
return t;
end
-- Create StepsDisplay for each player
for pn in ivalues(PlayerNumber) do
local MetricsName = "StepsDisplay" .. PlayerNumberToString(pn);
t[#t+1] = CreateStepsDisplay(pn) .. {
InitCommand=function(self) self:player(pn); self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end;
};
end
-- Create PaneDisplay for each player
t[#t+1] = StandardDecorationFromFileOptional("PaneDisplay","PaneDisplay");
--[[ for pn in ivalues(PlayerNumber) do
local MetricsName = "PaneDisplay" .. PlayerNumberToString(pn);
t[#t+1] = StandardDecorationFromFileOptional(MetricsName,"PaneDisplay",PlayerNumber);
end ]]
local t = LoadFallbackB();
--
t[#t+1] = StandardDecorationFromFileOptional("BannerFrame","BannerFrame");
t[#t+1] = StandardDecorationFromFileOptional("BPMDisplay","BPMDisplay");
t[#t+1] = StandardDecorationFromFileOptional("TimeDisplay","TimeDisplay");
t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay");
t[#t+1] = StandardDecorationFromFileOptional("SortDisplay","SortDisplay");
t[#t+1] = StandardDecorationFromFileOptional("DifficultyList","DifficultyList");
-- StepsDisplay creator
local function CreateStepsDisplay( _pn )
local function set(self, _pn)
self:SetFromGameState( _pn);
end
local t = Def.StepsDisplay {
InitCommand=cmd(Load,"StepsDisplay",GAMESTATE:GetPlayerState(_pn););
};
if _pn == PLAYER_1 then
t.CurrentStepsP1ChangedMessageCommand=function(self) set(self, _pn); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) set(self, _pn); end;
else
t.CurrentStepsP2ChangedMessageCommand=function(self) set(self, _pn); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) set(self, _pn); end;
end
return t;
end
-- Create StepsDisplay for each player
for pn in ivalues(PlayerNumber) do
local MetricsName = "StepsDisplay" .. PlayerNumberToString(pn);
t[#t+1] = CreateStepsDisplay(pn) .. {
InitCommand=function(self) self:player(pn); self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end;
};
end
-- Create PaneDisplay for each player
t[#t+1] = StandardDecorationFromFileOptional("PaneDisplay","PaneDisplay");
--[[ for pn in ivalues(PlayerNumber) do
local MetricsName = "PaneDisplay" .. PlayerNumberToString(pn);
t[#t+1] = StandardDecorationFromFileOptional(MetricsName,"PaneDisplay",PlayerNumber);
end ]]
return t;
@@ -1,74 +1,74 @@
local switchTime = 2;
local bThen, bNow, bMultipleBPMs;
local iCurrent = 0;
local Song, BPMs;
local updateTimer = function(self, fDeltaTime)
local c = self:GetChildren();
-- use aux as a timer internally.
self:aux( self:getaux() + fDeltaTime );
-- debug
-- c.BPMText:settextf("d:%0.16f (a:%0.2f)",fDeltaTime,self:getaux());
bNow = (math.floor( self:getaux() % switchTime ) == 0) and true or false;
local bChanged = (bThen == bNow);
-- Toggle current index
if bChanged then
iCurrent = 1 - iCurrent;
if ( BPMs[1] == BPMs[2] ) then
bMultipleBPMs = false;
c.BPMText:targetnumber(clamp(BPMs[1],0,9999));
else
bMultipleBPMs = true;
c.BPMText:targetnumber(clamp(BPMs[1+iCurrent],0,9999));
end;
end;
--
--
bThen = (math.floor( self:getaux() % 2 ) ~= 0) and true or false;
end;
return Def.ActorFrame {
BeginCommand=function(self)
self:SetUpdateFunction( updateTimer );
end;
CurrentSongChangedMessageCommand=function(self)
self:aux(0);
self:playcommand( GAMESTATE:GetCurrentSong():GetTimingData():HasBPMChanges() and "MultipleBPM" or "SingleBPM" );
end;
-- BPM Background
Def.Quad {
Name="BPMBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- BPM Multiple Warning
Def.Quad {
Name="BPMFlag";
InitCommand=cmd(x,32;y,-8;basezoomx,24;basezoomy,4;fadeleft,0.2;faderight,0.2;diffuse,ThemeColor.Primary;thump,1;effectclock,'beatnooffset');
SingleBPMCommand=cmd(finishtweening;decelerate,0.1;zoom,0;zoomx,8;diffusealpha,0);
MultipleBPMCommand=cmd(finishtweening;smooth,0.05;zoom,1;diffusealpha,1;);
};
-- BPM Label
LoadFont("Common Normal") .. {
Name="BPMLabel";
Text="BPM";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- BPM Display
Def.RollingNumbers {
Name="BPMText";
File=THEME:GetPathF("Common","Normal");
InitCommand=cmd(Load,"RollingNumbersBPMDisplay");
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
Song = GAMESTATE:GetCurrentSong();
BPMs = Song:GetDisplayBpms() or {0,0};
-- reset numbers
self:targetnumber( clamp(BPMs[1],0,9999) );
-- (force once)
if (self:getaux() == 0) then
self:settext(clamp(BPMs[1],0,9999));
self:aux( 1 );
end;
end;
};
local switchTime = 2;
local bThen, bNow, bMultipleBPMs;
local iCurrent = 0;
local Song, BPMs;
local updateTimer = function(self, fDeltaTime)
local c = self:GetChildren();
-- use aux as a timer internally.
self:aux( self:getaux() + fDeltaTime );
-- debug
-- c.BPMText:settextf("d:%0.16f (a:%0.2f)",fDeltaTime,self:getaux());
bNow = (math.floor( self:getaux() % switchTime ) == 0) and true or false;
local bChanged = (bThen == bNow);
-- Toggle current index
if bChanged then
iCurrent = 1 - iCurrent;
if ( BPMs[1] == BPMs[2] ) then
bMultipleBPMs = false;
c.BPMText:targetnumber(clamp(BPMs[1],0,9999));
else
bMultipleBPMs = true;
c.BPMText:targetnumber(clamp(BPMs[1+iCurrent],0,9999));
end;
end;
--
--
bThen = (math.floor( self:getaux() % 2 ) ~= 0) and true or false;
end;
return Def.ActorFrame {
BeginCommand=function(self)
self:SetUpdateFunction( updateTimer );
end;
CurrentSongChangedMessageCommand=function(self)
self:aux(0);
self:playcommand( GAMESTATE:GetCurrentSong():GetTimingData():HasBPMChanges() and "MultipleBPM" or "SingleBPM" );
end;
-- BPM Background
Def.Quad {
Name="BPMBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- BPM Multiple Warning
Def.Quad {
Name="BPMFlag";
InitCommand=cmd(x,32;y,-8;basezoomx,24;basezoomy,4;fadeleft,0.2;faderight,0.2;diffuse,ThemeColor.Primary;thump,1;effectclock,'beatnooffset');
SingleBPMCommand=cmd(finishtweening;decelerate,0.1;zoom,0;zoomx,8;diffusealpha,0);
MultipleBPMCommand=cmd(finishtweening;smooth,0.05;zoom,1;diffusealpha,1;);
};
-- BPM Label
LoadFont("Common Normal") .. {
Name="BPMLabel";
Text="BPM";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- BPM Display
Def.RollingNumbers {
Name="BPMText";
File=THEME:GetPathF("Common","Normal");
InitCommand=cmd(Load,"RollingNumbersBPMDisplay");
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
Song = GAMESTATE:GetCurrentSong();
BPMs = Song:GetDisplayBpms() or {0,0};
-- reset numbers
self:targetnumber( clamp(BPMs[1],0,9999) );
-- (force once)
if (self:getaux() == 0) then
self:settext(clamp(BPMs[1],0,9999));
self:aux( 1 );
end;
end;
};
};
@@ -1,125 +1,125 @@
local t = Def.ActorFrame {};
-- Background
t[#t+1] = Def.ActorFrame { Name="Background";
Def.Quad {
InitCommand=cmd(zoomto,320+8,96;diffuse,ThemeColor.Secondary);
};
};
-- Radar Text
local function RadarLabel( rc )
local t = Def.ActorFrame {};
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.upper(THEME:GetString("RadarCategoryShort",ToEnumShortString(rc)));
InitCommand=cmd(shadowlength,1;zoom,0.675;horizalign,right);
};
--
return t;
end;
--
local function RadarItem( pn, rc )
local t = Def.ActorFrame {};
--
local function GetRadarValue( _rc, _pn )
if GAMESTATE:GetCurrentSteps( _pn ) then
local Steps = GAMESTATE:GetCurrentSteps( _pn );
local RadarValues = Steps:GetRadarValues( _pn );
local ThisValue = RadarValues:GetValue( _rc );
--
return tonumber(ThisValue);
else
return 0;
end;
end;
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.format("%04i",GetRadarValue(rc,pn));
InitCommand=cmd(shadowlength,1;x,128;zoom,0.675;diffuse,PlayerColor(pn);playcommand,"Set");
SetCommand=function(self,params)
if params.Player == pn then
self:settextf("%04i",GetRadarValue(rc,pn));
end;
end;
};
--
t.CurrentSongChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentCourseChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
t.CurrentStepsP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentStepsP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
--
return t;
end;
--
local function RadarPercent( pn, rc )
local t = Def.ActorFrame {};
--
local function GetRadarValue( _rc, _pn )
if GAMESTATE:GetCurrentSteps( _pn ) then
local Steps = GAMESTATE:GetCurrentSteps( _pn );
local RadarValues = Steps:GetRadarValues( _pn );
local ThisValue = RadarValues:GetValue( _rc );
--
return tonumber(ThisValue);
else
return 0;
end;
end;
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.format("%03i%%",math.floor(GetRadarValue(rc,pn)*100));
InitCommand=cmd(shadowlength,1;x,128;zoom,0.675;diffuse,PlayerColor(pn);playcommand,"Set");
SetCommand=function(self,params)
if params.Player == pn then
self:settextf("%03i%%",math.floor(GetRadarValue(rc,pn)*100));
end;
end;
};
--
t.CurrentSongChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentCourseChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
t.CurrentStepsP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentStepsP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
--
return t;
end;
--
for index,rc in ipairs(RadarCategory) do
if index > 5 then
local VisualIndex = index-6
local VertOffset = ( VisualIndex % 4 ) * 16;
local HorizOffset = math.floor( (VisualIndex)/4 ) * 156;
t[#t+1] = Def.ActorFrame {
Name="RadarCategoryRow" .. tonumber(index-5);
InitCommand=cmd(x,-96+HorizOffset;y,-10+VertOffset);
--
RadarLabel(rc);
RadarItem(PLAYER_1, rc) .. { InitCommand=cmd(x,-96-8); };
RadarItem(PLAYER_2, rc) .. { InitCommand=cmd(x,-64+4); };
};
end
end;
--
for index,rc in ipairs(RadarCategory) do
if index < 6 then
local HorizOffset = (index-1) * 64;
t[#t+1] = Def.ActorFrame {
Name="RadarCategoryRow" .. tonumber(index-5);
InitCommand=cmd(x,-148+HorizOffset;y,-33);
--
RadarLabel(rc);
RadarPercent(PLAYER_1, rc) .. { InitCommand=cmd(x,-104;y,-7); };
RadarPercent(PLAYER_2, rc) .. { InitCommand=cmd(x,-104;y,7); };
};
end
end;
--
--[[ for index,rc in ipairs(RadarCategory) do
if index > 5 then
t[#t+1] = LoadFont("Common Normal") .. { Text=ToEnumShortString(rc); InitCommand=cmd(zoom,0.5;shadowlength,1;y,(index-5)*10); };
end
end; ]]
local t = Def.ActorFrame {};
-- Background
t[#t+1] = Def.ActorFrame { Name="Background";
Def.Quad {
InitCommand=cmd(zoomto,320+8,96;diffuse,ThemeColor.Secondary);
};
};
-- Radar Text
local function RadarLabel( rc )
local t = Def.ActorFrame {};
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.upper(THEME:GetString("RadarCategoryShort",ToEnumShortString(rc)));
InitCommand=cmd(shadowlength,1;zoom,0.675;horizalign,right);
};
--
return t;
end;
--
local function RadarItem( pn, rc )
local t = Def.ActorFrame {};
--
local function GetRadarValue( _rc, _pn )
if GAMESTATE:GetCurrentSteps( _pn ) then
local Steps = GAMESTATE:GetCurrentSteps( _pn );
local RadarValues = Steps:GetRadarValues( _pn );
local ThisValue = RadarValues:GetValue( _rc );
--
return tonumber(ThisValue);
else
return 0;
end;
end;
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.format("%04i",GetRadarValue(rc,pn));
InitCommand=cmd(shadowlength,1;x,128;zoom,0.675;diffuse,PlayerColor(pn);playcommand,"Set");
SetCommand=function(self,params)
if params.Player == pn then
self:settextf("%04i",GetRadarValue(rc,pn));
end;
end;
};
--
t.CurrentSongChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentCourseChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
t.CurrentStepsP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentStepsP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
--
return t;
end;
--
local function RadarPercent( pn, rc )
local t = Def.ActorFrame {};
--
local function GetRadarValue( _rc, _pn )
if GAMESTATE:GetCurrentSteps( _pn ) then
local Steps = GAMESTATE:GetCurrentSteps( _pn );
local RadarValues = Steps:GetRadarValues( _pn );
local ThisValue = RadarValues:GetValue( _rc );
--
return tonumber(ThisValue);
else
return 0;
end;
end;
--
t[#t+1] = LoadFont("Common Normal") .. {
Text=string.format("%03i%%",math.floor(GetRadarValue(rc,pn)*100));
InitCommand=cmd(shadowlength,1;x,128;zoom,0.675;diffuse,PlayerColor(pn);playcommand,"Set");
SetCommand=function(self,params)
if params.Player == pn then
self:settextf("%03i%%",math.floor(GetRadarValue(rc,pn)*100));
end;
end;
};
--
t.CurrentSongChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentCourseChangedMessageCommand=function(self) self:playcommand("Set"); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
t.CurrentStepsP1ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_1}); end;
t.CurrentStepsP2ChangedMessageCommand=function(self) self:playcommand("Set",{ Player = PLAYER_2}); end;
--
return t;
end;
--
for index,rc in ipairs(RadarCategory) do
if index > 5 then
local VisualIndex = index-6
local VertOffset = ( VisualIndex % 4 ) * 16;
local HorizOffset = math.floor( (VisualIndex)/4 ) * 156;
t[#t+1] = Def.ActorFrame {
Name="RadarCategoryRow" .. tonumber(index-5);
InitCommand=cmd(x,-96+HorizOffset;y,-10+VertOffset);
--
RadarLabel(rc);
RadarItem(PLAYER_1, rc) .. { InitCommand=cmd(x,-96-8); };
RadarItem(PLAYER_2, rc) .. { InitCommand=cmd(x,-64+4); };
};
end
end;
--
for index,rc in ipairs(RadarCategory) do
if index < 6 then
local HorizOffset = (index-1) * 64;
t[#t+1] = Def.ActorFrame {
Name="RadarCategoryRow" .. tonumber(index-5);
InitCommand=cmd(x,-148+HorizOffset;y,-33);
--
RadarLabel(rc);
RadarPercent(PLAYER_1, rc) .. { InitCommand=cmd(x,-104;y,-7); };
RadarPercent(PLAYER_2, rc) .. { InitCommand=cmd(x,-104;y,7); };
};
end
end;
--
--[[ for index,rc in ipairs(RadarCategory) do
if index > 5 then
t[#t+1] = LoadFont("Common Normal") .. { Text=ToEnumShortString(rc); InitCommand=cmd(zoom,0.5;shadowlength,1;y,(index-5)*10); };
end
end; ]]
return t
@@ -1,25 +1,25 @@
return Def.ActorFrame {
-- Time Background
Def.Quad {
Name="SortBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- Time Label
LoadFont("Common Normal") .. {
Name="SortLabel";
Text="SORT";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- Time Text
LoadFont("Common Normal") .. {
Name="SortText";
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
SortOrderChangedMessageCommand=cmd(playcommand,"Set";);
SetCommand=function(self)
local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() );
-- reset numbers
self:settext(s);
end;
};
return Def.ActorFrame {
-- Time Background
Def.Quad {
Name="SortBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- Time Label
LoadFont("Common Normal") .. {
Name="SortLabel";
Text="SORT";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- Time Text
LoadFont("Common Normal") .. {
Name="SortText";
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
SortOrderChangedMessageCommand=cmd(playcommand,"Set";);
SetCommand=function(self)
local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() );
-- reset numbers
self:settext(s);
end;
};
};
@@ -1,28 +1,28 @@
return Def.ActorFrame {
-- Time Background
Def.Quad {
Name="TimeBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- Time Label
LoadFont("Common Normal") .. {
Name="TimeLabel";
Text="TIME";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- Time Text
LoadFont("Common Normal") .. {
Name="BPMText";
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
Song = GAMESTATE:GetCurrentSong();
Time = Song:GetStepsSeconds() or 0;
Minutes = math.floor( Time / 60 );
Seconds = tonumber(Time) - tonumber(Minutes*60);
-- reset numbers
self:settextf("%02i:%02i",Minutes,Seconds);
end;
};
return Def.ActorFrame {
-- Time Background
Def.Quad {
Name="TimeBackground";
InitCommand=cmd(zoomto,96,32;diffuse,ThemeColor.Secondary;shadowlength,2;shadowcolor,Color.Alpha(ColorDarkTone(ThemeColor.Primary),0.95));
};
-- Time Label
LoadFont("Common Normal") .. {
Name="TimeLabel";
Text="TIME";
InitCommand=cmd(x,-32;y,-8;zoom,0.5);
};
-- Time Text
LoadFont("Common Normal") .. {
Name="BPMText";
OnCommand=cmd(horizalign,left;x,-46;y,6;zoom,0.75;maxwidth,92/0.75;);
BeginCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
Song = GAMESTATE:GetCurrentSong();
Time = Song:GetStepsSeconds() or 0;
Minutes = math.floor( Time / 60 );
Seconds = tonumber(Time) - tonumber(Minutes*60);
-- reset numbers
self:settextf("%02i:%02i",Minutes,Seconds);
end;
};
};
@@ -1,98 +1,98 @@
local t = Def.ActorFrame {};
local function UpdateTriangleFrame(self)
local curBPS = GAMESTATE:GetSongBPS() and GAMESTATE:GetSongBPS() or 1;
local c = self:GetChildren();
local auxRate = 3;
--
c.TriangleFrame:aux( math.mod( c.TriangleFrame:getaux() + ( curBPS * auxRate ), 360) );
c.TriangleFrame:rotationz( c.TriangleFrame:GetRotationZ() + ( curBPS * 0.75 ) );
c.TriangleFrame:zoom( 1.125 - ((c.TriangleFrame:getaux() / 360) * 0.35) );
-- c.TriangleFrame:x( math.cos( math.rad(c.TriangleFrame:getaux()) ) * 8 );
-- c.TriangleFrame:y(math.sin( math.rad(c.TriangleFrame:getaux()) ) * 8);
end;
t[#t+1] = Def.ActorFrame {
-- Base
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,48;
diffuse,ThemeColor.Secondary);
};
-- Inner Shadow
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
y,48;
zoomto,SCREEN_WIDTH,5;
diffuse,Color('Black');diffusealpha,0.25;
fadetop,1);
};
-- Inner Hard Line
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
y,48;
zoomto,SCREEN_WIDTH,1;
diffuse,Color('Black');diffusealpha,0.125;);
};
-- Outer White Fade
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
y,48;
zoomto,SCREEN_WIDTH,8;
diffuse,Color('White');diffusealpha,0.125;
fadebottom,1);
};
-- Outer White Line
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
y,48;
zoomto,SCREEN_WIDTH,1;
diffuse,Color('White');diffusealpha,0.125;);
};
}
t[#t+1] = Def.ActorFrame { Name="TriangleFrame";
InitCommand=cmd(x,24;y,32);
BeginCommand=function(self)
self:SetUpdateFunction( UpdateTriangleFrame );
end;
-- Triangle Beaterator
Def.ActorFrame {
Name="TriangleFrame";
--~ OnCommand=cmd(thump,2;effectclock,'beatnooffset';effectmagnitude,1,1.135,1);
--
LoadActor(THEME:GetPathG("_primitive","Triangle")) .. {
Name="Triangle";
OnCommand=cmd(diffuse,ThemeColor.Primary;zoom,0.75);
};
};
};
t[#t+1] = Def.ActorFrame {
-- Text
LoadFont("Common Normal") .. {
Text=string.upper(THEME:GetString( Var "LoadingScreen","HeaderText"));
InitCommand=cmd(horizalign,left;
x,16;y,16;
diffuse,ThemeColor.Primary;
zoom,0.875;
);
};
-- //
--[[ LoadFont("Common Normal") .. {
Text="//";
InitCommand=cmd(horizalign,left;
x,16;y,32;
diffuse,color("0.7,0.7,0.7,1");
zoom,0.5;
);
}; ]]
-- Textem
LoadFont("Common Normal") .. {
Text=string.upper("SELECT AND CHOOSE THE BEST ONE");
InitCommand=cmd(horizalign,left;
x,34;y,32;
diffuse,color("0.7,0.7,0.7,1");
zoom,0.5;
skewx,-0.125;
);
};
};
local t = Def.ActorFrame {};
local function UpdateTriangleFrame(self)
local curBPS = GAMESTATE:GetSongBPS() and GAMESTATE:GetSongBPS() or 1;
local c = self:GetChildren();
local auxRate = 3;
--
c.TriangleFrame:aux( math.mod( c.TriangleFrame:getaux() + ( curBPS * auxRate ), 360) );
c.TriangleFrame:rotationz( c.TriangleFrame:GetRotationZ() + ( curBPS * 0.75 ) );
c.TriangleFrame:zoom( 1.125 - ((c.TriangleFrame:getaux() / 360) * 0.35) );
-- c.TriangleFrame:x( math.cos( math.rad(c.TriangleFrame:getaux()) ) * 8 );
-- c.TriangleFrame:y(math.sin( math.rad(c.TriangleFrame:getaux()) ) * 8);
end;
t[#t+1] = Def.ActorFrame {
-- Base
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
zoomto,SCREEN_WIDTH,48;
diffuse,ThemeColor.Secondary);
};
-- Inner Shadow
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
y,48;
zoomto,SCREEN_WIDTH,5;
diffuse,Color('Black');diffusealpha,0.25;
fadetop,1);
};
-- Inner Hard Line
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,bottom;
y,48;
zoomto,SCREEN_WIDTH,1;
diffuse,Color('Black');diffusealpha,0.125;);
};
-- Outer White Fade
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
y,48;
zoomto,SCREEN_WIDTH,8;
diffuse,Color('White');diffusealpha,0.125;
fadebottom,1);
};
-- Outer White Line
Def.Quad {
InitCommand=cmd(horizalign,left;vertalign,top;
y,48;
zoomto,SCREEN_WIDTH,1;
diffuse,Color('White');diffusealpha,0.125;);
};
}
t[#t+1] = Def.ActorFrame { Name="TriangleFrame";
InitCommand=cmd(x,24;y,32);
BeginCommand=function(self)
self:SetUpdateFunction( UpdateTriangleFrame );
end;
-- Triangle Beaterator
Def.ActorFrame {
Name="TriangleFrame";
--~ OnCommand=cmd(thump,2;effectclock,'beatnooffset';effectmagnitude,1,1.135,1);
--
LoadActor(THEME:GetPathG("_primitive","Triangle")) .. {
Name="Triangle";
OnCommand=cmd(diffuse,ThemeColor.Primary;zoom,0.75);
};
};
};
t[#t+1] = Def.ActorFrame {
-- Text
LoadFont("Common Normal") .. {
Text=string.upper(THEME:GetString( Var "LoadingScreen","HeaderText"));
InitCommand=cmd(horizalign,left;
x,16;y,16;
diffuse,ThemeColor.Primary;
zoom,0.875;
);
};
-- //
--[[ LoadFont("Common Normal") .. {
Text="//";
InitCommand=cmd(horizalign,left;
x,16;y,32;
diffuse,color("0.7,0.7,0.7,1");
zoom,0.5;
);
}; ]]
-- Textem
LoadFont("Common Normal") .. {
Text=string.upper("SELECT AND CHOOSE THE BEST ONE");
InitCommand=cmd(horizalign,left;
x,34;y,32;
diffuse,color("0.7,0.7,0.7,1");
zoom,0.5;
skewx,-0.125;
);
};
};
return t