uint32 AsScene1307Key::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: if (_isClickable) { sendMessage(_parentScene, 0x4826, 0); stRemoveKey(); messageResult = 1; } break; case 0x2000: _isClickable = param.asInteger() != 0; break; case 0x2001: setSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex, param.asInteger()); stMoveKey(); break; case 0x2003: playSound(3); stUnlock(); break; case 0x2004: playSound(2); stInsert(); break; } return messageResult; }
uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_ANIMATION_START: if (param.asInteger() == 0x07053000) { _creatureExploded = true; sendMessage(_asCreature, 0x2004, 0); } else if (param.asInteger() == 0x140E5744) sendMessage(_asCreature, NM_KLAYMEN_CLIMB_LADDER, 0); else if (param.asInteger() == 0x40253C40) { _canAcceptInput = false; sendMessage(_asCreature, NM_KLAYMEN_STOP_CLIMBING, 0); } else if (param.asInteger() == 0x090EB048) { if (_klaymen->getX() < 572) setMessageList2(0x004AEC90); else setMessageList2(0x004AEC20); } break; case 0x2001: if (getGlobalVar(V_MATCH_STATUS) == 0) setMessageList2(0x004AECB0); else { sendEntityMessage(_klaymen, 0x1014, _asMatch); setMessageList2(0x004AECC0); } break; case NM_POSITION_CHANGE: if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) { // Move the TNT dummy if the fuse is burning sendEntityMessage(_klaymen, 0x1014, _asTntMan); setMessageList2(0x004AECF0, false); } else if (getGlobalVar(V_MATCH_STATUS) == 3) { // Light the TNT dummy if we have the match sendEntityMessage(_klaymen, 0x1014, _asTntMan); if (_klaymen->getX() > _asTntMan->getX()) setMessageList(0x004AECD0); else setMessageList(0x004AECE0); } break; case 0x4814: cancelMessageList(); break; case 0x4826: if (sender == _asTape) { sendEntityMessage(_klaymen, 0x1014, _asTape); setMessageList(0x004AED38); } break; case 0x4829: sendMessage(_asRightDoor, 0x4829, 0); break; case 0x8000: sendMessage(_asKlaymenHead, NM_KLAYMEN_STOP_CLIMBING, 0); break; } return messageResult; }
uint32 KmScene1109::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case NM_ANIMATION_UPDATE: _isSittingInTeleporter = param.asInteger() != 0; messageResult = 1; break; case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case NM_KLAYMEN_STAND_IDLE: if (_isSittingInTeleporter) GotoState(&Klaymen::stSitIdleTeleporter); else GotoState(&Klaymen::stTryStandIdle); break; case 0x4804: if (param.asInteger() != 0) { _destX = param.asInteger(); GotoState(&Klaymen::stWalkingFirst); } else GotoState(&Klaymen::stPeekWall); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case NM_KLAYMEN_TURN_TO_USE: if (_isSittingInTeleporter) GotoState(&Klaymen::stTurnToUseInTeleporter); break; case NM_KLAYMEN_RETURN_FROM_USE: if (_isSittingInTeleporter) GotoState(&Klaymen::stReturnFromUseInTeleporter); break; case 0x4834: GotoState(&Klaymen::stStepOver); break; case 0x4835: sendMessage(_parentScene, 0x2000, 1); _isSittingInTeleporter = true; GotoState(&Klaymen::stSitInTeleporter); break; case 0x4836: sendMessage(_parentScene, 0x2000, 0); _isSittingInTeleporter = false; GotoState(&Klaymen::stGetUpFromTeleporter); break; case 0x483D: teleporterAppear(0x2C2A4A1C); break; case 0x483E: teleporterDisappear(0x3C2E4245); break; } return messageResult; }
uint32 AsScene1308Mouse::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x66382026) playSound(0, 0x0CD84468); else if (param.asInteger() == 0x6E28061C) playSound(0, 0x78C8402C); else if (param.asInteger() == 0x462F0410) playSound(0, 0x60984E28); break; } return messageResult; }
uint32 AsScene3009Symbol::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_KLAYMEN_CLIMB_LADDER: if (param.asInteger()) { if (_symbolIndex == 11) _symbolIndex = 0; else _symbolIndex++; } else { if (_symbolIndex == 0) _symbolIndex = 11; else _symbolIndex--; } startAnimation(kAsScene3009SymbolFileHashes[_symbolPosition / 3], _symbolIndex, -1); _newStickFrameIndex = _symbolIndex; setSubVar(VA_CURR_CANNON_SYMBOLS, _symbolPosition, _symbolIndex); if (_symbolPosition / 3 == 0) { sendMessage(_parentScene, 0x2001, 0); } else { sendMessage(_parentScene, 0x2003, 0); } messageResult = 1; break; } return messageResult; }
uint32 AsScene2401FlowingWater::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (_isWaterFlowing && param.asInteger() == 0x02421405) startAnimationByHash(0x10203116, 0x01084280, 0); break; case 0x2002: if (!_isWaterFlowing) { _vm->_soundMan->addSound(0x40F11C09, 0x980C1420); _vm->_soundMan->playSoundLooping(0x980C1420); startAnimation(0x10203116, 0, -1); setVisible(true); _isWaterFlowing = true; } break; case 0x2003: _vm->_soundMan->deleteSound(0x980C1420); _isWaterFlowing = false; break; case 0x3002: stopAnimation(); setVisible(false); break; } return messageResult; }
uint32 Scene1608::hmLowerFloor(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x20250B1A) { clearRectList(); _klaymen->setVisible(false); showMouse(false); _sprite1->setVisible(false); //sendMessage(_asDoor, 0x4809, 0); // Play sound? _countdown1 = 28; } break; case 0x200D: sendMessage(_parentModule, 0x200D, 0); break; case 0x4826: if (sender == _asTape) { sendEntityMessage(_kmScene1608, 0x1014, _asTape); setMessageList(0x004B4770); } else if (sender == _asKey) setMessageList(0x004B46C8); break; } return 0; }
uint32 Scene::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { switch (messageNum) { case 0x0000: // mouse moved if (_mouseCursor && _mouseCursor->hasMessageHandler()) sendMessage(_mouseCursor, 0x4002, param); break; case 0x0001: // mouse clicked _mouseClicked = true; _mouseClickPos = param.asPoint(); break; case 0x0006: sendMessage(_parentModule, 0x1009, param); break; case 0x1006: // Sent by Klaymen when its animation sequence has finished if (_isKlaymenBusy) { _isKlaymenBusy = false; if (_messageListIndex == _messageListCount) { // If the current message list was processed completely, // sent Klaymen into the idle state. sendMessage(_klaymen, 0x4004, 0); } else { // Else continue with the next message in the current message list processMessageList(); } } break; case 0x1007: // This isn't sent by any code, check if it's in a message list // This cancels the current message list and sets Klaymen into the idle state. if (_isKlaymenBusy) { _isKlaymenBusy = false; _messageList = NULL; sendMessage(_klaymen, 0x4004, 0); } break; case 0x101D: // Hide the mouse cursor if (_mouseCursor) { _mouseCursorWasVisible = _mouseCursor->getSurface()->getVisible(); _mouseCursor->getSurface()->setVisible(false); } break; case 0x101E: // Show the mouse cursor if (_mouseCursorWasVisible && _mouseCursor) { _mouseCursor->getSurface()->setVisible(true); } break; case 0x1022: // Set the sender's surface priority setSurfacePriority(((Sprite*)sender)->getSurface(), param.asInteger()); break; } return 0; }
uint32 KmScene2401::hmSpit(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x16401CA6) { _canSpitPipe = true; if (_contSpitPipe) spitIntoPipe(); } else if (param.asInteger() == 0xC11C0008) { _canSpitPipe = false; _acceptInput = false; _readyToSpit = false; } else if (param.asInteger() == 0x018A0001) { sendMessage(_parentScene, 0x2001, _spitDestPipeIndex); } break; } return messageResult; }
uint32 Scene2101::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x02144CB1) sendEntityMessage(_klaymen, 0x1014, _ssFloorButton); else if (param.asInteger() == 0x21E64A00) { if (_doorStatus == 0) setMessageList(0x004B8E80); else setMessageList(0x004B8EC8); } else if (param.asInteger() == 0x41442820) cancelMessageList(); break; case 0x2000: if (param.asInteger() != 0) { setRectList(0x004B9008); _klaymen->setKlaymenIdleTable3(); } else { setRectList(0x004B8FF8); _klaymen->setKlaymenIdleTable1(); } break; case 0x480B: if (sender == _ssFloorButton && _doorStatus == 1) { sendMessage(_asDoor, 0x4808, 0); _doorStatus = 0; _countdown1 = 90; } break; case 0x4826: if (sender == _asTape1 || sender == _asTape2) { if (_klaymen->getX() >= 228 && _klaymen->getX() <= 500) { sendEntityMessage(_klaymen, 0x1014, sender); setMessageList(0x004B8F78); } else if (_klaymen->getX() < 228) setMessageList2(0x004B8F00); } break; } return 0; }
uint32 AsScene2401WaterSpit::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x120A0013) playSound(0, kAsScene2401WaterSpitFileHashes1[_soundIndex]); break; case 0x2000: _x = 240; _y = 447; _soundIndex = getSubVar(VA_CURR_WATER_PIPES_LEVEL, param.asInteger()); startAnimation(kAsScene2401WaterSpitFileHashes2[param.asInteger()], 0, -1); setVisible(true); playSound(0, 0x48640244); break; case 0x3002: stopAnimation(); setVisible(false); break; } return messageResult; }
uint32 AsScene2401WaterFlushing::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (_flushLoopCount > 0 && param.asInteger() == 0x02421405) { startAnimationByHash(0xB8596884, 0x01084280, 0); _flushLoopCount--; } break; case 0x2002: if (param.asInteger() > 0) { _flushLoopCount = param.asInteger() - 1; _countdown = _vm->_rnd->getRandomNumber(3) + 1; } break; case 0x3002: stopAnimation(); setVisible(false); break; } return messageResult; }
uint32 KmScene2101::hmHitByDoor(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender); int16 speedUpFrameIndex; switch (messageNum) { case 0x1008: speedUpFrameIndex = getFrameIndex(kKlaymenSpeedUpHash); if (_currFrameIndex < speedUpFrameIndex) { startAnimation(0x35AA8059, speedUpFrameIndex, -1); _y = 438; } messageResult = 0; break; case NM_ANIMATION_START: if (param.asInteger() == 0x1A1A0785) { playSound(0, 0x40F0A342); } else if (param.asInteger() == 0x60428026) { playSound(0, 0x40608A59); } break; } return messageResult; }
uint32 AsScene2402TV::hmJoke(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x431EA0B0) playSound(0); break; case 0x3002: gotoNextState(); break; } return messageResult; }
uint32 Scene2001::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2000: if (param.asInteger()) { setRectList(0x004B3680); _klaymen->setKlaymenIdleTable3(); } else { setRectList(0x004B3670); _klaymen->setKlaymenIdleTable1(); } } return 0; }
uint32 AsScene1303Balloon::hmBalloonPopped(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x020B0003) playSound(0, 0x742B0055); break; case 0x3002: playSound(0, 0x470007EE); stopAnimation(); setVisible(false); SetMessageHandler(NULL); break; } return messageResult; }
uint32 Scene1202::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = 0; Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_MOUSE_CLICK: if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_isPuzzleSolved) leaveScene(0); break; case NM_ANIMATION_UPDATE: _clickedIndex = (int)param.asInteger(); break; case NM_POSITION_CHANGE: _counter--; break; } return messageResult; }
uint32 KmScene1305::xHandleMessage(int messageNum, const MessageParam ¶m) { switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x4804: GotoState(&KmScene1305::stCrashDown); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; } return 0; }
uint32 Scene1608::hmUpperFloor(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x60842040) _carStatus = 1; break; case 0x200D: sendMessage(_parentModule, 0x200D, 0); break; case 0x4826: if (sender == _asKey) { sendEntityMessage(_kmScene1608, 0x1014, _asKey); setMessageList(0x004B4760); } break; } return 0; }
uint32 KmScene1304::xHandleMessage(int messageNum, const MessageParam ¶m) { switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x4812: if (param.asInteger() == 2) GotoState(&Klaymen::stPickUpNeedle); else if (param.asInteger() == 1) GotoState(&Klaymen::stPickUpTube); else GotoState(&Klaymen::stPickUpGeneric); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481F: if (param.asInteger() == 1) GotoState(&Klaymen::stTurnAwayFromUse); else if (param.asInteger() == 0) GotoState(&Klaymen::stTurnToUseHalf); else GotoState(&Klaymen::stWonderAbout); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return 0; }
uint32 Module::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { switch (messageNum) { case 0x0008: sendMessage(_parentModule, 8, 0); return 0; case 0x1009: _moduleResult = param.asInteger(); _done = true; return 0; case 0x100A: case 0x1023: case 0x1024: // Unused resource preloading messages return 0; default: if (_childObject && sender == _parentModule) return sender->sendMessage(_childObject, messageNum, param); } return 0; }
uint32 Scene2901::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x0001: if (param.asPoint().x <= 20 || param.asPoint().x >= 620) leaveScene((uint32)-1); break; case 0x2000: if (_currLocationButtonNum != _selectedButtonNum) leaveScene(_selectedButtonNum); break; case 0x2001: if (_currLocationButtonNum == _selectedButtonNum) _selectedButtonNum = _currWhirlButtonNum; _ssLocationButtonLights[_selectedButtonNum]->hide(); _selectedButtonNum = param.asInteger(); if (!getSubVar(V_TELEPORTER_DEST_AVAILABLE, _selectedButtonNum)) _selectedButtonNum = _currLocationButtonNum; break; } return 0; }
uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case NM_ANIMATION_UPDATE: _isSittingInTeleporter = param.asInteger() != 0; messageResult = 1; break; case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case NM_KLAYMEN_STAND_IDLE: if (_isSittingInTeleporter) GotoState(&Klaymen::stSitIdleTeleporter); else GotoState(&Klaymen::stTryStandIdle); break; case 0x4811: GotoState(&KmScene2101::stHitByDoor); break; case NM_KLAYMEN_PICKUP: if (param.asInteger() == 2) GotoState(&Klaymen::stPickUpNeedle); else if (param.asInteger() == 1) GotoState(&Klaymen::stPickUpTube); else GotoState(&Klaymen::stPickUpGeneric); break; case NM_KLAYMEN_PRESS_BUTTON: if (param.asInteger() == 1) GotoState(&Klaymen::stPressButton); else if (param.asInteger() == 2) GotoState(&Klaymen::stPressFloorButton); else GotoState(&Klaymen::stPressButtonSide); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case NM_KLAYMEN_TURN_TO_USE: if (_isSittingInTeleporter) GotoState(&Klaymen::stTurnToUseInTeleporter); break; case NM_KLAYMEN_RETURN_FROM_USE: if (_isSittingInTeleporter) GotoState(&Klaymen::stReturnFromUseInTeleporter); break; case 0x4834: GotoState(&Klaymen::stStepOver); break; case 0x4835: sendMessage(_parentScene, 0x2000, 1); _isSittingInTeleporter = true; GotoState(&Klaymen::stSitInTeleporter); break; case 0x4836: sendMessage(_parentScene, 0x2000, 0); _isSittingInTeleporter = false; GotoState(&Klaymen::stGetUpFromTeleporter); break; case 0x483D: teleporterAppear(0xFF290E30); break; case 0x483E: teleporterDisappear(0x9A28CA1C); break; } return messageResult; }
uint32 KmScene2403::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x480D: GotoState(&Klaymen::stPullCord); break; case 0x4812: GotoState(&Klaymen::stPickUpGeneric); break; case 0x4816: if (param.asInteger() == 1) GotoState(&Klaymen::stPressButton); else if (param.asInteger() == 2) GotoState(&Klaymen::stPressFloorButton); else GotoState(&Klaymen::stPressButtonSide); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481F: if (param.asInteger() == 0) GotoState(&Klaymen::stWonderAboutHalf); else if (param.asInteger() == 1) GotoState(&Klaymen::stWonderAboutAfter); else if (param.asInteger() == 3) GotoState(&Klaymen::stTurnToUseHalf); else if (param.asInteger() == 4) GotoState(&Klaymen::stTurnAwayFromUse); else GotoState(&Klaymen::stWonderAbout); break; case 0x4820: sendMessage(_parentScene, 0x2000, 0); GotoState(&Klaymen::stContinueClimbLadderUp); break; case 0x4821: sendMessage(_parentScene, 0x2000, 0); _destY = param.asInteger(); GotoState(&Klaymen::stStartClimbLadderDown); break; case 0x4822: sendMessage(_parentScene, 0x2000, 0); _destY = param.asInteger(); GotoState(&Klaymen::stStartClimbLadderUp); break; case 0x4823: sendMessage(_parentScene, 0x2001, 0); GotoState(&Klaymen::stClimbLadderHalf); break; case 0x482D: setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0); gotoNextStateExt(); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return messageResult; }
uint32 KmScene2401::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x4816: if (param.asInteger() == 1) GotoState(&Klaymen::stPressButton); else if (param.asInteger() == 2) GotoState(&Klaymen::stPressFloorButton); else GotoState(&Klaymen::stPressButtonSide); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481F: if (param.asInteger() == 1) GotoState(&Klaymen::stTurnAwayFromUse); else if (param.asInteger() == 0) GotoState(&Klaymen::stTurnToUseHalf); else GotoState(&Klaymen::stWonderAbout); break; case 0x482D: setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0); gotoNextStateExt(); break; case 0x482E: if (param.asInteger() == 1) GotoState(&Klaymen::stWalkToFrontNoStep); else GotoState(&Klaymen::stWalkToFront); break; case 0x482F: if (param.asInteger() == 1) GotoState(&Klaymen::stTurnToFront); else GotoState(&Klaymen::stTurnToBack); break; case 0x4832: GotoState(&Klaymen::stUseTube); break; case 0x4833: if (param.asInteger() == 1) GotoState(&Klaymen::stWonderAbout); else { _spitPipeIndex = sendMessage(_parentScene, 0x2000, 0); GotoState(&KmScene2401::stTrySpitIntoPipe); } break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return messageResult; }
uint32 KmScene2402::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: if (!getGlobalVar(V_TV_JOKE_TOLD)) GotoState(&Klaymen::stStandWonderAbout); else GotoState(&Klaymen::stTryStandIdle); break; case 0x4804: if (param.asInteger() != 0) { _destX = param.asInteger(); GotoState(&Klaymen::stWalkingFirst); } else GotoState(&Klaymen::stPeekWall); break; case 0x4812: GotoState(&Klaymen::stPickUpGeneric); break; case 0x4816: if (param.asInteger() == 1) GotoState(&Klaymen::stPressButton); else if (param.asInteger() == 2) GotoState(&Klaymen::stPressFloorButton); else GotoState(&Klaymen::stPressButtonSide); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481F: if (param.asInteger() == 0) GotoState(&Klaymen::stWonderAboutHalf); else if (param.asInteger() == 1) GotoState(&Klaymen::stWonderAboutAfter); else if (param.asInteger() == 3) GotoState(&Klaymen::stTurnToUseHalf); else if (param.asInteger() == 4) GotoState(&Klaymen::stTurnAwayFromUse); else GotoState(&Klaymen::stWonderAbout); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return messageResult; }
uint32 KmScene2406::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x4804: if (param.asInteger() != 0) { _destX = param.asInteger(); GotoState(&Klaymen::stWalkingFirst); } else GotoState(&Klaymen::stPeekWall); break; case 0x4812: if (param.asInteger() == 2) GotoState(&Klaymen::stPickUpNeedle); else if (param.asInteger() == 1) GotoState(&Klaymen::stPickUpTube); else GotoState(&Klaymen::stPickUpGeneric); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481A: GotoState(&Klaymen::stInsertDisk); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481D: GotoState(&Klaymen::stTurnToUse); break; case 0x481E: GotoState(&Klaymen::stReturnFromUse); break; case 0x481F: if (param.asInteger() == 0) GotoState(&Klaymen::stWonderAboutHalf); else if (param.asInteger() == 1) GotoState(&Klaymen::stWonderAboutAfter); else if (param.asInteger() == 3) GotoState(&Klaymen::stTurnToUseHalf); else if (param.asInteger() == 4) GotoState(&Klaymen::stTurnAwayFromUse); else GotoState(&Klaymen::stWonderAbout); break; case 0x4820: sendMessage(_parentScene, 0x2000, 0); GotoState(&Klaymen::stContinueClimbLadderUp); break; case 0x4821: sendMessage(_parentScene, 0x2000, 0); _destY = param.asInteger(); GotoState(&Klaymen::stStartClimbLadderDown); break; case 0x4822: sendMessage(_parentScene, 0x2000, 0); _destY = param.asInteger(); GotoState(&Klaymen::stStartClimbLadderUp); break; case 0x4823: sendMessage(_parentScene, 0x2001, 0); GotoState(&Klaymen::stClimbLadderHalf); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return messageResult; }
uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam ¶m) { switch (messageNum) { case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: GotoState(&Klaymen::stTryStandIdle); break; case 0x480A: if (param.asInteger() == 1) GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject); else GotoState(&Klaymen::stMoveObjectFaceObject); break; case 0x480D: GotoState(&Klaymen::stUseLever); break; case 0x4812: if (param.asInteger() == 2) GotoState(&Klaymen::stPickUpNeedle); else if (param.asInteger() == 1) GotoState(&Klaymen::stPickUpTube); else GotoState(&Klaymen::stPickUpGeneric); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481A: if (param.asInteger() == 1) GotoState(&Klaymen::stInsertKey); else GotoState(&Klaymen::stInsertDisk); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481D: GotoState(&Klaymen::stTurnToUse); break; case 0x481E: GotoState(&Klaymen::stReturnFromUse); break; case 0x4827: GotoState(&Klaymen::stReleaseLever); break; case 0x4834: GotoState(&Klaymen::stStepOver); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return 0; }
uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam ¶m) { uint32 messageResult = 0; switch (messageNum) { case 0x2000: _isSittingInTeleporter = param.asInteger() != 0; messageResult = 1; break; case 0x4001: case 0x4800: startWalkToX(param.asPoint().x, false); break; case 0x4004: if (_isSittingInTeleporter) GotoState(&Klaymen::stSitIdleTeleporter); else GotoState(&Klaymen::stTryStandIdle); break; case 0x4812: if (param.asInteger() == 2) GotoState(&Klaymen::stPickUpNeedle); else if (param.asInteger() == 1) GotoState(&Klaymen::stPickUpTube); else GotoState(&Klaymen::stPickUpGeneric); break; case 0x4816: if (param.asInteger() == 1) GotoState(&Klaymen::stPressButton); else if (param.asInteger() == 2) GotoState(&Klaymen::stPressFloorButton); else GotoState(&Klaymen::stPressButtonSide); break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481A: GotoState(&Klaymen::stInsertDisk); break; case 0x481B: if (param.asPoint().y != 0) startWalkToXDistance(param.asPoint().y, param.asPoint().x); else startWalkToAttachedSpriteXDistance(param.asPoint().x); break; case 0x481D: if (_isSittingInTeleporter) GotoState(&Klaymen::stTurnToUseInTeleporter); else GotoState(&Klaymen::stTurnToUse); break; case 0x481E: if (_isSittingInTeleporter) GotoState(&Klaymen::stReturnFromUseInTeleporter); else GotoState(&Klaymen::stReturnFromUse); break; case 0x481F: if (param.asInteger() == 1) GotoState(&Klaymen::stWonderAboutAfter); else if (param.asInteger() == 0) GotoState(&Klaymen::stWonderAboutHalf); else if (param.asInteger() == 4) GotoState(&Klaymen::stTurnAwayFromUse); else if (param.asInteger() == 3) GotoState(&Klaymen::stTurnToUseHalf); else GotoState(&Klaymen::stWonderAbout); break; case 0x482D: setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0); gotoNextStateExt(); break; case 0x482E: if (param.asInteger() == 1) GotoState(&Klaymen::stWalkToFrontNoStep); else GotoState(&Klaymen::stWalkToFront); break; case 0x482F: if (param.asInteger() == 1) GotoState(&Klaymen::stTurnToFront); else GotoState(&Klaymen::stTurnToBack); break; case 0x4834: GotoState(&Klaymen::stStepOver); break; case 0x4835: sendMessage(_parentScene, 0x2000, 1); _isSittingInTeleporter = true; GotoState(&Klaymen::stSitInTeleporter); break; case 0x4836: sendMessage(_parentScene, 0x2000, 0); _isSittingInTeleporter = false; GotoState(&Klaymen::stGetUpFromTeleporter); break; case 0x483D: teleporterAppear(0xEE084A04); break; case 0x483E: teleporterDisappear(0xB86A4274); break; case 0x483F: startSpecialWalkRight(param.asInteger()); break; case 0x4840: startSpecialWalkLeft(param.asInteger()); break; } return messageResult; }