[Scummvm-git-logs] scummvm master -> 73323b4f97a20bf7db5f18cfb4d9fd2c363b657e

neuromancer noreply at scummvm.org
Sun Apr 3 09:44:02 UTC 2022


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

Summary:
73323b4f97 HYPNO: play the correct videos when hitting or missing a boss in wet


Commit: 73323b4f97a20bf7db5f18cfb4d9fd2c363b657e
    https://github.com/scummvm/scummvm/commit/73323b4f97a20bf7db5f18cfb4d9fd2c363b657e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-04-03T11:40:20+02:00

Commit Message:
HYPNO: play the correct videos when hitting or missing a boss in wet

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


diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index 2db58ae1240..7c133d95af7 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -135,6 +135,7 @@ SegmentShootsSequence HypnoEngine::parseShootList(const Common::String &filename
 
 			Common::replace(n, "\nS", "");
 			Common::replace(n, "\nZ\n", "");
+			Common::replace(n, "\nZ", "");
 			si.name = n;
 			si.timestamp = atoi(t.c_str());
 			if (si.timestamp == 0)
@@ -167,7 +168,8 @@ void HypnoEngine::drawPlayer() { error("Function \"%s\" not implemented", __FUNC
 void HypnoEngine::drawHealth() { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::drawShoot(const Common::Point &target) { error("Function \"%s\" not implemented", __FUNCTION__); }
 void HypnoEngine::hitPlayer() { error("Function \"%s\" not implemented", __FUNCTION__); }
-void HypnoEngine::missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {}
+void HypnoEngine::missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {}
+void HypnoEngine::missNoTarget(ArcadeShooting *arc, MVideo &background) {}
 
 void HypnoEngine::runBeforeArcade(ArcadeShooting *arc) {}
 void HypnoEngine::runAfterArcade(ArcadeShooting *arc) {}
@@ -326,7 +328,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 			break;
 		}
 
-		if (!arc->transitionVideos.empty() && background.decoder->getCurFrame() >= (int)*arc->transitionTimes.begin()) {
+		if (!arc->transitionVideos.empty() && background.decoder->getCurFrame() > (int)*arc->transitionTimes.begin()) {
 			transition = true;
 			background.decoder->pauseVideo(true);
 
@@ -472,7 +474,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 
 				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
 				if (frame > 0 && frame >= (int)(bodyLastFrame - 3) && !it->destroyed) {
-					missTarget(it, arc, background);
+					missedTarget(it, arc, background);
 					incTargetsMissed();
 					// No need to pop attackFrames or explosionFrames
 					skipVideo(*it->video);
@@ -487,7 +489,7 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
 				uint32 bodyLastFrame = it->bodyFrames[it->bodyFrames.size() - 1].lastFrame();
 				if (frame > it->startFrame && frame - it->startFrame > bodyLastFrame)
 					if (!it->destroyed) {
-						missTarget(it, arc, background);
+						missedTarget(it, arc, background);
 						shootsToRemove.push_back(i);
 					}
 			}
@@ -572,7 +574,9 @@ bool HypnoEngine::clickedPrimaryShoot(const Common::Point &mousePos) { return tr
 void HypnoEngine::shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background) {
 	incShotsFired();
 	int i = detectTarget(mousePos);
-	if (i >= 0) {
+	if (i < 0) {
+		missNoTarget(arc, background);
+	} else {
 		if (!_shoots[i].hitSound.empty())
 			playSound(_soundPath + _shoots[i].hitSound, 1);
 
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 2987e9d4cbf..1f36f22d893 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -225,7 +225,8 @@ public:
 	virtual void drawShoot(const Common::Point &mousePos);
 	virtual void shoot(const Common::Point &mousePos, ArcadeShooting *arc, MVideo &background);
 	virtual void hitPlayer();
-	virtual void missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background);
+	virtual void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background);
+	virtual void missNoTarget(ArcadeShooting *arc, MVideo &background);
 
 	// Segments
 	uint32 _segmentIdx;
@@ -342,7 +343,9 @@ public:
 	void hitPlayer() override;
 	void drawCursorArcade(const Common::Point &mousePos) override;
 	Common::Point computeTargetPosition(const Common::Point &mousePos) override;
-	void missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
+	void missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) override;
+	void missNoTarget(ArcadeShooting *arc, MVideo &background) override;
+
 	void runCode(Code *code) override;
 	Common::String findNextLevel(const Common::String &level) override;
 	Common::String findNextLevel(const Transition *trans) override;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 7cb9487d370..292586ae9e6 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -400,7 +400,7 @@ bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
 	return clickedPrimaryShoot(mousePos);
 }
 
-void WetEngine::missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {
+void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {
 	if (s->name == "SP_SWITCH_R" || s->name == "SP_SWITCH_L") {
 		_health = 0;
 	} else if (s->name == "SP_LIZARD1") {
@@ -418,6 +418,41 @@ void WetEngine::missTarget(Shoot *s, ArcadeShooting *arc, MVideo &background) {
 	}
 }
 
+void WetEngine::missNoTarget(ArcadeShooting *arc, MVideo &background) {
+	debug("miss no target!");
+	for (int i = _shoots.size() - 1; i >= 0; --i) {
+		Shoot *it = &_shoots[i];
+		debug("missed: %d -> %s", i, it->name.c_str());
+		if ((it->name == "SP_BOSS" || it->name == "SP_BOSS1") && !arc->missBoss1Video.empty()) {
+			background.decoder->pauseVideo(true);
+			MVideo video(arc->missBoss1Video, Common::Point(0, 0), false, true, false);
+			disableCursor();
+			runIntro(video);
+			// Should be currentPalette?
+			loadPalette(arc->backgroundPalette);
+			background.decoder->pauseVideo(false);
+			updateScreen(background);
+			drawScreen();
+			if (!_music.empty())
+				playSound(_music, 0, arc->musicRate); // restore music
+			break;
+		} else if (it->name == "SP_BOSS2" && !arc->missBoss2Video.empty()) {
+			background.decoder->pauseVideo(true);
+			MVideo video(arc->missBoss2Video, Common::Point(0, 0), false, true, false);
+			disableCursor();
+			runIntro(video);
+			// Should be currentPalette?
+			loadPalette(arc->backgroundPalette);
+			background.decoder->pauseVideo(false);
+			updateScreen(background);
+			drawScreen();
+			if (!_music.empty())
+				playSound(_music, 0, arc->musicRate); // restore music
+			break;
+		}
+	}
+}
+
 void WetEngine::hitPlayer() {
 	if (_arcadeMode != "Y1" && _arcadeMode != "Y2" && _arcadeMode != "Y3" && _arcadeMode != "Y4" && _arcadeMode != "Y5") {
 		assert( _playerFrameSep < (int)_playerFrames.size());




More information about the Scummvm-git-logs mailing list