Initial commit
This commit is contained in:
51
engines/mm/mm1/views/interactions/access_code.cpp
Normal file
51
engines/mm/mm1/views/interactions/access_code.cpp
Normal file
@@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mm/mm1/views/interactions/access_code.h"
|
||||
#include "mm/mm1/maps/map08.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
AccessCode::AccessCode() :
|
||||
AnswerEntry("AccessCode", Common::Point(16, 3), 8) {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
void AccessCode::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map08.enter_code"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void AccessCode::answerEntered() {
|
||||
MM1::Maps::Map08 &map = *static_cast<MM1::Maps::Map08 *>(g_maps->_currentMap);
|
||||
map.codeEntered(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
50
engines/mm/mm1/views/interactions/access_code.h
Normal file
50
engines/mm/mm1/views/interactions/access_code.h
Normal file
@@ -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_MAPS_ACCESS_CODE_H
|
||||
#define MM1_VIEWS_MAPS_ACCESS_CODE_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class AccessCode : public AnswerEntry {
|
||||
protected:
|
||||
/**
|
||||
* Called when the code has been entered
|
||||
*/
|
||||
void answerEntered() override;
|
||||
public:
|
||||
AccessCode();
|
||||
virtual ~AccessCode() {}
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
101
engines/mm/mm1/views/interactions/alamar.cpp
Normal file
101
engines/mm/mm1/views/interactions/alamar.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/* 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/interactions/alamar.h"
|
||||
#include "mm/mm1/maps/map49.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
#define VAL1 952
|
||||
#define HAS_EYE 154
|
||||
|
||||
Alamar::Alamar() : TextView("Alamar") {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
bool Alamar::msgFocus(const FocusMessage &msg) {
|
||||
MM1::Maps::Map49 &map = *static_cast<MM1::Maps::Map49 *>(g_maps->_currentMap);
|
||||
|
||||
_succeeded = false;
|
||||
for (uint i = 0; i < g_globals->_party.size() && !_succeeded; ++i)
|
||||
_succeeded = (g_globals->_party[i]._flags[13] & CHARFLAG13_ALAMAR) != 0;
|
||||
map[HAS_EYE] = g_globals->_party.hasItem(EYE_OF_GOROS_ID) ? 1 : 0;
|
||||
|
||||
if (!_succeeded && !map[HAS_EYE]) {
|
||||
for (uint i = 0; i < g_globals->_party.size() && !_succeeded; ++i)
|
||||
g_globals->_party[i]._quest = 255;
|
||||
}
|
||||
|
||||
Sound::sound(SOUND_2);
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void Alamar::draw() {
|
||||
MM1::Maps::Map49 &map = *static_cast<MM1::Maps::Map49 *>(g_maps->_currentMap);
|
||||
clearSurface();
|
||||
|
||||
if (_succeeded) {
|
||||
writeString(0, 0, STRING["maps.map49.alamar1"]);
|
||||
writeString(STRING["maps.map49.alamar3"]);
|
||||
|
||||
} else if (map[HAS_EYE]) {
|
||||
send("View", DrawGraphicMessage(65 + 7));
|
||||
send("View", DrawGraphicMessage(65 + 8));
|
||||
|
||||
writeString(0, 0, STRING["maps.map49.alamar1"]);
|
||||
writeString(STRING["maps.map49.alamar4"]);
|
||||
|
||||
for (int i = 0; i < 6; ++i)
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
} else {
|
||||
writeString(0, 0, STRING["maps.map49.alamar1"]);
|
||||
writeString(STRING["maps.map49.alamar2"]);
|
||||
}
|
||||
}
|
||||
|
||||
bool Alamar::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map49 &map = *static_cast<MM1::Maps::Map49 *>(g_maps->_currentMap);
|
||||
close();
|
||||
|
||||
if (map[HAS_EYE]) {
|
||||
map[VAL1]++;
|
||||
map.updateGame();
|
||||
|
||||
} else {
|
||||
g_maps->_mapPos.x = 8;
|
||||
map.updateGame();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/alamar.h
Normal file
49
engines/mm/mm1/views/interactions/alamar.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_ALAMAR_H
|
||||
#define MM1_VIEWS_MAPS_ALAMAR_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Alamar : public TextView {
|
||||
private:
|
||||
bool _succeeded = false;
|
||||
public:
|
||||
Alamar();
|
||||
virtual ~Alamar() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
67
engines/mm/mm1/views/interactions/alien.cpp
Normal file
67
engines/mm/mm1/views/interactions/alien.cpp
Normal file
@@ -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/interactions/alien.h"
|
||||
#include "mm/mm1/maps/map31.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Alien::Alien() : TextView("Alien") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
void Alien::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map31.alien"]);
|
||||
}
|
||||
|
||||
bool Alien::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map31 &map = *static_cast<MM1::Maps::Map31 *>(
|
||||
g_maps->_currentMap);
|
||||
|
||||
switch (msg.keycode) {
|
||||
case Common::KEYCODE_a:
|
||||
close();
|
||||
map.hostile();
|
||||
break;
|
||||
case Common::KEYCODE_b:
|
||||
close();
|
||||
map.neutral();
|
||||
break;
|
||||
case Common::KEYCODE_c:
|
||||
close();
|
||||
map.friendly();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
46
engines/mm/mm1/views/interactions/alien.h
Normal file
46
engines/mm/mm1/views/interactions/alien.h
Normal file
@@ -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_MAPS_ALIEN_H
|
||||
#define MM1_VIEWS_MAPS_ALIEN_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Alien : public TextView {
|
||||
public:
|
||||
Alien();
|
||||
virtual ~Alien() {}
|
||||
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
80
engines/mm/mm1/views/interactions/answer_entry.cpp
Normal file
80
engines/mm/mm1/views/interactions/answer_entry.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
/* 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/interactions/answer_entry.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
AnswerEntry::AnswerEntry(const Common::String &name,
|
||||
const Common::Point &pos, size_t maxLength) :
|
||||
TextView(name), _pos(pos), _maxLength(maxLength) {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool AnswerEntry::msgFocus(const FocusMessage &msg) {
|
||||
TextView::msgFocus(msg);
|
||||
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MINIMAL);
|
||||
Sound::sound(SOUND_2);
|
||||
_answer = "";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AnswerEntry::draw() {
|
||||
writeString(_pos.x, _pos.y, _answer);
|
||||
for (uint i = 0; i < (_maxLength - _answer.size()); ++i)
|
||||
writeChar(_blank);
|
||||
}
|
||||
|
||||
bool AnswerEntry::msgKeypress(const KeypressMessage &msg) {
|
||||
if (!isDelayActive()) {
|
||||
if (msg.keycode == Common::KEYCODE_RETURN) {
|
||||
answerEntered();
|
||||
return true;
|
||||
|
||||
} else if (msg.keycode == Common::KEYCODE_SPACE ||
|
||||
(msg.keycode >= Common::KEYCODE_0 &&
|
||||
msg.keycode <= Common::KEYCODE_z)) {
|
||||
_answer += toupper(msg.ascii);
|
||||
redraw();
|
||||
|
||||
if (_answer.size() == _maxLength)
|
||||
answerEntered();
|
||||
|
||||
} else if (msg.keycode == Common::KEYCODE_BACKSPACE && !_answer.empty()) {
|
||||
_answer.deleteLastChar();
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
60
engines/mm/mm1/views/interactions/answer_entry.h
Normal file
60
engines/mm/mm1/views/interactions/answer_entry.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/* 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_ANSWER_ENTRY_H
|
||||
#define MM1_VIEWS_MAPS_ANSWER_ENTRY_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class AnswerEntry : public TextView {
|
||||
private:
|
||||
Common::Point _pos;
|
||||
size_t _maxLength;
|
||||
char _blank = '.';
|
||||
protected:
|
||||
Common::String _answer;
|
||||
|
||||
/**
|
||||
* Called when Enter pressed, or maximum length reached
|
||||
*/
|
||||
virtual void answerEntered() = 0;
|
||||
|
||||
public:
|
||||
AnswerEntry(const Common::String &name,
|
||||
const Common::Point &pos, size_t maxLength);
|
||||
virtual ~AnswerEntry() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
98
engines/mm/mm1/views/interactions/arenko.cpp
Normal file
98
engines/mm/mm1/views/interactions/arenko.cpp
Normal file
@@ -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/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 Views {
|
||||
namespace Interactions {
|
||||
|
||||
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 Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
51
engines/mm/mm1/views/interactions/arenko.h
Normal file
51
engines/mm/mm1/views/interactions/arenko.h
Normal file
@@ -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 Interactions {
|
||||
|
||||
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 Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
86
engines/mm/mm1/views/interactions/arrested.cpp
Normal file
86
engines/mm/mm1/views/interactions/arrested.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/* 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/interactions/arrested.h"
|
||||
#include "mm/mm1/maps/map04.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Arrested::Arrested() : TextView("Arrested") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Arrested::msgFocus(const FocusMessage &msg) {
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void Arrested::draw() {
|
||||
clearSurface();
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
writeString(0, 1, STRING["maps.map04.guards"]);
|
||||
}
|
||||
|
||||
bool Arrested::msgKeypress(const KeypressMessage &msg) {
|
||||
if (endDelay())
|
||||
return true;
|
||||
|
||||
switch (msg.keycode) {
|
||||
case Common::KEYCODE_a:
|
||||
attack();
|
||||
break;
|
||||
case Common::KEYCODE_b:
|
||||
bribe();
|
||||
break;
|
||||
case Common::KEYCODE_c:
|
||||
run();
|
||||
break;
|
||||
case Common::KEYCODE_d:
|
||||
surrender();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Arrested::surrender(int numYears) {
|
||||
Game::Arrested::surrender(numYears);
|
||||
|
||||
// Display sentence
|
||||
clearSurface();
|
||||
Sound::sound(SOUND_2);
|
||||
writeString(0, 1, STRING["maps.map04.sentence"]);
|
||||
writeNumber(numYears);
|
||||
|
||||
delaySeconds(3);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
51
engines/mm/mm1/views/interactions/arrested.h
Normal file
51
engines/mm/mm1/views/interactions/arrested.h
Normal file
@@ -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_ARRESTED_H
|
||||
#define MM1_VIEWS_MAPS_ARRESTED_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
#include "mm/mm1/game/arrested.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Arrested : public TextView, public MM1::Game::Arrested {
|
||||
private:
|
||||
void surrender(int numYears = 2);
|
||||
|
||||
public:
|
||||
Arrested();
|
||||
virtual ~Arrested() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
58
engines/mm/mm1/views/interactions/chess.cpp
Normal file
58
engines/mm/mm1/views/interactions/chess.cpp
Normal file
@@ -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/interactions/chess.h"
|
||||
#include "mm/mm1/maps/map29.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Chess::Chess() :
|
||||
AnswerEntry("Chess", Common::Point(10, 6), 23) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
bool Chess::msgFocus(const FocusMessage &msg) {
|
||||
Sound::sound(SOUND_3);
|
||||
return AnswerEntry::msgFocus(msg);
|
||||
}
|
||||
|
||||
void Chess::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 0, STRING["maps.map29.chess"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void Chess::answerEntered() {
|
||||
MM1::Maps::Map29 &map = *static_cast<MM1::Maps::Map29 *>(g_maps->_currentMap);
|
||||
clearSurface();
|
||||
close();
|
||||
map.chessAnswer(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/chess.h
Normal file
49
engines/mm/mm1/views/interactions/chess.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_CHESS_H
|
||||
#define MM1_VIEWS_MAPS_CHESS_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Chess : public AnswerEntry {
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
Chess();
|
||||
virtual ~Chess() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
98
engines/mm/mm1/views/interactions/dog_statue.cpp
Normal file
98
engines/mm/mm1/views/interactions/dog_statue.cpp
Normal file
@@ -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/interactions/dog_statue.h"
|
||||
#include "mm/mm1/maps/map42.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
DogStatue::DogStatue() : TextView("DogStatue") {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
bool DogStatue::msgFocus(const FocusMessage &msg) {
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
_completedQuests = false;
|
||||
for (uint i = 0; i < g_globals->_party.size(); ++i) {
|
||||
if ((g_globals->_party[i]._flags[0] &
|
||||
(CHARFLAG0_COURIER3 | CHARFLAG0_FOUND_CHEST | CHARFLAG0_40)) ==
|
||||
(CHARFLAG0_COURIER3 | CHARFLAG0_FOUND_CHEST | CHARFLAG0_40)) {
|
||||
_completedQuests = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void DogStatue::draw() {
|
||||
MM1::Maps::Map42 &map = *static_cast<MM1::Maps::Map42 *>(g_maps->_currentMap);
|
||||
|
||||
clearSurface();
|
||||
writeString(0, 0, STRING["maps.map42.statue1"]);
|
||||
|
||||
if (_completedQuests) {
|
||||
writeString(0, 2, STRING["maps.map42.statue2"]);
|
||||
map.dogSuccess();
|
||||
|
||||
} else {
|
||||
writeString(0, 3, STRING["maps.map42.statue3"]);
|
||||
}
|
||||
}
|
||||
|
||||
bool DogStatue::msgKeypress(const KeypressMessage &msg) {
|
||||
if (msg.keycode == Common::KEYCODE_y || msg.keycode == Common::KEYCODE_n) {
|
||||
MM1::Maps::Map42 &map = *static_cast<MM1::Maps::Map42 *>(g_maps->_currentMap);
|
||||
close();
|
||||
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
map.dogDesecrate();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DogStatue::msgAction(const ActionMessage &msg) {
|
||||
if (msg._action == KEYBIND_ESCAPE || msg._action == KEYBIND_SELECT) {
|
||||
MM1::Maps::Map42 &map = *static_cast<MM1::Maps::Map42 *>(g_maps->_currentMap);
|
||||
close();
|
||||
|
||||
if (msg._action == KEYBIND_SELECT)
|
||||
map.dogDesecrate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
50
engines/mm/mm1/views/interactions/dog_statue.h
Normal file
50
engines/mm/mm1/views/interactions/dog_statue.h
Normal file
@@ -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_MAPS_DOG_STATUE_H
|
||||
#define MM1_VIEWS_MAPS_DOG_STATUE_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class DogStatue : public TextView {
|
||||
private:
|
||||
bool _completedQuests = false;
|
||||
public:
|
||||
DogStatue();
|
||||
virtual ~DogStatue() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
68
engines/mm/mm1/views/interactions/ghost.cpp
Normal file
68
engines/mm/mm1/views/interactions/ghost.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
/* 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/interactions/ghost.h"
|
||||
#include "mm/mm1/maps/map37.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Ghost::Ghost() : TextView("Ghost") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
void Ghost::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map37.okrim1"]);
|
||||
}
|
||||
|
||||
bool Ghost::msgKeypress(const KeypressMessage &msg) {
|
||||
if (msg.keycode == Common::KEYCODE_y || msg.keycode == Common::KEYCODE_n) {
|
||||
MM1::Maps::Map37 &map = *static_cast<MM1::Maps::Map37 *>(g_maps->_currentMap);
|
||||
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
g_globals->_party[0]._condition = ERADICATED;
|
||||
} else {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map37.okrim2"]);
|
||||
|
||||
map[MM1::Maps::MAP_29] = 32;
|
||||
map[MM1::Maps::MAP_47] = 8;
|
||||
}
|
||||
|
||||
// Note: You get the ring whether or not you agree to it.
|
||||
// This is indeed how the original's logic is implemented
|
||||
close();
|
||||
g_globals->_treasure._items[2] = RING_OF_OKRIM_ID;
|
||||
g_events->addAction(KEYBIND_SEARCH);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
46
engines/mm/mm1/views/interactions/ghost.h
Normal file
46
engines/mm/mm1/views/interactions/ghost.h
Normal file
@@ -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_MAPS_GHOST_H
|
||||
#define MM1_VIEWS_MAPS_GHOST_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Ghost : public TextView {
|
||||
public:
|
||||
Ghost();
|
||||
virtual ~Ghost() {}
|
||||
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
102
engines/mm/mm1/views/interactions/giant.cpp
Normal file
102
engines/mm/mm1/views/interactions/giant.cpp
Normal file
@@ -0,0 +1,102 @@
|
||||
/* 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/interactions/giant.h"
|
||||
#include "mm/mm1/maps/map30.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Giant::Giant() : TextView("Giant") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Giant::msgFocus(const FocusMessage &msg) {
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_PARTY_MENUS);
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
bool Giant::msgUnfocus(const UnfocusMessage &msg) {
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
|
||||
return TextView::msgUnfocus(msg);
|
||||
}
|
||||
|
||||
void Giant::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map30.giant"]);
|
||||
}
|
||||
|
||||
bool Giant::msgKeypress(const KeypressMessage &msg) {
|
||||
if (endDelay()) {
|
||||
draw();
|
||||
|
||||
} else if (msg.keycode < Common::KEYCODE_1 ||
|
||||
msg.keycode > Common::KEYCODE_6) {
|
||||
close();
|
||||
|
||||
} else {
|
||||
uint charIndex = msg.keycode - Common::KEYCODE_1;
|
||||
charSelected(charIndex);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Giant::msgAction(const ActionMessage &msg) {
|
||||
if (endDelay()) {
|
||||
// Nothing further
|
||||
|
||||
} else if (msg._action >= KEYBIND_VIEW_PARTY1 &&
|
||||
msg._action <= KEYBIND_VIEW_PARTY6) {
|
||||
uint idx = msg._action - KEYBIND_VIEW_PARTY1;
|
||||
charSelected(idx);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Giant::charSelected(uint charIndex) {
|
||||
if (charIndex >= g_globals->_party.size())
|
||||
return;
|
||||
|
||||
MM1::Maps::Map30 &map = *static_cast<MM1::Maps::Map30 *>(g_maps->_currentMap);
|
||||
g_globals->_currCharacter = &g_globals->_party[charIndex];
|
||||
Common::String line = map.worthiness();
|
||||
|
||||
clearSurface();
|
||||
writeString(0, 1, line);
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
delaySeconds(5);
|
||||
}
|
||||
|
||||
void Giant::timeout() {
|
||||
redraw();
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
53
engines/mm/mm1/views/interactions/giant.h
Normal file
53
engines/mm/mm1/views/interactions/giant.h
Normal 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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MM1_VIEWS_MAPS_GIANT_H
|
||||
#define MM1_VIEWS_MAPS_GIANT_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Giant : public TextView {
|
||||
private:
|
||||
void charSelected(uint charIndex);
|
||||
|
||||
public:
|
||||
Giant();
|
||||
virtual ~Giant() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
bool msgUnfocus(const UnfocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
void timeout() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
112
engines/mm/mm1/views/interactions/gypsy.cpp
Normal file
112
engines/mm/mm1/views/interactions/gypsy.cpp
Normal file
@@ -0,0 +1,112 @@
|
||||
/* 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/interactions/gypsy.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
#define VAL1 123
|
||||
#define ANSWER_OFFSET 167
|
||||
|
||||
Gypsy::Gypsy() : TextView("Gypsy") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Gypsy::msgFocus(const FocusMessage &msg) {
|
||||
TextView::msgFocus(msg);
|
||||
modeChanged(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Gypsy::msgUnfocus(const UnfocusMessage &msg) {
|
||||
TextView::msgUnfocus(msg);
|
||||
modeChanged(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Gypsy::charSelected(uint charIndex) {
|
||||
if (charIndex < g_globals->_party.size()) {
|
||||
_character = &g_globals->_party[charIndex];
|
||||
|
||||
if (!(_character->_flags[4] & CHARFLAG4_ASSIGNED)) {
|
||||
_character->_flags[4] = CHARFLAG4_ASSIGNED |
|
||||
(getRandomNumber(8) - 1);
|
||||
}
|
||||
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void Gypsy::modeChanged(bool allowSelection) {
|
||||
if (allowSelection)
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_PARTY_MENUS);
|
||||
else
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
|
||||
|
||||
}
|
||||
|
||||
void Gypsy::draw() {
|
||||
clearSurface();
|
||||
if (!_character) {
|
||||
writeString(0, 1, STRING["maps.map23.gypsy"]);
|
||||
|
||||
} else {
|
||||
Common::String line = Common::String::format(
|
||||
STRING["maps.map23.your_sign_is"].c_str(),
|
||||
STRING[Common::String::format("colors.%d",
|
||||
_character->_flags[4] & CHARFLAG4_SIGN)].c_str()
|
||||
);
|
||||
|
||||
writeString(0, 1, line);
|
||||
}
|
||||
}
|
||||
|
||||
bool Gypsy::msgKeypress(const KeypressMessage &msg) {
|
||||
if (_character) {
|
||||
_character = nullptr;
|
||||
modeChanged(true);
|
||||
draw();
|
||||
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Gypsy::msgAction(const ActionMessage &msg) {
|
||||
if (msg._action >= KEYBIND_VIEW_PARTY1 &&
|
||||
msg._action <= KEYBIND_VIEW_PARTY6) {
|
||||
uint idx = msg._action - KEYBIND_VIEW_PARTY1;
|
||||
charSelected(idx);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
55
engines/mm/mm1/views/interactions/gypsy.h
Normal file
55
engines/mm/mm1/views/interactions/gypsy.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* 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_GYPSY_H
|
||||
#define MM1_VIEWS_MAPS_GYPSY_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
#include "mm/mm1/data/character.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Gypsy : public TextView {
|
||||
private:
|
||||
Character *_character = nullptr;
|
||||
|
||||
void charSelected(uint charIndex);
|
||||
void modeChanged(bool allowSelection);
|
||||
public:
|
||||
Gypsy();
|
||||
virtual ~Gypsy() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
bool msgUnfocus(const UnfocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
109
engines/mm/mm1/views/interactions/hacker.cpp
Normal file
109
engines/mm/mm1/views/interactions/hacker.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/* 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/interactions/hacker.h"
|
||||
#include "mm/mm1/maps/map36.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Hacker::Hacker() : TextView("Hacker") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Hacker::msgGame(const GameMessage &msg) {
|
||||
if (msg._name != "DISPLAY")
|
||||
return false;
|
||||
|
||||
g_globals->_currCharacter = &g_globals->_party[0];
|
||||
_canAccept = !g_globals->_currCharacter->_quest;
|
||||
|
||||
if (_canAccept) {
|
||||
// Show the view
|
||||
Sound::sound(SOUND_2);
|
||||
addView();
|
||||
|
||||
} else {
|
||||
MM1::Maps::Map36 &map = *static_cast<MM1::Maps::Map36 *>(g_maps->_currentMap);
|
||||
int questNum = g_globals->_party[0]._quest;
|
||||
Common::String line;
|
||||
|
||||
if (questNum >= 15 && questNum <= 21)
|
||||
line = map.checkQuestComplete();
|
||||
else
|
||||
line = STRING["maps.map36.hacker4"];
|
||||
|
||||
g_maps->_mapPos.x--;
|
||||
map.redrawGame();
|
||||
|
||||
send(SoundMessage(
|
||||
0, 1, STRING["maps.map36.hacker1"],
|
||||
0, 2, line
|
||||
));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Hacker::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map36.hacker1"]);
|
||||
writeString(0, 2, STRING["maps.map36.hacker2"]);
|
||||
}
|
||||
|
||||
bool Hacker::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map36 &map = *static_cast<MM1::Maps::Map36 *>(g_maps->_currentMap);
|
||||
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
close();
|
||||
map.acceptQuest();
|
||||
|
||||
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, line
|
||||
));
|
||||
}
|
||||
|
||||
} else if (msg.keycode == Common::KEYCODE_n) {
|
||||
close();
|
||||
map.redrawGame();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/hacker.h
Normal file
49
engines/mm/mm1/views/interactions/hacker.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_HACKER_H
|
||||
#define MM1_VIEWS_MAPS_HACKER_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Hacker : public TextView {
|
||||
private:
|
||||
bool _canAccept;
|
||||
public:
|
||||
Hacker();
|
||||
virtual ~Hacker() {}
|
||||
|
||||
bool msgGame(const GameMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
51
engines/mm/mm1/views/interactions/ice_princess.cpp
Normal file
51
engines/mm/mm1/views/interactions/ice_princess.cpp
Normal file
@@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mm/mm1/views/interactions/ice_princess.h"
|
||||
#include "mm/mm1/maps/map19.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
IcePrincess::IcePrincess() :
|
||||
AnswerEntry("IcePrincess", Common::Point(9, 7), 10) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
void IcePrincess::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map19.ice_princess"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void IcePrincess::answerEntered() {
|
||||
MM1::Maps::Map19 &map = *static_cast<MM1::Maps::Map19 *>(g_maps->_currentMap);
|
||||
map.riddleAnswer(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
48
engines/mm/mm1/views/interactions/ice_princess.h
Normal file
48
engines/mm/mm1/views/interactions/ice_princess.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_ICE_PRINCESS_H
|
||||
#define MM1_VIEWS_MAPS_ICE_PRINCESS_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class IcePrincess : public AnswerEntry {
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
IcePrincess();
|
||||
virtual ~IcePrincess() {}
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
107
engines/mm/mm1/views/interactions/inspectron.cpp
Normal file
107
engines/mm/mm1/views/interactions/inspectron.cpp
Normal file
@@ -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/interactions/inspectron.h"
|
||||
#include "mm/mm1/maps/map35.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
#define VAL1 123
|
||||
#define ANSWER_OFFSET 167
|
||||
|
||||
Inspectron::Inspectron() : TextView("Inspectron") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Inspectron::msgGame(const GameMessage &msg) {
|
||||
if (msg._name != "DISPLAY")
|
||||
return false;
|
||||
|
||||
g_globals->_currCharacter = &g_globals->_party[0];
|
||||
_canAccept = !g_globals->_currCharacter->_quest;
|
||||
|
||||
if (_canAccept) {
|
||||
// Open the view for display
|
||||
Sound::sound(SOUND_2);
|
||||
addView();
|
||||
|
||||
} else {
|
||||
// There's an active quest, so any result will simply be
|
||||
// displayed as a game message
|
||||
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();
|
||||
|
||||
send(SoundMessage(
|
||||
0, 1, STRING["maps.map35.inspectron1"],
|
||||
0, 2, line
|
||||
));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Inspectron::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map35.inspectron1"]);
|
||||
writeString(0, 2, STRING["maps.map35.inspectron2"]);
|
||||
}
|
||||
|
||||
bool Inspectron::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map35 &map = *static_cast<MM1::Maps::Map35 *>(g_maps->_currentMap);
|
||||
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
map.acceptQuest();
|
||||
close();
|
||||
|
||||
send(InfoMessage(
|
||||
0, 1, STRING["maps.map35.inspectron1"],
|
||||
0, 2, STRING[Common::String::format(
|
||||
"maps.map35.quests.%d",
|
||||
g_globals->_party[0]._quest - 8
|
||||
)]
|
||||
));
|
||||
|
||||
} else if (msg.keycode == Common::KEYCODE_n) {
|
||||
close();
|
||||
map.redrawGame();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/inspectron.h
Normal file
49
engines/mm/mm1/views/interactions/inspectron.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_INSPECTRON_H
|
||||
#define MM1_VIEWS_MAPS_INSPECTRON_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Inspectron : public TextView {
|
||||
private:
|
||||
bool _canAccept;
|
||||
public:
|
||||
Inspectron();
|
||||
virtual ~Inspectron() {}
|
||||
|
||||
bool msgGame(const GameMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
88
engines/mm/mm1/views/interactions/keeper.cpp
Normal file
88
engines/mm/mm1/views/interactions/keeper.cpp
Normal file
@@ -0,0 +1,88 @@
|
||||
/* 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/interactions/keeper.h"
|
||||
#include "mm/mm1/maps/map54.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Keeper::Keeper() : TextView("Keeper") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Keeper::msgFocus(const FocusMessage &msg) {
|
||||
_pageNum = 0;
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void Keeper::draw() {
|
||||
MM1::Maps::Map54 &map = *static_cast<MM1::Maps::Map54 *>(g_maps->_currentMap);
|
||||
uint32 perfTotal;
|
||||
bool isWorthy;
|
||||
|
||||
switch (_pageNum) {
|
||||
case 0:
|
||||
_bounds = getLineBounds(20, 24);
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map54.keeper1"]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
_bounds = getLineBounds(0, 24);
|
||||
isWorthy = map.isWorthy(perfTotal);
|
||||
|
||||
clearSurface();
|
||||
writeString(10, 0, STRING["maps.map54.keeper2"]);
|
||||
writeString(0, 2, Common::String::format(
|
||||
STRING["maps.map54.keeper3"].c_str(), perfTotal));
|
||||
writeString(0, 3, STRING[isWorthy ? "maps.map54.keeper5" :
|
||||
"maps.map54.keeper4"]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool Keeper::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map54 &map = *static_cast<MM1::Maps::Map54 *>(g_maps->_currentMap);
|
||||
|
||||
if (++_pageNum == 2) {
|
||||
close();
|
||||
map.sorpigalInn();
|
||||
} else {
|
||||
redraw();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/keeper.h
Normal file
49
engines/mm/mm1/views/interactions/keeper.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_KEEPER_H
|
||||
#define MM1_VIEWS_MAPS_KEEPER_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Keeper : public TextView {
|
||||
private:
|
||||
int _pageNum = 0;
|
||||
public:
|
||||
Keeper();
|
||||
virtual ~Keeper() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
67
engines/mm/mm1/views/interactions/leprechaun.cpp
Normal file
67
engines/mm/mm1/views/interactions/leprechaun.cpp
Normal file
@@ -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/interactions/leprechaun.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
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 Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
52
engines/mm/mm1/views/interactions/leprechaun.h
Normal file
52
engines/mm/mm1/views/interactions/leprechaun.h
Normal file
@@ -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 Interactions {
|
||||
|
||||
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 Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
52
engines/mm/mm1/views/interactions/lion.cpp
Normal file
52
engines/mm/mm1/views/interactions/lion.cpp
Normal file
@@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mm/mm1/views/interactions/lion.h"
|
||||
#include "mm/mm1/maps/map32.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
#define PASSWORD_INDEX 393
|
||||
|
||||
Lion::Lion() : AnswerEntry("Lion", Common::Point(11, 2), 10) {
|
||||
}
|
||||
|
||||
void Lion::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map32.statue"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void Lion::answerEntered() {
|
||||
MM1::Maps::Map32 &map = *static_cast<MM1::Maps::Map32 *>(g_maps->_currentMap);
|
||||
close();
|
||||
map.passwordEntered(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
48
engines/mm/mm1/views/interactions/lion.h
Normal file
48
engines/mm/mm1/views/interactions/lion.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_LION_H
|
||||
#define MM1_VIEWS_MAPS_LION_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Lion : public AnswerEntry {
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
Lion();
|
||||
virtual ~Lion() {}
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
64
engines/mm/mm1/views/interactions/lord_archer.cpp
Normal file
64
engines/mm/mm1/views/interactions/lord_archer.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/* 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/interactions/lord_archer.h"
|
||||
#include "mm/mm1/maps/map40.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
LordArcher::LordArcher() : TextView("LordArcher") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool LordArcher::msgFocus(const FocusMessage &msg) {
|
||||
Sound::sound(SOUND_3);
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void LordArcher::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map40.archer"]);
|
||||
}
|
||||
|
||||
bool LordArcher::msgKeypress(const KeypressMessage &msg) {
|
||||
if (msg.keycode == Common::KEYCODE_y || msg.keycode == Common::KEYCODE_n) {
|
||||
MM1::Maps::Map40 &map = *static_cast<MM1::Maps::Map40 *>(g_maps->_currentMap);
|
||||
close();
|
||||
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
map.archerSubmit();
|
||||
} else {
|
||||
map.archerResist();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
47
engines/mm/mm1/views/interactions/lord_archer.h
Normal file
47
engines/mm/mm1/views/interactions/lord_archer.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* 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_LORD_ARCHER_H
|
||||
#define MM1_VIEWS_MAPS_LORD_ARCHER_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class LordArcher : public TextView {
|
||||
public:
|
||||
LordArcher();
|
||||
virtual ~LordArcher() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
100
engines/mm/mm1/views/interactions/lord_ironfist.cpp
Normal file
100
engines/mm/mm1/views/interactions/lord_ironfist.cpp
Normal file
@@ -0,0 +1,100 @@
|
||||
/* 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/interactions/lord_ironfist.h"
|
||||
#include "mm/mm1/maps/map43.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
LordIronfist::LordIronfist() : TextView("LordIronfist") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool LordIronfist::msgFocus(const FocusMessage &msg) {
|
||||
g_globals->_currCharacter = &g_globals->_party[0];
|
||||
_canAccept = !g_globals->_currCharacter->_quest;
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
void LordIronfist::draw() {
|
||||
MM1::Maps::Map43 &map = *static_cast<MM1::Maps::Map43 *>(g_maps->_currentMap);
|
||||
clearSurface();
|
||||
|
||||
if (_canAccept) {
|
||||
Sound::sound2(SOUND_2);
|
||||
writeString(0, 1, STRING["maps.map43.ironfist1"]);
|
||||
writeString(0, 2, STRING["maps.map43.ironfist2"]);
|
||||
|
||||
} else {
|
||||
int questNum = g_globals->_party[0]._quest;
|
||||
Common::String line;
|
||||
|
||||
if (questNum < 8)
|
||||
line = map.checkQuestComplete();
|
||||
else
|
||||
line = STRING["maps.map43.ironfist4"];
|
||||
|
||||
g_maps->_mapPos.x++;
|
||||
map.redrawGame();
|
||||
|
||||
clearSurface();
|
||||
send(SoundMessage(
|
||||
0, 1, STRING["maps.map43.ironfist1"],
|
||||
0, 2, line
|
||||
));
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
bool LordIronfist::msgKeypress(const KeypressMessage &msg) {
|
||||
MM1::Maps::Map43 &map = *static_cast<MM1::Maps::Map43 *>(g_maps->_currentMap);
|
||||
|
||||
if (_canAccept) {
|
||||
if (msg.keycode == Common::KEYCODE_y) {
|
||||
close();
|
||||
map.acceptQuest();
|
||||
|
||||
send(InfoMessage(
|
||||
0, 1, STRING["maps.map43.ironfist1"],
|
||||
0, 2, STRING[Common::String::format(
|
||||
"maps.map43.quests.%d",
|
||||
g_globals->_party[0]._quest)]
|
||||
));
|
||||
|
||||
} else if (msg.keycode == Common::KEYCODE_n) {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
49
engines/mm/mm1/views/interactions/lord_ironfist.h
Normal file
49
engines/mm/mm1/views/interactions/lord_ironfist.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* 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_LORD_IRONFIST_H
|
||||
#define MM1_VIEWS_MAPS_LORD_IRONFIST_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class LordIronfist : public TextView {
|
||||
private:
|
||||
bool _canAccept;
|
||||
public:
|
||||
LordIronfist();
|
||||
virtual ~LordIronfist() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
52
engines/mm/mm1/views/interactions/orango.cpp
Normal file
52
engines/mm/mm1/views/interactions/orango.cpp
Normal file
@@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mm/mm1/views/interactions/orango.h"
|
||||
#include "mm/mm1/maps/map48.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Orango::Orango() :
|
||||
AnswerEntry("Orango", Common::Point(9, 7), 15) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
void Orango::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map48.orango1"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void Orango::answerEntered() {
|
||||
MM1::Maps::Map48 &map = *static_cast<MM1::Maps::Map48 *>(g_maps->_currentMap);
|
||||
close();
|
||||
map.orangoAnswer(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
48
engines/mm/mm1/views/interactions/orango.h
Normal file
48
engines/mm/mm1/views/interactions/orango.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_ORANGO_H
|
||||
#define MM1_VIEWS_MAPS_ORANGO_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Orango : public AnswerEntry {
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
Orango();
|
||||
virtual ~Orango() {}
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
183
engines/mm/mm1/views/interactions/prisoners.cpp
Normal file
183
engines/mm/mm1/views/interactions/prisoners.cpp
Normal file
@@ -0,0 +1,183 @@
|
||||
/* 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/interactions/prisoners.h"
|
||||
#include "mm/mm1/maps/map11.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Prisoner::Prisoner(const Common::String &name, const Common::String &line1,
|
||||
byte flag, Alignment freeAlignment, Alignment leaveAlignment) :
|
||||
TextView(name), _line1(line1), _flag(flag),
|
||||
_freeAlignment(freeAlignment), _leaveAlignment(leaveAlignment) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
void Prisoner::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 0, _line1);
|
||||
writeString(0, 3, STRING["maps.prisoners.options1"]);
|
||||
_textPos.x = 10;
|
||||
writeString(STRING["maps.prisoners.options2"]);
|
||||
_textPos.x = 10;
|
||||
writeString(STRING["maps.prisoners.options3"]);
|
||||
}
|
||||
|
||||
bool Prisoner::msgKeypress(const KeypressMessage &msg) {
|
||||
if (endDelay())
|
||||
return true;
|
||||
|
||||
if (msg.keycode < Common::KEYCODE_1 || msg.keycode > Common::KEYCODE_3)
|
||||
return true;
|
||||
|
||||
Common::String line;
|
||||
int align;
|
||||
switch (msg.keycode) {
|
||||
case Common::KEYCODE_1:
|
||||
line = STRING["maps.prisoners.flees"];
|
||||
align = _freeAlignment;
|
||||
g_maps->clearSpecial();
|
||||
flee();
|
||||
break;
|
||||
|
||||
case Common::KEYCODE_2:
|
||||
line = STRING["maps.prisoners.cowers"];
|
||||
align = _leaveAlignment;
|
||||
break;
|
||||
|
||||
default:
|
||||
align = NEUTRAL;
|
||||
break;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < g_globals->_party.size(); ++i) {
|
||||
Character &c = g_globals->_party[i];
|
||||
|
||||
if (!(c._flags[1] & _flag)) {
|
||||
c._flags[1] |= _flag;
|
||||
if (align == c._alignment)
|
||||
c._worthiness += 32;
|
||||
}
|
||||
}
|
||||
|
||||
if (align != NEUTRAL) {
|
||||
clearSurface();
|
||||
writeString(0, 1, line);
|
||||
Sound::sound(SOUND_2);
|
||||
delaySeconds(3);
|
||||
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Prisoner::timeout() {
|
||||
close();
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
ChildPrisoner::ChildPrisoner() :
|
||||
Prisoner("ChildPrisoner", STRING["maps.prisoners.child"],
|
||||
CHARFLAG1_4, GOOD, EVIL) {
|
||||
}
|
||||
|
||||
ManPrisoner::ManPrisoner() :
|
||||
Prisoner("ManPrisoner", STRING["maps.prisoners.man"],
|
||||
CHARFLAG1_20, EVIL, GOOD) {
|
||||
}
|
||||
|
||||
CloakedPrisoner::CloakedPrisoner() :
|
||||
Prisoner("CloakedPrisoner", STRING["maps.prisoners.cloaked"],
|
||||
CHARFLAG1_40, EVIL, GOOD) {
|
||||
}
|
||||
|
||||
DemonPrisoner::DemonPrisoner() :
|
||||
Prisoner("DemonPrisoner", STRING["maps.prisoners.demon"],
|
||||
CHARFLAG1_10, EVIL, GOOD) {
|
||||
}
|
||||
|
||||
MutatedPrisoner::MutatedPrisoner() :
|
||||
Prisoner("MutatedPrisoner", STRING["maps.prisoners.mutated"],
|
||||
CHARFLAG1_2, GOOD, EVIL) {
|
||||
}
|
||||
|
||||
MaidenPrisoner::MaidenPrisoner() :
|
||||
Prisoner("MaidenPrisoner", STRING["maps.prisoners.maiden"],
|
||||
CHARFLAG1_8, GOOD, EVIL) {
|
||||
}
|
||||
|
||||
void MaidenPrisoner::flee() {
|
||||
MM1::Maps::Map &map = *g_maps->_currentMap;
|
||||
map._walls[48] &= 0x7f;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
VirginPrisoner::VirginPrisoner() : TextView("VirginPrisoner") {
|
||||
setBounds(getLineBounds(20, 24));
|
||||
}
|
||||
|
||||
void VirginPrisoner::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map11.virgin"]);
|
||||
}
|
||||
|
||||
bool VirginPrisoner::msgKeypress(const KeypressMessage &msg) {
|
||||
switch (msg.keycode) {
|
||||
case Common::KEYCODE_a:
|
||||
g_events->close();
|
||||
g_events->send(SoundMessage(STRING["maps.map11.tip1"]));
|
||||
break;
|
||||
case Common::KEYCODE_b:
|
||||
g_events->close();
|
||||
static_cast<MM1::Maps::Map11 *>(g_maps->_currentMap)->challenge();
|
||||
break;
|
||||
case Common::KEYCODE_c:
|
||||
g_events->close();
|
||||
break;
|
||||
default:
|
||||
return TextView::msgKeypress(msg);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VirginPrisoner::msgAction(const ActionMessage &msg) {
|
||||
if (msg._action == KEYBIND_ESCAPE) {
|
||||
g_events->close();
|
||||
return true;
|
||||
} else {
|
||||
return TextView::msgAction(msg);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
108
engines/mm/mm1/views/interactions/prisoners.h
Normal file
108
engines/mm/mm1/views/interactions/prisoners.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/* 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_PRISONERS_H
|
||||
#define MM1_VIEWS_MAPS_PRISONERS_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
#include "mm/mm1/data/character.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Prisoner : public TextView {
|
||||
private:
|
||||
Common::String _line1;
|
||||
byte _flag;
|
||||
Alignment _freeAlignment;
|
||||
Alignment _leaveAlignment;
|
||||
protected:
|
||||
virtual void flee() {}
|
||||
public:
|
||||
Prisoner(const Common::String &name, const Common::String &line1,
|
||||
byte flag, Alignment freeAlignment, Alignment leaveAlignment);
|
||||
virtual ~Prisoner() {}
|
||||
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
void timeout() override;
|
||||
};
|
||||
|
||||
class ChildPrisoner : public Prisoner {
|
||||
public:
|
||||
ChildPrisoner();
|
||||
virtual ~ChildPrisoner() {}
|
||||
};
|
||||
|
||||
class ManPrisoner : public Prisoner {
|
||||
public:
|
||||
ManPrisoner();
|
||||
virtual ~ManPrisoner() {}
|
||||
};
|
||||
|
||||
class CloakedPrisoner : public Prisoner {
|
||||
public:
|
||||
CloakedPrisoner();
|
||||
virtual ~CloakedPrisoner() {
|
||||
}
|
||||
};
|
||||
|
||||
class DemonPrisoner : public Prisoner {
|
||||
public:
|
||||
DemonPrisoner();
|
||||
virtual ~DemonPrisoner() {
|
||||
}
|
||||
};
|
||||
|
||||
class MutatedPrisoner : public Prisoner {
|
||||
public:
|
||||
MutatedPrisoner();
|
||||
virtual ~MutatedPrisoner() {
|
||||
}
|
||||
};
|
||||
|
||||
class MaidenPrisoner : public Prisoner {
|
||||
protected:
|
||||
void flee() override;
|
||||
public:
|
||||
MaidenPrisoner();
|
||||
virtual ~MaidenPrisoner() {
|
||||
}
|
||||
};
|
||||
|
||||
class VirginPrisoner : public TextView {
|
||||
public:
|
||||
VirginPrisoner();
|
||||
virtual ~VirginPrisoner() {
|
||||
}
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
105
engines/mm/mm1/views/interactions/resistances.cpp
Normal file
105
engines/mm/mm1/views/interactions/resistances.cpp
Normal file
@@ -0,0 +1,105 @@
|
||||
/* 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/interactions/resistances.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Resistances::Resistances() : TextView("Resistances") {
|
||||
_bounds = getLineBounds(20, 24);
|
||||
}
|
||||
|
||||
bool Resistances::msgFocus(const FocusMessage &msg) {
|
||||
_charSelected = false;
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_PARTY_MENUS);
|
||||
return TextView::msgFocus(msg);
|
||||
}
|
||||
|
||||
bool Resistances::msgUnfocus(const UnfocusMessage &msg) {
|
||||
MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
|
||||
return TextView::msgUnfocus(msg);
|
||||
}
|
||||
|
||||
void Resistances::draw() {
|
||||
clearSurface();
|
||||
Sound::sound(SOUND_2);
|
||||
|
||||
if (!_charSelected) {
|
||||
writeString(0, 1, STRING["maps.map02.morango"]);
|
||||
|
||||
} else {
|
||||
Character &c = *g_globals->_currCharacter;
|
||||
writeString(0, 1, STRING["maps.map02.resistances1"]);
|
||||
writeString(c._name);
|
||||
newLine();
|
||||
writeString(0, 1, STRING["maps.map02.resistances2"]);
|
||||
|
||||
writeNumber(6, 1, c._resistances._s._magic);
|
||||
writeNumber(15, 1, c._resistances._s._fire);
|
||||
writeNumber(26, 1, c._resistances._s._cold);
|
||||
writeNumber(36, 1, c._resistances._s._electricity);
|
||||
writeNumber(6, 2, c._resistances._s._acid);
|
||||
writeNumber(15, 2, c._resistances._s._fear);
|
||||
writeNumber(26, 2, c._resistances._s._poison);
|
||||
writeNumber(36, 2, c._resistances._s._psychic);
|
||||
}
|
||||
}
|
||||
|
||||
bool Resistances::msgKeypress(const KeypressMessage &msg) {
|
||||
if (_charSelected)
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Resistances::msgMouseDown(const MouseDownMessage &msg) {
|
||||
if (_charSelected)
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Resistances::msgAction(const ActionMessage &msg) {
|
||||
if (msg._action == KEYBIND_ESCAPE) {
|
||||
close();
|
||||
|
||||
} else if (!_charSelected &&
|
||||
msg._action >= KEYBIND_VIEW_PARTY1 &&
|
||||
msg._action <= KEYBIND_VIEW_PARTY6) {
|
||||
uint charIndex = (int)(msg._action - KEYBIND_VIEW_PARTY1);
|
||||
if (charIndex < g_globals->_party.size()) {
|
||||
_charSelected = true;
|
||||
g_globals->_currCharacter = &g_globals->_party[charIndex];
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Spells
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
52
engines/mm/mm1/views/interactions/resistances.h
Normal file
52
engines/mm/mm1/views/interactions/resistances.h
Normal file
@@ -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_RESISTANCES_H
|
||||
#define MM1_VIEWS_MAPS_RESISTANCES_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Resistances : public TextView {
|
||||
private:
|
||||
bool _charSelected = false;
|
||||
public:
|
||||
Resistances();
|
||||
virtual ~Resistances() {}
|
||||
|
||||
bool msgFocus(const FocusMessage &msg) override;
|
||||
bool msgUnfocus(const UnfocusMessage &msg) override;
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgMouseDown(const MouseDownMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
51
engines/mm/mm1/views/interactions/ruby.cpp
Normal file
51
engines/mm/mm1/views/interactions/ruby.cpp
Normal file
@@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mm/mm1/views/interactions/ruby.h"
|
||||
#include "mm/mm1/maps/map39.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Ruby::Ruby() : AnswerEntry("Ruby", Common::Point(14, 7), 12) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
void Ruby::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, STRING["maps.map39.ruby1"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void Ruby::answerEntered() {
|
||||
MM1::Maps::Map39 &map = *static_cast<MM1::Maps::Map39 *>(g_maps->_currentMap);
|
||||
close();
|
||||
map.riddleAnswered(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
48
engines/mm/mm1/views/interactions/ruby.h
Normal file
48
engines/mm/mm1/views/interactions/ruby.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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_RUBY_H
|
||||
#define MM1_VIEWS_MAPS_RUBY_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Ruby : public AnswerEntry {
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
Ruby();
|
||||
virtual ~Ruby() {}
|
||||
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
76
engines/mm/mm1/views/interactions/trivia.cpp
Normal file
76
engines/mm/mm1/views/interactions/trivia.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/* 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/interactions/trivia.h"
|
||||
#include "mm/mm1/maps/map21.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
Trivia::Trivia() :
|
||||
AnswerEntry("Trivia", Common::Point(9, 7), 14) {
|
||||
_bounds = getLineBounds(17, 24);
|
||||
}
|
||||
|
||||
bool Trivia::msgGame(const GameMessage &msg) {
|
||||
if (msg._name == "TRIVIA") {
|
||||
_question = STRING[Common::String::format(
|
||||
"maps.map21.questions.%d", msg._value)];
|
||||
_correctAnswer = STRING[Common::String::format(
|
||||
"maps.map21.answers.%d", msg._value)];
|
||||
|
||||
open();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Trivia::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 1, _question);
|
||||
writeString(0, 7, STRING["maps.map21.answer"]);
|
||||
AnswerEntry::draw();
|
||||
}
|
||||
|
||||
void Trivia::answerEntered() {
|
||||
close();
|
||||
|
||||
if (_answer.equalsIgnoreCase(_correctAnswer)) {
|
||||
send(InfoMessage(STRING["maps.map21.correct"]));
|
||||
g_globals->_party[0]._gems += 50;
|
||||
Sound::sound(SOUND_3);
|
||||
|
||||
} else {
|
||||
g_maps->_mapPos.x = 15;
|
||||
g_events->send("Game", GameMessage("UPDATE"));
|
||||
send(InfoMessage(STRING["maps.map21.incorrect"]));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
51
engines/mm/mm1/views/interactions/trivia.h
Normal file
51
engines/mm/mm1/views/interactions/trivia.h
Normal file
@@ -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_TRIVIA_H
|
||||
#define MM1_VIEWS_MAPS_TRIVIA_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class Trivia : public AnswerEntry {
|
||||
private:
|
||||
Common::String _question, _correctAnswer;
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
Trivia();
|
||||
virtual ~Trivia() {}
|
||||
|
||||
bool msgGame(const GameMessage &msg) override;
|
||||
void draw() override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
108
engines/mm/mm1/views/interactions/volcano_god.cpp
Normal file
108
engines/mm/mm1/views/interactions/volcano_god.cpp
Normal file
@@ -0,0 +1,108 @@
|
||||
/* 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/interactions/volcano_god.h"
|
||||
#include "mm/mm1/maps/map11.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
VolcanoGod::VolcanoGod() :
|
||||
AnswerEntry("VolcanoGod", Common::Point(9, 3), 8) {
|
||||
}
|
||||
|
||||
void VolcanoGod::draw() {
|
||||
clearSurface();
|
||||
|
||||
switch (_mode) {
|
||||
case CHOOSE_OPTION:
|
||||
writeString(0, 1, STRING["maps.map11.volcano_god"]);
|
||||
break;
|
||||
|
||||
case ENTER_RESPONSE:
|
||||
writeString(0, 1, STRING["maps.map11.question"]);
|
||||
AnswerEntry::draw();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool VolcanoGod::msgKeypress(const KeypressMessage &msg) {
|
||||
if (endDelay())
|
||||
return true;
|
||||
|
||||
switch (_mode) {
|
||||
case CHOOSE_OPTION:
|
||||
switch (msg.keycode) {
|
||||
case Common::KEYCODE_a:
|
||||
challenge();
|
||||
break;
|
||||
case Common::KEYCODE_b:
|
||||
riddle();
|
||||
break;
|
||||
case Common::KEYCODE_c:
|
||||
clue();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ENTER_RESPONSE:
|
||||
return AnswerEntry::msgKeypress(msg);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void VolcanoGod::challenge() {
|
||||
MM1::Maps::Map11 &map = *static_cast<MM1::Maps::Map11 *>(g_maps->_currentMap);
|
||||
map.challenge();
|
||||
}
|
||||
|
||||
void VolcanoGod::riddle() {
|
||||
Sound::sound(SOUND_2);
|
||||
_mode = ENTER_RESPONSE;
|
||||
redraw();
|
||||
}
|
||||
|
||||
void VolcanoGod::clue() {
|
||||
MM1::Maps::Map11 &map = *static_cast<MM1::Maps::Map11 *>(g_maps->_currentMap);
|
||||
close();
|
||||
map.clue();
|
||||
}
|
||||
|
||||
void VolcanoGod::answerEntered() {
|
||||
MM1::Maps::Map11 &map = *static_cast<MM1::Maps::Map11 *>(g_maps->_currentMap);
|
||||
close();
|
||||
map.riddleAnswer(_answer);
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
57
engines/mm/mm1/views/interactions/volcano_god.h
Normal file
57
engines/mm/mm1/views/interactions/volcano_god.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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_VOLCANO_GOD_H
|
||||
#define MM1_VIEWS_MAPS_VOLCANO_GOD_H
|
||||
|
||||
#include "mm/mm1/views/interactions/answer_entry.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class VolcanoGod : public AnswerEntry {
|
||||
private:
|
||||
enum Mode { CHOOSE_OPTION, ENTER_RESPONSE };
|
||||
Mode _mode = CHOOSE_OPTION;
|
||||
|
||||
void challenge();
|
||||
void riddle();
|
||||
void clue();
|
||||
|
||||
protected:
|
||||
void answerEntered() override;
|
||||
|
||||
public:
|
||||
VolcanoGod();
|
||||
virtual ~VolcanoGod() {}
|
||||
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
57
engines/mm/mm1/views/interactions/won_game.cpp
Normal file
57
engines/mm/mm1/views/interactions/won_game.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/* 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/interactions/won_game.h"
|
||||
#include "mm/mm1/globals.h"
|
||||
#include "mm/mm1/sound.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
WonGame::WonGame() : TextView("WonGame") {
|
||||
Common::Rect r = getLineBounds(5, 11);
|
||||
r.right = 30 * 8;
|
||||
_bounds = r;
|
||||
}
|
||||
|
||||
void WonGame::draw() {
|
||||
clearSurface();
|
||||
writeString(0, 0, STRING["maps.map18.gates"]);
|
||||
writeString(0, 1, STRING["maps.map18.congratulations"]);
|
||||
Sound::sound(SOUND_3);
|
||||
}
|
||||
|
||||
bool WonGame::msgKeypress(const KeypressMessage &msg) {
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WonGame::msgAction(const ActionMessage &msg) {
|
||||
close();
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
47
engines/mm/mm1/views/interactions/won_game.h
Normal file
47
engines/mm/mm1/views/interactions/won_game.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* 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_WON_GAME_H
|
||||
#define MM1_VIEWS_MAPS_WON_GAME_H
|
||||
|
||||
#include "mm/mm1/views/text_view.h"
|
||||
|
||||
namespace MM {
|
||||
namespace MM1 {
|
||||
namespace Views {
|
||||
namespace Interactions {
|
||||
|
||||
class WonGame : public TextView {
|
||||
public:
|
||||
WonGame();
|
||||
virtual ~WonGame() {}
|
||||
|
||||
void draw() override;
|
||||
bool msgKeypress(const KeypressMessage &msg) override;
|
||||
bool msgAction(const ActionMessage &msg) override;
|
||||
};
|
||||
|
||||
} // namespace Interactions
|
||||
} // namespace Views
|
||||
} // namespace MM1
|
||||
} // namespace MM
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user