Exemple #1
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;
}
Exemple #2
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;
}
Exemple #3
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;
}