aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes/scene27.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/scenes/scene27.cpp')
-rw-r--r--engines/fullpipe/scenes/scene27.cpp63
1 files changed, 62 insertions, 1 deletions
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() {