FULLPIPE: Implement sceneHandler09()

This commit is contained in:
Eugene Sandulenko 2014-02-12 22:00:04 +02:00
parent f9ecd6518a
commit a1b7a36cdd
4 changed files with 208 additions and 0 deletions

View File

@ -591,10 +591,21 @@ namespace Fullpipe {
#define ANI_GRIT_9 2719
#define ANI_PLEVATEL 919
#define ANI_VISUNCHIK 904
#define MSG_SC9_EATBALL 941
#define MSG_SC9_FLOWN 943
#define MSG_SC9_FROMLADDER 4207
#define MSG_SC9_PLVCLICK 965
#define MSG_SC9_SETSCROLL 964
#define MSG_SC9_SHOWBALL 936
#define MSG_SC9_STARTTIOTIA 4942
#define MSG_SC9_TOLADDER 4206
#define MV_MAN9_SHOOT 922
#define MV_VSN_CYCLE2 2987
#define PIC_SC9_LADDER_R 2700
#define SND_9_018 4200
#define ST_GRT9_GRIT 2722
#define ST_GRT9_NORM 2721
#define ST_VSN_NORMAL 906
// Scene 10
#define ANI_GUM 978

View File

@ -170,6 +170,8 @@ Vars::Vars() {
scene09_numMovingHangers = 0;
scene09_var13 = 0;
scene09_var15 = 0;
scene09_var17 = 0;
scene09_var19 = 0;
scene10_gum = 0;
scene10_packet = 0;

View File

@ -361,6 +361,8 @@ public:
int scene09_numMovingHangers;
int scene09_var13;
int scene09_var15;
int scene09_var17;
int scene09_var19;
StaticANIObject *scene10_gum;
StaticANIObject *scene10_packet;

View File

@ -237,4 +237,197 @@ int scene09_updateCursor() {
return g_fp->_cursorId;
}
void sceneHandler09_winArcade() {
warning("STUB: sceneHandler09_winArcade()");
}
void sceneHandler09_startAuntie() {
warning("STUB: sceneHandler09_startAuntie()");
}
void sceneHandler09_spitterClick() {
warning("STUB: sceneHandler09_spitterClick()");
}
void sceneHandler09_eatBall() {
warning("STUB: sceneHandler09_eatBall()");
}
void sceneHandler09_showBall() {
warning("STUB: sceneHandler09_showBall()");
}
void sceneHandler09_cycleHangers() {
warning("STUB: sceneHandler09_cycleHangers()");
}
void sceneHandler09_limitHangerPhase() {
warning("STUB: sceneHandler09_limitHangerPhase()");
}
void sceneHandler09_checkHangerCollide() {
warning("STUB: sceneHandler09_checkHangerCollide()");
}
void sceneHandler09_hangerStartCycle() {
warning("STUB: sceneHandler09_hangerStartCycle()");
}
int sceneHandler09(ExCommand *cmd) {
if (cmd->_messageKind != 17)
return 0;
switch (cmd->_messageNum) {
case MSG_CMN_WINARCADE:
sceneHandler09_winArcade();
break;
case MSG_SC9_STARTTIOTIA:
sceneHandler09_startAuntie();
break;
case MSG_SC9_FROMLADDER:
getCurrSceneSc2MotionController()->setEnabled();
getGameLoaderInteractionController()->enableFlag24();
g_vars->scene09_var09 = 0;
break;
case MSG_SC9_TOLADDER:
getCurrSceneSc2MotionController()->clearEnabled();
getGameLoaderInteractionController()->disableFlag24();
g_vars->scene09_var09 = 1;
break;
case MSG_SC9_PLVCLICK:
sceneHandler09_spitterClick();
break;
case MSG_SC9_FLOWN:
g_vars->scene09_var08 = 0;
break;
case MSG_SC9_EATBALL:
sceneHandler09_eatBall();
break;
case MSG_SC9_SHOWBALL:
sceneHandler09_showBall();
break;
case 33:
{
int res = 0;
if (g_fp->_aniMan2) {
int x = g_fp->_aniMan2->_ox;
g_vars->scene09_var02 = g_fp->_aniMan2->_oy;
if (x < g_fp->_sceneRect.left + 200)
g_fp->_currentScene->_x = x - g_fp->_sceneRect.left - 300;
if (x > g_fp->_sceneRect.right - 200)
g_fp->_currentScene->_x = x - g_fp->_sceneRect.right + 300;
res = 1;
} else {
if (g_fp->_aniMan->_movement && g_fp->_aniMan->_movement->_id != MV_MAN9_SHOOT)
g_fp->_aniMan2 = g_fp->_aniMan;
}
sceneHandler09_cycleHangers();
sceneHandler09_limitHangerPhase();
sceneHandler09_checkHangerCollide();
if (g_vars->scene09_var10 >= 0)
sceneHandler09_hangerStartCycle();
if (!g_vars->scene09_var17)
g_fp->_behaviorManager->updateBehaviors();
g_fp->startSceneTrack();
return res;
}
case 30:
if (g_vars->scene09_var10 >= 0) {
if (ABS(g_vars->scene09_hangers[g_vars->scene09_var10]->phase) < 15) {
g_vars->scene09_hangers[g_vars->scene09_var10]->ani->_callback2 = 0;
g_vars->scene09_hangers[g_vars->scene09_var10]->ani->changeStatics2(ST_VSN_NORMAL);
}
}
g_vars->scene09_var10 = -1;
break;
case 29:
{
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
if (ani) {
if (ani->_id == ANI_PLEVATEL) {
sceneHandler09_spitterClick();
break;
}
if (ani->_id == ANI_VISUNCHIK) {
if (g_vars->scene09_numMovingHangers > 0) {
int hng = 0;
while (g_vars->scene09_hangers[hng]->ani != ani) {
++hng;
if (hng >= g_vars->scene09_numMovingHangers)
break;
}
g_vars->scene09_var10 = hng;
g_vars->scene09_var11 = g_vars->scene09_hangers[hng]->phase;
g_vars->scene09_var12 = g_vars->scene09_hangers[hng]->phase;
g_vars->scene09_var19 = cmd->_y;
if (!g_vars->scene09_hangers[hng]->ani->_movement || g_vars->scene09_hangers[hng]->ani->_movement->_id != MV_VSN_CYCLE2) {
g_vars->scene09_hangers[hng]->ani->changeStatics2(ST_VSN_NORMAL);
g_vars->scene09_hangers[hng]->ani->startAnim(MV_VSN_CYCLE2, 0, -1);
g_vars->scene09_hangers[hng]->ani->_callback2 = 0;
}
ExCommand *ex = new ExCommand(0, 35, SND_9_018, 0, 0, 0, 1, 0, 0, 0);
ex->_field_14 = 1;
ex->_excFlags |= 2;
ex->postMessage();
}
break;
}
}
if (g_vars->scene09_var09 && g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) == PIC_SC9_LADDER_R
&& !cmd->_keyCode && !g_fp->_aniMan->_movement) {
handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC9_LADDER_R, 0), 0);
}
if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1) || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
g_fp->processArcade(cmd);
}
}
break;
}
}
return 0;
}
} // End of namespace Fullpipe