diff options
Diffstat (limited to 'engines/avalanche/parser.cpp')
-rw-r--r-- | engines/avalanche/parser.cpp | 564 |
1 files changed, 282 insertions, 282 deletions
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index b8b461b053..f8f0d4478c 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -50,7 +50,7 @@ void Parser::init() { _inputText.clear(); _inputTextPos = 0; - _vm->_avalot->_weirdWord = false; + _vm->_weirdWord = false; // Initailaze the vocabulary. // Verbs: 1-49 @@ -422,13 +422,13 @@ void Parser::handleFunctionKey(const Common::Event &event) { case Common::KEYCODE_F5: { _person = kPeoplePardon; _thing = kPardon; - Common::String f5does = _vm->_avalot->f5Does(); + Common::String f5does = _vm->f5Does(); VerbCode verb = (VerbCode)f5does[0]; - _vm->_avalot->callVerb(verb); + _vm->callVerb(verb); } break; case Common::KEYCODE_F7: - _vm->_avalot->callVerb(kVerbCodeOpen); + _vm->callVerb(kVerbCodeOpen); break; default: break; @@ -440,7 +440,7 @@ void Parser::plotText() { cursorOff(); _vm->_graphics->_surface.fillRect(Common::Rect(24, 161, 640, 169), kColorBlack); // Black out the line of the text. - _vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_avalot->_font, 8, 24, 161, kColorWhite); + _vm->_graphics->drawText(_vm->_graphics->_surface, _inputText, _vm->_font, 8, 24, 161, kColorWhite); cursorOn(); CursorMan.showMouse(true); @@ -539,7 +539,7 @@ Common::String Parser::rank() { }; for (int i = 0; i < 8; i++) { - if ((_vm->_avalot->_dnascore >= kRanks[i]._score) && (_vm->_avalot->_dnascore < kRanks[i + 1]._score)) { + if ((_vm->_dnascore >= kRanks[i]._score) && (_vm->_dnascore < kRanks[i + 1]._score)) { return kRanks[i]._title; } } @@ -551,7 +551,7 @@ Common::String Parser::totalTime() { const double ticksInOneSec = (double)(65535) / 3600; uint16 h, m, s; - h = (uint16)floor(_vm->_avalot->_totalTime / ticksInOneSec); // No. of seconds. + h = (uint16)floor(_vm->_totalTime / ticksInOneSec); // No. of seconds. m = h % 3600; h /= 3600; s = m % 60; @@ -593,10 +593,10 @@ void Parser::displayWhat(byte target, bool animate, bool &ambiguous) { _vm->_dialogs->displayText("What?"); } else { if (animate) { - Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName((People)target).c_str()); + Common::String tmpStr = Common::String::format("{ %s }", _vm->getName((People)target).c_str()); _vm->_dialogs->displayText(tmpStr); } else { - Common::String z = _vm->_avalot->getItem(target); + Common::String z = _vm->getItem(target); if (z != "") { Common::String tmpStr = Common::String::format("{ %s }", z.c_str()); _vm->_dialogs->displayText(tmpStr); @@ -612,16 +612,16 @@ bool Parser::doPronouns() { byte wordCode = _thats[i]; switch (wordCode) { case 200: - displayWhat(_vm->_avalot->_him, true, ambiguous); - _thats.setChar(_vm->_avalot->_him, i); + displayWhat(_vm->_him, true, ambiguous); + _thats.setChar(_vm->_him, i); break; case 201: - displayWhat(_vm->_avalot->_her, true, ambiguous); - _thats.setChar(_vm->_avalot->_her, i); + displayWhat(_vm->_her, true, ambiguous); + _thats.setChar(_vm->_her, i); break; case 202: - displayWhat(_vm->_avalot->_it, false, ambiguous); - _thats.setChar(_vm->_avalot->_it, i); + displayWhat(_vm->_it, false, ambiguous); + _thats.setChar(_vm->_it, i); break; } } @@ -666,32 +666,32 @@ void Parser::storeInterrogation(byte interrogation) { case 1: _inputText.toLowercase(); sayIt(); - _vm->_avalot->_favouriteDrink = _inputText; - _vm->_avalot->_cardiffQuestionNum = 2; + _vm->_favouriteDrink = _inputText; + _vm->_cardiffQuestionNum = 2; break; case 2: properNouns(); sayIt(); - _vm->_avalot->_favouriteSong = _inputText; - _vm->_avalot->_cardiffQuestionNum = 3; + _vm->_favouriteSong = _inputText; + _vm->_cardiffQuestionNum = 3; break; case 3: properNouns(); sayIt(); - _vm->_avalot->_worstPlaceOnEarth = _inputText; - _vm->_avalot->_cardiffQuestionNum = 4; + _vm->_worstPlaceOnEarth = _inputText; + _vm->_cardiffQuestionNum = 4; break; case 4: _inputText.toLowercase(); sayIt(); - if (!_vm->_avalot->_spareEvening.empty()) - _vm->_avalot->_spareEvening.clear(); - _vm->_avalot->_spareEvening = _inputText; + if (!_vm->_spareEvening.empty()) + _vm->_spareEvening.clear(); + _vm->_spareEvening = _inputText; _vm->_dialogs->displayScrollChain('z', 5); // His closing statement... _vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge _vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away! - _vm->_avalot->_magics[1]._operation = Avalot::kMagicNothing; - _vm->_avalot->_cardiffQuestionNum = 5; + _vm->_magics[1]._operation = AvalancheEngine::kMagicNothing; + _vm->_cardiffQuestionNum = 5; break; case 99: //store_high(_inputText); @@ -727,9 +727,9 @@ void Parser::parse() { } // Are we being interrogated right now? - if (_vm->_avalot->_interrogation > 0) { - storeInterrogation(_vm->_avalot->_interrogation); - _vm->_avalot->_weirdWord = true; + if (_vm->_interrogation > 0) { + storeInterrogation(_vm->_interrogation); + _vm->_weirdWord = true; return; } @@ -761,7 +761,7 @@ void Parser::parse() { // Check also[] first, which contains words about the actual room. if (!thisword.empty()) { for (int i = 0; i < 31; i++) { - if ((_vm->_avalot->_also[i][0]) && (getPos(',' + thisword, *_vm->_avalot->_also[i][0]) > -1)) { + if ((_vm->_also[i][0]) && (getPos(',' + thisword, *_vm->_also[i][0]) > -1)) { _thats += Common::String(99 + i); notfound = false; } @@ -813,12 +813,12 @@ void Parser::parse() { replace(Common::String("\x4\xE5"), 20); // "take off" = "doff" // Words that could mean more than one _person - if (_vm->_avalot->_room == kRoomNottsPub) + if (_vm->_room == kRoomNottsPub) replace(Common::String('\xCC'), 164); // Barman = Port else replace(Common::String('\xCC'), 154); // Barman = Malagauche - switch (_vm->_avalot->_room) { + switch (_vm->_room) { case kRoomAylesOffice: replace(Common::String('\xCB'), 163); // Monk = Ayles break; @@ -830,39 +830,39 @@ void Parser::parse() { } if (doPronouns()) { - _vm->_avalot->_weirdWord = true; + _vm->_weirdWord = true; _thats = kNothing; return; } // Second parsing. - if (!_vm->_avalot->_subject.empty()) - _vm->_avalot->_subject.clear(); - _vm->_avalot->_subjectNum = 0; // Find subject of conversation. + if (!_vm->_subject.empty()) + _vm->_subject.clear(); + _vm->_subjectNum = 0; // Find subject of conversation. for (int i = 0; (i < 11) && !_realWords[i].empty(); i++) { if ((_realWords[i][0] == '\'') || (_realWords[i][0] == '\"')) { - _vm->_avalot->_subjectNum = (byte)_thats[i]; + _vm->_subjectNum = (byte)_thats[i]; _thats.setChar(kMoved, i); break; } } - if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // Still not found. + if ((_vm->_subjectNum == 0) && !_thats.empty()) { // Still not found. for (uint16 i = 0; i < _thats.size() - 1; i++) { if ((byte)_thats[i] == 252) { // The word is "about", or something similar. - _vm->_avalot->_subjectNum = (byte)_thats[i + 1]; + _vm->_subjectNum = (byte)_thats[i + 1]; _thats.setChar(0, i + 1); break; } } } - if ((_vm->_avalot->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say". + if ((_vm->_subjectNum == 0) && !_thats.empty()) { // STILL not found! Must be the word after "say". for (uint16 i = 0; i < _thats.size() - 1; i++) { if (((byte)_thats[i] == 7) && ((byte)_thats[i + 1] != 0) && !((225 <= (byte)_thats[i + 1]) && ((byte)_thats[i + 1] <= 229))) { // SAY not followed by a preposition - _vm->_avalot->_subjectNum = (byte)_thats[i + 1]; + _vm->_subjectNum = (byte)_thats[i + 1]; _thats.setChar(0, i + 1); break; } @@ -885,30 +885,30 @@ void Parser::parse() { if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) { Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str()); _vm->_dialogs->displayText(tmpStr); - _vm->_avalot->_weirdWord = true; + _vm->_weirdWord = true; } else - _vm->_avalot->_weirdWord = false; + _vm->_weirdWord = false; if (_thats.empty()) _thats = kNothing; if (_thing != kPardon) - _vm->_avalot->_it = _thing; + _vm->_it = _thing; if (_person != kPardon) { if (_person < kPeopleArkata) - _vm->_avalot->_him = _person; + _vm->_him = _person; else - _vm->_avalot->_her = _person; + _vm->_her = _person; } } void Parser::examineObject() { - if (_thing != _vm->_avalot->_thinks) - _vm->_avalot->thinkAbout(_thing, Avalot::kThing); + if (_thing != _vm->_thinks) + _vm->thinkAbout(_thing, AvalancheEngine::kThing); switch (_thing) { case kObjectWine : - switch (_vm->_avalot->_wineState) {// 4 is perfect wine. 0 is not holding the wine. + switch (_vm->_wineState) {// 4 is perfect wine. 0 is not holding the wine. case 1: _vm->_dialogs->displayScrollChain('t', 1); // Normal examine wine scroll break; @@ -921,7 +921,7 @@ void Parser::examineObject() { } break; case kObjectOnion: - if (_vm->_avalot->_rottenOnion) + if (_vm->_rottenOnion) _vm->_dialogs->displayScrollChain('q', 21); // Yucky onion else _vm->_dialogs->displayScrollChain('t', 18); // Normal onion @@ -932,7 +932,7 @@ void Parser::examineObject() { } bool Parser::isPersonHere() { // Person equivalent of "holding". - if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room)) + if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->getRoom(_person) == _vm->_room)) return true; else { Common::String tmpStr; @@ -947,19 +947,19 @@ bool Parser::isPersonHere() { // Person equivalent of "holding". void Parser::exampers() { if (isPersonHere()) { - if (_thing != _vm->_avalot->_thinks) - _vm->_avalot->thinkAbout(_person, Avalot::kPerson); + if (_thing != _vm->_thinks) + _vm->thinkAbout(_person, AvalancheEngine::kPerson); byte newPerson = _person - 149; - if ((_person == kPeopleDogfood) && _vm->_avalot->_wonNim) + if ((_person == kPeopleDogfood) && _vm->_wonNim) _vm->_dialogs->displayScrollChain('Q', 8); // "I'm Not Playing!" - else if ((_person == kPeopleDuLustie) && _vm->_avalot->_lustieIsAsleep) + else if ((_person == kPeopleDuLustie) && _vm->_lustieIsAsleep) _vm->_dialogs->displayScrollChain('Q', 65); // He's asleep. else _vm->_dialogs->displayScrollChain('p', newPerson); - if ((_person == kPeopleAyles) && !_vm->_avalot->_aylesIsAwake) + if ((_person == kPeopleAyles) && !_vm->_aylesIsAwake) _vm->_dialogs->displayScrollChain('Q', 13); // CHECKME: Present in the original, but it doesn't make sense. @@ -979,7 +979,7 @@ bool Parser::isHolding() { if (_thing > 100) _vm->_dialogs->displayText("Be reasonable!"); - else if (!_vm->_avalot->_objects[_thing - 1]) // Verbs that need "_thing" to be in the inventory. + else if (!_vm->_objects[_thing - 1]) // Verbs that need "_thing" to be in the inventory. _vm->_dialogs->displayText("You're not holding it, Avvy."); else holdingResult = true; @@ -988,7 +988,7 @@ bool Parser::isHolding() { } void Parser::openBox(bool isOpening) { - if ((_vm->_avalot->_room == kRoomYours) && (_thing == 54)) { + if ((_vm->_room == kRoomYours) && (_thing == 54)) { _vm->_background->draw(-1, -1, 4); _vm->_background->update(); @@ -1015,7 +1015,7 @@ void Parser::examine() { examineObject(); else if ((50 <= _thing) && (_thing <= 100)) { // Also _thing openBox(true); - _vm->_dialogs->displayText(*_vm->_avalot->_also[_thing - 50][1]); + _vm->_dialogs->displayText(*_vm->_also[_thing - 50][1]); openBox(false); } } @@ -1030,17 +1030,17 @@ void Parser::inventory() { Common::String tmpStr = Common::String("You're carrying "); for (int i = 0; i < kObjectNum; i++) { - if (_vm->_avalot->_objects[i]) { + if (_vm->_objects[i]) { itemNum++; - if (itemNum == _vm->_avalot->_carryNum) + if (itemNum == _vm->_carryNum) tmpStr += "and "; - tmpStr += _vm->_avalot->getItem(i + 1); + tmpStr += _vm->getItem(i + 1); if ((i + 1) == _wearing) tmpStr += ", which you're wearing"; - if (itemNum < _vm->_avalot->_carryNum) + if (itemNum < _vm->_carryNum) tmpStr += ", "; } } @@ -1056,17 +1056,17 @@ void Parser::inventory() { void Parser::swallow() { // Eat something. switch (_thing) { case kObjectWine: - switch (_vm->_avalot->_wineState) { // 4 is perfect + switch (_vm->_wineState) { // 4 is perfect case 1: - if (_vm->_avalot->_teetotal) { + if (_vm->_teetotal) { _vm->_dialogs->displayScrollChain('D', 6); return; } _vm->_dialogs->displayScrollChain('U', 1); _vm->_pingo->wobble(); _vm->_dialogs->displayScrollChain('U', 2); - _vm->_avalot->_objects[kObjectWine - 1] = false; - _vm->_avalot->refreshObjectList(); + _vm->_objects[kObjectWine - 1] = false; + _vm->refreshObjectList(); drink(); break; case 2: @@ -1076,10 +1076,10 @@ void Parser::swallow() { // Eat something. } break; case kObjectPotion: - _vm->_avalot->setBackgroundColor(4); + _vm->setBackgroundColor(4); _vm->_dialogs->displayScrollChain('U', 3); - _vm->_avalot->gameOver(); - _vm->_avalot->setBackgroundColor(0); + _vm->gameOver(); + _vm->setBackgroundColor(0); break; case kObjectInk: _vm->_dialogs->displayScrollChain('U', 4); @@ -1089,19 +1089,19 @@ void Parser::swallow() { // Eat something. break; case kObjectMushroom: _vm->_dialogs->displayScrollChain('U', 6); - _vm->_avalot->gameOver(); + _vm->gameOver(); break; case kObjectOnion: - if (_vm->_avalot->_rottenOnion) + if (_vm->_rottenOnion) _vm->_dialogs->displayScrollChain('U', 11); else { _vm->_dialogs->displayScrollChain('U', 8); - _vm->_avalot->_objects[kObjectOnion - 1] = false; - _vm->_avalot->refreshObjectList(); + _vm->_objects[kObjectOnion - 1] = false; + _vm->refreshObjectList(); } break; default: - if ((_vm->_avalot->_room == kRoomArgentPub) || (_vm->_avalot->_room == kRoomNottsPub)) + if ((_vm->_room == kRoomArgentPub) || (_vm->_room == kRoomNottsPub)) _vm->_dialogs->displayText("Try BUYing things before you drink them!"); else _vm->_dialogs->displayText("The taste of it makes you retch!"); @@ -1112,7 +1112,7 @@ void Parser::peopleInRoom() { byte numPeople = 0; // Number of people in the room. for (int i = 151; i < 179; i++) { // Start at 1 so we don't list Avvy himself! - if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) + if (_vm->getRoom((People)i) == _vm->_room) numPeople++; } @@ -1122,14 +1122,14 @@ void Parser::peopleInRoom() { Common::String tmpStr; byte actPerson = 0; // Actually listed people. for (int i = 151; i < 179; i++) { - if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) { + if (_vm->getRoom((People)i) == _vm->_room) { actPerson++; if (actPerson == 1) // First on the list. - tmpStr = _vm->_avalot->getName((People)i); + tmpStr = _vm->getName((People)i); else if (actPerson < numPeople) // The middle... - tmpStr += ", " + _vm->_avalot->getName((People)i); + tmpStr += ", " + _vm->getName((People)i); else // The end. - tmpStr += " and " + _vm->_avalot->getName((People)i); + tmpStr += " and " + _vm->getName((People)i); } } @@ -1142,30 +1142,30 @@ void Parser::peopleInRoom() { } void Parser::lookAround() { - _vm->_dialogs->displayText(*_vm->_avalot->_also[0][1]); - switch (_vm->_avalot->_room) { + _vm->_dialogs->displayText(*_vm->_also[0][1]); + switch (_vm->_room) { case kRoomSpludwicks: - if (_vm->_avalot->_avariciusTalk > 0) + if (_vm->_avariciusTalk > 0) _vm->_dialogs->displayScrollChain('q', 23); else peopleInRoom(); break; case kRoomRobins: - if (_vm->_avalot->_tiedUp) + if (_vm->_tiedUp) _vm->_dialogs->displayScrollChain('q', 38); - if (_vm->_avalot->_mushroomGrowing) + if (_vm->_mushroomGrowing) _vm->_dialogs->displayScrollChain('q', 55); break; case kRoomInsideCardiffCastle: - if (!_vm->_avalot->_takenPen) + if (!_vm->_takenPen) _vm->_dialogs->displayScrollChain('q', 49); break; case kRoomLustiesRoom: - if (_vm->_avalot->_lustieIsAsleep) + if (_vm->_lustieIsAsleep) _vm->_dialogs->displayScrollChain('q', 65); break; case kRoomCatacombs: - switch (_vm->_avalot->_catacombY * 256 + _vm->_avalot->_catacombX) { + switch (_vm->_catacombY * 256 + _vm->_catacombX) { case 258 : _vm->_dialogs->displayScrollChain('q', 80); // Inside art gallery. break; @@ -1184,7 +1184,7 @@ void Parser::lookAround() { void Parser::openDoor() { // Special cases. - switch (_vm->_avalot->_room) { + switch (_vm->_room) { case kRoomYours: if (_vm->_animation->inField(1)) { // Opening the box. @@ -1202,29 +1202,29 @@ void Parser::openDoor() { break; } - if ((!_vm->_avalot->_userMovesAvvy) && (_vm->_avalot->_room != kRoomLusties)) + if ((!_vm->_userMovesAvvy) && (_vm->_room != kRoomLusties)) return; // No doors can open if you can't move Avvy. for (int i = 0; i < 7; i++) { if (_vm->_animation->inField(i + 8)) { - MagicType *portal = &_vm->_avalot->_portals[i]; + MagicType *portal = &_vm->_portals[i]; switch (portal->_operation) { - case Avalot::kMagicExclaim: + case AvalancheEngine::kMagicExclaim: _vm->_animation->_sprites[0].bounce(); _vm->_dialogs->displayScrollChain('x', portal->_data); break; - case Avalot::kMagicTransport: - _vm->_avalot->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F); + case AvalancheEngine::kMagicTransport: + _vm->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F); break; - case Avalot::kMagicUnfinished: + case AvalancheEngine::kMagicUnfinished: _vm->_animation->_sprites[0].bounce(); _vm->_dialogs->displayText("Sorry. This place is not available yet!"); break; - case Avalot::kMagicSpecial: + case AvalancheEngine::kMagicSpecial: _vm->_animation->callSpecial(portal->_data); break; - case Avalot::kMagicOpenDoor: - _vm->_avalot->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9); + case AvalancheEngine::kMagicOpenDoor: + _vm->openDoor((Room)(portal->_data >> 8), portal->_data & 0x0F, i + 9); break; } @@ -1232,7 +1232,7 @@ void Parser::openDoor() { } } - if (_vm->_avalot->_room == kRoomMap) + if (_vm->_room == kRoomMap) _vm->_dialogs->displayText("Avvy, you can complete the whole game without ever going " \ "to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."); else @@ -1258,15 +1258,15 @@ void Parser::putProc() { switch (_thing2) { case kObjectWine: if (_thing == kObjectOnion) { - if (_vm->_avalot->_rottenOnion) + if (_vm->_rottenOnion) _vm->_dialogs->displayText("That's a bit like shutting the stable door after the horse has bolted!"); else { // Put onion into wine? - if (_vm->_avalot->_wineState != 3) { + if (_vm->_wineState != 3) { Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Dialogs::kControlItalic, Dialogs::kControlRoman); _vm->_dialogs->displayText(tmpStr); } else { // Put onion into vinegar! Yes! - _vm->_avalot->_onionInVinegar = true; - _vm->_avalot->incScore(7); + _vm->_onionInVinegar = true; + _vm->incScore(7); _vm->_dialogs->displayScrollChain('u', 9); } } @@ -1275,8 +1275,8 @@ void Parser::putProc() { break; case 54: - if (_vm->_avalot->_room == kRoomYours) { // Put something into the box. - if (_vm->_avalot->_boxContent != kNothing) + if (_vm->_room == kRoomYours) { // Put something into the box. + if (_vm->_boxContent != kNothing) _vm->_dialogs->displayText("There's something in the box already, Avvy. Try taking that out first."); else { switch (_thing) { @@ -1294,14 +1294,14 @@ void Parser::putProc() { break; default: // Put the object into the box... if (_wearing == _thing) { - Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_avalot->getItem(_thing).c_str()); + Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->getItem(_thing).c_str()); _vm->_dialogs->displayText(tmpStr); } else { openBox(true); // Open box. - _vm->_avalot->_boxContent = _thing; - _vm->_avalot->_objects[_thing - 1] = false; - _vm->_avalot->refreshObjectList(); + _vm->_boxContent = _thing; + _vm->_objects[_thing - 1] = false; + _vm->refreshObjectList(); _vm->_dialogs->displayText("OK, it's in the box."); openBox(false); // Shut box. @@ -1322,7 +1322,7 @@ void Parser::putProc() { * @remarks Originally called 'not_in_order' */ void Parser::notInOrder() { - Common::String itemStr = _vm->_avalot->getItem(_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick]); + Common::String itemStr = _vm->getItem(_vm->kSpludwicksOrder[_vm->_givenToSpludwick]); Common::String tmpStr = Common::String::format("Sorry, I need the ingredients in the right order for this potion. " \ "What I need next is %s%c2%c", itemStr.c_str(), Dialogs::kControlRegister, Dialogs::kControlSpeechBubble); _vm->_dialogs->displayText(tmpStr); @@ -1343,40 +1343,40 @@ void Parser::goToCauldron() { * @remarks Originally called 'give2spludwick' */ bool Parser::giveToSpludwick() { - if (_vm->_avalot->kSpludwicksOrder[_vm->_avalot->_givenToSpludwick] != _thing) { + if (_vm->kSpludwicksOrder[_vm->_givenToSpludwick] != _thing) { notInOrder(); return false; } switch (_thing) { case kObjectOnion: - _vm->_avalot->_objects[kObjectOnion - 1] = false; - if (_vm->_avalot->_rottenOnion) + _vm->_objects[kObjectOnion - 1] = false; + if (_vm->_rottenOnion) _vm->_dialogs->displayScrollChain('q', 22); else { - _vm->_avalot->_givenToSpludwick++; + _vm->_givenToSpludwick++; _vm->_dialogs->displayScrollChain('q', 20); goToCauldron(); - _vm->_avalot->incScore(3); + _vm->incScore(3); } - _vm->_avalot->refreshObjectList(); + _vm->refreshObjectList(); break; case kObjectInk: - _vm->_avalot->_objects[kObjectInk - 1] = false; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->_givenToSpludwick++; + _vm->_objects[kObjectInk - 1] = false; + _vm->refreshObjectList(); + _vm->_givenToSpludwick++; _vm->_dialogs->displayScrollChain('q', 24); goToCauldron(); - _vm->_avalot->incScore(3); + _vm->incScore(3); break; case kObjectMushroom: - _vm->_avalot->_objects[kObjectMushroom - 1] = false; + _vm->_objects[kObjectMushroom - 1] = false; _vm->_dialogs->displayScrollChain('q', 25); - _vm->_avalot->incScore(5); - _vm->_avalot->_givenToSpludwick++; + _vm->incScore(5); + _vm->_givenToSpludwick++; goToCauldron(); - _vm->_avalot->_objects[kObjectPotion - 1] = true; - _vm->_avalot->refreshObjectList(); + _vm->_objects[kObjectPotion - 1] = true; + _vm->refreshObjectList(); break; default: return true; @@ -1388,27 +1388,27 @@ bool Parser::giveToSpludwick() { void Parser::drink() { _alcoholLevel++; if (_alcoholLevel == 5) { - _vm->_avalot->_objects[kObjectKey - 1] = true; // Get the key. - _vm->_avalot->_teetotal = true; - _vm->_avalot->_avvyIsAwake = false; - _vm->_avalot->_avvyInBed = true; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->dusk(); - _vm->_avalot->hangAroundForAWhile(); - _vm->_avalot->flipRoom(kRoomYours, 1); - _vm->_avalot->setBackgroundColor(14); + _vm->_objects[kObjectKey - 1] = true; // Get the key. + _vm->_teetotal = true; + _vm->_avvyIsAwake = false; + _vm->_avvyInBed = true; + _vm->refreshObjectList(); + _vm->dusk(); + _vm->hangAroundForAWhile(); + _vm->flipRoom(kRoomYours, 1); + _vm->setBackgroundColor(14); _vm->_animation->_sprites[0]._visible = false; } } void Parser::cardiffClimbing() { - if (_vm->_avalot->_standingOnDais) { // Clamber up. + if (_vm->_standingOnDais) { // Clamber up. _vm->_dialogs->displayText("You climb down, back onto the floor."); - _vm->_avalot->_standingOnDais = false; + _vm->_standingOnDais = false; _vm->_animation->appearPed(0, 2); } else if (_vm->_animation->inField(0)) { // Clamber down _vm->_dialogs->displayText("You clamber up onto the dais."); - _vm->_avalot->_standingOnDais = true; + _vm->_standingOnDais = true; _vm->_animation->appearPed(0, 1); } else _vm->_dialogs->displayText("Get a bit closer, Avvy."); @@ -1419,21 +1419,21 @@ void Parser::already() { } void Parser::standUp() { - switch (_vm->_avalot->_room) { + switch (_vm->_room) { case kRoomYours: // Avvy isn't asleep. - if (_vm->_avalot->_avvyIsAwake && _vm->_avalot->_avvyInBed) { // But he's in bed. - if (_vm->_avalot->_teetotal) { + if (_vm->_avvyIsAwake && _vm->_avvyInBed) { // But he's in bed. + if (_vm->_teetotal) { _vm->_dialogs->displayScrollChain('d', 12); - _vm->_avalot->setBackgroundColor(0); + _vm->setBackgroundColor(0); _vm->_dialogs->displayScrollChain('d', 14); } _vm->_animation->_sprites[0]._visible = true; - _vm->_avalot->_userMovesAvvy = true; + _vm->_userMovesAvvy = true; _vm->_animation->appearPed(0, 1); _vm->_animation->setDirection(kDirLeft); _vm->_background->draw(-1, -1, 3); // Picture of empty pillow. - _vm->_avalot->incScore(1); - _vm->_avalot->_avvyInBed = false; + _vm->incScore(1); + _vm->_avvyInBed = false; _vm->_timer->loseTimer(Timer::kReasonArkataShouts); } else already(); @@ -1444,12 +1444,12 @@ void Parser::standUp() { break; case kRoomNottsPub: - if (_vm->_avalot->_sittingInPub) { + if (_vm->_sittingInPub) { _vm->_background->draw(-1, -1, 3); // Not sitting down. _vm->_animation->_sprites[0]._visible = true; // But standing up. _vm->_animation->appearPed(0, 3); // And walking away. - _vm->_avalot->_sittingInPub = false; // Really not sitting down. - _vm->_avalot->_userMovesAvvy = true; // And ambulant. + _vm->_sittingInPub = false; // Really not sitting down. + _vm->_userMovesAvvy = true; // And ambulant. } else already(); break; @@ -1459,18 +1459,18 @@ void Parser::standUp() { } void Parser::getProc(char thing) { - switch (_vm->_avalot->_room) { + switch (_vm->_room) { case kRoomYours: if (_vm->_animation->inField(1)) { - if (_vm->_avalot->_boxContent == thing) { + if (_vm->_boxContent == thing) { _vm->_background->draw(-1, -1, 4); _vm->_dialogs->displayText("OK, I've got it."); - _vm->_avalot->_objects[thing - 1] = true; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->_boxContent = kNothing; + _vm->_objects[thing - 1] = true; + _vm->refreshObjectList(); + _vm->_boxContent = kNothing; _vm->_background->draw(-1, -1, 5); } else { - Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_avalot->getItem(thing).c_str()); + Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->getItem(thing).c_str()); _vm->_dialogs->displayText(tmpStr); } } else @@ -1480,18 +1480,18 @@ void Parser::getProc(char thing) { switch (thing) { case kObjectPen: if (_vm->_animation->inField(1)) { // Standing on the dais. - if (_vm->_avalot->_takenPen) + if (_vm->_takenPen) _vm->_dialogs->displayText("It's not there, Avvy."); else { // OK: we're taking the pen, and it's there. _vm->_background->draw(-1, -1, 3); // No pen there now. _vm->_animation->callSpecial(3); // Zap! - _vm->_avalot->_takenPen = true; - _vm->_avalot->_objects[kObjectPen - 1] = true; - _vm->_avalot->refreshObjectList(); + _vm->_takenPen = true; + _vm->_objects[kObjectPen - 1] = true; + _vm->refreshObjectList(); _vm->_dialogs->displayText("Taken."); } - } else if (_vm->_avalot->_standingOnDais) + } else if (_vm->_standingOnDais) _vm->_dialogs->displayScrollChain('q', 53); else _vm->_dialogs->displayScrollChain('q', 51); @@ -1504,14 +1504,14 @@ void Parser::getProc(char thing) { } break; case kRoomRobins: - if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_avalot->_mushroomGrowing)) { + if ((thing == kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_mushroomGrowing)) { _vm->_background->draw(-1, -1, 2); _vm->_dialogs->displayText("Got it!"); - _vm->_avalot->_mushroomGrowing = false; - _vm->_avalot->_takenMushroom = true; - _vm->_avalot->_objects[kObjectMushroom - 1] = true; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->incScore(3); + _vm->_mushroomGrowing = false; + _vm->_takenMushroom = true; + _vm->_objects[kObjectMushroom - 1] = true; + _vm->refreshObjectList(); + _vm->incScore(3); } else _vm->_dialogs->displayScrollChain('q', 57); break; @@ -1525,13 +1525,13 @@ void Parser::getProc(char thing) { * @remarks Originally called 'give_Geida_the_lute' */ void Parser::giveGeidaTheLute() { - if (_vm->_avalot->_room != kRoomLustiesRoom) { + if (_vm->_room != kRoomLustiesRoom) { Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble); _vm->_dialogs->displayText(tmpStr); return; } - _vm->_avalot->_objects[kObjectLute - 1] = false; - _vm->_avalot->refreshObjectList(); + _vm->_objects[kObjectLute - 1] = false; + _vm->refreshObjectList(); _vm->_dialogs->displayScrollChain('q', 64); // She plays it. _vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings); @@ -1553,13 +1553,13 @@ void Parser::winSequence() { Common::String Parser::personSpeaks() { if ((_person == kPeoplePardon) || (_person == kPeopleNone)) { - if ((_vm->_avalot->_him == kPeoplePardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room)) - _person = _vm->_avalot->_her; + if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room)) + _person = _vm->_her; else - _person = _vm->_avalot->_him; + _person = _vm->_him; } - if (_vm->_avalot->getRoom(_person) != _vm->_avalot->_room) { + if (_vm->getRoom(_person) != _vm->_room) { return Common::String::format("%c1", Dialogs::kControlRegister); // Avvy himself! } @@ -1577,7 +1577,7 @@ Common::String Parser::personSpeaks() { return tmpStr; for (int i = 0; i < 16; i++) { - if ((_vm->_avalot->kQuasipeds[i]._who == _person) && (_vm->_avalot->kQuasipeds[i]._room == _vm->_avalot->_room)) + if ((_vm->kQuasipeds[i]._who == _person) && (_vm->kQuasipeds[i]._room == _vm->_room)) tmpStr += Common::String::format("%c%c", Dialogs::kControlRegister, 'A' + i); } @@ -1588,7 +1588,7 @@ void Parser::heyThanks() { Common::String tmpStr = personSpeaks(); tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Dialogs::kControlSpeechBubble); _vm->_dialogs->displayText(tmpStr); - _vm->_avalot->_objects[_thing - 1] = false; + _vm->_objects[_thing - 1] = false; } /** @@ -1604,7 +1604,7 @@ void Parser::doThat() { return; } - if (_vm->_avalot->_weirdWord) + if (_vm->_weirdWord) return; if (_thing < 200) @@ -1614,11 +1614,11 @@ void Parser::doThat() { if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp) && (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart) && (_verb != kVerbCodeDir) && (_verb != kVerbCodeScore) && (_verb != kVerbCodeHiscores) && (_verb != kVerbCodeSmartAlec)) { - if (!_vm->_avalot->_alive) { + if (!_vm->_alive) { _vm->_dialogs->displayText("You're dead, so don't talk. What are you, a ghost or something? Try restarting, or restoring a saved game!"); return; } - if (!_vm->_avalot->_avvyIsAwake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { + if (!_vm->_avvyIsAwake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { _vm->_dialogs->displayText("Talking in your sleep? Try waking up!"); return; } @@ -1638,7 +1638,7 @@ void Parser::doThat() { break; case kVerbCodeGet: if (_thing != kPardon) { // Legitimate try to pick something up. - if (_vm->_avalot->_carryNum >= kCarryLimit) + if (_vm->_carryNum >= kCarryLimit) _vm->_dialogs->displayText("You can't carry any more!"); else getProc(_thing); @@ -1658,21 +1658,21 @@ void Parser::doThat() { break; case kVerbCodeTalk: if (_person == kPeoplePardon) { - if (_vm->_avalot->_subjectNum == 99) { // They typed "say password". + if (_vm->_subjectNum == 99) { // They typed "say password". Common::String tmpStr = Common::String::format("Yes, but what %cis%c the password?", Dialogs::kControlItalic, Dialogs::kControlRoman); _vm->_dialogs->displayText(tmpStr); - } else if (((1 <= _vm->_avalot->_subjectNum) && (_vm->_avalot->_subjectNum <= 49)) || (_vm->_avalot->_subjectNum == 253) || (_vm->_avalot->_subjectNum == 249)) { + } else if (((1 <= _vm->_subjectNum) && (_vm->_subjectNum <= 49)) || (_vm->_subjectNum == 253) || (_vm->_subjectNum == 249)) { _thats.deleteChar(0); for (int i = 0; i < 10; i++) _realWords[i] = _realWords[i + 1]; - _verb = (VerbCode)_vm->_avalot->_subjectNum; + _verb = (VerbCode)_vm->_subjectNum; doThat(); return; } else { - _person = (People)_vm->_avalot->_subjectNum; - _vm->_avalot->_subjectNum = 0; + _person = (People)_vm->_subjectNum; + _vm->_subjectNum = 0; if ((_person == kPeopleNone) || (_person == kPeoplePardon)) _vm->_dialogs->displayText("Talk to whom?"); else if (isPersonHere()) @@ -1701,7 +1701,7 @@ void Parser::doThat() { case kPeopleCrapulus: if (_thing == kObjectWine) { _vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down."); - _vm->_avalot->_objects[kObjectWine - 1] = false; + _vm->_objects[kObjectWine - 1] = false; } else heyThanks(); break; @@ -1718,24 +1718,24 @@ void Parser::doThat() { case kPeopleIbythneth: if (_thing == kObjectBadge) { _vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow! - _vm->_avalot->incScore(3); - _vm->_avalot->_objects[kObjectBadge - 1] = false; - _vm->_avalot->_objects[kObjectHabit - 1] = true; - _vm->_avalot->_givenBadgeToIby = true; + _vm->incScore(3); + _vm->_objects[kObjectBadge - 1] = false; + _vm->_objects[kObjectHabit - 1] = true; + _vm->_givenBadgeToIby = true; _vm->_background->draw(-1, -1, 7); _vm->_background->draw(-1, -1, 8); } else heyThanks(); break; case kPeopleAyles: - if (_vm->_avalot->_aylesIsAwake) { + if (_vm->_aylesIsAwake) { if (_thing == kObjectPen) { - _vm->_avalot->_objects[kObjectPen - 1] = false; + _vm->_objects[kObjectPen - 1] = false; _vm->_dialogs->displayScrollChain('q', 54); - _vm->_avalot->_objects[kObjectInk - 1] = true; - _vm->_avalot->_givenPenToAyles = true; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->incScore(2); + _vm->_objects[kObjectInk - 1] = true; + _vm->_givenPenToAyles = true; + _vm->refreshObjectList(); + _vm->incScore(2); } else heyThanks(); } else @@ -1744,11 +1744,11 @@ void Parser::doThat() { case kPeopleGeida: switch (_thing) { case kObjectPotion: - _vm->_avalot->_objects[kObjectPotion - 1] = false; + _vm->_objects[kObjectPotion - 1] = false; _vm->_dialogs->displayScrollChain('u', 16); // She drinks it. - _vm->_avalot->incScore(2); - _vm->_avalot->_givenPotionToGeida = true; - _vm->_avalot->refreshObjectList(); + _vm->incScore(2); + _vm->_givenPotionToGeida = true; + _vm->refreshObjectList(); break; case kObjectLute: giveGeidaTheLute(); @@ -1760,7 +1760,7 @@ void Parser::doThat() { case kPeopleArkata: switch (_thing) { case kObjectPotion: - if (_vm->_avalot->_givenPotionToGeida) + if (_vm->_givenPotionToGeida) winSequence(); else _vm->_dialogs->displayScrollChain('q', 77); // That Geida woman! @@ -1774,7 +1774,7 @@ void Parser::doThat() { } } } - _vm->_avalot->refreshObjectList(); // Just in case... + _vm->refreshObjectList(); // Just in case... } break; @@ -1805,7 +1805,7 @@ void Parser::doThat() { else { Common::String tmpStr = Common::String::format("%cC%cDo you really want to quit?", Dialogs::kControlRegister, Dialogs::kControlIcon); if (_vm->_dialogs->displayQuestion(tmpStr)) - _vm->_avalot->_letMeOut = true; + _vm->_letMeOut = true; } break; case kVerbCodeGo: @@ -1820,8 +1820,8 @@ void Parser::doThat() { toDisplay = toDisplay + "LORD AVALOT D'ARGENT" + Dialogs::kControlCenter + Dialogs::kControlNewLine + "The medi\x91val descendant of" + Dialogs::kControlNewLine + "Denarius Avaricius Sextus" + Dialogs::kControlNewLine + Dialogs::kControlNewLine - + "version " + _vm->_avalot->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF " - + _vm->_avalot->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon; + + "version " + _vm->kVersionNum + Dialogs::kControlNewLine + Dialogs::kControlNewLine + "Copyright \xEF " + + _vm->kCopyright + ", Mark, Mike and Thomas Thurman." + Dialogs::kControlRegister + 'Y' + Dialogs::kControlIcon; _vm->_dialogs->displayText(toDisplay); _vm->_dialogs->_aboutBox = false; } @@ -1829,11 +1829,11 @@ void Parser::doThat() { case kVerbCodeUndress: if (_wearing == kNothing) _vm->_dialogs->displayText("You're already stark naked!"); - else if (_vm->_avalot->_avvysInTheCupboard) { - Common::String tmpStr = Common::String::format("You take off %s.", _vm->_avalot->getItem(_wearing).c_str()); + else if (_vm->_avvysInTheCupboard) { + Common::String tmpStr = Common::String::format("You take off %s.", _vm->getItem(_wearing).c_str()); _vm->_dialogs->displayText(tmpStr); _wearing = kNothing; - _vm->_avalot->refreshObjectList(); + _vm->refreshObjectList(); } else _vm->_dialogs->displayText("Hadn't you better find somewhere more private, Avvy?"); break; @@ -1855,7 +1855,7 @@ void Parser::doThat() { } else _wearing = _thing; - _vm->_avalot->refreshObjectList(); + _vm->refreshObjectList(); byte i; if (_thing == kObjectHabit) @@ -1880,19 +1880,19 @@ void Parser::doThat() { break; case kVerbCodePlay: if (_thing == kPardon) { - switch (_vm->_avalot->_room) { // They just typed "play"... + switch (_vm->_room) { // They just typed "play"... case kRoomArgentPub: // ...in the pub, => play Nim. warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()"); // play_nim(); // The following parts are copied from play_nim(). // The player automatically wins the game everytime he wins, until I implement the mini-game. - if (_vm->_avalot->_wonNim) { // Already won the game. + if (_vm->_wonNim) { // Already won the game. _vm->_dialogs->displayScrollChain('Q', 6); return; } - if (!_vm->_avalot->_askedDogfoodAboutNim) { + if (!_vm->_askedDogfoodAboutNim) { _vm->_dialogs->displayScrollChain('q', 84); return; } @@ -1902,14 +1902,14 @@ void Parser::doThat() { // You won - strange! _vm->_dialogs->displayScrollChain('Q', 7); // You won! Give us a lute! - _vm->_avalot->_objects[kObjectLute - 1] = true; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->_wonNim = true; + _vm->_objects[kObjectLute - 1] = true; + _vm->refreshObjectList(); + _vm->_wonNim = true; _vm->_background->draw(-1, -1, 0); // Show the settle with no lute on it. - _vm->_avalot->incScore(7); // 7 points for winning! + _vm->incScore(7); // 7 points for winning! if (_playedNim == 1) - _vm->_avalot->incScore(3); // 3 points for playing your 1st game. + _vm->incScore(3); // 3 points for playing your 1st game. // A warning to the player that there should have been a mini-game. TODO: Remove it later!!! _vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", but I haven't implemented it yet: you win and get the lute automatically.") @@ -1924,20 +1924,20 @@ void Parser::doThat() { case kObjectLute : _vm->_dialogs->displayScrollChain('U', 7); - if (_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room) + if (_vm->getRoom(kPeopleCwytalot) == _vm->_room) _vm->_dialogs->displayScrollChain('U', 10); - if (_vm->_avalot->getRoom(kPeopleDuLustie) == _vm->_avalot->_room) + if (_vm->getRoom(kPeopleDuLustie) == _vm->_room) _vm->_dialogs->displayScrollChain('U', 15); break; case 52: - if (_vm->_avalot->_room == kRoomMusicRoom) + if (_vm->_room == kRoomMusicRoom) playHarp(); else _vm->_dialogs->displayText(kWhat); break; case 55: - if (_vm->_avalot->_room == kRoomArgentPub) + if (_vm->_room == kRoomArgentPub) // play_nim(); warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()"); else @@ -1952,7 +1952,7 @@ void Parser::doThat() { if (isHolding()) { if (_thing == kObjectBell) { _vm->_dialogs->displayText("Ding, dong, ding, dong, ding, dong, ding, dong..."); - if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B'))) + if ((_vm->_bellsAreRinging) & (_vm->setFlag('B'))) // \? are used to avoid that ??! is parsed as a trigraph _vm->_dialogs->displayText("(Are you trying to join in, Avvy\?\?!)"); } else @@ -1974,7 +1974,7 @@ void Parser::doThat() { warning("STUB: Parser::doThat() - case kVerbCodeboss"); break; case kVerbCodePee: - if (_vm->_avalot->setFlag('P')) { + if (_vm->setFlag('P')) { _vm->_dialogs->displayText("Hmm, I don't think anyone will notice..."); _vm->_timer->addTimer(4, Timer::kProcUrinate, Timer::kReasonGoToToilet); } else { @@ -1985,16 +1985,16 @@ void Parser::doThat() { case kVerbCodeCheat: { Common::String tmpStr = Common::String::format("%cCheat mode now enabled.", Dialogs::kControlItalic); _vm->_dialogs->displayText(tmpStr); - _vm->_avalot->_cheat = true; + _vm->_cheat = true; } break; case kVerbCodeMagic: - if (_vm->_avalot->_avariciusTalk > 0) + if (_vm->_avariciusTalk > 0) _vm->_dialogs->displayScrollChain('q', 19); else { - if ((_vm->_avalot->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears! + if ((_vm->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) { // Avaricius appears! _vm->_dialogs->displayScrollChain('q', 17); - if (_vm->_avalot->getRoom(kPeopleSpludwick) == kRoomSpludwicks) + if (_vm->getRoom(kPeopleSpludwick) == kRoomSpludwicks) _vm->_dialogs->displayScrollChain('q', 18); else { Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1]; @@ -2003,7 +2003,7 @@ void Parser::doThat() { spr->walkTo(4); spr->_callEachStepFl = true; spr->_eachStepProc = Animation::kProcBackAndForth; - _vm->_avalot->_avariciusTalk = 14; + _vm->_avariciusTalk = 14; _vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks); } } else @@ -2031,21 +2031,21 @@ void Parser::doThat() { _vm->_pingo->zonk(); Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you.%c%c(`Such is the anger of the gods, Avvy!\")", Dialogs::kControlNewLine, Dialogs::kControlNewLine); _vm->_dialogs->displayText(tmpStr); - _vm->_avalot->gameOver(); + _vm->gameOver(); } } _sworeNum++; break; case kVerbCodeListen: - if ((_vm->_avalot->_bellsAreRinging) & (_vm->_avalot->setFlag('B'))) + if ((_vm->_bellsAreRinging) & (_vm->setFlag('B'))) _vm->_dialogs->displayText("All other noise is drowned out by the ringing of the bells."); - else if (_vm->_avalot->_listen.empty()) + else if (_vm->_listen.empty()) _vm->_dialogs->displayText("You can't hear anything much at the moment, Avvy."); else - _vm->_dialogs->displayText(_vm->_avalot->_listen); + _vm->_dialogs->displayText(_vm->_listen); break; case kVerbCodeBuy: // What are they trying to buy? - switch (_vm->_avalot->_room) { + switch (_vm->_room) { case kRoomArgentPub: if (_vm->_animation->inField(5)) { // We're in a pub, and near the bar. switch (_thing) { @@ -2053,40 +2053,40 @@ void Parser::doThat() { case 53: case 54: case 58: // Beer, whisky, cider or mead. - if (_vm->_avalot->_malagauche == 177) { // Already getting us one. + if (_vm->_malagauche == 177) { // Already getting us one. _vm->_dialogs->displayScrollChain('D', 15); return; } - if (_vm->_avalot->_teetotal) { + if (_vm->_teetotal) { _vm->_dialogs->displayScrollChain('D', 6); return; } if (_alcoholLevel == 0) - _vm->_avalot->incScore(3); + _vm->incScore(3); _vm->_background->draw(-1, -1, 11); _vm->_dialogs->displayText(booze[_thing - 51] + ", please." + Dialogs::kControlRegister + '1' + Dialogs::kControlSpeechBubble); - _vm->_avalot->_drinking = _thing; + _vm->_drinking = _thing; _vm->_background->draw(-1, -1, 9); - _vm->_avalot->_malagauche = 177; + _vm->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks); break; case 52: examine(); break; // We have a right one here - buy Pepsi??! case kObjectWine: - if (_vm->_avalot->_objects[kObjectWine - 1]) // We've already got the wine! + if (_vm->_objects[kObjectWine - 1]) // We've already got the wine! _vm->_dialogs->displayScrollChain('D', 2); // 1 bottle's shufishent! else { - if (_vm->_avalot->_malagauche == 177) { // Already getting us one. + if (_vm->_malagauche == 177) { // Already getting us one. _vm->_dialogs->displayScrollChain('D', 15); return; } - if (_vm->_avalot->_carryNum >= kCarryLimit) { + if (_vm->_carryNum >= kCarryLimit) { _vm->_dialogs->displayText("Your hands are full."); return; } @@ -2095,9 +2095,9 @@ void Parser::doThat() { Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Dialogs::kControlRegister, Dialogs::kControlSpeechBubble); _vm->_dialogs->displayText(tmpStr); if (_alcoholLevel == 0) - _vm->_avalot->incScore(3); + _vm->incScore(3); _vm->_background->draw(-1, -1, 9); - _vm->_avalot->_malagauche = 177; + _vm->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks); } @@ -2110,23 +2110,23 @@ void Parser::doThat() { case kRoomOutsideDucks: if (_vm->_animation->inField(5)) { if (_thing == kObjectOnion) { - if (_vm->_avalot->_objects[kObjectOnion - 1]) + if (_vm->_objects[kObjectOnion - 1]) _vm->_dialogs->displayScrollChain('D', 10); // Not planning to juggle with the things! - else if (_vm->_avalot->_carryNum >= kCarryLimit) + else if (_vm->_carryNum >= kCarryLimit) _vm->_dialogs->displayText("Before you ask, you remember that your hands are full."); else { if (_boughtOnion) _vm->_dialogs->displayScrollChain('D', 11); else { _vm->_dialogs->displayScrollChain('D', 9); - _vm->_avalot->incScore(3); + _vm->incScore(3); } - _vm->_avalot->decreaseMoney(3); // It costs thruppence. - _vm->_avalot->_objects[kObjectOnion - 1] = true; - _vm->_avalot->refreshObjectList(); + _vm->decreaseMoney(3); // It costs thruppence. + _vm->_objects[kObjectOnion - 1] = true; + _vm->refreshObjectList(); _boughtOnion = true; - _vm->_avalot->_rottenOnion = false; // It's OK when it leaves the stall! - _vm->_avalot->_onionInVinegar = false; + _vm->_rottenOnion = false; // It's OK when it leaves the stall! + _vm->_onionInVinegar = false; } } else _vm->_dialogs->displayScrollChain('D', 0); @@ -2142,33 +2142,33 @@ void Parser::doThat() { } break; case kVerbCodeAttack: - if ((_vm->_avalot->_room == kRoomBrummieRoad) && + if ((_vm->_room == kRoomBrummieRoad) && ((_person == kPeopleCwytalot) || (_thing == kObjectCrossbow) || (_thing == kObjectBolt)) && - (_vm->_avalot->getRoom(kPeopleCwytalot) == _vm->_avalot->_room)) { - switch (_vm->_avalot->_objects[kObjectBolt - 1] + _vm->_avalot->_objects[kObjectCrossbow - 1] * 2) { + (_vm->getRoom(kPeopleCwytalot) == _vm->_room)) { + switch (_vm->_objects[kObjectBolt - 1] + _vm->_objects[kObjectCrossbow - 1] * 2) { // 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both. case 0: _vm->_dialogs->displayScrollChain('Q', 10); _vm->_dialogs->displayText("(At the very least, don't use your bare hands!)"); break; case 1: - _vm->_dialogs->displayText("Attack _vm->_avalot->him with only a crossbow bolt? Are you planning on playing darts?!"); + _vm->_dialogs->displayText("Attack _vm->him with only a crossbow bolt? Are you planning on playing darts?!"); break; case 2: _vm->_dialogs->displayText("Come on, Avvy! You're not going to get very far with only a crossbow!"); break; case 3: _vm->_dialogs->displayScrollChain('Q', 11); - _vm->_avalot->_cwytalotGone = true; - _vm->_avalot->_objects[kObjectBolt - 1] = false; - _vm->_avalot->_objects[kObjectCrossbow - 1] = false; - _vm->_avalot->refreshObjectList(); - _vm->_avalot->_magics[11]._operation = Avalot::kMagicNothing; - _vm->_avalot->incScore(7); + _vm->_cwytalotGone = true; + _vm->_objects[kObjectBolt - 1] = false; + _vm->_objects[kObjectCrossbow - 1] = false; + _vm->refreshObjectList(); + _vm->_magics[11]._operation = AvalancheEngine::kMagicNothing; + _vm->incScore(7); _vm->_animation->_sprites[1].walkTo(1); _vm->_animation->_sprites[1]._vanishIfStill = true; _vm->_animation->_sprites[1]._callEachStepFl = false; - _vm->_avalot->setRoom(kPeopleCwytalot, kRoomDummy); + _vm->setRoom(kPeopleCwytalot, kRoomDummy); break; default: _vm->_dialogs->displayScrollChain('Q', 10); // Please try not to be so violent! @@ -2177,14 +2177,14 @@ void Parser::doThat() { _vm->_dialogs->displayScrollChain('Q', 10); break; case kVerbCodePasswd: - if (_vm->_avalot->_room != kRoomBridge) + if (_vm->_room != kRoomBridge) _vm->_dialogs->displayScrollChain('Q', 12); else { bool ok = true; for (uint i = 0; i < _thats.size(); i++) { Common::String temp = _realWords[i]; temp.toUppercase(); - int pwdId = _vm->_avalot->_passwordNum + kFirstPassword; + int pwdId = _vm->_passwordNum + kFirstPassword; for (uint j = 0; j < _vocabulary[pwdId]._word.size(); j++) { if (_vocabulary[pwdId]._word[j] != temp[j]) ok = false; @@ -2192,13 +2192,13 @@ void Parser::doThat() { } if (ok) { - if (_vm->_avalot->_drawbridgeOpen != 0) + if (_vm->_drawbridgeOpen != 0) _vm->_dialogs->displayText("Contrary to your expectations, the drawbridge fails to close again."); else { - _vm->_avalot->incScore(4); + _vm->incScore(4); _vm->_dialogs->displayText("The drawbridge opens!"); _vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls); - _vm->_avalot->_drawbridgeOpen = 1; + _vm->_drawbridgeOpen = 1; } } else _vm->_dialogs->displayScrollChain('Q', 12); @@ -2208,10 +2208,10 @@ void Parser::doThat() { //_vm->_enid->dir(_realWords[1]); TODO: Replace it with proper ScummVM-friendly function(s)! break; case kVerbCodeDie: - _vm->_avalot->gameOver(); + _vm->gameOver(); break; case kVerbCodeScore: { - Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_avalot->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str()); + Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%cThis gives you a rank of %s.%c%c%s", _vm->_dnascore, Dialogs::kControlCenter, Dialogs::kControlNewLine, Dialogs::kControlNewLine, Dialogs::kControlNewLine, rank().c_str(), Dialogs::kControlNewLine, Dialogs::kControlNewLine, totalTime().c_str()); _vm->_dialogs->displayText(tmpStr); } break; @@ -2243,14 +2243,14 @@ void Parser::doThat() { break; case kVerbCodeClimb: - if (_vm->_avalot->_room == kRoomInsideCardiffCastle) + if (_vm->_room == kRoomInsideCardiffCastle) cardiffClimbing(); else // In the wrong room! _vm->_dialogs->displayText("Not with your head for heights, Avvy!"); break; case kVerbCodeJump: _vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping); - _vm->_avalot->_userMovesAvvy = false; + _vm->_userMovesAvvy = false; break; case kVerbCodeHiscores: // show_highs(); @@ -2262,18 +2262,18 @@ void Parser::doThat() { case kPeoplePardon: case kPeopleAvalot: case 0: - if (!_vm->_avalot->_avvyIsAwake) { - _vm->_avalot->_avvyIsAwake = true; - _vm->_avalot->incScore(1); - _vm->_avalot->_avvyInBed = true; + if (!_vm->_avvyIsAwake) { + _vm->_avvyIsAwake = true; + _vm->incScore(1); + _vm->_avvyInBed = true; _vm->_background->draw(-1, -1, 2); // Picture of Avvy, awake in bed. - if (_vm->_avalot->_teetotal) + if (_vm->_teetotal) _vm->_dialogs->displayScrollChain('d', 13); } else _vm->_dialogs->displayText("You're already awake, Avvy!"); break; case kPeopleAyles: - if (!_vm->_avalot->_aylesIsAwake) + if (!_vm->_aylesIsAwake) _vm->_dialogs->displayText("You can't seem to wake him by yourself."); break; case kPeopleJacques: { @@ -2287,26 +2287,26 @@ void Parser::doThat() { } break; case kVerbCodeSit: - if (_vm->_avalot->_room == kRoomNottsPub) { - if (_vm->_avalot->_sittingInPub) + if (_vm->_room == kRoomNottsPub) { + if (_vm->_sittingInPub) _vm->_dialogs->displayText("You're already sitting!"); else { _vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down. _vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown); } } else { // Default doodah. - _vm->_avalot->dusk(); - _vm->_avalot->hangAroundForAWhile(); - _vm->_avalot->dawn(); + _vm->dusk(); + _vm->hangAroundForAWhile(); + _vm->dawn(); Common::String tmpStr = Common::String::format("A few hours later...%cnothing much has happened...", Dialogs::kControlParagraph); _vm->_dialogs->displayText(tmpStr); } break; case kVerbCodeRestart: if (_vm->_dialogs->displayQuestion("Restart game and lose changes?")) { - _vm->_avalot->dusk(); - _vm->_avalot->newGame(); - _vm->_avalot->dawn(); + _vm->dusk(); + _vm->newGame(); + _vm->dawn(); } break; case kVerbCodePardon: |