diff options
author | Eugene Sandulenko | 2013-12-22 12:34:49 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-12-22 12:34:49 +0200 |
commit | badfd14f74166d614d1413d2ab26458ea262803c (patch) | |
tree | 44b7226de59502e24bc24f6032d914e6c2b5f127 | |
parent | 0d1876ef2e243b62b4754940b46a9a1096fbc298 (diff) | |
download | scummvm-rg350-badfd14f74166d614d1413d2ab26458ea262803c.tar.gz scummvm-rg350-badfd14f74166d614d1413d2ab26458ea262803c.tar.bz2 scummvm-rg350-badfd14f74166d614d1413d2ab26458ea262803c.zip |
FULPIPE: Implement sceneHandler08_calcFlight()
-rw-r--r-- | engines/fullpipe/constants.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene08.cpp | 114 |
2 files changed, 83 insertions, 35 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 6e68f97455..115b867efd 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -209,6 +209,8 @@ namespace Fullpipe { #define MV_MAN6_TAKEBALL 2691 #define MV_MAN6_THROWBALL 2692 #define MV_MAN8_BADLUCK 783 +#define MV_MAN8_HANDSDOWN 772 +#define MV_MAN8_HANDSUP 777 #define MV_MAN8_JUMPOFF 2969 #define MV_MAN8_SITDOWN 2968 #define MV_MANHDL_HANDLEDOWN 630 @@ -233,6 +235,7 @@ namespace Fullpipe { #define MV_SC7_BOX_default 792 #define MV_SPK4_PLAY 3276 #define MV_SPR_LOWER 543 +#define MV_VMT_DEF 765 #define PIC_CMN_EVAL 3468 #define PIC_CSR_DEFAULT 4891 #define PIC_CSR_DEFAULT_INV 4892 @@ -456,6 +459,7 @@ namespace Fullpipe { #define ST_MAN_UP 449 #define ST_MAN6_BALL 2688 #define ST_MAN8_FLYDOWN 771 +#define ST_MAN8_FLYUP 769 #define ST_MAN8_HANDSUP 773 #define ST_MOM_SITS 659 #define ST_MOM_STANDS 658 diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp index 763e6f7582..181ac58392 100644 --- a/engines/fullpipe/scenes/scene08.cpp +++ b/engines/fullpipe/scenes/scene08.cpp @@ -218,33 +218,6 @@ void sceneHandler08_jumpLogic(ExCommand *cmd) { } } -void sceneHandler08_calcFlight() { - warning("STUB: sceneHandler08_calcFlight()"); -} - -void sceneHandler08_checkEndArcade() { - if (g_vars->scene08_var02) { - int x = g_fp->_aniMan->_ox; - int y = g_vars->scene08_var08 + g_fp->_aniMan->_oy; - - if (!((g_vars->scene08_var08 + g_fp->_aniMan->_oy) % 3)) - g_vars->scene08_var08--; - - g_fp->_aniMan->setOXY(x, y); - - if (y < 80) { - sceneHandler08_finishArcade(); - - ExCommand *ex = new ExCommand(SC_8, 17, 0, 0, 0, 0, 1, 0, 0, 0); - ex->_messageNum = 61; - ex->_excFlags |= 2; - ex->_keyCode = TrubaUp; - - ex->postMessage(); - } - } -} - void sceneHandler08_badLuck() { g_fp->_currentScene->getPictureObjectById(PIC_SC8_LADDER, 0)->_flags &= 0xFFFB; @@ -267,14 +240,6 @@ void sceneHandler08_badLuck() { g_vars->scene08_var01 = 0; } -void sceneHandler08_calcOffset() { - warning("STUB: sceneHandler08_calcOffset()"); -} - -void sceneHandler08_pushCallback(int *par) { - warning("STUB: sceneHandler08_pushCallback()"); -} - void sceneHandler08_sitDown() { g_fp->_aniMan->setOXY(380, g_fp->_aniMan->_oy); @@ -288,6 +253,85 @@ void sceneHandler08_sitDown() { g_vars->scene08_var03 = 1; } +void sceneHandler08_calcFlight() { + Common::Point point; + int y = g_vars->scene08_var08 + g_fp->_aniMan->_oy; + + g_fp->_aniMan->setOXY(g_fp->_aniMan->_ox, y); + + g_vars->scene08_var08 += 2; + + if (g_vars->scene08_var08 < g_vars->scene08_var04) + g_vars->scene08_var08 = g_vars->scene08_var04; + + y = y + g_fp->_aniMan->getSomeXY(point)->y; + + if (g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) + y -= 25; + + if (y <= g_vars->scene08_vmyats->_oy) { + g_vars->scene08_vmyats->hide(); + } else { + g_vars->scene08_vmyats->show1(-1, -1, -1, 0); + + if (!g_vars->scene08_vmyats->_movement) + g_vars->scene08_vmyats->startAnim(MV_VMT_DEF, 0, -1); + } + + if (g_fp->_aniMan->_oy <= 280 && g_vars->scene08_var07 && g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_HANDSUP) { + sceneHandler08_badLuck(); + } else if (g_fp->_aniMan->_oy > 236 || g_vars->scene08_var07 || !g_fp->_aniMan->_statics || g_fp->_aniMan->_statics->_staticsId != ST_MAN8_HANDSUP) { + if (g_fp->_aniMan->_movement || g_fp->_aniMan->_oy < 660 + || (g_vars->scene08_vmyats->_movement && g_vars->scene08_vmyats->_movement->_currDynamicPhaseIndex > 0) + || abs(g_vars->scene08_var08) > 2) { + if (g_vars->scene08_var08 >= 0 && !g_fp->_aniMan->_movement) { + if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_HANDSUP) + g_fp->_aniMan->startAnim(MV_MAN8_HANDSDOWN, 0, -1); + else + g_fp->_aniMan->changeStatics2(ST_MAN8_FLYDOWN); + } + + if (g_fp->_aniMan->_oy < 500 && !g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYUP && g_vars->scene08_var08 < 0) + g_fp->_aniMan->startAnim(MV_MAN8_HANDSUP, 0, -1); + } else { + sceneHandler08_sitDown(); + } + } else { + sceneHandler08_enterUp(); + } +} + +void sceneHandler08_checkEndArcade() { + if (g_vars->scene08_var02) { + int x = g_fp->_aniMan->_ox; + int y = g_vars->scene08_var08 + g_fp->_aniMan->_oy; + + if (!((g_vars->scene08_var08 + g_fp->_aniMan->_oy) % 3)) + g_vars->scene08_var08--; + + g_fp->_aniMan->setOXY(x, y); + + if (y < 80) { + sceneHandler08_finishArcade(); + + ExCommand *ex = new ExCommand(SC_8, 17, 0, 0, 0, 0, 1, 0, 0, 0); + ex->_messageNum = 61; + ex->_excFlags |= 2; + ex->_keyCode = TrubaUp; + + ex->postMessage(); + } + } +} + +void sceneHandler08_calcOffset() { + warning("STUB: sceneHandler08_calcOffset()"); +} + +void sceneHandler08_pushCallback(int *par) { + warning("STUB: sceneHandler08_pushCallback()"); +} + int sceneHandler08_updateScreenCallback() { int res; |