bool CBilgeSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (_enabled) { switch (getRandomNumber(4)) { case 0: case 4: { _enabled = false; CTurnOff offMsg; offMsg.execute(this); break; } case 1: startTalking(this, 230055); break; case 2: startTalking(this, 230067); break; case 3: startTalking(this, 230045); break; default: break; } } else { CTurnOn onMsg; onMsg.execute(this); _enabled = true; } return true; }
bool CSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (!_field1D8) { Rect tempRect = _rect1; tempRect.translate(_bounds.left, _bounds.top); if (!_enabled || (_field188 && tempRect.contains(msg->_mousePos))) { CTurnOn onMsg; onMsg.execute(this); _enabled = true; } else if (getRandomNumber(256) < 130) { _enabled = false; CTurnOff offMsg; offMsg.execute(this); } else { switch (getRandomNumber(2)) { case 0: startTalking(this, 230055, findView()); break; case 1: startTalking(this, 230067, findView()); break; case 2: startTalking(this, 230045, findView()); break; default: break; } } } return true; }
bool CBarbot::MovieFrameMsg(CMovieFrameMsg *msg) { if (msg->_frameNumber == _frames[29]._startFrame) { playSound("c#2.wav", _volume); } else if (msg->_frameNumber == _frames[55]._startFrame || msg->_frameNumber == _frames[32]._startFrame) { // Finished giving the Barbot a glass CStatusChangeMsg statusMsg; statusMsg._newStatus = 0; statusMsg.execute("PickUpGlass"); if (_glassContent == GG_EMPTY) { // I'd rather see that full of Starling Puret startTalking(this, 250574); } else if (_glassContent > GG_EMPTY) { // What's this? startTalking(this, 250580); petSetArea(PET_CONVERSATION); } _glassContent = GG_DEFAULT; } else if (msg->_frameNumber == _frames[36]._startFrame) { CVisibleMsg visibleMsg(false); visibleMsg.execute("LemonOnBar"); } else if (msg->_frameNumber == _frames[35]._startFrame) { CVisibleMsg visibleMsg(false); visibleMsg.execute("TVOnBar"); } return true; }
bool CBellBot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { switch (msg->_action) { case 1: case 28: { _npcFlags &= ~NPCFLAG_IDLING; CDismissBotMsg dismissMsg; dismissMsg.execute(this); break; } case 5: _npcFlags &= ~NPCFLAG_20000; playClip("Walk Off", MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); movieEvent(); break; case 17: { CActMsg actMsg("ThrowTVDownWell"); actMsg.execute("ThrowTVDownWellControl"); break; } case 29: { CActMsg actMsg("BellbotGetLight"); actMsg.execute("BellbotGetLightCutScene"); startTalking(this, 158); break; } default: break; } return true; }
bool CParrot::EnterViewMsg(CEnterViewMsg *msg) { static const char *const NAMES[] = { "Talking0", "Talking1", "Talking2", "Talking3", "Talking4", "Talking5", "Talking6", "Talking7", nullptr }; if (!_v4) { setPosition(Point(_field124, _bounds.top)); _field118 = 1; _npcFlags &= ~(NPCFLAG_10000 | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000 | NPCFLAG_400000); loadFrame(0); endTalking(this, true, findView()); if (_speechCounter > 0) { playRandomClip(NAMES, MOVIE_NOTIFY_OBJECT); } else { startTalking(this, 280258, findView()); } petSetArea(PET_CONVERSATION); _field12C = 0; _npcFlags |= NPCFLAG_START_IDLING; } 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 CDeskbot::ActMsg(CActMsg *msg) { if (msg->_action == "2ndClassUpgrade" && getPassengerClass() > 2) { startTalking(this, 140, findView()); } return true; }
bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) { if (CParrot::_v4 != 3) { moveToView(); setPosition(Point(0, 0)); setVisible(true); playClip("Pick Up", 2); playClip("Flapping", 1); stopTimer(_timerId); _timerId = addTimer(1000, 1000); _freeCounter = 0; CParrot::_v4 = 1; msg->_value3 = 1; return CCarry::PassOnDragStartMsg(msg); } CTrueTalkNPC *npc = dynamic_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6)); if (npc) startTalking(npc, 0x446BF); _fieldE0 = 0; playSound("z#475.wav"); moveUnder(findRoom()); msg->_value4 = 1; return true; }
bool CBellBot::MovieEndMsg(CMovieEndMsg *msg) { if (!(_npcFlags & NPCFLAG_10000)) { CTrueTalkNPC::MovieEndMsg(msg); } else if (clipExistsByEnd("Walk On", msg->_endFrame)) { setPosition(Point(80, 10)); loadFrame(543); _npcFlags |= NPCFLAG_START_IDLING; if (_npcFlags & NPCFLAG_40000) { startTalking(this, 157); _npcFlags &= ~NPCFLAG_40000; } setTalking(this, true); petSetArea(PET_CONVERSATION); } else if (clipExistsByEnd("Walk Off", msg->_endFrame)) { CPutBotBackInHisBoxMsg boxMsg; boxMsg.execute(this); if (_npcFlags & NPCFLAG_20000) startAnimTimer("SummonDoorbot", 1500); } else { CTrueTalkNPC::MovieEndMsg(msg); } 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 CParrot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { if (_v4) { CViewItem *view = msg->_param2 ? findView() : nullptr; startTalking(this, msg->_action, view); } return true; }
bool CMaitreD::TimerMsg(CTimerMsg *msg) { if (msg->_action == "MD Fight") { if (_field12C && compareViewNameTo("1stClassRestaurant.MaitreD Node.N")) { startTalking(this, 131, findView()); } } else { CTrueTalkNPC::TimerMsg(msg); } return true; }
bool CDoorbot::ActMsg(CActMsg *msg) { debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot ActMsg action=%s v108=%d v110=%d v114=%d", msg->_action.c_str(), _introMovieNum, _field110, _field114); if (msg->_action == "DoorbotPlayerPressedTopButton") { disableMouse(); startTalking(this, 221471); } else if (msg->_action == "DoorbotPlayerPressedMiddleButton") { startTalking(this, 221470); } else if (msg->_action == "DoorbotPlayerPressedBottomButton") { startTalking(this, 221469); } else if (msg->_action == "DoorbotReachedEmbLobby") { startTalking(this, 221472); } else if (msg->_action == "PlayerPicksUpPhoto") { _field110 = 1; if (!_field114 && _introMovieNum == 4) { stopAnimTimer(_timerId); _timerId = 0; _introMovieNum = 5; startTalking(this, 221484); } } else if (msg->_action == "PlayerPutsPhotoInPet") { _field110 = 2; if (!_field114 && _introMovieNum == 5) { stopAnimTimer(_timerId); _timerId = 0; startTalking(this, 221486); disableMouse(); } } return true; }
bool CDoorbot::TextInputMsg(CTextInputMsg *msg) { if (!(_npcFlags & NPCFLAG_DOORBOT_INTRO)) return CTrueTalkNPC::TextInputMsg(msg); if (_introMovieNum == 1) { stopAnimTimer(_timerId); _introMovieNum = 2; _timerId = 0; if (msg->_input == "yes" || msg->_input == "yeah" || msg->_input == "yea" || msg->_input == "yup" || msg->_input == "yep" || msg->_input == "sure" || msg->_input == "alright" || msg->_input == "all right" || msg->_input == "ok") { startTalking(this, 221479); } else { startTalking(this, 221478); } } return true; }
bool CMaitreD::EnterViewMsg(CEnterViewMsg *msg) { endTalking(this, true, findView()); _field12C = _field134; if (_string3 == "STMusic" && (!_field11C || _string2 == _string3)) return true; if (_string3.contains("nasty ambient")) startTalking(this, 111, findView()); else if (!CMusicRoom::_musicHandler->checkSound(1)) startTalking(this, 114, findView()); else if (!CMusicRoom::_musicHandler->checkSound(3)) startTalking(this, 113, findView()); else if (!CMusicRoom::_musicHandler->checkSound(2)) startTalking(this, 115, findView()); else { startTalking(this, 110, findView()); CMaitreDHappyMsg happyMsg; happyMsg.execute("MaitreD Left Arm"); happyMsg.execute("MaitreD Right Arm"); } 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 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 CParrot::ActMsg(CActMsg *msg) { if (msg->_action == "PistaccioEaten") { CActMsg actMsg("NutsEaten"); actMsg.execute("Ear2"); } else if (msg->_action == "Chicken") { // Nothing to do } else if (msg->_action == "CarryParrotLeftView") { if (!_v2) { _v1 = 0; CStatusChangeMsg statusMsg; statusMsg._newStatus = 1; statusMsg.execute("PerchCoreHolder"); } } else if (msg->_action == "StartChickenDrag") { if (!_v4) { stopMovie(); startTalking(this, 280275, findView()); _field12C = 0; } } else if (msg->_action == "EnteringFromTOW" && (_v4 == 0 || _v4 == 2)) { if (_v2) { _v2 = 2; } else { setVisible(true); CTreeItem *cageBar = getRoot()->findByName("CageBar"); detach(); attach(cageBar); _v4 = 0; CActMsg actMsg1("OpenNow"); actMsg1.execute("ParrotCage"); CActMsg actMsg2("GainParrot"); actMsg2.execute("ParrotLobbyController"); } } 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; }
bool CParrot::MouseDragStartMsg(CMouseDragStartMsg *msg) { if (_field118 && !_v4 && checkPoint(msg->_mousePos, false, true)) { setVisible(false); CRoomItem *room = findRoom(); moveUnder(room); startTalking(this, 280129); performAction(true); CCarry *item = dynamic_cast<CCarry *>(getRoot()->findByName(_string2)); if (item) { item->_fieldE0 = 1; CPassOnDragStartMsg passMsg; passMsg._mousePos = msg->_mousePos; passMsg.execute(item); msg->_dragItem = item; CActMsg actMsg("LoseParrot"); actMsg.execute("ParrotLobbyController"); } } return true; }
bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) { debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot MovieEndMsg flags=%x v=%d, start=%d, end=%d", _npcFlags, _introMovieNum, msg->_startFrame, msg->_endFrame); if (_npcFlags & NPCFLAG_DOORBOT_INTRO) { switch (_introMovieNum) { case 3: startTalking(this, 221482); _introMovieNum = 4; break; case 6: if (clipExistsByEnd("Cloak On", msg->_endFrame)) { petShow(); setState1C(true); changeView("ServiceElevator.Node 1.S"); changeView("ServiceElevator.Node 1.N"); } break; case 7: startTalking(this, 221467); _introMovieNum = 8; break; case 9: startTalking(this, 221468); break; case 11: changeView("ServiceElevator.Node 1.S"); changeView("MoonEmbLobby.Node 1.NE"); break; default: break; } CTrueTalkNPC::MovieEndMsg(msg); } else if (_npcFlags & NPCFLAG_100000) { if (clipExistsByEnd("Cloak Off", msg->_endFrame)) { _npcFlags = (_npcFlags & ~NPCFLAG_8) | NPCFLAG_START_IDLING; setTalking(this, false); startTalking(this, 221474); _npcFlags |= NPCFLAG_DOORBOT_INTRO; _introMovieNum = 0; } else if (clipExistsByEnd("Cloak On", msg->_endFrame)) { petShow(); setState1C(true); changeView("ServiceElevator.Node 1.S"); } else { CTrueTalkNPC::MovieEndMsg(msg); } } else if (_npcFlags & NPCFLAG_400000) { if (clipExistsByEnd("Whizz On Left", msg->_endFrame) || clipExistsByEnd("Whizz On Right", msg->_endFrame)) { setPosition(Point((600 - _bounds.width()) / 2 + 18, 42)); loadFrame(0); setTalking(this, true); _npcFlags |= NPCFLAG_START_IDLING; petSetArea(PET_CONVERSATION); } else if (clipExistsByEnd("Whizz Off Left", msg->_endFrame) || clipExistsByEnd("Whizz Off Right", msg->_endFrame)) { CPutBotBackInHisBoxMsg boxMsg; boxMsg.execute(this); if (_npcFlags & NPCFLAG_4000000) startAnimTimer("SummonBellbot", 1500); } else { CTrueTalkNPC::MovieEndMsg(msg); } } else { CTrueTalkNPC::MovieEndMsg(msg); } return true; }
bool CTitania::TimerMsg(CTimerMsg *msg) { changeView("Titania.Node 18.N", ""); startTalking("PerchedParrot", 80022); return true; }
bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { if (_field1D8) return true; if (!_enabled) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); return true; } CPetControl *pet = getPetControl(); if (!pet) return true; CGameObject *mailObject = findMail(pet->getRoomFlags()); if (!mailObject) { switch (getRandomNumber(2)) { case 0: startTalking(this, 70111, findView()); break; case 1: startTalking(this, 70112, findView()); break; case 2: startTalking(this, 70113, findView()); break; default: break; } petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY); } else { _field19C = 0; CRoomFlags roomFlags = _roomFlags; if (!pet->testRooms5(roomFlags) || getPassengerClass() > 0) { roomFlags = pet->getSpecialRoomFlags("BilgeRoom"); _field19C = 1; } else { pet->getMailDest(roomFlags); } _isFeathers = mailObject->getName() == "Feathers"; _isChicken = mailObject->getName() == "Chicken"; _field158 = 0; _field188 = 0; _field1D8 = 1; incTransitions(); if (_isFeathers) { _field19C = 0; removeMail(roomFlags, roomFlags); pet->phonographAction(""); if (_startFrame2 >= 0) { playMovie(_startFrame2, _endFrame2, 0); startTalking(this, 230022, findView()); } _field158 = 1; if (_startFrame3 >= 0) playMovie(_startFrame3, _endFrame3, 0); if (_startFrame4 >= 0) { _mailP = mailObject; playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT); } if (_startFrame5 >= 0) { playMovie(_startFrame5, _endFrame5, 0); } } else { removeMail(pet->getRoomFlags(), roomFlags); pet->phonographAction(""); if (_startFrame2 >= 0) { playMovie(_startFrame2, _endFrame2, 0); startTalking(this, 230012, findView()); } if (_startFrame3 >= 0) playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT); } } return true; }
bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { CPetControl *pet = getPetControl(); if (msg->_endFrame == _endFrame12) { if (_startFrame10 >= 0) playSound("z#27.wav"); } else if (msg->_endFrame == _endFrame10) { if (_startFrame11 >= 0) playSound("z#30.wav"); } else { if (_endFrame9 == _endFrame10 && pet) { if (_v2) { startTalking(this, getRandomNumber(1) ? 230062 : 230063); } else if (!findMail(pet->getRoomFlags())) { switch (getRandomNumber(4)) { case 0: startTalking(this, 230001); break; case 1: startTalking(this, 230002); break; case 2: startTalking(this, 230003); break; default: break; } } } if (msg->_endFrame == _endFrame3) { switch (_field158) { case 1: stopSound(_soundHandle); _soundHandle = playSound("z#3.wav"); break; case 2: stopSound(_soundHandle); _soundHandle = playSound("z#12.wav"); break; case 3: if (_isChicken) { startTalking(this, 230018); _isChicken = false; } else { startTalking(this, 230013); } break; case 4: startTalking(this, 230017); break; default: break; } CSUBTransition transMsg; transMsg.execute(this); } else if (msg->_endFrame == _bilgeEndFrame2) { playSound("z#25.wav", 70); playSound("z#24.wav", 70); } else if (msg->_endFrame == _endFrame4) { if (_mailP) { _mailP->petAddToInventory(); CVisibleMsg visibleMsg(true); visibleMsg.execute(_mailP); _mailP = nullptr; petSetArea(PET_INVENTORY); CSUBTransition transMsg; transMsg.execute(this); } } else if (msg->_endFrame == _bilgeEndFrame1) { changeView("BilgeRoomWith.Node 1.N", ""); _v2 = 0; resetMail(); if (_mailP) { _mailP->petAddToInventory(); CVisibleMsg visibleMsg(true); visibleMsg.execute(_mailP); _mailP = nullptr; petSetArea(PET_INVENTORY); } startTalking(this, 150); CBodyInBilgeRoomMsg bodyMsg; bodyMsg.execute("Service Elevator Entity"); decTransitions(); _field158 = 0; } else { _field158 = 0; } } return true; }
bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { CPetControl *pet = getPetControl(); if (!_enabled || !pet) return true; uint petRoomFlags = pet->getRoomFlags(); CGameObject *mailObject = findMail(petRoomFlags); if (!mailObject) { petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY); return true; } _field19C = 0; _mailP = mailObject; uint roomFlags = _roomFlags; if (!pet->testRooms5(roomFlags) || getPassengerClass() > pet->getMailDest(roomFlags)) { roomFlags = pet->getSpecialRoomFlags("BilgeRoom"); _field19C = 1; } _isChicken = mailObject->getName() == "Chicken"; _isFeathers = mailObject->getName() == "Feathers"; _field158 = 0; if (_v2) { if (_isFeathers) { startTalking(this, 230022); _field158 = 1; if (_startFrame3 >= 0) playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT); if (_bilgeStartFrame1 >= 0) { playMovie(_startFrame12, _endFrame12, MOVIE_GAMESTATE); playMovie(_bilgeStartFrame2, _bilgeEndFrame2, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); playMovie(_bilgeStartFrame1, _bilgeEndFrame1, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); incTransitions(); } } else { startTalking(this, 230012); _field158 = 2; if (_startFrame3 >= 0) playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); if (_startFrame4 >= 0) playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); if (_startFrame5 >= 0) playMovie(_startFrame5, _endFrame5, MOVIE_GAMESTATE); } } else { if (_isFeathers) { startTalking(this, 230022); _field158 = 3; if (_startFrame3 >= 0) playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); if (_startFrame4 >= 0) playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); if (_startFrame5 >= 0) playMovie(_startFrame5, _endFrame5, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); } else { removeMail(petRoomFlags, roomFlags); startTalking(this, 230012); if (_startFrame3 >= 0) { _field158 = 4; playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); } } } return true; }
bool CParrot::LeaveRoomMsg(CLeaveRoomMsg *msg) { if (!_v4) startTalking(this, 280259); return true; }
bool CParrot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) { static const char *const NAMES[] = { "Idle0", "Idle1", "Peck At Feet", "Peck At Feet Left" "Peck At Feet Right", nullptr }; if (!(_npcFlags & (NPCFLAG_10000 | NPCFLAG_20000 | NPCFLAG_40000 | NPCFLAG_80000 | NPCFLAG_100000 | NPCFLAG_200000 | NPCFLAG_400000)) && _visible && !_v4 && !compareViewNameTo("ParrotLobby.Node 1.N")) { CGameObject *dragItem = getDraggingObject(); if (!dragItem || dragItem->getName() == "Chicken") { if (!_v5 ||getRandomNumber(3) != 0) { if (getRandomNumber(1)) { startTalking(this, 280267, findView()); } else { msg->_names = NAMES; } } else { int id = -1; switch (stateGet38()) { case 0: id = 280107; break; case 1: id = 280106; break; case 2: id = 280115; break; case 3: id = 280114; break; case 4: id = 280113; break; case 5: id = 280112; break; case 6: id = 280111; break; case 7: id = 280110; break; case 8: id = 280109; break; case 9: id = 280108; break; case 10: id = 280105; break; case 11: id = 280000; break; default: break; } if (id != -1) startTalking(this, id, findView()); CActMsg actMsg("FlashCore"); actMsg.execute("PerchCoreHolder"); } } } return true; }
bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) { static const char *const ROOM_NAMES[] = { "SGTState", "SGTLittleLift", "SecClassLittleLift", "SecClassState", "Lift", "ServiceElevator", "Dome", "Home", "MoonEmbLobby", nullptr }; if (!stateGet24() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N")) return true; // Check for rooms not to speak in for (const char *const *s = &ROOM_NAMES[0]; *s; ++s) { if (isEquals(*s)) return true; } // Don't have the parrot speak too often if ((getTicksCount() - _field120) < 20000 || _speechCounter) return true; playSound("z#475.wav", 50); if (msg->_target == "Bomb") { startTalking("PerchedParrot", 280236); } else if (msg->_target == "Announcements") { startTalking("PerchedParrot", 280263); } else if (msg->_target == "Television") { startTalking("PerchedParrot", 280264); } else if (msg->_target == "Barbot") { if (msg->_action == "AskForDrink") startTalking("PerchedParrot", 280262); } else if (msg->_target == "SuccUBus") { if (msg->_action == "TurnOn") startTalking("PerchedParrot", 80161); else if (msg->_action == "EnterView") startTalking("PerchedParrot", 80159); } else if (msg->_target == "Cellpoints") { if (getRandomNumber(2) == 0) { switch (getRandomNumber(2)) { case 0: startTalking("PerchedParrot", 80193); break; case 1: startTalking("PerchedParrot", 80197); break; case 2: startTalking("PerchedParrot", 80198); break; default: break; } } else if (msg->_action == "DoorBot") { startTalking("PerchedParrot", 80195); } else if (msg->_action == "DeskBot") { startTalking("PerchedParrot", 80194); } else if (msg->_action == "BarBot") { startTalking("PerchedParrot", 80191); } else if (msg->_action == "BellBot") { startTalking("PerchedParrot", 80192); } else if (msg->_action == "LiftBot") { startTalking("PerchedParrot", 80196); } } _field120 = getTicksCount(); 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; }
void DccVoiceWindow::startOrStopTalking(bool bStart) { if(bStart)startTalking(); else stopTalking(); }