aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-03-31 23:10:37 +0300
committerEugene Sandulenko2014-03-31 23:10:55 +0300
commitee9ad6cfb5a75e1bf76a49b7d2bd36ea76dd7994 (patch)
treea375d1ceb40160f3322c0a36acda38c26c8763af
parent2eed6daf72468fdcf5ef0a0ab54871e7d3943ff6 (diff)
downloadscummvm-rg350-ee9ad6cfb5a75e1bf76a49b7d2bd36ea76dd7994.tar.gz
scummvm-rg350-ee9ad6cfb5a75e1bf76a49b7d2bd36ea76dd7994.tar.bz2
scummvm-rg350-ee9ad6cfb5a75e1bf76a49b7d2bd36ea76dd7994.zip
FULLPIPE: Implement sceneHandler29_animBearded()
-rw-r--r--engines/fullpipe/constants.h7
-rw-r--r--engines/fullpipe/scenes/scene29.cpp86
2 files changed, 92 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 3f568fd8b5..59c4ded125 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -1295,6 +1295,7 @@ namespace Fullpipe {
#define MSG_SC29_STOPRIDE 2107
#define MV_ASS_HITGREEN 2138
#define MV_ASS_HITRED 2139
+#define MV_BRDCMN_GOR 4735
#define MV_MAN29_BEND 2091
#define MV_MAN29_HIT 2088
#define MV_MAN29_JUMP 2090
@@ -1307,6 +1308,10 @@ namespace Fullpipe {
#define MV_STR1_SHOOT 2109
#define MV_STR2_SHOOT 2112
#define PIC_SC29_LTRUBA 2081
+#define QU_SC29_BRD1 4741
+#define QU_SC29_BRD2 4742
+#define QU_SC29_BRDOUT1 4743
+#define QU_SC29_BRDOUT2 4744
#define QU_SC29_ESCAPE 2129
#define QU_SC29_MANFROM_L 2101
#define QU_SC29_MANFROM_R 2104
@@ -1315,6 +1320,8 @@ namespace Fullpipe {
#define SND_29_028 4758
#define SND_29_029 4759
#define ST_ASS_NORM 2122
+#define ST_BRDCMN_GOR 4734
+#define ST_BRDCMN_RIGHT 4732
#define ST_MAN29_RUNR 2140
#define ST_MAN29_SITR 2141
#define ST_STR1_RIGHT 2143
diff --git a/engines/fullpipe/scenes/scene29.cpp b/engines/fullpipe/scenes/scene29.cpp
index 8d0fb5d6e1..3fe1cac4e7 100644
--- a/engines/fullpipe/scenes/scene29.cpp
+++ b/engines/fullpipe/scenes/scene29.cpp
@@ -498,7 +498,91 @@ void sceneHandler29_shoot() {
}
void sceneHandler29_animBearded() {
- warning("STUB: sceneHandler29_animBearded()");
+ MessageQueue *mq;
+
+ for (uint i = 0; i < g_vars->scene29_var19.size(); i++) {
+ StaticANIObject *ani = g_vars->scene29_var19[i]->ani;
+
+ if (g_vars->scene29_var19[i]->wbflag) {
+ int x = ani->_ox;
+ int y = ani->_oy;
+
+ if (!ani->_movement && ani->_statics->_staticsId == (ST_BRDCMN_RIGHT | 0x4000)) {
+ x -= 4;
+
+ if (x - g_vars->scene29_var20 < 100 || !g_vars->scene29_var10) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRDOUT1), 0, 1);
+
+ mq->replaceKeyCode(-1, ani->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene29_var19[i]->wbflag = 0;
+ g_vars->scene29_var19[i]->wbcounter = 0;
+ }
+ }
+
+ if (!ani->_movement && ani->_statics->_staticsId == ST_BRDCMN_GOR)
+ ani->startAnim(MV_BRDCMN_GOR, 0, -1);
+
+ if (ani->_movement) {
+ if (ani->_movement->_id == MV_BRDCMN_GOR) {
+ x -= 4;
+
+ if (g_vars->scene29_var20 - x < 60 || x - g_vars->scene29_var20 < -260 || !g_vars->scene29_var10) {
+ ani->changeStatics2(ST_BRDCMN_RIGHT);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRDOUT2), 0, 1);
+
+ mq->replaceKeyCode(-1, ani->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene29_var19[i]->wbflag = 0;
+ g_vars->scene29_var19[i]->wbcounter = 0;
+ }
+ }
+ }
+
+ ani->setOXY(x, y);
+ continue;
+ }
+
+ if (g_vars->scene29_var10 && g_vars->scene29_var19[i]->wbcounter > 30) {
+ int newx;
+
+ if (g_fp->_rnd->getRandomNumber(1))
+ goto dostuff;
+
+ if (g_vars->scene29_var20 <= 700) {
+ g_vars->scene29_var19[i]->wbcounter++;
+ continue;
+ }
+
+ if (g_vars->scene29_var20 >= 1100) {
+ dostuff:
+ if (g_vars->scene29_var20 <= 700 || g_vars->scene29_var20 >= 1350) {
+ g_vars->scene29_var19[i]->wbcounter++;
+ continue;
+ }
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRD2), 0, 1);
+
+ newx = g_vars->scene29_var20 - 200;
+ } else {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC29_BRD1), 0, 1);
+
+ newx = g_vars->scene29_var20 + 350;
+ }
+
+ mq->getExCommandByIndex(0)->_x = newx;
+ mq->replaceKeyCode(-1, ani->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene29_var19[i]->wbflag = 1;
+ g_vars->scene29_var19[i]->wbcounter = 0;
+ }
+
+ g_vars->scene29_var19[i]->wbcounter++;
+ }
}