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 Scene1105::createObjects() { _ssSymbols[0] = insertSprite<SsScene1105Symbol>(kScene1105FileHashes[getSubVar(VA_DICE_MEMORY_SYMBOLS, 0)], 161, 304); _ssSymbols[1] = insertSprite<SsScene1105Symbol>(kScene1105FileHashes[getSubVar(VA_DICE_MEMORY_SYMBOLS, 1)], 294, 304); _ssSymbols[2] = insertSprite<SsScene1105Symbol>(kScene1105FileHashes[getSubVar(VA_DICE_MEMORY_SYMBOLS, 2)], 440, 304); _ssSymbolDice[0] = insertSprite<SsScene1105SymbolDie>(0, 206, 304); _ssSymbolDice[1] = insertSprite<SsScene1105SymbolDie>(1, 339, 304); _ssSymbolDice[2] = insertSprite<SsScene1105SymbolDie>(2, 485, 304); _ssSymbol1UpButton = insertSprite<SsScene1105Button>(this, 0x08002860, NRect::make(146, 362, 192, 403)); addCollisionSprite(_ssSymbol1UpButton); _ssSymbol1DownButton = insertSprite<SsScene1105Button>(this, 0x42012460, NRect::make(147, 404, 191, 442)); addCollisionSprite(_ssSymbol1DownButton); _ssSymbol2UpButton = insertSprite<SsScene1105Button>(this, 0x100030A0, NRect::make(308, 361, 355, 402)); addCollisionSprite(_ssSymbol2UpButton); _ssSymbol2DownButton = insertSprite<SsScene1105Button>(this, 0x840228A0, NRect::make(306, 406, 352, 445)); addCollisionSprite(_ssSymbol2DownButton); _ssSymbol3UpButton = insertSprite<SsScene1105Button>(this, 0x20000120, NRect::make(476, 358, 509, 394)); addCollisionSprite(_ssSymbol3UpButton); _ssSymbol3DownButton = insertSprite<SsScene1105Button>(this, 0x08043121, NRect::make(463, 401, 508, 438)); addCollisionSprite(_ssSymbol3DownButton); _ssActionButton = insertSprite<SsScene1105Button>(this, 0x8248AD35, NRect::make(280, 170, 354, 245)); addCollisionSprite(_ssActionButton); _isPanelOpen = true; _asTeddyBear->show(); insertPuzzleMouse(0x18666208, 20, 620); }
StaticScene::StaticScene(NeverhoodEngine *vm, Module *parentModule, uint32 backgroundFileHash, uint32 cursorFileHash) : Scene(vm, parentModule) { SetMessageHandler(&StaticScene::handleMessage); setBackground(backgroundFileHash); setPalette(backgroundFileHash); insertPuzzleMouse(cursorFileHash, 20, 620); }
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; }
Scene2609::Scene2609(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _isBusy(false) { SetUpdateHandler(&Scene::update); SetMessageHandler(&Scene2609::handleMessage); setBackground(0x51409A16); setPalette(0x51409A16); _asWater = insertSprite<AsScene2609Water>(); _ssButton = insertSprite<SsScene2609Button>(this); addCollisionSprite(_ssButton); insertPuzzleMouse(0x09A1251C, 20, 620); insertStaticSprite(0x02138002, 1200); insertStaticSprite(0x825E2827, 1200); }
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); }
Scene1105::Scene1105(NeverhoodEngine *vm, Module *parentModule) : Scene(vm, parentModule), _countdown(0), _isPanelOpen(false), _isActionButtonClicked(false), _doMoveTeddy(false), _isClosePanelDone(false), _leaveResult(0), _backgroundIndex(0) { Sprite *ssOpenButton; _vm->gameModule()->initMemoryPuzzle(); SetUpdateHandler(&Scene1105::update); SetMessageHandler(&Scene1105::handleMessage); setBackground(0x20010002); setPalette(0x20010002); _asTeddyBear = insertSprite<AsScene1105TeddyBear>(this); ssOpenButton = insertSprite<SsScene1105OpenButton>(this); addCollisionSprite(ssOpenButton); insertPuzzleMouse(0x10006208, 20, 620); loadSound(0, 0x48442057); loadSound(1, 0xC025014F); loadSound(2, 0x68E25540); }
Scene2901::Scene2901(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule), _currLocationButtonNum(which), _selectedButtonNum(which), _currWhirlButtonNum(0), _prevWhirlButtonNum(0), _countdown1(1), _skipCountdown(0), _blinkOn(0) { _isButton2Broken = getGlobalVar(V_ENTRANCE_OPEN) != 0; setSubVar(V_TELEPORTER_DEST_AVAILABLE, which, 1); setSubVar(V_TELEPORTER_DEST_AVAILABLE, 5, 1); setSubVar(V_TELEPORTER_DEST_AVAILABLE, 4, 1); if (_currLocationButtonNum == 3) setSubVar(V_TELEPORTER_DEST_AVAILABLE, 2, 1); setBackground(kScene2901FileHashes1[_currLocationButtonNum]); setPalette(kScene2901FileHashes1[_currLocationButtonNum]); for (uint i = 0; i < 6; ++i) { if (i != 2 || !_isButton2Broken) { _ssLocationButtons[i] = insertSprite<SsScene2901LocationButton>(this, _currLocationButtonNum, i); addCollisionSprite(_ssLocationButtons[i]); _ssLocationButtonLights[i] = insertSprite<SsScene2901LocationButtonLight>(_currLocationButtonNum, i); } } if (_isButton2Broken) insertSprite<SsScene2901BrokenButton>(_currLocationButtonNum); _ssBigButton = insertSprite<SsScene2901BigButton>(this, _currLocationButtonNum); addCollisionSprite(_ssBigButton); insertPuzzleMouse(kScene2901FileHashes2[_currLocationButtonNum], 20, 620); SetUpdateHandler(&Scene2901::update); SetMessageHandler(&Scene2901::handleMessage); }