[Scummvm-git-logs] scummvm master -> 6ca717b49d6828e8d98831dfcc84b8df28502944
dreammaster
noreply at scummvm.org
Wed Apr 12 05:03:26 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:
76c0e2c3bc MM: MM1: Create proper views for map 0 leprechaun
1118cee359 MM: MM1: Added map 35 Inspectron
6ca717b49d MM: MM1: Map 36 fixes, added Lord Hacker view
Commit: 76c0e2c3bc1708b95221c270f7f9fd2eee0eb59e
https://github.com/scummvm/scummvm/commit/76c0e2c3bc1708b95221c270f7f9fd2eee0eb59e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-11T22:03:12-07:00
Commit Message:
MM: MM1: Create proper views for map 0 leprechaun
Changed paths:
A engines/mm/mm1/game/leprechaun.cpp
A engines/mm/mm1/game/leprechaun.h
A engines/mm/mm1/views/maps/leprechaun.cpp
A engines/mm/mm1/views/maps/leprechaun.h
A engines/mm/mm1/views_enh/interactions/leprechaun.cpp
A engines/mm/mm1/views_enh/interactions/leprechaun.h
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/maps/map00.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 f8692889378..c39a485b023 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -993,7 +993,8 @@ maps:
levitate: ", levitation saves you!"
emap00:
training_inside: "Before you are various groups engaged in training exercises. Worg, the guildmaster asks, \"Do you require training (Y/N)?\""
- leprechaun: "A tenacious leprechaun appears saying, \"Traveling the roads is quite dangerous save for the strong and courageous, Only 1 gem you lose and i'll send you to the town you choose.\"\n\n'ESC' to go back\nWhich town (1-5)?"
+ leprechaun: "A tenacious leprechaun appears saying, \"Traveling the roads is quite dangerous. Only 1 gem and i'll teleport you.\""
+ leprechaun_title: "Leprechaun"
map01:
blacksmith: "\"B. Smith's workshop\""
diff --git a/engines/mm/mm1/game/leprechaun.cpp b/engines/mm/mm1/game/leprechaun.cpp
new file mode 100644
index 00000000000..0cdb0937ebe
--- /dev/null
+++ b/engines/mm/mm1/game/leprechaun.cpp
@@ -0,0 +1,67 @@
+/* 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/leprechaun.h"
+#include "mm/mm1/maps/map00.h"
+#include "mm/mm1/globals.h"
+
+#define TOWN_NUM 0x2fe
+#define LEPRECHAUN_MAP_ID1 0x2ff
+#define LEPRECHAUN_MAP_ID2 0x304
+#define LEPRECHAUN_MAP_X 0x309
+#define LEPRECHAUN_MAP_Y 0x30E
+
+namespace MM {
+namespace MM1 {
+namespace Game {
+
+void Leprechaun::teleportToTown(char townNum) {
+ Maps::Maps &maps = *g_maps;
+ Maps::Map00 &map = *static_cast<Maps::Map00 *>(g_maps->_currentMap);
+
+ map[TOWN_NUM] = townNum;
+
+ // Scan the party for someone with any gems
+ for (uint i = 0; i < g_globals->_party.size(); ++i) {
+ Character &c = g_globals->_party[i];
+ if (c._gems) {
+ c._gems--;
+
+ int townIndex = map[TOWN_NUM] - Common::KEYCODE_1;
+ maps._mapPos.x = map[LEPRECHAUN_MAP_X + townIndex];
+ maps._mapPos.y = map[LEPRECHAUN_MAP_Y + townIndex];
+ maps.changeMap(
+ map[LEPRECHAUN_MAP_ID1 + townIndex] |
+ (map[LEPRECHAUN_MAP_ID2 + townIndex] << 8),
+ 1);
+
+ g_events->redraw();
+ return;
+ }
+ }
+
+ maps._mapPos = Common::Point(8, 5);
+ map.updateGame();
+}
+
+} // namespace Game
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/game/leprechaun.h b/engines/mm/mm1/game/leprechaun.h
new file mode 100644
index 00000000000..5c89227ed1c
--- /dev/null
+++ b/engines/mm/mm1/game/leprechaun.h
@@ -0,0 +1,38 @@
+/* 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_LEPRECHAUN_H
+#define MM1_GAME_LEPRECHAUN_H
+
+namespace MM {
+namespace MM1 {
+namespace Game {
+
+class Leprechaun {
+public:
+ void teleportToTown(char townNum);
+};
+
+} // namespace Game
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/maps/map00.cpp b/engines/mm/mm1/maps/map00.cpp
index 3b60ca9455a..d694661e9fe 100644
--- a/engines/mm/mm1/maps/map00.cpp
+++ b/engines/mm/mm1/maps/map00.cpp
@@ -29,11 +29,6 @@ namespace MM {
namespace MM1 {
namespace Maps {
-#define TOWN_NUM 0x2fe
-#define LEPRECHAUN_MAP_ID1 0x2ff
-#define LEPRECHAUN_MAP_ID2 0x304
-#define LEPRECHAUN_MAP_X 0x309
-#define LEPRECHAUN_MAP_Y 0x30E
#define STATUE_VAL 0x412
void Map00::special() {
@@ -115,53 +110,7 @@ void Map00::special07() {
}
void Map00::special08() {
- SoundMessage msg(
- STRING["maps.map00.leprechaun"],
- [](const Common::KeyState &keyState) {
- Maps &maps = *g_maps;
- Map &map = *g_maps->_currentMap;
-
- switch (keyState.keycode) {
- case Common::KEYCODE_ESCAPE:
- maps.turnAround();
- g_events->focusedView()->close();
- break;
- case Common::KEYCODE_1:
- case Common::KEYCODE_2:
- case Common::KEYCODE_3:
- case Common::KEYCODE_4:
- case Common::KEYCODE_5:
- g_events->focusedView()->close();
- map[TOWN_NUM] = keyState.ascii;
-
- for (uint i = 0; i < g_globals->_party.size(); ++i) {
- Character &c = g_globals->_party[i];
- if (c._gems) {
- c._gems--;
-
- int townIndex = map[TOWN_NUM] - Common::KEYCODE_1;
- maps._mapPos.x = map[LEPRECHAUN_MAP_X + townIndex];
- maps._mapPos.y = map[LEPRECHAUN_MAP_Y + townIndex];
- maps.changeMap(
- map[LEPRECHAUN_MAP_ID1 + townIndex] |
- (map[LEPRECHAUN_MAP_ID2 + townIndex] << 8),
- 1);
-
- g_events->redraw();
- return;
- }
- }
-
- maps._mapPos = Common::Point(8, 5);
- break;
- default:
- break;
- }
- }
- );
-
- msg._largeMessage = true;
- send(msg);
+ g_events->addView("Leprechaun");
}
void Map00::special09() {
diff --git a/engines/mm/mm1/views/dialogs.h b/engines/mm/mm1/views/dialogs.h
index 787afdf0aa4..0f4427f4cb3 100644
--- a/engines/mm/mm1/views/dialogs.h
+++ b/engines/mm/mm1/views/dialogs.h
@@ -67,6 +67,7 @@
#include "mm/mm1/views/maps/ice_princess.h"
#include "mm/mm1/views/maps/inspectron.h"
#include "mm/mm1/views/maps/keeper.h"
+#include "mm/mm1/views/maps/leprechaun.h"
#include "mm/mm1/views/maps/lion.h"
#include "mm/mm1/views/maps/lord_archer.h"
#include "mm/mm1/views/maps/lord_ironfist.h"
@@ -142,6 +143,7 @@ private:
Views::Maps::IcePrincess _icePrincess;
Views::Maps::Inspectron _inspectron;
Views::Maps::Keeper _keeper;
+ Views::Maps::Leprechaun _leprechaun;
Views::Maps::Lion _lion;
Views::Maps::LordArcher _lordArcher;
Views::Maps::LordIronfist _lordIronfist;
diff --git a/engines/mm/mm1/views/maps/leprechaun.cpp b/engines/mm/mm1/views/maps/leprechaun.cpp
new file mode 100644
index 00000000000..f4f2b04d5aa
--- /dev/null
+++ b/engines/mm/mm1/views/maps/leprechaun.cpp
@@ -0,0 +1,67 @@
+/* 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/leprechaun.h"
+#include "mm/mm1/globals.h"
+
+namespace MM {
+namespace MM1 {
+namespace Views {
+namespace Maps {
+
+Leprechaun::Leprechaun() : TextView("Leprechaun") {
+ _bounds = getLineBounds(17, 24);
+}
+
+bool Leprechaun::msgFocus(const FocusMessage &msg) {
+ TextView::msgFocus(msg);
+ MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
+ return true;
+}
+
+void Leprechaun::draw() {
+ clearSurface();
+ writeString(0, 1, STRING["maps.map00.leprechaun"]);
+}
+
+bool Leprechaun::msgKeypress(const KeypressMessage &msg) {
+ if (msg.keycode >= Common::KEYCODE_1 && msg.keycode <= Common::KEYCODE_5) {
+ teleportToTown(msg.ascii);
+ return true;
+ }
+
+ return false;
+}
+
+bool Leprechaun::msgAction(const ActionMessage &msg) {
+ if (msg._action == KEYBIND_ESCAPE) {
+ close();
+ g_maps->turnAround();
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace Maps
+} // namespace Views
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views/maps/leprechaun.h b/engines/mm/mm1/views/maps/leprechaun.h
new file mode 100644
index 00000000000..267b26771f9
--- /dev/null
+++ b/engines/mm/mm1/views/maps/leprechaun.h
@@ -0,0 +1,52 @@
+/* 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_LEPRECHAUN_H
+#define MM1_VIEWS_MAPS_LEPRECHAUN_H
+
+#include "mm/mm1/views/text_view.h"
+#include "mm/mm1/game/leprechaun.h"
+
+namespace MM {
+namespace MM1 {
+namespace Views {
+namespace Maps {
+
+class Leprechaun : public TextView, public MM1::Game::Leprechaun {
+private:
+ void surrender(int numYears = 2);
+
+public:
+ Leprechaun();
+ virtual ~Leprechaun() {}
+
+ 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 6299c393370..0cf0af09c95 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -61,6 +61,7 @@
#include "mm/mm1/views_enh/interactions/giant.h"
#include "mm/mm1/views_enh/interactions/gypsy.h"
#include "mm/mm1/views_enh/interactions/ice_princess.h"
+#include "mm/mm1/views_enh/interactions/leprechaun.h"
#include "mm/mm1/views_enh/interactions/lion.h"
#include "mm/mm1/views_enh/interactions/prisoners.h"
#include "mm/mm1/views_enh/interactions/resistances.h"
@@ -91,6 +92,7 @@ private:
ViewsEnh::Interactions::Giant _giant;
ViewsEnh::Interactions::Gypsy _gypsy;
ViewsEnh::Interactions::IcePrincess _icePrincess;
+ ViewsEnh::Interactions::Leprechaun _leprechaun;
ViewsEnh::Interactions::Lion _lion;
ViewsEnh::Interactions::Resistances _resistances;
ViewsEnh::Interactions::Statue _statue;
diff --git a/engines/mm/mm1/views_enh/interactions/leprechaun.cpp b/engines/mm/mm1/views_enh/interactions/leprechaun.cpp
new file mode 100644
index 00000000000..4a9cf15f362
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/leprechaun.cpp
@@ -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/>.
+ *
+ */
+
+#include "mm/mm1/views_enh/interactions/leprechaun.h"
+#include "mm/mm1/globals.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Leprechaun::Leprechaun() : Interaction("Leprechaun", 15) {
+ _title = STRING["maps.emap00.leprechaun_title"];
+ addText(STRING["maps.emap00.leprechaun"]);
+ addButton(STRING["stats.towns.1"], '1');
+ addButton(STRING["stats.towns.2"], '2');
+ addButton(STRING["stats.towns.3"], '3');
+ addButton(STRING["stats.towns.4"], '4');
+ addButton(STRING["stats.towns.5"], '5');
+}
+
+bool Leprechaun::msgFocus(const FocusMessage &msg) {
+ Interaction::msgFocus(msg);
+ MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
+ return true;
+}
+
+bool Leprechaun::msgKeypress(const KeypressMessage &msg) {
+ if (msg.keycode >= Common::KEYCODE_1 && msg.keycode <= Common::KEYCODE_5) {
+ teleportToTown(msg.ascii);
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/leprechaun.h b/engines/mm/mm1/views_enh/interactions/leprechaun.h
new file mode 100644
index 00000000000..af961cc9bf1
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/leprechaun.h
@@ -0,0 +1,46 @@
+/* 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_LEPRECHAUN_H
+#define MM1_VIEWS_ENH_INTERACTIONS_LEPRECHAUN_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+#include "mm/mm1/game/leprechaun.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Leprechaun : public Interaction, MM1::Game::Leprechaun {
+public:
+ Leprechaun();
+ virtual ~Leprechaun() {}
+ bool msgFocus(const FocusMessage &msg) override;
+ 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 6abecad7af6..2543ef71bfe 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -42,6 +42,7 @@ MODULE_OBJS += \
mm1/game/combat.o \
mm1/game/encounter.o \
mm1/game/equip_remove.o \
+ mm1/game/leprechaun.o \
mm1/game/monster_touch.o \
mm1/game/rest.o \
mm1/game/spell_casting.o \
@@ -83,6 +84,7 @@ MODULE_OBJS += \
mm1/views/maps/ice_princess.o \
mm1/views/maps/inspectron.o \
mm1/views/maps/keeper.o \
+ mm1/views/maps/leprechaun.o \
mm1/views/maps/lion.o \
mm1/views/maps/lord_archer.o \
mm1/views/maps/lord_ironfist.o \
@@ -188,6 +190,7 @@ MODULE_OBJS += \
mm1/views_enh/interactions/ice_princess.o \
mm1/views_enh/interactions/interaction.o \
mm1/views_enh/interactions/interaction_query.o \
+ mm1/views_enh/interactions/leprechaun.o \
mm1/views_enh/interactions/lion.o \
mm1/views_enh/interactions/prisoners.o \
mm1/views_enh/interactions/resistances.o \
Commit: 1118cee35924691cb8000ee491222f6f2228f56d
https://github.com/scummvm/scummvm/commit/1118cee35924691cb8000ee491222f6f2228f56d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-11T22:03:12-07:00
Commit Message:
MM: MM1: Added map 35 Inspectron
Changed paths:
A engines/mm/mm1/views_enh/interactions/inspectron.cpp
A engines/mm/mm1/views_enh/interactions/inspectron.h
devtools/create_mm/files/mm1/strings_en.yml
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 c39a485b023..dd1c3e8371a 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1506,13 +1506,13 @@ maps:
exit: "Exit castle (Y/N)?"
merchant_pass: "Castle guards exclaim\n\"No merchants pass! Begone peasants.\""
quests:
- 0: "Find the ancient ruins in the\nquivering forest"
- 1: "Visit blithes peak, and report"
+ 0: "Find the ancient ruins in the\nQuivering Forest"
+ 1: "Visit Blithes Peak, and report"
2: "The people of the desert have much to\ntrade,bring me a sample of their goods"
- 3: "Find the shrine of okzar in the\ncaves below dusk"
- 4: "Find the fabled fountain in dragadune"
- 5: "Solve the riddle of the ruby"
- 6: "Defeat the stronghold\nin the enchanted forest"
+ 3: "Find the Shrine of Okzar in the\ncaves below dusk"
+ 4: "Find the Fabled Fountain in Dragadune"
+ 5: "Solve the Riddle of the Ruby"
+ 6: "Defeat the stronghold\nin the Enchanted Forest"
inspectron1: "Lord inspectron speaks:\n"
inspectron2: "\"Your services are needed!\"Accept (Y/N)?"
inspectron3: "\"Return not until thy quest is complete\""
@@ -1521,6 +1521,11 @@ maps:
message: "Etched in silver, message a reads:\natis-19-31ud54aeupi1"
slide: "A slide!"
vault: "Empty vault, alarm!"
+ emap35:
+ inspectron_title: "Lord Inspectron"
+ inspectron2: "\"Your services are needed!\" Accept (Y/N)?"
+ accept: "Accept"
+ decline: "Decline"
map36:
exit: "Exit castle, (Y/N)?"
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 0cf0af09c95..bf74fd491dc 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -61,6 +61,7 @@
#include "mm/mm1/views_enh/interactions/giant.h"
#include "mm/mm1/views_enh/interactions/gypsy.h"
#include "mm/mm1/views_enh/interactions/ice_princess.h"
+#include "mm/mm1/views_enh/interactions/inspectron.h"
#include "mm/mm1/views_enh/interactions/leprechaun.h"
#include "mm/mm1/views_enh/interactions/lion.h"
#include "mm/mm1/views_enh/interactions/prisoners.h"
@@ -92,6 +93,7 @@ private:
ViewsEnh::Interactions::Giant _giant;
ViewsEnh::Interactions::Gypsy _gypsy;
ViewsEnh::Interactions::IcePrincess _icePrincess;
+ ViewsEnh::Interactions::Inspectron _inspectron;
ViewsEnh::Interactions::Leprechaun _leprechaun;
ViewsEnh::Interactions::Lion _lion;
ViewsEnh::Interactions::Resistances _resistances;
diff --git a/engines/mm/mm1/views_enh/interactions/inspectron.cpp b/engines/mm/mm1/views_enh/interactions/inspectron.cpp
new file mode 100644
index 00000000000..8cd9f057e50
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/inspectron.cpp
@@ -0,0 +1,107 @@
+/* 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/inspectron.h"
+#include "mm/mm1/maps/map35.h"
+#include "mm/mm1/globals.h"
+#include "mm/mm1/sound.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Inspectron::Inspectron() : Interaction("Inspectron", 18) {
+ _title = STRING["maps.emap35.inspectron_title"];
+}
+
+bool Inspectron::msgFocus(const FocusMessage &msg) {
+ Interaction::msgFocus(msg);
+ return true;
+}
+
+bool Inspectron::msgGame(const GameMessage &msg) {
+ if (msg._name != "DISPLAY")
+ return false;
+
+ g_globals->_currCharacter = &g_globals->_party[0];
+ _mode = g_globals->_currCharacter->_quest ? ACTIVE_QUEST : CAN_ACCEPT;
+
+ if (_mode == CAN_ACCEPT)
+ Sound::sound(SOUND_2);
+ addView();
+ clearButtons();
+
+ if (_mode == CAN_ACCEPT) {
+ addText(STRING["maps.map35.inspectron2"]);
+ addButton(STRING["maps.emap35.accept"], 'Y');
+ addButton(STRING["maps.emap35.decline"], 'N');
+
+ } else {
+ // There's an active quest, so check for completion
+ MM1::Maps::Map35 &map = *static_cast<MM1::Maps::Map35 *>(g_maps->_currentMap);
+ int questNum = g_globals->_party[0]._quest;
+ Common::String line;
+
+ if (questNum >= 8 && questNum <= 14)
+ line = map.checkQuestComplete();
+ else
+ line = STRING["maps.map35.inspectron4"];
+
+ g_maps->_mapPos.y++;
+ map.redrawGame();
+
+ addText(line);
+ }
+
+ return true;
+}
+
+bool Inspectron::msgKeypress(const KeypressMessage &msg) {
+ MM1::Maps::Map35 &map = *static_cast<MM1::Maps::Map35 *>(g_maps->_currentMap);
+
+ if (_mode == CAN_ACCEPT) {
+ if (msg.keycode == Common::KEYCODE_y) {
+ map.acceptQuest();
+ _mode = ACCEPTED_QUEST;
+
+ clearButtons();
+ addText(STRING[Common::String::format(
+ "maps.map35.quests.%d",
+ g_globals->_party[0]._quest - 8
+ )]);
+
+ redraw();
+ return true;
+
+ } else if (msg.keycode == Common::KEYCODE_n) {
+ close();
+ return true;
+ }
+ }
+
+ return false;
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/inspectron.h b/engines/mm/mm1/views_enh/interactions/inspectron.h
new file mode 100644
index 00000000000..756832005eb
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/inspectron.h
@@ -0,0 +1,52 @@
+/* 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_INSPECTRON_H
+#define MM1_VIEWS_ENH_INTERACTIONS_INSPECTRON_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+#include "mm/mm1/data/character.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Inspectron : public Interaction {
+private:
+ enum Mode { CAN_ACCEPT, ACTIVE_QUEST, ACCEPTED_QUEST };
+ Mode _mode = CAN_ACCEPT;
+
+public:
+ Inspectron();
+ virtual ~Inspectron() {}
+
+ bool msgGame(const GameMessage &msg) override;
+ bool msgFocus(const FocusMessage &msg) override;
+ 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 2543ef71bfe..4ccf32b8b2a 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -188,6 +188,7 @@ MODULE_OBJS += \
mm1/views_enh/interactions/giant.o \
mm1/views_enh/interactions/gypsy.o \
mm1/views_enh/interactions/ice_princess.o \
+ mm1/views_enh/interactions/inspectron.o \
mm1/views_enh/interactions/interaction.o \
mm1/views_enh/interactions/interaction_query.o \
mm1/views_enh/interactions/leprechaun.o \
Commit: 6ca717b49d6828e8d98831dfcc84b8df28502944
https://github.com/scummvm/scummvm/commit/6ca717b49d6828e8d98831dfcc84b8df28502944
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-11T22:03:13-07:00
Commit Message:
MM: MM1: Map 36 fixes, added Lord Hacker view
Changed paths:
A engines/mm/mm1/views_enh/interactions/hacker.cpp
A engines/mm/mm1/views_enh/interactions/hacker.h
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/maps/map36.cpp
engines/mm/mm1/views/maps/hacker.cpp
engines/mm/mm1/views_enh/dialogs.h
engines/mm/mm1/views_enh/interactions/inspectron.cpp
engines/mm/mm1/views_enh/interactions/prisoners.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 dd1c3e8371a..fc8d021cd25 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -946,6 +946,8 @@ maps:
tavern_inside: "Step up to the bar (Y/N)?"
passage_outside1: "A passage leads outside, take it (Y/N)?"
passage_outside2: "Passage outside, exit (Y/N)?"
+ accept: "Accept"
+ decline: "Decline"
desert:
its_hot: "It's hot... "
@@ -1524,11 +1526,9 @@ maps:
emap35:
inspectron_title: "Lord Inspectron"
inspectron2: "\"Your services are needed!\" Accept (Y/N)?"
- accept: "Accept"
- decline: "Decline"
map36:
- exit: "Exit castle, (Y/N)?"
+ exit: "Exit castle (Y/N)?"
begone: "Castle guards exclaim,\"Begone peasants!\""
slide: "Slide!"
pit: "The pit of peril..."
@@ -1543,12 +1543,17 @@ maps:
6: "the ring of okirm"
hacker1: "Lord hacker speaks:\n"
hacker2: "\"Your services are needed!\"Accept (Y/N)?"
- hacker3: "Bring me "
+ hacker3: "Bring me"
hacker4: "\"Sorry, you're already quested.\""
hacker5: "\"Return not until thy quest is complete\"\n(leader should present items)"
hacker6: "Well done, quest complete! +%u exp"
hacker7: "My brew is complete, guards take their\nitems and send them to the pit!"
message: "Etched in silver, message C reads:\niaci1;-2;0nu--g,not2"
+ emap36:
+ hacker_title: "Lord Hacker"
+ begone: "Castle guards exclaim, \"Begone peasants!\""
+ hacker2: "\"Your services are needed!\" Accept (Y/N)?"
+ hacker7: "My brew is complete. Guards take their items and send them to the pit!"
map37:
message1: "Etched in gold, message 1 reads:\nCompletion-must-each-kings-of-astral-\nwith-9th-sanctum-and-wondrous"
diff --git a/engines/mm/mm1/maps/map36.cpp b/engines/mm/mm1/maps/map36.cpp
index c793b944ecc..b8813deb2a4 100644
--- a/engines/mm/mm1/maps/map36.cpp
+++ b/engines/mm/mm1/maps/map36.cpp
@@ -79,9 +79,9 @@ void Map36::special01() {
void Map36::special02() {
visitedExit();
- send(SoundMessage(STRING["maps.map36.slide"]));
g_maps->_mapPos = Common::Point(12, 2);
g_maps->changeMap(0xa00, 2);
+ send(SoundMessage(STRING["maps.map36.slide"]));
}
void Map36::special03() {
@@ -90,9 +90,9 @@ void Map36::special03() {
void Map36::special04() {
if (!g_globals->_party.hasItem(MERCHANTS_PASS_ID)) {
- send(SoundMessage(STRING["maps.map36.begone"]));
g_maps->_mapPos.x--;
updateGame();
+ send(SoundMessage(STRING["maps.map36.begone"]));
}
}
@@ -105,9 +105,9 @@ void Map36::special05() {
void Map36::special06() {
visitedExit();
- send(SoundMessage(STRING["maps.map36.pit"]));
g_maps->_mapPos = Common::Point(7, 4);
g_maps->changeMap(0x705, 3);
+ send(SoundMessage(STRING["maps.map36.pit"]));
}
void Map36::special07() {
diff --git a/engines/mm/mm1/views/maps/hacker.cpp b/engines/mm/mm1/views/maps/hacker.cpp
index a6e8202ff08..fe3ebabd2b8 100644
--- a/engines/mm/mm1/views/maps/hacker.cpp
+++ b/engines/mm/mm1/views/maps/hacker.cpp
@@ -82,11 +82,16 @@ bool Hacker::msgKeypress(const KeypressMessage &msg) {
Character &c = g_globals->_party[0];
if (c._quest) {
+ Common::String line = Common::String::format("%s %s",
+ STRING["maps.map36.hacker3."].c_str(),
+ STRING[Common::String::format(
+ "maps.map36.ingredients.%d",
+ g_globals->_party[0]._quest - 15)].c_str()
+ );
+
send(InfoMessage(
0, 1, STRING["maps.map36.hacker1"],
- 0, 2, STRING[Common::String::format(
- "maps.map36.ingredients.%d",
- g_globals->_party[0]._quest - 15)]
+ 0, 2, line
));
}
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index bf74fd491dc..800a0cfd9d4 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -60,6 +60,7 @@
#include "mm/mm1/views_enh/interactions/chess.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"
#include "mm/mm1/views_enh/interactions/ice_princess.h"
#include "mm/mm1/views_enh/interactions/inspectron.h"
#include "mm/mm1/views_enh/interactions/leprechaun.h"
@@ -92,6 +93,7 @@ private:
ViewsEnh::Interactions::Chess _chess;
ViewsEnh::Interactions::Giant _giant;
ViewsEnh::Interactions::Gypsy _gypsy;
+ ViewsEnh::Interactions::Hacker _hacker;
ViewsEnh::Interactions::IcePrincess _icePrincess;
ViewsEnh::Interactions::Inspectron _inspectron;
ViewsEnh::Interactions::Leprechaun _leprechaun;
diff --git a/engines/mm/mm1/views_enh/interactions/hacker.cpp b/engines/mm/mm1/views_enh/interactions/hacker.cpp
new file mode 100644
index 00000000000..583985251e9
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/hacker.cpp
@@ -0,0 +1,110 @@
+/* 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/hacker.h"
+#include "mm/mm1/maps/map36.h"
+#include "mm/mm1/globals.h"
+#include "mm/mm1/sound.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Hacker::Hacker() : Interaction("Hacker", 35) {
+ _title = STRING["maps.emap36.hacker_title"];
+}
+
+bool Hacker::msgFocus(const FocusMessage &msg) {
+ Interaction::msgFocus(msg);
+ return true;
+}
+
+bool Hacker::msgGame(const GameMessage &msg) {
+ if (msg._name != "DISPLAY")
+ return false;
+
+ g_globals->_currCharacter = &g_globals->_party[0];
+ _mode = g_globals->_currCharacter->_quest ? ACTIVE_QUEST : CAN_ACCEPT;
+
+ if (_mode == CAN_ACCEPT)
+ Sound::sound(SOUND_2);
+ addView();
+ clearButtons();
+
+ if (_mode == CAN_ACCEPT) {
+ addText(STRING["maps.map36.hacker2"]);
+ addButton(STRING["maps.accept"], 'Y');
+ addButton(STRING["maps.decline"], 'N');
+
+ } else {
+ // There's an active quest, so check for completion
+ MM1::Maps::Map36 &map = *static_cast<MM1::Maps::Map36 *>(g_maps->_currentMap);
+ int questNum = g_globals->_party[0]._quest;
+ Common::String line;
+
+ if (questNum >= 8 && questNum <= 14)
+ line = map.checkQuestComplete();
+ else
+ line = STRING["maps.map36.hacker4"];
+
+ g_maps->_mapPos.y++;
+ map.redrawGame();
+
+ addText(line);
+ }
+
+ return true;
+}
+
+bool Hacker::msgKeypress(const KeypressMessage &msg) {
+ MM1::Maps::Map36 &map = *static_cast<MM1::Maps::Map36 *>(g_maps->_currentMap);
+
+ if (_mode == CAN_ACCEPT) {
+ if (msg.keycode == Common::KEYCODE_y) {
+ map.acceptQuest();
+ _mode = ACCEPTED_QUEST;
+
+ clearButtons();
+ Common::String line = Common::String::format("%s %s",
+ STRING["maps.map36.hacker3"].c_str(),
+ STRING[Common::String::format(
+ "maps.map36.ingredients.%d",
+ g_globals->_party[0]._quest - 15)].c_str()
+ );
+ addText(line);
+
+ redraw();
+ return true;
+
+ } else if (msg.keycode == Common::KEYCODE_n) {
+ close();
+ return true;
+ }
+ }
+
+ return false;
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/hacker.h b/engines/mm/mm1/views_enh/interactions/hacker.h
new file mode 100644
index 00000000000..54cf3061827
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/hacker.h
@@ -0,0 +1,52 @@
+/* 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_HACKER_H
+#define MM1_VIEWS_ENH_INTERACTIONS_HACKER_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+#include "mm/mm1/data/character.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Hacker : public Interaction {
+private:
+ enum Mode { CAN_ACCEPT, ACTIVE_QUEST, ACCEPTED_QUEST };
+ Mode _mode = CAN_ACCEPT;
+
+public:
+ Hacker();
+ virtual ~Hacker() {}
+
+ bool msgGame(const GameMessage &msg) override;
+ bool msgFocus(const FocusMessage &msg) override;
+ bool msgKeypress(const KeypressMessage &msg) override;
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/views_enh/interactions/inspectron.cpp b/engines/mm/mm1/views_enh/interactions/inspectron.cpp
index 8cd9f057e50..6e8eb74848d 100644
--- a/engines/mm/mm1/views_enh/interactions/inspectron.cpp
+++ b/engines/mm/mm1/views_enh/interactions/inspectron.cpp
@@ -52,8 +52,8 @@ bool Inspectron::msgGame(const GameMessage &msg) {
if (_mode == CAN_ACCEPT) {
addText(STRING["maps.map35.inspectron2"]);
- addButton(STRING["maps.emap35.accept"], 'Y');
- addButton(STRING["maps.emap35.decline"], 'N');
+ addButton(STRING["maps.accept"], 'Y');
+ addButton(STRING["maps.decline"], 'N');
} else {
// There's an active quest, so check for completion
diff --git a/engines/mm/mm1/views_enh/interactions/prisoners.cpp b/engines/mm/mm1/views_enh/interactions/prisoners.cpp
index 7740706cc19..4cbd07ed63c 100644
--- a/engines/mm/mm1/views_enh/interactions/prisoners.cpp
+++ b/engines/mm/mm1/views_enh/interactions/prisoners.cpp
@@ -119,8 +119,9 @@ ManPrisoner::ManPrisoner() :
}
CloakedPrisoner::CloakedPrisoner() :
- Prisoner("CloakedPrisoner", 1, STRING["maps.prisoners.cloaked"],
+ Prisoner("CloakedPrisoner", 16, STRING["maps.prisoners.cloaked"],
CHARFLAG1_40, EVIL, GOOD) {
+ _animated = false;
}
DemonPrisoner::DemonPrisoner() :
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index 4ccf32b8b2a..dad70ac149d 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -187,6 +187,7 @@ MODULE_OBJS += \
mm1/views_enh/interactions/chess.o \
mm1/views_enh/interactions/giant.o \
mm1/views_enh/interactions/gypsy.o \
+ mm1/views_enh/interactions/hacker.o \
mm1/views_enh/interactions/ice_princess.o \
mm1/views_enh/interactions/inspectron.o \
mm1/views_enh/interactions/interaction.o \
More information about the Scummvm-git-logs
mailing list