Use enums for unlock, unlocknotify, unlocknum

This adds an anonymous enum for the unlock and unlocknotify arrays and
unlocknum function, and replaces all integer literals with them.

This is not named and thus cannot be used for strict typechecking
because these are actually indexes into an array in XML save files, so
the numbers themselves matter a lot.
This commit is contained in:
Misa
2023-06-05 17:34:27 -07:00
parent 14d034e4c6
commit e931f2a4a1
7 changed files with 202 additions and 118 deletions

View File

@@ -701,9 +701,18 @@ int main(int argc, char *argv[])
if(game.swnbestrank >= 6) game.unlockAchievement("vvvvvvsupgrav60");
}
if(game.unlock[5]) game.unlockAchievement("vvvvvvgamecomplete");
if(game.unlock[19]) game.unlockAchievement("vvvvvvgamecompleteflip");
if(game.unlock[20]) game.unlockAchievement("vvvvvvmaster");
if (game.unlock[UnlockTrophy_GAME_COMPLETE])
{
game.unlockAchievement("vvvvvvgamecomplete");
}
if (game.unlock[UnlockTrophy_FLIPMODE_COMPLETE])
{
game.unlockAchievement("vvvvvvgamecompleteflip");
}
if (game.unlock[UnlockTrophy_NODEATHMODE_COMPLETE])
{
game.unlockAchievement("vvvvvvmaster");
}
if (game.bestgamedeaths > -1) {
if (game.bestgamedeaths <= 500) {