summaryrefslogtreecommitdiff
path: root/src/koopatlas/pathmanager.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-03-03 02:55:19 +0100
committerTreeki <treeki@gmail.com>2013-03-03 02:55:19 +0100
commit314c9015a11d18fa34fc4f91c9830e03a245ce86 (patch)
tree78e63ca9b35bdf1756c6cbbe094d21b9a9e5949f /src/koopatlas/pathmanager.cpp
parent1821ee168a7df344e236cf0af1c55569b1e75976 (diff)
downloadkamek-314c9015a11d18fa34fc4f91c9830e03a245ce86.tar.gz
kamek-314c9015a11d18fa34fc4f91c9830e03a245ce86.zip
add launch stars
Diffstat (limited to '')
-rw-r--r--src/koopatlas/pathmanager.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp
index d55ad12..00e1bef 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 "koopatlas/map.h"
#include <sfx.h>
#include <stage.h>
@@ -821,7 +822,7 @@ void dWMPathManager_c::execute() {
} else {
// TODO: maybe remove this? got to see how it looks
static u16 directions[] = {-0x4000,0x4000,-0x7FFF,0};
- daWMPlayer_c::instance->rot.y = directions[pressedDir];
+ daWMPlayer_c::instance->setTargetRotY(directions[pressedDir]);
}
} else if (nowPressed & WPAD_TWO) {
activatePoint();
@@ -881,7 +882,9 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
{jump,1.0f,1.0f, -1,2.5f, SE_NULL,SE_PLY_JUMP, 0,0},
{jump,1.0f,10.0f, -1,2.5f, SE_NULL,SE_PLY_JUMP, 0,0},
{jump,1.0f,10.0f, -1,2.5f, SE_NULL,SE_PLY_JUMP, 0,0},
- {jump,1.0f,10.0f, -1,2.5f, SE_NULL,SE_PLY_JUMP, 0,"Wm_mr_waterwave_out"},
+
+ // Jump water (actually cannon)
+ {dm_notice,1.0f,10.0f, -1,-1.0f, SE_NULL,SE_VOC_MA_CANNON_SHOT, 0,0},
// Ladder up, left, right
{pea_plant,1.2f,10.0f, -0x7FFF,1.5f, SE_PLY_FOOTNOTE_CS_ROCK_CLIMB,SE_NULL, 0,0},
@@ -904,13 +907,15 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
// Enter cave, this is handled specially
{run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
- {run,1.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
+
+ // Cannon 2
+ {dm_noti_wait,1.0f,10.0f, -1,-1.0f, SE_NULL,SE_VOC_MA_CANNON_SHOT, 0,0},
// Invisible, this is handled specially
{wait,2.0f,10.0f, -1,1.0f, SE_NULL,SE_NULL, 0,0},
};
- isJumping = (path->animation >= dKPPath_s::JUMP && path->animation <= dKPPath_s::JUMP_WATER);
+ isJumping = (path->animation >= dKPPath_s::JUMP && path->animation <= dKPPath_s::JUMP_SAND);
float playerScale = 1.6f;
@@ -938,16 +943,25 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) {
whichAnim = P_slip;
}
- player->startAnimation(whichAnim, updateRate, Animations[id].animParam2, 0.0f);
-
if (Animations[id].forceRotation != -1) {
forcedRotation = true;
- player->rot.y = Animations[id].forceRotation;
+ player->setTargetRotY(Animations[id].forceRotation);
+ } else if (id == dKPPath_s::JUMP_WATER || id == dKPPath_s::RESERVED_18) {
+ // keep the current rotation
+ forcedRotation = true;
+ PlayerAnimStates[dm_notice].playsOnce = 0;
+
+ nw4r::snd::SoundHandle something;
+ PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_OBJ_WARP_CANNON_SHOT, 1);
+
+ dWMMap_c::instance->spinLaunchStar();
} else {
forcedRotation = false;
- player->rot.y = direction;
+ player->setTargetRotY(direction);
}
+ player->startAnimation(whichAnim, updateRate, Animations[id].animParam2, 0.0f);
+
moveSpeed = (Animations[id].forceSpeed >= 0.0f) ? Animations[id].forceSpeed : 3.0f;
moveSpeed = path->speed * moveSpeed;
if (path->animation == dKPPath_s::SWIM) {
@@ -1051,7 +1065,7 @@ void dWMPathManager_c::moveThroughPath(int pressedDir) {
if (allowed) {
reverseThroughPath = !reverseThroughPath;
if (!forcedRotation)
- player->rot.y += 0x8000;
+ player->setTargetRotY(player->targetRotY + 0x8000);
// start over with the reversed path!
moveThroughPath(-1);
return;
@@ -1332,7 +1346,7 @@ void dWMPathManager_c::activatePoint() {
PlaySoundWithFunctionB4(SoundRelatedClass, &something2, (Player_Powerup[0] == 3) ? SE_VOC_MA_PLAYER_DECIDE_MAME: SE_VOC_MA_CS_COURSE_IN, 1);
daWMPlayer_c::instance->startAnimation(course_in, 1.2, 10.0, 0.0);
- daWMPlayer_c::instance->rot.y = 0;
+ daWMPlayer_c::instance->setTargetRotY(0);
isEnteringLevel = true;
levelStartWait = 40;