Skip to content

Commit

Permalink
Merge pull request #4 from iristraa/master
Browse files Browse the repository at this point in the history
Add Ultimate Achievements
  • Loading branch information
iArtie authored Mar 6, 2024
2 parents 754cef0 + 57099d0 commit 9bb14cc
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,64 @@ class $modify(PlayLayer) {
return PlayLayer::init(level, useReplay, dontCreateObjects);

}

// ultimate achievements - hello from iris
void levelComplete() {
PlayLayer::levelComplete();
auto GSValues = GameStatsManager::sharedState()->m_playerStats;
int coinsCollected = 0;
int setPercentage;
switch (m_level->m_levelID) {
case 1001:
// the seven seas
if (GSValues->objectForKey("unique_1001_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1001_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1001_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.mdcoin01", setPercentage, false);
break;
case 1002:
// viking arena
if (GSValues->objectForKey("unique_1002_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1002_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1002_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.mdcoin02", setPercentage, false);
break;
case 1003:
// airborne robots
if (GSValues->objectForKey("unique_1003_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1003_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_1003_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.mdcoin03", setPercentage, false);
break;
case 4001:
// press start
if (GSValues->objectForKey("unique_4001_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4001_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4001_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.subzero.coins001", setPercentage, false);
break;
case 4002:
// nock em
if (GSValues->objectForKey("unique_4002_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4002_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4002_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.subzero.coins002", setPercentage, false);
break;
case 4003:
// power trip
if (GSValues->objectForKey("unique_4003_1") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4003_2") != nullptr) ++coinsCollected;
if (GSValues->objectForKey("unique_4003_3") != nullptr) ++coinsCollected;
setPercentage = coinsCollected * 100 / 3;
AchievementManager::sharedState()->reportAchievementWithID("geometry.ach.subzero.coins003", setPercentage, false);
break;
}
}
//
// int getCurrentPercentInt()
// {
Expand Down

0 comments on commit 9bb14cc

Please sign in to comment.