diff options
Diffstat (limited to 'engines/mortevielle/actions.cpp')
-rw-r--r-- | engines/mortevielle/actions.cpp | 92 |
1 files changed, 43 insertions, 49 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 5738a8fd3a..73d258af6c 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -209,8 +209,8 @@ void MortevielleEngine::fctTake() { _obpart = false; prepareDisplayText(); } else { - _tabdon[kAcha + ((_mchai - 1) * 10) + _searchCount - 1] = 0; - tsuiv(); + _tabdon[kAcha + ((_curSearchObjId - 1) * 10) + _searchCount - 1] = 0; + prepareNextObject(); ++_takeObjCount; if (_takeObjCount > 6) { _coreVar._faithScore += 2; @@ -283,7 +283,7 @@ void MortevielleEngine::fctTake() { || ((_coreVar._currPlace == RED_ROOM) && (_num == 2)) || ((_coreVar._currPlace == BATHROOM) && (_num == 6)) || ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 4)) - || ((_coreVar._currPlace == ROOM9) && (_num == 4)) + || ((_coreVar._currPlace == JULIA_ROOM) && (_num == 4)) || ((_coreVar._currPlace == DINING_ROOM) && (_num > 2)) || ((_coreVar._currPlace == BUREAU) && (_num == 7)) || ((_coreVar._currPlace == KITCHEN) && (_num == 6)) @@ -457,7 +457,7 @@ void MortevielleEngine::fctLook() { treg(147); if ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 3)) treg(149); - if ((_coreVar._currPlace == ROOM9) && (_num == 2)) + if ((_coreVar._currPlace == JULIA_ROOM) && (_num == 2)) treg(30); if ((_coreVar._currPlace == DINING_ROOM) && (_num == 3)) treg(31); @@ -503,25 +503,23 @@ void MortevielleEngine::fctSearch() { if (_num == 0) { setCoordinates(7); if (_num != 0) { - int cx = 0; - do { - ++cx; - } while ((cx <= 6) && (_num != _openObjects[cx])); - if (_num != _openObjects[cx]) - _crep = 187; - else { + int i; + for (i = 1; (i <= 6) && (_num != _openObjects[i]); i++) + ; + if (_num == _openObjects[i]) { if (_currBitIndex > 0) _coreVar._faithScore += 3; - _mchai = rechai(); - if (_mchai != 0) { + _curSearchObjId = getFirstObject(); + if (_curSearchObjId != 0) { _searchCount = 0; _heroSearching = true; _menu.setSearchMenu(); - tsuiv(); + prepareNextObject(); } else _crep = 997; - } + } else + _crep = 187; } else { setCoordinates(8); _crep = 997; @@ -608,13 +606,12 @@ void MortevielleEngine::fctOpen() { if (_currBitIndex > 0) _coreVar._faithScore += 2; ++_openObjCount; - int tmpPlace = 0; - do { - ++tmpPlace; - } while (!((tmpPlace > 6) || (_openObjects[tmpPlace] == 0) || (_openObjects[tmpPlace] == _num))); - if (_openObjects[tmpPlace] != _num) { + int i; + for (i = 1; (i <= 6) && (_openObjects[i] != 0) && (_openObjects[i] != _num); i++) + ; + if (_openObjects[i] != _num) { if (!( ((_num == 3) && ((_coreVar._currPlace == OWN_ROOM) - || (_coreVar._currPlace == ROOM9) + || (_coreVar._currPlace == JULIA_ROOM) || (_coreVar._currPlace == BLUE_ROOM) || (_coreVar._currPlace == BATHROOM))) || ((_num == 4) && ((_coreVar._currPlace == GREEN_ROOM) @@ -635,10 +632,10 @@ void MortevielleEngine::fctOpen() { if (getRandomNumber(1, 4) == 3) _speechManager.startSpeech(7, 9, 1); } - _openObjects[tmpPlace] = _num; + _openObjects[i] = _num; displayAnimFrame(1, _num); } - tmpPlace = _coreVar._currPlace; + int tmpPlace = _coreVar._currPlace; if (_coreVar._currPlace == CRYPT) tmpPlace = CELLAR; _crep = _tabdon[kAouvr + (tmpPlace * 7) + _num - 1]; @@ -886,20 +883,19 @@ void MortevielleEngine::fctClose() { return; setCoordinates(7); if (_num != 0) { - int cx = 0; - do { - ++cx; - } while ((cx <= 6) && (_num != _openObjects[cx])); - if (_num == _openObjects[cx]) { + int i; + for (i = 1; (i <= 6) && (_num != _openObjects[i]); ++i) + ; + if (_num == _openObjects[i]) { displayAnimFrame(2, _num); _crep = 998; - _openObjects[cx] = 0; + _openObjects[i] = 0; --_openObjCount; if (_openObjCount < 0) _openObjCount = 0; - int chai = rechai(); - if (_mchai == chai) - _mchai = 0; + int objId = getFirstObject(); + if (_curSearchObjId == objId) + _curSearchObjId = 0; } else { _crep = 187; } @@ -968,7 +964,7 @@ void MortevielleEngine::fctSelfPut() { else { if (_caff > 99) { _crep = 999; - ajchai(); + putObject(); if (_crep != 192) displayEmptyHand(); return; @@ -979,20 +975,18 @@ void MortevielleEngine::fctSelfPut() { setCoordinates(7); _crep = 124; if (_num != 0) { - int chai = rechai(); - if (chai == 0) + int objId = getFirstObject(); + if (objId == 0) _crep = 997; else { - int cx = 0; - do { - ++cx; - } while ((cx <= 6) && (_num != _openObjects[cx])); - if (_num != _openObjects[cx]) - _crep = 187; - else { - _mchai = chai; + int i; + for (i = 1; (i <= 6) && (_num != _openObjects[i]); i++) + ; + if (_num == _openObjects[i]) { + _curSearchObjId = objId; _crep = 999; - } + } else + _crep = 187; } } else { setCoordinates(8); @@ -1042,7 +1036,7 @@ void MortevielleEngine::fctSelfPut() { _crep = 185; if ((_crep == 999) || (_crep == 185) || (_crep == 998)) { if (_crep == 999) - ajchai(); + putObject(); if (_crep != 192) displayEmptyHand(); } @@ -1140,9 +1134,9 @@ void MortevielleEngine::fctEnter() { showMoveMenuAlert(); else if (_roomDoorId == OWN_ROOM) _crep = 997; - else if ((_roomDoorId == ROOM9) && (_coreVar._selectedObjectId != 136)) { - _crep = 189; - _coreVar._availableQuestion[8] = '*'; + else if ((_roomDoorId == JULIA_ROOM) && (_coreVar._selectedObjectId != 136)) { + _crep = 189; + _coreVar._availableQuestion[8] = '*'; } else { int z = 0; if (!_blo) @@ -1161,7 +1155,7 @@ void MortevielleEngine::fctEnter() { _currMenu = MENU_DISCUSS; _currAction = (_menu._discussMenu[charIndex]._menuId << 8) | _menu._discussMenu[charIndex]._actionId; _syn = true; - if (_roomDoorId == ROOM9) { + if (_roomDoorId == JULIA_ROOM) { _col = true; _caff = 70; drawPictureWithText(); |