diff options
author | Treeki <treeki@gmail.com> | 2012-09-27 16:58:43 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-09-27 16:58:43 +0200 |
commit | 624a89dc12d88973486b39937871c5facf6b9bb6 (patch) | |
tree | ff7614e780d13162d1749e4f57478dc16b9226d7 /src/newer.cpp | |
parent | 3268b1fab87a34897289faa8a1f5ee0679f74e19 (diff) | |
parent | 0fc70778c02671e64b8360b7ebdbb0e8c29f0a05 (diff) | |
download | kamek-624a89dc12d88973486b39937871c5facf6b9bb6.tar.gz kamek-624a89dc12d88973486b39937871c5facf6b9bb6.zip |
Merge branch 'new-hud' into level-select
Diffstat (limited to '')
-rw-r--r-- | src/newer.cpp | 85 |
1 files changed, 15 insertions, 70 deletions
diff --git a/src/newer.cpp b/src/newer.cpp index 6d672e2..0b53fa6 100644 --- a/src/newer.cpp +++ b/src/newer.cpp @@ -1,77 +1,22 @@ #include <newer.h> +#include <game.h> -NWRWorld NewerWorldForLevelID(int w, int l) { - switch (w) { - case 1: return YOSHI_ISLAND; - case 2: - if (((l>1) && (l<5)) || (l==15) || (l==33) || (l==34)) - return SOGGY_SEWERS; - else - return RUBBLE_RUINS; - case 3: return MUSHROOM_PEAKS; - case 4: return SAKURA_VILLAGE; - case 5: - if (l<7 || l==15 || l==33 || l==34) - return FREEZEFLAME_GLACIER; - else - return FREEZEFLAME_VOLCANO; - case 6: return PUMPKIN_BONEYARD; - case 7: - if (l<4) - return SKY_MOUNTAIN; - else - return STARRY_SKIES; - case 8: - if (l<6 || l==15 || l==25 || l==33 || l==34) - return KOOPA_PLANET; - else - return KOOPA_CORE; - case 9: return BONUS_LAND; - case 10: - if (l<6 || l==30 || l==41) - return GOLDWOOD_FOREST; - else if (l<11 || l==32) - return MINIMEGA_ISLAND; - else if (l<16 || l==33 || l==34 || l==31) - return CRYSTAL_CAVES; - else if (l<19) - return BOMBARD_CLIFFS; - else - return SKY_CITY; - } - - return UNKNOWN_WORLD; -} +int getStarCoinCount() { + SaveBlock *save = GetSaveFile()->GetBlock(-1); + int coinsSpent = save->credits_hiscore; + int coinsEarned = 0; -const wchar_t *NewerWorldNames[] = { - L"Yoshi's Island", - L"Rubble Ruins", - L"Soggy Sewers", - L"Mushroom Peaks", - L"Sakura Village", - L"Freezeflame Glacier", - L"Freezeflame Volcano", - L"Pumpkin Boneyard", - L"Sky Mountain", - L"Starry Skies", - L"Koopa Planet", - L"Koopa Core", - L"Bonus Land", - L"Goldwood Forest", - L"Mini-Mega Island", - L"Crystal Caves", - L"Bombard Cliffs", - L"Sky City" -}; + for (int w = 0; w < 10; w++) { + for (int l = 0; l < 10; l++) { + u32 conds = save->GetLevelCondition(w, l); -// This is an array so it can be accessed from fileselect.S -int NewerWorldCount[] = { - 18 -}; + if (conds & COND_COIN1) { coinsEarned++; } + if (conds & COND_COIN2) { coinsEarned++; } + if (conds & COND_COIN3) { coinsEarned++; } + } + } -const wchar_t *NewerWorldName(NWRWorld world) { - if (world < 0 || world >= WORLD_COUNT) - return L"Unknown World"; - return NewerWorldNames[world]; + int coinsLeft = coinsEarned - coinsSpent; + return coinsLeft; } |