From e5462f415f08636b3091f5db282b4cf872ba9d75 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 20 Dec 2013 11:29:23 +0200 Subject: FULLPIPE: Implement sceneHandler08() --- engines/fullpipe/constants.h | 11 ++ engines/fullpipe/scenes.cpp | 1 + engines/fullpipe/scenes.h | 1 + engines/fullpipe/scenes/scene08.cpp | 201 ++++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+) diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 1e145855b9..984e024a26 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -139,11 +139,18 @@ namespace Fullpipe { #define MSG_SC7_OPENLUKE 823 #define MSG_SC7_PULL 2943 #define MSG_SC7_SHOWBOX 816 +#define MSG_SC8_ARCADENOW 1044 +#define MSG_SC8_ENTERUP 3037 +#define MSG_SC8_GETHIMUP 789 +#define MSG_SC8_HIDELADDER_D 1107 +#define MSG_SC8_RESUMEFLIGHT 784 +#define MSG_SC8_STANDUP 2976 #define MSG_GOTOLADDER 618 #define MSG_SHAKEBOTTLE 584 #define MSG_SHOOTKOZAW 557 #define MSG_SHOWCOIN 1033 #define MSG_SPINHANDLE 2398 +#define MSG_STARTARCADE 781 #define MSG_STARTHAND 612 #define MSG_TAKEBOTTLE 614 #define MSG_TAKEKOZAW 611 @@ -170,6 +177,7 @@ namespace Fullpipe { #define MV_KZW_STANDUP 563 #define MV_KZW_TURN 562 #define MV_MAN_FROMLADDER 493 +#define MV_MAN_FROMLADDERUP 1522 #define MV_MAN_GOD 481 #define MV_MAN_GOLADDER 451 #define MV_MAN_GOLADDER2 2844 @@ -185,6 +193,7 @@ namespace Fullpipe { #define MV_MAN_STOPLADDER 454 #define MV_MAN_STOPLADDER2 2845 #define MV_MAN_TOLADDER 448 +#define MV_MAN_TOLADDERD 1524 #define MV_MAN_TOLADDER2 2841 #define MV_MAN_TURN_LU 486 #define MV_MAN_TURN_SUD 1089 @@ -365,6 +374,7 @@ namespace Fullpipe { #define SND_4_012 3127 #define SND_4_033 4990 #define SND_5_026 5316 +#define SND_8_014 3624 #define SND_CMN_031 3516 #define SND_CMN_070 5199 #define SND_INTR_019 5220 @@ -436,6 +446,7 @@ namespace Fullpipe { #define ST_PNK_WEIGHTLEFT 503 #define ST_PNK_WEIGHTRIGHT 504 #define ST_SPR_UP 544 +#define ST_VMT_MIN 766 #define TrubaDown 697 #define TrubaLeft 474 #define TrubaRight 696 diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 6e59ade06c..a701b5b206 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -153,6 +153,7 @@ Vars::Vars() { scene08_var05 = 0; scene08_var06 = 0; scene08_var07 = 0; + scene08_var08 = 0; selector = 0; } diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 11b0170d59..f671ed9799 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -194,6 +194,7 @@ public: int scene08_var05; int scene08_var06; int scene08_var07; + int scene08_var08; PictureObject *selector; }; diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp index 9b71b543cb..c8a64a2410 100644 --- a/engines/fullpipe/scenes/scene08.cpp +++ b/engines/fullpipe/scenes/scene08.cpp @@ -31,6 +31,7 @@ #include "fullpipe/floaters.h" #include "fullpipe/motion.h" #include "fullpipe/gameloader.h" +#include "fullpipe/behavior.h" namespace Fullpipe { @@ -100,4 +101,204 @@ void scene08_initScene(Scene *sc) { g_fullpipe->setArcadeOverlay(PIC_CSR_ARCADE3); } +void sceneHandler08_winArcade() { + warning("STUB: sceneHandler08_winArcade()"); +} + +void sceneHandler08_enterUp() { + warning("STUB: sceneHandler08_enterUp()"); +} + +void sceneHandler08_hideLadder() { + warning("STUB: sceneHandler08_hideLadder()"); +} + +void sceneHandler08_arcadeNow() { + warning("STUB: sceneHandler08_arcadeNow()"); +} + +void sceneHandler08_resumeFlight() { + warning("STUB: sceneHandler08_resumeFlight()"); +} + +void sceneHandler08_startArcade() { + warning("STUB: sceneHandler08_startArcade()"); +} + +void sceneHandler08_airMoves() { + warning("STUB: sceneHandler08_airMoves()"); +} + +void sceneHandler08_jumpLogic(ExCommand *cmd) { + warning("STUB: sceneHandler08_jumpLogic(cmd)"); +} + +void sceneHandler08_calcFlight() { + warning("STUB: sceneHandler08_calcFlight()"); +} + +void sceneHandler08_checkEndArcade() { + warning("STUB: sceneHandler08_checkEndArcade()"); +} + +void sceneHandler08_badLuck() { + warning("STUB: sceneHandler08_badLuck()"); +} + +void sceneHandler08_calcOffset() { + warning("STUB: sceneHandler08_calcOffset()"); +} + +void sceneHandler08_finishArcade() { + warning("STUB: sceneHandler08_finishArcade()"); +} + +void sceneHandler08_jumpOff() { + warning("STUB: sceneHandler08_jumpOff()"); +} + +void sceneHandler08_pushCallback(int *par) { + warning("STUB: sceneHandler08_pushCallback()"); +} + +void sceneHandler08_sitDown() { + warning("STUB: sceneHandler08_sitDown()"); +} + +void sceneHandler08_standUp() { + warning("STUB: sceneHandler08_standUp()"); +} + +void sceneHandler08_updateScreenCallback() { + warning("STUB: sceneHandler08_updateScreenCallback()"); +} + +int sceneHandler08(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + switch (cmd->_messageNum) { + case MSG_CMN_WINARCADE: + sceneHandler08_winArcade(); + break; + + case MSG_SC8_ENTERUP: + sceneHandler08_enterUp(); + break; + + case MSG_SC8_HIDELADDER_D: + sceneHandler08_hideLadder(); + break; + + case MSG_SC8_STANDUP: + g_vars->scene08_var08 = -10; + g_vars->scene08_vmyats->changeStatics2(ST_VMT_MIN); + g_vars->scene08_vmyats->setOXY(382, 703); + g_vars->scene08_vmyats->_priority = 29; + g_vars->scene08_vmyats->_callback2 = sceneHandler08_pushCallback; + g_vars->scene08_var01 = 1; + break; + + case MSG_SC8_ARCADENOW: + sceneHandler08_arcadeNow(); + break; + + case MSG_SC8_RESUMEFLIGHT: + sceneHandler08_resumeFlight(); + break; + + case MSG_SC8_GETHIMUP: + g_vars->scene08_var08 = 0; + g_vars->scene08_var02 = 1; + break; + + case MSG_STARTARCADE: + sceneHandler08_startArcade(); + break; + + case 29: + if (g_vars->scene08_var06) { + if (g_vars->scene08_var01) { + sceneHandler08_airMoves(); + break; + } + if (g_vars->scene08_var03) { + sceneHandler08_jumpLogic(cmd); + break; + } + } + break; + + case 33: + { + int res = 0; + + if (g_fullpipe->_aniMan2) { + if (g_vars->scene08_var06) { + int scHeight = g_fullpipe->_sceneRect.bottom - g_fullpipe->_sceneRect.top; + + if (g_fullpipe->_aniMan2->_oy < g_fullpipe->_sceneRect.top + 200) { + g_fullpipe->_sceneRect.top = g_fullpipe->_aniMan2->_oy - 200; + + if (g_fullpipe->_sceneRect.top < 0) + g_fullpipe->_sceneRect.top = 0; + + g_fullpipe->_sceneRect.bottom = scHeight + g_fullpipe->_sceneRect.top; + } + + if (g_fullpipe->_aniMan2->_oy > g_fullpipe->_sceneRect.bottom - 350) { + g_fullpipe->_sceneRect.bottom = g_fullpipe->_aniMan2->_oy + 350; + g_fullpipe->_sceneRect.top = g_fullpipe->_aniMan2->_oy + 350 - scHeight; + } + } else { + if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200) + g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300; + + if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200) + g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300; + + res = 1; + } + } + + g_fullpipe->_floaters->update(); + + if (g_vars->scene08_var06) { + if (g_vars->scene08_var01) + sceneHandler08_calcFlight(); + } else { + Movement *mov = g_fullpipe->_aniMan->_movement; + + if (mov) { + if (mov->_id == MV_MAN_TOLADDERD && mov->_currDynamicPhaseIndex == 8) + g_fullpipe->_aniMan->_priority = 2; + + if (mov && mov->_id == MV_MAN_FROMLADDERUP && mov->_currDynamicPhaseIndex == 13) + g_fullpipe->_aniMan->_priority = 20; + } + + g_fullpipe->_behaviorManager->updateBehaviors(); + g_fullpipe->startSceneTrack(); + } + + if (g_vars->scene08_var02) + sceneHandler08_checkEndArcade(); + + if (g_vars->scene08_var05 > 0) { + g_vars->scene08_var05--; + + if (!g_vars->scene08_var05) { + g_fullpipe->playSound(SND_8_014, 0); + + g_vars->scene08_var05 = 71; + } + } + + return res; + } + } + + return 0; +} + } // End of namespace Fullpipe -- cgit v1.2.3