+ criticals and errors count for longs and vols on result screen & * speed up results enter animation

This commit is contained in:
FajsiEx 2021-07-28 22:10:00 +02:00
parent c856d58566
commit 10416a2882
1 changed files with 52 additions and 29 deletions

View File

@ -58,9 +58,9 @@ local bottomPanelY = 1110;
local jacketPanelX = 0; local jacketPanelX = 0;
local jacketPanelY = 820; local jacketPanelY = 820;
local JACKET_PANEL_TRANSTION_ENTER_OFFSET = -128; local JACKET_PANEL_TRANSTION_ENTER_OFFSET = -256;
local RIGHT_PANEL_TRANSTION_ENTER_OFFSET = 128; local RIGHT_PANEL_TRANSTION_ENTER_OFFSET = 256;
local BOTTOM_PANEL_TRANSTION_ENTER_OFFSET = 128; local BOTTOM_PANEL_TRANSTION_ENTER_OFFSET = 256;
local highScore; local highScore;
@ -247,13 +247,13 @@ local drawRightPanelContent = function()
gfx.Text(objectTypeTimingStats.chip.errors, rightPanelX + 255, gfx.Text(objectTypeTimingStats.chip.errors, rightPanelX + 255,
rightPanelY + 425); rightPanelY + 425);
-- LONG -- LONG
gfx.Text('N/A', rightPanelX + 333, rightPanelY + 365); gfx.Text(objectTypeTimingStats.long.criticals, rightPanelX + 333, rightPanelY + 365);
gfx.Text('-', rightPanelX + 333, rightPanelY + 395); gfx.Text('-', rightPanelX + 333, rightPanelY + 395);
gfx.Text('N/A', rightPanelX + 333, rightPanelY + 425); gfx.Text(objectTypeTimingStats.long.errors, rightPanelX + 333, rightPanelY + 425);
-- VOL -- VOL
gfx.Text('N/A', rightPanelX + 411, rightPanelY + 365); gfx.Text(objectTypeTimingStats.vol.criticals, rightPanelX + 411, rightPanelY + 365);
gfx.Text('-', rightPanelX + 411, rightPanelY + 395); gfx.Text('-', rightPanelX + 411, rightPanelY + 395);
gfx.Text('N/A', rightPanelX + 411, rightPanelY + 425); gfx.Text(objectTypeTimingStats.vol.errors, rightPanelX + 411, rightPanelY + 425);
-- Draw max combo -- Draw max combo
gfx.Text(result.maxCombo, rightPanelX + 371, rightPanelY + 466); gfx.Text(result.maxCombo, rightPanelX + 371, rightPanelY + 466);
@ -320,7 +320,7 @@ end
local tickTransitions = function(deltaTime) local tickTransitions = function(deltaTime)
if transitionEnterScale < 1 then if transitionEnterScale < 1 then
transitionEnterScale = transitionEnterScale + deltaTime / 1.5 -- transition should last for 1.5s transitionEnterScale = transitionEnterScale + deltaTime / 0.66 -- transition should last for that time in seconds
else else
transitionEnterScale = 1 transitionEnterScale = 1
end end
@ -341,48 +341,71 @@ result_set = function()
jacketImage = gfx.CreateImage(result.jacketPath, 0) jacketImage = gfx.CreateImage(result.jacketPath, 0)
end end
-- Store the highest score so we can use it later for delta and stuff
highScore = result.highScores[1]; highScore = result.highScores[1];
-- This only counts the "CHIP" objects, not LONGs or LAZERs -- "CHIP" objects
for hitStatIndex = 1, #result.noteHitStats do for hitStatIndex = 1, #result.noteHitStats do
local hitStat = result.noteHitStats[hitStatIndex]; local hitStat = result.noteHitStats[hitStatIndex];
if (hitStat.rating == 0) then -- Miss if (hitStat.rating == 0) then -- Errors
objectTypeTimingStats.chip.errors = objectTypeTimingStats.chip.errors = objectTypeTimingStats.chip.errors + 1;
objectTypeTimingStats.chip.errors + 1;
if hitStat.delta < 0 then if hitStat.delta < 0 then
earlyLateBarsStats.earlyErrors = earlyLateBarsStats.earlyErrors = earlyLateBarsStats.earlyErrors + 1;
earlyLateBarsStats.earlyErrors + 1;
else else
earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors + 1;
earlyLateBarsStats.lateErrors + 1;
end end
elseif hitStat.rating == 1 then elseif hitStat.rating == 1 then -- Nears
objectTypeTimingStats.chip.nears = objectTypeTimingStats.chip.nears = objectTypeTimingStats.chip.nears + 1;
objectTypeTimingStats.chip.nears + 1;
if hitStat.delta < 0 then if hitStat.delta < 0 then
earlyLateBarsStats.earlyNears = earlyLateBarsStats.earlyNears = earlyLateBarsStats.earlyNears + 1;
earlyLateBarsStats.earlyNears + 1;
else else
earlyLateBarsStats.lateNears = earlyLateBarsStats.lateNears + 1; earlyLateBarsStats.lateNears = earlyLateBarsStats.lateNears + 1;
end end
else else -- Criticals
objectTypeTimingStats.chip.criticals = objectTypeTimingStats.chip.criticals = objectTypeTimingStats.chip.criticals + 1;
objectTypeTimingStats.chip.criticals + 1;
end end
end end
-- "LONG" objects
for hitStatIndex = 1, #result.holdHitStats do
local hitStat = result.holdHitStats[hitStatIndex];
if (hitStat.rating == 0) then -- Errors
objectTypeTimingStats.long.errors = objectTypeTimingStats.long.errors + 1;
earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors + 1;
else -- Criticals
objectTypeTimingStats.long.criticals = objectTypeTimingStats.long.criticals + 1;
end
end
-- "VOL" a.k.a laser objects
for hitStatIndex = 1, #result.laserHitStats do
local hitStat = result.laserHitStats[hitStatIndex];
if (hitStat.rating == 0) then -- Errors
objectTypeTimingStats.vol.errors = objectTypeTimingStats.vol.errors + 1;
earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors + 1;
else -- Criticals
objectTypeTimingStats.vol.criticals = objectTypeTimingStats.vol.criticals + 1;
end
end
earlyLateBarsStats.criticals = result.perfects -- Criticals are for all objects
-- misses on LONGs or LAZERs are automatically late errors -- misses on LONGs or LAZERs are automatically late errors
-- so we add errors that are not ealy or late to late errors -- so we add errors that are not ealy or late to late errors
earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors + -- earlyLateBarsStats.lateErrors = earlyLateBarsStats.lateErrors +
(result.misses - -- (result.misses -
earlyLateBarsStats.lateErrors - -- earlyLateBarsStats.lateErrors -
earlyLateBarsStats.earlyErrors) -- earlyLateBarsStats.earlyErrors)
-- criticals are same for all objects so we just copy them from results -- criticals are same for all objects so we just copy them from results
earlyLateBarsStats.criticals = result.perfects
end end
render = function(deltaTime, showStats) render = function(deltaTime, showStats)