mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 09:39:43 +01:00
Give MotU trophy in normal mode
This makes it so that it is possible to obtain the Master of the Universe trophy/achievement, usually unlocked by beating No Death Mode, outside of NDM. There are several conditions that need to be met: 1. The game needs to be started from a new game and cannot be from loading a save. 2. Accessibility modes (invincibility and slowdown) must never be enabled. If either condition is violated, then the boolean that keeps track of NDM eligibility will be set to false.
This commit is contained in:
parent
d8b2b3542a
commit
32562f03a9
4 changed files with 35 additions and 2 deletions
|
@ -225,6 +225,7 @@ void Game::init(void)
|
||||||
ndmresulthardestroom_x = hardestroom_x;
|
ndmresulthardestroom_x = hardestroom_x;
|
||||||
ndmresulthardestroom_y = hardestroom_y;
|
ndmresulthardestroom_y = hardestroom_y;
|
||||||
ndmresulthardestroom_specialname = false;
|
ndmresulthardestroom_specialname = false;
|
||||||
|
nodeatheligible = false;
|
||||||
|
|
||||||
customcol=0;
|
customcol=0;
|
||||||
|
|
||||||
|
@ -3312,11 +3313,14 @@ void Game::updatestate(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nodeathmode || nodeatheligible)
|
||||||
if (nodeathmode)
|
|
||||||
{
|
{
|
||||||
unlockAchievement("vvvvvvmaster"); //bloody hell
|
unlockAchievement("vvvvvvmaster"); //bloody hell
|
||||||
unlocknum(UnlockTrophy_NODEATHMODE_COMPLETE);
|
unlocknum(UnlockTrophy_NODEATHMODE_COMPLETE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodeathmode)
|
||||||
|
{
|
||||||
setstate(3520);
|
setstate(3520);
|
||||||
setstatedelay(0);
|
setstatedelay(0);
|
||||||
}
|
}
|
||||||
|
@ -7768,6 +7772,11 @@ void Game::returntoingame(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEFER_CALLBACK(nextbgcolor);
|
DEFER_CALLBACK(nextbgcolor);
|
||||||
|
|
||||||
|
if (nocompetitive())
|
||||||
|
{
|
||||||
|
invalidate_ndm_trophy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::unlockAchievement(const char* name)
|
void Game::unlockAchievement(const char* name)
|
||||||
|
@ -7820,6 +7829,15 @@ void Game::copyndmresults(void)
|
||||||
SDL_memcpy(ndmresultcrewstats, crewstats, sizeof(ndmresultcrewstats));
|
SDL_memcpy(ndmresultcrewstats, crewstats, sizeof(ndmresultcrewstats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Game::invalidate_ndm_trophy(void)
|
||||||
|
{
|
||||||
|
if (nodeatheligible)
|
||||||
|
{
|
||||||
|
vlog_debug("NDM trophy is invalidated!");
|
||||||
|
}
|
||||||
|
nodeatheligible = false;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int get_framerate(const int slowdown)
|
static inline int get_framerate(const int slowdown)
|
||||||
{
|
{
|
||||||
switch (slowdown)
|
switch (slowdown)
|
||||||
|
|
|
@ -432,6 +432,8 @@ public:
|
||||||
int ndmresulthardestroom_y;
|
int ndmresulthardestroom_y;
|
||||||
bool ndmresulthardestroom_specialname;
|
bool ndmresulthardestroom_specialname;
|
||||||
void copyndmresults(void);
|
void copyndmresults(void);
|
||||||
|
bool nodeatheligible;
|
||||||
|
void invalidate_ndm_trophy(void);
|
||||||
|
|
||||||
//Time Trials
|
//Time Trials
|
||||||
bool intimetrial, timetrialparlost;
|
bool intimetrial, timetrialparlost;
|
||||||
|
|
|
@ -461,6 +461,8 @@ void gamelogic(void)
|
||||||
game.deathseq--;
|
game.deathseq--;
|
||||||
if (game.deathseq <= 0)
|
if (game.deathseq <= 0)
|
||||||
{
|
{
|
||||||
|
game.invalidate_ndm_trophy();
|
||||||
|
|
||||||
if (game.nodeathmode)
|
if (game.nodeathmode)
|
||||||
{
|
{
|
||||||
game.deathseq = 1;
|
game.deathseq = 1;
|
||||||
|
|
|
@ -2651,6 +2651,16 @@ void scriptclass::startgamemode(const enum StartMode mode)
|
||||||
graphics.showcutscenebars = true;
|
graphics.showcutscenebars = true;
|
||||||
graphics.setbars(320);
|
graphics.setbars(320);
|
||||||
load("intro");
|
load("intro");
|
||||||
|
|
||||||
|
if (!game.nocompetitive())
|
||||||
|
{
|
||||||
|
game.nodeatheligible = true;
|
||||||
|
vlog_debug("NDM trophy is eligible.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game.invalidate_ndm_trophy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3088,6 +3098,7 @@ void scriptclass::hardreset(void)
|
||||||
|
|
||||||
game.nodeathmode = false;
|
game.nodeathmode = false;
|
||||||
game.nocutscenes = false;
|
game.nocutscenes = false;
|
||||||
|
game.nodeatheligible = false;
|
||||||
|
|
||||||
for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++)
|
for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue