Skip to content

Commit

Permalink
FULLPIPE: Started implementation of sceneHandler38_animateAlcoholics()
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Jan 21, 2014
1 parent 33b6d08 commit 711522e
Showing 1 changed file with 161 additions and 1 deletion.
162 changes: 161 additions & 1 deletion engines/fullpipe/scenes/scene38.cpp
Expand Up @@ -164,6 +164,166 @@ void sceneHandler38_drink() {

void sceneHandler38_animateAlcoholics() {
warning("STUB: sceneHandler38_animateAlcoholics()");

#if 0
MessageQueue *mq;

if (g_vars->scene38_boss->_movement || !(g_vars->scene38_boss->_flags & 4) || (g_vars->scene38_boss->_flags & 2)) {
g_vars->scene38_var05 = 0;
} else {
g_vars->scene38_var05++;
}

if (g_vars->scene38_var05 >= 50) {
int bossSt = g_vars->scene38_boss->_statics->_staticsId;

if (bossSt == ST_GLV_SLEEP2) {
g_vars->scene38_var05 = 0;
} else if ((g_vars->scene38_domino0->_flags & 4) && g_vars->scene38_domino0->_statics->_staticsId == ST_DMN38_6) {
if (bossSt == ST_GLV_HAMMER) {
chainQueue(QU_GLV_TAKEDOMINO, 1);
g_vars->scene38_var05 = 0;
}

if (bossSt == ST_GLV_NOHAMMER) {
chainQueue(QU_GLV_TAKEDOMINO_NOHMR, 1);
g_vars->scene38_var05 = 0;
}
} else {
if ((g_vars->scene38_bottle->_flags & 4) && g_vars->scene38_bottle->_statics->_staticsId == ST_BTL38_FULL && bossSt == ST_GLV_NOHAMMER) {
chainQueue(QU_GLV_DRINKBOTTLE, 1);
g_vars->scene38_var05 = 0;
} else {
int bossAnim = 0;

if (g_fp->_rnd->getRandomNumber(32767) >= 1310 || g_vars->scene38_boss->_statics->_staticsId != ST_GLV_HAMMER) {
if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
if (g_fp->_rnd->getRandomNumber(32767) < 1310) {
if (bossSt == ST_GLV_HAMMER)
bossAnim = QU_GLV_DRINK;
else if (bossSt == ST_GLV_NOHAMMER)
bossAnim = QU_GLV_DRINK_NOHMR;
}
} else {
if (bossSt == ST_GLV_HAMMER)
bossAnim = QU_GLV_PROPOSE;
else if (bossSt == ST_GLV_NOHAMMER)
bossAnim = QU_GLV_PROPOSE_NOHMR;
}
} else {
bossAnim = QU_GLV_HMRKICK;
}

if (g_vars->scene38_var06 == bossAnim) {
g_vars->scene38_var07++;

if (g_vars->scene38_var07 > 2)
bossAnim = 0;
} else {
g_vars->scene38_var06 = bossAnim;
g_vars->scene38_var07 = 1;
}

if (bossAnim > 0) {
mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(bossAnim), 0, 0);

mq->chain(0);

g_vars->scene38_var05 = 0;
}
}
}
}

if (g_vars->scene38_tally->_movement || !(g_vars->scene38_tally->_flags & 4) || (g_vars->scene38_tally->_flags & 2)) {
g_vars->scene38_var08 = 0;
} else {
g_vars->scene38_var08++;
}

if (g_vars->scene38_var08 >= 50) {
int tallyAnim = 0;

if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
if (g_fp->_rnd->getRandomNumber(32767) < 1310)
tallyAnim = QU_DLD_ICK;
} else {
tallyAnim = QU_DLD_GLOT;
}
} else {
tallyAnim = QU_DLD_BLINK;
}
} else {
if (g_vars->scene38_domino1->_statics->_staticsId == ST_DMN38_NORM3) {
tallyAnim = QU_DLD_TAKE1;
} else if (g_vars->scene38_domino1->_statics->_staticsId == ST_DMN38_NORM4) {
tallyAnim = QU_DLD_TAKE2;
}
}

if (g_vars->scene38_var09 == tallyAnim) {
g_vars->scene38_var10++;

if (g_vars->scene38_var10++ > 2)
tallyAnim = 0;
} else {
g_vars->scene38_var09 = tallyAnim;
g_vars->scene38_var10 = 1;
}
if (tallyAnim > 0) {
mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(tallyAnim), 0, 0);

mq->chain(0);
g_vars->scene38_var08 = 0;
}
}

if (g_vars->scene38_shorty->_movement || !(g_vars->scene38_shorty->_flags & 4) || (g_vars->scene38_shorty->_flags & 2)) {
g_vars->scene38_var11 = 0;
return;
}

g_vars->scene38_var11++;

if (g_vars->scene38_var11 < 50)
return;

int shortyAnim = 0;

if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
if (g_fp->_rnd->getRandomNumber(32767) >= 1310 || g_vars->scene38_shorty->_statics->_staticsId != ST_MLS_LEFT2) {
if (g_vars->scene38_boss->_statics->_staticsId != ST_GLV_SLEEP2 && g_vars->scene38_var05 > 30 && g_fp->_rnd->getRandomNumber(32767) < 0x3FFF && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2)
shortyAnim = QU_MLS_HAND;
} else {
shortyAnim = QU_MLS_BLINK;
}
} else {
if (g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_RIGHT2) {
shortyAnim = QU_MLS_TURNL;
} else if (g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2) {
shortyAnim = QU_MLS_TURNR;
}
}

if (g_vars->scene38_var12 == shortyAnim) {
g_vars->scene38_var13++;
if (g_vars->scene38_var13 > 2)
return;
} else {
g_vars->scene38_var12 = shortyAnim;
g_vars->scene38_var13 = 1;
}

if (shortyAnim > 0) {
mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(shortyAnim), 0, 0);

mq->chain(0);

g_vars->scene38_var11 = 0;
}
#endif
}

int sceneHandler38(ExCommand *cmd) {
Expand Down Expand Up @@ -238,7 +398,7 @@ int sceneHandler38(ExCommand *cmd) {
if (x < g_fp->_sceneRect.left + g_vars->scene38_var01)
g_fp->_currentScene->_x = x - g_vars->scene38_var03 - g_fp->_sceneRect.left;

if (x > g_fp->_sceneRect.right - g_vars->scene38_var01 )
if (x > g_fp->_sceneRect.right - g_vars->scene38_var01)
g_fp->_currentScene->_x = x + g_vars->scene38_var03 - g_fp->_sceneRect.right;
}

Expand Down

0 comments on commit 711522e

Please sign in to comment.