aboutsummaryrefslogtreecommitdiff
path: root/engines/supernova2
diff options
context:
space:
mode:
Diffstat (limited to 'engines/supernova2')
-rw-r--r--engines/supernova2/rooms.cpp16
-rw-r--r--engines/supernova2/rooms.h1
-rw-r--r--engines/supernova2/state.cpp6
3 files changed, 17 insertions, 6 deletions
diff --git a/engines/supernova2/rooms.cpp b/engines/supernova2/rooms.cpp
index e9ede99b58..1bec6107d8 100644
--- a/engines/supernova2/rooms.cpp
+++ b/engines/supernova2/rooms.cpp
@@ -21,6 +21,7 @@
*/
#include "common/system.h"
+#include "common/config-manager.h"
#include "graphics/palette.h"
#include "graphics/cursorman.h"
@@ -3704,17 +3705,26 @@ BstDoor::BstDoor(Supernova2Engine *vm, GameManager *gm) {
_objectState[16] = Object(_id, kStringLetter, kStringDefaultDescription, BST15, PRESS, 14, 0, 0);
_objectState[17] = Object(_id, kStringLetter, kStringDefaultDescription, BST16, PRESS, 15, 0, 0);
_objectState[18] = Object(_id, kStringDoor, kStringMassive, DOOR, EXIT | OPENABLE | CLOSED, 16, 16, 0, HALL, 2);
+
+ char germanPassword[16] = {0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0};
+ char englishPassword[16] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};
+ if (ConfMan.get("language") == "en")
+ for (int i = 0; i < 16; i++)
+ _password[i] = englishPassword[i];
+ else
+ for (int i = 0; i < 16; i++)
+ _password[i] = germanPassword[i];
}
void BstDoor::onEntrance() {
- setRoomSeen(true);
+ if (ConfMan.get("language") == "en")
+ _vm->_screen->renderMessage("You are almost there", kMessageNormal, 105, 130);
}
void BstDoor::animation() {
}
bool BstDoor::interact(Action verb, Object &obj1, Object &obj2) {
- static char password[16] = {0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0};
if (_gm->move(verb, obj1)) {
_gm->passageConstruction();
_gm->_newRoom = true;
@@ -3726,7 +3736,7 @@ bool BstDoor::interact(Action verb, Object &obj1, Object &obj2) {
_vm->renderImage(number);
_vm->playSound(kAudioTaxiOpen);
for (number = 1; number <= 16; number++) {
- if (isSectionVisible(number) != password[number - 1])
+ if (isSectionVisible(number) != _password[number - 1])
return true;
}
_gm->wait(2);
diff --git a/engines/supernova2/rooms.h b/engines/supernova2/rooms.h
index aee27646f6..46a86eda17 100644
--- a/engines/supernova2/rooms.h
+++ b/engines/supernova2/rooms.h
@@ -525,6 +525,7 @@ public:
virtual bool interact(Action verb, Object &obj1, Object &obj2);
private:
+ char _password[16];
};
class Hall : public Room {
diff --git a/engines/supernova2/state.cpp b/engines/supernova2/state.cpp
index 9f25e15ec6..41c092ef28 100644
--- a/engines/supernova2/state.cpp
+++ b/engines/supernova2/state.cpp
@@ -132,6 +132,8 @@ bool GameManager::deserialize(Common::ReadStream *in, int version) {
for (int i = 0; i < NUMROOMS; ++i) {
_rooms[i]->deserialize(in, version);
}
+ delete _rooms[BST_DOOR];
+ _rooms[BST_DOOR] = new BstDoor(_vm, this);
_lastRoom = _rooms[lastRoomId];
changeRoom(curRoomId);
@@ -524,8 +526,6 @@ void GameManager::initGui() {
}
void GameManager::updateEvents() {
- if (_currentRoom == _rooms[ELEVATOR])
- debug("%d %d", _state._elevatorE, _state._elevatorNumber);
handleTime();
if (_animationEnabled && !_vm->_screen->isMessageShown() && _animationTimer == 0)
_currentRoom->animation();
@@ -1317,7 +1317,7 @@ bool GameManager::genericInteract(Action verb, Object &obj1, Object &obj2) {
_vm->renderMessage(kStringNothingHappens);
} else if (verb == ACTION_USE && Object::combine(obj1, obj2, ROD, MAGNET)) {
Object *o1, *o2;
- if (obj2._type == ROD) {
+ if (obj2._id == ROD) {
o1 = &obj2;
o2 = &obj1;
} else {