From 5a274117efd3049e2fe2aa3d31d115dce0692064 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 13 Jan 2014 22:00:44 +0200 Subject: FULLPIPE: Implement sceneHandler34_animateAction() --- engines/fullpipe/constants.h | 5 +++ engines/fullpipe/scenes/scene34.cpp | 67 +++++++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 89760e0cda..f38d019d69 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1154,11 +1154,16 @@ namespace Fullpipe { #define MSG_SC34_SHOWVENT 2481 #define MSG_SC34_TESTVENT 2557 #define MSG_SC34_UNCLIMB 2492 +#define MV_MAN34_TRY 2485 +#define MV_MAN34_TRYTABUR 2489 #define MV_MAN34_TURNVENT_L 4307 #define MV_MAN34_TURNVENT_R 2500 #define QU_SC34_ENTERLIFT 2819 #define QU_SC34_EXITLIFT 2820 +#define QU_SC34_FROMBOX 2494 +#define QU_SC34_FROMBOX_FLOOR 4572 #define QU_SC34_FROMCACTUS 4312 +#define QU_SC34_FROMSTOOL 2491 #define QU_SC34_SHOWSTOOL 2496 #define QU_CTS34_FALLEFT 4316 #define QU_CTS34_FALLRIGHT 4317 diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp index edc3783d2d..39df6f9fa4 100644 --- a/engines/fullpipe/scenes/scene34.cpp +++ b/engines/fullpipe/scenes/scene34.cpp @@ -194,8 +194,69 @@ void sceneHandler34_sub02(ExCommand *cmd) { warning("STUB: sceneHandler34_sub02(cmd)"); } -void sceneHandler34_sub01(ExCommand *cmd) { - warning("STUB: sceneHandler34_sub01(cmd)"); +void sceneHandler34_animateAction(ExCommand *cmd) { + if (g_fp->_aniMan->_movement) + return; + + int ox = g_fp->_aniMan->_ox; + int oy = g_fp->_aniMan->_oy; + StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y); + + if (!ani || ani->_id != ANI_VENT_34) { + int qId = 0; + + if (ox == 887) { + if (oy != 370) + return; + + qId = QU_SC34_FROMSTOOL; + } else { + if (ox != 916) + return; + + if (oy == 286) { + MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC34_FROMBOX), 0, 0); + + mq->addExCommandToEnd(cmd->createClone()); + mq->chain(0); + + sceneHandler34_setExits(); + + return; + } + + if (oy != 345) + return; + + qId = QU_SC34_FROMBOX_FLOOR; + } + + if (qId) { + MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(qId), 0, 0); + + mq->addExCommandToEnd(cmd->createClone()); + mq->chain(0); + } + + return; + } + + if (ox == 887) { + if (oy == 370) + g_fp->_aniMan->startAnim(MV_MAN34_TRYTABUR, 0, -1); + + } else if (ox == 916) { + if (oy == 286) { + int id = g_vars->scene34_vent->_statics->_staticsId; + if (id == ST_VNT34_UP2) { + g_fp->_aniMan->startAnim(MV_MAN34_TURNVENT_R, 0, -1); + } else if (id == ST_VNT34_RIGHT3) { + g_fp->_aniMan->startAnim(MV_MAN34_TURNVENT_L, 0, -1); + } + } else if (oy == 345) { + g_fp->_aniMan->startAnim(MV_MAN34_TRY, 0, -1); + } + } } void sceneHandler34_showVent() { @@ -331,7 +392,7 @@ int sceneHandler34(ExCommand *cmd) { case 29: { if (g_vars->scene34_var05) { - sceneHandler34_sub01(cmd); + sceneHandler34_animateAction(cmd); break; } -- cgit v1.2.3