[Scummvm-git-logs] scummvm master -> 71435fc8ba0e3286d33c7f02257a6590fdecbf4a

neuromancer noreply at scummvm.org
Sun Oct 27 21:16:57 UTC 2024


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

Summary:
b0a91331c3 FREESCAPE: missing entrance in castle for dos
03d7c1a0da FREESCAPE: change variable state when crawling
fce08233a5 FREESCAPE: implemented castle dos endgame
b4dfe4d173 FREESCAPE: reset shakeOffset to zero when not used
71435fc8ba FREESCAPE: enable spirits damage in castle


Commit: b0a91331c3ac46e12dc9b982560c7962564fe7f5
    https://github.com/scummvm/scummvm/commit/b0a91331c3ac46e12dc9b982560c7962564fe7f5
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-27T22:07:51+01:00

Commit Message:
FREESCAPE: missing entrance in castle for dos

Changed paths:
    engines/freescape/games/castle/castle.cpp


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index fea9a6259be..793fd21e0d0 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -672,6 +672,7 @@ void CastleEngine::loadAssets() {
 		for (auto &it : _areaMap) {
 			it._value->addStructure(_areaMap[255]);
 			it._value->addObjectFromArea(227, _areaMap[255]);
+			it._value->addObjectFromArea(228, _areaMap[255]);
 			it._value->addObjectFromArea(229, _areaMap[255]);
 			it._value->addObjectFromArea(242, _areaMap[255]);
 			it._value->addObjectFromArea(139, _areaMap[255]);


Commit: 03d7c1a0da7e2ac1ed60f0eeae647c435211685a
    https://github.com/scummvm/scummvm/commit/03d7c1a0da7e2ac1ed60f0eeae647c435211685a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-27T22:07:51+01:00

Commit Message:
FREESCAPE: change variable state when crawling

Changed paths:
    engines/freescape/games/castle/castle.cpp
    engines/freescape/language/8bitDetokeniser.h


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 793fd21e0d0..5eeff9e86ba 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -411,6 +411,7 @@ void CastleEngine::pressedKey(const int keycode) {
 				insertTemporaryMessage(_messagesList[11], _countdown - 2);
 				return;
 			}
+			_gameStateVars[k8bitVariableCrawling] = 0;
 		}
 		// TODO: raising can fail if there is no room, so the action should fail
 		_playerStepIndex = 2;
@@ -427,14 +428,17 @@ void CastleEngine::pressedKey(const int keycode) {
 				insertTemporaryMessage(_messagesList[11], _countdown - 2);
 				return;
 			}
+			_gameStateVars[k8bitVariableCrawling] = 0;
 		}
 
 		// TODO: raising can fail if there is no room, so the action should fail
 		_playerStepIndex = 1;
 		insertTemporaryMessage(_messagesList[14], _countdown - 2);
 	} else if (keycode == kActionCrawlMode) {
-		if (_playerHeightNumber == 1)
+		if (_playerHeightNumber == 1) {
 			lower();
+			_gameStateVars[k8bitVariableCrawling] = 128;
+		}
 		_playerStepIndex = 0;
 		insertTemporaryMessage(_messagesList[13], _countdown - 2);
 	} else if (keycode == kActionFaceForward) {
diff --git a/engines/freescape/language/8bitDetokeniser.h b/engines/freescape/language/8bitDetokeniser.h
index c04f4b90116..7f00dcd04de 100644
--- a/engines/freescape/language/8bitDetokeniser.h
+++ b/engines/freescape/language/8bitDetokeniser.h
@@ -27,7 +27,11 @@
 namespace Freescape {
 
 enum {
-	k8bitGameBitTravelRock = 30,
+	k8bitGameBitTravelRock = 30
+};
+
+enum {
+	k8bitVariableCrawling = 30,
 	k8bitVariableSpiritsDestroyed = 28,
 	k8bitVariableEnergy = 62,
 	k8bitVariableScore = 61,


Commit: fce08233a50cbb0d238ec56a84ec670e4ad55a5e
    https://github.com/scummvm/scummvm/commit/fce08233a50cbb0d238ec56a84ec670e4ad55a5e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-27T22:07:51+01:00

Commit Message:
FREESCAPE: implemented castle dos endgame

Changed paths:
    engines/freescape/freescape.cpp
    engines/freescape/games/castle/castle.cpp
    engines/freescape/games/castle/castle.h


diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 5167e321931..c9b8b80bc35 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -924,6 +924,7 @@ void FreescapeEngine::initGameState() {
 
 	removeTimers();
 	startCountdown(_initialCountdown - 1);
+	clearTemporalMessages();
 	int seconds, minutes, hours;
 	getTimeFromCountdown(seconds, minutes, hours);
 	_lastMinute = minutes;
diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 5eeff9e86ba..f7795b2aec8 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -373,7 +373,10 @@ void CastleEngine::initGameState() {
 }
 
 bool CastleEngine::checkIfGameEnded() {
-	if (getGameBit(31)) { // Escaped!
+	if (_gameStateControl != kFreescapeGameStatePlaying)
+		return false;
+
+	if (getGameBit(31) || _currentArea->getAreaID() == 74) { // Escaped!
 		_gameStateControl = kFreescapeGameStateEnd;
 		return true;
 	} else
@@ -384,11 +387,14 @@ void CastleEngine::endGame() {
 	_shootingFrames = 0;
 	_delayedShootObject = nullptr;
 	_endGamePlayerEndArea = true;
+	insertTemporaryMessage(_messagesList[5], INT_MIN);
 
-	if (_endGameKeyPressed) {
-		_gameStateControl = kFreescapeGameStateRestart;
-		_endGameKeyPressed = false;
+	if (isDOS()) {
+		drawFullscreenEndGameAndWait();
 	}
+
+	_gameStateControl = kFreescapeGameStateRestart;
+	_endGameKeyPressed = false;
 }
 
 void CastleEngine::pressedKey(const int keycode) {
@@ -624,6 +630,53 @@ void CastleEngine::drawInfoMenu() {
 	g_system->showMouse(false);
 }
 
+void CastleEngine::drawFullscreenEndGameAndWait() {
+	Graphics::Surface *surface = new Graphics::Surface();
+	surface->create(_screenW, _screenH, _gfx->_texturePixelFormat);
+	surface->fillRect(_fullscreenViewArea, _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00));
+	surface->fillRect(_viewArea, _gfx->_texturePixelFormat.ARGBToColor(0xFF, 0x00, 0x00, 0x00));
+	surface->copyRectToSurface(*_endGameBackgroundFrame, 46, 38, Common::Rect(0, 0, _endGameBackgroundFrame->w, _endGameBackgroundFrame->h));
+
+	Common::Event event;
+	bool cont = true;
+	bool magisterAlive = true;
+	while (!shouldQuit() && cont) {
+		while (_eventManager->pollEvent(event)) {
+
+			// Events
+			switch (event.type) {
+			case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
+				if (event.customType == kActionShoot) {
+					if (magisterAlive) {
+						surface->copyRectToSurface(*_endGameThroneFrame, 121, 52, Common::Rect(0, 0, _endGameThroneFrame->w - 1, _endGameThroneFrame->h));
+						magisterAlive = false;
+					} else
+						cont = false;
+				}
+				break;
+			case Common::EVENT_SCREEN_CHANGED:
+				_gfx->computeScreenViewport();
+				break;
+			default:
+				break;
+			}
+		}
+		_gfx->clear(0, 0, 0, true);
+		drawBorder();
+		if (_currentArea)
+			drawUI();
+
+		drawFullscreenSurface(surface);
+		_gfx->flipBuffer();
+		g_system->updateScreen();
+		g_system->delayMillis(15); // try to target ~60 FPS
+	}
+
+	surface->free();
+	delete surface;
+}
+
+
 // Same as FreescapeEngine::executeExecute but updates the spirits destroyed counter
 void CastleEngine::executeDestroy(FCLInstruction &instruction) {
 	uint16 objectID = 0;
diff --git a/engines/freescape/games/castle/castle.h b/engines/freescape/games/castle/castle.h
index b03214bcf4a..d7947691e4e 100644
--- a/engines/freescape/games/castle/castle.h
+++ b/engines/freescape/games/castle/castle.h
@@ -131,6 +131,7 @@ private:
 	void loadRiddles(Common::SeekableReadStream *file, int offset, int number);
 	void loadDOSFonts(Common::SeekableReadStream *file, int pos);
 	void drawFullscreenRiddleAndWait(uint16 riddle);
+	void drawFullscreenEndGameAndWait();
 	void drawRiddle(uint16 riddle, uint32 front, uint32 back, Graphics::Surface *surface);
 	void tryToCollectKey();
 	void addGhosts();


Commit: b4dfe4d173901723c68f3d4a6b11684b67cab152
    https://github.com/scummvm/scummvm/commit/b4dfe4d173901723c68f3d4a6b11684b67cab152
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-27T22:07:51+01:00

Commit Message:
FREESCAPE: reset shakeOffset to zero when not used

Changed paths:
    engines/freescape/games/castle/castle.cpp


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index f7795b2aec8..51fb5db90a3 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -1012,8 +1012,10 @@ void CastleEngine::checkSensors() {
 
 	_lastTick = _ticks;
 
-	if (_sensors.empty())
+	if (_sensors.empty()) {
+		_gfx->_shakeOffset = Common::Point();
 		return;
+	}
 
 	for (auto &it : _sensors) {
 		Sensor *sensor = (Sensor *)it;
@@ -1055,8 +1057,10 @@ void CastleEngine::checkSensors() {
 		break;
 	}
 
-	if (!ghostInArea)
+	if (!ghostInArea) {
+		_gfx->_shakeOffset = Common::Point();
 		return;
+	}
 
 	int firingInterval = 5; // This is fixed for all the ghosts?
 	if (_ticks % firingInterval == 0) {


Commit: 71435fc8ba0e3286d33c7f02257a6590fdecbf4a
    https://github.com/scummvm/scummvm/commit/71435fc8ba0e3286d33c7f02257a6590fdecbf4a
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2024-10-27T22:07:51+01:00

Commit Message:
FREESCAPE: enable spirits damage in castle

Changed paths:
    engines/freescape/games/castle/castle.cpp


diff --git a/engines/freescape/games/castle/castle.cpp b/engines/freescape/games/castle/castle.cpp
index 51fb5db90a3..5fb85b9f390 100644
--- a/engines/freescape/games/castle/castle.cpp
+++ b/engines/freescape/games/castle/castle.cpp
@@ -1004,9 +1004,6 @@ void CastleEngine::addGhosts() {
 }
 
 void CastleEngine::checkSensors() {
-	if (_disableSensors)
-		return;
-
 	if (_lastTick == _ticks)
 		return;
 
@@ -1062,11 +1059,18 @@ void CastleEngine::checkSensors() {
 		return;
 	}
 
-	int firingInterval = 5; // This is fixed for all the ghosts?
-	if (_ticks % firingInterval == 0) {
+	if (_disableSensors)
+		return;
+
+	// This is the frequency to shake the screen
+	if (_ticks % 5 == 0) {
 		if (_underFireFrames <= 0)
 			_underFireFrames = 1;
-		//takeDamageFromSensor();
+	}
+
+	// This is the frequency to take damage
+	if (_ticks % 100 == 0) {
+		takeDamageFromSensor();
 	}
 }
 




More information about the Scummvm-git-logs mailing list