MM: MM1: Added WonGame view

This commit is contained in:
Paul Gilbert 2023-04-08 20:39:24 -07:00
parent e4a3d240a8
commit 38d26b8c81
8 changed files with 121 additions and 11 deletions

View File

@ -1250,14 +1250,19 @@ maps:
map18:
passage: "Cavernous passage to Erliquin,\ntake it (Y/N)?"
cave: "A cave, enter (Y/N)?"
castle_north: "Castle blackridge north, enter (Y/N)?"
castle_south: "Castle blackridge south, enter (Y/N)?"
castle_north: "Castle Blackridge North, enter (Y/N)?"
castle_south: "Castle Blackridge South, enter (Y/N)?"
ruins: "Ancient ruins of a deserted wizards lair\nshow signs of recent use, enter (Y/N)?"
gates: "The gates to another world!\n"
congratulations: "Congratulations distinguished \ntravelers! The gates are now\nopen to you, in order to pass\nthrough you must first find\n<ight and Magic Book Two !!!"
gates: "The Gates to Another World!\n"
congratulations: "Congratulations distinguished \ntravelers! The gates are now\nopen to you, in order to pass\nthrough you must first find\nMight and Magic Book Two !!!"
sign1: "A sign pointing S. reads: Blackridge N."
sign2: "A sign pointing E. reads: Blackridge S."
sign3: "A sign pointing E. reads: Erliquin"
emap18:
ruins: "Ancient ruins of a deserted wizard's lair show signs of recent use, enter (Y/N)?"
sign1: "A sign pointing S. reads:\nBlackridge N."
sign2: "A sign pointing E. reads:\nBlackridge S."
congratulations: "Congratulations distinguished \ntravelers! The gates are now\nopen to you. In order to pass\nthrough you must first find\nMight and Magic Book Two !!!"
map19:
ice_princess: "An a throne adorned with precious gems\nthe ice princess speaks,\n\"Conqueror of worlds, maker of dreams\nThe greatest force of all, yet elusive\nit seems.\"\n\nAnswer:> "

View File

@ -140,19 +140,16 @@ void Map18::special06() {
}
void Map18::special07() {
send(SoundMessage(STRING["maps.map18.gates"]));
bool hasWonGame = false;
for (uint i = 0; i < g_globals->_party.size(); ++i) {
Character &c = g_globals->_party[i];
g_globals->_currCharacter = &c;
if (c._flags[13] & CHARFLAG13_80)
hasWonGame = true;
const Character &c = g_globals->_party[i];
hasWonGame |= (c._flags[13] & CHARFLAG13_80) != 0;
}
if (hasWonGame)
g_events->addView("WonGame");
else
send(SoundMessage(STRING["maps.map18.gates"]));
}
void Map18::special08() {

View File

@ -36,6 +36,7 @@ WonGame::WonGame() : TextView("WonGame") {
void WonGame::draw() {
clearSurface();
writeString(0, 0, STRING["maps.map18.gates"]);
writeString(0, 1, STRING["maps.map18.congratulations"]);
Sound::sound(SOUND_3);
}
@ -45,6 +46,11 @@ bool WonGame::msgKeypress(const KeypressMessage &msg) {
return true;
}
bool WonGame::msgAction(const ActionMessage &msg) {
close();
return true;
}
} // namespace Maps
} // namespace Views
} // namespace MM1

View File

@ -36,6 +36,7 @@ public:
void draw() override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
};
} // namespace Maps

View File

@ -52,6 +52,7 @@
#include "mm/mm1/views_enh/which_character.h"
#include "mm/mm1/views_enh/which_item.h"
#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/arrested.h"
#include "mm/mm1/views_enh/interactions/prisoners.h"
@ -125,6 +126,7 @@ private:
ViewsEnh::WhichCharacter _whichCharacter;
ViewsEnh::WhichItem _whichItem;
ViewsEnh::WhoWillTry _whoWillTry;
ViewsEnh::WonGame _wonGame;
Views::Bash _bash;
public:
Dialogs() {}

View File

@ -0,0 +1,53 @@
/* 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/won_game.h"
#include "mm/mm1/globals.h"
#include "mm/mm1/sound.h"
namespace MM {
namespace MM1 {
namespace ViewsEnh {
WonGame::WonGame() : ScrollView("WonGame") {
setBounds(Common::Rect(0, 0, 234, 144));
}
void WonGame::draw() {
ScrollView::draw();
writeLine(0, STRING["maps.map18.gates"], ALIGN_MIDDLE);
writeLine(1, STRING["maps.map18.congratulations"], ALIGN_MIDDLE);
Sound::sound(SOUND_3);
}
bool WonGame::msgKeypress(const KeypressMessage &msg) {
close();
return true;
}
bool WonGame::msgAction(const ActionMessage &msg) {
close();
return true;
}
} // namespace ViewsEnh
} // namespace MM1
} // namespace MM

View File

@ -0,0 +1,45 @@
/* 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_WON_GAME_H
#define MM1_VIEWS_ENH_WON_GAME_H
#include "mm/mm1/views_enh/scroll_view.h"
namespace MM {
namespace MM1 {
namespace ViewsEnh {
class WonGame : public ScrollView {
public:
WonGame();
virtual ~WonGame() {}
void draw() override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
};
} // namespace ViewsEnh
} // namespace MM1
} // namespace MM
#endif

View File

@ -174,6 +174,7 @@ MODULE_OBJS += \
mm1/views_enh/which_character.o \
mm1/views_enh/which_item.o \
mm1/views_enh/who_will_try.o \
mm1/views_enh/won_game.o \
mm1/views_enh/yes_no.o \
mm1/views_enh/interactions/access_code.o \
mm1/views_enh/interactions/arrested.o \