예제 #1
0
bool CScraliontisTable::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_fieldEC) {
		changeView(_destination, _armPickedUp ? _armDestination : _armlessDestination);
	}
	else if (!_ticks || (getTicksCount() - _ticks) >= 5000) {
		CTriggerNPCEvent triggerMsg(119);
		triggerMsg.execute("MaitreD");
		_ticks = getTicksCount();
	}

	return true;
}
예제 #2
0
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
	_npcFlags |= NPCFLAG_SPEAKING;
	++_field100;

	if (!(_npcFlags & NPCFLAG_8)) {
		if (_speechTimerId)
			stopTimer(_speechTimerId);

		_soundId = msg->_soundId;
		_fieldF0 = getTicksCount();

		if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
			_npcFlags &= ~NPCFLAG_2;
			stopMovie();

			CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
			msg1.execute(this);

			if (msg1._names) {
				CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
				msg2.execute(this);
			}
		}
	}

	return true;
}
예제 #3
0
bool CIdleSummoner::TimerMsg(CTimerMsg *msg) {
	uint nodesCtr = getNodeChangedCtr();
	if (msg->_actionVal == 1 && !petDoorOrBellbotPresent()
			&& nodesCtr > 0 && _fieldD8) {
		if (!compareRoomNameTo("TopOfWell") && !compareRoomNameTo("EmbLobby"))
			return true;

		int region = talkGetDialRegion("BellBot", 1);
		uint delay = region == 1 ? 15000 : 12000;
		uint enterTicks = MIN(getNodeEnterTicks(), _ticks);
		
		CString name;
		uint ticks = getTicksCount() - enterTicks;
		if (ticks > delay) {
			if (region == 1 || getRandomNumber(1) == 1) {
				name = "BellBot";
			} else {
				name = "DoorBot";
			}
			_fieldD8 = nodesCtr;

			if (getRoom()) {
				CSummonBotQueryMsg queryMsg(name);
				if (queryMsg.execute(this)) {
					CSummonBotMsg summonMsg(name, 1);
					summonMsg.execute(this);
				}
			}
		}
	}

	return true;
}
예제 #4
0
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
	debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechStartedMsg flags=%x dialogueId=%d",
		getName().c_str(), _npcFlags, msg->_dialogueId);

	_npcFlags |= NPCFLAG_SPEAKING;
	++_speechCounter;

	if (!(_npcFlags & NPCFLAG_8)) {
		// Stop any previous animation
		if (_speechTimerId)
			stopAnimTimer(_speechTimerId);
		_speechTimerId = 0;

		_speechDuration = msg->_speechDuration;
		_startTicks = getTicksCount();

		if (!hasActiveMovie() || (_npcFlags & NPCFLAG_IDLING)) {
			_npcFlags &= ~NPCFLAG_IDLING;
			stopMovie();

			CNPCPlayTalkingAnimationMsg msg1(_speechDuration, 0, nullptr);
			msg1.execute(this);

			if (msg1._names) {
				CNPCPlayAnimationMsg msg2(msg1._names, msg1._speechDuration);
				msg2.execute(this);
			}
		}
	}

	return true;
}
예제 #5
0
bool CBarbot::LoadSuccessMsg(CLoadSuccessMsg *msg) {
	_field14C = _field150 = getTicksCount();
	_frameNum = -1;
	_field148 = -1;

	return true;
}
예제 #6
0
bool CIdleSummoner::ActMsg(CActMsg *msg) {
	if (msg->_action == "Enable") {
		if (!_fieldD4)
			_fieldD4 = addTimer(15000, 15000);
	} else if (msg->_action == "Disable") {
		if (_fieldD4 > 0) {
			stopAnimTimer(_fieldD4);
			_fieldD4 = 0;
		}
	} else if (msg->_action == "DoorbotDismissed" || msg->_action == "BellbotDismissed") {
		_ticks = getTicksCount();
	}

	return true;
}
예제 #7
0
bool CHeadSmashLever::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	if (_enabled) {
		playMovie(0, 14, 0);
		playSound(TRANSLATE("z#54.wav", "z#585.wav"));
		int soundHandle = playSound(TRANSLATE("z#45.wav", "z#576.wav"));
		queueSound(TRANSLATE("z#49.wav", "z#580.wav"), soundHandle);
		_ticks = getTicksCount();
		_fieldE4 = true;
	} else {
		playMovie(0);
		playSound(TRANSLATE("z#56.wav", "z#587.wav"));
	}

	return true;
}
예제 #8
0
bool CPlayMusicButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
	CMusicRoom *musicRoom = getMusicRoom();
	if (_flag) {
		musicRoom->stopMusic();
		stopMovie();
		loadFrame(0);
		_flag = false;
	} else {
		musicRoom->startMusic(100);
		playMovie(MOVIE_REPEAT);
		_ticks = getTicksCount();
		_flag = true;
	}

	return true;
}
예제 #9
0
bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
	if (_npcFlags & NPCFLAG_2) {
		_npcFlags &= ~NPCFLAG_2;
		CNPCQueueIdleAnimMsg idleMsg;
		idleMsg.execute(this);
		return true;
	} else if (!(_npcFlags & NPCFLAG_SPEAKING)) {
		return false;
	}

	int diff = getTicksCount() - _fieldF0;
	int ticks = MAX((int)_soundId - diff, 0);
	CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
	msg1.execute(this);

	if (msg1._names) {
		CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
		msg2.execute(this);
	}

	return true;
}
예제 #10
0
bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) {
	static const char *const ROOM_NAMES[] = {
		"SGTState", "SGTLittleLift", "SecClassLittleLift", "SecClassState",
		"Lift", "ServiceElevator", "Dome", "Home", "MoonEmbLobby", nullptr
	};

	if (!stateGet24() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N"))
		return true;

	// Check for rooms not to speak in
	for (const char *const *s = &ROOM_NAMES[0]; *s; ++s) {
		if (isEquals(*s))
			return true;
	}

	// Don't have the parrot speak too often
	if ((getTicksCount() - _field120) < 20000 || _speechCounter)
		return true;

	playSound("z#475.wav", 50);

	if (msg->_target == "Bomb") {
		startTalking("PerchedParrot", 280236);
	} else if (msg->_target == "Announcements") {
		startTalking("PerchedParrot", 280263);
	} else if (msg->_target == "Television") {
		startTalking("PerchedParrot", 280264);
	} else if (msg->_target == "Barbot") {
		if (msg->_action == "AskForDrink")
			startTalking("PerchedParrot", 280262);
	} else if (msg->_target == "SuccUBus") {
		if (msg->_action == "TurnOn")
			startTalking("PerchedParrot", 80161);
		else if (msg->_action == "EnterView")
			startTalking("PerchedParrot", 80159);
	} else if (msg->_target == "Cellpoints") {
		if (getRandomNumber(2) == 0) {
			switch (getRandomNumber(2)) {
			case 0:
				startTalking("PerchedParrot", 80193);
				break;
			case 1:
				startTalking("PerchedParrot", 80197);
				break;
			case 2:
				startTalking("PerchedParrot", 80198);
				break;
			default:
				break;
			}
		} else if (msg->_action == "DoorBot") {
			startTalking("PerchedParrot", 80195);
		} else if (msg->_action == "DeskBot") {
			startTalking("PerchedParrot", 80194);
		} else if (msg->_action == "BarBot") {
			startTalking("PerchedParrot", 80191);
		} else if (msg->_action == "BellBot") {
			startTalking("PerchedParrot", 80192);
		} else if (msg->_action == "LiftBot") {
			startTalking("PerchedParrot", 80196);
		}
	}

	_field120 = getTicksCount();
	return true;
}
예제 #11
0
bool CIdleSummoner::LoadSuccessMsg(CLoadSuccessMsg *msg) {
	_ticks = getTicksCount();
	return true;
}
예제 #12
0
bool CHeadSmashLever::LoadSuccessMsg(CLoadSuccessMsg *msg) {
	if (_fieldE4)
		_ticks = getTicksCount();

	return true;
}
예제 #13
0
bool CBarbot::MovieEndMsg(CMovieEndMsg *msg) {
	if (msg->_endFrame == _frameNum) {
		_frameNum = -1;
		_field14C = getTicksCount();
	}

	if (msg->_endFrame == _field148) {
		_field148 = -1;
		_field150 = getTicksCount();
	}

	if (msg->_endFrame == _field13C) {
		if (_field124)
			playMovie(_frames[53]._startFrame, _frames[53]._startFrame, 0);
		else if (_visCenterOnCounter)
			playMovie(_frames[27]._endFrame, _frames[27]._endFrame, 0);

		_field13C = -1;
		return true;
	}

	if (msg->_endFrame == _frames[58]._endFrame || msg->_endFrame == _frames[21]._endFrame) {
		CVisibleMsg visibleMsg(true);
		visibleMsg.execute("BarShelfVisCentre");
	}

	if (msg->_endFrame == _frames[57]._endFrame) {
		startTalking(this, 250575);
		playSound("c#10.wav", _volume);
		return true;
	}

	if (msg->_endFrame == _frames[55]._endFrame) {
		playSound("c#10.wav", _volume);
		return true;
	}

	if (msg->_endFrame == _frames[56]._endFrame
			|| msg->_endFrame == _frames[54]._endFrame) {
		CStatusChangeMsg statusMsg;
		statusMsg._newStatus = 1;
		statusMsg.execute("PickUpGlass");
		CMoveToStartPosMsg moveMsg;
		moveMsg.execute("BeerGlass");
		return true;
	}

	if (msg->_endFrame == _frames[30]._endFrame) {
		_field124 = 0;
		CStatusChangeMsg statusMsg;
		statusMsg._newStatus = 0;
		statusMsg.execute("PickUpGlass");
	}

	if (msg->_endFrame == _frames[45]._endFrame) {
		if (!_gottenDrunk) {
			CVisibleMsg visibleMsg(false);
			visibleMsg.execute("BarShelfVisCentre");
		}

		return true;
	}

	if (msg->_endFrame == _frames[44]._endFrame) {
		_visCenterOnCounter = true;
		_gottenDrunk = true;
		startTalking(this, 250586);
		CStatusChangeMsg statusMsg;
		statusMsg._newStatus = 1;
		statusMsg.execute("PickUpVisCentre");
		CPuzzleSolvedMsg solvedMsg;
		solvedMsg.execute("VisionCentre");
	}

	if (msg->_endFrame == _frames[46]._endFrame) {
		if (!_gottenDrunk && !areIngredientsMissing())
			startTalking(this, 250571);
		return true;
	}

	if (msg->_endFrame == _frames[43]._endFrame
			|| msg->_endFrame == _frames[42]._endFrame
			|| msg->_endFrame == _frames[41]._endFrame) {
		if (_field124)
			playMovie(_frames[53]._startFrame, _frames[53]._startFrame, 0);
		return true;
	}

	if (msg->_endFrame == _frames[38]._endFrame || msg->_endFrame == _frames[23]._endFrame) {
		playSound("c#3.wav", _volume);
	} else if (msg->_endFrame == _frames[36]._endFrame) {
		playSound("c#6.wav", _volume);
	} else if (msg->_endFrame == _frames[35]._endFrame) {
		playSound("c#8.wav", _volume);
	} else if (msg->_endFrame == _frames[33]._endFrame) {
		playSound("c#4.wav", _volume);
	} else if (msg->_endFrame == _frames[32]._endFrame) {
		startTalking(this, 145);
		playSound("c#9.wav", _volume);
	} else if (msg->_endFrame == _frames[47]._endFrame) {
		playSound("c#9.wav", _volume);
		_addedVodka = true;
		_drunkFlag = true;
	} else if (msg->_endFrame == _frames[30]._endFrame) {
		playSound("c#4.wav", 60);
	} else if (msg->_endFrame == _frames[29]._endFrame) {
		if (!_fieldC4) {
			performAction(true, nullptr);
			setVisible(false);
			CActMsg actMsg("ResetCount");
			actMsg.execute("BarBell");
		}
	} else if (msg->_endFrame == _frames[27]._endFrame) {
		CStatusChangeMsg statusMsg;
		statusMsg._newStatus = 1;
		statusMsg.execute("PickUpVisCentre");
		_visCenterOnCounter = true;
		_field134 = 0;
		startTalking(this, 250586);
	}

	return true;
}