MORTEVIELLE: Some more renaming

This commit is contained in:
Strangerke 2012-03-14 23:06:23 +01:00
parent 836b9513e6
commit 0919546917
8 changed files with 137 additions and 133 deletions

View file

@ -58,6 +58,7 @@ void MortevielleEngine::fctMove() {
if ((_anyone) || (_keyPressedEsc)) if ((_anyone) || (_keyPressedEsc))
return; return;
tcoord(1); tcoord(1);
if (g_num == 0) if (g_num == 0)
@ -83,83 +84,78 @@ void MortevielleEngine::fctMove() {
return; return;
} }
tsort(); tsort();
int cx = 1; int menuChoice = 1;
while (_menu._moveMenu[cx] != g_msg[4]) while (_menu._moveMenu[menuChoice] != g_msg[4])
++cx; ++menuChoice;
if (g_s._currPlace == MOUNTAIN) { if (g_s._currPlace == MOUNTAIN) {
if (cx == 1) if (menuChoice == 1)
gotoManorFront(); gotoManorFront();
if (cx == 2) else if (menuChoice == 2)
checkManorDistance(); checkManorDistance();
_menu.setDestinationMenuText(g_s._currPlace); _menu.setDestinationMenuText(g_s._currPlace);
return; return;
} } else if (g_s._currPlace == INSIDE_WELL) {
if (menuChoice == 1)
if (g_s._currPlace == ROOM23) { floodedInWell();
if (cx == 1) else if (menuChoice == 2)
t1deau();
if (cx == 2)
gotoManorBack(); gotoManorBack();
_menu.setDestinationMenuText(g_s._currPlace); _menu.setDestinationMenuText(g_s._currPlace);
return; return;
} } else if ((g_s._currPlace == BUREAU) && (menuChoice == 1))
menuChoice = 6;
if ((g_s._currPlace == BUREAU) && (cx == 1))
cx = 6;
else if (g_s._currPlace == KITCHEN) { else if (g_s._currPlace == KITCHEN) {
if (cx == 2) if (menuChoice == 2)
cx = 6; menuChoice = 6;
else if (cx == 5) else if (menuChoice == 5)
cx = 16; menuChoice = 16;
} } else if ((g_s._currPlace == CELLAR) && (menuChoice == 3))
menuChoice = 6;
else if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (menuChoice == 4))
menuChoice = 6;
if ((g_s._currPlace == CELLAR) && (cx == 3))
cx = 6;
if (((g_s._currPlace == LANDING) || (g_s._currPlace == ROOM26)) && (cx == 4))
cx = 6;
if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != ROOM26)) if ((g_s._currPlace > MOUNTAIN) && (g_s._currPlace != ROOM26))
cx += 10; menuChoice += 10;
if ((g_s._currPlace == CHAPEL) && (cx == 13))
cx = 16;
if (g_s._currPlace == MANOR_FRONT) {
if (cx == 12)
cx = 16;
else if (cx > 13)
cx = 15;
}
if ((g_s._currPlace == MANOR_BACK) && (cx > 14))
cx = 15;
else if ((g_s._currPlace == WELL) && (cx > 13) && (cx != 17))
cx = 15;
if (cx == 1) if ((g_s._currPlace == CHAPEL) && (menuChoice == 13))
menuChoice = 16;
else if (g_s._currPlace == MANOR_FRONT) {
if (menuChoice == 12)
menuChoice = 16;
else if (menuChoice > 13)
menuChoice = 15;
} else if ((g_s._currPlace == MANOR_BACK) && (menuChoice > 14))
menuChoice = 15;
else if ((g_s._currPlace == WELL) && (menuChoice > 13) && (menuChoice != 17))
menuChoice = 15;
if (menuChoice == 1)
g_s._currPlace = BUREAU; g_s._currPlace = BUREAU;
else if (cx == 2) else if (menuChoice == 2)
g_s._currPlace = KITCHEN; g_s._currPlace = KITCHEN;
else if (cx == 3) else if (menuChoice == 3)
g_s._currPlace = CELLAR; g_s._currPlace = CELLAR;
else if (cx == 4) else if (menuChoice == 4)
g_s._currPlace = LANDING; g_s._currPlace = LANDING;
else if (cx == 5) else if (menuChoice == 5)
cx = 12; menuChoice = 12;
else if (cx == 6) else if (menuChoice == 6)
cx = 11; menuChoice = 11;
if (cx == 11) if (menuChoice == 11)
gotoDiningRoom(); gotoDiningRoom();
else if (cx == 12) else if (menuChoice == 12)
gotoManorFront(); gotoManorFront();
else if (cx == 13) else if (menuChoice == 13)
g_s._currPlace = CHAPEL; g_s._currPlace = CHAPEL;
else if (cx == 14) else if (menuChoice == 14)
g_s._currPlace = WELL; g_s._currPlace = WELL;
else if (cx == 15) else if (menuChoice == 15)
checkManorDistance(); checkManorDistance();
else if (cx == 16) else if (menuChoice == 16)
gotoManorBack(); gotoManorBack();
else if (cx == 17) { else if (menuChoice == 17) {
if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140)) if ((g_s._wellObjectId != 120) && (g_s._wellObjectId != 140))
g_crep = 997; g_crep = 997;
else if (g_s._wellObjectId == 120) else if (g_s._wellObjectId == 120)
@ -168,11 +164,11 @@ void MortevielleEngine::fctMove() {
g_crep = 1505; g_crep = 1505;
loseGame(); loseGame();
} else { } else {
g_s._currPlace = ROOM23; g_s._currPlace = INSIDE_WELL;
affrep(); affrep();
} }
} }
if ((cx < 5) || (cx == 13) || (cx == 14)) if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
affrep(); affrep();
debloc(g_s._currPlace); debloc(g_s._currPlace);
_menu.setDestinationMenuText(g_s._currPlace); _menu.setDestinationMenuText(g_s._currPlace);
@ -187,7 +183,7 @@ void MortevielleEngine::fctTake() {
int cx = g_caff; int cx = g_caff;
avpoing(cx); avpoing(cx);
if (g_crep != 139) { if (g_crep != 139) {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 3; g_s._faithScore += 3;
if (_obpart) { if (_obpart) {
if (g_s._currPlace == PURPLE_ROOM) if (g_s._currPlace == PURPLE_ROOM)
@ -237,7 +233,7 @@ void MortevielleEngine::fctTake() {
if ((g_num == 0) || ((g_num == 1) && (g_s._currPlace == CRYPT))) { if ((g_num == 0) || ((g_num == 1) && (g_s._currPlace == CRYPT))) {
tcoord(8); tcoord(8);
if (g_num != 0) { if (g_num != 0) {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 3; g_s._faithScore += 3;
g_crep = 997; g_crep = 997;
if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0)) if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
@ -276,15 +272,22 @@ void MortevielleEngine::fctTake() {
g_crep = 999; g_crep = 999;
} }
} else { } else {
if ( ((g_s._currPlace == OWN_ROOM) && (g_num == 3)) || ((g_s._currPlace == GREEN_ROOM) && (g_num == 4)) if ( ((g_s._currPlace == OWN_ROOM) && (g_num == 3))
|| ((g_s._currPlace == PURPLE_ROOM) && (g_num == 1)) || ((g_s._currPlace == DARKBLUE_ROOM) && (g_num == 3)) || ((g_s._currPlace == GREEN_ROOM) && (g_num == 4))
|| ((g_s._currPlace == BLUE_ROOM) && (g_num == 6)) || ((g_s._currPlace == RED_ROOM) && (g_num == 2)) || ((g_s._currPlace == PURPLE_ROOM) && (g_num == 1))
|| ((g_s._currPlace == BATHROOM) && (g_num == 6)) || ((g_s._currPlace == GREEN_ROOM2) && (g_num == 4)) || ((g_s._currPlace == DARKBLUE_ROOM) && (g_num == 3))
|| ((g_s._currPlace == 9) && (g_num == 4)) || ((g_s._currPlace == DINING_ROOM) && (g_num > 2)) || ((g_s._currPlace == BLUE_ROOM) && (g_num == 6))
|| ((g_s._currPlace == BUREAU) && (g_num == 7)) || ((g_s._currPlace == KITCHEN) && (g_num == 6)) || ((g_s._currPlace == RED_ROOM) && (g_num == 2))
|| ((g_s._currPlace == ATTIC) && (g_num > 4)) || ((g_s._currPlace > ATTIC) && (g_s._currPlace != ROOM23)) ) || ((g_s._currPlace == BATHROOM) && (g_num == 6))
|| ((g_s._currPlace == GREEN_ROOM2) && (g_num == 4))
|| ((g_s._currPlace == ROOM9) && (g_num == 4))
|| ((g_s._currPlace == DINING_ROOM) && (g_num > 2))
|| ((g_s._currPlace == BUREAU) && (g_num == 7))
|| ((g_s._currPlace == KITCHEN) && (g_num == 6))
|| ((g_s._currPlace == ATTIC) && (g_num > 4))
|| ((g_s._currPlace > ATTIC) && (g_s._currPlace != INSIDE_WELL)) )
g_crep = 997; g_crep = 997;
else if (g_s._currPlace == ROOM23) { else if (g_s._currPlace == INSIDE_WELL) {
g_crep = 1504; g_crep = 1504;
loseGame(); loseGame();
} else } else
@ -331,7 +334,7 @@ void MortevielleEngine::fctLift() {
if (g_num == 0) { if (g_num == 0) {
tcoord(8); tcoord(8);
if (g_num != 0) { if (g_num != 0) {
if (g_ipers > 0) if (_currBitIndex > 0)
++g_s._faithScore; ++g_s._faithScore;
g_crep = 997; g_crep = 997;
if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0)) if ((g_s._currPlace == PURPLE_ROOM) && (g_s._purpleRoomObjectId != 0))
@ -339,7 +342,7 @@ void MortevielleEngine::fctLift() {
} }
return; return;
} }
if (g_ipers > 0) if (_currBitIndex > 0)
++g_s._faithScore; ++g_s._faithScore;
int tmpPlace = g_s._currPlace; int tmpPlace = g_s._currPlace;
if (g_s._currPlace == CRYPT) if (g_s._currPlace == CRYPT)
@ -489,7 +492,7 @@ void MortevielleEngine::fctSearch() {
if (_anyone || _keyPressedEsc) if (_anyone || _keyPressedEsc)
return; return;
if (g_s._currPlace == ROOM23) { if (g_s._currPlace == INSIDE_WELL) {
g_crep = 1504; g_crep = 1504;
loseGame(); loseGame();
return; return;
@ -506,7 +509,7 @@ void MortevielleEngine::fctSearch() {
if (g_num != ord(g_touv[cx])) if (g_num != ord(g_touv[cx]))
g_crep = 187; g_crep = 187;
else { else {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 3; g_s._faithScore += 3;
rechai(g_mchai); rechai(g_mchai);
@ -523,7 +526,7 @@ void MortevielleEngine::fctSearch() {
tcoord(8); tcoord(8);
g_crep = 997; g_crep = 997;
if (g_num != 0) { if (g_num != 0) {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 3; g_s._faithScore += 3;
if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) { if ((g_s._currPlace != WELL) && (g_s._currPlace != SECRET_PASSAGE) && (g_s._currPlace != ATTIC)) {
if (g_s._currPlace == PURPLE_ROOM) { if (g_s._currPlace == PURPLE_ROOM) {
@ -540,7 +543,7 @@ void MortevielleEngine::fctSearch() {
} }
} }
} else { } else {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 3; g_s._faithScore += 3;
g_crep = 997; g_crep = 997;
if (g_s._currPlace < CELLAR) if (g_s._currPlace < CELLAR)
@ -602,7 +605,7 @@ void MortevielleEngine::fctOpen() {
tcoord(7); tcoord(7);
if (g_num != 0) { if (g_num != 0) {
if (g_ipers > 0) if (_currBitIndex > 0)
g_s._faithScore += 2; g_s._faithScore += 2;
++g_iouv; ++g_iouv;
int tmpPlace = 0; int tmpPlace = 0;
@ -705,8 +708,8 @@ void MortevielleEngine::fctPlace() {
showMouse(); showMouse();
tinke(); tinke();
drawClock(); drawClock();
if (g_ipers != 0) if (_currBitIndex != 0)
showPeoplePresent(g_ipers); showPeoplePresent(_currBitIndex);
else else
displayAloneText(); displayAloneText();
@ -1027,7 +1030,7 @@ void MortevielleEngine::fctSelfPut() {
} }
} }
} }
if (g_caff == ROOM23) if (g_caff == INSIDE_WELL)
g_crep = 185; g_crep = 185;
if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) { if ((g_crep == 999) || (g_crep == 185) || (g_crep == 998)) {
if (g_crep == 999) if (g_crep == 999)
@ -1046,7 +1049,7 @@ void MortevielleEngine::fctListen() {
if (g_s._currPlace != ROOM26) if (g_s._currPlace != ROOM26)
g_crep = 101; g_crep = 101;
else { else {
if (g_ipers != 0) if (_currBitIndex != 0)
++g_s._faithScore; ++g_s._faithScore;
int p, rand; int p, rand;
ecfren(p, rand, g_s._faithScore, g_ment); ecfren(p, rand, g_s._faithScore, g_ment);
@ -1171,7 +1174,7 @@ void MortevielleEngine::fctEnter() {
_menu.setDestinationMenuText(g_s._currPlace); _menu.setDestinationMenuText(g_s._currPlace);
g_ment = 0; g_ment = 0;
g_mpers = 0; g_mpers = 0;
g_ipers = 0; _currBitIndex = 0;
} }
} }
} }
@ -1266,7 +1269,7 @@ void MortevielleEngine::fctLeave() {
g_crep = 176; g_crep = 176;
} else if (g_s._currPlace == SECRET_PASSAGE) } else if (g_s._currPlace == SECRET_PASSAGE)
nextPlace = t23coul(); nextPlace = t23coul();
else if (g_s._currPlace == ROOM23) else if (g_s._currPlace == INSIDE_WELL)
nextPlace = WELL; nextPlace = WELL;
if (g_crep != 997) if (g_crep != 997)
@ -1294,13 +1297,13 @@ void MortevielleEngine::fctWait() {
tinke(); tinke();
if (!_blo) if (!_blo)
t11(g_s._currPlace); t11(g_s._currPlace);
if ((g_ipers != 0) && (g_mpers == 0)) { if ((_currBitIndex != 0) && (g_mpers == 0)) {
g_crep = 998; g_crep = 998;
if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR))
cavegre(); cavegre();
if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM)) if ((g_s._currPlace > OWN_ROOM) && (g_s._currPlace < DINING_ROOM))
_anyone = true; _anyone = true;
g_mpers = g_ipers; g_mpers = _currBitIndex;
if (!_anyone) if (!_anyone)
tinke(); tinke();
return; return;
@ -1517,7 +1520,7 @@ void MortevielleEngine::fctDiscuss() {
hirs(); hirs();
drawRightFrame(); drawRightFrame();
showMouse(); showMouse();
showPeoplePresent(g_ipers); showPeoplePresent(_currBitIndex);
tinke(); tinke();
drawClock(); drawClock();
affrep(); affrep();

View file

@ -558,54 +558,54 @@ void MortevielleEngine::resetPresenceInRooms(int roomId) {
* Engine function - Show the people present in the given room * Engine function - Show the people present in the given room
* @remarks Originally called 'affper' * @remarks Originally called 'affper'
*/ */
void MortevielleEngine::showPeoplePresent(int per) { void MortevielleEngine::showPeoplePresent(int bitIndex) {
int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2); int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
for (int i = 1; i <= 8; ++i) for (int i = 1; i <= 8; ++i)
_menu.disableMenuItem(_menu._discussMenu[i]); _menu.disableMenuItem(_menu._discussMenu[i]);
clearScreenType10(); clearScreenType10();
if ((per & 128) == 128) { if ((bitIndex & 128) == 128) {
_screenSurface.putxy(xp, 24); _screenSurface.putxy(xp, 24);
_screenSurface.drawString("LEO", 4); _screenSurface.drawString("LEO", 4);
_menu.enableMenuItem(_menu._discussMenu[1]); _menu.enableMenuItem(_menu._discussMenu[1]);
} }
if ((per & 64) == 64) { if ((bitIndex & 64) == 64) {
_screenSurface.putxy(xp, 32); _screenSurface.putxy(xp, 32);
_screenSurface.drawString("PAT", 4); _screenSurface.drawString("PAT", 4);
_menu.enableMenuItem(_menu._discussMenu[2]); _menu.enableMenuItem(_menu._discussMenu[2]);
} }
if ((per & 32) == 32) { if ((bitIndex & 32) == 32) {
_screenSurface.putxy(xp, 40); _screenSurface.putxy(xp, 40);
_screenSurface.drawString("GUY", 4); _screenSurface.drawString("GUY", 4);
_menu.enableMenuItem(_menu._discussMenu[3]); _menu.enableMenuItem(_menu._discussMenu[3]);
} }
if ((per & 16) == 16) { if ((bitIndex & 16) == 16) {
_screenSurface.putxy(xp, 48); _screenSurface.putxy(xp, 48);
_screenSurface.drawString("EVA", 4); _screenSurface.drawString("EVA", 4);
_menu.enableMenuItem(_menu._discussMenu[4]); _menu.enableMenuItem(_menu._discussMenu[4]);
} }
if ((per & 8) == 8) { if ((bitIndex & 8) == 8) {
_screenSurface.putxy(xp, 56); _screenSurface.putxy(xp, 56);
_screenSurface.drawString("BOB", 4); _screenSurface.drawString("BOB", 4);
_menu.enableMenuItem(_menu._discussMenu[5]); _menu.enableMenuItem(_menu._discussMenu[5]);
} }
if ((per & 4) == 4) { if ((bitIndex & 4) == 4) {
_screenSurface.putxy(xp, 64); _screenSurface.putxy(xp, 64);
_screenSurface.drawString("LUC", 4); _screenSurface.drawString("LUC", 4);
_menu.enableMenuItem(_menu._discussMenu[6]); _menu.enableMenuItem(_menu._discussMenu[6]);
} }
if ((per & 2) == 2) { if ((bitIndex & 2) == 2) {
_screenSurface.putxy(xp, 72); _screenSurface.putxy(xp, 72);
_screenSurface.drawString("IDA", 4); _screenSurface.drawString("IDA", 4);
_menu.enableMenuItem(_menu._discussMenu[7]); _menu.enableMenuItem(_menu._discussMenu[7]);
} }
if ((per & 1) == 1) { if ((bitIndex & 1) == 1) {
_screenSurface.putxy(xp, 80); _screenSurface.putxy(xp, 80);
_screenSurface.drawString("MAX", 4); _screenSurface.drawString("MAX", 4);
_menu.enableMenuItem(_menu._discussMenu[8]); _menu.enableMenuItem(_menu._discussMenu[8]);
} }
g_ipers = per; _currBitIndex = bitIndex;
} }
/** /**
@ -771,7 +771,7 @@ void MortevielleEngine::displayAloneText() {
_screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70); _screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
_screenSurface.drawString(sAlone, 4); _screenSurface.drawString(sAlone, 4);
g_ipers = 0; _currBitIndex = 0;
} }
int chlm() { int chlm() {
@ -843,7 +843,7 @@ void debloc(int roomId) {
g_y = 0; g_y = 0;
if ((roomId != ROOM26) && (roomId != LANDING)) if ((roomId != ROOM26) && (roomId != LANDING))
g_vm->resetPresenceInRooms(roomId); g_vm->resetPresenceInRooms(roomId);
g_mpers = g_ipers; g_mpers = g_vm->_currBitIndex;
} }
/** /**
@ -989,7 +989,7 @@ void MortevielleEngine::setPresenceGreenRoom(int roomId) {
_roomPresenceEva = true; _roomPresenceEva = true;
} }
g_ipers = 10; _currBitIndex = 10;
} }
/** /**
@ -1002,7 +1002,7 @@ void MortevielleEngine::setPresencePurpleRoom() {
else else
_room9PresenceLeo = true; _room9PresenceLeo = true;
g_ipers = 10; _currBitIndex = 10;
} }
/** /**
@ -1011,7 +1011,7 @@ void MortevielleEngine::setPresencePurpleRoom() {
*/ */
void MortevielleEngine::setPresenceBlueRoom() { void MortevielleEngine::setPresenceBlueRoom() {
_roomPresenceMax = true; _roomPresenceMax = true;
g_ipers = 10; _currBitIndex = 10;
} }
/** /**
@ -1024,7 +1024,7 @@ void MortevielleEngine::setPresenceRedRoom(int roomId) {
else if (roomId == GREEN_ROOM2) else if (roomId == GREEN_ROOM2)
_roomPresencePat = true; _roomPresencePat = true;
g_ipers = 10; _currBitIndex = 10;
} }
/** /**
@ -1310,7 +1310,7 @@ void phaz(int &rand, int &p, int cf) {
void resetVariables() { void resetVariables() {
copcha(); copcha();
g_s._ipre = false; g_s._alreadyEnteredManor = false;
g_s._selectedObjectId = 0; g_s._selectedObjectId = 0;
g_s._cellarObjectId = 0; g_s._cellarObjectId = 0;
g_s._atticBallHoleObjectId = 0; g_s._atticBallHoleObjectId = 0;
@ -1358,7 +1358,7 @@ void resetVariables() {
void MortevielleEngine::initGame() { void MortevielleEngine::initGame() {
_place = MANOR_FRONT; _place = MANOR_FRONT;
g_jh = 0; g_jh = 0;
if (!g_s._ipre) if (!g_s._alreadyEnteredManor)
_blo = true; _blo = true;
g_t = kTime1; g_t = kTime1;
g_mh = readclock(); g_mh = readclock();
@ -1654,7 +1654,7 @@ void musique(int so) {
if (so == 0) { if (so == 0) {
/* musik(0) */ /* musik(0) */
; ;
} else if ((g_prebru == 0) && (!g_s._ipre)) { } else if ((g_prebru == 0) && (!g_s._alreadyEnteredManor)) {
g_vm->_speechManager.startSpeech(10, 1, 1); g_vm->_speechManager.startSpeech(10, 1, 1);
++g_prebru; ++g_prebru;
} else { } else {
@ -1674,7 +1674,7 @@ void musique(int so) {
g_vm->_speechManager.startSpeech(12, 1, 1); g_vm->_speechManager.startSpeech(12, 1, 1);
i = true; i = true;
} }
} else if (g_s._currPlace == ROOM23) { } else if (g_s._currPlace == INSIDE_WELL) {
g_vm->_speechManager.startSpeech(13, 1, 1); g_vm->_speechManager.startSpeech(13, 1, 1);
i = true; i = true;
} }
@ -1839,14 +1839,14 @@ void tinke() {
g_vm->setRandomPresenceChapel(cf); g_vm->setRandomPresenceChapel(cf);
break; break;
} }
if ((g_mpers != 0) && (g_ipers != 10)) if ((g_mpers != 0) && (g_vm->_currBitIndex != 10))
g_mpers = g_ipers; g_mpers = g_vm->_currBitIndex;
if ((g_mpers == 0) && (g_ipers > 0)) { if ((g_mpers == 0) && (g_vm->_currBitIndex > 0)) {
if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) { if ((g_s._currPlace == ATTIC) || (g_s._currPlace == CELLAR)) {
cavegre(); cavegre();
} else if (g_ipers == 10) { } else if (g_vm->_currBitIndex == 10) {
g_ipers = 0; g_vm->_currBitIndex = 0;
if (!g_vm->_brt) { if (!g_vm->_brt) {
g_vm->_brt = true; g_vm->_brt = true;
g_hdb = readclock(); g_hdb = readclock();
@ -1901,7 +1901,7 @@ void afdes(int ad) {
} }
void tkey1(bool d) { void tkey1(bool d) {
bool quest; bool quest = false;
int x, y, c; int x, y, c;
hideMouse(); hideMouse();
@ -2142,9 +2142,9 @@ void MortevielleEngine::gotoDiningRoom() {
loseGame(); loseGame();
} else } else
st1sama(); st1sama();
} else if (!g_s._ipre) { //Is it your first time? } else if (!g_s._alreadyEnteredManor) { //Is it your first time?
g_ipers = 255; _currBitIndex = 255; // Everybody is present
g_vm->showPeoplePresent(g_ipers); g_vm->showPeoplePresent(_currBitIndex);
g_caff = 77; g_caff = 77;
afdes(0); afdes(0);
g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15); g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
@ -2163,9 +2163,9 @@ void MortevielleEngine::gotoDiningRoom() {
g_vm->resetPresenceInRooms(DINING_ROOM); g_vm->resetPresenceInRooms(DINING_ROOM);
if (!g_vm->_blo) if (!g_vm->_blo)
minute = t11(OWN_ROOM); minute = t11(OWN_ROOM);
g_ipers = 0; _currBitIndex = 0;
g_mpers = 0; g_mpers = 0;
g_s._ipre = true; g_s._alreadyEnteredManor = true;
} else } else
st1sama(); st1sama();
} }
@ -2210,7 +2210,11 @@ void MortevielleEngine::gotoManorBack() {
affrep(); affrep();
} }
void t1deau() { /**
* Engine function - Dead : Flooded in Well
* @remarks Originally called 't1deau'
*/
void MortevielleEngine::floodedInWell() {
g_crep = 1503; g_crep = 1503;
g_vm->loseGame(); g_vm->loseGame();
} }
@ -2245,7 +2249,7 @@ L1:
g_s._faithScore += 3 * (g_s._faithScore / 10); g_s._faithScore += 3 * (g_s._faithScore / 10);
tsort(); tsort();
g_vm->_menu.setDestinationMenuText(LANDING); g_vm->_menu.setDestinationMenuText(LANDING);
int cx = convertBitIndexToCharacterIndex(g_ipers); int cx = convertBitIndexToCharacterIndex(g_vm->_currBitIndex);
g_caff = 69 + cx; g_caff = 69 + cx;
g_crep = g_caff; g_crep = g_caff;
g_msg[3] = MENU_DISCUSS; g_msg[3] = MENU_DISCUSS;
@ -2288,7 +2292,7 @@ void tsuiv() {
++g_is; ++g_is;
g_caff = tbcl; g_caff = tbcl;
g_crep = g_caff + 400; g_crep = g_caff + 400;
if (g_ipers != 0) if (g_vm->_currBitIndex != 0)
g_s._faithScore += 2; g_s._faithScore += 2;
} else { } else {
affrep(); affrep();
@ -2490,8 +2494,8 @@ void changeGraphicalDevice(int newDevice) {
drawRightFrame(); drawRightFrame();
tinke(); tinke();
drawClock(); drawClock();
if (g_ipers != 0) if (g_vm->_currBitIndex != 0)
g_vm->showPeoplePresent(g_ipers); g_vm->showPeoplePresent(g_vm->_currBitIndex);
else else
g_vm->displayAloneText(); g_vm->displayAloneText();
clearScreenType2(); clearScreenType2();
@ -2659,8 +2663,8 @@ void MortevielleEngine::handleOpcode() {
if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) || if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
((hour > 0) && (hour < 6) && (g_s._currPlace != 0))) ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
++g_s._faithScore; ++g_s._faithScore;
if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != ROOM23) if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != INSIDE_WELL)
&& (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!_loseGame)) { && (g_s._currPlace != OWN_ROOM) && (g_s._selectedObjectId != 152) && (!_loseGame)) {
if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) { if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
g_crep = 1501; g_crep = 1501;
loseGame(); loseGame();

View file

@ -121,7 +121,6 @@ extern void premtet();
extern void ajchai(); extern void ajchai();
extern void ajjer(int ob); extern void ajjer(int ob);
extern void t1vier(); extern void t1vier();
extern void t1deau();
extern void tctrm(); extern void tctrm();
extern void quelquun(); extern void quelquun();
extern void tsuiv(); extern void tsuiv();

View file

@ -144,6 +144,7 @@ public:
int _newGraphicalDevice; int _newGraphicalDevice;
int _place; int _place;
int _manorDistance; int _manorDistance;
int _currBitIndex;
int _c_zzz; int _c_zzz;
@ -165,7 +166,6 @@ public:
bool _loseGame; // Lose game flag. Originally called 'perdu' bool _loseGame; // Lose game flag. Originally called 'perdu'
bool _txxFileFl; // Flag used to determine if texts are from the original files or from a DAT file bool _txxFileFl; // Flag used to determine if texts are from the original files or from a DAT file
MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc); MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
~MortevielleEngine(); ~MortevielleEngine();
virtual bool hasFeature(EngineFeature f) const; virtual bool hasFeature(EngineFeature f) const;
@ -258,7 +258,7 @@ public:
void loadPlaces(); void loadPlaces();
void initGame(); void initGame();
void resetPresenceInRooms(int roomId); void resetPresenceInRooms(int roomId);
void showPeoplePresent(int per); void showPeoplePresent(int bitIndex);
int selectCharacters(int min, int max); int selectCharacters(int min, int max);
void displayAloneText(); void displayAloneText();
@ -268,6 +268,7 @@ public:
void gotoDiningRoom(); void gotoDiningRoom();
bool checkInventory(int objectId); bool checkInventory(int objectId);
void loseGame(); void loseGame();
void floodedInWell();
}; };

View file

@ -377,7 +377,7 @@ void taffich() {
if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149)) if (((a > 69) && (a < 80)) || (a == 30) || (a == 31) || (a == 144) || (a == 147) || (a == 149))
m = 2030; m = 2030;
if (((a < 27) && (((g_maff > 69) && (!g_s._ipre)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33))) if (((a < 27) && (((g_maff > 69) && (!g_s._alreadyEnteredManor)) || (g_maff > 99))) || ((g_maff > 29) && (g_maff < 33)))
m = 2033; m = 2033;
g_maff = a; g_maff = a;

View file

@ -60,7 +60,7 @@ void SavegameManager::sync_save(Common::Serializer &sz) {
sz.syncAsSint16LE(g_s1._selectedObjectId); sz.syncAsSint16LE(g_s1._selectedObjectId);
sz.syncAsSint16LE(g_s1._purpleRoomObjectId); sz.syncAsSint16LE(g_s1._purpleRoomObjectId);
sz.syncAsSint16LE(g_s1._cryptObjectId); sz.syncAsSint16LE(g_s1._cryptObjectId);
sz.syncAsByte(g_s1._ipre); sz.syncAsByte(g_s1._alreadyEnteredManor);
sz.syncAsByte(g_s1._heure); sz.syncAsByte(g_s1._heure);
sz.syncBytes(g_bufcha, 391); sz.syncBytes(g_bufcha, 391);

View file

@ -109,7 +109,6 @@ int g_x,
g_mlec, g_mlec,
g_mchai, g_mchai,
g_menup, g_menup,
g_ipers,
g_mpers, g_mpers,
g_mnumo, g_mnumo,
g_xprec, g_xprec,

View file

@ -107,17 +107,16 @@ extern const byte g_rang[16];
/* /*
9 "A glance at the forbidden$", 9 "A glance at the forbidden$",
18 "It's already open$", 18 "It's already open$",
23 "Strange horoscope$",
26 "A photograph$", 26 "A photograph$",
27 "The coat of arms$", 27 "The coat of arms$",
*/ */
enum places { enum places {
OWN_ROOM = 0, GREEN_ROOM = 1, PURPLE_ROOM = 2, TOILETS = 3, DARKBLUE_ROOM = 4, OWN_ROOM = 0, GREEN_ROOM = 1, PURPLE_ROOM = 2, TOILETS = 3, DARKBLUE_ROOM = 4,
BLUE_ROOM = 5, RED_ROOM = 6, BATHROOM = 7, GREEN_ROOM2 = 8, ROOM9 = 9, BLUE_ROOM = 5, RED_ROOM = 6, BATHROOM = 7, GREEN_ROOM2 = 8, ROOM9 = 9,
DINING_ROOM = 10, BUREAU = 11, KITCHEN = 12, ATTIC = 13, CELLAR = 14, DINING_ROOM = 10, BUREAU = 11, KITCHEN = 12, ATTIC = 13, CELLAR = 14,
LANDING = 15, CRYPT = 16, SECRET_PASSAGE = 17, ROOM18 = 18, MOUNTAIN = 19, LANDING = 15, CRYPT = 16, SECRET_PASSAGE = 17, ROOM18 = 18, MOUNTAIN = 19,
CHAPEL = 20, MANOR_FRONT = 21, MANOR_BACK = 22, ROOM23 = 23, WELL = 24, CHAPEL = 20, MANOR_FRONT = 21, MANOR_BACK = 22, INSIDE_WELL = 23, WELL = 24,
DOOR = 25, ROOM26 = 26, ROOM27 = 27 DOOR = 25, ROOM26 = 26, ROOM27 = 27
}; };
@ -128,7 +127,7 @@ struct sav_chaine {
byte _sjer[31]; byte _sjer[31];
int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId; int _currPlace, _atticBallHoleObjectId, _atticRodHoleObjectId, _cellarObjectId, _secretPassageObjectId, _wellObjectId;
int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId; int _selectedObjectId, _purpleRoomObjectId, _cryptObjectId;
bool _ipre; bool _alreadyEnteredManor;
byte _heure; byte _heure;
}; };
@ -215,7 +214,6 @@ extern int g_x,
g_mlec, g_mlec,
g_mchai, g_mchai,
g_menup, g_menup,
g_ipers,
g_mpers, g_mpers,
g_mnumo, g_mnumo,
g_xprec, g_xprec,