From dd90d6a3cbd0288a1138122106b9f4f819f5bbba Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 28 Oct 2012 13:19:01 +0100 Subject: added the on-death anim/sound --- src/koopatlas/pathmanager.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/koopatlas/pathmanager.cpp') diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 5d301df..bb610e3 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -3,6 +3,7 @@ #include "koopatlas/hud.h" #include "koopatlas/player.h" #include +#include extern "C" void PlaySoundWithFunctionB4(void *spc, nw4r::snd::SoundHandle *handle, int id, int unk); @@ -27,6 +28,19 @@ void dWMPathManager_c::setup() { isEnteringLevel = false; levelStartWait = -1; unlockPaths(); + + if (!countdownToFadeIn) + waitAtStart = 50; + else + waitAtStart = -1; + + waitForAfterDeathAnim = -1; + mustPlayAfterDeathAnim = false; + if (LastPowerupStoreType == LOSE_LEVEL) { + mustPlayAfterDeathAnim = true; + daWMPlayer_c::instance->visible = false; + } + SpammyReport("done\n"); // Figure out what path node to start at @@ -383,6 +397,28 @@ void dWMPathManager_c::execute() { return; } + if (waitAtStart > 0) { + waitAtStart--; + if (waitAtStart == 0) { + if (mustPlayAfterDeathAnim) { + daWMPlayer_c::instance->visible = true; + daWMPlayer_c::instance->startAnimation(ending_wait, 1.0f, 0.0f, 0.0f); + waitForAfterDeathAnim = 60; + + nw4r::snd::SoundHandle something; + PlaySoundWithFunctionB4(SoundRelatedClass, &something, SE_VOC_MA_CS_COURSE_MISS, 1); + } + } + return; + } + + if (waitForAfterDeathAnim > 0) { + waitForAfterDeathAnim--; + if (waitForAfterDeathAnim == 0) + daWMPlayer_c::instance->startAnimation(wait_select, 1.0f, 0.0f, 0.0f); + return; + } + if (shouldRequestSave) { dScKoopatlas_c::instance->showSaveWindow(); shouldRequestSave = false; @@ -771,7 +807,7 @@ void dWMPathManager_c::activatePoint() { nw4r::snd::SoundHandle something2; PlaySoundWithFunctionB4(SoundRelatedClass, &something2, (Player_Powerup[0] == 3) ? SE_VOC_MA_PLAYER_DECIDE_MAME: SE_VOC_MA_CS_COURSE_IN, 1); - daWMPlayer_c::instance->startAnimation(170, 1.2, 10.0, 0.0); + daWMPlayer_c::instance->startAnimation(course_in, 1.2, 10.0, 0.0); daWMPlayer_c::instance->rot.y = 0; isEnteringLevel = true; -- cgit v1.2.3