summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-04-30 17:34:29 +0200
committerTreeki <treeki@gmail.com>2013-04-30 17:34:51 +0200
commitb5c29919c928e55e10b82d9de2dd9879b5e1a32b (patch)
tree6f1fd02380a0db2e676b811ce8db5c6b55a56670 /src
parent46f7334790a5cef5fb167698e2d11c8bb680b6e9 (diff)
downloadkamek-b5c29919c928e55e10b82d9de2dd9879b5e1a32b.tar.gz
kamek-b5c29919c928e55e10b82d9de2dd9879b5e1a32b.zip
move automatically after beating castles/fortresses
Diffstat (limited to '')
-rw-r--r--src/koopatlas/pathmanager.cpp36
-rw-r--r--src/koopatlas/pathmanager.h3
2 files changed, 39 insertions, 0 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 697b9fb..9741c4b 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -909,6 +909,42 @@ void dWMPathManager_c::execute() {
return;
}
+ if (shouldRequestSave && !checkedForMoveAfterEndLevel) {
+ checkedForMoveAfterEndLevel = true;
+
+ static const int endLevels[11][3] = {
+ {1, 38, 1}, // W1 right
+ {2, 38, 2}, // W2 up
+ {3, 38, 0}, // W3 left
+ {4, 38, 1}, // W4 right
+ {5, 38, 1}, // W5 right
+ {6, 38, 2}, // W6 up
+ {7, 38, 1}, // W7 right
+ {10, 5, 2}, // GW up
+ {10, 10, 0}, // MM left
+ {10, 15, 3}, // CC down
+ {10, 25, 1}, // SC right
+ };
+
+ int w = LastLevelPlayed[0] + 1;
+ int l = LastLevelPlayed[1] + 1;
+
+ for (int i = 0; i < 11; i++) {
+ if (endLevels[i][0] == w && endLevels[i][1] == l) {
+ afterFortressMode = true;
+ startMovementTo(currentNode->exits[endLevels[i][2]]);
+ return;
+ }
+ }
+ }
+
+ if (afterFortressMode) {
+ if (isMoving)
+ moveThroughPath(-1);
+ else
+ afterFortressMode = false;
+ }
+
if (shouldRequestSave) {
dScKoopatlas_c::instance->showSaveWindow();
shouldRequestSave = false;
diff --git a/src/koopatlas/pathmanager.h b/src/koopatlas/pathmanager.h
index afd8103..42d94ba 100644
--- a/src/koopatlas/pathmanager.h
+++ b/src/koopatlas/pathmanager.h
@@ -108,6 +108,9 @@ class dWMPathManager_c {
int waitAfterInitialPlayerAnim;
bool initialLoading;
+ bool checkedForMoveAfterEndLevel;
+ bool afterFortressMode;
+
bool doingThings();
dLevelInfo_c::entry_s *enteredLevel;