diff options
-rw-r--r-- | engines/fullpipe/scenes.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene04.cpp | 40 |
3 files changed, 34 insertions, 10 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index a0f90af532..014459e847 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -99,7 +99,7 @@ Vars::Vars() { scene04_var19 = 0; scene04_var20 = 0; scene04_var24 = 0; - scene04_var26 = 0; + scene04_bottleY = 0; selector = 0; } diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index ed0da0a9db..670b94a839 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -122,7 +122,7 @@ public: int scene04_var19; int scene04_var20; StaticANIObject *scene04_var24; - int scene04_var26; + int scene04_bottleY; PictureObject *selector; }; diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 137133ba28..d642ebfcd2 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -285,7 +285,7 @@ void sceneHandler04_clickPlank() { void sceneHandler04_dropBottle() { g_vars->scene04_var12 = 1; - g_vars->scene04_var26 = 10; + g_vars->scene04_bottleY = 10; g_vars->scene04_var06 = 0; while (g_vars->scene04_kozyawkiAni.size()) { @@ -389,8 +389,36 @@ void sceneHandler04_sub5() { warning("sceneHandler04_sub5()"); } -void sceneHandler04_sub6() { - warning("sceneHandler04_sub6()"); +void sceneHandler04_bottleUpdateObjects(int off) { + for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it) { + GameObject *obj = *it; + + obj->setOXY(obj->_field_8 + 20, off + obj->_field_8 + 24); + } +} + +void sceneHandler04_liftBottle() { + int newy = g_vars->scene04_bottleY + g_vars->scene04_spring->_oy; + + g_vars->scene04_bottleY += 5; + + sceneHandler04_bottleUpdateObjects(newy - g_vars->scene04_spring->_oy); + + g_vars->scene04_spring->setOXY(g_vars->scene04_spring->_ox, newy); + + if (g_vars->scene04_bottle->_oy >= 226) { + sceneHandler04_bottleUpdateObjects(226 - g_vars->scene04_bottle->_oy); + + g_vars->scene04_spring->setOXY(g_vars->scene04_spring->_ox, 437); + g_vars->scene04_var12 = 0; + g_vars->scene04_var09 = 0; + g_vars->scene04_var19 = 1; + g_vars->scene04_var06 = 2; + g_vars->scene04_var20 = 10; + g_vars->scene04_var02 = 0; + + g_fullpipe->setObjectState(sO_LowerPipe, g_fullpipe->getObjectEnumState(sO_LowerPipe, sO_IsClosed)); + } } void sceneHandler04_sub7() { @@ -425,10 +453,6 @@ void sceneHandler04_testPlank(ExCommand *ex) { warning("sceneHandler04_testPlank()"); } -void sceneHandler04_bottleUpdateObjects(int off) { - warning("sceneHandler04_bottleUpdateObjects()"); -} - void sceneHandler04_updateBottle() { Common::Point point; @@ -581,7 +605,7 @@ int sceneHandler04(ExCommand *ex) { sceneHandler04_sub5(); if (g_vars->scene04_var12) - sceneHandler04_sub6(); + sceneHandler04_liftBottle(); if (g_vars->scene04_var08) sceneHandler04_clickLadder(); |