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

dreammaster noreply at scummvm.org
Thu Apr 13 05:04:07 UTC 2023


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:
f0bef23dbe MM: MM1: Map 37 fixes, added Okrim ghost interaction


Commit: f0bef23dbe20edbeb7336bf2e2202ed88fc9fb68
    https://github.com/scummvm/scummvm/commit/f0bef23dbe20edbeb7336bf2e2202ed88fc9fb68
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-12T22:03:53-07:00

Commit Message:
MM: MM1: Map 37 fixes, added Okrim ghost interaction

Changed paths:
  A engines/mm/mm1/views_enh/interactions/ghost.cpp
  A engines/mm/mm1/views_enh/interactions/ghost.h
    devtools/create_mm/files/mm1/strings_en.yml
    engines/mm/mm1/globals.cpp
    engines/mm/mm1/maps/map37.cpp
    engines/mm/mm1/messages.h
    engines/mm/mm1/views/maps/ghost.cpp
    engines/mm/mm1/views_enh/dialogs.h
    engines/mm/mm1/views_enh/game_messages.cpp
    engines/mm/module.mk


diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index fc8d021cd25..0490dd90ff9 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1557,12 +1557,15 @@ maps:
 
 	map37:
 		message1: "Etched in gold, message 1 reads:\nCompletion-must-each-kings-of-astral-\nwith-9th-sanctum-and-wondrous"
-		okrim1: "A ghostlike figure rises from the body\nof okrim and speaks,\"In exchange for\nmy ring, forfeit a life, accept (Y/N)?\""
+		okrim1: "A ghostlike figure rises from the body\nof Okrim and speaks,\"In exchange for\nmy ring, forfeit a life. Accept (Y/N)?\""
 		okrim2: "\"May the shadow of death greet you\nwith open arms!\""
 		archway: "A gem encrusted archway reads:\nLair of the omnipotent wizard Okrim"
 		opening: "An opening above leads outside,\nClimb out (Y/N)?"
 		spins: "The floor spins!"
-
+	emap37:
+		okrim: "Okrim"
+		okrim1: "A ghostlike figure rises from the body of Okrim and speaks, \"In exchange for my ring, forfeit a life. Accept (Y/N)?\""
+	
 	map38:
 		message4: "Etched in gold, message 4 reads:'\nof-be-has-true-knowledge-plane-a-level-'\nto-reality-it"
 		banner: "A banner reads:\nthe labyrinth of lazzeruth...\nfew have entered, none have returned!"
diff --git a/engines/mm/mm1/globals.cpp b/engines/mm/mm1/globals.cpp
index 833cfb1e36c..76fe73c3fdc 100644
--- a/engines/mm/mm1/globals.cpp
+++ b/engines/mm/mm1/globals.cpp
@@ -142,7 +142,7 @@ Common::String Globals::operator[](const Common::String &name) const {
 	assert(_strings.contains(name));
 	Common::String result = _strings[name];
 
-	if (g_engine->isEnhanced() && isMapStr)
+	if (g_engine->isEnhanced() && name.hasPrefix("maps."))
 		result = searchAndReplace(result, "\n", " ");
 
 	return result;
diff --git a/engines/mm/mm1/maps/map37.cpp b/engines/mm/mm1/maps/map37.cpp
index c617fb468f9..c4aa1f04a6c 100644
--- a/engines/mm/mm1/maps/map37.cpp
+++ b/engines/mm/mm1/maps/map37.cpp
@@ -55,7 +55,9 @@ void Map37::special() {
 }
 
 void Map37::special00() {
-	send(SoundMessage(STRING["maps.map37.message1"]));
+	SoundMessage msg(STRING["maps.map37.message1"]);
+	msg._fontReduced = true;
+	send(msg);
 }
 
 void Map37::special01() {
diff --git a/engines/mm/mm1/messages.h b/engines/mm/mm1/messages.h
index 9535fcb5780..8ac3b4b9021 100644
--- a/engines/mm/mm1/messages.h
+++ b/engines/mm/mm1/messages.h
@@ -135,6 +135,7 @@ struct InfoMessage : public Message {
 	bool _largeMessage = false;
 	bool _sound = false;
 	int _delaySeconds = 0;
+	bool _fontReduced = false;
 
 	InfoMessage();
 	InfoMessage(const Common::String &str, TextAlign align = ALIGN_LEFT);
diff --git a/engines/mm/mm1/views/maps/ghost.cpp b/engines/mm/mm1/views/maps/ghost.cpp
index 65db2831ec8..47872527b73 100644
--- a/engines/mm/mm1/views/maps/ghost.cpp
+++ b/engines/mm/mm1/views/maps/ghost.cpp
@@ -29,9 +29,6 @@ namespace MM1 {
 namespace Views {
 namespace Maps {
 
-#define VAL1 123
-#define ANSWER_OFFSET 167
-
 Ghost::Ghost() : TextView("Ghost") {
 	_bounds = getLineBounds(20, 24);
 }
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 800a0cfd9d4..32c5d8d71cc 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -58,6 +58,7 @@
 #include "mm/mm1/views_enh/interactions/arenko.h"
 #include "mm/mm1/views_enh/interactions/arrested.h"
 #include "mm/mm1/views_enh/interactions/chess.h"
+#include "mm/mm1/views_enh/interactions/ghost.h"
 #include "mm/mm1/views_enh/interactions/giant.h"
 #include "mm/mm1/views_enh/interactions/gypsy.h"
 #include "mm/mm1/views_enh/interactions/hacker.h"
@@ -91,6 +92,7 @@ private:
 	ViewsEnh::Interactions::Arenko _arenko;
 	ViewsEnh::Interactions::Arrested _arrested;
 	ViewsEnh::Interactions::Chess _chess;
+	ViewsEnh::Interactions::Ghost _ghost;
 	ViewsEnh::Interactions::Giant _giant;
 	ViewsEnh::Interactions::Gypsy _gypsy;
 	ViewsEnh::Interactions::Hacker _hacker;
diff --git a/engines/mm/mm1/views_enh/game_messages.cpp b/engines/mm/mm1/views_enh/game_messages.cpp
index 8fa455c96ae..9873ef42d2a 100644
--- a/engines/mm/mm1/views_enh/game_messages.cpp
+++ b/engines/mm/mm1/views_enh/game_messages.cpp
@@ -73,6 +73,7 @@ bool GameMessages::msgInfo(const InfoMessage &msg) {
 	_yCallback = msg._yCallback;
 	_nCallback = msg._nCallback;
 	_keyCallback = msg._keyCallback;
+	_fontReduced = msg._fontReduced;
 
 	// Add the view
 	addView(this);
diff --git a/engines/mm/mm1/views_enh/interactions/ghost.cpp b/engines/mm/mm1/views_enh/interactions/ghost.cpp
new file mode 100644
index 00000000000..b33bf96499b
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/ghost.cpp
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mm/mm1/views_enh/interactions/ghost.h"
+#include "mm/mm1/maps/map37.h"
+#include "mm/mm1/globals.h"
+
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Ghost::Ghost() : Interaction("Ghost", 33) {
+	_title = STRING["maps.emap37.okrim"];
+}
+
+bool Ghost::msgFocus(const FocusMessage &msg) {
+	Interaction::msgFocus(msg);
+	addText(STRING["maps.map37.okrim1"]);
+
+	clearButtons();
+	addButton(STRING["maps.accept"], 'Y');
+	addButton(STRING["maps.decline"], 'N');
+
+	return true;
+}
+
+bool Ghost::msgKeypress(const KeypressMessage &msg) {
+	if (!_buttons.empty()) {
+		MM1::Maps::Map37 &map = *static_cast<MM1::Maps::Map37 *>(g_maps->_currentMap);
+
+		if (msg.keycode == Common::KEYCODE_y) {
+			g_globals->_party[0]._condition = ERADICATED;
+			close();
+			return true;
+
+		} else if (msg.keycode == Common::KEYCODE_n) {
+			map[MM1::Maps::MAP_29] = 32;
+			map[MM1::Maps::MAP_47] = 8;
+
+			addText(STRING["maps.map37.okrim2"]);
+			clearButtons();
+			return true;
+		}
+	}
+
+	return true;
+}
+
+void Ghost::viewAction() {
+	if (_buttons.empty()) {
+		close();
+	}
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/ghost.h b/engines/mm/mm1/views_enh/interactions/ghost.h
new file mode 100644
index 00000000000..989ce1bcf9a
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/ghost.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MM1_VIEWS_ENH_INTERACTIONS_GHOST_H
+#define MM1_VIEWS_ENH_INTERACTIONS_GHOST_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Ghost : public Interaction {
+protected:
+	/**
+	 * Handles any action/press
+	 */
+	void viewAction() override;
+
+public:
+	Ghost();
+
+	/**
+	 * Handles focus
+	 */
+	bool msgFocus(const FocusMessage &msg) override;
+
+	/**
+	 * Handle keypresses
+	 */
+	bool msgKeypress(const KeypressMessage &msg) override;
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index dad70ac149d..fcdffc5499a 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -186,6 +186,7 @@ MODULE_OBJS += \
 	mm1/views_enh/interactions/arrested.o \
 	mm1/views_enh/interactions/chess.o \
 	mm1/views_enh/interactions/giant.o \
+	mm1/views_enh/interactions/ghost.o \
 	mm1/views_enh/interactions/gypsy.o \
 	mm1/views_enh/interactions/hacker.o \
 	mm1/views_enh/interactions/ice_princess.o \




More information about the Scummvm-git-logs mailing list