bool CSGTNavigation::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (compareRoomNameTo("SgtLobby")) { _statics->_destView = getRoomNodeName(); _statics->_destRoom = "SgtLobby"; changeView("SGTState.Node 1.S"); } else if (compareRoomNameTo("SGTLittleLift")) { if (_statics->_changeViewNum != 1) { _statics->_destRoom = "SGTLittleLift"; changeView("SGTState.Node 1.S"); } } else if (compareRoomNameTo("SGTState")) { if (_statics->_destRoom == "SgtLobby") { if (compareViewNameTo("SGTState.Node 2.N")) { changeView("SGTState.Node 1.N"); _statics->_destView += ".S"; } else { _statics->_destView += ".N"; } changeView(_statics->_destView); } else if (_statics->_destRoom == "SGTLittleLift") { if (compareViewNameTo("SGTState.Node 1.S")) { changeView("SGTLittleLift.Node 1.N"); } else { changeView("SGTState.Node 1.N"); changeView("SGTLittleLift.Node 1.S"); } } } return true; }
bool CIdleSummoner::TimerMsg(CTimerMsg *msg) { uint nodesCtr = getNodeChangedCtr(); if (msg->_actionVal == 1 && !petDoorOrBellbotPresent() && nodesCtr > 0 && _fieldD8) { if (!compareRoomNameTo("TopOfWell") && !compareRoomNameTo("EmbLobby")) return true; int region = talkGetDialRegion("BellBot", 1); uint delay = region == 1 ? 15000 : 12000; uint enterTicks = MIN(getNodeEnterTicks(), _ticks); CString name; uint ticks = getTicksCount() - enterTicks; if (ticks > delay) { if (region == 1 || getRandomNumber(1) == 1) { name = "BellBot"; } else { name = "DoorBot"; } _fieldD8 = nodesCtr; if (getRoom()) { CSummonBotQueryMsg queryMsg(name); if (queryMsg.execute(this)) { CSummonBotMsg summonMsg(name, 1); summonMsg.execute(this); } } } } 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 CBellBot::OnSummonBotMsg(COnSummonBotMsg *msg) { if (msg->_value == 1) { _npcFlags |= NPCFLAG_40000; } else { static const char *const ROOM_WAVES[8][2] = { { "EmbLobby", "z#193.wav" }, { "PromenadeDeck", "z#191.wav" }, { "Arboretum", "z#195.wav" }, { "Frozen Arboretum", "z#195.wav" }, { "Bar", "z#194.wav" }, { "MusicRoom", "z#192.wav" }, { "MusicRoomLobby", "z#192.wav" }, { "1stClassRestaurant", "z#190.wav" } }; int idx; for (idx = 0; idx < 8; ++idx) { if (compareRoomNameTo(ROOM_WAVES[idx][0])) { playSound(ROOM_WAVES[idx][1]); break; } } if (idx == 8) playSound("z#147.wav"); sleep(2000); _npcFlags &= ~NPCFLAG_40000; } playClip("Walk On", MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); movieEvent(); _npcFlags |= NPCFLAG_10000; return true; }
bool CDoorbot::OnSummonBotMsg(COnSummonBotMsg *msg) { const char *const ROOM_WAVES[8][2] = { { "EmbLobby", "z#186.wav" }, { "PromenadeDeck", "z#184.wav" }, { "Arboretum", "z#188.wav" }, { "Frozen Arboretum", "z#188.wav" }, { "Bar", "z#187.wav" }, { "MusicRoom", "z#185.wav" }, { "MusicRoomLobby", "z#185.wav" }, { "1stClassRestaurant", "z#183.wav" }, }; if (msg->_value != -1) { int idx; for (idx = 0; idx < 8; ++idx) { if (compareRoomNameTo(ROOM_WAVES[idx][0])) { playSound(ROOM_WAVES[idx][1]); } } if (idx == 8) playSound("z#146.wav"); sleep(2000); } playClip(getRandomNumber(1) ? "Whizz On Left" : "Whizz On Right", MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); movieEvent(); _npcFlags |= NPCFLAG_400000; 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 CEnterExitMiniLift::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (compareRoomNameTo("SgtLobby")) { _statics->_destView = getRoomNodeName() + ".S"; _statics->_destRoom = "SgtLobby"; changeView("SGTLittleLift.Node 1.E"); CPetControl *pet = getPetControl(); if (pet) pet->setRoomsRoomNum(_destRoomNum); } else if (compareRoomNameTo("SGTLittleLift")) { if (_statics->_changeViewFlag) { changeView(_statics->_destView); } } return true; }
bool CBarbot::TimerMsg(CTimerMsg *msg) { if (!_fieldC4 && compareRoomNameTo("Bar")) { CParrotSpeakMsg speakMsg("Barbot", "AskForDrink"); speakMsg.execute("PerchedParrot"); addTimer(10000 + getRandomNumber(20000)); } return true; }
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 CEnterExitSecClassMiniLift::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (compareRoomNameTo("2ndClassLobby")) { _statics->_viewName = getRoomNodeName() + ".W"; changeView("SecClassLittleLift.Node 1.E"); _statics->_state = 1; CPetControl *pet = getPetControl(); if (pet) { pet->setRoomsRoomNum(_roomNum); pet->setRoomsSublevel(1); } } else if (compareRoomNameTo("SecClassLittleLift")) { if (_statics->_state == 1) { changeView(_statics->_viewName); } } return true; }
bool CEnterSecClassState::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (getPassengerClass() > 2) { playSound("b#105.wav"); petDisplayMessage(1, CLASS_NOT_PERMITTED_IN_AREA); } else if (!compareRoomNameTo("SecClassLittleLift") || _mode == 2) { CActMsg actMsg(getFullViewName().deleteRight(3) + ".S"); actMsg.execute("SecClassRoomLeaver"); changeView("secClassState.Node 01.N"); } 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 CSuccUBus::EnterViewMsg(CEnterViewMsg *msg) { if (getRandomNumber(4) == 0 && compareRoomNameTo("PromenadeDeck")) { CParrotSpeakMsg speakMsg("SuccUBus", "EnterView"); speakMsg.execute("PerchedParrot"); } petSetRemoteTarget(); _mailP = nullptr; if (_startFrame8 >= 0) loadFrame(_startFrame8); return true; }
bool CPETTransition::EnterViewMsg(CEnterViewMsg *msg) { CPetControl *pet = getPetControl(); if (compareRoomNameTo("1stClassLobby") && pet) { int elevatorNum = pet->getRoomsElevatorNum(); CString nodeView = msg->_newView->getNodeViewName(); if (nodeView == "Node 1.E") { pet->setRoomsElevatorNum((elevatorNum == 1 || elevatorNum == 2) ? 1 : 3); } else if (nodeView == "Node 1.W") { pet->setRoomsElevatorNum((elevatorNum == 1 || elevatorNum == 2) ? 2 : 4); } } return true; }
bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) { if (getRandomNumber(6) == 0) { CParrotSpeakMsg parrotMsg("Television", ""); parrotMsg.execute("PerchedParrot"); } if (_channelNum == 3 && compareRoomNameTo("SGTState") && getPassengerClass() == THIRD_CLASS) { // WORKAROUND: The original allowed the magazine to be "won" multiple times. We // now search for magazine within the room (which is it's initial, hidden location). // That way, when it's 'Won', it's no longer present and can't be won again CMagazine *magazine = dynamic_cast<CMagazine *>(findRoom()->findByName("Magazine")); if (magazine) { // You may be a winner CProximity prox1, prox2; prox1._soundType = prox2._soundType = Audio::Mixer::kSpeechSoundType; playSound(TRANSLATE("z#47.wav", "z#578.wav"), prox1); _soundHandle = playSound(TRANSLATE("b#20.wav", "b#1.wav"), prox2); // Get the room flags for the SGT floor we're on CPetControl *pet = getPetControl(); uint roomFlags = pet->getRoomFlags(); // Send the magazine to the SuccUBus debugC(DEBUG_INTERMEDIATE, kDebugScripts, "Assigned room - %d", roomFlags); magazine->addMail(roomFlags); magazine->sendMail(roomFlags, roomFlags); loadFrame(561); } else { petDisplayMessage(NOTHING_ON_CHANNEL); } } else if (_channelNum == 2) { loadFrame(_seasonFrame); } else if (_channelNum == 4 && _channel4Glyph) { if (_turnOn) loadFrame(502); else petDisplayMessage(NOTHING_ON_CHANNEL); } else if (_channelNum == 5 && *CGetLiftEye2::_destObject != "NULL") { loadFrame(393 + _eyeFloorNum); } else { petDisplayMessage(NOTHING_ON_CHANNEL); } return true; }
bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) { petClear(); if (_isOn) { if (isSoundActive(_soundHandle)) stopSound(_soundHandle, 0); loadFrame(622); stopMovie(); setVisible(0); _isOn = false; if (compareRoomNameTo("CSGState")) { CVisibleMsg visibleMsg(true); visibleMsg.execute("Tellypic"); } } return true; }
bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) { if (msg->_name == "Television") { CVisibleMsg visibleMsg(_isOn); _isOn = !_isOn; if (_isOn) { setVisible(true); playMovie(0, 55, 0); _channelNum = 1; } else { stopMovie(); if (isSoundActive(_soundHandle)) stopSound(_soundHandle, 0); setVisible(false); } if (compareRoomNameTo("SGTState")) visibleMsg.execute("Tellypic"); } return true; }
bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) { if (getRandomNumber(6) == 0) { CParrotSpeakMsg parrotMsg("Television", ""); parrotMsg.execute("PerchedParrot"); } if (_channelNum == 3 && compareRoomNameTo("SGTState") && getPassengerClass() == THIRD_CLASS) { playSound("z#47.wav"); _soundHandle = playSound("b#20.wav"); CMagazine *magazine = dynamic_cast<CMagazine *>(getRoot()->findByName("Magazine")); if (magazine) { CPetControl *pet = getPetControl(); uint roomFlags = pet->getRoomFlags(); debugC(kDebugScripts, "Assigned room - %d", roomFlags); magazine->addMail(roomFlags); magazine->removeMail(roomFlags, roomFlags); } loadFrame(561); } else if (_channelNum == 2) { loadFrame(_seasonFrame); } else if (_channelNum == 4 && _channel4Glyph) { if (_turnOn) loadFrame(502); else petDisplayMessage(NOTHING_ON_CHANNEL); } else if (_channelNum == 5 && *CGetLiftEye2::_destObject != "NULL") { loadFrame(393 + _floorNum); } else { petDisplayMessage(NOTHING_ON_CHANNEL); } return true; }
bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { CPetControl *pet = getPetControl(); uint petRoomFlags = pet ? pet->getRoomFlags() : 0; if (msg->_endFrame == _endFrame10) { if (_startFrame11 >= 0) playSound("z#30.wav", 100); if (_field15C) { _field15C = false; setVisible(false); CSignalObject signalMsg; signalMsg._numValue = 1; signalMsg.execute(_string2); } } if (msg->_endFrame == _endFrame9) { bool flag = false; if (pet && mailExists(petRoomFlags)) { CGameObject *mailObject = _v3 && compareRoomNameTo("Titania") ? findMailByFlags(3, petRoomFlags) : findMailByFlags(_field140, petRoomFlags); if (mailObject) { switch (getRandomNumber(4)) { case 0: startTalking(this, 70094, findView()); break; case 1: startTalking(this, 70095, findView()); break; case 2: startTalking(this, 70096, findView()); break; case 3: startTalking(this, 70098, findView()); break; case 4: startTalking(this, 70099, findView()); break; default: break; } flag = true; } } if (!_field188 && !flag) { stopSound(_soundHandle); _soundHandle = -1; switch (getRandomNumber(_v2 ? 7 : 5, &_field1B0)) { case 2: startTalking(this, 230001, findView()); break; case 3: startTalking(this, 230002, findView()); break; case 4: startTalking(this, 230003, findView()); break; case 5: startTalking(this, 230064, findView()); break; case 6: startTalking(this, 230062, findView()); break; case 7: startTalking(this, 230063, findView()); break; default: break; } } } if (msg->_endFrame == _endFrame3) { if (_field158 == 1) { startTalking(this, 230022, findView()); } else if (_field158 == 2) { startTalking(this, 230017, findView()); } else if (_field19C) { startTalking(this, 230019, findView()); _field19C = 0; } else if (_isChicken) { startTalking(this, 230018, findView()); _isChicken = false; } else { startTalking(this, 230013, findView()); } if (_field1D8) { _field1D8 = 0; decTransitions(); } CSUBTransition transMsg; transMsg.execute(this); } if (msg->_endFrame == _endFrame4) { if (pet && _mailP) { _mailP->setMailId(petRoomFlags); } _field188 = 1; _mailP = 0; if (_field1D8) { _field1D8 = 0; decTransitions(); } CSUBTransition transMsg; transMsg.execute(this); } return true; }
bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { CPetControl *pet = getPetControl(); uint petRoomFlags = pet ? pet->getRoomFlags() : 0; if (msg->_endFrame == _offEndFrame) { if (_endingStartFrame >= 0) playSound("z#30.wav", 100); if (_signalFlag) { _signalFlag = false; setVisible(false); CSignalObject signalMsg; signalMsg._numValue = 1; signalMsg.execute(_signalTarget); } } if (msg->_endFrame == _onEndFrame) { bool flag = false; if (pet && !mailExists(petRoomFlags)) { CGameObject *mailObject = _enabled && compareRoomNameTo("Titania") ? findMailByFlags(RFC_TITANIA, petRoomFlags) : findMailByFlags(_flagsComparison, petRoomFlags); if (mailObject) { switch (getRandomNumber(4)) { case 0: startTalking(this, 70094, findView()); break; case 1: startTalking(this, 70095, findView()); break; case 2: startTalking(this, 70096, findView()); break; case 3: startTalking(this, 70098, findView()); break; case 4: startTalking(this, 70099, findView()); break; default: break; } flag = true; } } if (!_field188 && !flag) { stopSound(_soundHandle); _soundHandle = -1; switch (getRandomNumber(_style ? 7 : 5, &_priorRandomVal2)) { case 2: startTalking(this, 230001, findView()); break; case 3: startTalking(this, 230002, findView()); break; case 4: startTalking(this, 230003, findView()); break; case 5: startTalking(this, 230064, findView()); break; case 6: startTalking(this, 230062, findView()); break; case 7: startTalking(this, 230063, findView()); break; default: break; } } } if (msg->_endFrame == _sendEndFrame) { if (_sendAction == SA_FEATHERS) { startTalking(this, 230022, findView()); } else if (_sendAction == SA_EATEN) { startTalking(this, 230017, findView()); } else if (_sendLost) { startTalking(this, 230019, findView()); _sendLost = false; } else if (_isChicken) { startTalking(this, 230018, findView()); _isChicken = false; } else { startTalking(this, 230013, findView()); } if (_inProgress) { _inProgress = false; decTransitions(); } CSUBTransition transMsg; transMsg.execute(this); } if (msg->_endFrame == _receiveEndFrame) { // SuccUBus disgorged mail if (pet && _mailP) { _mailP->setMailDest(petRoomFlags); } _field188 = 1; _mailP = nullptr; if (_inProgress) { _inProgress = false; decTransitions(); } CSUBTransition transMsg; transMsg.execute(this); } return true; }