From d492457c34fb13494dfb66786e55dce33d01175c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 6 Feb 2014 23:31:04 +0200 Subject: FULLPIPE: Implement sceneHandler27_batLogic() --- engines/fullpipe/constants.h | 11 +++++++ engines/fullpipe/scenes.cpp | 3 ++ engines/fullpipe/scenes.h | 2 ++ engines/fullpipe/scenes/scene27.cpp | 63 ++++++++++++++++++++++++++++++++++++- 4 files changed, 78 insertions(+), 1 deletion(-) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 730dc7194e..f1d2d873fc 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -1096,11 +1096,17 @@ namespace Fullpipe { #define MSG_SC27_STARTWIPE 2057 #define MSG_SC27_TAKEVENT 4584 #define MV_BTA_FALL 2049 +#define MV_BTH_1_0 3366 +#define MV_BTH_2_1 3364 +#define MV_BTH_3_2 3362 +#define MV_BTH_4_3 3360 +#define MV_BTH_5_4 3358 #define MV_MAN27_FLOW 1990 #define MV_MAN27_THROWBET 1989 #define PIC_SC27_HITZONE2 4756 #define QU_DRV_GIVEVENT 2040 #define QU_MID_CLEANVENT 4583 +#define QU_SC27_RESTARTBETS 3370 #define QU_SC27_SHOWBET 3368 #define SND_27_026 4127 #define SND_27_027 4128 @@ -1108,6 +1114,11 @@ namespace Fullpipe { #define ST_BTA_FALL 2054 #define ST_BTA_HILITE 2052 #define ST_BTA_NORM 2028 +#define ST_BTH_1 3365 +#define ST_BTH_2 3363 +#define ST_BTH_3 3361 +#define ST_BTH_4 3359 +#define ST_BTH_5 3357 #define ST_DRV_VENT 1996 #define ST_MID_BROOM 2022 #define ST_MID_SPADE 3489 diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index a94f176030..c8916f3a4c 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1374,5 +1374,8 @@ void FullpipeEngine::updateMap(PreloadItem *pre) { } } +void BallChain::init(Ball **ball) { + warning("STUB: BallChain::init()"); +} } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index d07e926a88..a83c288e82 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -206,6 +206,8 @@ struct BallChain { BallChain() : pHead(0), field_8(0), pTail(0), numBalls(0), cPlex(0), cPlexLen(0) {} ~BallChain() { free(cPlex); } + + void init(Ball **ball); }; class Vars { diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp index c6d945eeab..407cf3820d 100644 --- a/engines/fullpipe/scenes/scene27.cpp +++ b/engines/fullpipe/scenes/scene27.cpp @@ -450,7 +450,68 @@ void sceneHandler27_maidSwitchback() { } void sceneHandler27_batLogic() { - warning("STUB: sceneHandler27_batLogic()"); + if (g_vars->scene27_balls.numBalls) { + g_vars->scene27_bat = g_vars->scene27_balls.pHead->ani; + + g_vars->scene27_balls.pHead = g_vars->scene27_balls.pHead->p0; + + if (g_vars->scene27_balls.pHead) + g_vars->scene27_balls.pHead->p0->p1 = 0; + else + g_vars->scene27_balls.field_8 = 0; + + g_vars->scene27_balls.init(&g_vars->scene27_balls.pHead->p0); + + int mv; + + switch (g_vars->scene27_batHandler->_statics->_staticsId) { + case ST_BTH_5: + mv = MV_BTH_5_4; + break; + + case ST_BTH_4: + mv = MV_BTH_4_3; + break; + + case ST_BTH_3: + mv = MV_BTH_3_2; + break; + + case ST_BTH_2: + mv = MV_BTH_2_1; + break; + + case ST_BTH_1: + mv = MV_BTH_1_0; + break; + + default: + chainQueue(QU_SC27_RESTARTBETS, 1); + + getCurrSceneSc2MotionController()->setEnabled(); + getGameLoaderInteractionController()->enableFlag24(); + + g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); + + return; + } + + MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact()); + + mq->setFlags(mq->getFlags() | 1); + + ExCommand *ex = new ExCommand(g_vars->scene27_batHandler->_id, 1, mv, 0, 0, 0, 1, 0, 0, 0); + ex->_excFlags |= 2; + mq->addExCommandToEnd(ex); + + ex = new ExCommand(0, 17, MSG_SC27_CLICKBET, 0, 0, 0, 1, 0, 0, 0); + ex->_excFlags |= 3; + mq->addExCommandToEnd(ex); + + mq->chain(0); + } else { + g_vars->scene27_bat = 0; + } } void sceneHandler27_calcWinArcade() { -- cgit v1.2.3