示例#1
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_showBallMan() {
	if (g_vars->scene14_flyingBall) {
		g_vars->scene14_flyingBall->show1(g_vars->scene14_dudeX - 166, g_vars->scene14_dudeY + 40, MV_BAL14_TOGMA, 0);
		g_vars->scene14_flyingBall->_priority = 27;

		MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
		ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_TOGMA, 0, 0, 0, 1, 0, 0, 0);

		ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
		ex->_excFlags |= 2;
		ex->_field_24 = 1;
		mq->addExCommandToEnd(ex);

		ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
		ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
		ex->_excFlags |= 3;
		mq->addExCommandToEnd(ex);
		mq->chain(0);

		g_vars->scene14_flyingBall->startAnim(MV_BAL14_TOGMA, 0, -1);

		g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
		g_vars->scene14_flyingBall = 0;

		if (g_vars->scene14_dudeX >= 1300)
			sceneHandler14_exitScene();
	}
}
示例#2
0
void sceneHandler27_batLogic() {
    if (g_vars->scene27_balls.size()) {
        g_vars->scene27_bat = g_vars->scene27_balls[0];

        g_vars->scene27_balls.remove_at(0);

        int mv;

        switch (g_vars->scene27_batHandler->_statics->_staticsId) {
        case ST_BTH_5:
            mv = MV_BTH_5_4;
            break;

        case ST_BTH_4:
            mv = MV_BTH_4_3;
            break;

        case ST_BTH_3:
            mv = MV_BTH_3_2;
            break;

        case ST_BTH_2:
            mv = MV_BTH_2_1;
            break;

        case ST_BTH_1:
            mv = MV_BTH_1_0;
            break;

        default:
            chainQueue(QU_SC27_RESTARTBETS, 1);

            getCurrSceneSc2MotionController()->activate();
            getGameLoaderInteractionController()->enableFlag24();

            g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);

            return;
        }

        MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

        mq->setFlags(mq->getFlags() | 1);

        ExCommand *ex = new ExCommand(g_vars->scene27_batHandler->_id, 1, mv, 0, 0, 0, 1, 0, 0, 0);
        ex->_excFlags |= 2;
        mq->addExCommandToEnd(ex);

        ex = new ExCommand(0, 17, MSG_SC27_CLICKBET, 0, 0, 0, 1, 0, 0, 0);
        ex->_excFlags |= 3;
        mq->addExCommandToEnd(ex);

        mq->chain(0);
    } else {
        g_vars->scene27_bat = 0;
    }
}
示例#3
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_arcadeLogic() {
	g_vars->scene14_flyingBall->stopAnim_maybe();
	g_vars->scene14_flyingBall->hide();

	if (g_vars->scene14_dudeIsKicking)
		sceneHandler14_clearCallback();

	if (g_vars->scene14_hitsLeft <= 1) {
		setInputDisabled(1);

		sceneHandler14_clearCallback();

		g_vars->scene14_dudeCanKick = false;
		g_fp->_aniMan2 = 0;

		chainQueue(QU_SC14_WINARCADE, 1);

		--g_vars->scene14_hitsLeft;
	} else {
		ExCommand *ex;

		g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);

		if (g_vars->scene14_hitsLeft != 3 || g_vars->scene14_pink) {
			MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

			ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_BACKOFF, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);

			ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);

			mq->chain(0);
		} else {
			MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

			ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_BACKOFF2, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);

			ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);

			mq->chain(0);
		}

		sceneHandler14_grandmaStepForward();
		--g_vars->scene14_hitsLeft;
	}
}
示例#4
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_grandmaThrow() {
	g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);

	MessageQueue *mq = new MessageQueue;
	ExCommand *ex = new ExCommand(ANI_GRANDMA, 2, 30, 0, 0, 0, 1, 0, 0, 0);

	ex->_excFlags |= 2;
	mq->addExCommandToEnd(ex);

	ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
	ex->_excFlags |= 2;
	mq->addExCommandToEnd(ex);

	mq->chain(0);
}
示例#5
0
void sceneHandler29_manHit() {
	MGMInfo mgminfo;

	g_vars->scene29_var15 = 1;

	g_fp->_aniMan->changeStatics2(ST_MAN29_RUNR);
	g_fp->_aniMan->setOXY(g_vars->scene29_var20, g_vars->scene29_var21);

	mgminfo.ani = g_fp->_aniMan;
	mgminfo.staticsId2 = ST_MAN29_SITR;
	mgminfo.y1 = 463;
	mgminfo.x1 = g_vars->scene29_var20 <= 638 ? 351 : 0;
	mgminfo.field_1C = 10;
	mgminfo.field_10 = 1;
	mgminfo.flags = (g_vars->scene29_var20 <= 638 ? 2 : 0) | 0x44;
	mgminfo.movementId = MV_MAN29_HIT;

	MessageQueue *mq = g_vars->scene29_mgm.genMovement(&mgminfo);
	ExCommand *ex;

	if (mq) {
		if (g_vars->scene29_var20 <= 638) {
			ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP_NORM, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			ex->_keyCode = g_fp->_aniMan->_okeyCode;
			mq->addExCommandToEnd(ex);

			ex = new ExCommand(0, 17, MSG_SC29_STOPRIDE, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			mq->addExCommandToEnd(ex);

			g_vars->scene29_var09 = 0;
			g_vars->scene29_var10 = 0;
			g_vars->scene29_var11 = 0;
			g_vars->scene29_var12 = 0;
		} else {
			ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			ex->_keyCode = g_fp->_aniMan->_okeyCode;
			mq->addExCommandToEnd(ex);
		}

		mq->setFlags(mq->getFlags() | 1);

		if (!mq->chain(g_fp->_aniMan))
			delete mq;
	}
}
示例#6
0
文件: scene29.cpp 项目: Cruel/scummvm
void sceneHandler29_manHit() {
	MGMInfo mgminfo;

	g_vars->scene29_manIsHit = true;

	g_fp->_aniMan->changeStatics2(ST_MAN29_RUNR);
	g_fp->_aniMan->setOXY(g_vars->scene29_manX, g_vars->scene29_manY);

	mgminfo.ani = g_fp->_aniMan;
	mgminfo.staticsId2 = ST_MAN29_SITR;
	mgminfo.y1 = 463;
	mgminfo.x1 = g_vars->scene29_manX <= 638 ? 351 : 0;
	mgminfo.field_1C = 10;
	mgminfo.field_10 = 1;
	mgminfo.flags = (g_vars->scene29_manX <= 638 ? 2 : 0) | 0x44;
	mgminfo.movementId = MV_MAN29_HIT;

	MessageQueue *mq = g_vars->scene29_mgm.genMovement(&mgminfo);
	ExCommand *ex;

	if (mq) {
		if (g_vars->scene29_manX <= 638) {
			ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP_NORM, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			ex->_keyCode = g_fp->_aniMan->_okeyCode;
			mq->addExCommandToEnd(ex);

			ex = new ExCommand(0, 17, MSG_SC29_STOPRIDE, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			mq->addExCommandToEnd(ex);

			g_vars->scene29_manIsRiding = false;
			g_vars->scene29_arcadeIsOn = false;
			g_vars->scene29_reachedFarRight = false;
			g_vars->scene29_rideBackEnabled = false;
		} else {
			ex = new ExCommand(ANI_MAN, 1, MV_MAN29_STANDUP, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			ex->_keyCode = g_fp->_aniMan->_okeyCode;
			mq->addExCommandToEnd(ex);
		}

		mq->setFlags(mq->getFlags() | 1);

		if (!mq->chain(g_fp->_aniMan))
			delete mq;
	}
}
示例#7
0
void sceneHandler26_clickVent(StaticANIObject *ani, ExCommand *cmd) {
    if (ani->_okeyCode || g_fp->getObjectState(sO_Hatch_26) == g_fp->getObjectEnumState(sO_Hatch_26, sO_Opened)) {
        if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
            g_vars->scene26_activeVent = ani;

            int x = ani->_ox - 20;
            int y = ani->_oy + 61;

            if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) {
                MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_UP);

                if (mq) {
                    ExCommand *ex = new ExCommand(0, 17, MSG_SC26_CLICKVENT, 0, 0, 0, 1, 0, 0, 0);

                    ex->_excFlags |= 3;
                    ex->_keyCode = ani->_okeyCode;

                    mq->addExCommandToEnd(ex);

                    postExCommand(g_fp->_aniMan->_id, 2, x, y, 0, -1);
                }
            } else {
                sceneHandler26_animateVents(ani);
            }
        }
    }

    cmd->_messageKind = 0;
}
示例#8
0
void sceneHandler10_clickGum() {
	if (g_vars->scene10_hasGum) {
		if (sceneHandler10_inflaterIsBlind()) {
			if (g_vars->scene10_hasGum) {
				int x = g_vars->scene10_gum->_ox - 139;
				int y = g_vars->scene10_gum->_oy - 48;

				if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1) {
					MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_RIGHT);
					if (mq) {
						ExCommand *ex = new ExCommand(0, 17, MSG_SC10_CLICKGUM, 0, 0, 0, 1, 0, 0, 0);
						ex->_excFlags = 2;
						mq->addExCommandToEnd(ex);

						postExCommand(g_fp->_aniMan->_id, 2, x, y, 0, -1);
					}
				} else {
					g_vars->scene10_hasGum = 0;

					chainQueue(QU_SC10_TAKEGUM, 1);
				}
			}
		} else {
			g_vars->scene10_inflater->changeStatics2(ST_NDV_SIT);

			if (g_fp->getObjectState(sO_Inflater) == g_fp->getObjectEnumState(sO_Inflater, sO_WithGum))
				g_vars->scene10_inflater->startAnim(MV_NDV_DENIES, 0, -1);
			else
				g_vars->scene10_inflater->startAnim(MV_NDV_DENY_NOGUM, 0, -1);
		}
	}
}
示例#9
0
文件: scene11.cpp 项目: Cruel/scummvm
void sceneHandler11_jumpOver(double angle) {
	MGMInfo mgminfo;

	sceneHandler11_emptySwing();

	g_fp->_aniMan->show1(690 - (int)(sin(g_vars->scene11_swingAngle) * -267.0), 215 - (int)(cos(g_vars->scene11_swingAngle) * -267.0),
						  MV_MAN11_JUMPOVER, 0);
	g_fp->_aniMan->_priority = 0;

	mgminfo.staticsId2 = ST_MAN_1PIX;
	mgminfo.ani = g_fp->_aniMan;
	mgminfo.x1 = 1163;
	mgminfo.y1 = 837 - (int)(angle * 153.0);
	mgminfo.field_1C = 0;
	mgminfo.field_10 = 1;
	mgminfo.flags = 78;
	mgminfo.movementId = MV_MAN11_JUMPOVER;

	MessageQueue *mq = g_vars->scene11_mgm.genMovement(&mgminfo);

	if (mq) {
		g_vars->scene11_crySound = SND_11_022;

		ExCommand *ex = new ExCommand(0, 17, MSG_SC11_RESTARTMAN, 0, 0, 0, 1, 0, 0, 0);
		ex->_excFlags = 2;

		mq->addExCommandToEnd(ex);

		if (!mq->chain(g_fp->_aniMan))
			delete mq;
	}
}
示例#10
0
void sceneHandler28_clickLift(int numLift) {
	int x = 0;

	debugC(2, kDebugSceneLogic, "scene28: clickLift(%d)", numLift);

	switch (numLift) {
	case 0: x = 600; break;
	case 1: x = 824; break;
	case 2: x = 1055; break;
	case 3: x = 1286; break;
	case 4: x = 1517; break;
	case 5: x = 1748; break;
	case 6: x = 1979; break;
	}

	if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(472 - g_fp->_aniMan->_oy) > 1
		|| g_fp->_aniMan->_movement
		|| g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) {
		debugC(2, kDebugSceneLogic, "scene28: clickLift: overwrite");

		MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, 472, 1, ST_MAN_UP);
		if (mq) {
			ExCommand *ex = new ExCommand(0, 17, MSG_SC28_CLICKLIFT, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 3;
			ex->_param = numLift;

			mq->addExCommandToEnd(ex);

			postExCommand(g_fp->_aniMan->_id, 2, x, 472, 0, -1);
		}
	} else {
		switch (numLift) {
		case 0:
			sceneHandler28_lift0Start();
			break;
		case 1:
			sceneHandler28_lift1Start();
			break;
		case 2:
			sceneHandler28_lift2Start();
			break;
		case 3:
			sceneHandler28_lift3Start();
			break;
		case 4:
			sceneHandler28_lift4Start();
			break;
		case 5:
			sceneHandler28_lift5Start();
			break;
		case 6:
			sceneHandler28_lift6Start();
			break;
		default:
			return;
		}
	}
}
示例#11
0
文件: scene11.cpp 项目: Cruel/scummvm
void sceneHandler11_jumpHitAndWin() {
	MGMInfo mgminfo;

	sceneHandler11_emptySwing();

	g_fp->_aniMan->show1(690 - (int)(sin(g_vars->scene11_swingAngle) * -267.0), 215 - (int)(cos(g_vars->scene11_swingAngle) * -267.0),
						  MV_MAN11_JUMPHIT, 0);
	g_fp->_aniMan->_priority = 10;

	mgminfo.field_1C = 10;
	mgminfo.ani = g_fp->_aniMan;
	mgminfo.staticsId2 = ST_MAN_1PIX;
	mgminfo.x1 = 1400;
	mgminfo.y1 = 0;
	mgminfo.field_10 = 1;
	mgminfo.flags = 66;
	mgminfo.movementId = MV_MAN11_JUMPHIT;

	MessageQueue *mq = g_vars->scene11_mgm.genMovement(&mgminfo);

	if (mq) {
		g_vars->scene11_crySound = SND_11_024;
		ExCommand *ex = new ExCommand(ANI_MAN, 2, 36, 0, 0, 0, 1, 0, 0, 0);
		ex->_keyCode = -1;
		ex->_excFlags = 2;

		mq->addExCommandToEnd(ex);

		ex = new ExCommand(SC_11, 17, 61, 0, 0, 0, 1, 0, 0, 0);
		ex->_keyCode = TrubaRight;
		ex->_excFlags = 3;

		mq->addExCommandToEnd(ex);

		if (!mq->chain(g_fp->_aniMan))
			delete mq;


		if (g_fp->getObjectState(sO_Swingie) == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInCorner))
			g_fp->setObjectState(sO_Swingie, g_fp->getObjectEnumState(sO_Swingie, sO_IsSitting));

		g_fp->setObjectState(sO_DudeHasJumped, g_fp->getObjectEnumState(sO_DudeHasJumped, sO_Yes));
	}
}
示例#12
0
文件: scene29.cpp 项目: Cruel/scummvm
void sceneHandler29_clickPorter(ExCommand *cmd) {
	if (!g_fp->_aniMan->isIdle() || g_fp->_aniMan->_flags & 0x100) {
		cmd->_messageKind = 0;

		return;
	}

	if (g_vars->scene29_manX <= g_vars->scene29_porter->_ox) {
		if (ABS(351 - g_vars->scene29_manX) > 1 || ABS(443 - g_vars->scene29_manY) > 1
			|| g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
			if (g_fp->_msgX != 351 || g_fp->_msgY != 443) {
				MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 351, 443, 1, ST_MAN_RIGHT);

				if (mq) {
					mq->addExCommandToEnd(cmd->createClone());

					postExCommand(g_fp->_aniMan->_id, 2, 351, 443, 0, -1);
				}
			}
		} else {
			sceneHandler29_manToL();
		}
	} else {
		g_vars->scene29_manX = g_fp->_aniMan->_ox;
		g_vars->scene29_manY = g_fp->_aniMan->_oy;

		if (ABS(1582 - g_vars->scene29_manX) > 1 || ABS(445 - g_fp->_aniMan->_oy) > 1
			|| g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) {
			if (g_fp->_msgX != 1582 || g_fp->_msgY != 445) {
				MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1582, 445, 1, (0x4000 | ST_MAN_RIGHT));

				if (mq) {
					mq->addExCommandToEnd(cmd->createClone());

					postExCommand(g_fp->_aniMan->_id, 2, 1582, 445, 0, -1);
				}
			}
		} else {
			sceneHandler29_manToR();
		}
	}
}
示例#13
0
文件: scene16.cpp 项目: Cruel/scummvm
void sceneHandler16_drink() {
	if (g_vars->scene16_mug->_flags & 4) {
		if (!g_vars->scene16_jettie->_movement) {
			if (!g_vars->scene16_walkingBoy || !g_vars->scene16_walkingBoy->_movement || g_vars->scene16_walkingBoy->_movement->_id != MV_BOY_DRINK) {
				if (!g_vars->scene16_walkingGirl || !g_vars->scene16_walkingGirl->_movement || g_vars->scene16_walkingGirl->_movement->_id != MV_GRL_DRINK) {
					if (g_vars->scene16_mug->_statics->_staticsId == ST_MUG_FULL) {
						MessageQueue *mq;
						ExCommand *ex;

						if (g_vars->scene16_walkingBoy) {
							g_fp->_aniMan->_flags |= 0x180;

							g_vars->scene16_walkingBoy->changeStatics2(ST_BOY_STAND);
							g_vars->scene16_walkingBoy->queueMessageQueue(0);

							mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYKICK), 0, 1);

							mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode);

							ex = new ExCommand(ANI_MAN, 34, 384, 0, 0, 0, 1, 0, 0, 0);
							ex->_excFlags |= 3u;
							ex->_field_14 = 384;
							ex->_messageNum = 0;

							mq->insertExCommandAt(2, ex);
							mq->setFlags(mq->getFlags() | 1);
							mq->chain(0);
						} else {
							g_fp->_aniMan->_flags |= 1;

							mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_MANDRINK), 0, 1);

							ex = new ExCommand(ANI_MAN, 34, 256, 0, 0, 0, 1, 0, 0, 0);
							ex->_excFlags |= 3u;
							ex->_field_14 = 256;
							ex->_messageNum = 0;

							mq->addExCommandToEnd(ex);
							mq->setFlags(mq->getFlags() | 1);
							mq->chain(0);

							g_fp->_currentScene->getStaticANIObject1ById(ANI_GIRL, -1)->changeStatics2(ST_GRL_STAND);
						}

						g_fp->_currentScene->getStaticANIObject1ById(ANI_WIRE16, -1)->show1(-1, -1, -1, 0);
					} else {
						chainObjQueue(g_fp->_aniMan, QU_SC16_TAKEMUG, 1);
					}
				}
			}
		}
	}
}
示例#14
0
文件: scene08.cpp 项目: 33d/scummvm
void sceneHandler08_jumpOff(ExCommand *cmd) {
	MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

	mq->addExCommandToEnd(cmd->createClone());
	mq->setFlags(mq->getFlags() | 1);

	g_fp->_globalMessageQueueList->addMessageQueue(mq);

	g_fp->_aniMan->startAnim(MV_MAN8_JUMPOFF, mq->_id, -1);

	sceneHandler08_finishArcade();
}
示例#15
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_showBallGrandmaHit() {
	if (g_vars->scene14_flyingBall) {
		g_vars->scene14_flyingBall->show1(g_vars->scene14_grandmaX + 190, g_vars->scene14_grandmaY + 56, MV_BAL14_TOGMA, 0);
		g_vars->scene14_flyingBall->_priority = 27;

		MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
		ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_TOGMA, 0, 0, 0, 1, 0, 0, 0);

		ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
		ex->_excFlags |= 2;
		ex->_field_24 = 1;
		mq->addExCommandToEnd(ex);

		ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
		ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
		ex->_excFlags |= 3;
		mq->addExCommandToEnd(ex);
		mq->chain(0);

		g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
		g_vars->scene14_flyingBall = 0;
	}
}
示例#16
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_passToGrandma() {
	g_vars->scene14_flyingBall->stopAnim_maybe();
	g_vars->scene14_flyingBall->_priority = 27;

	MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
	ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_FALL, 0, 0, 0, 1, 0, 0, 0);

	ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
	ex->_excFlags |= 2;
	ex->_field_24 = 1;
	mq->addExCommandToEnd(ex);

	ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
	ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
	ex->_excFlags |= 3;
	mq->addExCommandToEnd(ex);
	mq->chain(0);

	g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
	g_vars->scene14_flyingBall = 0;

	sceneHandler14_grandmaThrow();
}
示例#17
0
文件: scene14.cpp 项目: Cruel/scummvm
void sceneHandler14_grandmaJumpThrow() {
	g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);

	MessageQueue *mq = new MessageQueue;
	ExCommand *ex = new ExCommand(ANI_GRANDMA, 2, 30, 0, 0, 0, 1, 0, 0, 0);

	ex->_excFlags |= 2;
	mq->addExCommandToEnd(ex);

	ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_JUMPFW, 0, 0, 0, 1, 0, 0, 0);
	ex->_excFlags |= 2;
	mq->addExCommandToEnd(ex);

	ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
	ex->_excFlags |= 2;
	mq->addExCommandToEnd(ex);

	mq->chain(0);

	g_vars->scene14_dude2X += 71;
	g_fp->_currentScene->_x = 71;

	g_fp->_aniMan2 = g_fp->_aniMan;
}
示例#18
0
void sceneHandler32_potLogic(ExCommand *cmd) {
	if (g_vars->scene32_cactusCounter < 0 || g_vars->scene32_cactusCounter > 20) {
		MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

		ExCommand *ex = new ExCommand(ANI_MAN, 1, MV_MAN32_STANDUP, 0, 0, 0, 1, 0, 0, 0);

		ex->_excFlags |= 2;

		mq->addExCommandToEnd(ex);

		StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);

		if (!ani || ani->_id != ANI_KADKA)
			mq->addExCommandToEnd(cmd->createClone());

		mq->setFlags(mq->getFlags() | 1);
		mq->chain(0);

		getCurrSceneSc2MotionController()->activate();
		getGameLoaderInteractionController()->enableFlag24();

		g_vars->scene32_dudeIsSitting = false;
	}
}
示例#19
0
文件: scene16.cpp 项目: Cruel/scummvm
void sceneHandler16_mugClick() {
	if (abs(310 - g_fp->_aniMan->_ox) >= 1 || abs(449 - g_fp->_aniMan->_oy) >= 1
		|| g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
		MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 310, 449, 1, ST_MAN_RIGHT);

		if (mq) {
			ExCommand *ex = new ExCommand(0, 17, MSG_SC16_MUGCLICK, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags = 2;
			mq->addExCommandToEnd(ex);

			postExCommand(g_fp->_aniMan->_id, 2, 310, 449, 0, -1);
		}
	} else {
		sceneHandler16_drink();
	}
}
示例#20
0
文件: scene14.cpp 项目: Cruel/scummvm
bool sceneHandler14_arcadeProcessClick(ExCommand *cmd) {
	if (!getCurrSceneSc2MotionController()->_isEnabled)
		return 0;

	if (!g_vars->scene14_grandmaIsHere) {
		if (!cmd->_keyCode) {
			if (g_vars->scene14_pink) {
				if (g_vars->scene14_pink->_flags & 4) {
					if (cmd->_sceneClickX < g_vars->scene14_pink->_ox + 40) {
						handleObjectInteraction(g_fp->_aniMan, g_vars->scene14_pink, 0);
						cmd->_messageKind = 0;
						return true;
					}
				}
			}
		}
		return false;
	}

	if (getCurrSceneSc2MotionController()->_objtype != kObjTypeMctlCompound)
		return false;

	if (!getCurrSceneSc2MotionController()->_motionControllers[0]->_movGraphReactObj->pointInRegion(cmd->_sceneClickX, cmd->_sceneClickY))
		return false;

	if (cmd->_sceneClickX > 1237)
		return false;

	MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 1237, 451, 1, 0);

	if (!mq)
		return false;

	ExCommand *ex = new ExCommand(0, 17, MSG_SC14_STARTARCADE, 0, 0, 0, 1, 0, 0, 0);

	ex->_excFlags |= 3;
	mq->addExCommandToEnd(ex);
	mq->setFlags(mq->getFlags() | 1);

	postExCommand(g_fp->_aniMan->_id, 2, 1237, 451, 0, -1);

	cmd->_messageKind = 0;

	getCurrSceneSc2MotionController()->deactivate();
	getGameLoaderInteractionController()->disableFlag24();
	return true;
}
示例#21
0
void sceneHandler32_ladderLogic(ExCommand *cmd) {
	MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC32_FROMLADDER), 0, 0);

	if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) != PIC_SC32_LADDER)
		mq->addExCommandToEnd(cmd->createClone());

	mq->setFlags(mq->getFlags() | 1);

	g_fp->_aniMan->changeStatics2(ST_MAN_STANDLADDER);
	if (!mq->chain(g_fp->_aniMan))
		delete mq;

	g_vars->scene32_dudeOnLadder = false;

	getCurrSceneSc2MotionController()->activate();
	getGameLoaderInteractionController()->enableFlag24();
}
示例#22
0
文件: scene11.cpp 项目: Cruel/scummvm
void sceneHandler11_putBoot() {
	if (abs(353 - g_fp->_aniMan->_ox) > 1 || abs(498 - g_fp->_aniMan->_oy) > 1
		|| g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
		MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, 353, 498, 1, ST_MAN_RIGHT);

		if (mq) {
			ExCommand *ex = new ExCommand(0, 17, MSG_SC11_PUTBOOT, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 3;

			mq->addExCommandToEnd(ex);

			postExCommand(g_fp->_aniMan->_id, 2, 353, 498, 0, -1);
		}
	} else {
		sceneHandler11_putABoot();
	}
}
示例#23
0
void sceneHandler06_takeBall() {
	if (g_vars->scene06_currentBall && !g_vars->scene06_currentBall->_movement && g_vars->scene06_currentBall->_statics->_staticsId == ST_NBL_NORM) {
		if (abs(1158 - g_fp->_aniMan->_ox) > 1
			|| abs(452 - g_fp->_aniMan->_oy) > 1
			|| g_fp->_aniMan->_movement
			|| g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) {
			MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1158, 452, 1, (0x4000 | ST_MAN_RIGHT));

			if (mq) {
				ExCommand *ex = new ExCommand(0, 17, MSG_SC6_TAKEBALL, 0, 0, 0, 1, 0, 0, 0);
				ex->_excFlags |= 3;
				mq->addExCommandToEnd(ex);

				postExCommand(g_fp->_aniMan->_id, 2, 1158, 452, 0, -1);
			}
		} else {
			sceneHandler06_startAiming();
		}
	}
}
示例#24
0
文件: scene08.cpp 项目: 33d/scummvm
void sceneHandler08_badLuck() {
	g_fp->_currentScene->getPictureObjectById(PIC_SC8_LADDER, 0)->_flags &= 0xFFFB;

	g_fp->_aniMan->changeStatics2(ST_MAN8_HANDSUP);
	g_fp->_aniMan->setOXY(376, 280);
	g_fp->_aniMan->_priority = 10;

	MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

	ExCommand *ex = new ExCommand(g_fp->_aniMan->_id, 1, MV_MAN8_BADLUCK, 0, 0, 0, 1, 0, 0, 0);
	ex->_excFlags |= 2;
	ex->_keyCode = g_fp->_aniMan->_okeyCode;
	mq->addExCommandToEnd(ex);

	mq->setFlags(mq->getFlags() | 1);
	mq->chain(0);

	g_fp->setObjectState(sO_StairsUp_8, g_fp->getObjectEnumState(sO_StairsUp_8, sO_NotBroken));

	g_vars->scene08_inAir = false;
}
示例#25
0
void sceneHandler27_clickBat(ExCommand *cmd) {
    int bx = g_vars->scene27_bat->_ox - 5;
    int by = g_vars->scene27_bat->_oy - 71;

#if DBG
    sceneHandler27_throwBat();
    return;
#endif

    if (ABS(bx - g_fp->_aniMan->_ox) > 1 || ABS(by - g_fp->_aniMan->_oy) > 1
            || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
        MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, bx, by, 1, ST_MAN_RIGHT);

        if (mq) {
            mq->addExCommandToEnd(cmd->createClone());

            postExCommand(g_fp->_aniMan->_id, 2, bx, by, 0, -1);
        }
    } else {
        sceneHandler27_throwBat();
    }
}
示例#26
0
文件: scene11.cpp 项目: Cruel/scummvm
void sceneHandler11_jumpFromSwing() {
	g_vars->scene11_arcadeIsOn = false;
	g_vars->scene11_hint->_flags &= 0xFFFB;
	g_vars->scene11_scrollIsEnabled = false;

	getCurrSceneSc2MotionController()->activate();
	getGameLoaderInteractionController()->enableFlag24();

	g_vars->scene11_swingOldAngle = 0.0;
	g_vars->scene11_swingAngleDiff = 0.0;
	g_vars->scene11_swingSpeed = 0.0;
	g_vars->scene11_swingAngle = 0.0;

	g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN11, -1);
	g_vars->scene11_dudeOnSwing->_flags &= 0xFFFB;
	g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_KACHELI, -1);
	g_vars->scene11_dudeOnSwing->changeStatics2(ST_KCH_STATIC);
	g_vars->scene11_dudeOnSwing->setOXY(691, 371);
	g_vars->scene11_dudeOnSwing->_priority = 20;
	g_vars->scene11_dudeOnSwing->_flags |= 4;

    MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
    ExCommand *ex = new ExCommand(g_fp->_aniMan->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);
	ex->_field_14 = 256;
	ex->_messageNum = 0;
	ex->_excFlags |= 3;
	mq->addExCommandToEnd(ex);
	mq->setFlags(mq->getFlags() | 1);

	g_fp->_globalMessageQueueList->addMessageQueue(mq);

	g_fp->_aniMan->_flags |= 0x104;
	g_fp->_aniMan->changeStatics2(ST_MAN11_SWING);
	g_fp->_aniMan->setOXY(685, 373);
	g_fp->_aniMan->startAnim(MV_MAN11_JUMPFROMSWING, mq->_id, -1);

	g_fp->_aniMan2 = g_fp->_aniMan;
}
示例#27
0
void sceneHandler35_startFlow() {
    if (g_fp->getObjectState(sO_Valve_35) == g_fp->getObjectEnumState(sO_Valve_35, sO_TurnedOn)) {
        if ((g_vars->scene35_hose->_flags & 4) && g_vars->scene35_hose->_statics->_staticsId == ST_HZE_NORM) {
            g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_BLINK, 0);
            g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_TRY, 0);

            g_vars->scene35_bellyInflater->changeStatics2(ST_PDV_SMALL);
            g_vars->scene35_bellyInflater->_flags &= 0xFEFF;

            MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC35_EATHOZE), 0, 0);

            mq->setFlags(mq->getFlags() | 1);

            ExCommand *cmd = new ExCommand(g_vars->scene35_bellyInflater->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);

            cmd->_excFlags |= 3;
            cmd->_field_14 = 256;
            cmd->_messageNum = 0;

            mq->addExCommandToEnd(cmd);

            if (!mq->chain(g_vars->scene35_bellyInflater))
                delete mq;

            g_vars->scene35_bellyInflater->_flags |= 1;

            getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing, 1);

            g_fp->playSound(SND_35_012, 1);
        } else {
            if (!g_vars->scene35_flowCounter)
                g_vars->scene35_flowCounter = 98;

            g_fp->playSound(SND_35_011, 1);
        }
    }
}
示例#28
0
bool GameLoader::gotoScene(int sceneId, int entranceId) {
    SceneTag *st;

    int sc2idx = getSceneTagBySceneId(sceneId, &st);

    if (sc2idx < 0)
        return false;

    if (!_sc2array[sc2idx]._isLoaded)
        return false;

    if (_sc2array[sc2idx]._entranceDataCount < 1) {
        g_fp->_currentScene = st->_scene;
        return true;
    }

    if (_sc2array[sc2idx]._entranceDataCount <= 0)
        return false;

    int entranceIdx = 0;
    if (sceneId != 726) // WORKAROUND
        for (entranceIdx = 0; _sc2array[sc2idx]._entranceData[entranceIdx]->_field_4 != entranceId; entranceIdx++) {
            if (entranceIdx >= _sc2array[sc2idx]._entranceDataCount)
                return false;
        }

    GameVar *sg = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");

    if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != 0)
        sg->setSubVarAsInt("Entrance", entranceId);

    if (!g_fp->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
        return false;

    g_fp->_msgObjectId2 = 0;
    g_fp->_msgY = -1;
    g_fp->_msgX = -1;

    g_fp->_currentScene = st->_scene;

    MessageQueue *mq1 = g_fp->_currentScene->getMessageQueueById(_sc2array[sc2idx]._entranceData[entranceIdx]->_messageQueueId);
    if (mq1) {
        MessageQueue *mq = new MessageQueue(mq1, 0, 0);

        StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
        if (stobj) {
            stobj->_flags &= 0x100;

            ExCommand *ex = new ExCommand(stobj->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);

            ex->_field_14 = 256;
            ex->_messageNum = 0;
            ex->_excFlags |= 3;

            mq->addExCommandToEnd(ex);
        }

        mq->setFlags(mq->getFlags() | 1);

        if (!mq->chain(0)) {
            delete mq;

            return false;
        }
    } else {
        StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
        if (stobj)
            stobj->_flags &= 0xfeff;
    }

    return true;
}
示例#29
0
void sceneHandler06_mumsyBallTake() {
	int momAni = 0;

	switch (g_vars->scene06_mumsyNumBalls) {
    case 1:
		momAni = MV_MOM_TAKE1;
		break;
    case 2:
		momAni = MV_MOM_TAKE2;
		break;
    case 3:
		momAni = MV_MOM_TAKE3;
		break;
    case 4:
		momAni = MV_MOM_TAKE4;
		break;
    case 5:
		momAni = MV_MOM_TAKE5;
		break;
	}

	MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());

	ExCommand *ex = new ExCommand(ANI_MAMASHA, 2, 50, 0, 0, 0, 1, 0, 0, 0);

	ex->_excFlags = 2u;
	mq->addExCommandToEnd(ex);

	if (g_vars->scene06_mumsyNumBalls >= 5) {
		g_fp->setObjectState(sO_BigMumsy, g_fp->getObjectEnumState(sO_BigMumsy, sO_IsGone));

		if (g_fp->getObjectState(sO_ClockAxis) == g_fp->getObjectEnumState(sO_ClockAxis, sO_IsNotAvailable))
			g_fp->setObjectState(sO_ClockAxis, g_fp->getObjectEnumState(sO_ClockAxis, sO_WithoutHandle));

		ex = new ExCommand(ANI_MAMASHA, 1, momAni, 0, 0, 0, 1, 0, 0, 0);
		ex->_excFlags |= 2;
		mq->addExCommandToEnd(ex);

		if (g_vars->scene06_mumsyPos + 3 >= 0) {
			ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_STARTBK, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2u;
			mq->addExCommandToEnd(ex);

			for (int i = 0; i < g_vars->scene06_mumsyPos + 3; i++) {
				ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_CYCLEBK, 0, 0, 0, 1, 0, 0, 0);
				ex->_excFlags |= 2;
				mq->addExCommandToEnd(ex);
			}

			ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_STOPBK, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);
		}

		ex = new ExCommand(0, 18, QU_MOM_TOLIFT, 0, 0, 0, 1, 0, 0, 0);
		ex->_excFlags |= 3;
		mq->addExCommandToEnd(ex);
	} else {
		if (momAni) {
			ex = new ExCommand(ANI_MAMASHA, 1, momAni, 0, 0, 0, 1, 0, 0, 0);
			ex->_excFlags |= 2;
			mq->addExCommandToEnd(ex);
		}

		if (g_vars->scene06_mumsyPos < 0) {
			for (int i = 0; i > g_vars->scene06_mumsyPos; i--) {
				ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_JUMPFW, 0, 0, 0, 1, 0, 0, 0);
				ex->_excFlags |= 2;
				mq->addExCommandToEnd(ex);
			}
		} else if (g_vars->scene06_mumsyPos > 0) {
			for (int i = 0; i < g_vars->scene06_mumsyPos; i++) {
				ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_JUMPBK, 0, 0, 0, 1, 0, 0, 0);
				ex->_excFlags |= 2;
				mq->addExCommandToEnd(ex);
			}
		}

		ex = new ExCommand(0, 18, QU_MOM_SITDOWN, 0, 0, 0, 1, 0, 0, 0);
		ex->_excFlags |= 3u;
		mq->addExCommandToEnd(ex);
	}

	mq->setFlags(mq->getFlags() | 1);
	mq->chain(0);

	g_vars->scene06_mumsyNumBalls = 0;
	g_vars->scene06_arcadeEnabled = false;

	g_fp->_aniMan2 = 0;
}
示例#30
0
bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject *obj, int invId) {
	if (subj) {
		if (!subj->isIdle() || (subj->_flags & 0x100))
			return false;
	}

	if (!_interactions.size())
		return false;

	Interaction *inter = 0;
	Interaction *previnter = 0;
	int dur = 0;
	int mindur = 0xFFFF;

	MessageQueue *mq;
	ExCommand *ex;

	for (InteractionList::iterator i = _interactions.begin(); i != _interactions.end(); ++i) {
		Interaction *cinter = *i;

		if (!cinter->canInteract(subj, obj, invId))
			continue;

		if ((inter || cinter->_objectId2) && (!obj || cinter->_objectId3 != obj->_id)) {
			if (cinter->_messageQueue)
				cinter->_messageQueue->calcDuration(subj);

			debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic(cinter->_actionName));

			PicAniInfo aniInfo;

			obj->getPicAniInfo(aniInfo);

			if (cinter->_staticsId1 && obj->_objtype == kObjTypeStaticANIObject) {
				StaticANIObject *ani = static_cast<StaticANIObject *>(obj);
				ani->_messageQueueId = 0;
				ani->changeStatics2(cinter->_staticsId1);
			}
			int xpos = cinter->_xOffs + obj->_ox;
			int ypos = cinter->_yOffs + obj->_oy;

			obj->setPicAniInfo(aniInfo);

			if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1) {
				debugC(0, kDebugPathfinding, "Calling makeQueue() at [%d, %d]", xpos, ypos);
				mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->makeQueue(subj, xpos, ypos, 1, cinter->_staticsId2);
				if (mq) {
					dur = mq->calcDuration(subj);
					delete mq;
				} else {
					dur = 0x10000;
				}
				inter = previnter;
			} else {
				dur = 0;
			}
			if (dur < mindur) {
				inter = cinter;
				mindur = dur;
				previnter = cinter;
			}
		} else {
			inter = cinter;
			break;
		}
	}

	if (!inter)
		return false;

	if (!inter->_objectId2) {
		if (obj->_objtype == kObjTypeStaticANIObject) {
			StaticANIObject *ani = static_cast<StaticANIObject *>(obj);

			if (inter->_flags & 1) {
				if (!ani->isIdle())
					return false;

				if (ani->_flags & 0x100)
					return false;
			} else if (inter->_staticsId1 != 0) {
				if (ani->_movement || ani->_statics == 0 || ani->_statics->_staticsId != inter->_staticsId1) {
					mq = ani->changeStatics1(inter->_staticsId1);
					if (!mq)
						return false;

					ex = new ExCommand((subj ? subj->_id : 0), 55, 0, 0, 0, 0, 1, 0, 0, 0);
					ex->_x = obj->_id;
					ex->_y = obj->_odelay;
					ex->_param = subj ? subj->_odelay : 0;
					ex->_excFlags = 3;
					ex->_z = (obj->_objtype != kObjTypePictureObject);
					ex->_field_20 = invId;
					mq->addExCommandToEnd(ex);

					if (mq->_isFinished) {
						mq->_isFinished = 0;
						ani->queueMessageQueue(mq);
					}

					return true;
				} else {
					if (ani->getMessageQueue())
						ani->queueMessageQueue(0);
				}
			}
		}

		if (inter->_messageQueue) {
			mq = new MessageQueue(inter->_messageQueue, 0, 1);
			mq->changeParam28ForObjectId(obj->_id, -1, obj->_odelay);

			if (!mq->chain(0))
				return false;
		}

		return true;
	}

	if (obj && !subj)
		return true;

	if (!obj || inter->_objectId3 == obj->_id) {
		if (subj) {
			if (inter->_messageQueue) {
				if (subj->isIdle()) {
					mq = new MessageQueue(inter->_messageQueue, 0, 1);

					if (!mq->chain(subj)) {
						delete mq;

						return false;
					}
				}
			}
		}
		return true;
	}

	if (inter->isOverlapping(subj, obj)) {
		if (obj->_objtype == kObjTypeStaticANIObject) {
			StaticANIObject *ani = static_cast<StaticANIObject *>(obj);

			ani->queueMessageQueue(0);

			if (inter->_staticsId1)
				ani->changeStatics2(inter->_staticsId1);

			if (!(inter->_flags & 0x10000))
				obj->_flags |= 0x80;
		}

		if (!inter->_messageQueue)
			return false;

		subj->setOXY(inter->_xOffs + obj->_ox, inter->_yOffs + obj->_oy);

		mq = new MessageQueue(inter->_messageQueue, 0, 1);
		mq->changeParam28ForObjectId(obj->_id, -1, obj->_odelay);
		mq->_flags |= 1;

		if (!(inter->_flags & 0x10000)) {
			ex = new ExCommand(obj->_id, 34, 0x80, 0, 0, 0, 1, 0, 0, 0);
			ex->_param = obj->_odelay;
			ex->_z = 0x80;
			ex->_messageNum = 0;
			ex->_excFlags = 3;
			mq->addExCommandToEnd(ex);
		}

		ex = new ExCommand(obj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
		ex->_param = obj->_odelay;
		ex->_z = 0x100;
		ex->_messageNum = 0;
		ex->_excFlags = 3;
		mq->addExCommandToEnd(ex);

		ex = new ExCommand(subj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
		ex->_param = subj->_odelay;
		ex->_z = 0x100;
		ex->_messageNum = 0;
		ex->_excFlags = 3;
		mq->addExCommandToEnd(ex);

		ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0);
		ex->_excFlags |= 3;
		ex->_param = 0;
		mq->addExCommandToEnd(ex);

		if (!mq->chain(subj)) {
			delete mq;

			return false;
		}

		subj->_flags |= 0x100;
		obj->_flags |= 0x100;
	} else {
		bool someFlag = false;
		PicAniInfo aniInfo;

		obj->getPicAniInfo(aniInfo);

		if (obj->_objtype == kObjTypeStaticANIObject && inter->_staticsId1) {
			StaticANIObject *ani = static_cast<StaticANIObject *>(obj);

			ani->_messageQueueId = 0;
			ani->changeStatics2(inter->_staticsId1);
		}

		int xpos = inter->_xOffs + obj->_ox;
		int ypos = inter->_yOffs + obj->_oy;

		obj->setPicAniInfo(aniInfo);

		if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1
				|| (inter->_staticsId2 != 0 && (subj->_statics == 0 || subj->_statics->_staticsId != inter->_staticsId2))) {
			mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->startMove(subj, xpos, ypos, 1, inter->_staticsId2);

			if (!mq)
				return false;

			ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0);
			ex->_x = obj->_id;
			ex->_y = obj->_odelay;
			ex->_param = subj->_odelay;
			ex->_excFlags = 3;
			ex->_field_20 = invId;
			ex->_z = (obj->_objtype != kObjTypePictureObject);
			mq->addExCommandToEnd(ex);

			someFlag = true;

			ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0);
			ex->_x = xpos;
			ex->_y = ypos;
			ex->_excFlags |= 3;
			ex->_param = 6;
			ex->_z = obj->_id;
			ex->_field_20 = obj->_odelay;
			ex->postMessage();
		}

		if (!inter->_staticsId1 || !(inter->_flags & 1))
			return true;

		if (obj->_objtype != kObjTypeStaticANIObject)
			return false;

		StaticANIObject *ani = static_cast<StaticANIObject *>(obj);

		if (!ani->isIdle())
			return false;

		if (ani->getMessageQueue())
			ani->queueMessageQueue(0);

		if (!ani->_statics || ani->_statics->_staticsId != inter->_staticsId1 || ani->_movement) {
			mq = ani->changeStatics1(inter->_staticsId1);

			if (!mq)
				return false;

			if (someFlag) {
				if (!(inter->_flags & 0x10000)) {
					if (mq->_isFinished) {
						ani->_flags |= 0x80u;
					} else {
						ex = new ExCommand(ani->_id, 34, 0x80, 0, 0, 0, 1, 0, 0, 0);
						ex->_z = 0x80;
						ex->_param = ani->_odelay;
						ex->_excFlags = 3;
						mq->addExCommandToEnd(ex);
					}
				}
				ex = new ExCommand(ani->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
				ex->_param = ani->_odelay;
				ex->_z = 0x100;
				ex->_excFlags = 3;
				mq->addExCommandToEnd(ex);
			} else {
				ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0);
				ex->_x = ani->_id;
				ex->_y = ani->_odelay;
				ex->_param = subj->_odelay;
				ex->_excFlags = 2;
				ex->_z = (obj->_objtype != kObjTypePictureObject);
				ex->_field_20 = invId;
				mq->addExCommandToEnd(ex);

				if (!mq->_isFinished)
					return true;

				mq->_isFinished = 0;
				ani->queueMessageQueue(mq);
			}
		} else {
			obj->_flags |= 0x100;

			if (inter->_flags & 0x10000)
				return true;

			obj->_flags |= 0x80;
		}
	}

	return true;
}