Use enums for time trial indexes

This adds an anonymous enum for time trial indexes (e.g. the bestrank,
bestlives, etc. arrays and timetriallevel), and replaces all integer
literals with them.

Just like the unlock arrays, these are indexes to an array in XML save
files, so the numbers matter, and therefore should not use strict
typechecking.
This commit is contained in:
Misa
2023-06-05 17:50:19 -07:00
parent e931f2a4a1
commit 8e3ec9aeef
6 changed files with 77 additions and 32 deletions

View File

@@ -729,12 +729,30 @@ int main(int argc, char *argv[])
}
}
if(game.bestrank[0]>=3) game.unlockAchievement("vvvvvvtimetrial_station1_fixed");
if(game.bestrank[1]>=3) game.unlockAchievement("vvvvvvtimetrial_lab_fixed");
if(game.bestrank[2]>=3) game.unlockAchievement("vvvvvvtimetrial_tower_fixed");
if(game.bestrank[3]>=3) game.unlockAchievement("vvvvvvtimetrial_station2_fixed");
if(game.bestrank[4]>=3) game.unlockAchievement("vvvvvvtimetrial_warp_fixed");
if(game.bestrank[5]>=3) game.unlockAchievement("vvvvvvtimetrial_final_fixed");
if (game.bestrank[TimeTrial_SPACESTATION1] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_station1_fixed");
}
if (game.bestrank[TimeTrial_LABORATORY] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_lab_fixed");
}
if (game.bestrank[TimeTrial_TOWER] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_tower_fixed");
}
if (game.bestrank[TimeTrial_SPACESTATION2] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_station2_fixed");
}
if (game.bestrank[TimeTrial_WARPZONE] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_warp_fixed");
}
if (game.bestrank[TimeTrial_FINALLEVEL] >= 3)
{
game.unlockAchievement("vvvvvvtimetrial_final_fixed");
}
obj.init();