diff options
| author | Paul Gilbert | 2014-04-22 19:47:58 -0400 | 
|---|---|---|
| committer | Paul Gilbert | 2014-04-22 19:47:58 -0400 | 
| commit | 3f1a49b567aac10fe8a195f7a2b8e07603470a72 (patch) | |
| tree | 92d10c4c98026163a338b9383cd167872554e327 | |
| parent | aedf8593034303066bf83d041f63731aa65a3ef6 (diff) | |
| download | scummvm-rg350-3f1a49b567aac10fe8a195f7a2b8e07603470a72.tar.gz scummvm-rg350-3f1a49b567aac10fe8a195f7a2b8e07603470a72.tar.bz2 scummvm-rg350-3f1a49b567aac10fe8a195f7a2b8e07603470a72.zip | |
MADS: Implemented Conversation::read method
| -rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 19 | ||||
| -rw-r--r-- | engines/mads/user_interface.cpp | 12 | ||||
| -rw-r--r-- | engines/mads/user_interface.h | 17 | 
3 files changed, 33 insertions, 15 deletions
| diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 15cd4822aa..f7c727bb39 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -821,9 +821,10 @@ void Scene307::step() {  				if (_prisonerMessageId > 0x10A)  					_prisonerMessageId = 0x104;  			} else if (_globals[kKnowsBuddyBeast] && (_vm->getRandomNumber(1, 3) == 1)) { -				warning("TODO: if (_globals[kKnowsBuddyBeast] && (sub71C16(&dialog2, 0) > 1) && (_vm->getRandomNumber(1, 3) == 1)) {"); -				int idx = _scene->_kernelMessages.add(Common::Point(5, 51), 0xFDFC, 0, 81, 120, _game.getQuote(267)); -				_scene->_kernelMessages.setQuoted(idx, 4, true); +				if (_globals[kKnowsBuddyBeast] && (dialog2.read(0) > 1) && (_vm->getRandomNumber(1, 3) == 1)) { +					int idx = _scene->_kernelMessages.add(Common::Point(5, 51), 0xFDFC, 0, 81, 120, _game.getQuote(267)); +					_scene->_kernelMessages.setQuoted(idx, 4, true); +				}  			}  			_prisonerTimer = 0;  		} @@ -2333,13 +2334,13 @@ void Scene318::handleDialog() {  		case 0x195:  			handleInternDialog(0x1AF, 7, 9999999); -			warning("TODO: if (!sub71C16(&_dialog1, 0x196))"); +			if (!dialog1.read(0x196))  				dialog1.write(0x197, true);  			break;  		case 0x196:  			handleInternDialog(0x1B6, 5, 9999999); -			warning("TODO: if (!sub71C16(&_dialog1, 0x195))"); +			if (!dialog1.read(0x195))  				dialog1.write(0x197, true);  			break; @@ -2376,10 +2377,10 @@ void Scene318::handleDialog() {  			_dialogFl = false;  			handleInternDialog(0x1D0, 1, 120); -			warning("TODO: if ((sub71C16(&_dialog1, 0) == 1) || (_action._activeAction._verbId == 0x19D)) {"); -			_explosionFl = true; -			_internCounter = 3420; -			//			} +			if (dialog1.read(0) || (_action._activeAction._verbId == 0x19D)) { +				_explosionFl = true; +				_internCounter = 3420; +			}  			break;  		} diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 346ad2d688..493804c923 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -258,6 +258,18 @@ void Conversation::set(int quoteId, ...) {  	va_end(va);  } +bool Conversation::read(int quoteId) { +	uint16 flags = _vm->_game->globals()[_globalId]; + +	for (uint idx = 0; idx < _quotes.size(); ++idx) { +		if (_quotes[idx] == quoteId) { +			return flags & (1 << idx); +		} +	} + +	return false; +} +  void Conversation::write(int quoteId, bool flag) {  	for (uint idx = 0; idx < _quotes.size(); ++idx) {  		if (_quotes[idx] == quoteId) { diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h index a29a0e6de0..baae269c4f 100644 --- a/engines/mads/user_interface.h +++ b/engines/mads/user_interface.h @@ -104,18 +104,23 @@ public:  	Common::Array<int> _quotes;  	/** -	* Set up a conversation sequence -	*/ +	 * Set up a conversation sequence +	 */  	void setup(int globalId, ...);  	/** -	* Activates the passed set of quotes in the given conversation node -	*/ +	 * Activates the passed set of quotes in the given conversation node +	 */  	void set(int quoteId, ...);  	/** -	* Activates or deactivates the specified quote in the given conversation node -	*/ +	 * Returns true whether the given quote is enabled in the conversation +	 */ +	bool read(int quoteId); + +	/** +	 * Activates or deactivates the specified quote in the given conversation node +	 */  	void write(int quoteId, bool flag);  	/** | 
