bool CShipSetting::MouseDragStartMsg(CMouseDragStartMsg *msg) { if (!checkStartDragging(msg)) return false; if (_itemName == "NULL") return true; CTurnOff offMsg; offMsg.execute(_target); if (isEquals("ChickenSetting") || _itemName == "ChickenBridge") { CActMsg actMsg("IncreaseQuantity"); actMsg.execute("ChickenDispenser"); } if (_itemName != "NULL") { CPassOnDragStartMsg passMsg(msg->_mousePos, 1); passMsg.execute(_itemName); msg->_dragItem = getRoot()->findByName(_itemName); CVisibleMsg visibleMsg(true); visibleMsg.execute(_itemName); } CSetFrameMsg frameMsg(0); frameMsg.execute(_frameTarget); _itemName = "NULL"; _cursorId = CURSOR_ARROW; 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 CBilgeSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (_isOn) { switch (getRandomNumber(4)) { case 0: case 4: { _isOn = 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); _isOn = true; } return true; }
bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (!_v3) { CTurnOff offMsg; offMsg.execute(this); } return true; }
bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) { if (_deskbotActive) { CTurnOff turnOff; turnOff.execute(this); } return true; }
bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) { CPetControl *pet = getPetControl(); if (msg->_value == _field1DC) return true; if (mailExists(pet->getRoomFlags())) return false; _field1DC = msg->_value; if (_field1DC) { CGameObject *item = msg->_object; _string3 = item->getName(); CHoseConnectedMsg hoseMsg(1, this); hoseMsg.execute(msg->_object); item->petMoveToHiddenRoom(); CPumpingMsg pumpingMsg(1, this); pumpingMsg.execute(this); _field1DC = 1; if (_enabled) { _enabled = false; } else { playMovie(_startFrame9, _endFrame9, 0); playSound("z#26.wav"); } playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT); } else { stopMovie(); stopSound(_field1EC); playMovie(_field1F0, _field1F4, MOVIE_NOTIFY_OBJECT); CPumpingMsg pumpingMsg(0, this); pumpingMsg.execute(_string3); CGameObject *obj = getHiddenObject(_string3); if (obj) { obj->petAddToInventory(); obj->setVisible(true); } _enabled = true; CTurnOff offMsg; offMsg.execute(this); } return true; }
bool CSGTStateRoom::ActMsg(CActMsg *msg) { CPetControl *pet = getPetControl(); uint roomFlags = pet->getRoomFlags(); uint assignedRoom = pet->getAssignedRoomFlags(); if (roomFlags != assignedRoom) { petDisplayMessage(NOT_YOUR_ASSIGNED_ROOM); } else if (_isClosed) { CTurnOn onMsg; onMsg.execute(this); } else { CTurnOff offMsg; offMsg.execute(this); } return true; }
bool CLightSwitch::PETActivateMsg(CPETActivateMsg *msg) { if (msg->_name == "Light") { if (_flag) { CTurnOff offMsg; offMsg.execute("1stClassState", CLight::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN); } else { CTurnOn onMsg; onMsg.execute("1stClassState", CLight::_type, MSGFLAG_CLASS_DEF | MSGFLAG_SCAN); _flag = false; if (_turnOnTV) CTelevision::_turnOn = false; } } return true; }
bool CShipSetting::AddHeadPieceMsg(CAddHeadPieceMsg *msg) { _cursorId = CURSOR_HAND; if (msg->_value == "Enable") { CTurnOn onMsg; onMsg.execute(_target); if (isEquals("ChickenSetting")) { CActMsg actMsg("DecreaseQuantity"); actMsg.execute("ChickenDispenser"); } } else { CTurnOff offMsg; offMsg.execute(_target); } return true; }
bool CNodeAutoSoundPlayer::LeaveNodeMsg(CLeaveNodeMsg *msg) { CNodeItem *node = findNode(); CRoomItem *room = findRoom(); if (node == msg->_oldNode) { CTurnOff offMsg; offMsg.execute(this); if (_enabled) { CChangeMusicMsg changeMsg; changeMsg._action = MUSIC_START; changeMsg.execute(room, CAutoMusicPlayer::_type, MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); } } return true; }
bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { switch (msg->_action) { case 19: inc54(); lockMouse(); petSetArea(PET_CONVERSATION); playClip("ReprogramPETInHand", MOVIE_NOTIFY_OBJECT); _npcFlags |= NPCFLAG_10000; _classNum = (PassengerClass)msg->_param1; switch (_classNum) { case FIRST_CLASS: petDisplayMessage(UPGRADED_TO_FIRST_CLASS); setPassengerClass(_classNum); petReassignRoom(_classNum); break; case SECOND_CLASS: petDisplayMessage(UPGRADED_TO_SECOND_CLASS); setPassengerClass(_classNum); petReassignRoom(_classNum); break; case THIRD_CLASS: setPassengerClass(THIRD_CLASS); petReassignRoom(_classNum); break; default: break; } case 20: if (getPassengerClass() == 1) { CPetControl *petControl = getPetControl(); if (petControl) petControl->changeLocationClass(UNCHECKED); } break; case 21: if (getPassengerClass() == FIRST_CLASS) { CPetControl *petControl = getPetControl(); if (petControl) petControl->changeLocationClass(THIRD_CLASS); } break; case 22: if (getPassengerClass() == FIRST_CLASS) { CPetControl *petControl = getPetControl(); if (petControl) petControl->changeLocationClass(SECOND_CLASS); } break; case 23: if (getPassengerClass() == FIRST_CLASS) { CPetControl *petControl = getPetControl(); if (petControl) petControl->changeLocationClass(FIRST_CLASS); } break; case 26: _npcFlags |= NPCFLAG_80000; CTurnOff turnOff; turnOff.execute(this); lockMouse(); break; } return true; }
bool CBarbot::LeaveViewMsg(CLeaveViewMsg *msg) { CTurnOff offMsg; offMsg.execute(this); return true; }