コード例 #1
0
ファイル: bilge_succubus.cpp プロジェクト: OmerMor/scummvm
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 (_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;
}
コード例 #3
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;
}
コード例 #4
0
ファイル: bilge_succubus.cpp プロジェクト: DrItanium/scummvm
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;
}