示例#1
0
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;
}
示例#2
0
bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CGameObject *other = msg->_other;
	CString otherName = other->getName();

	if (otherName == "PET") {
		return CCarry::UseWithOtherMsg(msg);
	} else if (isEquals("DatasideTransporter")) {
		CShowTextMsg textMsg("This item is incorrectly calibrated.");
		textMsg.execute("PET");
	} else if (isEquals("DatasideTransporter")) {
		error("TODO: Set msg->_other->fieldC4 = 2");
	} else if (isEquals("SendYourself")) {
		error("TODO: Set msg->_other->fieldC8 = 1");
	}

	return true;
}
示例#3
0
bool CPetControl::isBotInView(const CString &name) const {
	CGameManager *gameManager = getGameManager();
	if (!gameManager)
		return false;
	CViewItem *view = gameManager->getView();
	if (!view)
		return false;

	// Iterate to find NPC
	for (CTreeItem *child = view->getFirstChild(); child; child = child->scan(view)) {
		CGameObject *gameObject = dynamic_cast<CGameObject *>(child);
		if (gameObject) {
			if (!gameObject->getName().compareToIgnoreCase(name))
				return true;
		}
	}

	return false;
}
示例#4
0
bool CChicken::TimerMsg(CTimerMsg *msg) {
	CGameObject *obj = getMailManFirstObject();
	while (obj && obj->getName() != "Chicken")
		obj = getMailManNextObject(obj);

	bool flag = false;
	if (obj) {
		flag = _v1;
	} else if (_v1 > 0) {
		--_v1;
		flag = _v1;
	}

	if (flag) {
		petInvChange();
		stopTimer(_timerId);
	}

	return true;
}
示例#5
0
bool CPetControl::dismissBot(const CString &name) {
	CGameManager *gameManager = getGameManager();
	if (!gameManager)
		return false;
	CViewItem *view = gameManager->getView();
	if (!view)
		return false;

	bool result = false;
	CDismissBotMsg dismissMsg;
	for (CTreeItem *treeItem = view->getFirstChild(); treeItem;
			treeItem = treeItem->scan(view)) {
		CGameObject *obj = dynamic_cast<CGameObject *>(treeItem);
		if (obj) {
			if (!obj->getName().compareToIgnoreCase(name))
				result = true;
			else
				dismissMsg.execute(treeItem);
		}
	}

	return result;
}
示例#6
0
bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
	CGameObject *other = msg->_other;
	CString otherName = other->getName();

	if (otherName == "PET") {
		return CCarry::UseWithOtherMsg(msg);
	} else if (otherName == "DatasideTransporter") {
		CString name = getName();
		if (name == "DatasideTransporter") {
			// TODO
			if (name != "SendYourself") {
				// TODO
			}
		} else {
			// TODO	
		}
	} else {
		CShowTextMsg textMsg("This item is incorrectly calibrated.");
		textMsg.execute("PET");
	}

	return true;
}
示例#7
0
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;
}
示例#8
0
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;
}
示例#9
0
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;
}
示例#10
0
bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
	if (_inProgress)
		return true;

	if (!_isOn) {
		petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY);
		return true;
	}

	CPetControl *pet = getPetControl();
	if (!pet)
		return true;

	uint destRoomFlags = pet->getRoomFlags();
	CGameObject *mailObject = findMail(destRoomFlags);
	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 {
		_sendLost = false;

		CRoomFlags roomFlags = _destRoomFlags;
		if (!pet->isSuccUBusDest(roomFlags) || pet->getMailDestClass(roomFlags) < getPassengerClass()) {
			roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
			_sendLost = true;
		}

		_isFeathers = mailObject->getName() == "Feathers";
		_isChicken = mailObject->getName() == "Chicken";
		_sendAction = SA_SENT;
		_field188 = 0;
		_inProgress = true;
		incTransitions();

		if (_isFeathers) {
			// The feather has special handling to be rejected by the SuccUBus
			_sendLost = false;
			sendMail(destRoomFlags, roomFlags);
			pet->phonographAction("");

			if (_okStartFrame >= 0) {
				playMovie(_okStartFrame, _okEndFrame, 0);
				startTalking(this, 230022, findView());
			}

			_sendAction = SA_FEATHERS;
			if (_sendStartFrame >= 0)
				playMovie(_sendStartFrame, _sendEndFrame, 0);

			if (_receiveStartFrame >= 0) {
				_mailP = mailObject;
				playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT);
			}

			if (_afterReceiveStartFrame >= 0) {
				playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, 0);
			}
		} else {
			// Send the mail to the destination
			sendMail(pet->getRoomFlags(), roomFlags);
			pet->phonographAction("");

			if (_okStartFrame >= 0) {
				playMovie(_okStartFrame, _okEndFrame, 0);
				startTalking(this, 230012, findView());
			}

			if (_sendStartFrame >= 0)
				playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);
		}
	}

	return true;
}
示例#11
0
bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) {
	CPetControl *pet = getPetControl();
	if (!_isOn || !pet)
		return true;

	uint petRoomFlags = pet->getRoomFlags();
	CGameObject *mailObject = findMail(petRoomFlags);

	if (!mailObject) {
		petDisplayMessage(2, NOTHING_IN_SUCCUBUS_TRAY);
		return true;
	}

	_sendLost = false;
	_mailP = mailObject;

	uint roomFlags = _destRoomFlags;
	if (!pet->isSuccUBusDest(roomFlags) || getPassengerClass() > pet->getMailDestClass(roomFlags)) {
		roomFlags = pet->getSpecialRoomFlags("BilgeRoom");
		_sendLost = true;
	}

	_isChicken = mailObject->getName() == "Chicken";
	_isFeathers = mailObject->getName() == "Feathers";
	_sendAction = SA_SENT;

	if (_style) {
		if (_isFeathers) {
			startTalking(this, 230022);
			_sendAction = SA_FEATHERS;

			if (_sendStartFrame >= 0)
				playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT);

			if (_sneezing2StartFrame >= 0) {
				playMovie(_trayOutStartFrame, _trayOutEndFrame, MOVIE_WAIT_FOR_FINISH);
				playMovie(_sneezing1StartFrame, _sneezing1EndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
				playMovie(_sneezing2StartFrame, _sneezing2EndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
				incTransitions();
			}
		} else {
			startTalking(this, 230012);
			_sendAction = SA_EATEN;
			if (_sendStartFrame >= 0)
				playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
			if (_receiveStartFrame >= 0)
				playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
			if (_afterReceiveStartFrame >= 0)
				playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_WAIT_FOR_FINISH);
		}
	} else {
		if (_isFeathers) {
			startTalking(this, 230022);
			_sendAction = SA_BILGE_FEATHERS;

			if (_sendStartFrame >= 0)
				playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
			if (_receiveStartFrame >= 0)
				playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
			if (_afterReceiveStartFrame >= 0)
				playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
		} else {
			sendMail(petRoomFlags, roomFlags);
			startTalking(this, 230012);
			if (_sendStartFrame >= 0) {
				_sendAction = SA_BILGE_SENT;
				playMovie(_sendStartFrame, _sendEndFrame, MOVIE_NOTIFY_OBJECT | MOVIE_WAIT_FOR_FINISH);
			}
		}
	}

	return true;
}