bool CPetLoadSave::KeyCharMsg(int key) { switch (key) { case Common::KEYCODE_TAB: case Common::KEYCODE_DOWN: case Common::KEYCODE_KP2: if (_savegameSlotNum != -1) { highlightSlot((_savegameSlotNum + 1) % 5); getPetControl()->makeDirty(); } return true; case Common::KEYCODE_UP: case Common::KEYCODE_KP8: if (_savegameSlotNum != -1) { int slotNum = --_savegameSlotNum; highlightSlot((slotNum == -1) ? SAVEGAME_SLOTS_COUNT - 1 : slotNum); getPetControl()->makeDirty(); } return true; case Common::KEYCODE_RETURN: case Common::KEYCODE_KP_ENTER: execute(); return true; default: return false; } }
bool CSuccUBus::TurnOn(CTurnOn *msg) { if (getRandomNumber(9) == 0) { CParrotSpeakMsg speakMsg("SuccUBus", "TurnOn"); speakMsg.execute("PerchedParrot"); } CPetControl *pet = getPetControl(); if (pet) { if (!_signalFlag && _initialStartFrame >= 0) { playMovie(_initialStartFrame, _initialEndFrame, 0); playSound("z#30.wav", 100); } if (_onStartFrame >= 0) { playMovie(_onStartFrame, _onEndFrame, MOVIE_NOTIFY_OBJECT); playSound("z#26.wav", 100); } uint petRoomFlags = pet->getRoomFlags(); if (mailExists(petRoomFlags) && _endFrame1 >= 0) // Mail canister present playMovie(_endFrame1, _endFrame1, 0); _isOn = true; CSUBTransition transMsg; transMsg.execute(this); setTalking(this, true, findView()); petSetArea(PET_REMOTE); petHighlightGlyph(16); } return true; }
bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) { CPetControl *pet = getPetControl(); if (_flag) { _flag = false; setVisible(true); starFn(STAR_HIDE); playMovie(61, 120, MOVIE_NOTIFY_OBJECT); playSound("a#47.wav"); playSound("a#48.wav"); if (pet) { pet->decAreaLocks(); pet->setArea(PET_REMOTE); } decTransitions(); } else { incTransitions(); _flag = true; setVisible(true); playMovie(0, 60, MOVIE_NOTIFY_OBJECT); playSound("a#48.wav"); playSound("a#47.wav"); } return true; }
bool CSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) { if (!msg->_item) return false; CPetControl *pet = getPetControl(); CCarry *item = dynamic_cast<CCarry *>(msg->_item); Rect tempRect = _rect2; tempRect.translate(_bounds.left, _bounds.top); uint roomFlags = pet ? pet->getRoomFlags() : 0; if (!_enabled || !pet || !item || !tempRect.contains(item->getControid())) { item->petAddToInventory(); } else if (mailExists(roomFlags)) { petDisplayMessage(SUCCUBUS_DESCRIPTION); item->petAddToInventory(); } else { petContainerRemove(item); pet->phonographAction(""); CChicken *chicken = dynamic_cast<CChicken *>(item); bool chickenFlag = chicken ? chicken->_string6 != "None" : false; item->setVisible(false); if (_startFrame1 >= 0) { playSound("z#23.wav"); playMovie(_startFrame1, _endFrame1, 0); } if (!chickenFlag) { _field188 = 1; item->addMail(roomFlags); petSetArea(PET_REMOTE); petHighlightGlyph(16); CSUBTransition transMsg; transMsg.execute(this); } else { if (_startFrame2 >= 0) { startTalking(this, 70219, findView()); playMovie(_startFrame2, _endFrame2, 0); } if (_startFrame3 >= 0) { playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT); _field158 = 2; } CViewItem *view = parseView(chicken->_fullViewName); if (!view) return false; item->setPosition(item->_origPos); item->moveUnder(view); CSUBTransition transMsg; transMsg.execute(this); } } return true; }
bool CSuccUBus::TurnOn(CTurnOn *msg) { if (getRandomNumber(9) == 0) { CParrotSpeakMsg speakMsg("SuccUBus", "TurnOn"); speakMsg.execute("PerchedParrot"); } CPetControl *pet = getPetControl(); if (pet) { if (!_field15C && _startFrame8 >= 0) { playMovie(_startFrame8, _endFrame8, 0); playSound("z#30.wav", 100); } if (_startFrame9 >= 0) { playMovie(_startFrame9, _endFrame9, MOVIE_NOTIFY_OBJECT); playSound("z#26.wav", 100); } uint petRoomFlags = pet->getRoomFlags(); if (mailExists(petRoomFlags) && _endFrame1 >= 0) playMovie(_endFrame1, _endFrame1, 0); _enabled = true; CSUBTransition transMsg; transMsg.execute(this); setTalking(this, true, findView()); petSetArea(PET_REMOTE); petHighlightGlyph(16); } return true; }
bool CBilgeSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { CPetControl *pet = getPetControl(); if (_v2) { if (_startFrame4 >= 0) playMovie(_startFrame4, _endFrame4, MOVIE_GAMESTATE); if (_startFrame5 >= 0) playMovie(_startFrame5, _endFrame5, MOVIE_GAMESTATE); playSound("z#28.wav", 70); } else if (!_enabled) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); return false; } else if (!pet) { return false; } else { uint roomFlags = pet->getRoomFlags(); CGameObject *mailObject = findMailByFlags( _v3 && compareRoomNameTo("Titania") ? 3 : _field140, roomFlags); if (mailObject) { _mailP = mailObject; if (_startFrame4 >= 0) playMovie(_startFrame4, _endFrame4, MOVIE_GAMESTATE); } else { petDisplayMessage(2, NOTHING_TO_DELIVER); } } return true; }
bool CBilgeSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { CPetControl *pet = getPetControl(); if (_style) { if (_receiveStartFrame >= 0) playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_WAIT_FOR_FINISH); if (_afterReceiveStartFrame >= 0) playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_WAIT_FOR_FINISH); playSound("z#28.wav", 70); } else if (!_isOn) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); return false; } else if (!pet) { return false; } else { uint roomFlags = pet->getRoomFlags(); CGameObject *mailObject = findMailByFlags( _enabled && compareRoomNameTo("Titania") ? RFC_TITANIA : _flagsComparison, roomFlags); if (mailObject) { _mailP = mailObject; if (_receiveStartFrame >= 0) playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_WAIT_FOR_FINISH); } else { petDisplayMessage(2, NOTHING_TO_DELIVER); } } return true; }
bool CBilgeSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) { CPetControl *pet = getPetControl(); if (!msg->_item) return false; CCarry *item = dynamic_cast<CCarry *>(msg->_item); if (!_enabled || !pet || !item) { item->petAddToInventory(); return true; } uint petRoomFlags = pet->getRoomFlags(); if (mailExists(petRoomFlags)) { petDisplayMessage(2, SUCCUBUS_SINGLE_DELIVERY); item->petAddToInventory(); return true; } petContainerRemove(item); pet->phonographAction(""); playSound("z#23.wav"); CChicken *chicken = dynamic_cast<CChicken *>(item); bool chickenFlag = chicken ? chicken->_string6 == "None" : false; if (chickenFlag) { if (_startFrame2 >= 0) { startTalking(this, 70219); playMovie(_startFrame2, _endFrame2, 0); } if (_startFrame3 >= 0) { _field158 = 5; playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT); } CViewItem *view = parseView(item->_fullViewName); if (view) { item->setVisible(false); setPosition(item->_origPos); item->moveUnder(view); CSUBTransition transMsg; transMsg.execute(this); } else { return false; } } else { item->addMail(petRoomFlags); if (_startFrame2 >= 0) playMovie(_startFrame2, _endFrame2, 0); petSetArea(PET_REMOTE); CSUBTransition transMsg; transMsg.execute(this); } return true; }
bool CLightSwitch::EnterRoomMsg(CEnterRoomMsg *msg) { _flag = true; CPetControl *pet = getPetControl(); if (pet) _turnOnTV = pet->isFirstClassSuite(); return true; }
bool CEnterSecClassState::MovieEndMsg(CMovieEndMsg *msg) { CPetControl *pet = getPetControl(); if (pet) { pet->setRooms1CC(_mode); pet->resetRoomsHighlight(); } return true; }
bool CBellBot::TrueTalkGetStateValueMsg(CTrueTalkGetStateValueMsg *msg) { CPetControl *pet = getPetControl(); bool flag = pet ? pet->isRoom59706() : false; if (msg->_stateNum == 7) msg->_stateVal = flag ? 1 : 0; return true; }
bool CSGTNavigation::EnterViewMsg(CEnterViewMsg *msg) { if (isEquals("SGTLL")) { static const int FRAMES[3] = { 0, 36, 74 }; CPetControl *pet = getPetControl(); loadFrame(FRAMES[pet->getRooms1CC() - 1]); } return true; }
void CProjectItem::postLoad() { CGameManager *gameManager = getGameManager(); if (gameManager) gameManager->postLoad(this); CPetControl *petControl = getPetControl(); if (petControl) petControl->postLoad(); }
bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { CPetControl *pet = getPetControl(); if (_inProgress || !pet) return true; if (!_isOn) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); return true; } uint petRoomFlags = pet->getRoomFlags(); if (mailExists(petRoomFlags)) { // There's already something to send in the tray, so you can't receive switch (getRandomNumber(2)) { case 0: startTalking(this, 70080, findView()); break; case 1: startTalking(this, 70081, findView()); break; case 2: startTalking(this, 70082, findView()); break; default: break; } } else { CGameObject *mailObject = findMailByFlags( _enabled && compareRoomNameTo("Titania") ? RFC_TITANIA : _flagsComparison, petRoomFlags); if (!mailObject) { // No mail for this SuccUBus if (getRandomNumber(1) == 0) { startTalking(this, 70104, findView()); } else { startTalking(this, 70105, findView()); } playMovie(_emptyStartFrame, _emptyEndFrame, 0); playMovie(_smokeStartFrame, _smokeEndFrame, 0); petDisplayMessage(2, NOTHING_TO_DELIVER); } else { // Receive the mail addressed to this SuccUBus _mailP = mailObject; startTalking(this, 230004, findView()); if (_receiveStartFrame >= 0) { _sendAction = SA_FEATHERS; _inProgress = true; incTransitions(); playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT); } } } return true; }
bool CPetLoadSave::reset() { highlightChange(); resetSlots(); CPetControl *pet = getPetControl(); if (pet) { _gutter.reset("PetSaveGutter", pet, MODE_UNSELECTED); } return true; }
void CTrueTalkNPC::performAction(bool startTalkingFlag, CViewItem *destView) { CPetControl *pet = getPetControl(); if (pet) pet->resetActiveNPC(); if (startTalkingFlag) startTalker(destView); if (pet) pet->convResetNPC(); }
bool CPetQuit::MouseButtonUpMsg(const Point &pt) { CPetControl *pet = getPetControl(); if (_btnYes.MouseButtonUpMsg(pt) && pet) { CGameManager *gameManager = pet->getGameManager(); if (gameManager) gameManager->_gameState._quitGame = true; return true; } else { return false; } }
void CEntertainmentDeviceGlyph::draw2(CScreenManager *screenManager) { CString viewName = getPetControl()->getFullViewName(); if (viewName == "SGTState.Node 1.S") { _gfxElement->setSelected(_flag); _gfxElement->draw(screenManager); } else if (viewName == "SGTState.Node 4.E") { _gfxElement->setSelected(_flag2); _gfxElement->draw(screenManager); _gfxElement2->draw(screenManager); _gfxElement3->draw(screenManager); } }
void CPetLoad::execute() { CPetControl *pet = getPetControl(); if (_savegameSlotNum >= 0 && _slotInUse[_savegameSlotNum]) { CMainGameWindow *window = g_vm->_window; // WORKAROUND: Schedule the savegame to be loaded after frame rendering ends window->loadGame(_savegameSlotNum); } else if (pet) { pet->displayMessage(SELECT_GAME_TO_LOAD); } }
bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) { CString viewName = getPetControl()->getFullViewName(); if (viewName == "SGTState.Node 1.S") { return elementMouseButtonDownMsg(pt, 4); } else if (viewName == "SGTState.Node 4.E") { return _gfxElement->MouseButtonDownMsg(pt) || _gfxElement2->MouseButtonDownMsg(pt) || _gfxElement3->MouseButtonDownMsg(pt); } return false; }
bool CEnterExitSecClassMiniLift::StatusChangeMsg(CStatusChangeMsg *msg) { _statics->_state = msg->_newStatus; if (msg->_newStatus == 3) _statics->_state = 2; CPetControl *pet = getPetControl(); if (pet) pet->setRoomsSublevel(_statics->_state); _cursorId = _statics->_state == 1 ? CURSOR_MOVE_FORWARD : CURSOR_INVALID; return true; }
bool CTelevision::LightsMsg(CLightsMsg *msg) { CPetControl *pet = getPetControl(); bool flag = false; if (pet) flag = pet->isRoom59706(); if (msg->_flag2 || !flag) _turnOn = true; return true; }
bool CPetSave::reset() { CPetLoadSave::reset(); CPetControl *pet = getPetControl(); if (pet) { setName("PetSave", pet); _btnLoadSave.reset("PetSaveOut", pet, MODE_UNSELECTED); _btnLoadSave.reset("PetSaveIn", pet, MODE_SELECTED); } return true; }
bool CTelevision::LightsMsg(CLightsMsg *msg) { CPetControl *pet = getPetControl(); bool isYourStateroom = false; if (pet) isYourStateroom = pet->isFirstClassSuite(); if (msg->_topLeft || !isYourStateroom) _turnOn = true; return true; }
bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { CPetControl *pet = getPetControl(); if (_field1D8 || !pet) return true; if (!_enabled) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); return true; } uint petRoomFlags = pet->getRoomFlags(); if (mailExists(petRoomFlags)) { switch (getRandomNumber(2)) { case 0: startTalking(this, 70080, findView()); break; case 1: startTalking(this, 70081, findView()); break; case 2: startTalking(this, 70082, findView()); break; default: break; } } else { CGameObject *mailObject = findMailByFlags(compareRoomNameTo("Titania") ? 3 : _field140, petRoomFlags); if (!mailObject) { if (getRandomNumber(1) == 0) { startTalking(this, 70104, findView()); } else { startTalking(this, 70105, findView()); } playMovie(_startFrame6, _endFrame6, 0); playMovie(_startFrame7, _endFrame7, 0); petDisplayMessage(2, NOTHING_TO_DELIVER); } else { startTalking(this, 230004, findView()); if (_startFrame4 >= 0) { _field158 = 1; _field1D8 = 1; incTransitions(); playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT); } } } return true; }
bool CNavigationControllerGlyph::MouseButtonUpMsg(const Point &pt) { if (!_gfxElement->MouseButtonUpMsg(pt)) return false; _flag = !_flag; CTreeItem *target = getPetControl()->_remoteTarget; if (target) { CPETHelmetOnOffMsg msg; msg.execute(target); } return true; }
bool CSGTStateRoom::LeaveRoomMsg(CLeaveRoomMsg *msg) { CPetControl *pet = getPetControl(); uint roomFlags = pet->getRoomFlags(); uint assignedRoom = pet->getAssignedRoomFlags(); if (roomFlags == assignedRoom) { _savedFrame = getMovieFrame(); _savedIsClosed = _isClosed; _savedVisible = _visible; } _statics->_roomFlags = roomFlags; return true; }
void CPetSave::execute() { CPetControl *pet = getPetControl(); if (_savegameSlotNum >= 0) { highlightSlot(-1); CProjectItem *project = pet ? pet->getRoot() : nullptr; if (project) { project->saveGame(_savegameSlotNum, _slotNames[_savegameSlotNum].getText()); pet->displayMessage(BLANK); } } else if (pet) { pet->displayMessage(SELECT_GAME_TO_SAVE); } }
bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) { if (!_gfxElement->MouseButtonUpMsg(pt)) return false; CTreeItem *target = getPetControl()->_remoteTarget; if (target) { CPETActivateMsg msg("SGTSelector", petNum); msg.execute(target); _flag = !_flag; _gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED); } return true; }
bool CCarryParrot::ActMsg(CActMsg *msg) { if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) { CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6)); if (npc) startTalking(npc, 0x446BF); setVisible(false); _fieldE0 = 0; if (CParrot::_v4 == 4) { CActMsg actMsg("Shut"); actMsg.execute("ParrotCage"); } else { playSound("z#475.wav"); if (!_feathersFlag) { CCarry *feathers = dynamic_cast<CCarry *>(getRoot()->findByName("Feathers")); if (feathers) { feathers->setVisible(true); feathers->petAddToInventory(); } _feathersFlag = true; } getPetControl()->removeFromInventory(this); getPetControl()->setAreaChangeType(1); moveUnder(getRoom()); } CParrot::_v4 = 2; stopTimer(_timerId); _timerId = 0; } return true; }