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; }
void Module1600::createScene(int sceneNum, int which) { debug(1, "Module1600::createScene(%d, %d)", sceneNum, which); _sceneNum = sceneNum; switch (_sceneNum) { case 0: _vm->gameState().sceneNum = 0; createNavigationScene(0x004B39D0, which); break; case 1: _vm->gameState().sceneNum = 1; createNavigationScene(0x004B3A30, which); break; case 2: _vm->gameState().sceneNum = 2; createNavigationScene(0x004B3A60, which); break; case 3: _vm->gameState().sceneNum = 3; createNavigationScene(0x004B3A90, which); break; case 4: _vm->gameState().sceneNum = 4; createNavigationScene(0x004B3B20, which); break; case 5: _vm->gameState().sceneNum = 5; createNavigationScene(0x004B3B50, which); break; case 6: _vm->gameState().sceneNum = 6; createNavigationScene(0x004B3B80, which); break; case 7: _vm->gameState().sceneNum = 7; _childObject = new Scene1608(_vm, this, which); break; case 8: _vm->gameState().sceneNum = 8; _childObject = new Scene1609(_vm, this); break; case 1001: _vm->gameState().sceneNum = 1; if (getGlobalVar(V_TALK_COUNTING_INDEX) == 1) createSmackerScene(0x80050200, true, true, false); else if (getGlobalVar(V_TALK_COUNTING_INDEX) == 2) createSmackerScene(0x80090200, true, true, false); else createSmackerScene(0x80000200, true, true, false); if (getGlobalVar(V_TALK_COUNTING_INDEX) >= 2) setGlobalVar(V_TALK_COUNTING_INDEX, 0); else incGlobalVar(V_TALK_COUNTING_INDEX, +1); break; } SetUpdateHandler(&Module1600::updateScene); _childObject->handleUpdate(); }
SsScene1907UpDownButton::SsScene1907UpDownButton(NeverhoodEngine *vm, Scene1907 *parentScene, AsScene1907Symbol *asScene1907Symbol) : StaticSprite(vm, 1400), _parentScene(parentScene), _asScene1907Symbol(asScene1907Symbol), _countdown1(0) { loadSprite(0x64516424, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 1400); setVisible(false); loadSound(0, 0x44061000); SetUpdateHandler(&SsScene1907UpDownButton::update); SetMessageHandler(&SsScene1907UpDownButton::handleMessage); if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { if (getGlobalVar(V_STAIRS_DOWN)) setToDownPosition(); else setToUpPosition(); } }
Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which) : Module(vm, parentModule), _soundVolume(0) { _vm->_soundMan->addSoundList(0x1A214010, kModule2300SoundList); _vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150); _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0; if (_isWallBroken) { _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); _vm->_soundMan->playSoundLooping(0x90F0D1C3); } else { _vm->_soundMan->setSoundParams(0x90F0D1C3, false, 0, 0, 0, 0); } _vm->_soundMan->playTwoSounds(0x1A214010, 0x48498E46, 0x50399F64, 0); _vm->_soundMan->playTwoSounds(0x1A214010, 0x41861371, 0x43A2507F, 0); if (which < 0) createScene(_vm->gameState().sceneNum, -1); else if (which == 1) createScene(2, 0); else if (which == 2) createScene(3, 0); else if (which == 3) createScene(4, -1); else if (which == 4) createScene(1, 3); else createScene(0, 1); }
AsScene2402TV::AsScene2402TV(NeverhoodEngine *vm, Klaymen *klaymen) : AnimatedSprite(vm, 1100), _klaymen(klaymen), _countdown1(0), _countdown2(0) { _x = 260; _y = 210; createSurface(100, 127, 90); setDoDeltaX(1); SetMessageHandler(&Sprite::handleMessage); if (!getGlobalVar(V_TV_JOKE_TOLD)) { loadSound(0, 0x58208810); _countdown1 = 48; startAnimation(0x4919397A, 0, -1); _newStickFrameIndex = 0; SetUpdateHandler(&AsScene2402TV::upWait); } else { int16 frameIndex; if (_klaymen->getX() > 320) _currFrameIndex = 29; frameIndex = CLIP<int16>((_klaymen->getX() - _x + 150) / 10, 0, 29); startAnimation(0x050A0103, frameIndex, -1); _newStickFrameIndex = frameIndex; _countdown1 = 0; SetUpdateHandler(&AsScene2402TV::upFocusKlaymen); } }
Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule) : Scene(vm, parentModule), _currMovingSymbolIndex(0), _pluggedInCount(0), _moveDownCountdown(0), _moveUpCountdown(0), _countdown3(0), _hasPlugInFailed(false) { setBackground(0x20628E05); setPalette(0x20628E05); for (int i = 0; i < 9; i++) _positionFree[i] = true; for (int i = 0; i < 9; i++) { _asSymbols[i] = insertSprite<AsScene1907Symbol>(this, i, getRandomPositionIndex()); addCollisionSprite(_asSymbols[i]); } _ssUpDownButton = insertSprite<SsScene1907UpDownButton>(this, _asSymbols[8]); addCollisionSprite(_ssUpDownButton); _asWaterHint = insertSprite<AsScene1907WaterHint>(); insertPuzzleMouse(0x28E0120E, 20, 620); SetMessageHandler(&Scene1907::handleMessage); SetUpdateHandler(&Scene1907::update); if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) _pluggedInCount = 9; loadSound(0, 0x72004A10); loadSound(1, 0x22082A12); loadSound(2, 0x21100A10); loadSound(3, 0x68E25540); }
Scene1202::Scene1202(NeverhoodEngine *vm, Module *parentModule) : Scene(vm, parentModule), _paletteResource(vm), _soundToggle(true), _isPuzzleSolved(false), _counter(0), _clickedIndex(-1) { SetMessageHandler(&Scene1202::handleMessage); SetUpdateHandler(&Scene1202::update); setBackground(0x60210ED5); setPalette(0x60210ED5); addEntity(_palette); _paletteResource.load(0x60250EB5); _paletteResource.copyPalette(_paletteData); insertPuzzleMouse(0x10ED160A, 20, 620); for (int tntIndex = 0; tntIndex < 18; tntIndex++) { _asTntItems[tntIndex] = insertSprite<AsScene1202TntItem>(this, tntIndex); addCollisionSprite(_asTntItems[tntIndex]); } insertStaticSprite(0x8E8419C1, 1100); if (getGlobalVar(V_TNT_DUMMY_BUILT)) SetMessageHandler(&Scene1202::hmSolved); playSound(0, 0x40106542); loadSound(1, 0x40005446); loadSound(2, 0x40005446); // Same sound as slot 1 loadSound(3, 0x68E25540); }
void Module2000::updateScene() { if (!updateChild()) { switch (_sceneNum) { case 0: if (_moduleResult == 1) leaveModule(0); else createScene(1, 0); break; case 1: if (_moduleResult == 0) { if (getGlobalVar(V_WORLDS_JOINED)) createScene(1, 0); else createScene(2, -1); } else if (_moduleResult == 1) createScene(1, 1); else if (_moduleResult == 2) createScene(0, 0); break; case 2: createScene(1, 0); break; } } }
NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint32 navigationListId, int navigationIndex, const byte *itemsTypes) : Scene(vm, parentModule), _itemsTypes(itemsTypes), _navigationIndex(navigationIndex), _smackerDone(false), _isWalkingForward(false), _isTurning(false), _smackerFileHash(0), _interactive(true), _leaveSceneAfter(false) { _navigationList = _vm->_staticData->getNavigationList(navigationListId); _navigationListId = navigationListId; if (_navigationIndex < 0) { _navigationIndex = (int)getGlobalVar(V_NAVIGATION_INDEX); if (_navigationIndex >= (int)_navigationList->size()) _navigationIndex = 0; } setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex); SetUpdateHandler(&NavigationScene::update); SetMessageHandler(&NavigationScene::handleMessage); _smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, (*_navigationList)[_navigationIndex].fileHash, true, true)); createMouseCursor(); _vm->_screen->clear(); _vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder()); sendMessage(_parentModule, 0x100A, _navigationIndex); }
SsScene3009SymbolEdges::SsScene3009SymbolEdges(NeverhoodEngine *vm, int index) : StaticSprite(vm, 1400), _blinkCountdown(0) { loadSprite(kSsScene3009SymbolEdgesFileHashes[index], kSLFDefDrawOffset | kSLFDefPosition, 600); if (getGlobalVar(V_ROBOT_HIT)) hide(); else startBlinking(); SetUpdateHandler(&SsScene3009SymbolEdges::update); }
SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm) : StaticSprite(vm, 0x11122122, 200) { _firstY = _y; if (getGlobalVar(V_FLYTRAP_RING_FENCE)) _y += 152; loadSound(0, 0x7A00400C); loadSound(1, 0x78184098); SetUpdateHandler(&SsScene1302Fence::update); SetMessageHandler(&SsScene1302Fence::handleMessage); SetSpriteUpdate(NULL); }
AsScene3009VerticalIndicator::AsScene3009VerticalIndicator(NeverhoodEngine *vm, Scene3009 *parentScene, int index) : AnimatedSprite(vm, 1000), _parentScene(parentScene), _enabled(false) { _x = 300; _y = getGlobalVar(V_CANNON_RAISED) ? 52 : 266; createSurface1(0xC2463913, 1200); _needRefresh = true; updatePosition(); setVisible(false); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene3009VerticalIndicator::handleMessage); }
void SsScene2609Button::update() { updatePosition(); if (_countdown != 0 && (--_countdown == 0)) { if (getGlobalVar(V_WATER_RUNNING)) { setGlobalVar(V_WATER_RUNNING, 0); sendMessage(_parentScene, 0x2001, 0); } else { setGlobalVar(V_WATER_RUNNING, 1); sendMessage(_parentScene, 0x2002, 0); } } }
DiskplayerScene::DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int paletteIndex) : Scene(vm, parentModule), _diskIndex(0), _appearCountdown(0), _tuneInCountdown(0), _hasAllDisks(false), _dropKey(false), _inputDisabled(true), _updateStatus(kUSStopped) { int availableDisksCount = 0; setBackground(0x8A000044); setPalette(kDiskplayerPaletteFileHashes[paletteIndex]); _ssPlayButton = insertSprite<DiskplayerPlayButton>(this); addCollisionSprite(_ssPlayButton); _asKey = insertSprite<AsDiskplayerSceneKey>(); for (int i = 0; i < 20; i++) { _diskAvailable[i] = false; if (getSubVar(VA_IS_TAPE_INSERTED, i)) availableDisksCount++; } for (int i = 0; i < availableDisksCount; i++) _diskAvailable[kDiskplayerInitArray[i] - 1] = true; for (int slotIndex = 0; slotIndex < 20; slotIndex++) { _diskSlots[slotIndex] = new DiskplayerSlot(_vm, this, slotIndex, _diskAvailable[slotIndex]); addEntity(_diskSlots[slotIndex]); } _hasAllDisks = availableDisksCount == 20; if (_hasAllDisks && !getGlobalVar(V_HAS_FINAL_KEY)) _dropKey = true; _finalDiskSlot = new DiskplayerSlot(_vm, this, 20, false); addEntity(_finalDiskSlot); insertPuzzleMouse(0x000408A8, 20, 620); showMouse(false); _diskSmackerPlayer = new SmackerPlayer(_vm, this, 0x08288103, false, true); addEntity(_diskSmackerPlayer); addSurface(_diskSmackerPlayer->getSurface()); _diskSmackerPlayer->setDrawPos(154, 86); _vm->_screen->setSmackerDecoder(_diskSmackerPlayer->getSmackerDecoder()); _palette->usePalette(); SetMessageHandler(&DiskplayerScene::handleMessage); SetUpdateHandler(&DiskplayerScene::update); _appearCountdown = 6; }
Scene1901::Scene1901(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule) { Sprite *tempSprite; setRectList(0x004B34C8); setBackground(0x01303227); setPalette(0x01303227); insertScreenMouse(0x0322301B); insertStaticSprite(0x42213133, 1100); if (!getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) insertStaticSprite(0x40A40168, 100); else if (getGlobalVar(V_STAIRS_DOWN)) { insertStaticSprite(0x124404C4, 100); setGlobalVar(V_STAIRS_DOWN_ONCE, 1); } else insertStaticSprite(0x02840064, 100); if (which < 0) { // Restoring game insertKlaymen<KmScene1901>(120, 380); setMessageList(0x004B3408); } else if (which == 1) { // Klaymen returning from the puzzle insertKlaymen<KmScene1901>(372, 380); setMessageList(0x004B3410); } else { // Klaymen entering from the left insertKlaymen<KmScene1901>(0, 380); setMessageList(0x004B3400); } tempSprite = insertStaticSprite(0x4830A402, 1100); _klaymen->setClipRect(tempSprite->getDrawRect().x, 0, 640, 480); }
AsScene1907Symbol::AsScene1907Symbol(NeverhoodEngine *vm, Scene1907 *parentScene, int elementIndex, int positionIndex) : AnimatedSprite(vm, 1000 - positionIndex), _parentScene(parentScene), _elementIndex(elementIndex), _isMoving(false) { _plugInFailed = false; _plugInTryCount = 0; if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { _isPluggedIn = true; _currPositionIndex = elementIndex; if (!getGlobalVar(V_STAIRS_DOWN)) { _x = kAsScene1907SymbolPluggedInPositions[_currPositionIndex].x; _y = kAsScene1907SymbolPluggedInPositions[_currPositionIndex].y; } else { _x = kAsScene1907SymbolPluggedInDownPositions[_currPositionIndex].x; _y = kAsScene1907SymbolPluggedInDownPositions[_currPositionIndex].y; } createSurface1(kAsScene1907SymbolFileHashes[_elementIndex], 1000 + _currPositionIndex); startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], -1, -1); _newStickFrameIndex = STICK_LAST_FRAME; } else { _isPluggedIn = false; _currPositionIndex = positionIndex; loadSound(0, 0x74231924); loadSound(1, 0x36691914); loadSound(2, 0x5421D806); _parentScene->setPositionFree(_currPositionIndex, false); _x = kAsScene1907SymbolGroundPositions[_currPositionIndex].x; _y = kAsScene1907SymbolGroundPositions[_currPositionIndex].y; createSurface1(kAsScene1907SymbolFileHashes[_elementIndex], 1000 + _currPositionIndex); startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], 0, -1); _newStickFrameIndex = 0; } _collisionBoundsOffset.set(0, 0, 80, 80); Sprite::updateBounds(); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1907Symbol::handleMessage); }
AsScene2609Water::AsScene2609Water(NeverhoodEngine *vm) : AnimatedSprite(vm, 1000) { _x = 240; _y = 420; setDoDeltaX(1); createSurface1(0x9C210C90, 1200); setClipRect(260, 260, 400, 368); _vm->_soundMan->addSound(0x08526C36, 0xDC2769B0); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene2609Water::handleMessage); if (getGlobalVar(V_WATER_RUNNING)) sendMessage(this, 0x2002, 0); }
uint32 SsScene1907UpDownButton::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: if (_countdown1 == 0 && !_asScene1907Symbol->isMoving() && getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { setVisible(true); _countdown1 = 4; updatePosition(); playSound(0); } messageResult = 1; } return messageResult; }
SsScene2609Button::SsScene2609Button(NeverhoodEngine *vm, Scene *parentScene) : StaticSprite(vm, 1400), _parentScene(parentScene), _countdown(0) { SetUpdateHandler(&SsScene2609Button::update); SetMessageHandler(&SsScene2609Button::handleMessage); loadSprite(0x825A6923, kSLFDefDrawOffset | kSLFDefPosition | kSLFDefCollisionBoundsOffset, 400); if (!getGlobalVar(V_WATER_RUNNING)) setVisible(false); loadSound(0, 0x10267160); loadSound(1, 0x7027FD64); loadSound(2, 0x44043000); loadSound(3, 0x44045000); }
void Module1200::updateScene() { if (!updateChild()) { switch (_sceneNum) { case 0: if (_moduleResult == 1) createScene(1, 0); else if (_moduleResult == 2) { if (getGlobalVar(V_CREATURE_EXPLODED) && !getGlobalVar(V_SEEN_CREATURE_EXPLODE_VID)) createScene(2, -1); else leaveModule(1); } else leaveModule(0); break; case 1: createScene(0, 1); break; case 2: _vm->_soundMan->startMusic(0x62222CAE, 0, 0); createScene(0, 3); break; } } }
uint32 Scene1907::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_MOUSE_CLICK: if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_hasPlugInFailed && _moveDownCountdown == 0 && _moveUpCountdown == 0 && _countdown3 == 0) { leaveScene(0); } break; case NM_ANIMATION_UPDATE: if (getGlobalVar(V_STAIRS_DOWN)) { playSound(0); for (int i = 0; i < 9; i++) _asSymbols[i]->moveUp(); _ssUpDownButton->setToUpPosition(); setGlobalVar(V_STAIRS_DOWN, 0); } else { if (!getGlobalVar(V_WALL_BROKEN)) { playSound(2); _countdown3 = 5; } else { playSound(1); _ssUpDownButton->setToDownPosition(); setGlobalVar(V_STAIRS_DOWN, 1); } _moveDownCountdown = 1; _currMovingSymbolIndex = 8; } break; case 0x2001: playSound(3); setGlobalVar(V_STAIRS_PUZZLE_SOLVED, 1); break; } return 0; }
AsScene3009HorizontalIndicator::AsScene3009HorizontalIndicator(NeverhoodEngine *vm, Scene3009 *parentScene, uint32 cannonTargetStatus) : AnimatedSprite(vm, 1000), _parentScene(parentScene), _enabled(false) { _x = getGlobalVar(V_CANNON_TURNED) ? 533 : 92; _y = 150; createSurface1(0xC0C12954, 1200); _needRefresh = true; updatePosition(); setVisible(false); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene3009HorizontalIndicator::handleMessage); if (cannonTargetStatus == kCTSRightRobotNoTarget || cannonTargetStatus == kCTSRightRobotIsTarget || cannonTargetStatus == kCTSRightNoRobot) { SetSpriteUpdate(&AsScene3009HorizontalIndicator::suMoveRight); _x = 280; } }
void Module2300::createScene(int sceneNum, int which) { debug(1, "Module2300::createScene(%d, %d)", sceneNum, which); _sceneNum = sceneNum; switch (_sceneNum) { case 0: _vm->gameState().sceneNum = 0; createNavigationScene(0x004B67B8, which); break; case 1: _vm->gameState().sceneNum = 1; createNavigationScene(0x004B67E8, which); if (_isWallBroken) { _soundVolume = 15; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 15); } break; case 2: _vm->gameState().sceneNum = 2; createNavigationScene(0x004B6878, which); break; case 3: _vm->gameState().sceneNum = 3; if (getGlobalVar(V_WALL_BROKEN)) createNavigationScene(0x004B68F0, which); else { _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); createNavigationScene(0x004B68A8, which); if (_isWallBroken) { _soundVolume = 87; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 87); } } break; case 4: _vm->gameState().sceneNum = 4; _vm->_soundMan->setTwoSoundsPlayFlag(true); createSmackerScene(0x20080A0B, true, true, false); break; case 9999: createDemoScene(); break; } SetUpdateHandler(&Module2300::updateScene); _childObject->handleUpdate(); }
AsScene1302Bridge::AsScene1302Bridge(NeverhoodEngine *vm, Scene *parentScene) : AnimatedSprite(vm, 1100), _parentScene(parentScene) { _x = 320; _y = 240; createSurface1(0x88148150, 500); if (!getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { startAnimation(0x88148150, 0, -1); _newStickFrameIndex = 0; } else { startAnimation(0x88148150, -1, -1); _newStickFrameIndex = STICK_LAST_FRAME; } loadSound(0, 0x68895082); loadSound(1, 0x689BD0C1); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1302Bridge::handleMessage); }
void Module2900::updateScene() { if (!updateChild()) { switch (_sceneNum) { case 0: if (_moduleResult == (uint32)-1) { leaveModule((uint32)-1); } else { _teleporterModuleResult = _moduleResult; switch (getGlobalVar(V_TELEPORTER_WHICH)) { case 0: createScene(3, 4); break; case 1: createScene(2, 2); break; case 2: createScene(5, 2); break; case 3: createScene(4, 2); break; case 4: createScene(6, 2); break; case 5: createScene(1, 2); break; default: leaveModule(_moduleResult); break; } } break; case 1: case 2: case 3: case 4: case 5: case 6: leaveModule(_teleporterModuleResult); break; } } }
void AsScene1907Symbol::suMoveUp() { _y -= _yIncr; if (getGlobalVar(V_WALL_BROKEN)) { if (_y - (9 + (_elementIndex > 5 ? 31 : 0)) < kAsScene1907SymbolPluggedInPositions[_elementIndex].y) _yIncr--; else _yIncr++; } else _yIncr = 2; if (_yIncr > 9) _yIncr = 9; else if (_yIncr < 1) _yIncr = 1; if (_y < kAsScene1907SymbolPluggedInPositions[_elementIndex].y) { _y = kAsScene1907SymbolPluggedInPositions[_elementIndex].y; _isMoving = false; SetSpriteUpdate(NULL); } }
uint32 AsScene1105TeddyBear::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case NM_POSITION_CHANGE: if (getGlobalVar(V_ROBOT_TARGET)) { startAnimation(0x6B0C0432, 0, -1); playSound(0); } else { startAnimation(0x65084002, 0, -1); playSound(1); } break; case NM_ANIMATION_STOP: sendMessage(_parentScene, 0x2003, 0); stopAnimation(); break; } return messageResult; }
Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule) : Scene(vm, parentModule), _countdown1(1), _currentSymbolIndex(0), _symbolPosition(0), _changeCurrentSymbol(true), _isSolved(false) { _vm->gameModule()->initCodeSymbolsPuzzle(); _noisySymbolIndex = getGlobalVar(V_NOISY_SYMBOL_INDEX); SetMessageHandler(&Scene1609::handleMessage); SetUpdateHandler(&Scene1609::update); setBackground(0x92124A14); setPalette(0x92124A14); insertPuzzleMouse(0x24A10929, 20, 620); for (int symbolPosition = 0; symbolPosition < 12; symbolPosition++) _asSymbols[symbolPosition] = insertSprite<AsScene3011Symbol>(symbolPosition, false); _ssButton = insertSprite<SsScene3011Button>(this, true); addCollisionSprite(_ssButton); loadSound(0, 0x68E25540); }
void Module2000::createScene(int sceneNum, int which) { debug(1, "Module2000::createScene(%d, %d)", sceneNum, which); _sceneNum = sceneNum; switch (_sceneNum) { case 0: _vm->gameState().sceneNum = 0; _childObject = new Scene2001(_vm, this, which); break; case 1: _vm->gameState().sceneNum = 1; createNavigationScene(getGlobalVar(V_WORLDS_JOINED) ? 0x004B7B48 : 0x004B7B00, which); break; case 2: _vm->gameState().sceneNum = 2; setGlobalVar(V_WORLDS_JOINED, 1); setSubVar(V_TELEPORTER_DEST_AVAILABLE, 1, 1); createSmackerScene(0x204B2031, true, true, false); break; } SetUpdateHandler(&Module2000::updateScene); _childObject->handleUpdate(); }
uint32 SsScene2609Button::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: if (_countdown == 0) { sendMessage(_parentScene, 0x2000, 0); if (getGlobalVar(V_WATER_RUNNING)) { setVisible(false); playSound(3); playSound(1); _countdown = 12; } else { setVisible(true); playSound(2); playSound(0); _countdown = 96; } } messageResult = 1; break; } return messageResult; }