SUPERNOVA2: Add partialy implemented checkout room

This commit is contained in:
Jaromir Wysoglad 2019-06-04 15:47:49 +02:00 committed by Thierry Crozat
parent 856b387641
commit 93561220b7
4 changed files with 43 additions and 19 deletions

View File

@ -81,7 +81,7 @@ enum Action {
enum RoomId { enum RoomId {
INTRO,AIRPORT,TAXISTAND,STREET,GAMES,CABIN,KIOSK, INTRO,AIRPORT,TAXISTAND,STREET,GAMES,CABIN,KIOSK,
CULTURE_PALACE,CASHBOX,CITY1,CITY2,ELEVATOR,APARTMENT,SHIP, CULTURE_PALACE,CHECKOUT,CITY1,CITY2,ELEVATOR,APARTMENT,SHIP,
PYRAMID,PYR_ENTRANCE,UPSTAIRS1,DOWNSTAIRS1, PYRAMID,PYR_ENTRANCE,UPSTAIRS1,DOWNSTAIRS1,
BOTTOM_RIGHT_DOOR,BOTTOM_LEFT_DOOR,UPSTAIRS2,DOWNSTAIRS2, BOTTOM_RIGHT_DOOR,BOTTOM_LEFT_DOOR,UPSTAIRS2,DOWNSTAIRS2,
@ -209,8 +209,8 @@ kString395, kString396, kString397, kString398, kString399,
kString400, kString401, kString402, kString403, kString404, kString400, kString401, kString402, kString403, kString404,
kString405, kString406, kString407, kString408, kString409, kString405, kString406, kString407, kString408, kString409,
kString410, kString411, kString412, kString413, kString414, kString410, kString411, kString412, kString413, kString414,
kString415, kString416, kString417, kString418, kString419, kString415, kStringAtMusicContest, kStringNoImitation, kStringGoodJoke, kStringCommon,
kString420, kString421, kString422, kString423, kString424, kStringIWillProof, kStringIWillPerform, kString422, kString423, kString424,
kString425, kString426, kString427, kString428, kString429, kString425, kString426, kString427, kString428, kString429,
kString430, kString431, kString432, kString433, kString434, kString430, kString431, kString432, kString433, kString434,
kString435, kString436, kString437, kString438, kString439, kString435, kString436, kString437, kString438, kString439,
@ -236,7 +236,7 @@ kString530, kString531, kString532, kString533, kString534,
kString535, kString536, kString537, kString538, kString539, kString535, kString536, kString537, kString538, kString539,
kString540, kString541, kString542, kString543, kString544, kString540, kString541, kString542, kString543, kString544,
kString545, kString546, kStringFascinating, kStringTaxis, kStringTaxisDescription, kString545, kString546, kStringFascinating, kStringTaxis, kStringTaxisDescription,
kStringAxacussan, kStringParticipationCard, kString552, kString553, kString554, kStringAxacussan, kStringParticipationCard, kStringAxacussian, kString553, kString554,
kString555, kString556, kString557, kString558, kString559, kString555, kString556, kString557, kString558, kString559,
kString560, kString561, kString562, kString563, kString564, kString560, kString561, kString562, kString563, kString564,
kString565, kString566, kString567, kString568, kString569, kString565, kString566, kString567, kString568, kString569,
@ -249,7 +249,7 @@ kStringIntroTV3, kStringIntroTV4, kStringIntroTV5, kStringIntroTV6, kStringIntro
kStringIntroTV8, kStringIntroTV9, kStringIntroTV10, kStringIntroTV11, kStringIntroTV12, kStringIntroTV8, kStringIntroTV9, kStringIntroTV10, kStringIntroTV11, kStringIntroTV12,
kStringIntroTV13, kStringIntroTV14, kStringIntroTV15, kStringIntroTV16, kStringIntro9, kStringIntroTV13, kStringIntroTV14, kStringIntroTV15, kStringIntroTV16, kStringIntro9,
kStringIntro10, kStringIntro11, kStringIntro12, kStringIntro13, kStringIntro14, kStringIntro10, kStringIntro11, kStringIntro12, kStringIntro13, kStringIntro14,
kStringDialogSeparator, kStringForMusicConcert kStringDialogSeparator
}; };
ObjectType operator|(ObjectType a, ObjectType b); ObjectType operator|(ObjectType a, ObjectType b);

View File

@ -1003,7 +1003,7 @@ CulturePalace::CulturePalace(Supernova2Engine *vm, GameManager *gm) {
_var2 = false; _var2 = false;
_var3 = false; _var3 = false;
_objectState[0] = Object(_id, kStringExit, kStringDefaultDescription, NULLOBJECT, EXIT, 1, 1, 0, CASHBOX, 6); _objectState[0] = Object(_id, kStringEntrance, kStringDefaultDescription, NULLOBJECT, EXIT, 1, 1, 0, CHECKOUT, 6);
_objectState[1] = Object(_id, kStringCulturePalace, kStringFascinating, NULLOBJECT, NULLTYPE, 0, 0, 0); _objectState[1] = Object(_id, kStringCulturePalace, kStringFascinating, NULLOBJECT, NULLTYPE, 0, 0, 0);
_objectState[2] = Object(_id, kStringTaxis, kStringTaxisDescription, NULLOBJECT, NULLTYPE, 3, 3, 0); _objectState[2] = Object(_id, kStringTaxis, kStringTaxisDescription, NULLOBJECT, NULLTYPE, 3, 3, 0);
_objectState[3] = Object(_id, kStringAxacussan, kStringDefaultDescription, AXACUSSER, TALK, 4, 4, 0); _objectState[3] = Object(_id, kStringAxacussan, kStringDefaultDescription, AXACUSSER, TALK, 4, 4, 0);
@ -1041,11 +1041,10 @@ void CulturePalace::notEnoughMoney() {
} }
bool CulturePalace::interact(Action verb, Object &obj1, Object &obj2) { bool CulturePalace::interact(Action verb, Object &obj1, Object &obj2) {
static StringId dial1[4] = { static StringId dial1[3] = {
kStringHorstHummel, kStringHorstHummel,
kStringNiceWeather, kStringNiceWeather,
kStringTellTicket, kStringTellTicket,
kStringForMusicConcert
}; };
static byte dials1[] = {1, 1, 2}; static byte dials1[] = {1, 1, 2};
@ -1133,7 +1132,7 @@ bool CulturePalace::interact(Action verb, Object &obj1, Object &obj2) {
_gm->reply(kStringIdiot, 0, 0); _gm->reply(kStringIdiot, 0, 0);
_var2 = false; _var2 = false;
_var3 = true; _var3 = true;
_gm->_rooms[CASHBOX]->addSentence(1,1); _gm->_rooms[CHECKOUT]->addSentence(1,1);
_gm->drawStatus(); _gm->drawStatus();
_gm->drawInventory(); _gm->drawInventory();
_gm->drawMapExits(); _gm->drawMapExits();
@ -1155,23 +1154,45 @@ bool CulturePalace::interact(Action verb, Object &obj1, Object &obj2) {
return true; return true;
} }
Cashbox::Cashbox(Supernova2Engine *vm, GameManager *gm) { Checkout::Checkout(Supernova2Engine *vm, GameManager *gm) {
_vm = vm; _vm = vm;
_gm = gm; _gm = gm;
_fileNumber = 6; _fileNumber = 21;
_id = CASHBOX; _id = CHECKOUT;
_shown[0] = kShownTrue; _shown[0] = kShownTrue;
_var1 = false;
_var2 = false;
_var3 = false;
_objectState[0] = Object(_id, kStringEntrance, kStringDefaultDescription, KP_ENTRANCE, EXIT, 0, 0, 0, NULLROOM, 3);
_objectState[1] = Object(_id, kStringExit, kStringDefaultDescription, NULLOBJECT, EXIT, 255, 255, 0, CULTURE_PALACE, 22);
_objectState[2] = Object(_id, kStringAxacussian, kStringDefaultDescription, AXACUSSER, TALK, 1, 1, 0);
} }
void Cashbox::onEntrance() { void Checkout::onEntrance() {
if (!_var3) {
_var3 = true;
_gm->reply(kStringAtMusicContest, 1, 1 + 128);
_gm->say(kStringNoImitation);
_gm->reply(kStringGoodJoke, 1, 1 + 128);
_gm->say(kStringIAmHorstHummel);
_gm->reply(kStringCommon, 1, 1 + 128);
_gm->say(kStringIWillProof);
_gm->say(kStringIWillPerform);
_gm->drawStatus();
_gm->drawInventory();
_gm->drawMapExits();
_gm->drawCommandBox();
}
setRoomSeen(true); setRoomSeen(true);
} }
void Cashbox::animation() { void Checkout::animation() {
} }
bool Cashbox::interact(Action verb, Object &obj1, Object &obj2) { bool Checkout::interact(Action verb, Object &obj1, Object &obj2) {
return true; return true;
} }

View File

@ -166,14 +166,17 @@ private:
bool _var3; bool _var3;
}; };
class Cashbox : public Room { class Checkout : public Room {
public: public:
Cashbox(Supernova2Engine *vm, GameManager *gm); Checkout(Supernova2Engine *vm, GameManager *gm);
virtual void onEntrance(); virtual void onEntrance();
virtual void animation(); virtual void animation();
virtual bool interact(Action verb, Object &obj1, Object &obj2); virtual bool interact(Action verb, Object &obj1, Object &obj2);
private: private:
bool _var1;
bool _var2;
bool _var3;
}; };
class City1 : public Room { class City1 : public Room {

View File

@ -237,7 +237,7 @@ void GameManager::destroyRooms() {
delete _rooms[CABIN]; delete _rooms[CABIN];
delete _rooms[KIOSK]; delete _rooms[KIOSK];
delete _rooms[CULTURE_PALACE]; delete _rooms[CULTURE_PALACE];
delete _rooms[CASHBOX]; delete _rooms[CHECKOUT];
delete _rooms[CITY1]; delete _rooms[CITY1];
delete _rooms[CITY2]; delete _rooms[CITY2];
delete _rooms[ELEVATOR]; delete _rooms[ELEVATOR];
@ -353,7 +353,7 @@ void GameManager::initRooms() {
_rooms[CABIN] = new Cabin(_vm, this); _rooms[CABIN] = new Cabin(_vm, this);
_rooms[KIOSK] = new Kiosk(_vm, this); _rooms[KIOSK] = new Kiosk(_vm, this);
_rooms[CULTURE_PALACE] = new CulturePalace(_vm, this); _rooms[CULTURE_PALACE] = new CulturePalace(_vm, this);
_rooms[CASHBOX] = new Cashbox(_vm, this); _rooms[CHECKOUT] = new Checkout(_vm, this);
_rooms[CITY1] = new City1(_vm, this); _rooms[CITY1] = new City1(_vm, this);
_rooms[CITY2] = new City2(_vm, this); _rooms[CITY2] = new City2(_vm, this);
_rooms[ELEVATOR] = new Elevator(_vm, this); _rooms[ELEVATOR] = new Elevator(_vm, this);