diff options
author | Eugene Sandulenko | 2014-01-01 23:47:46 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-01 23:47:46 +0200 |
commit | 485807a4da1f8c2b04a75fac5d48ce39617eea85 (patch) | |
tree | 922bea970fae5ab29f3bf50b4feefdf6e8675cc1 | |
parent | 065118d8b67b9bbc19b0bedb54a46ef27db89520 (diff) | |
download | scummvm-rg350-485807a4da1f8c2b04a75fac5d48ce39617eea85.tar.gz scummvm-rg350-485807a4da1f8c2b04a75fac5d48ce39617eea85.tar.bz2 scummvm-rg350-485807a4da1f8c2b04a75fac5d48ce39617eea85.zip |
FULLPIPE: Implement sceneHandler17()
-rw-r--r-- | engines/fullpipe/constants.h | 15 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene17.cpp | 154 |
4 files changed, 172 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 013e920090..a292be0d33 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -690,9 +690,23 @@ namespace Fullpipe { // Scene 17 #define ANI_HAND17 1446 +#define MSG_SC17_DROP 3414 +#define MSG_SC17_FILLBOTTLE 1436 +#define MSG_SC17_HIDESUGAR 1417 +#define MSG_SC17_SHOWBOTTLE 1432 +#define MSG_SC17_SHOWSUGAR 1416 +#define MSG_SC17_TESTTRUBA 1458 +#define MSG_SC17_UPDATEHAND 1560 +#define PIC_SC17_RTRUBA 1323 +#define PIC_SC17_RTRUBA2 5297 +#define QU_HND17_ASK 1456 +#define QU_HND17_ATTRACT 1455 +#define QU_HND17_TOCYCLE 1454 +#define ST_HND17_EMPTY 1448 // Scene 24 #define ANI_DROP_24 3505 +#define ANI_INV_HAMMER 884 #define ANI_JET24 1837 #define ANI_WATER24 1834 #define MV_MAN_TURN_RL 332 @@ -705,6 +719,7 @@ namespace Fullpipe { #define SND_24_006 4041 #define SND_24_007 4042 #define ST_DRP24_EMPTY 3507 +#define ST_HND17_ATTRACT 1451 #define ST_WTR24_FLOWLOWER 1843 // Debug scene diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index ed3e6960af..5a21543173 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -248,6 +248,8 @@ Vars::Vars() { scene17_var07 = 0; scene17_var08 = 0; scene17_hand = 0; + scene17_var09 = 0; + scene17_var10 = 0; scene24_jetIsOn = false; scene24_flowIsLow = false; diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index d055b252d0..012cd209ee 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -329,6 +329,8 @@ public: int scene17_var07; int scene17_var08; StaticANIObject *scene17_hand; + int scene17_var09; + int scene17_var10; bool scene24_jetIsOn; bool scene24_flowIsLow; diff --git a/engines/fullpipe/scenes/scene17.cpp b/engines/fullpipe/scenes/scene17.cpp index 3a2c725dfa..e08299bbee 100644 --- a/engines/fullpipe/scenes/scene17.cpp +++ b/engines/fullpipe/scenes/scene17.cpp @@ -32,7 +32,7 @@ #include "fullpipe/interaction.h" #include "fullpipe/behavior.h" - +#include "fullpipe/floaters.h" namespace Fullpipe { @@ -48,4 +48,156 @@ void scene17_initScene(Scene *sc) { g_vars->scene17_hand = sc->getStaticANIObject1ById(ANI_HAND17, -1); } +void sceneHandler17_drop() { + warning("STUB: sceneHandler17_drop()"); +} + +void sceneHandler17_fillBottle() { + warning("STUB: sceneHandler17_fillBottle()"); +} + +void sceneHandler17_testTruba() { + warning("STUB: sceneHandler17_testTruba()"); +} + +void sceneHandler17_showBottle() { + warning("STUB: sceneHandler17_showBottle()"); +} + +void sceneHandler17_hideSugar() { + warning("STUB: sceneHandler17_hideSugar()"); +} + +void sceneHandler17_showSugar() { + warning("STUB: sceneHandler17_showSugar()"); +} + +void sceneHandler17_moonshineFill() { + warning("STUB: sceneHandler17_moonshineFill()"); +} + +void sceneHandler17_updateFlies() { + warning("STUB: sceneHandler17_updateFlies()"); +} + + +int sceneHandler17(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + switch (cmd->_messageNum) { + case MSG_SC17_DROP: + sceneHandler17_drop(); + break; + + case MSG_SC17_UPDATEHAND: + if (g_fp->getObjectState(sO_UsherHand) == g_fp->getObjectEnumState(sO_UsherHand, sO_WithCoin)) { + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 0); + + g_vars->scene17_var09 = 0; + } else { + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 1); + + g_vars->scene17_var09 = 1; + } + break; + + case MSG_SC17_FILLBOTTLE: + sceneHandler17_fillBottle(); + break; + + case MSG_SC17_TESTTRUBA: + sceneHandler17_testTruba(); + break; + + case MSG_SC17_SHOWBOTTLE: + sceneHandler17_showBottle(); + break; + + case MSG_SC17_HIDESUGAR: + sceneHandler17_hideSugar(); + break; + + case MSG_SC17_SHOWSUGAR: + sceneHandler17_showSugar(); + break; + + case 29: + { + int pic = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY); + + if (pic == PIC_SC17_RTRUBA2 || pic == PIC_SC17_RTRUBA) { + if (cmd->_keyCode == ANI_INV_COIN || cmd->_keyCode == ANI_INV_BOOT || cmd->_keyCode == ANI_INV_HAMMER) { + if (g_vars->scene17_var09) { + if (g_fp->_aniMan->isIdle()) { + if (!(g_fp->_aniMan->_flags & 0x100)) { + handleObjectInteraction(g_fp->_aniMan, g_vars->scene17_hand, cmd->_keyCode); + break; + } + } + } + } + } + } + break; + + case 33: + { + int x = g_vars->scene17_var10; + g_vars->scene17_var07 = g_vars->scene17_var10; + + if (g_fp->_aniMan2) { + x = g_fp->_aniMan2->_ox; + + g_vars->scene17_var10 = x; + + if (x < g_fp->_sceneRect.left + g_vars->scene17_var01) { + g_fp->_currentScene->_x = x - g_vars->scene17_var03 - g_fp->_sceneRect.left; + + x = g_vars->scene17_var10; + } + + if (x > g_fp->_sceneRect.right - g_vars->scene17_var01) { + g_fp->_currentScene->_x = x + g_vars->scene17_var03 - g_fp->_sceneRect.right; + x = g_vars->scene17_var10; + } + } + + if (g_vars->scene17_var06) { + sceneHandler17_moonshineFill(); + x = g_vars->scene17_var10; + } + + if (g_vars->scene17_var09) { + if (g_vars->scene17_var07 < 410 && x >= 410) { + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 0); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_ATTRACT, QU_HND17_ATTRACT, 0); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 1); + } else if (g_vars->scene17_var07 > 410 && x <= 410) { + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 1); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_ATTRACT, QU_HND17_ATTRACT, 1); + g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0); + } + } + + --g_vars->scene17_var08; + + if (!g_vars->scene17_var08) + sceneHandler17_updateFlies(); + + g_fp->_floaters->update(); + + g_fp->_behaviorManager->updateBehaviors(); + + g_fp->startSceneTrack(); + + break; + } + } + + return 0; +} + } // End of namespace Fullpipe |