aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova
diff options
context:
space:
mode:
authorStrangerke2017-11-27 07:36:23 +0100
committerThierry Crozat2018-01-23 02:15:41 +0000
commit4810d514fead024305aec4fcb1f414a1cc3b98ca (patch)
treefefd63862483f8fe3fbbbc26d8262b5aaae04bc8 /engines/supernova
parent626e93e6f8cd6bdb518c5962b851b9adab09c344 (diff)
downloadscummvm-rg350-4810d514fead024305aec4fcb1f414a1cc3b98ca.tar.gz
scummvm-rg350-4810d514fead024305aec4fcb1f414a1cc3b98ca.tar.bz2
scummvm-rg350-4810d514fead024305aec4fcb1f414a1cc3b98ca.zip
SUPERNOVA: Implement telomat, increase savegame version
Diffstat (limited to 'engines/supernova')
-rw-r--r--engines/supernova/rooms.cpp2
-rw-r--r--engines/supernova/rooms.h4
-rw-r--r--engines/supernova/state.cpp173
-rw-r--r--engines/supernova/state.h2
-rw-r--r--engines/supernova/supernova.h2
5 files changed, 176 insertions, 7 deletions
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 44446f437f..c7cc3aec10 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -2847,7 +2847,7 @@ bool AxacussBcorridor::interact(Action verb, Object &obj1, Object &obj2) {
}
} else if ((verb == ACTION_LOOK) &&
(obj1._id >= DOOR1) && (obj1._id <= DOOR4)) {
- _nameSeen |= 1 << (obj1._id - DOOR1);
+ _gm->_state._nameSeen[obj1._id - DOOR1] = true;
return false;
} else if ((verb == ACTION_WALK) &&
((obj1._id == PILLAR1) || (obj1._id == PILLAR2))) {
diff --git a/engines/supernova/rooms.h b/engines/supernova/rooms.h
index 89609eabdb..ad28afb991 100644
--- a/engines/supernova/rooms.h
+++ b/engines/supernova/rooms.h
@@ -1149,10 +1149,8 @@ public:
virtual void onEntrance();
virtual bool interact(Action verb, Object &obj1, Object &obj2);
-
-private:
- byte _nameSeen;
};
+
class AxacussIntersection : public Room {
public:
AxacussIntersection(SupernovaEngine *vm, GameManager *gm) {
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 6553596387..f1ceda0531 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -57,6 +57,8 @@ bool GameManager::serialize(Common::WriteStream *out) {
out->writeByte(_state._cableConnected);
out->writeByte(_state._powerOff);
out->writeByte(_state._dream);
+ for (int i = 0; i < 4; i++)
+ out->writeByte(_state._nameSeen[i]);
// Inventory
out->writeSint32LE(_inventory.getSize());
@@ -113,6 +115,13 @@ bool GameManager::deserialize(Common::ReadStream *in, int version) {
_state._powerOff = in->readByte();
_state._dream = in->readByte();
+ for (int i = 0; i < 4; i++) {
+ if (version >= 7)
+ _state._nameSeen[i] = in->readByte();
+ else
+ _state._nameSeen[i] = false;
+ }
+
_oldTime = g_system->getMillis();
// Inventory
@@ -655,8 +664,163 @@ void GameManager::corridorOnEntrance() {
busted(0);
}
-void GameManager::telomat(int number) {
- warning("STUB: telomat %d", number);
+void GameManager::telomat(int nr) {
+ static Common::String name[8] = {
+ "DR. ALAB HANSI",
+ "ALAB HANSI",
+ "SAVAL LUN",
+ "x",
+ "PROF. DR. UGNUL TSCHABB",
+ "UGNUL TSCHABB",
+ "ALGA HURZ LI",
+ "x"
+ };
+
+ static Common::String name2[4] = {
+ "Alab Hansi",
+ "Saval Lun",
+ "Ugnul Tschabb",
+ "Alga Hurz Li"
+ };
+
+ Common::String dial1[4];
+ dial1[0] = "Guten Tag, hier ist Horst Hummel.";
+ dial1[1] = "";
+ dial1[2] = "Es ist sehr wichtig.";
+ dial1[3] = "|";
+
+ static byte rows1[3] = {1, 2, 1};
+
+ Common::String dial2[4];
+ dial2[0] = "Vom Mars.";
+ dial2[1] = "Vom Klo.";
+ dial2[2] = "Das werde ich kaum erzählen.";
+ dial2[3] = "|";
+
+ static byte rows2[4] = {1, 1, 1, 1};
+
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderText("1 Büromanager", 100, 70, kColorGreen);
+ _vm->renderText("2 Telomat", 100, 81, kColorGreen);
+ _vm->renderText("3 ProText", 100, 92, kColorGreen);
+ _vm->renderText("4 Calculata", 100, 103, kColorGreen);
+ _vm->renderText("Bitte wählen", 100, 120, kColorDarkGreen);
+ Common::String input;
+ do {
+ getInput();
+
+ switch (_key.keycode) {
+ case Common::KEYCODE_2: {
+ _vm->renderBox(0, 0, 320, 200, kColorDarkBlue);
+ _vm->renderText("Geben Sie den gewünschten Namen ein:", 50, 80, kColorGreen);
+ _vm->renderText("(Vor- und Nachname)", 50, 91, kColorGreen);
+ do
+ edit(input, 50, 105, 30);
+ while ((_key.keycode != Common::KEYCODE_RETURN) && (_key.keycode != Common::KEYCODE_ESCAPE));
+
+ if (_key.keycode == Common::KEYCODE_ESCAPE) {
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderRoom(*_currentRoom);
+ _vm->paletteBrightness();
+ _guiEnabled = true;
+ drawMapExits();
+ return;
+ }
+
+ input.toUppercase();
+
+ int i = 0;
+ while ((input != name[i]) && (i < 8))
+ i++;
+ i >>= 1;
+ if (i == 4) {
+ _vm->renderText("Name unbekannt", 50, 120, kColorGreen);
+ wait2(10);
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderRoom(*_currentRoom);
+ _vm->paletteBrightness();
+ _guiEnabled = true;
+ drawMapExits();
+ return;
+ }
+
+ if ((i == nr) || _rooms[BCORRIDOR]->getObject(4 + i)->hasProperty(CAUGHT)) {
+ _vm->renderText("Verbindung unmöglich", 50, 120, kColorGreen);
+ wait2(10);
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderRoom(*_currentRoom);
+ _vm->paletteBrightness();
+ _guiEnabled = true;
+ drawMapExits();
+ return;
+ }
+
+ _vm->renderText("Verbindung wird hergestellt", 50, 120, kColorGreen);
+ wait2(10);
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderRoom(*_currentRoom);
+ _vm->paletteBrightness();
+ input = Common::String::format("%s am Apparat.", name2[i]);
+ _vm->renderMessage(input, kMessageTop);
+ waitOnInput(_timer1);
+ _vm->removeMessage();
+ if (_state._nameSeen[nr]) {
+ input = Common::String::format("Hier ist %s. Können Sie mal gerade kommen?", name2[nr]);
+ dial1[1] = input;
+ _currentRoom->addSentence(1, 1);
+ } else
+ _currentRoom->removeSentence(1, 1);
+
+ switch (dialog(3, rows1, dial1, 1)) {
+ case 1: _vm->renderMessage("Huch, Sie hören sich aber|nicht gut an. Ich komme sofort.", kMessageTop);
+ waitOnInput(_timer1);
+ _vm->removeMessage();
+ if ((_state._destination == 255) && !_rooms[BCORRIDOR]->isSectionVisible(7)) {
+ _state._eventTime = _state._time + ticksToMsec(150);
+ _state._eventCallback = kGuardWalkFn;
+ _state._origin = i;
+ _state._destination = nr;
+ }
+ break;
+ case 0: _vm->renderMessage("Horst Hummel! Von wo rufen Sie an?", kMessageTop);
+ waitOnInput(_timer1);
+ _vm->removeMessage();
+ if (dialog(4, rows2, dial2, 0) != 3) {
+ wait2(10);
+ say("Hmm, keine Antwort.");
+ }
+ _rooms[BCORRIDOR]->setSectionVisible(7, true);
+ _rooms[BCORRIDOR]->setSectionVisible(i + 1, true);
+ _state._eventTime = 0xffffffff;
+ _currentRoom->addSentence(0, 1);
+ }
+ _guiEnabled = true;
+ drawMapExits();
+ return;
+ }
+ case Common::KEYCODE_1:
+ case Common::KEYCODE_3:
+ case Common::KEYCODE_4:
+ _vm->renderBox(0, 0, 320, 200, kColorDarkBlue);
+ _vm->renderText("Passwort:", 100, 90, kColorGreen);
+ input = "";
+ do
+ edit(input, 100, 105, 30);
+ while ((_key.keycode != Common::KEYCODE_RETURN) && (_key.keycode != Common::KEYCODE_ESCAPE));
+
+ if (_key.keycode == Common::KEYCODE_RETURN) {
+ _vm->renderText("Falsches Passwort", 100, 120, kColorGreen);
+ wait2(10);
+ }
+ case Common::KEYCODE_ESCAPE:
+ _vm->renderBox(0, 0, 320, 200, kColorBlack);
+ _vm->renderRoom(*_currentRoom);
+ _vm->paletteBrightness();
+ _guiEnabled = true;
+ drawMapExits();
+ return;
+ }
+ } while (true);
}
void GameManager::startSearch() {
@@ -1149,6 +1313,11 @@ void GameManager::reply(const char *text, int aus1, int aus2) {
_vm->removeMessage();
}
+int GameManager::dialog(int num, byte rowLength[6], Common::String text[6], int number) {
+ warning("STUB dialog");
+ return 0;
+}
+
int GameManager::dialog(int num, byte rowLength[6], StringID text[6], int number) {
_vm->_allowLoadGame = false;
_guiEnabled = false;
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index e5403ba909..4a7c833c7a 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -55,6 +55,7 @@ struct GameState {
bool _cableConnected;
bool _powerOff;
bool _dream;
+ bool _nameSeen[4];
};
class Inventory {
@@ -187,6 +188,7 @@ public:
void setAnimationTimer(int ticks);
void dead(const char *message);
void dead(StringID messageId);
+ int dialog(int num, byte rowLength[6], Common::String text[6], int number);
int dialog(int num, byte rowLength[6], StringID text[6], int number);
void sentence(int number, bool brightness);
void say(StringID textId);
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index f356c778fd..ffe7da57ba 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -43,7 +43,7 @@
namespace Supernova {
#define SAVEGAME_HEADER MKTAG('M','S','N','1')
-#define SAVEGAME_VERSION 6
+#define SAVEGAME_VERSION 7
#define SUPERNOVA_DAT "supernova.dat"
#define SUPERNOVA_DAT_VERSION 1