예제 #1
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;
}
예제 #2
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;
}