diff options
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/core.cpp | 6 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 49 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.h | 2 | ||||
-rw-r--r-- | src/koopatlas/shop.cpp | 6 |
4 files changed, 52 insertions, 11 deletions
diff --git a/src/koopatlas/core.cpp b/src/koopatlas/core.cpp index 50308a0..b550f07 100644 --- a/src/koopatlas/core.cpp +++ b/src/koopatlas/core.cpp @@ -466,8 +466,10 @@ void dScKoopatlas_c::executeState_Normal() { CSMENU_ACTIVE(this->csMenu) = true; state.setState(&StateID_CSMenu); } else if (nowPressed & WPAD_A) { - pathManager.unlockAllPaths(); - } + pathManager.unlockAllPaths(2); + } else if (nowPressed & WPAD_B) { + pathManager.unlockAllPaths(0); + } pathManager.execute(); } diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index a945662..762ba03 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -537,7 +537,7 @@ void dWMPathManager_c::activatePoint() { int w = currentNode->levelNumber[0] - 1; int l = currentNode->levelNumber[1] - 1; - if (l == 0) { + if (l == 40) { dWMShop_c::instance->LoadShopForWorld(w); dScKoopatlas_c::instance->state.setState(&dScKoopatlas_c::instance->StateID_ShopWait); return; @@ -565,11 +565,50 @@ void dWMPathManager_c::activatePoint() { } -void dWMPathManager_c::unlockAllPaths() { +void dWMPathManager_c::unlockAllPaths(char type) { - for (int i = 0; i < pathLayer->pathCount; i++) { - dKPPath_s *path = pathLayer->paths[i]; - path->isAvailable = true; + // Unlocks ALL paths, regular and secret + if (type == 0) { + for (int i = 0; i < pathLayer->pathCount; i++) { + dKPPath_s *path = pathLayer->paths[i]; + path->isAvailable = true; + + SaveBlock *save = GetSaveFile()->GetBlock(-1); + for (int j = 0; j < 10; j++) { + for (int h = 0; h < 0x2A; h++) { + save->completions[j][h] = 0x30; + } + } + unlockPaths(); + } + } + + // Unlocks ALL paths, regular only + if (type == 1) { + for (int i = 0; i < pathLayer->pathCount; i++) { + dKPPath_s *path = pathLayer->paths[i]; + path->isAvailable = true; + + SaveBlock *save = GetSaveFile()->GetBlock(-1); + for (int j = 0; j < 10; j++) { + for (int h = 0; h < 0x2A; h++) { + save->completions[j][h] = 0x10; + } + } + unlockPaths(); + } + } + + // Unlocks current path, regular and secret + if (type == 2) { + if (currentNode->type == dKPNode_s::LEVEL) { + int w = currentNode->levelNumber[0] - 1; + int l = currentNode->levelNumber[1] - 1; + + SaveBlock *save = GetSaveFile()->GetBlock(-1); + save->completions[w][l] = 0x30; + unlockPaths(); + } } // Can't change node models - the price we pay for not using anims diff --git a/src/koopatlas/pathmanager.h b/src/koopatlas/pathmanager.h index 2ce0e9c..f939427 100644 --- a/src/koopatlas/pathmanager.h +++ b/src/koopatlas/pathmanager.h @@ -22,7 +22,7 @@ class dWMPathManager_c { void startMovementTo(dKPPath_s *path); void moveThroughPath(); void activatePoint(); - void unlockAllPaths(); + void unlockAllPaths(char type); dKPLayer_s *pathLayer; diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index a39a382..0a93f44 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -259,7 +259,7 @@ int dWMShop_c::onDraw() { void dWMShop_c::specialDraw1() { OSReport("Lakionnnne...."); if (!isHidden) { - Vec pos = {0.0f, 0.0f, 1000.0f}; + Vec pos = {250.0f, 170.0f, 1000.0f}; S16Vec rot = {0,0,0}; Vec scale = {1.0f, 1.0f, 1.0f}; matrix.translation(pos.x, pos.y, pos.z); @@ -270,8 +270,8 @@ void dWMShop_c::specialDraw1() { shopkeep.calcWorld(false); shopkeep.scheduleForDrawing(); -// if(this->ska.isAnimationDone()) -// this->ska.setCurrentFrame(0.0); + if(this->ska.isAnimationDone()) + this->ska.setCurrentFrame(0.0); } return; } |