aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/supernova2/ms2_def.h10
-rw-r--r--engines/supernova2/rooms.cpp32
-rw-r--r--engines/supernova2/rooms.h8
-rw-r--r--engines/supernova2/state.cpp6
4 files changed, 49 insertions, 7 deletions
diff --git a/engines/supernova2/ms2_def.h b/engines/supernova2/ms2_def.h
index 697c4ac14f..c3d9d03ca7 100644
--- a/engines/supernova2/ms2_def.h
+++ b/engines/supernova2/ms2_def.h
@@ -100,7 +100,7 @@ enum RoomId {
enum ObjectId {
INVALIDOBJECT = -1,
NULLOBJECT = 0,
- TAXI=1,WALLET,TRANSMITTER,KNIFE,ROD,BES_CABIN,MONEY,
+ TAXI=1,WALLET,TRANSMITTER,KNIFE,ROD,OCCUPIED_CABIN,MONEY,
SLOT1,CHAIR,GANG,G_RIGHT,G_LEFT,PYRA_ENTRANCE,DOOR,BUTTON,
PART0,PART1,PART2,PART3,PART4,PART5,PART6,PART7,
PART8,PART9,PART10,PART11,PART12,PART13,PART14,PART15,
@@ -159,7 +159,7 @@ kString145, kString146, kString147, kString148, kString149,
kString150, kString151, kString152, kString153, kString154,
kString155, kString156, kString157, kString158, kString159,
kString160, kString161, kString162, kString163, kString164,
-kString165, kString166, kString167, kString168, kString169,
+kString165, kString166, kString167, kString168, kStringExit,
kString170, kString171, kString172, kString173, kString174,
kString175, kString176, kString177, kStringDefaultDescription, kStringLooksMetal,
kStringTaxiArrives, kStringNothingHappens, kStringEmpty, kStringWalletOpen, kStringAttachMagnet,
@@ -169,7 +169,7 @@ kString195, kString196, kString197, kString198, kString199,
kStringAirportEntrance, kStringAirport, kStringDowntown, kStringCulturePalace, kStringEarth,
kStringPrivateApartment, kStringLeaveTaxi, kStringPay, kStringAddress, kStringCheater,
kStringNotEnoughMoney, kStringTaxiAccelerating, kString5MinutesLater, kStringAlreadyHavePole, kStringSawPole,
-kStringOnlyShop, kString216, kString217, kString218, kString219,
+kStringOnlyShop, kStringCabinOccupiedSay, kString217, kString218, kString219,
kString220, kString221, kString222, kString223, kString224,
kString225, kString226, kString227, kString228, kString229,
kString230, kString231, kString232, kString233, kString234,
@@ -186,8 +186,8 @@ kStringSpaceship, kStringSpaceshipDescription, kStringVehicles, kStringVehiclesD
kStringVehicleDescription, kStringEntranceDescription, kStringWallet, kStringWalletDescription, kStringDevice,
kStringDeviceDescription, kStringIdCard, kStringIdCardDescription, kStringStaircase, kStringStaircaseDescription,
kStringBusinessStreet, kStringBusinessStreetDescription, kStringRod, kStringPost, kStringRailing,
-kString300, kString301, kString302, kString303, kString304,
-kString305, kString306, kString307, kString308, kString309,
+kStringPoster, kStringPosterDescription, kStringCabin, kStringCabinFree, kStringCabinOccupied,
+kStringFeet, kStringFeetDescription, kString307, kString308, kString309,
kString310, kString311, kString312, kString313, kString314,
kString315, kString316, kString317, kString318, kString319,
kString320, kString321, kString322, kString323, kString324,
diff --git a/engines/supernova2/rooms.cpp b/engines/supernova2/rooms.cpp
index a5ea68fb2a..9f93e770c6 100644
--- a/engines/supernova2/rooms.cpp
+++ b/engines/supernova2/rooms.cpp
@@ -702,4 +702,36 @@ bool Street::interact(Action verb, Object &obj1, Object &obj2) {
return true;
}
+Games::Games(Supernova2Engine *vm, GameManager *gm) {
+ _vm = vm;
+ _gm = gm;
+
+ _fileNumber = 6;
+ _id = GAMES;
+ _shown[0] = kShownTrue;
+
+ _objectState[0] = Object(_id, kStringPoster, kStringPosterDescription, POSTER, UNNECESSARY, 3, 3, 0);
+ _objectState[1] = Object(_id, kStringCabin, kStringCabinFree, NULLOBJECT, EXIT, 1, 1, 0, CABIN, 9);
+ _objectState[2] = Object(_id, kStringCabin, kStringCabinOccupied, OCCUPIED_CABIN, NULLTYPE, 0, 0, 0);
+ _objectState[3] = Object(_id, kStringFeet, kStringFeetDescription, NULLOBJECT, NULLTYPE, 2, 2, 0);
+ _objectState[4] = Object(_id, kStringExit, kStringDefaultDescription, NULLOBJECT, EXIT, 255, 255, 0, STREET, 22);
+}
+
+void Games::onEntrance() {
+ setRoomSeen(true);
+}
+
+bool Games::interact(Action verb, Object &obj1, Object &obj2) {
+ if (verb == ACTION_WALK && obj1._id == OCCUPIED_CABIN) {
+ _vm->renderMessage(kStringCabinOccupiedSay);
+ }
+ else if (verb == ACTION_LOOK && obj1._id == POSTER) {
+ _gm->_taxi_possibility &= ~4; // add culture palace
+ return false;
+ }
+ else
+ return false;
+ return true;
+}
+
}
diff --git a/engines/supernova2/rooms.h b/engines/supernova2/rooms.h
index 15bdea6cb2..8c595b4c01 100644
--- a/engines/supernova2/rooms.h
+++ b/engines/supernova2/rooms.h
@@ -120,5 +120,13 @@ public:
private:
};
+class Games : public Room {
+public:
+ Games(Supernova2Engine *vm, GameManager *gm);
+ virtual void onEntrance();
+ virtual bool interact(Action verb, Object &obj1, Object &obj2);
+
+private:
+};
}
#endif // SUPERNOVA2_ROOMS_H
diff --git a/engines/supernova2/state.cpp b/engines/supernova2/state.cpp
index d179011b37..2751db7ec0 100644
--- a/engines/supernova2/state.cpp
+++ b/engines/supernova2/state.cpp
@@ -53,7 +53,7 @@ bool GameManager::serialize(Common::WriteStream *out) {
// Rooms
out->writeByte(_currentRoom->getId());
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 5; ++i) {
_rooms[i]->serialize(out);
}
@@ -86,7 +86,7 @@ bool GameManager::deserialize(Common::ReadStream *in, int version) {
// Rooms
RoomId curRoomId = static_cast<RoomId>(in->readByte());
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 5; ++i) {
_rooms[i]->deserialize(in, version);
}
changeRoom(curRoomId);
@@ -227,6 +227,7 @@ void GameManager::destroyRooms() {
delete _rooms[AIRPORT];
delete _rooms[TAXISTAND];
delete _rooms[STREET];
+ delete _rooms[GAMES];
}
void GameManager::initState() {
@@ -273,6 +274,7 @@ void GameManager::initRooms() {
_rooms[AIRPORT] = new Airport(_vm, this);
_rooms[TAXISTAND] = new TaxiStand(_vm, this);
_rooms[STREET] = new Street(_vm, this);
+ _rooms[GAMES] = new Games(_vm, this);
}
void GameManager::initGui() {