diff --git a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua index 1fd781998c..44626673c6 100644 --- a/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua +++ b/Themes/default/BGAnimations/ScreenGameplay decorations/default.lua @@ -165,4 +165,9 @@ t[#t+1] = Def.ActorFrame { }; CreateStops(); }; -return t \ No newline at end of file +if PREFSMAN:GetPreference("ScoringType") == 'ScoringType_Custom' then t[#t+1] = Def.Actor{ + JudgmentMessageCommand = function(self, params) + SpecialScoring[ReadPrefFromFile("UserPrefSpecialScoringMode")](params, STATSMAN:GetCurStageStats():GetPlayerStageStats(params.Player) + end; +}; +return t diff --git a/Themes/default/Languages/en.ini b/Themes/default/Languages/en.ini index 1ec0d82f11..07b570c340 100644 --- a/Themes/default/Languages/en.ini +++ b/Themes/default/Languages/en.ini @@ -60,6 +60,7 @@ LifeDifficulty=Life Difficulty: %s TimingDifficulty=Timing Difficulty: %s [OptionTitles] GamePrefAutoSetStyle=Auto Set Style +UserPrefSpecialScoringMode=Special Scoring Mode GamePrefNotePosition=Note Positions GamePrefComboOnRolls=Rolls Increment Combo GamePrefComboUnderField=Combo Under Field @@ -78,10 +79,12 @@ GamePrefComboUnderField=Determine if the combo should display under the notes or GamePrefAdjustSpeed=Adjust the default scale for speed modifiers. Normal corresponds to the original StepMania 3.9 speed, Fast is twice that rate. UserPrefGameplayShowScore=Show or Hide the score display in gameplay. +UserPrefSpecialScoringMode=Select the scoring mode to be used if the Special scoring type is selected. UserPrefGameplayShowStepsDisplay=Show or Hide the step information display in gameplay. UserPrefShowLotsaOptions=Choose how many lines/rows of options to choose from. &oq;Few&cq; keeps the list to a minimum. &oq;Many&cq; adds various show-off mods. UserPrefLongFail=Choose between the original sm-ssc fail (Long) or the new sm-ssc fail (Short). UserPrefFlashyCombo=Determine if combo flashes should be shown or not. +ScoringType=Defines which scoring method to use. If Special is selected, you can select a Special Scoring Mode in Theme Options. [StepsListDisplayRow StepsType] Dance_Single=4 Dance_Double=8 @@ -109,8 +112,8 @@ Maniax_Double=MD Techno_Single4=4 Techno_Single5=5 Techno_Single8=8 -Techno_Double4=4 -Techno_Double5=5 +Techno_Double4=D4 +Techno_Double5=D5 Pnm_Five=5 Pnm_Nine=9 Guitar_Five=5 @@ -129,4 +132,7 @@ Explanation-WhereToFind=Launches a web page with information on finding songs fo Explanation-HowToInstall=Launches a web page with song installation instructions. Explanation-AdditionalFolders=If you have other installs of StepMania, you can use the AdditionalFolders preferences to load it into sm-ssc. Explanation-ReloadSongs=Reload the songs. This is required if you've added/changed/deleted songs while sm-ssc is running. -Explanation-Exit=Return to the title menu. \ No newline at end of file +Explanation-Exit=Return to the title menu. + +[OptionNames] +Custom=Special diff --git a/Themes/default/Scripts/03 ThemePrefs.lua b/Themes/default/Scripts/03 ThemePrefs.lua index a5889c1d24..af853f7d77 100644 --- a/Themes/default/Scripts/03 ThemePrefs.lua +++ b/Themes/default/Scripts/03 ThemePrefs.lua @@ -21,6 +21,9 @@ function InitUserPrefs() if GetUserPref("UserPrefGameplayShowScore") == nil then SetUserPref("UserPrefGameplayShowScore", false); end; + if GetUserPref("UserPrefSpecialScoringMode") == nil then + SetUserPref("UserPrefSpecialScoringMode", 1); + end; if GetUserPrefB("UserPrefShowLotsaOptions") == nil then SetUserPref("UserPrefShowLotsaOptions", true); end; @@ -230,6 +233,34 @@ function UserPrefShowLotsaOptions() return t; end +function UserPrefSpecialScoringMode() + local t = { + Name = "UserPrefSpecialScoringMode"; + LayoutType = "ShowAllInRow"; + SelectType = "SelectOne"; + OneChoiceForAllPlayers = true; + ExportOnChange = false; + Choices = { 'DDR 1st', 'DDR 3rd', 'DDR 4th', 'DDR SuperNOVA' }; + LoadSelections = function(self, list, pn) + if ReadPrefFromFile("UserPrefSpecialScoringMode") ~= nil then + list[GetUserPref("UserPrefSpecialScoringMode")] = true; + else + WritePrefToFile("UserPrefSpecialScoringMode",1); + list[1] = true; + end; + end; + SaveSelections = function(self, list, pn) + local val; + for k,v in ipairs(list) do if v then val = k end end; + WritePrefToFile("UserPrefSpecialScoringMode",val); + MESSAGEMAN:Broadcast("PreferenceSet", { Message == "Set Preference" } ); + THEME:ReloadMetrics(); + end; + }; + setmetatable( t, t ); + return t; +end + function GetDefaultOptionLines() local LineSets = { "1,8,14,2,3,4,5,6,R,7,9,10,11,12,13,15,16,17,18", -- All diff --git a/Themes/default/Scripts/04 SpecialScoring.lua b/Themes/default/Scripts/04 SpecialScoring.lua new file mode 100644 index 0000000000..0ba99cc7c1 --- /dev/null +++ b/Themes/default/Scripts/04 SpecialScoring.lua @@ -0,0 +1,43 @@ +--Special Scoring types. +local r = {}; +--the following metatable makes any missing value in a table 0 instead of nil. +local ZeroIfNotFound = { _index = function() return 0 end; }; +----------------------------------------------------------- +--DDR 1st Mix and 2nd Mix Scoring +----------------------------------------------------------- +r[1] = function(params, pss) + local dCombo = math.floor(pss:GetCurrentCombo()/4); + local bScore = (m^2+1) * 100; + local multLookup = { ['TapNoteScore_W1']=3, ['TapNoteScore_W2']=3, ['TapNoteScore_W3']=1 }; + setmetatable(multLookup, ZeroIfNotFound); + pss:SetScore(pss:GetScore()+(bScore*multLookup[params.TapNoteScore])); +end; +----------------------------------------------------------- +--DDR 3rd Mix and USA Scoring +----------------------------------------------------------- +r[2] = function(params, pss) + local totalSteps = GAMESTATE:GetCurrentSteps(params.Player):GetRadarValues():GetValue('RadarCategory_TapsAndHolds'); + local baseScore = math.round(1000000/((totalSteps*(totalSteps+1))/2)); + local curStep = pss:GetRadarActual:GetValue('RadarCategory_TapsAndHolds'); + local endBonus = (curStep == totalSteps) and (1000000-math.round(1000000/(totalSteps*(totalSteps+1)/2))*(totalSteps*(totalSteps+1)/2)) or 0; + local multLookup = { ['TapNoteScore_W1']=10, ['TapNoteScore_W2']=10, ['TapNoteScore_W3']=5 }; + setmetatable(multLookup, ZeroIfNotFound); + local thisScore = multLookup[params.TapNoteScore] * (baseScore * curStep + endBonus); + pss:SetScore(pss:GetScore()+thisScore); +end; +----------------------------------------------------------- +--DDR 4th Mix/Extra Mix/Konamix/GB3/DDRPC Scoring +----------------------------------------------------------- +r[3] = function(params, pss) + local scoreLookupTable = { ['TapNoteScore_W1']=777, ['TapNoteScore_W2']=777, ['TapNoteScore_W3']=555 }; + setmetatable(scoreLookupTable, ZeroIfNotFound); + local comboBonusForThisStep = pss:GetCurCombo()*333; + pss:SetScore(pss:GetScore+scoreForThisStep+comboBonusForThisStep); +end; +----------------------------------------------------------- +--DDR SuperNOVA(-esque) scoring +----------------------------------------------------------- +r[4] = function(params, pss) + pss:SetScore(pss:GetPercentDancePoints()*1000000); +end; +SpecialScoring = r; diff --git a/Themes/default/metrics.ini b/Themes/default/metrics.ini index 7b9a1b9238..f99b716421 100644 --- a/Themes/default/metrics.ini +++ b/Themes/default/metrics.ini @@ -827,10 +827,11 @@ ItemsLongRowSharedX=SCREEN_CENTER_X [ScreenOptionsTheme] Fallback="ScreenOptionsServiceChild" -LineNames="gNotePos,gAuto,gScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo,AdjustSpeed" +LineNames="gNotePos,gAuto,gScore,gSScore,gSDisp,gOpts,gLongFail,gComboUnderField,FlashyCombo,AdjustSpeed" #,gAuto LinegNotePos="lua,GamePrefNotePosition()" LinegScore="lua,UserPrefGameplayShowScore()" +LinegSScore"lua,UserPrefSpecialScoringMode()" LinegSDisp="lua,UserPrefGameplayShowStepsDisplay()" LinegOpts="lua,UserPrefShowLotsaOptions()" LinegAuto="lua,GamePrefAutoSetStyle()" @@ -1831,6 +1832,7 @@ ComboGraphP2OffCommand= # MachineRecordP1X=SCREEN_CENTER_X-220 #MachineRecordP1Y=SCREEN_BOTTOM-156 + MachineRecordP1Y=SCREEN_TOP+146 MachineRecordP1OnCommand= MachineRecordP1OffCommand= @@ -2056,4 +2058,25 @@ ChoiceExit="screen,"..Branch.TitleMenu()..";text,"..Screen.String("Exit") DefaultChoice="WhereToFind" OptionOrderUp="5:4,4:3,3:2,2:1,1:5" -OptionOrderDown="1:2,2:3,3:4,4:5,5:1" \ No newline at end of file +OptionOrderDown="1:2,2:3,3:4,4:5,5:1" +[CustomScoring] +# So special scoring works properly, we zero this out +ComboAboveThresholdAddsToScoreBonus=0 +ComboScoreBonusThreshold=0 +ComboScoreBonusValue=0 +ComboMultiplier=0 +DoubleNoteScoreMultiplier=0 +TripleNoteScoreMultiplier=0 +QuadOrHigherNoteScoreMultiplier=0 +PointsW1=0 +PointsW2=0 +PointsW3=0 +PointsW4=0 +PointsW5=0 +PointsMiss=0 +PointsHitMine=0 +PointsCheckpointHit=0 +PointsCheckpointMiss=0 +PointsNone=0 +PointsHoldHeld=0 +PointsHoldLetGo=0