Esempio n. 1
0
bool CGondolierSlider::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
	if (!(_fieldFC ? _v5 : _v8)) {
		int minVal = 0x7FFFFFFF;
		int foundIndex = -1;
		int yp = (_sliderRect2.top + _sliderRect2.bottom) / 2
			+ _bounds.top - msg->_mousePos.y;

		for (int idx = 0; idx < 11; ++idx) {
			int yv = yp + ARRAY[idx];
			if (yv < 0)
				yv = -yv;
			if (yv < minVal) {
				minVal = yv;
				foundIndex = idx;
			}
		}

		if (foundIndex >= 0) {
			_arrayIndex = foundIndex;
			CSignalObject signalMsg;
			signalMsg.execute(this);
		}
	}

	return true;
}
Esempio n. 2
0
bool CGondolierSlider::FrameMsg(CFrameMsg *msg) {
	if (_fieldFC ? _v5 : _v8) {
		if (_arrayIndex < 10) {
			++_arrayIndex;
			CSignalObject signalMsg;
			signalMsg.execute(this);

			int yp = 0;
			if (_arrayIndex > 0)
				yp = ARRAY[_arrayIndex] - ARRAY[_arrayIndex - 1];
			
			if (!_string2.empty()) {
				CTranslateObjectMsg transMsg;
				transMsg._delta = Point(0, yp);
				transMsg.execute(_string2);
			}
		}
	} else if (_fieldFC ? _v10 : _v9) {
		if (!_field118 && !_puzzleSolved && _arrayIndex > 0) {
			CSignalObject signalMsg;
			signalMsg.execute(this);
		}
	}

	return true;
}
Esempio n. 3
0
bool CGondolierSlider::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
	if (!(_sliderNum ? _leftSliderHooked : _rightSliderHooked)) {
		int minVal = 0x7FFFFFFF;
		int foundIndex = -1;
		int yp = (_defaultThumbRect.top + _defaultThumbRect.bottom) / 2
			+ _bounds.top - msg->_mousePos.y;

		for (int idx = 0; idx < 11; ++idx) {
			int yDiff = ABS(yp + Y_OFFSETS[idx]);

			if (yDiff < minVal) {
				minVal = yDiff;
				foundIndex = idx;
			}
		}

		if (foundIndex >= 0) {
			_sliderIndex = foundIndex;
			CSignalObject signalMsg;
			signalMsg.execute(this);
		}
	}

	return true;
}
Esempio n. 4
0
bool CGondolierSlider::FrameMsg(CFrameMsg *msg) {
	if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) {
		if (_sliderIndex < 10) {
			++_sliderIndex;
			CSignalObject signalMsg;
			signalMsg.execute(this);

			int yp = 0;
			if (_sliderIndex > 0)
				yp = Y_OFFSETS[_sliderIndex] - Y_OFFSETS[_sliderIndex - 1];

			if (!_armName.empty()) {
				CTranslateObjectMsg transMsg;
				transMsg._delta = Point(0, yp);
				transMsg.execute(_armName);
			}
		}
	} else if (_sliderNum ? _priorRightSliderHooked : _priorLeftSliderHooked) {
		if (!_dragging && !_puzzleSolved && _sliderIndex > 0) {
			--_sliderIndex;
			CSignalObject signalMsg;
			signalMsg.execute(this);
		}
	}

	return true;
}
Esempio n. 5
0
bool CGondolierSlider::SignalObject(CSignalObject *msg) {
	_arrayIndex = CLIP(_arrayIndex, 0, 10);
	_sliderRect1 = _sliderRect2;
	_sliderRect1.translate(_bounds.left, _bounds.top);
	_sliderRect1.translate(0, ARRAY[_arrayIndex]);
	loadFrame(_arrayIndex);

	CSignalObject signalMsg;
	signalMsg._numValue = 10 - _arrayIndex;
	signalMsg._strValue = _fieldFC ? "Fly" : "Tos";
	signalMsg.execute(_string3);

	return true;
}
Esempio n. 6
0
bool CGondolierSlider::SignalObject(CSignalObject *msg) {
	_sliderIndex = CLIP(_sliderIndex, 0, 10);
	_thumbRect = _defaultThumbRect;
	_thumbRect.translate(_bounds.left, _bounds.top);
	_thumbRect.translate(0, Y_OFFSETS[_sliderIndex]);
	loadFrame(_sliderIndex);

	CSignalObject signalMsg;
	signalMsg._numValue = 10 - _sliderIndex;
	signalMsg._strValue = _sliderNum ? "Fly" : "Tos";
	signalMsg.execute(_signalTarget);

	return true;
}
Esempio n. 7
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;
}
Esempio n. 8
0
bool CGondolierSlider::EnterViewMsg(CEnterViewMsg *msg) {
	CSignalObject signalMsg;
	signalMsg.execute(this);
	return true;
}
Esempio n. 9
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;
}