summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-07-22 17:19:41 -0500
committerColin Noga <Tempus@chronometry.ca>2012-07-22 17:19:41 -0500
commit53116b7ae344edd0ed421a466fd6ae732c2d82d8 (patch)
treef582b24e4fa8a38f3c3a03f08f1068fbd6251556 /src/koopatlas/pathmanager.cpp
parenta37e9d8030a5274072cc085db74e463eb4be0a73 (diff)
downloadkamek-53116b7ae344edd0ed421a466fd6ae732c2d82d8.tar.gz
kamek-53116b7ae344edd0ed421a466fd6ae732c2d82d8.zip
Lots of world map path rendering and movement implementations and fixes.
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r--src/koopatlas/pathmanager.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index 8e0edac..cfdf2b7 100644
--- a/src/koopatlas/pathmanager.cpp
+++ b/src/koopatlas/pathmanager.cpp
@@ -67,6 +67,7 @@ void dWMPathManager_c::setup() {
for (int i = 0; i < pathLayer->pathCount; i++) {
dKPPath_s *path = pathLayer->paths[i];
+ OSReport("Path unlocked by %d-%d, unlock type %d, is available %d", path->unlockLevelNumber[0], path->unlockLevelNumber[1], path->unlockType, path->isAvailable);
if (path->unlockType > 0) {
u32 conds = save->GetLevelCondition(path->unlockLevelNumber[0] - 1, path->unlockLevelNumber[1] - 1);
@@ -74,6 +75,8 @@ void dWMPathManager_c::setup() {
path->isAvailable = true;
else if (path->unlockType == 2 && (conds & COND_SECRET))
path->isAvailable = true;
+ else
+ path->isAvailable = false;
}
}
SpammyReport("done\n");
@@ -105,6 +108,8 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
dWMHud_c::instance->hidePointBar();
SpammyReport("point bar hidden\n");
+ if (!path->isAvailable) { return; }
+
SpammyReport("a\n");
isMoving = true;
reverseThroughPath = (path->end == currentNode);
@@ -141,6 +146,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->rot.y = direction;
player->hasSound = false;
player->hasEffect = false;
+ moveSpeed = 3.0f;
switch (path->animation) {
@@ -177,22 +183,26 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->startAnimation(jump, 1.0, 1.0, 0.0);
MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1);
isJumping = true;
+ moveSpeed = 2.5f;
break;
case 5:
player->startAnimation(jump, 1.0, 10.0, 0.0);
MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1);
isJumping = true;
+ moveSpeed = 2.5f;
break;
case 6:
player->startAnimation(jump, 1.0, 10.0, 0.0);
MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1);
isJumping = true;
+ moveSpeed = 2.5f;
break;
case 7:
player->startAnimation(jump, 1.0, 10.0, 0.0);
MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1);
isJumping = true;
SpawnEffect("Wm_mr_waterwave_out", 0, &player->pos, 0, &player->scale);
+ moveSpeed = 2.0f;
break;
// Climbing
@@ -201,18 +211,21 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->rot.y = 0x8000;
player->hasSound = true;
player->soundName = SE_PLY_FOOTNOTE_CS_ROCK_CLIMB;
+ moveSpeed = 1.5f;
break;
case 9:
player->startAnimation(tree_climb, 1.2, 10.0, 0.0);
player->rot.y = 0xC000;
player->hasSound = true;
player->soundName = SE_PLY_FOOTNOTE_CS_ROCK_CLIMB;
+ moveSpeed = 1.5f;
break;
case 10:
player->startAnimation(tree_climb, 1.2, 10.0, 0.0);
player->rot.y = 0x4000;
player->hasSound = true;
player->soundName = SE_PLY_FOOTNOTE_CS_ROCK_CLIMB;
+ moveSpeed = 1.5f;
break;
// Others
@@ -222,6 +235,7 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->hasEffect = true;
player->soundName = SE_PLY_SWIM;
player->effectName = "Wm_mr_waterswim";
+ moveSpeed = 2.0f;
break;
case 13:
player->startAnimation(Tjumped, 2.0, 0.0, 0.0);
@@ -230,16 +244,19 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
player->startAnimation(b_dash2, 3.0, 10.0, 0.0);
player->hasSound = true;
player->soundName = SE_PLY_FOOTNOTE_DIRT;
+ moveSpeed = 5.0f;
break;
case 15:
player->startAnimation(wait, 2.0, 10.0, 0.0);
player->rot.y = 0x0000;
MapSoundPlayer(SoundRelatedClass, SE_PLY_DOKAN_IN_OUT, 1);
+ moveSpeed = 1.0f;
break;
case 16:
player->startAnimation(wait, 2.0, 10.0, 0.0);
player->rot.y = 0x8000;
MapSoundPlayer(SoundRelatedClass, SE_OBJ_DOOR_OPEN, 1);
+ moveSpeed = 0.2f;
break;
default:
OSReport("No animtaion?!");
@@ -260,7 +277,7 @@ void dWMPathManager_c::moveThroughPath() {
Vec move = (Vec){to->x - from->x, to->y - from->y, 0};
VECNormalize(&move, &move);
- VECScale(&move, &move, 3.0f);
+ VECScale(&move, &move, moveSpeed);
daWMPlayer_c *player = daWMPlayer_c::instance;
@@ -270,8 +287,10 @@ void dWMPathManager_c::moveThroughPath() {
float midpoint = (from->y + to->y) / 2;
float top, len;
- if (ys > ye) { len = ys - ye; top = ys - midpoint + 4.0; }
- else { len = ye - ys; top = ye - midpoint + 4.0; }
+ if (ys > ye) { len = ys - ye; top = ys - midpoint + 10.0; }
+ else { len = ye - ys; top = ye - midpoint + 10.0; }
+
+ if (len == 0.0) { len = 2.0; }
float a;
if (timer > 0.0) { a = -timer; }