[Scummvm-git-logs] scummvm master -> 73e0229decda14962fcef1ac3006332d4c188e44

dreammaster noreply at scummvm.org
Mon Apr 10 00:35:51 UTC 2023


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

Summary:
e1ccdb877e MM: MM1: Fixes for map 23, added gypsy
8c814df757 MM: MM1: Map string fixes
73e0229dec MM: MM1: Added separate view for the druid Arenko


Commit: e1ccdb877e7f97d19dfef68560c6c537752466d8
    https://github.com/scummvm/scummvm/commit/e1ccdb877e7f97d19dfef68560c6c537752466d8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-09T17:35:26-07:00

Commit Message:
MM: MM1: Fixes for map 23, added gypsy

Changed paths:
  A engines/mm/mm1/views_enh/interactions/gypsy.cpp
  A engines/mm/mm1/views_enh/interactions/gypsy.h
    devtools/create_mm/files/mm1/strings_en.yml
    engines/mm/mm1/views/maps/gypsy.cpp
    engines/mm/mm1/views_enh/color_questions.cpp
    engines/mm/mm1/views_enh/dialogs.h
    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 202ed3eb190..0b4b6cec830 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -928,6 +928,15 @@ monster_actions:
 	steals_something: "steals something"
 	takes_food: "takes food"
 	turned_to_stone: "is turned to stone"
+colors:
+	0: "Red Thorac"
+	1: "Blue Ogram"
+	2: "Green Bagar"
+	3: "Yellow Limra"
+	4: "Purple Sagran"
+	5: "Orange Oolak"
+	6: "Black Dresidion"
+	7: "White Dilithium"
 maps:
 	poof: "Poof!"
 	sign: "A sign above the door reads:\n"
@@ -1236,16 +1245,6 @@ maps:
 		correct: "Correct!"
 		islands: "Atop this peak 5 islands can be seen\nto the southeast"
 		wave: "A tidal wave sweeps the party away!"
-	emap17:
-		options:
-			1: "Red Thorac"
-			2: "Blue Ogram"
-			3: "Green Bagar"
-			4: "Yellow Limra"
-			5: "Purple Sagran"
-			6: "Orange Oolak"
-			7: "Black Dresidion"
-			8: "White Dilithium"
 
 	map18:
 		passage: "Cavernous passage to Erliquin,\ntake it (Y/N)?"
@@ -1319,8 +1318,8 @@ maps:
 		poison: "Arghhh... poison!"
 		today_spells: "Today spells!"
 		today_might: "Today might!"
-		fountain: "A fountain speaks:\n\"will the party drink (Y/N)?\""
-		chest: "You found a chest upon which an\ninscription reads: Property of xx!xx!\nInside you found a ruby whistle, 2000\ngold and a note:\nThe stronghold lies at b-3,14-2\nBlow twice to enter."
+		fountain: "A fountain speaks:\n\"Will the party drink (Y/N)?\""
+		chest: "You found a chest upon which an\ninscription reads: Property of Xx!xx!\nInside you found a ruby whistle, 2000\ngold and a note:\nThe stronghold lies at B-3,14-2\nBlow twice to enter."
 		roadsign: "Roadsign: Sorpigal S.17, W.1, N.2"
 
 	map23:
@@ -1337,15 +1336,9 @@ maps:
 		look_out: "Look out!"
 		gypsy: "A toothless gypsy seer asks, \"Who would\nlike to hear their sign (1-6)?\""
 		your_sign_is: "\"Your sign is the %s\""
-		signs:
-			0: "Red Thorac"
-			1: "Blue Ogram"
-			2: "Green Bagar"
-			3: "Yellow Limra"
-			4: "Purple Sagran"
-			5: "Orange Oolak"
-			6: "Black Dresidion"
-			7: "White Dilithium"
+	emap23:
+		statues: "Statues block the path, smash them (Y/N)?"
+		gypsy_title: "Gypsy"
 
 	map24:
 		wyverns: "Wyverns attack from above!"
diff --git a/engines/mm/mm1/views/maps/gypsy.cpp b/engines/mm/mm1/views/maps/gypsy.cpp
index 9d9436f6550..d073e18b030 100644
--- a/engines/mm/mm1/views/maps/gypsy.cpp
+++ b/engines/mm/mm1/views/maps/gypsy.cpp
@@ -75,7 +75,7 @@ void Gypsy::draw() {
 	} else {
 		Common::String line = Common::String::format(
 			STRING["maps.map23.your_sign_is"].c_str(),
-			STRING[Common::String::format("maps.map23.signs.%d",
+			STRING[Common::String::format("colors.%d",
 				_character->_flags[4] & CHARFLAG4_SIGN)].c_str()
 		);
 
diff --git a/engines/mm/mm1/views_enh/color_questions.cpp b/engines/mm/mm1/views_enh/color_questions.cpp
index 2e28aaac85d..93988cc88c4 100644
--- a/engines/mm/mm1/views_enh/color_questions.cpp
+++ b/engines/mm/mm1/views_enh/color_questions.cpp
@@ -61,7 +61,7 @@ void ColorQuestions::draw() {
 		for (int option = 0; option < 8; ++option) {
 			Common::String prefix = Common::String::format("%c) ", '1' + option);
 			writeString(20 + 105 * (option % 2), 10 + (option / 2) * 8, prefix, ALIGN_RIGHT);
-			writeString(STRING[Common::String::format("maps.emap17.options.%d", option + 1)]);
+			writeString(STRING[Common::String::format("colors.%d", option + 1)]);
 		}
 
 	} else {
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 341d5f5271c..e873f8b43bb 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -55,6 +55,7 @@
 #include "mm/mm1/views_enh/won_game.h"
 #include "mm/mm1/views_enh/interactions/access_code.h"
 #include "mm/mm1/views_enh/interactions/arrested.h"
+#include "mm/mm1/views_enh/interactions/gypsy.h"
 #include "mm/mm1/views_enh/interactions/ice_princess.h"
 #include "mm/mm1/views_enh/interactions/prisoners.h"
 #include "mm/mm1/views_enh/interactions/resistances.h"
@@ -79,6 +80,7 @@ struct Dialogs {
 private:
 	ViewsEnh::Interactions::AccessCode _accessCode;
 	ViewsEnh::Interactions::Arrested _arrested;
+	ViewsEnh::Interactions::Gypsy _gypsy;
 	ViewsEnh::Interactions::IcePrincess _icePrincess;
 	ViewsEnh::Interactions::Resistances _resistances;
 	ViewsEnh::Interactions::Statue _statue;
diff --git a/engines/mm/mm1/views_enh/interactions/gypsy.cpp b/engines/mm/mm1/views_enh/interactions/gypsy.cpp
new file mode 100644
index 00000000000..1dac4aa31a2
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/gypsy.cpp
@@ -0,0 +1,71 @@
+/* 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/gypsy.h"
+#include "mm/mm1/globals.h"
+
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Gypsy::Gypsy() : Interaction("Gypsy", 9) {
+	_title = STRING["maps.emap23.gypsy_title"];
+}
+
+bool Gypsy::msgFocus(const FocusMessage &msg) {
+	PartyView::msgFocus(msg);
+
+	_charSelected = false;
+	addText(STRING["maps.map23.gypsy"]);
+	return true;
+}
+
+void Gypsy::viewAction() {
+	// When already showing Gypsy, any click/key will close view
+	if (_lines.empty())
+		close();
+}
+
+void Gypsy::charSwitched(Character *priorChar) {
+	Interaction::charSwitched(priorChar);
+
+	Character &c = *g_globals->_currCharacter;
+	if (!(c._flags[4] & CHARFLAG4_ASSIGNED)) {
+		c._flags[4] = CHARFLAG4_ASSIGNED |
+			(getRandomNumber(8) - 1);
+	}
+
+	Common::String line = Common::String::format(
+		STRING["maps.map23.your_sign_is"].c_str(),
+		STRING[Common::String::format("colors.%d",
+			c._flags[4] & CHARFLAG4_SIGN)].c_str()
+	);
+	addText(line);
+
+	redraw();
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/gypsy.h b/engines/mm/mm1/views_enh/interactions/gypsy.h
new file mode 100644
index 00000000000..846b61e4580
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/gypsy.h
@@ -0,0 +1,61 @@
+/* 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_GYPSY_H
+#define MM1_VIEWS_ENH_INTERACTIONS_GYPSY_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Gypsy : public Interaction {
+private:
+	bool _charSelected = false;
+
+protected:
+	/**
+	 * Handles any action/press
+	 */
+	void viewAction() override;
+
+	/**
+	 * Called when the selected character has been switched
+	 */
+	void charSwitched(Character *priorChar) override;
+
+public:
+	Gypsy();
+
+	/**
+	 * Handles focus
+	 */
+	bool msgFocus(const FocusMessage &msg) override;
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index a289047fcbe..d7810096baa 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -178,6 +178,7 @@ MODULE_OBJS += \
 	mm1/views_enh/yes_no.o \
 	mm1/views_enh/interactions/access_code.o \
 	mm1/views_enh/interactions/arrested.o \
+	mm1/views_enh/interactions/gypsy.o \
 	mm1/views_enh/interactions/ice_princess.o \
 	mm1/views_enh/interactions/interaction.o \
 	mm1/views_enh/interactions/interaction_query.o \


Commit: 8c814df757dad4629461745308b30ce9ac9e156a
    https://github.com/scummvm/scummvm/commit/8c814df757dad4629461745308b30ce9ac9e156a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-09T17:35:27-07:00

Commit Message:
MM: MM1: Map string fixes

Changed paths:
    devtools/create_mm/files/mm1/strings_en.yml


diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index 0b4b6cec830..da359808b12 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1342,13 +1342,15 @@ maps:
 
 	map24:
 		wyverns: "Wyverns attack from above!"
-		wyvern_eye: "One of the wyvern's eyes begins to glow!Take it (Y/N)?"
+		wyvern_eye: "One of the wyvern's eyes begins to glow!\nTake it (Y/N)?"
 		roadsign: "Roadsign: Sorpigal N.22, W.2, N.2"
 		kilburn: "The exiled Lord Kilburn speaks:\n\"Take this map and explore the desert.\nReport your findings to the other lords.\nThen they will understand!\" Accept(Y/N)?"
 		backpacks_full: "*** Backpacks full!"
 		lair: "A wyvern's lair, investigate (Y/N)?"
 		sign: "Painted in a black and white pattern,\na sign reads: The first part is female."
 		hermit: "The hermit says: \"Trade wares (Y/N)?\""
+	emap24:
+		kilburn: "The exiled Lord Kilburn speaks: \"Take this map and explore the desert. Report your findings to the other lords. Then they will understand!\" Accept (Y/N)?"
 
 	map25:
 		slab: "A large slab of coral blocks a passage!\n"
@@ -1365,7 +1367,7 @@ maps:
 		scorpion: "Suddenly, a gargantuan scorpion attacks!"
 		trading_post: "A small tribe of desert nomads have\nestablished a trading post here.\nTrade item (Y/N)?"
 		nothing_to_trade: "Your leader has nothing to trade!"
-		kilburn: "Kilburn, c-3 6-14"
+		kilburn: "Kilburn, C-3 6-14"
 
 	map27:
 		pool: "The pool of wisdom grants those who are\nworthy +4 personality."


Commit: 73e0229decda14962fcef1ac3006332d4c188e44
    https://github.com/scummvm/scummvm/commit/73e0229decda14962fcef1ac3006332d4c188e44
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-09T17:35:27-07:00

Commit Message:
MM: MM1: Added separate view for the druid Arenko

Changed paths:
  A engines/mm/mm1/game/arenko.cpp
  A engines/mm/mm1/game/arenko.h
  A engines/mm/mm1/views/maps/arenko.cpp
  A engines/mm/mm1/views/maps/arenko.h
  A engines/mm/mm1/views_enh/interactions/arenko.cpp
  A engines/mm/mm1/views_enh/interactions/arenko.h
    devtools/create_mm/files/mm1/strings_en.yml
    engines/mm/mm1/maps/map28.cpp
    engines/mm/mm1/views/dialogs.h
    engines/mm/mm1/views_enh/dialogs.h
    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 da359808b12..a80896de089 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1394,6 +1394,12 @@ maps:
 		cursed: "Cursed"
 		keep_climbing: "Keep climbing."
 		sign: "Roadsign: Algary S.9"
+	emap28:
+		arenko_title: "Arenko"
+		well_done: "Well done! What is your pleasure?"
+		gold: "Gold"
+		gems: "Gems"
+		item: "Item"
 
 	map29:
 		algary: "Algary, enter (Y/N)?"
diff --git a/engines/mm/mm1/game/arenko.cpp b/engines/mm/mm1/game/arenko.cpp
new file mode 100644
index 00000000000..3bb664ca698
--- /dev/null
+++ b/engines/mm/mm1/game/arenko.cpp
@@ -0,0 +1,50 @@
+/* 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/game/arenko.h"
+#include "mm/mm1/globals.h"
+
+
+namespace MM {
+namespace MM1 {
+namespace Game {
+
+void Arenko::giveGold() {
+	g_globals->_treasure.setGold((getRandomNumber(8) + 8) * 256);
+	g_maps->clearSpecial();
+	g_events->addAction(KEYBIND_SEARCH);
+}
+
+void Arenko::giveGems() {
+	g_globals->_treasure.setGems(getRandomNumber(50) + 200);
+	g_maps->clearSpecial();
+	g_events->addAction(KEYBIND_SEARCH);
+}
+
+void Arenko::giveItem() {
+	g_globals->_treasure._items[2] = getRandomNumber(22) + 196;
+	g_maps->clearSpecial();
+	g_events->addAction(KEYBIND_SEARCH);
+}
+
+} // namespace Game
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/game/arenko.h b/engines/mm/mm1/game/arenko.h
new file mode 100644
index 00000000000..e73bddb7e09
--- /dev/null
+++ b/engines/mm/mm1/game/arenko.h
@@ -0,0 +1,42 @@
+/* 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_GAME_ARENKO_H
+#define MM1_GAME_ARENKO_H
+
+#include "mm/mm1/game/game_logic.h"
+
+namespace MM {
+namespace MM1 {
+namespace Game {
+
+class Arenko : public GameLogic {
+public:
+	void giveGold();
+	void giveGems();
+	void giveItem();
+};
+
+} // namespace Game
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/maps/map28.cpp b/engines/mm/mm1/maps/map28.cpp
index 1416af8dacc..a0bc36cadf7 100644
--- a/engines/mm/mm1/maps/map28.cpp
+++ b/engines/mm/mm1/maps/map28.cpp
@@ -135,43 +135,7 @@ void Map28::special() {
 }
 
 void Map28::special00() {
-	if (!_data[VAL1]) {
-		send(SoundMessage(STRING["maps.map28.arenko"]));
-		_data[VAL2] = 1;
-	} else if (_data[VAL1] < 19) {
-		send(SoundMessage(STRING["maps.map28.keep_climbing"]));
-	} else {
-		send(SoundMessage(
-			STRING["maps.map28.well_done"],
-			[](const Common::KeyState &ks) {
-				switch (ks.keycode) {
-				case Common::KEYCODE_a:
-					g_events->close();
-					g_globals->_treasure.setGold((g_events->getRandomNumber(8) + 8) * 256);
-					g_maps->clearSpecial();
-					g_events->addAction(KEYBIND_SEARCH);
-					break;
-
-				case Common::KEYCODE_b:
-					g_events->close();
-					g_globals->_treasure.setGems(g_events->getRandomNumber(50) + 200);
-					g_maps->clearSpecial();
-					g_events->addAction(KEYBIND_SEARCH);
-					break;
-
-				case Common::KEYCODE_c:
-					g_events->close();
-					g_globals->_treasure._items[2] = g_events->getRandomNumber(22) + 196;
-					g_maps->clearSpecial();
-					g_events->addAction(KEYBIND_SEARCH);
-					break;
-
-				default:
-					break;
-				}
-			}
-		));
-	}
+	g_events->addView("Arenko");
 }
 
 void Map28::special01() {
diff --git a/engines/mm/mm1/views/dialogs.h b/engines/mm/mm1/views/dialogs.h
index d5afba41807..787afdf0aa4 100644
--- a/engines/mm/mm1/views/dialogs.h
+++ b/engines/mm/mm1/views/dialogs.h
@@ -56,6 +56,7 @@
 #include "mm/mm1/views/maps/access_code.h"
 #include "mm/mm1/views/maps/alamar.h"
 #include "mm/mm1/views/maps/alien.h"
+#include "mm/mm1/views/maps/arenko.h"
 #include "mm/mm1/views/maps/arrested.h"
 #include "mm/mm1/views/maps/chess.h"
 #include "mm/mm1/views/maps/dog_statue.h"
@@ -123,6 +124,7 @@ private:
 	Views::Maps::AccessCode _accessCode;
 	Views::Maps::Alamar _alamar;
 	Views::Maps::Alien _alien;
+	Views::Maps::Arenko _arenko;
 	Views::Maps::Arrested _arrested;
 	Views::Maps::Chess _chess;
 	Views::Maps::ChildPrisoner _childPrisoner;
diff --git a/engines/mm/mm1/views/maps/arenko.cpp b/engines/mm/mm1/views/maps/arenko.cpp
new file mode 100644
index 00000000000..021e0c7b2ee
--- /dev/null
+++ b/engines/mm/mm1/views/maps/arenko.cpp
@@ -0,0 +1,98 @@
+/* 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/maps/arenko.h"
+#include "mm/mm1/maps/map28.h"
+#include "mm/mm1/globals.h"
+
+#define VAL1 63
+#define VAL2 64
+
+namespace MM {
+namespace MM1 {
+namespace Views {
+namespace Maps {
+
+Arenko::Arenko() : TextView("Arenko") {
+	_bounds = getLineBounds(20, 24);
+}
+
+bool Arenko::msgFocus(const FocusMessage &msg) {
+	MM1::Maps::Map28 &map = *static_cast<MM1::Maps::Map28 *>(g_maps->_currentMap);
+
+	if (!map[VAL1]) {
+		_line = STRING["maps.map28.arenko"];
+		map[VAL2] = 1;
+
+	} else if (map[VAL1] < 19) {
+		_line = STRING["maps.map28.keep_climbing"];
+
+	} else {
+		_line = STRING["maps.map28.well_done"];
+	}
+
+	return true;
+}
+
+void Arenko::draw() {
+	clearSurface();
+	writeString(0, 1, _line);
+}
+
+bool Arenko::msgKeypress(const KeypressMessage &msg) {
+	MM1::Maps::Map28 &map = *static_cast<MM1::Maps::Map28 *>(g_maps->_currentMap);
+
+	if (map[VAL1] == 19) {
+		switch (msg.keycode) {
+		case Common::KEYCODE_a:
+			close();
+			giveGold();
+			return true;
+		case Common::KEYCODE_b:
+			close();
+			giveGems();
+			return true;
+		case Common::KEYCODE_c:
+			close();
+			giveItem();
+			return true;
+		default:
+			break;
+		}
+	} else {
+		close();
+	}
+
+	return true;
+}
+
+bool Arenko::msgAction(const ActionMessage &msg) {
+	MM1::Maps::Map28 &map = *static_cast<MM1::Maps::Map28 *>(g_maps->_currentMap);
+	if (map[VAL1] != 19)
+		close();
+
+	return true;
+}
+
+} // namespace Maps
+} // namespace Views
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views/maps/arenko.h b/engines/mm/mm1/views/maps/arenko.h
new file mode 100644
index 00000000000..d37ac9b0149
--- /dev/null
+++ b/engines/mm/mm1/views/maps/arenko.h
@@ -0,0 +1,51 @@
+/* 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_MAPS_ARENKO_H
+#define MM1_VIEWS_MAPS_ARENKO_H
+
+#include "mm/mm1/views/text_view.h"
+#include "mm/mm1/game/arenko.h"
+
+namespace MM {
+namespace MM1 {
+namespace Views {
+namespace Maps {
+
+class Arenko : public TextView, public MM1::Game::Arenko {
+private:
+	Common::String _line;
+public:
+	Arenko();
+	virtual ~Arenko() {}
+
+	bool msgFocus(const FocusMessage &msg) override;
+	void draw() override;
+	bool msgKeypress(const KeypressMessage &msg) override;
+	bool msgAction(const ActionMessage &msg) override;
+};
+
+} // namespace Maps
+} // namespace Views
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index e873f8b43bb..27df486f91a 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -54,6 +54,7 @@
 #include "mm/mm1/views_enh/who_will_try.h"
 #include "mm/mm1/views_enh/won_game.h"
 #include "mm/mm1/views_enh/interactions/access_code.h"
+#include "mm/mm1/views_enh/interactions/arenko.h"
 #include "mm/mm1/views_enh/interactions/arrested.h"
 #include "mm/mm1/views_enh/interactions/gypsy.h"
 #include "mm/mm1/views_enh/interactions/ice_princess.h"
@@ -79,6 +80,7 @@ namespace ViewsEnh {
 struct Dialogs {
 private:
 	ViewsEnh::Interactions::AccessCode _accessCode;
+	ViewsEnh::Interactions::Arenko _arenko;
 	ViewsEnh::Interactions::Arrested _arrested;
 	ViewsEnh::Interactions::Gypsy _gypsy;
 	ViewsEnh::Interactions::IcePrincess _icePrincess;
diff --git a/engines/mm/mm1/views_enh/interactions/arenko.cpp b/engines/mm/mm1/views_enh/interactions/arenko.cpp
new file mode 100644
index 00000000000..d6108e6a319
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/arenko.cpp
@@ -0,0 +1,97 @@
+/* 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/arenko.h"
+#include "mm/mm1/maps/map28.h"
+#include "mm/mm1/globals.h"
+
+#define VAL1 63
+#define VAL2 64
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Arenko::Arenko() : Interaction("Arenko", 9) {
+	_title = STRING["maps.emap28.arenko_title"];
+}
+
+bool Arenko::msgFocus(const FocusMessage &msg) {
+	Maps::Map28 &map = *static_cast<Maps::Map28 *>(g_maps->_currentMap);
+	clearButtons();
+
+	if (!map[VAL1]) {
+		addText(STRING["maps.map28.arenko"]);
+		map[VAL2] = 1;
+
+	} else if (map[VAL1] < 19) {
+		addText(STRING["maps.map28.keep_climbing"]);
+
+	} else {
+		addText(STRING["maps.map28.well_done"]);
+		addButton(STRING["maps.emap28.gold"], 'A');
+		addButton(STRING["maps.emap28.gems"], 'B');
+		addButton(STRING["maps.emap28.item"], 'C');
+	}
+
+	return true;
+}
+
+void Arenko::viewAction() {
+	if (_buttons.empty()) {
+		close();
+	}
+}
+
+bool Arenko::msgKeypress(const KeypressMessage &msg) {
+	if (!_buttons.empty()) {
+		switch (msg.keycode) {
+		case Common::KEYCODE_a:
+			close();
+			giveGold();
+			return true;
+		case Common::KEYCODE_b:
+			close();
+			giveGems();
+			return true;
+		case Common::KEYCODE_c:
+			close();
+			giveItem();
+			return true;
+		default:
+			break;
+		}
+	}
+
+	return Interaction::msgKeypress(msg);
+}
+
+bool Arenko::msgAction(const ActionMessage &msg) {
+	if (_buttons.empty())
+		return Interaction::msgAction(msg);
+	return true;
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/arenko.h b/engines/mm/mm1/views_enh/interactions/arenko.h
new file mode 100644
index 00000000000..bd61d170c73
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/arenko.h
@@ -0,0 +1,50 @@
+/* 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_ARENKO_H
+#define MM1_VIEWS_ENH_INTERACTIONS_ARENKO_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+#include "mm/mm1/game/arenko.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Arenko : public Interaction, public MM1::Game::Arenko {
+protected:
+	void viewAction() override;
+
+public:
+	Arenko();
+
+	bool msgFocus(const FocusMessage &msg) override;
+	bool msgKeypress(const KeypressMessage &msg) override;
+	bool msgAction(const ActionMessage &msg) override;
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index d7810096baa..cd6c3c00d34 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -36,6 +36,7 @@ MODULE_OBJS += \
 	mm1/data/text_parser.o \
 	mm1/data/trap.o \
 	mm1/data/treasure.o \
+	mm1/game/arenko.o \
 	mm1/game/arrested.o \
 	mm1/game/game_logic.o \
 	mm1/game/combat.o \
@@ -71,6 +72,7 @@ MODULE_OBJS += \
 	mm1/views/maps/alamar.o \
 	mm1/views/maps/alien.o \
 	mm1/views/maps/answer_entry.o \
+	mm1/views/maps/arenko.o \
 	mm1/views/maps/arrested.o \
 	mm1/views/maps/chess.o \
 	mm1/views/maps/dog_statue.o \
@@ -177,6 +179,7 @@ MODULE_OBJS += \
 	mm1/views_enh/won_game.o \
 	mm1/views_enh/yes_no.o \
 	mm1/views_enh/interactions/access_code.o \
+	mm1/views_enh/interactions/arenko.o \
 	mm1/views_enh/interactions/arrested.o \
 	mm1/views_enh/interactions/gypsy.o \
 	mm1/views_enh/interactions/ice_princess.o \




More information about the Scummvm-git-logs mailing list