diff options
author | Treeki <treeki@gmail.com> | 2013-04-08 00:32:43 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-04-08 00:34:36 +0200 |
commit | 9789e4ea08dc28d7cee6127ec3b2eb8b28451b07 (patch) | |
tree | 272af10b17cd0e0aa765cec6d32c8c552f1418d3 /src | |
parent | bb1b94f68f00e7b4ffa7421bfa5e23fe7b750784 (diff) | |
download | kamek-9789e4ea08dc28d7cee6127ec3b2eb8b28451b07.tar.gz kamek-9789e4ea08dc28d7cee6127ec3b2eb8b28451b07.zip |
fix stuff on the map related to tracking level completions, etc
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/core.cpp | 6 | ||||
-rw-r--r-- | src/koopatlas/core.h | 1 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 48 |
3 files changed, 45 insertions, 10 deletions
diff --git a/src/koopatlas/core.cpp b/src/koopatlas/core.cpp index b67df2f..613bb80 100644 --- a/src/koopatlas/core.cpp +++ b/src/koopatlas/core.cpp @@ -408,6 +408,12 @@ int dScKoopatlas_c::onCreate() { save->current_world = 6; } + if (MaybeFinishingLevel[0] == 7 && MaybeFinishingLevel[1] == 24) { + currentMapID = 7; // KoopaPlanetUnd + save->current_world = 7; + isAfter8Castle = true; + } + somethingAboutSound(_8042A788); return true; diff --git a/src/koopatlas/core.h b/src/koopatlas/core.h index 9970baf..a48e96c 100644 --- a/src/koopatlas/core.h +++ b/src/koopatlas/core.h @@ -118,6 +118,7 @@ class dScKoopatlas_c : public dScene_c { bool isFirstPlay; bool isAfterKamekCutscene; + bool isAfter8Castle; void startMusic(); bool warpZoneHacks; diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 00e1bef..579934a 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -146,7 +146,11 @@ void dWMPathManager_c::setup() { SpammyReport("out of bounds (%d), using node 0\n", pathLayer->nodeCount); currentNode = pathLayer->nodes[0]; } else { - currentNode = pathLayer->nodes[save->current_path_node]; + int butts = Remocon_GetButtons(GetActiveRemocon()); + if ((butts & WPAD_MINUS) && (butts & WPAD_PLUS) && (butts & WPAD_ONE)) + currentNode = pathLayer->nodes[0]; + else + currentNode = pathLayer->nodes[save->current_path_node]; SpammyReport("OK %p\n", currentNode); } @@ -161,6 +165,18 @@ void dWMPathManager_c::setup() { } } } + + if (wm->isAfter8Castle) { + // warp to 8-L + for (int i = 0; i < pathLayer->nodeCount; i++) { + dKPNode_s *node = pathLayer->nodes[i]; + if (node->type == dKPNode_s::LEVEL && node->levelNumber[0] == 8 && node->levelNumber[1] == 5) { + currentNode = node; + save->current_path_node = i; + break; + } + } + } } for (int i = 0; i < pathLayer->nodeCount; i++) @@ -234,8 +250,13 @@ void dWMPathManager_c::setup() { completionMessageType = CMP_MSG_GLOBAL_EXITS; } } - if (CanFinishEverything && gFlag == gTotalFlag) + if (CanFinishEverything && gFlag == gTotalFlag) { + save->titleScreenWorld = 3; + save->titleScreenLevel = 10; + + shouldRequestSave = true; completionMessageType = CMP_MSG_EVERYTHING; + } } ResetAllCompletionCandidates(); @@ -250,7 +271,8 @@ static u8 *PathAvailabilityData = 0; static u8 *NodeAvailabilityData = 0; dWMPathManager_c::~dWMPathManager_c() { - if (PathAvailabilityData && !isEnteringLevel) { + bool entering8_25 = (MaybeFinishingLevel[0] == 7) && (MaybeFinishingLevel[1] == 24); + if (PathAvailabilityData && !isEnteringLevel && !entering8_25) { delete[] PathAvailabilityData; PathAvailabilityData = 0; @@ -259,6 +281,8 @@ dWMPathManager_c::~dWMPathManager_c() { } if (isEnteringLevel) { + ResetAllCompletionCandidates(); + SaveBlock *save = GetSaveFile()->GetBlock(-1); if ((enteredLevel->displayLevel >= 21 && enteredLevel->displayLevel <= 27 && enteredLevel->displayLevel != 26) || (enteredLevel->displayLevel >= 29 && enteredLevel->displayLevel <= 42)) { @@ -338,8 +362,6 @@ dWMPathManager_c::~dWMPathManager_c() { } // So.. are we candidates for any of these? - ResetAllCompletionCandidates(); - LastLevelPlayed[0] = enteredLevel->worldSlot; LastLevelPlayed[1] = enteredLevel->levelSlot; @@ -604,7 +626,7 @@ bool dWMPathManager_c::doingThings() { if (isEnteringLevel || (waitAfterUnlock > 0) || (completionAnimDelay > 0) || (waitAtStart > 0) || (waitAfterInitialPlayerAnim > 0) || panningCameraToPaths || panningCameraFromPaths || - (waitBeforePanBack > 0) || + (waitBeforePanBack > 0) || !initialLoading || (countdownToFadeIn > 0) || (unlockingAlpha != -1)) return true; @@ -637,11 +659,15 @@ void dWMPathManager_c::execute() { PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_VOC_MA_CS_COURSE_MISS, 1); } else if (mustPlayAfterWinAnim) { daWMPlayer_c::instance->visible = true; - daWMPlayer_c::instance->startAnimation(dm_surp_wait, 1.0f, 0.0f, 0.0f); - waitAfterInitialPlayerAnim = 38; + if (dScKoopatlas_c::instance->isAfter8Castle) { + waitAfterInitialPlayerAnim = 1; + } else { + daWMPlayer_c::instance->startAnimation(dm_surp_wait, 1.0f, 0.0f, 0.0f); + waitAfterInitialPlayerAnim = 38; - nw4r::snd::SoundHandle something; - PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_VOC_MA_CS_JUMP, 1); + nw4r::snd::SoundHandle something; + PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_VOC_MA_CS_JUMP, 1); + } } } return; @@ -1308,6 +1334,8 @@ void dWMPathManager_c::copyWorldDefToSave(const dKPWorldDef_s *world) { save->hudHintS = world->hudHintS; save->hudHintL = world->hudHintL; + if (save->titleScreenWorld == 3 && save->titleScreenLevel == 10) + return; save->titleScreenWorld = world->titleScreenWorld; save->titleScreenLevel = world->titleScreenLevel; } |