[Scummvm-git-logs] scummvm master -> c5dd87f8bb616da1f2b730a065aaa26840d4380d

neuromancer noreply at scummvm.org
Fri Apr 15 10:52:56 UTC 2022


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e7fd575e79 HYPNO: show total score when you finish the arcade level of the spider demo
a546023f65 HYPNO: refactor arcade code in spider to use missedTarget function
31a772cbca HYPNO: refactor arcade code to use a function to process keys
3e6b514cf3 HYPNO: refactor player position code into spider
fa9feb0df3 HYPNO: allow to replay conversations and refactor code some code in spider
8137f77f05 HYPNO: quit when finish level in wet demo
c5dd87f8bb HYPNO: optionally show score and accuracy at the end of the wet demos


Commit: e7fd575e793f9be6f4d85e4064c8deaee4373b41
    https://github.com/scummvm/scummvm/commit/e7fd575e793f9be6f4d85e4064c8deaee4373b41
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:07:14+02:00

Commit Message:
HYPNO: show total score when you finish the arcade level of the spider demo

Changed paths:
    engines/hypno/spider/arcade.cpp
    engines/hypno/spider/hard.cpp


diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index ae5be4d7076..973b7443c01 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -63,6 +63,14 @@ void SpiderEngine::runAfterArcade(ArcadeShooting *arc) {
 		assert(_score >= _bonus);
 		_score -= _bonus;
 	}
+
+	if (isDemo() && _restoredContentEnabled) {
+		if (_health == 0)
+			showScore("Spider-man was defeated!");
+		else
+			showScore("Spider-Man saved the day!");
+		_score = 0;
+	}
 }
 
 void SpiderEngine::initSegment(ArcadeShooting *arc) {
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index 06a76d96e15..ed7a5870f43 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -1088,8 +1088,9 @@ void SpiderEngine::runGiveUp() {
 }
 
 void SpiderEngine::showScore(const Common::String prefix) {
-	Common::String message = Common::String::format("%s\n\
-	You finished the game with a score of %d points", prefix.c_str(), _score);
+	Common::String fmessage = "%s\nYou finished the ";
+	fmessage = fmessage + (isDemo() ? "demo" : "game") + " with a score of %d points";
+	Common::String message = Common::String::format(fmessage.c_str(), prefix.c_str(), _score);
 	GUI::MessageDialog dialog(message);
 	dialog.runModal();
 }


Commit: a546023f65051be9155efc54680b4aa99693d002
    https://github.com/scummvm/scummvm/commit/a546023f65051be9155efc54680b4aa99693d002
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:07:14+02:00

Commit Message:
HYPNO: refactor arcade code in spider to use missedTarget function

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/hypno.h
    engines/hypno/spider/arcade.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 3e2079dec99..cd476df9e3c 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -464,10 +464,6 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 							else
 								_shoots[0] = s;
 						} else if (it->animation == "NONE") {
-							if ((uint32)(it->name[0]) == _currentPlayerPosition) {
-								_health = _health - it->attackWeight;
-								hitPlayer();
-							}
 							byte *c = getTargetColor(it->name, _levelId);
 							assert(s.paletteSize == 1 || s.paletteSize == 0);
 							loadPalette(c, s.paletteOffset, s.paletteSize);
@@ -526,7 +522,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 			} else if (!it->video && it->bodyFrames.size() > 0) {
 				uint32 frame = _background->decoder->getCurFrame();
 				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
-				if (frame > it->startFrame && frame - it->startFrame > bodyLastFrame)
+				if (frame > it->startFrame && frame - it->startFrame >= bodyLastFrame - 3)
 					if (!it->destroyed) {
 						missedTarget(it, arc);
 						shootsToRemove.push_back(i);
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 0c4cb6e0675..79bd5ff8a1c 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -422,6 +422,7 @@ public:
 	void drawShoot(const Common::Point &target) override;
 	void drawPlayer() override;
 	void drawHealth() override;
+	void missedTarget(Shoot *s, ArcadeShooting *arc) override;
 	void hitPlayer() override;
 
 	// Arcade
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index 973b7443c01..cdb7bf03a2e 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -90,6 +90,15 @@ void SpiderEngine::findNextSegment(ArcadeShooting *arc) {
 	_segmentIdx = _segmentIdx + 1;
 }
 
+void SpiderEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
+	if (_arcadeMode != "YC" && _arcadeMode != "YD")
+		return;
+	if ((uint32)(s->name[0]) == _currentPlayerPosition) {
+		_health = _health - s->attackWeight;
+		hitPlayer();
+	}
+}
+
 
 void SpiderEngine::hitPlayer() {
 	if (_playerFrameSep < (int)_playerFrames.size()) {


Commit: 31a772cbca7fc1b93609040a67f9f567fb8557d7
    https://github.com/scummvm/scummvm/commit/31a772cbca7fc1b93609040a67f9f567fb8557d7
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:07:14+02:00

Commit Message:
HYPNO: refactor arcade code to use a function to process keys

Changed paths:
    engines/hypno/arcade.cpp
    engines/hypno/hypno.h
    engines/hypno/spider/arcade.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/wet/arcade.cpp
    engines/hypno/wet/wet.cpp


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index cd476df9e3c..c9d4daf58b9 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -167,6 +167,8 @@ void HypnoEngine::missNoTarget(ArcadeShooting *arc) {}
 void HypnoEngine::runBeforeArcade(ArcadeShooting *arc) {}
 void HypnoEngine::runAfterArcade(ArcadeShooting *arc) {}
 
+void HypnoEngine::pressedKey(const int keycode) {}
+
 void HypnoEngine::initSegment(ArcadeShooting *arc) { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::findNextSegment(ArcadeShooting *arc) { error("Function \"%s\" not implemented", __FUNCTION__); }
 
@@ -246,29 +248,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 				break;
 
 			case Common::EVENT_KEYDOWN:
-				if (event.kbd.keycode == Common::KEYCODE_c) {
-					_background->decoder->pauseVideo(true);
-					showCredits();
-					loadPalette(currentPalette);
-					changeScreenMode("320x200");
-					_background->decoder->pauseVideo(false);
-					updateScreen(*_background);
-					drawScreen();
-				} else if (event.kbd.keycode == Common::KEYCODE_k) { // Added for testing
-					_health = 0;
-				} else if (event.kbd.keycode == Common::KEYCODE_LEFT) {
-					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = kPlayerLeft;
-				} else if (event.kbd.keycode == Common::KEYCODE_DOWN) {
-					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = kPlayerBottom;
-				} else if (event.kbd.keycode == Common::KEYCODE_RIGHT) {
-					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = kPlayerRight;
-				} else if (event.kbd.keycode == Common::KEYCODE_UP) {
-					_lastPlayerPosition = _currentPlayerPosition;
-					_currentPlayerPosition = kPlayerTop;
-				}
+				pressedKey(event.kbd.keycode);
 				break;
 
 			case Common::EVENT_LBUTTONDOWN:
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 79bd5ff8a1c..fa8164925f8 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -244,6 +244,7 @@ public:
 	uint32 _lastPlayerPosition;
 	virtual Common::Point computeTargetPosition(const Common::Point &mousePos);
 	virtual int detectTarget(const Common::Point &mousePos);
+	virtual void pressedKey(const int keycode);
 	virtual bool clickedPrimaryShoot(const Common::Point &mousePos);
 	virtual bool clickedSecondaryShoot(const Common::Point &mousePos);
 	virtual void drawShoot(const Common::Point &mousePos);
@@ -387,6 +388,7 @@ public:
 	void saveProfile(const Common::String &name, int levelId);
 
 	// Arcade
+	void pressedKey(const int keycode) override;
 	void runBeforeArcade(ArcadeShooting *arc) override;
 	void runAfterArcade(ArcadeShooting *arc) override;
 	void findNextSegment(ArcadeShooting *arc) override;
@@ -426,6 +428,7 @@ public:
 	void hitPlayer() override;
 
 	// Arcade
+	void pressedKey(const int keycode) override;
 	void runBeforeArcade(ArcadeShooting *arc) override;
 	void runAfterArcade(ArcadeShooting *arc) override;
 	void findNextSegment(ArcadeShooting *arc) override;
diff --git a/engines/hypno/spider/arcade.cpp b/engines/hypno/spider/arcade.cpp
index cdb7bf03a2e..4a4471ed3d2 100644
--- a/engines/hypno/spider/arcade.cpp
+++ b/engines/hypno/spider/arcade.cpp
@@ -90,6 +90,30 @@ void SpiderEngine::findNextSegment(ArcadeShooting *arc) {
 	_segmentIdx = _segmentIdx + 1;
 }
 
+
+void SpiderEngine::pressedKey(const int keycode) {
+	if (keycode == Common::KEYCODE_c) {
+		if (_cheatsEnabled) {
+			_skipLevel = true;
+			return;
+		}
+	} else if (keycode == Common::KEYCODE_k) { // Added for testing
+		_health = 0;
+	} else if (keycode == Common::KEYCODE_LEFT) {
+		_lastPlayerPosition = _currentPlayerPosition;
+		_currentPlayerPosition = kPlayerLeft;
+	} else if (keycode == Common::KEYCODE_DOWN) {
+		_lastPlayerPosition = _currentPlayerPosition;
+		_currentPlayerPosition = kPlayerBottom;
+	} else if (keycode == Common::KEYCODE_RIGHT) {
+		_lastPlayerPosition = _currentPlayerPosition;
+		_currentPlayerPosition = kPlayerRight;
+	} else if (keycode == Common::KEYCODE_UP) {
+		_lastPlayerPosition = _currentPlayerPosition;
+		_currentPlayerPosition = kPlayerTop;
+	}
+}
+
 void SpiderEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
 	if (_arcadeMode != "YC" && _arcadeMode != "YD")
 		return;
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index ed7a5870f43..8a973a10785 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -1096,24 +1096,14 @@ void SpiderEngine::showScore(const Common::String prefix) {
 }
 
 void SpiderEngine::showCredits() {
-	if (_cheatsEnabled && !_arcadeMode.empty()) {
-		_skipLevel = true;
-		return;
-	}
-
-	if (!_arcadeMode.empty())
-		return; // No credits during arcade sequence
-
-	if (!isDemo()) { // No credits in demo
-		changeScreenMode("640x480");
-		MVideo video("cine/credits.smk", Common::Point(0, 0), false, true, false);
-		runIntro(video);
-		if (_restoredContentEnabled) {
-			showScore("Spider-Man saved the day!");
-		}
-		_score = 0;
-		_nextLevel = "mainmenu.mi_";
+	changeScreenMode("640x480");
+	MVideo video("cine/credits.smk", Common::Point(0, 0), false, true, false);
+	runIntro(video);
+	if (_restoredContentEnabled) {
+		showScore("Spider-Man saved the day!");
 	}
+	_score = 0;
+	_nextLevel = "mainmenu.mi_";
 }
 
 } // End of namespace Hypno
\ No newline at end of file
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index f35a0032151..679e57ffb28 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -463,6 +463,24 @@ void WetEngine::runBeforeArcade(ArcadeShooting *arc) {
 	_playerFrameIdx = -1;
 }
 
+void WetEngine::pressedKey(const int keycode) {
+	if (keycode == Common::KEYCODE_c) {
+		if (_cheatsEnabled) {
+			_skipLevel = true;
+			return;
+		}
+		_background->decoder->pauseVideo(true);
+		showCredits();
+		//loadPalette(currentPalette); //FIXME
+		changeScreenMode("320x200");
+		_background->decoder->pauseVideo(false);
+		updateScreen(*_background);
+		drawScreen();
+	} else if (keycode == Common::KEYCODE_k) { // Added for testing
+		_health = 0;
+	}
+}
+
 void WetEngine::drawCursorArcade(const Common::Point &mousePos) {
 	int i = detectTarget(mousePos);
 	if (_arcadeMode == "YT") {
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 0f44d399007..0457851eca3 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -389,11 +389,6 @@ void WetEngine::loadAssetsFullGame() {
 }
 
 void WetEngine::showCredits() {
-	if (_cheatsEnabled && !_arcadeMode.empty()) {
-		_skipLevel = true;
-		return;
-	}
-
 	if (!isDemo() || (_variant == "Demo" && _language == Common::EN_USA)) {
 		MVideo video("c_misc/credits.smk", Common::Point(0, 0), false, true, false);
 		runIntro(video);


Commit: 3e6b514cf33fb13802ab4729294660005d28e61e
    https://github.com/scummvm/scummvm/commit/3e6b514cf33fb13802ab4729294660005d28e61e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:07:14+02:00

Commit Message:
HYPNO: refactor player position code into spider

Changed paths:
    engines/hypno/hypno.cpp
    engines/hypno/hypno.h
    engines/hypno/spider/spider.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index 227a59f81a3..16bf5788f3b 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -54,7 +54,6 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
 	  _playerFrameIdx(0), _playerFrameSep(0), _refreshConversation(false),
 	  _countdown(0), _timerStarted(false), _score(0), _lives(0),
 	  _defaultCursor(""), _checkpoint(""), _skipDefeatVideo(false),
-	  _currentPlayerPosition(kPlayerLeft), _lastPlayerPosition(kPlayerLeft),
 	  _background(nullptr),
 	  _masks(nullptr),
 	  _screenW(0), _screenH(0) { // Every games initializes its own resolution
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index fa8164925f8..9978c877d8a 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -240,8 +240,6 @@ public:
 	// Arcade
 	Common::String _arcadeMode;
 	MVideo *_background;
-	uint32 _currentPlayerPosition;
-	uint32 _lastPlayerPosition;
 	virtual Common::Point computeTargetPosition(const Common::Point &mousePos);
 	virtual int detectTarget(const Common::Point &mousePos);
 	virtual void pressedKey(const int keycode);
@@ -469,6 +467,9 @@ private:
 	void runGiveUp();
 	void showScore(const Common::String prefix);
 
+	uint32 _currentPlayerPosition;
+	uint32 _lastPlayerPosition;
+
 	bool _fuseState[2][10] = {};
 	bool _isFuseRust = true;
 	bool _isFuseUnreadable = false;
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 8fac7e5895f..a809bfa1434 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -30,7 +30,9 @@ namespace Hypno {
 
 extern const char *sceneVariables[];
 
-SpiderEngine::SpiderEngine(OSystem *syst, const ADGameDescription *gd) : HypnoEngine(syst, gd) {
+SpiderEngine::SpiderEngine(OSystem *syst, const ADGameDescription *gd)
+  : HypnoEngine(syst, gd),
+  _currentPlayerPosition(kPlayerLeft), _lastPlayerPosition(kPlayerLeft) {
 	_screenW = 640;
 	_screenH = 480;
 	_font = nullptr;


Commit: fa9feb0df363a3adc04399a9e25e47c403dfd7b8
    https://github.com/scummvm/scummvm/commit/fa9feb0df363a3adc04399a9e25e47c403dfd7b8
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:07:14+02:00

Commit Message:
HYPNO: allow to replay conversations and refactor code some code in spider

Changed paths:
    engines/hypno/actions.cpp
    engines/hypno/grammar.h
    engines/hypno/hypno.h
    engines/hypno/scene.cpp
    engines/hypno/spider/talk.cpp


diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index 742caba0d02..add5cd9262e 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -231,7 +231,9 @@ void HypnoEngine::runChangeLevel(ChangeLevel *a) {
 }
 
 void HypnoEngine::runTalk(Talk *a) {
-	_conversation.push_back(a);
+	// Recreate the items to allow modifications
+	Talk *n = new Talk(a);
+	_conversation.push_back(n);
 	_refreshConversation = true;
 }
 
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index f3da2679900..ebef962baab 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -300,6 +300,11 @@ public:
 		escape = false;
 		active = true;
 	}
+
+	Talk(Talk *t)  {
+		*this = *t;
+	}
+
 	TalkCommands commands;
 	bool active;
 	bool escape;
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 9978c877d8a..9bae0f979b0 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -323,6 +323,7 @@ public:
 	Actions _conversation;
 	bool _refreshConversation;
 	virtual void showConversation();
+	virtual void endConversation();
 	virtual void rightClickedConversation(const Common::Point &mousePos);
 	virtual void leftClickedConversation(const Common::Point &mousePos);
 	virtual bool hoverConversation(const Common::Point &mousePos);
@@ -442,6 +443,7 @@ public:
 	void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
 
 	void showConversation() override;
+	void endConversation() override;
 	void rightClickedConversation(const Common::Point &mousePos) override;
 	void leftClickedConversation(const Common::Point &mousePos) override;
 	bool hoverConversation(const Common::Point &mousePos) override;
diff --git a/engines/hypno/scene.cpp b/engines/hypno/scene.cpp
index 2f992f28be4..4dac0737bf5 100644
--- a/engines/hypno/scene.cpp
+++ b/engines/hypno/scene.cpp
@@ -119,9 +119,10 @@ void HypnoEngine::clickedHotspot(Common::Point mousePos) {
 		}
 	}
 	if (selected.type == MakeMenu) {
-		if (isDemo())
+		if (isDemo()) {
 			_nextLevel = "sixdemo/mis/demo.mis";
-		else // TODO: remove when proper escape to main menu is implemented
+			resetSceneState();
+		} else // TODO: remove when proper escape to main menu is implemented
 			openMainMenuDialog();
 		return;
 	}
@@ -254,7 +255,6 @@ void HypnoEngine::runTransition(Transition *trans) {
 void HypnoEngine::runScene(Scene *scene) {
 	_refreshConversation = false;
 	_timerStarted = false;
-	_conversation.clear();
 	Common::Event event;
 	Common::Point mousePos;
 	Common::List<uint32> videosToRemove;
@@ -530,11 +530,13 @@ void HypnoEngine::runScene(Scene *scene) {
 	_nextParallelVideoToPlay.clear();
 	_nextSequentialVideoToPlay.clear();
 	_escapeSequentialVideoToPlay.clear();
+	_conversation.clear();
 
 	removeTimers();
 }
 
 void HypnoEngine::showConversation() { error("Function \"%s\" not implemented", __FUNCTION__); }
+void HypnoEngine::endConversation() { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::rightClickedConversation(const Common::Point &mousePos) { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::leftClickedConversation(const Common::Point &mousePos) { error("Function \"%s\" not implemented", __FUNCTION__); }
 bool HypnoEngine::hoverConversation(const Common::Point &mousePos) { error("Function \"%s\" not implemented", __FUNCTION__); }
diff --git a/engines/hypno/spider/talk.cpp b/engines/hypno/spider/talk.cpp
index 0304ebd754c..b8e3c836184 100644
--- a/engines/hypno/spider/talk.cpp
+++ b/engines/hypno/spider/talk.cpp
@@ -24,6 +24,15 @@
 
 namespace Hypno {
 
+void SpiderEngine::endConversation() {
+	debugC(1, kHypnoDebugScene, "Ending and clearing conversation");
+	for (Actions::iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
+		Talk *a = (Talk *)*itt;
+		delete a;
+	}
+	_conversation.clear();
+}
+
 void SpiderEngine::showConversation() {
 	debugC(1, kHypnoDebugScene, "Showing conversation");
 	defaultCursor();
@@ -31,11 +40,21 @@ void SpiderEngine::showConversation() {
 	uint32 y = 0;
 	Graphics::Surface *speaker = decodeFrame("dialog/speaker3.smk", 0);
 	bool activeFound = false;
+	bool skipRepeated = false;
 
 	// First iteration on the talk commands
 	Videos videos;
 	for (Actions::iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
 		Talk *a = (Talk *)*itt;
+
+		for (TalkCommands::const_iterator it = a->commands.begin(); it != a->commands.end(); ++it) {
+			if (it->command == "P") {
+				if (_intros[it->path]) {
+					skipRepeated = true;
+				}
+			}
+		}
+
 		if (a->boxPos != Common::Point(0, 0)) {
 			if (!(x == 0 && x == y))
 				error("Multiple BOX positions found");
@@ -47,6 +66,7 @@ void SpiderEngine::showConversation() {
 			videos.push_back(MVideo(a->intro, a->introPos, false, false, false));
 			_intros[a->intro] = true;
 		}
+
 	}
 
 	if (videos.size() > 0) {
@@ -60,7 +80,7 @@ void SpiderEngine::showConversation() {
 	// Second iteration on the talk commands
 	for (Actions::const_iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
 		Talk *a = (Talk *)*itt;
-		if (a->active) {
+		if (a->active && !skipRepeated) {
 			uint32 frame;
 			Common::String path;
 			for (TalkCommands::const_iterator it = a->commands.begin(); it != a->commands.end(); ++it) {
@@ -78,7 +98,7 @@ void SpiderEngine::showConversation() {
 				drawImage(*surf, x + speaker->w, y, false);
 				a->rect = Common::Rect(x + speaker->w, y, x + surf->w, y + surf->h);
 				y = y + surf->h;
-				
+
 				surf->free();
 				delete surf;
 			}
@@ -88,8 +108,18 @@ void SpiderEngine::showConversation() {
 		debugC(1, kHypnoDebugScene, "No active item was found in the current conversation");
 		// Final iteration on the talk commands
 		bool shouldEscape = false;
-		for (Actions::const_iterator it = _conversation.begin(); it != _conversation.end(); ++it) {
-			Talk *a = (Talk *)*it;
+		for (Actions::const_iterator itt = _conversation.begin(); itt != _conversation.end(); ++itt) {
+			Talk *a = (Talk *)*itt;
+
+			// Avoid this conversation next time
+			for (TalkCommands::const_iterator it = a->commands.begin(); it != a->commands.end(); ++it) {
+				if (it->command == "P") {
+					if (!it->path.empty()) {
+						_intros[it->path] = true;
+					}
+				}
+			}
+
 			if (!a->second.empty()) {
 				debugC(1, kHypnoDebugScene, "Adding %s to play after the conversation ends", a->second.c_str());
 				videos.push_back(MVideo(a->second, a->secondPos, false, false, false));
@@ -104,8 +134,7 @@ void SpiderEngine::showConversation() {
 			videos.clear();
 		}
 
-		debugC(1, kHypnoDebugScene, "Clearing conversation");
-		_conversation.clear();
+		endConversation();
 		_music.clear();
 
 		if (shouldEscape) {
@@ -123,7 +152,7 @@ void SpiderEngine::showConversation() {
 		}
 
 		drawScreen();
-	} 
+	}
 	speaker->free();
 	delete speaker;
 }


Commit: 8137f77f0586827e7fa37e6e6a9280ecb69f7cbd
    https://github.com/scummvm/scummvm/commit/8137f77f0586827e7fa37e6e6a9280ecb69f7cbd
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:11:04+02:00

Commit Message:
HYPNO: quit when finish level in wet demo

Changed paths:
    engines/hypno/wet/wet.cpp


diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 0457851eca3..7ed712fd14e 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -203,7 +203,7 @@ void WetEngine::loadAssetsPCW() {
 	intro->intros.push_back("c_misc/wet.smk");
 	_levels["<start>"] = intro;
 
-	loadArcadeLevel("c11.mis", "<quit>", "<check_lives>", "");
+	loadArcadeLevel("c11.mis", "<quit>", "<quit>", "");
 
 	Transition *over = new Transition("<quit>");
 	_levels["<game_over>"] = over;


Commit: c5dd87f8bb616da1f2b730a065aaa26840d4380d
    https://github.com/scummvm/scummvm/commit/c5dd87f8bb616da1f2b730a065aaa26840d4380d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-15T12:53:16+02:00

Commit Message:
HYPNO: optionally show score and accuracy at the end of the wet demos

Changed paths:
    engines/hypno/hypno.h
    engines/hypno/wet/arcade.cpp
    engines/hypno/wet/hard.cpp


diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 9bae0f979b0..b2a5a8c139f 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -399,6 +399,7 @@ private:
 	void runLevelMenu(Code *code);
 	void runCheckLives(Code *code);
 	void endCredits(Code *code);
+	void showDemoScore();
 	uint32 findPaletteIndexZones(uint32 id);
 
 	Common::BitArray _font05;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 679e57ffb28..6393cc046a7 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -23,6 +23,7 @@
 #include "hypno/hypno.h"
 
 #include "common/events.h"
+#include "gui/message.h"
 #include "graphics/cursorman.h"
 
 namespace Hypno {
@@ -246,7 +247,9 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
 
 void WetEngine::runAfterArcade(ArcadeShooting *arc) {
 	_checkpoint = _currentLevel;
-	if (!isDemo() || (_variant == "Demo" && _language == Common::EN_USA)) {
+	if (isDemo() && _variant != "Demo" && _restoredContentEnabled) {
+		showDemoScore();
+	} else if (!isDemo() || (_variant == "Demo" && _language == Common::EN_USA)) {
 		byte *palette;
 		Graphics::Surface *frame = decodeFrame("c_misc/zones.smk", 12, &palette);
 		loadPalette(palette, 0, 256);
diff --git a/engines/hypno/wet/hard.cpp b/engines/hypno/wet/hard.cpp
index 04a433217dc..aaad9643390 100644
--- a/engines/hypno/wet/hard.cpp
+++ b/engines/hypno/wet/hard.cpp
@@ -20,6 +20,7 @@
  */
 
 #include "common/bitarray.h"
+#include "gui/message.h"
 #include "common/events.h"
 #include "common/config-manager.h"
 #include "common/savefile.h"
@@ -254,4 +255,11 @@ void WetEngine::runMainMenu(Code *code) {
 
 }
 
+void WetEngine::showDemoScore() {
+	Common::String fmessage = "You finished the demo with an accuracy of %d%% and a score of %d points";
+	Common::String message = Common::String::format(fmessage.c_str(), accuracyRatio(), _score);
+	GUI::MessageDialog dialog(message);
+	dialog.runModal();
+}
+
 } // End of namespace Hypno




More information about the Scummvm-git-logs mailing list