Ejemplo n.º 1
0
bool CBilgeSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) {
	CPetControl *pet = getPetControl();

	if (_style) {
		if (_receiveStartFrame >= 0)
			playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_WAIT_FOR_FINISH);
		if (_afterReceiveStartFrame >= 0)
			playMovie(_afterReceiveStartFrame, _afterReceiveEndFrame, MOVIE_WAIT_FOR_FINISH);

		playSound("z#28.wav", 70);
	} else if (!_isOn) {
		petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY);
		return false;
	} else if (!pet) {
		return false;
	} else {
		uint roomFlags = pet->getRoomFlags();
		CGameObject *mailObject = findMailByFlags(
			_enabled && compareRoomNameTo("Titania") ? RFC_TITANIA : _flagsComparison,
			roomFlags);

		if (mailObject) {
			_mailP = mailObject;
			if (_receiveStartFrame >= 0)
				playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_WAIT_FOR_FINISH);
		} else {
			petDisplayMessage(2, NOTHING_TO_DELIVER);
		}
	}

	return true;
}
Ejemplo n.º 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 (!_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;
}
Ejemplo n.º 3
0
bool CBilgeSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) {
	CPetControl *pet = getPetControl();

	if (_v2) {
		if (_startFrame4 >= 0)
			playMovie(_startFrame4, _endFrame4, MOVIE_GAMESTATE);
		if (_startFrame5 >= 0)
			playMovie(_startFrame5, _endFrame5, MOVIE_GAMESTATE);

		playSound("z#28.wav", 70);
	} else if (!_enabled) {
		petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY);
		return false;
	} else if (!pet) {
		return false;
	} else {
		uint roomFlags = pet->getRoomFlags();
		CGameObject *mailObject = findMailByFlags(
			_v3 && compareRoomNameTo("Titania") ? 3 : _field140,
			roomFlags);

		if (mailObject) {
			_mailP = mailObject;
			if (_startFrame4 >= 0)
				playMovie(_startFrame4, _endFrame4, MOVIE_GAMESTATE);
		} else {
			petDisplayMessage(2, NOTHING_TO_DELIVER);
		}
	}

	return true;
}
Ejemplo n.º 4
0
bool CSuccUBus::TurnOn(CTurnOn *msg) {
	if (getRandomNumber(9) == 0) {
		CParrotSpeakMsg speakMsg("SuccUBus", "TurnOn");
		speakMsg.execute("PerchedParrot");
	}

	CPetControl *pet = getPetControl();
	if (pet) {
		if (!_signalFlag && _initialStartFrame >= 0) {
			playMovie(_initialStartFrame, _initialEndFrame, 0);
			playSound("z#30.wav", 100);
		}

		if (_onStartFrame >= 0) {
			playMovie(_onStartFrame, _onEndFrame, MOVIE_NOTIFY_OBJECT);
			playSound("z#26.wav", 100);
		}

		uint petRoomFlags = pet->getRoomFlags();
		if (mailExists(petRoomFlags) && _endFrame1 >= 0)
			// Mail canister present
			playMovie(_endFrame1, _endFrame1, 0);

		_isOn = true;
		CSUBTransition transMsg;
		transMsg.execute(this);

		setTalking(this, true, findView());
		petSetArea(PET_REMOTE);
		petHighlightGlyph(16);
	}

	return true;
}
Ejemplo n.º 5
0
bool CSuccUBus::TurnOn(CTurnOn *msg) {
    if (getRandomNumber(9) == 0) {
        CParrotSpeakMsg speakMsg("SuccUBus", "TurnOn");
        speakMsg.execute("PerchedParrot");
    }

    CPetControl *pet = getPetControl();
    if (pet) {
        if (!_field15C && _startFrame8 >= 0) {
            playMovie(_startFrame8, _endFrame8, 0);
            playSound("z#30.wav", 100);
        }

        if (_startFrame9 >= 0) {
            playMovie(_startFrame9, _endFrame9, MOVIE_NOTIFY_OBJECT);
            playSound("z#26.wav", 100);
        }

        uint petRoomFlags = pet->getRoomFlags();
        if (mailExists(petRoomFlags) && _endFrame1 >= 0)
            playMovie(_endFrame1, _endFrame1, 0);

        _enabled = true;
        CSUBTransition transMsg;
        transMsg.execute(this);

        setTalking(this, true, findView());
        petSetArea(PET_REMOTE);
        petHighlightGlyph(16);
    }

    return true;
}
Ejemplo n.º 6
0
bool CBilgeSuccUBus::SubAcceptCCarryMsg(CSubAcceptCCarryMsg *msg) {
	CPetControl *pet = getPetControl();
	if (!msg->_item)
		return false;

	CCarry *item = dynamic_cast<CCarry *>(msg->_item);
	if (!_enabled || !pet || !item) {
		item->petAddToInventory();
		return true;
	}

	uint petRoomFlags = pet->getRoomFlags();
	if (mailExists(petRoomFlags)) {
		petDisplayMessage(2, SUCCUBUS_SINGLE_DELIVERY);
		item->petAddToInventory();
		return true;
	}

	petContainerRemove(item);
	pet->phonographAction("");
	playSound("z#23.wav");

	CChicken *chicken = dynamic_cast<CChicken *>(item);
	bool chickenFlag = chicken ? chicken->_string6 == "None" : false;

	if (chickenFlag) {
		if (_startFrame2 >= 0) {
			startTalking(this, 70219);
			playMovie(_startFrame2, _endFrame2, 0);
		}

		if (_startFrame3 >= 0) {
			_field158 = 5;
			playMovie(_startFrame3, _endFrame3, MOVIE_NOTIFY_OBJECT);
		}

		CViewItem *view = parseView(item->_fullViewName);
		if (view) {
			item->setVisible(false);
			setPosition(item->_origPos);
			item->moveUnder(view);

			CSUBTransition transMsg;
			transMsg.execute(this);
		} else {
			return false;
		}
	} else {
		item->addMail(petRoomFlags);
		if (_startFrame2 >= 0)
			playMovie(_startFrame2, _endFrame2, 0);

		petSetArea(PET_REMOTE);
		CSUBTransition transMsg;
		transMsg.execute(this);
	}

	return true;
}
Ejemplo n.º 7
0
bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) {
	CPetControl *pet = getPetControl();

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

	uint petRoomFlags = pet->getRoomFlags();
	if (mailExists(petRoomFlags)) {
		// There's already something to send in the tray, so you can't receive
		switch (getRandomNumber(2)) {
		case 0:
			startTalking(this, 70080, findView());
			break;
		case 1:
			startTalking(this, 70081, findView());
			break;
		case 2:
			startTalking(this, 70082, findView());
			break;
		default:
			break;
		}
	} else {
		CGameObject *mailObject = findMailByFlags(
			_enabled && compareRoomNameTo("Titania") ? RFC_TITANIA : _flagsComparison, petRoomFlags);
		if (!mailObject) {
			// No mail for this SuccUBus
			if (getRandomNumber(1) == 0) {
				startTalking(this, 70104, findView());
			} else {
				startTalking(this, 70105, findView());
			}

			playMovie(_emptyStartFrame, _emptyEndFrame, 0);
			playMovie(_smokeStartFrame, _smokeEndFrame, 0);
			petDisplayMessage(2, NOTHING_TO_DELIVER);
		} else {
			// Receive the mail addressed to this SuccUBus
			_mailP = mailObject;
			startTalking(this, 230004, findView());

			if (_receiveStartFrame >= 0) {
				_sendAction = SA_FEATHERS;
				_inProgress = true;
				incTransitions();
				playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT);
			}
		}
	}

	return true;
}
Ejemplo n.º 8
0
bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) {
    CPetControl *pet = getPetControl();

    if (_field1D8 || !pet)
        return true;
    if (!_enabled) {
        petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY);
        return true;
    }

    uint petRoomFlags = pet->getRoomFlags();
    if (mailExists(petRoomFlags)) {
        switch (getRandomNumber(2)) {
        case 0:
            startTalking(this, 70080, findView());
            break;
        case 1:
            startTalking(this, 70081, findView());
            break;
        case 2:
            startTalking(this, 70082, findView());
            break;
        default:
            break;
        }
    } else {
        CGameObject *mailObject = findMailByFlags(compareRoomNameTo("Titania")
                                  ? 3 : _field140, petRoomFlags);
        if (!mailObject) {
            if (getRandomNumber(1) == 0) {
                startTalking(this, 70104, findView());
            } else {
                startTalking(this, 70105, findView());
            }

            playMovie(_startFrame6, _endFrame6, 0);
            playMovie(_startFrame7, _endFrame7, 0);
            petDisplayMessage(2, NOTHING_TO_DELIVER);
        } else {
            startTalking(this, 230004, findView());

            if (_startFrame4 >= 0) {
                _field158 = 1;
                _field1D8 = 1;
                incTransitions();
                playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT);
            }
        }
    }

    return true;
}
Ejemplo n.º 9
0
bool CSGTStateRoom::LeaveRoomMsg(CLeaveRoomMsg *msg) {
	CPetControl *pet = getPetControl();
	uint roomFlags = pet->getRoomFlags();
	uint assignedRoom = pet->getAssignedRoomFlags();

	if (roomFlags == assignedRoom) {
		_savedFrame = getMovieFrame();
		_savedIsClosed = _isClosed;
		_savedVisible = _visible;
	}

	_statics->_roomFlags = roomFlags;
	return true;
}
Ejemplo n.º 10
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;
}
Ejemplo n.º 11
0
bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
	if (getRandomNumber(6) == 0) {
		CParrotSpeakMsg parrotMsg("Television", "");
		parrotMsg.execute("PerchedParrot");
	}

	if (_channelNum == 3 && compareRoomNameTo("SGTState") && getPassengerClass() == THIRD_CLASS) {
		// WORKAROUND: The original allowed the magazine to be "won" multiple times. We
		// now search for magazine within the room (which is it's initial, hidden location).
		// That way, when it's 'Won', it's no longer present and can't be won again
		CMagazine *magazine = dynamic_cast<CMagazine *>(findRoom()->findByName("Magazine"));

		if (magazine) {
			// You may be a winner
			CProximity prox1, prox2;
			prox1._soundType = prox2._soundType = Audio::Mixer::kSpeechSoundType;
			playSound(TRANSLATE("z#47.wav", "z#578.wav"), prox1);
			_soundHandle = playSound(TRANSLATE("b#20.wav", "b#1.wav"), prox2);

			// Get the room flags for the SGT floor we're on
			CPetControl *pet = getPetControl();
			uint roomFlags = pet->getRoomFlags();

			// Send the magazine to the SuccUBus
			debugC(DEBUG_INTERMEDIATE, kDebugScripts, "Assigned room - %d", roomFlags);
			magazine->addMail(roomFlags);
			magazine->sendMail(roomFlags, roomFlags);

			loadFrame(561);
		} else {
			petDisplayMessage(NOTHING_ON_CHANNEL);
		}
	} else if (_channelNum == 2) {
		loadFrame(_seasonFrame);
	} else if (_channelNum == 4 && _channel4Glyph) {
		if (_turnOn)
			loadFrame(502);
		else
			petDisplayMessage(NOTHING_ON_CHANNEL);
	} else if (_channelNum == 5 && *CGetLiftEye2::_destObject != "NULL") {
		loadFrame(393 + _eyeFloorNum);
	} else {
		petDisplayMessage(NOTHING_ON_CHANNEL);
	}

	return true;
}
Ejemplo n.º 12
0
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;
}
Ejemplo n.º 13
0
bool CSuccUBus::MouseDragStartMsg(CMouseDragStartMsg *msg) {
    CPetControl *pet = getPetControl();
    Rect tempRect = _rect1;
    tempRect.translate(_bounds.left, _bounds.top);

    if (_field1D8 || !_enabled || !_field188 || !tempRect.contains(msg->_mousePos)
            || !pet)
        return true;

    uint petRoomFlags = pet->getRoomFlags();
    CGameObject *mailObject = findMail(petRoomFlags);
    if (!mailObject)
        return true;

    petAddToCarryParcel(mailObject);
    CViewItem *view = getView();
    if (!view)
        return true;

    mailObject->moveUnder(view);
    mailObject->setPosition(Point(msg->_mousePos.x + mailObject->_bounds.width() / 2,
                                  msg->_mousePos.y + mailObject->_bounds.height() / 2));

    CVisibleMsg visibleMsg(true);
    visibleMsg.execute(mailObject);
    CPassOnDragStartMsg dragMsg;
    dragMsg._mousePos = msg->_mousePos;
    dragMsg._value3 = 1;
    dragMsg.execute(mailObject);

    if (!dragMsg._value4)
        msg->_dragItem = mailObject;

    loadFrame(_field184);
    _field188 = 0;
    CSUBTransition transMsg;
    transMsg.execute(this);

    return true;
}
Ejemplo n.º 14
0
bool CSuccUBus::SUBTransition(CSUBTransition *msg) {
    CPetControl *pet = getPetControl();

    if (pet) {
        uint petRoomFlags = pet->getRoomFlags();

        if (_enabled) {
            CGameObject *mailObject = findMail(petRoomFlags);
            if (mailObject)
                pet->phonographAction("Send");
            else
                pet->phonographAction("Receive");
        } else {
            if (pet->isSuccUBusRoom(petRoomFlags))
                pet->phonographAction("Record");
            else
                pet->phonographAction("");
        }
    }

    return true;
}
Ejemplo n.º 15
0
bool CSGTStateRoom::EnterRoomMsg(CEnterRoomMsg *msg) {
	CPetControl *pet = getPetControl();
	uint roomFlags = pet->getRoomFlags();
	uint assignedRoom = pet->getAssignedRoomFlags();

	if (roomFlags == assignedRoom) {
		loadFrame(_savedFrame);
		_isClosed = _savedIsClosed;
		setVisible(_savedVisible);

		if (isEquals("Desk") && _statics->_desk == "Closed")
			loadFrame(1);
	}

	if (isEquals("Drawer")) {
		petSetArea(PET_REMOTE);
		if (roomFlags == assignedRoom && getPassengerClass() == 3
				&& _statics->_announcementFlag) {
			// Congratulations, you may have won an upgrade
			playSound("b#21.wav");
			_statics->_announcementFlag = false;
		}

		_statics->_drawer = "Closed";
		setVisible(false);
		_isClosed = true;
	} else if (roomFlags != assignedRoom) {
		loadFrame(0);
		if (_displayFlag) {
			setVisible(true);
			if (isEquals("Desk"))
				loadFrame(1);
		} else {
			setVisible(false);
		}
	}

	return true;
}
Ejemplo n.º 16
0
bool CBilgeSuccUBus::TurnOn(CTurnOn *msg) {
	CPetControl *pet = getPetControl();

	if (pet) {
		if (_startFrame9 >= 0) {
			playMovie(_startFrame9, _endFrame9, MOVIE_NOTIFY_OBJECT);
			playSound("z#26.wav");
		}

		if (mailExists(pet->getRoomFlags()) && _startFrame2 >= 0)
			playMovie(_startFrame2, _endFrame2, 0);

		_enabled = true;
		CSUBTransition transMsg;
		transMsg.execute(this);

		setTalking(this, true);
		petSetArea(PET_REMOTE);
		petHighlightGlyph(16);
	}

	return true;
}
Ejemplo n.º 17
0
bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
	if (getRandomNumber(6) == 0) {
		CParrotSpeakMsg parrotMsg("Television", "");
		parrotMsg.execute("PerchedParrot");
	}

	if (_channelNum == 3 && compareRoomNameTo("SGTState") && getPassengerClass() == THIRD_CLASS) {
		playSound("z#47.wav");
		_soundHandle = playSound("b#20.wav");
		CMagazine *magazine = dynamic_cast<CMagazine *>(getRoot()->findByName("Magazine"));

		if (magazine) {
			CPetControl *pet = getPetControl();
			uint roomFlags = pet->getRoomFlags();

			debugC(kDebugScripts, "Assigned room - %d", roomFlags);
			magazine->addMail(roomFlags);
			magazine->removeMail(roomFlags, roomFlags);
		}

		loadFrame(561);
	} else if (_channelNum == 2) {
		loadFrame(_seasonFrame);
	} else if (_channelNum == 4 && _channel4Glyph) {
		if (_turnOn)
			loadFrame(502);
		else
			petDisplayMessage(NOTHING_ON_CHANNEL);
	} else if (_channelNum == 5 && *CGetLiftEye2::_destObject != "NULL") {
		loadFrame(393 + _floorNum);
	} else {
		petDisplayMessage(NOTHING_ON_CHANNEL);
	}

	return true;
}
Ejemplo n.º 18
0
bool CBilgeSuccUBus::TurnOff(CTurnOff *msg) {
	CPetControl *pet = getPetControl();

	if (pet && mailExists(pet->getRoomFlags()) && _startFrame12 >= 0)
		playMovie(_startFrame12, _endFrame12, MOVIE_NOTIFY_OBJECT);
	else if (_endFrame12 >= 0)
		playMovie(_endFrame12, _endFrame12, MOVIE_NOTIFY_OBJECT);

	if (_soundHandle != -1) {
		stopSound(_soundHandle);
		_soundHandle = -1;
	}

	if (_startFrame10 >= 0)
		playMovie(_startFrame10, _endFrame10, MOVIE_NOTIFY_OBJECT);

	_enabled = false;
	performAction(true);

	CSUBTransition transMsg;
	transMsg.execute(this);

	return true;
}
Ejemplo n.º 19
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;
}
Ejemplo n.º 20
0
bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
	CPetControl *pet = getPetControl();
	uint petRoomFlags = pet ? pet->getRoomFlags() : 0;

	if (msg->_endFrame == _offEndFrame) {
		if (_endingStartFrame >= 0)
			playSound("z#30.wav", 100);

		if (_signalFlag) {
			_signalFlag = false;
			setVisible(false);
			CSignalObject signalMsg;
			signalMsg._numValue = 1;
			signalMsg.execute(_signalTarget);
		}
	}

	if (msg->_endFrame == _onEndFrame) {
		bool flag = false;

		if (pet && !mailExists(petRoomFlags)) {
			CGameObject *mailObject = _enabled && compareRoomNameTo("Titania") ?
				findMailByFlags(RFC_TITANIA, petRoomFlags) :
				findMailByFlags(_flagsComparison, petRoomFlags);

			if (mailObject) {
				switch (getRandomNumber(4)) {
				case 0:
					startTalking(this, 70094, findView());
					break;
				case 1:
					startTalking(this, 70095, findView());
					break;
				case 2:
					startTalking(this, 70096, findView());
					break;
				case 3:
					startTalking(this, 70098, findView());
					break;
				case 4:
					startTalking(this, 70099, findView());
					break;
				default:
					break;
				}
				flag = true;
			}
		}

		if (!_field188 && !flag) {
			stopSound(_soundHandle);
			_soundHandle = -1;

			switch (getRandomNumber(_style ? 7 : 5, &_priorRandomVal2)) {
			case 2:
				startTalking(this, 230001, findView());
				break;
			case 3:
				startTalking(this, 230002, findView());
				break;
			case 4:
				startTalking(this, 230003, findView());
				break;
			case 5:
				startTalking(this, 230064, findView());
				break;
			case 6:
				startTalking(this, 230062, findView());
				break;
			case 7:
				startTalking(this, 230063, findView());
				break;
			default:
				break;
			}
		}
	}

	if (msg->_endFrame == _sendEndFrame) {
		if (_sendAction == SA_FEATHERS) {
			startTalking(this, 230022, findView());
		} else if (_sendAction == SA_EATEN) {
			startTalking(this, 230017, findView());
		} else if (_sendLost) {
			startTalking(this, 230019, findView());
			_sendLost = false;
		} else if (_isChicken) {
			startTalking(this, 230018, findView());
			_isChicken = false;
		} else {
			startTalking(this, 230013, findView());
		}

		if (_inProgress) {
			_inProgress = false;
			decTransitions();
		}

		CSUBTransition transMsg;
		transMsg.execute(this);
	}

	if (msg->_endFrame == _receiveEndFrame) {
		// SuccUBus disgorged mail
		if (pet && _mailP) {
			_mailP->setMailDest(petRoomFlags);
		}

		_field188 = 1;
		_mailP = nullptr;
		if (_inProgress) {
			_inProgress = false;
			decTransitions();
		}

		CSUBTransition transMsg;
		transMsg.execute(this);
	}

	return true;
}
Ejemplo n.º 21
0
bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
	CPetControl *pet = getPetControl();

	if (msg->_endFrame == _endFrame12) {
		if (_startFrame10 >= 0)
			playSound("z#27.wav");
	} else if (msg->_endFrame == _endFrame10) {
		if (_startFrame11 >= 0)
			playSound("z#30.wav");
	} else {
		if (_endFrame9 == _endFrame10 && pet) {
			if (_v2) {
				startTalking(this, getRandomNumber(1) ? 230062 : 230063);
			} else if (!findMail(pet->getRoomFlags())) {
				switch (getRandomNumber(4)) {
				case 0:
					startTalking(this, 230001);
					break;
				case 1:
					startTalking(this, 230002);
					break;
				case 2:
					startTalking(this, 230003);
					break;
				default:
					break;
				}
			}
		}

		if (msg->_endFrame == _endFrame3) {
			switch (_field158) {
			case 1:
				stopSound(_soundHandle);
				_soundHandle = playSound("z#3.wav");
				break;
			case 2:
				stopSound(_soundHandle);
				_soundHandle = playSound("z#12.wav");
				break;
			case 3:
				if (_isChicken) {
					startTalking(this, 230018);
					_isChicken = false;
				} else {
					startTalking(this, 230013);
				}
				break;
			case 4:
				startTalking(this, 230017);
				break;
			default:
				break;
			}

			CSUBTransition transMsg;
			transMsg.execute(this);

		} else if (msg->_endFrame == _bilgeEndFrame2) {
			playSound("z#25.wav", 70);
			playSound("z#24.wav", 70);

		} else if (msg->_endFrame == _endFrame4) {
			if (_mailP) {
				_mailP->petAddToInventory();
				CVisibleMsg visibleMsg(true);
				visibleMsg.execute(_mailP);

				_mailP = nullptr;
				petSetArea(PET_INVENTORY);

				CSUBTransition transMsg;
				transMsg.execute(this);
			}

		} else if (msg->_endFrame == _bilgeEndFrame1) {
			changeView("BilgeRoomWith.Node 1.N", "");
			_v2 = 0;
			resetMail();

			if (_mailP) {
				_mailP->petAddToInventory();
				CVisibleMsg visibleMsg(true);
				visibleMsg.execute(_mailP);

				_mailP = nullptr;
				petSetArea(PET_INVENTORY);
			}

			startTalking(this, 150);
			CBodyInBilgeRoomMsg bodyMsg;
			bodyMsg.execute("Service Elevator Entity");
			decTransitions();
			_field158 = 0;

		} else {
			_field158 = 0;
		}
	}

	return true;
}
Ejemplo n.º 22
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;
}
Ejemplo n.º 23
0
bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
	CPetControl *pet = getPetControl();

	if (msg->_endFrame == _trayOutEndFrame) {
		if (_offStartFrame >= 0)
			playSound("z#27.wav");
	} else if (msg->_endFrame == _offEndFrame) {
		if (_endingStartFrame >= 0)
			playSound("z#30.wav");
	} else {
		if (msg->_endFrame == _onEndFrame && pet) {
			if (_style) {
				startTalking(this, getRandomNumber(1) ? 230062 : 230063);
			} else if (!findMail(pet->getRoomFlags())) {
				switch (getRandomNumber(4)) {
				case 0:
					startTalking(this, 230001);
					break;
				case 1:
					startTalking(this, 230002);
					break;
				case 2:
					startTalking(this, 230003);
					break;
				default:
					break;
				}
			}

		} else if (msg->_endFrame == _sendEndFrame) {
			switch (_sendAction) {
			case SA_EATEN:
				stopSound(_soundHandle, 1);
				_soundHandle = playSound("z#3.wav", 1);
				break;
			case SA_BILGE_FEATHERS:
				stopSound(_soundHandle);
				_soundHandle = playSound("z#12.wav");
				break;
			case SA_BILGE_SENT:
				if (_isChicken) {
					startTalking(this, 230018);
					_isChicken = false;
				} else {
					startTalking(this, 230013);
				}
				break;
			case SA_BILGE_EATEN:
				startTalking(this, 230017);
				break;
			default:
				break;
			}

			CSUBTransition transMsg;
			transMsg.execute(this);

		} else if (msg->_endFrame == _receiveEndFrame) {
			if (_mailP) {
				_mailP->petAddToInventory();
				CVisibleMsg visibleMsg(true);
				visibleMsg.execute(_mailP);

				_mailP = nullptr;
				petSetArea(PET_INVENTORY);

				CSUBTransition transMsg;
				transMsg.execute(this);
			}

		} else if (msg->_endFrame == _sneezing1EndFrame) {
			playSound("z#25.wav", 70);
			playSound("z#24.wav", 70);

		} else if (msg->_endFrame == _sneezing2EndFrame) {
			changeView("BilgeRoomWith.Node 1.N", "");
			_style = false;
			resetMail();

			if (_mailP) {
				_mailP->petAddToInventory();
				CVisibleMsg visibleMsg(true);
				visibleMsg.execute(_mailP);

				_mailP = nullptr;
				petSetArea(PET_INVENTORY);
			}

			startTalking(this, 150);
			CBodyInBilgeRoomMsg bodyMsg;
			bodyMsg.execute("Service Elevator Entity");
			decTransitions();
			_sendAction = SA_SENT;

		} else {
			_sendAction = SA_SENT;
		}
	}

	return true;
}
Ejemplo n.º 24
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;
}
Ejemplo n.º 25
0
bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) {
    CPetControl *pet = getPetControl();
    uint petRoomFlags = pet ? pet->getRoomFlags() : 0;

    if (msg->_endFrame == _endFrame10) {
        if (_startFrame11 >= 0)
            playSound("z#30.wav", 100);

        if (_field15C) {
            _field15C = false;
            setVisible(false);
            CSignalObject signalMsg;
            signalMsg._numValue = 1;
            signalMsg.execute(_string2);
        }
    }

    if (msg->_endFrame == _endFrame9) {
        bool flag = false;

        if (pet && mailExists(petRoomFlags)) {
            CGameObject *mailObject = _v3 && compareRoomNameTo("Titania") ?
                                      findMailByFlags(3, petRoomFlags) :
                                      findMailByFlags(_field140, petRoomFlags);

            if (mailObject) {
                switch (getRandomNumber(4)) {
                case 0:
                    startTalking(this, 70094, findView());
                    break;
                case 1:
                    startTalking(this, 70095, findView());
                    break;
                case 2:
                    startTalking(this, 70096, findView());
                    break;
                case 3:
                    startTalking(this, 70098, findView());
                    break;
                case 4:
                    startTalking(this, 70099, findView());
                    break;
                default:
                    break;
                }
                flag = true;
            }
        }

        if (!_field188 && !flag) {
            stopSound(_soundHandle);
            _soundHandle = -1;

            switch (getRandomNumber(_v2 ? 7 : 5, &_field1B0)) {
            case 2:
                startTalking(this, 230001, findView());
                break;
            case 3:
                startTalking(this, 230002, findView());
                break;
            case 4:
                startTalking(this, 230003, findView());
                break;
            case 5:
                startTalking(this, 230064, findView());
                break;
            case 6:
                startTalking(this, 230062, findView());
                break;
            case 7:
                startTalking(this, 230063, findView());
                break;
            default:
                break;
            }
        }
    }

    if (msg->_endFrame == _endFrame3) {
        if (_field158 == 1) {
            startTalking(this, 230022, findView());
        } else if (_field158 == 2) {
            startTalking(this, 230017, findView());
        } else if (_field19C) {
            startTalking(this, 230019, findView());
            _field19C = 0;
        } else if (_isChicken) {
            startTalking(this, 230018, findView());
            _isChicken = false;
        } else {
            startTalking(this, 230013, findView());
        }

        if (_field1D8) {
            _field1D8 = 0;
            decTransitions();
        }

        CSUBTransition transMsg;
        transMsg.execute(this);
    }

    if (msg->_endFrame == _endFrame4) {
        if (pet && _mailP) {
            _mailP->setMailId(petRoomFlags);
        }

        _field188 = 1;
        _mailP = 0;
        if (_field1D8) {
            _field1D8 = 0;
            decTransitions();
        }

        CSUBTransition transMsg;
        transMsg.execute(this);
    }

    return true;
}
Ejemplo n.º 26
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;
}
Ejemplo n.º 27
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;
}