summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/koopatlas/pathmanager.cpp49
1 files changed, 44 insertions, 5 deletions
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