From f64e9237c40ae73ee6ac055647b9643afa396df5 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 29 Jun 2020 15:53:19 -0700 Subject: [PATCH] Display centiseconds on time trial result and Game Complete Centiseconds won't be saved to any save file or anything. This is just to make speedrunning a bit more competitive, being able to know the precise time of a time trial or full game run. The time trial par time on the result screen always has ".99" after it. This is basically due to the game comparing the number of seconds to the par number of seconds using less-than-or-equal-to instead of simply less-than. --- desktop_version/src/Game.cpp | 4 ++++ desktop_version/src/Game.h | 2 +- desktop_version/src/Render.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index af0832e2..96ded99f 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -258,6 +258,7 @@ void Game::init(void) timetrialparlost = false; timetrialpar = 0; timetrialresulttime = 0; + timetrialresultframes = 0; totalflips = 0; hardestroom = "Welcome Aboard"; @@ -1390,6 +1391,7 @@ void Game::updatestate() obj.removetrigger(82); hascontrol = false; timetrialresulttime = seconds + (minutes * 60) + (hours * 60 * 60); + timetrialresultframes = frames; timetrialrank = 0; if (timetrialresulttime <= timetrialpar) timetrialrank++; if (trinkets() >= timetrialshinytarget) timetrialrank++; @@ -3219,6 +3221,7 @@ void Game::updatestate() graphics.createtextbox(" All Crew Members Rescued! ", -1, 64, 0, 0, 0); } savetime = timestring(); + savetime += "." + help.twodigits(frames*100 / 30); break; case 3503: { @@ -6883,6 +6886,7 @@ std::string Game::resulttimestring() { tempstring = "00:" + help.twodigits(timetrialresulttime); } + tempstring += "." + help.twodigits(timetrialresultframes*100 / 30); return tempstring; } diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 4c15f33b..32891871 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -258,7 +258,7 @@ public: //Time Trials bool intimetrial, timetrialparlost; int timetrialcountdown, timetrialshinytarget, timetriallevel; - int timetrialpar, timetrialresulttime, timetrialrank; + int timetrialpar, timetrialresulttime, timetrialresultframes, timetrialrank; int creditposition; int oldcreditposition; diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index e8cd1f43..439491c4 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -661,7 +661,7 @@ void menurender() { graphics.bigprint( -1, 20, "Results", tr, tg, tb, true, 3); - std::string tempstring = game.resulttimestring() + " / " + game.partimestring(); + std::string tempstring = game.resulttimestring() + " / " + game.partimestring() + ".99"; graphics.drawspritesetcol(30, 80-15, 50, 22); graphics.Print(65, 80-15, "TIME TAKEN:", 255, 255, 255);