diff options
Diffstat (limited to 'src/koopatlas')
-rw-r--r-- | src/koopatlas/mapdata.cpp | 2 | ||||
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 16 | ||||
-rw-r--r-- | src/koopatlas/player.cpp | 2 | ||||
-rw-r--r-- | src/koopatlas/shop.cpp | 36 | ||||
-rw-r--r-- | src/koopatlas/shop.h | 3 |
5 files changed, 42 insertions, 17 deletions
diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp index d4f9d0c..d766bed 100644 --- a/src/koopatlas/mapdata.cpp +++ b/src/koopatlas/mapdata.cpp @@ -71,7 +71,7 @@ void dKPNode_s::setupNodeExtra() { } // Is it a shop? - else if (level == 41) + else if (level == 99) colour = "g3d/shop.brres"; // Is it complete? diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 6134dc6..8a05ea4 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -352,6 +352,12 @@ void dWMPathManager_c::execute() { activatePoint(); if (pressedDir >= 0) { + static u16 xangles[] = {-0,0,0x1800,-0x1800}; + daWMPlayer_c::instance->rot.x = xangles[pressedDir]; + + static u16 zangles[] = {-0x1800,0x1800,0,0}; + daWMPlayer_c::instance->rot.z = zangles[pressedDir]; + if (canUseExit(currentNode->exits[pressedDir])) { startMovementTo(currentNode->exits[pressedDir]); } else { @@ -473,6 +479,12 @@ void dWMPathManager_c::startMovementTo(dKPPath_s *path) { player->startAnimation(Animations[id].anim, Animations[id].animParam1, Animations[id].animParam2, 0.0f); player->rot.y = (Animations[id].forceRotation != -1) ? Animations[id].forceRotation : direction; + + OSReport("Rot.y = %08x", player->rot.y); + player->rot.x = (player->rot.y < 0) ? -((player->rot.y + 0x4000) * 0x1800 / 0x8000 * 2) : (player->rot.y - 0x4000) * 0x1800 / 0x8000 * 2; + player->rot.z = (player->rot.y < 0) ? -((player->rot.y + 0x8000) * 0x1800 / 0x8000 * 2) : (player->rot.y ) * 0x1800 / 0x8000 * 2; + + moveSpeed = (Animations[id].forceSpeed >= 0.0f) ? Animations[id].forceSpeed : 3.0f; if (Animations[id].repeatEffect) { @@ -673,7 +685,7 @@ void dWMPathManager_c::activatePoint() { int w = currentNode->levelNumber[0] - 1; int l = currentNode->levelNumber[1] - 1; - if (l == 40) { + if (l == 98) { dWMShop_c::instance->LoadShopForWorld(w); dScKoopatlas_c::instance->state.setState(&dScKoopatlas_c::instance->StateID_ShopWait); return; @@ -693,6 +705,8 @@ void dWMPathManager_c::activatePoint() { MapSoundPlayer(SoundRelatedClass, SE_SYS_GAME_START, 1); daWMPlayer_c::instance->startAnimation(170, 1.2, 10.0, 0.0); daWMPlayer_c::instance->rot.y = 0; + daWMPlayer_c::instance->rot.x = -0x1800; + daWMPlayer_c::instance->rot.z = 0; isEnteringLevel = true; levelStartWait = 40; diff --git a/src/koopatlas/player.cpp b/src/koopatlas/player.cpp index 3f791b6..97b4d8d 100644 --- a/src/koopatlas/player.cpp +++ b/src/koopatlas/player.cpp @@ -14,7 +14,7 @@ int daWMPlayer_c::onCreate() { hammerSuit.setup(this->modelHandler); pos = (Vec){0.0f,0.0f,3000.0f}; - rot = (S16Vec){0,0,0}; + rot = (S16Vec){-0x1800,0,0}; scale = (Vec){1.6f,1.6f,1.6f}; current_param = 0; diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index 29a96b0..cd20ddb 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -118,6 +118,7 @@ int dWMShop_c::onCreate() { return false; currentItem = 0; + wasOff = false; static const char *brlanNames[5] = {"shop_hitButton.brlan", "shop_offButton.brlan", "shop_onButton.brlan", "shop_inWindow.brlan", "shop_outWindow.brlan"}; static const char *groupNames[20] = {"B00_Button", "B01_Button", "B02_Button", "B03_Button", "B05_Button", "B08_Button", @@ -222,20 +223,23 @@ int dWMShop_c::onDraw() { } void dWMShop_c::specialDraw1() { - if (!isHidden) { - // Vec pos = {250.0f, 170.0f, -1000.0f}; - // S16Vec rot = {0,0,0}; - // Vec scale = {1.0f, 1.0f, 1.0f}; - // matrix.translation(pos.x, pos.y, pos.z); - // matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z); - - // shopkeep.setDrawMatrix(matrix); - // shopkeep.setScale(&scale); - // shopkeep.calcWorld(false); - // shopkeep.scheduleForDrawing(); - - // if(this->ska.isAnimationDone()) - // this->ska.setCurrentFrame(0.0); + if (!isHidden && !layout.isAnimOn(18) && !layout.isAnimOn(19)) { + + Vec pos = {250.0f, 170.0f, 1000.0f}; + S16Vec rot = {0,0,0}; + Vec scale = {1.0f, 1.0f, 1.0f}; + matrix.translation(pos.x, pos.y, pos.z); + matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z); + + shopkeep.setDrawMatrix(matrix); + shopkeep.setScale(&scale); + shopkeep.calcWorld(false); + shopkeep.scheduleForDrawing(); + + if (wasOff) { effect.spawn("Wm_ob_greencoinkira", 0, &pos, &rot, &scale); wasOff = false; } + + if(this->ska.isAnimationDone()) + this->ska.setCurrentFrame(0.0); } return; } @@ -282,6 +286,8 @@ void dWMShop_c::LoadShopForWorld(int world) { if (!isHidden) { return; } + wasOff = true; + // Handle showing it MapSoundPlayer(SoundRelatedClass, SE_SYS_DIALOGUE_IN, 1); isHidden = false; @@ -328,6 +334,8 @@ void dWMShop_c::CloseUpShop() { changeItem(currentItem, 0); currentItem = 0; + effect.spawn("Wm_ob_greencoinkira", 0, &pos, &rot, &scale); + // itemA->Delete(); // itemB->Delete(); // itemC->Delete(); diff --git a/src/koopatlas/shop.h b/src/koopatlas/shop.h index eca02d1..cf78b36 100644 --- a/src/koopatlas/shop.h +++ b/src/koopatlas/shop.h @@ -27,8 +27,11 @@ class dWMShop_c : public dActor_c { m3d::anmChr_c ska; mMtx matrix; + mEf::es2 effect; + char currentItem; bool isHidden; + bool wasOff; int world; dShopItem *itemA; |