예제 #1
0
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;
}
예제 #2
0
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 (!_isOn || !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->_condiment == "None" : false;

		item->setVisible(false);
		if (_startFrame1 >= 0) {
			playSound("z#23.wav");
			playMovie(_startFrame1, _endFrame1, 0);
		}

		if (!chickenFlag) {
			// Not chicken, or chicken with condiments
			_field188 = 1;
			item->addMail(roomFlags);
			petSetArea(PET_REMOTE);
			petHighlightGlyph(16);
			CSUBTransition transMsg;
			transMsg.execute(this);
		} else {
			// Chicken without condiments was passed to SuccUBus, so it'll
			// eat it immediately
			if (_okStartFrame >= 0) {
				startTalking(this, 70219, findView());
				playMovie(_okStartFrame, _okEndFrame, 0);
			}

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

			// WORKAROUND: The original had code below to return the chicken
			// to the dispensor after eaten, but since _fullViewName isn't
			// set, it didn't work. I've added code below in the else block
			// that replicates what happens when the parrot eats the chicken
			CViewItem *view = parseView(chicken->_fullViewName);
			if (view) {
				item->setPosition(item->_origPos);
				item->moveUnder(view);

				CSUBTransition transMsg;
				transMsg.execute(this);
			} else {
				CActMsg actMsg("Eaten");
				actMsg.execute(chicken);
				return false;
			}
		}
	}

	return true;
}