diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-07-20 15:10:14 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-07-20 15:10:14 -0500 |
commit | 2d39f19d92673bb9a8f12a71bbd6d86dd2166237 (patch) | |
tree | ae0c64dd5329b42564c00ecb990b956467addea0 /src/koopatlas/pathmanager.cpp | |
parent | 7db25a9cb78f98d57fa0e386eb4a14c2842d52e7 (diff) | |
download | kamek-2d39f19d92673bb9a8f12a71bbd6d86dd2166237.tar.gz kamek-2d39f19d92673bb9a8f12a71bbd6d86dd2166237.zip |
Bugfix to the hud, added in player animations for path movement
Diffstat (limited to 'src/koopatlas/pathmanager.cpp')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 155 |
1 files changed, 152 insertions, 3 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 632edfa..6cf0750 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -2,6 +2,7 @@ #include "koopatlas/core.h" #include "koopatlas/hud.h" #include "koopatlas/player.h" +#include <sfx.h> void dWMPathManager_c::setup() { isMoving = false; @@ -125,9 +126,142 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) { SpammyReport("f\n"); daWMPlayer_c *player = daWMPlayer_c::instance; SpammyReport("g %p\n", player); - player->startAnimation(2, 2.0, 10.0, 0.0); + // path->speed + + // wait = 0, + // walk = 1, + // run = 2, + // b_dash2 = 4, + + // jump = 5, + // 2jmp_c_2 = 9, + // 2jumped = 10, + + // tree_climb = 45, + + // swim_wait + // swim_walk = 38, + + // wall_walk_l = 60, + // wall_walk_r = 61, + + // hang_walk_l = 65, + // hang_walk_r = 66, + + // wait, door_walk SpammyReport("h\n"); player->rot.y = direction; + player->hasSound = false; + player->hasEffect = false; + + switch (path->animation) { + + // Running + case 0: + player->startAnimation(run, 2.0, 10.0, 0.0); + player->hasSound = true; + player->soundName = SE_PLY_FOOTNOTE_DIRT; + break; + case 1: + player->startAnimation(run, 2.0, 10.0, 0.0); + player->hasSound = true; + player->hasEffect = true; + player->soundName = SE_PLY_FOOTNOTE_CS_SAND; + player->effectName = "Wm_mr_foot_sand"; + break; + case 2: + player->startAnimation(run, 2.0, 10.0, 0.0); + player->hasSound = true; + player->hasEffect = true; + player->soundName = SE_PLY_FOOTNOTE_CS_SNOW; + player->effectName = "Wm_mr_foot_snow"; + break; + case 3: + player->startAnimation(run, 2.0, 10.0, 0.0); + player->hasSound = true; + player->hasEffect = true; + player->soundName = SE_PLY_FOOTNOTE_CS_WATER; + player->effectName = "Wm_mr_foot_water"; + break; + + // Jumping + case 4: + player->startAnimation(jump, 1.0, 1.0, 0.0); + MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1); + break; + case 5: + player->startAnimation(jump, 1.0, 10.0, 0.0); + MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1); + break; + case 6: + player->startAnimation(jump, 1.0, 10.0, 0.0); + MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1); + break; + case 7: + player->startAnimation(jump, 1.0, 10.0, 0.0); + MapSoundPlayer(SoundRelatedClass, SE_PLY_JUMP, 1); + SpawnEffect("Wm_mr_waterwave_out", 0, &player->pos, 0, &player->scale); + break; + + // Climbing + case 8: + player->startAnimation(pea_plant, 1.2, 10.0, 0.0); + player->rot.y = 0x8000; + player->hasSound = true; + player->soundName = SE_PLY_FOOTNOTE_CS_ROCK_CLIMB; + 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; + 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; + break; + + // Others + case 12: + OSReport("Swimming"); + player->startAnimation(swim_wait, 1.2, 10.0, 0.0); + player->hasSound = true; + player->hasEffect = true; + player->soundName = SE_PLY_SWIM; + player->effectName = "Wm_mr_waterswim"; + break; + case 13: + OSReport("Falling"); + player->startAnimation(Tjumped, 2.0, 0.0, 0.0); + break; + case 14: + OSReport("Dashing"); + player->startAnimation(b_dash2, 3.0, 10.0, 0.0); + player->hasSound = true; + player->soundName = SE_PLY_FOOTNOTE_DIRT; + break; + case 15: + OSReport("Piping"); + player->startAnimation(wait, 2.0, 10.0, 0.0); + player->rot.y = 0x0000; + MapSoundPlayer(SoundRelatedClass, SE_PLY_DOKAN_IN_OUT, 1); + break; + case 16: + OSReport("Dooring"); + player->startAnimation(wait, 2.0, 10.0, 0.0); + player->rot.y = 0x8000; + MapSoundPlayer(SoundRelatedClass, SE_OBJ_DOOR_OPEN, 1); + break; + default: + OSReport("No animtaion?!"); + player->startAnimation(run, 2.0, 10.0, 0.0); + player->hasSound = true; + player->soundName = SE_PLY_FOOTNOTE_DIRT; + break; + } + SpammyReport("i\n"); } @@ -172,6 +306,8 @@ void dWMPathManager_c::moveThroughPath() { } else if (to->type != dKPNode_s::PASS_THROUGH) { // Stop here player->startAnimation(0, 1.2, 10.0, 0.0); + player->hasEffect = false; + player->hasSound = false; SpammyReport("stopping here\n"); @@ -191,10 +327,23 @@ void dWMPathManager_c::moveThroughPath() { void dWMPathManager_c::activatePoint() { if (currentNode->type == dKPNode_s::LEVEL) { - daWMPlayer_c::instance->startAnimation(170, 1.2, 10.0, 0.0); - int w = currentNode->levelNumber[0] - 1; int l = currentNode->levelNumber[1] - 1; + + if ((l > 29) && (l < 38)) { + SaveBlock *save = GetSaveFile()->GetBlock(-1); + u32 conds = save->GetLevelCondition(w, l); + + SpammyReport("Toad House Flags: %x", conds); + if (conds & 0xFF0) { + + MapSoundPlayer(SoundRelatedClass, SE_SYS_INVALID, 1); + return; } + } + + MapSoundPlayer(SoundRelatedClass, SE_SYS_GAME_START, 1); + daWMPlayer_c::instance->startAnimation(170, 1.2, 10.0, 0.0); + dLevelInfo_c::entry_s *level = dScKoopatlas_c::instance->levelInfo.search(w, l); dScKoopatlas_c::instance->startLevel(level); } |