Exemplo n.º 1
0
void DreamWebEngine::doSomeTalk() {
	while (true) {
		const uint8 *str = getPersonText(_character & 0x7F, _talkPos);

		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		createPanel();
		showPanel();
		showMan();
		showExit();
		convIcons();

		printDirect(str, 164, 64, 144, false);

		loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
		if (_speechLoaded)
			playChannel1(62);

		_pointerMode = 3;
		workToScreenM();
		if (hangOnPQ())
			return;

		_talkPos++;

		str = getPersonText(_character & 0x7F, _talkPos);
		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		if (*str != ':' && *str != 32) {
			createPanel();
			showPanel();
			showMan();
			showExit();
			convIcons();
			printDirect(str, 48, 128, 144, false);

			loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
			if (_speechLoaded)
				playChannel1(62);

			_pointerMode = 3;
			workToScreenM();
			if (hangOnPQ())
				return;
		}

		_talkPos++;
	}
}
Exemplo n.º 2
0
void DreamWebEngine::fadeUpMonFirst() {
	palToStartPal();
	palToEndPal();
	memset(_startPal + 231 * 3, 0, 8 * 3);
	memset(_startPal + 246 * 3, 0, 1 * 3);
	_fadeDirection = 1;
	_fadeCount = 63;
	_colourPos = 0;
	_numToFade = 128;
	hangOn(64);
	playChannel1(26);
	hangOn(64);
}
Exemplo n.º 3
0
void DreamWebEngine::showRain() {
	Common::List<Rain>::iterator i;

	// Do nothing if there's no rain at all
	if (_rainList.empty())
		return;

	const uint8 *frameData = _mainSprites.getFrameData(58);

	for (i = _rainList.begin(); i != _rainList.end(); ++i) {
		Rain &rain = *i;
		uint16 y = rain.y + _mapAdY + _mapYStart;
		uint16 x = rain.x + _mapAdX + _mapXStart;
		uint16 size = rain.size;
		uint16 offset = (rain.w3 - rain.b5) & 511;
		rain.w3 = offset;
		const uint8 *src = frameData + offset;
		uint8 *dst = workspace() + y * 320 + x;
		for (uint16 j = 0; j < size; ++j) {
			uint8 v = src[j];
			if (v != 0)
				*dst = v;
			dst += 320-1; // advance diagonally
		}
	}

	if (_channel1Playing != 255)
		return;
	if (_realLocation == 2 && _vars._beenMugged != 1)
		return;
	if (_realLocation == 55)
		return;

	if (randomNumber() >= 1) // play thunder with 1 in 256 chance
		return;

	uint8 soundIndex;
	if (_channel0Playing != 6)
		soundIndex = 4;
	else
		soundIndex = 7;
	playChannel1(soundIndex);
}
Exemplo n.º 4
0
void DreamWebEngine::startTalk() {
	_talkMode = 0;

	const uint8 *str = getPersonText(_character & 0x7F, 0);
	uint16 y;

	_charShift = 91+91;
	y = 64;
	printDirect(&str, 66, &y, 241, true);

	_charShift = 0;
	y = 80;
	printDirect(&str, 66, &y, 241, true);

	_speechLoaded = false;
	loadSpeech('R', _realLocation, 'C', 64*(_character & 0x7F));
	if (_speechLoaded) {
		_volumeDirection = 1;
		_volumeTo = 6;
		playChannel1(50 + 12);
	}
}