diff options
author | Strangerke | 2013-09-24 21:24:52 +0200 |
---|---|---|
committer | Strangerke | 2013-09-24 21:24:52 +0200 |
commit | b3f6ce975ff7eb50eb775ce3c5113e85e60c1434 (patch) | |
tree | 510f3f55b345cdf2c932185b1fb11fa184435277 /engines/avalanche | |
parent | 3ae30372bcf3bff39f8d4fd0df65536bc589ae8f (diff) | |
download | scummvm-rg350-b3f6ce975ff7eb50eb775ce3c5113e85e60c1434.tar.gz scummvm-rg350-b3f6ce975ff7eb50eb775ce3c5113e85e60c1434.tar.bz2 scummvm-rg350-b3f6ce975ff7eb50eb775ce3c5113e85e60c1434.zip |
AVALANCHE: Use People enum as a type for several variables, modify functions accordingly
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/avalot.cpp | 38 | ||||
-rw-r--r-- | engines/avalanche/avalot.h | 85 | ||||
-rw-r--r-- | engines/avalanche/dialogs.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/enums.h | 107 | ||||
-rw-r--r-- | engines/avalanche/menu.cpp | 14 | ||||
-rw-r--r-- | engines/avalanche/parser.cpp | 58 | ||||
-rw-r--r-- | engines/avalanche/parser.h | 5 |
7 files changed, 177 insertions, 134 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 9abdd9c13c..90d2542136 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -672,9 +672,9 @@ void Avalot::findPeople(byte room) { for (int i = 1; i < 29; i++) { if (_whereIs[i] == room) { if (i < 25) - _him = i + 150; + _him = (People)(150 + i); else - _her = i + 150; + _her = (People)(150 + i); } } } @@ -1434,9 +1434,9 @@ void Avalot::checkClick() { if (_thinkThing) { _vm->_parser->_thing = _thinks; _vm->_parser->_thing += 49; - _vm->_parser->_person = _vm->_parser->kPardon; + _vm->_parser->_person = kPeoplePardon; } else { - _vm->_parser->_person = _thinks; + _vm->_parser->_person = (People) _thinks; _vm->_parser->_thing = _vm->_parser->kPardon; } callVerb(Parser::kVerbCodeExam); @@ -1702,10 +1702,10 @@ void Avalot::newGame() { avvy->appear(300, 117, kDirRight); // Needed to initialize Avalot. //for (gd = 0; gd <= 30; gd++) for (gm = 0; gm <= 1; gm++) also[gd][gm] = nil; // fillchar(previous^,sizeof(previous^),#0); { blank out array } - _him = Parser::kPardon; - _her = Parser::kPardon; + _him = kPeoplePardon; + _her = kPeoplePardon; _it = Parser::kPardon; - _lastPerson = Parser::kPardon; // = Pardon? + _lastPerson = kPeoplePardon; // = Pardon? _passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1; _userMovesAvvy = false; _doingSpriteRun = false; @@ -1743,7 +1743,7 @@ bool Avalot::decreaseMoney(uint16 howmuchby) { return true; } -Common::String Avalot::getName(byte whose) { +Common::String Avalot::getName(People whose) { static const Common::String kLads[17] = { "Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche", "Friar Tuck", "Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff", "Dogfood", @@ -1752,20 +1752,20 @@ Common::String Avalot::getName(byte whose) { static const Common::String kLasses[4] = {"Arkata", "Geida", "\0xB1", "the Wise Woman"}; - if (whose < 175) - return kLads[whose - 150]; + if (whose < kPeopleArkata) + return kLads[whose - kPeopleAvalot]; else - return kLasses[whose - 175]; + return kLasses[whose - kPeopleArkata]; } -byte Avalot::getNameChar(byte whose) { +byte Avalot::getNameChar(People whose) { static const char kLadChar[] = "ASCDMTRwLfgeIyPu"; static const char kLassChar[] = "kG\0xB1o"; - if (whose < 175) - return kLadChar[whose - 150]; + if (whose < kPeopleArkata) + return kLadChar[whose - kPeopleAvalot]; else - return kLassChar[whose - 175]; + return kLassChar[whose - kPeopleArkata]; } Common::String Avalot::getThing(byte which) { @@ -2049,11 +2049,11 @@ void Avalot::openDoor(Room whither, byte ped, byte magicnum) { _vm->_sequence->startToOpen(); } -void Avalot::setRoom(byte persId, Room roomId) { - _whereIs[persId - 150] = roomId; +void Avalot::setRoom(People persId, Room roomId) { + _whereIs[persId - kPeopleAvalot] = roomId; } -Room Avalot::getRoom(byte persId) { - return _whereIs[persId - 150]; +Room Avalot::getRoom(People persId) { + return _whereIs[persId - kPeopleAvalot]; } } // End of namespace Avalanche diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h index 92cc456b22..3999c19f25 100644 --- a/engines/avalanche/avalot.h +++ b/engines/avalanche/avalot.h @@ -63,76 +63,6 @@ private: void chime(); }; -enum Color { - kColorBlack, kColorBlue, kColorGreen, kColorCyan, kColorRed, - kColorMagenta, kColorBrown, kColorLightgray, kColorDarkgray, kColorLightblue, - kColorLightgreen, kColorLightcyan, kColorLightred, kColorLightmagenta, kColorYellow, - kColorWhite -}; - -// CHECKME: kRoomBossKey is a guess -enum Room { - kRoomNowhere = 0, kRoomYours = 1, kRoomOutsideYours = 2, kRoomOutsideSpludwicks = 3, - kRoomYourHall = 5, kRoomMusicRoom = 7, kRoomOutsideArgentPub = 9, kRoomArgentRoad = 10, - kRoomWiseWomans = 11, kRoomSpludwicks = 12, kRoomInsideAbbey = 13, kRoomOutsideAbbey = 14, - kRoomAvvysGarden = 15, kRoomAylesOffice = 16, kRoomArgentPub = 19, kRoomBrummieRoad = 20, - kRoomBridge = 21, kRoomLusties = 22, kRoomLustiesRoom = 23, kRoomWestHall = 25, - kRoomEastHall = 26, kRoomOubliette = 27, kRoomGeidas = 28, kRoomCatacombs = 29, - kRoomEntranceHall = 40, kRoomRobins = 42, kRoomOutsideNottsPub = 46, kRoomNottsPub = 47, - kRoomOutsideDucks = 50, kRoomDucks = 51, kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71, - kRoomBossKey = 98, kRoomMap = 99, kRoomDummy = 177 // Dummy room -}; - -// Objects you can hold: -enum Object { - kObjectWine = 1, - kObjectMoney, - kObjectBodkin, - kObjectPotion, - kObjectChastity, - kObjectBolt, - kObjectCrossbow, - kObjectLute, - kObjectBadge, - kObjectMushroom, - kObjectKey, - kObjectBell, - kObjectPrescription, - kObjectPen, - kObjectInk, - kObjectClothes, - kObjectHabit, - kObjectOnion, - kObjectDummy = 177 -}; - -// People who hang around this game. -enum People { - // Boys: - kPeopleAvalot = 150, - kPeopleSpludwick = 151, - kPeopleCrapulus = 152, - kPeopleDrDuck = 153, - kPeopleMalagauche = 154, - kPeopleFriarTuck = 155, - kPeopleRobinHood = 156, - kPeopleCwytalot = 157, - kPeopleDuLustie = 158, - kPeopleDuke = 159, - kPeopleDogfood = 160, - kPeopleTrader = 161, - kPeopleIbythneth = 162, - kPeopleAyles = 163, - kPeoplePort = 164, - kPeopleSpurge = 165, - kPeopleJacques = 166, - // Girls: - kPeopleArkata = 175, - kPeopleGeida = 176, - kPeopleInvisible = 177, - kPeopleWisewoman = 178 -}; - static const byte kObjectNum = 18; // always preface with a # static const int16 kCarryLimit = 12; // carry limit @@ -169,7 +99,7 @@ typedef int8 TuneType[31]; struct QuasipedType { byte _whichPed, _foregroundColor, _room, _backgroundColor; - uint16 _who; + People _who; }; #if 0 @@ -346,10 +276,11 @@ public: Common::String _subject; // What you're talking to them about. byte _subjectNum; // The same thing. bool _keyboardClick; // Is a keyboard click noise wanted? - byte _him, _her, _it; + People _him, _her; + byte _it; int32 _roomTime; // Set to 0 when you enter a room, added to in every loop. - byte _lastPerson; // Last person to have been selected using the People menu. + People _lastPerson; // Last person to have been selected using the People menu. bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites. bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning. bool _isLoaded; // Is it a loaded gamestate? @@ -404,8 +335,8 @@ public: bool decreaseMoney(uint16 howmuchby); // Called pennycheck in the original. void hangAroundForAWhile(); - Common::String getName(byte whose); - byte getNameChar(byte whose); + Common::String getName(People whose); + byte getNameChar(People whose); Common::String getThing(byte which); char getThingChar(byte which); Common::String getItem(byte which); // Called get_better in the original. @@ -414,8 +345,8 @@ public: void openDoor(Room whither, byte ped, byte magicnum); // Handles slidey-open doors. void flipRoom(Room room, byte ped); - void setRoom(byte persId, Room roomId); - Room getRoom(byte persId); + void setRoom(People persId, Room roomId); + Room getRoom(People persId); private: AvalancheEngine *_vm; diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index e9d89c2192..68bd2c29b6 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -954,8 +954,8 @@ void Dialogs::speak(byte who, byte subject) { } void Dialogs::talkTo(byte whom) { - if (_vm->_parser->_person == _vm->_parser->kPardon) { - _vm->_parser->_person = _vm->_avalot->_subjectNum; + if (_vm->_parser->_person == kPeoplePardon) { + _vm->_parser->_person = (People)_vm->_avalot->_subjectNum; _vm->_avalot->_subjectNum = 0; } diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h new file mode 100644 index 0000000000..9965091eb8 --- /dev/null +++ b/engines/avalanche/enums.h @@ -0,0 +1,107 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This code is based on the original source code of Lord Avalot d'Argent version 1.3. + * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. + */ + +#ifndef AVALANCHE_ENUMS_H +#define AVALANCHE_ENUMS_H + +namespace Avalanche { +enum Color { + kColorBlack, kColorBlue, kColorGreen, kColorCyan, kColorRed, + kColorMagenta, kColorBrown, kColorLightgray, kColorDarkgray, kColorLightblue, + kColorLightgreen, kColorLightcyan, kColorLightred, kColorLightmagenta, kColorYellow, + kColorWhite +}; + +// CHECKME: kRoomBossKey is a guess +enum Room { + kRoomNowhere = 0, kRoomYours = 1, kRoomOutsideYours = 2, kRoomOutsideSpludwicks = 3, + kRoomYourHall = 5, kRoomMusicRoom = 7, kRoomOutsideArgentPub = 9, kRoomArgentRoad = 10, + kRoomWiseWomans = 11, kRoomSpludwicks = 12, kRoomInsideAbbey = 13, kRoomOutsideAbbey = 14, + kRoomAvvysGarden = 15, kRoomAylesOffice = 16, kRoomArgentPub = 19, kRoomBrummieRoad = 20, + kRoomBridge = 21, kRoomLusties = 22, kRoomLustiesRoom = 23, kRoomWestHall = 25, + kRoomEastHall = 26, kRoomOubliette = 27, kRoomGeidas = 28, kRoomCatacombs = 29, + kRoomEntranceHall = 40, kRoomRobins = 42, kRoomOutsideNottsPub = 46, kRoomNottsPub = 47, + kRoomOutsideDucks = 50, kRoomDucks = 51, kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71, + kRoomBossKey = 98, kRoomMap = 99, kRoomDummy = 177 // Dummy room +}; + +// Objects you can hold: +enum Object { + kObjectWine = 1, + kObjectMoney, + kObjectBodkin, + kObjectPotion, + kObjectChastity, + kObjectBolt, + kObjectCrossbow, + kObjectLute, + kObjectBadge, + kObjectMushroom, + kObjectKey, + kObjectBell, + kObjectPrescription, + kObjectPen, + kObjectInk, + kObjectClothes, + kObjectHabit, + kObjectOnion, + kObjectDummy = 177 +}; + +// People who hang around this game. +enum People { + // Boys: + kPeopleAvalot = 150, + kPeopleSpludwick = 151, + kPeopleCrapulus = 152, + kPeopleDrDuck = 153, + kPeopleMalagauche = 154, + kPeopleFriarTuck = 155, + kPeopleRobinHood = 156, + kPeopleCwytalot = 157, + kPeopleDuLustie = 158, + kPeopleDuke = 159, + kPeopleDogfood = 160, + kPeopleTrader = 161, + kPeopleIbythneth = 162, + kPeopleAyles = 163, + kPeoplePort = 164, + kPeopleSpurge = 165, + kPeopleJacques = 166, + // Girls: + kPeopleArkata = 175, + kPeopleGeida = 176, + kPeopleInvisible = 177, + kPeopleWisewoman = 178, + // + kPeoplePardon = 254, + kPeopleNone = 0 +}; + +} // End of namespace Avalanche + +#endif // AVALANCHE_ENUMS_H diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp index 6af0e79429..0686fbbf44 100644 --- a/engines/avalanche/menu.cpp +++ b/engines/avalanche/menu.cpp @@ -451,9 +451,9 @@ void Menu::setupMenuPeople() { _activeMenuItem.reset(); - for (int i = 150; i <= 178; i++) { - if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) { - _activeMenuItem.setupOption(_vm->_avalot->getName(i), _vm->_avalot->getNameChar(i), "", true); + for (int i = kPeopleAvalot; i <= kPeopleWisewoman; i++) { + if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) { + _activeMenuItem.setupOption(_vm->_avalot->getName((People)i), _vm->_avalot->getNameChar((People)i), "", true); people += i; } } @@ -582,7 +582,7 @@ void Menu::runMenuAction() { // Get up, pause game, open door, look, inventory, walk/run. switch (_activeMenuItem._choiceNum) { case 0: - _vm->_parser->_person = _vm->_parser->kPardon; + _vm->_parser->_person = kPeoplePardon; _vm->_parser->_thing = _vm->_parser->kPardon; f5Does = _vm->_avalot->f5Does(); _vm->_avalot->callVerb(f5Does[0]); @@ -619,7 +619,7 @@ void Menu::runMenuObjects() { void Menu::runMenuPeople() { _vm->_avalot->thinkAbout(people[_activeMenuItem._choiceNum], Avalot::kPerson); - _vm->_avalot->_lastPerson = people[_activeMenuItem._choiceNum]; + _vm->_avalot->_lastPerson = (People)people[_activeMenuItem._choiceNum]; } void Menu::runMenuWith() { @@ -631,7 +631,7 @@ void Menu::runMenuWith() { if (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum] == Parser::kVerbCodeGive) _vm->_parser->_person = _vm->_avalot->_lastPerson; else - _vm->_parser->_person = Parser::kPardon; + _vm->_parser->_person = kPeoplePardon; } else { switch (_vm->_avalot->_verbStr[_activeMenuItem._choiceNum]) { case 100: // Beer @@ -659,7 +659,7 @@ void Menu::runMenuWith() { _vm->_avalot->callVerb(Parser::kVerbCodeBuy); return; default: - _vm->_parser->_person = _vm->_parser->_thing; + _vm->_parser->_person = (People)_vm->_parser->_thing; _vm->_parser->_thing = Parser::kPardon; _vm->_avalot->_subjectNum = 0; } diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 8e60a5654a..3e318558ef 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -421,7 +421,7 @@ void Parser::handleReturn() { void Parser::handleFunctionKey(const Common::Event &event) { switch (event.kbd.keycode) { case Common::KEYCODE_F5: - _person = kPardon; + _person = kPeoplePardon; _thing = kPardon; _vm->_avalot->callVerb(_vm->_avalot->f5Does()[0]); break; @@ -591,7 +591,7 @@ 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(target).c_str()); + Common::String tmpStr = Common::String::format("{ %s }", _vm->_avalot->getName((People)target).c_str()); _vm->_dialogs->displayText(tmpStr); } else { Common::String z = _vm->_avalot->getItem(target); @@ -713,7 +713,7 @@ void Parser::parse() { _verb = kPardon; _thing = kPardon; _thing2 = kPardon; - _person = kPardon; + _person = kPeoplePardon; clearWords(); @@ -868,14 +868,15 @@ void Parser::parse() { } for (int16 i = _thats.size() - 1; i >= 0; i--) { // Reverse order, so first will be used. - if (((byte)_thats[i] == 253) || ((byte)_thats[i] == 249) || ((1 <= (byte)_thats[i]) && ((byte)_thats[i] <= 49))) - _verb = (byte)_thats[i]; - else if ((50 <= (byte)_thats[i]) && ((byte)_thats[i] <= 149)) { + byte curChar = (byte)_thats[i]; + if ((curChar == 253) || (curChar == 249) || ((1 <= curChar) && (curChar <= 49))) + _verb = curChar; + else if ((50 <= curChar) && (curChar <= 149)) { _thing2 = _thing; - _thing = (byte)_thats[i]; - } else if ((150 <= (byte)_thats[i]) && ((byte)_thats[i] <= 199)) - _person = (byte)_thats[i]; - else if ((byte)_thats[i] == 251) + _thing = curChar; + } else if ((150 <= curChar) && (curChar <= 199)) + _person = (People)curChar; + else if (curChar == 251) _polite = true; } @@ -929,7 +930,7 @@ void Parser::examineObject() { } bool Parser::isPersonHere() { // Person equivalent of "holding". - if ((_person == kPardon) || (_person == 0) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room)) + if ((_person == kPeoplePardon) || (_person == kPeopleNone) || (_vm->_avalot->getRoom(_person) == _vm->_avalot->_room)) return true; else { Common::String tmpStr; @@ -959,7 +960,8 @@ void Parser::exampers() { if ((_person == kPeopleAyles) && !_vm->_avalot->_aylesIsAwake) _vm->_dialogs->displayScrollChain('Q', 13); - _person = newPerson; + // CHECKME: Present in the original, but it doesn't make sense. + // _person = newPerson; } } @@ -1004,7 +1006,7 @@ void Parser::openBox(bool isOpening) { void Parser::examine() { // EITHER it's an object OR it's an Also OR it's a _person OR it's something else. - if ((_person == kPardon) && (_thing != kPardon)) { + if ((_person == kPeoplePardon) && (_thing != kPardon)) { if (isHolding()) { // Remember: it's been slipped! Ie subtract 49. if ((1 <= _thing) && (_thing <= 49)) // Standard object @@ -1108,7 +1110,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(i) == _vm->_avalot->_room) + if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) numPeople++; } @@ -1118,14 +1120,14 @@ void Parser::peopleInRoom() { Common::String tmpStr; byte actPerson = 0; // Actually listed people. for (int i = 151; i < 179; i++) { - if (_vm->_avalot->getRoom(i) == _vm->_avalot->_room) { + if (_vm->_avalot->getRoom((People)i) == _vm->_avalot->_room) { actPerson++; if (actPerson == 1) // First on the list. - tmpStr = _vm->_avalot->getName(i + 150); + tmpStr = _vm->_avalot->getName((People)i); else if (actPerson < numPeople) // The middle... - tmpStr += ", " + _vm->_avalot->getName(i + 150); + tmpStr += ", " + _vm->_avalot->getName((People)i); else // The end. - tmpStr += " and " + _vm->_avalot->getName(i + 150); + tmpStr += " and " + _vm->_avalot->getName((People)i); } } @@ -1185,7 +1187,7 @@ void Parser::openDoor() { if (_vm->_animation->inField(1)) { // Opening the box. _thing = 54; // The box. - _person = kPardon; + _person = kPeoplePardon; examine(); return; } @@ -1551,8 +1553,8 @@ void Parser::winSequence() { } Common::String Parser::personSpeaks() { - if ((_person == kPardon) || (_person == 0)) { - if ((_vm->_avalot->_him == kPardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room)) + if ((_person == kPeoplePardon) || (_person == kPeopleNone)) { + if ((_vm->_avalot->_him == kPeoplePardon) || (_vm->_avalot->getRoom(_vm->_avalot->_him) != _vm->_avalot->_room)) _person = _vm->_avalot->_her; else _person = _vm->_avalot->_him; @@ -1642,7 +1644,7 @@ void Parser::doThat() { else getProc(_thing); } else { // Not... ditto. - if (_person != kPardon) + if (_person != kPeoplePardon) _vm->_dialogs->displayText("You can't sweep folk off their feet!"); else _vm->_dialogs->displayText("I assure you, you don't need it."); @@ -1656,7 +1658,7 @@ void Parser::doThat() { inventory(); break; case kVerbCodeTalk: - if (_person == kPardon) { + if (_person == kPeoplePardon) { if (_vm->_avalot->_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); @@ -1670,9 +1672,9 @@ void Parser::doThat() { doThat(); return; } else { - _person = _vm->_avalot->_subjectNum; + _person = (People)_vm->_avalot->_subjectNum; _vm->_avalot->_subjectNum = 0; - if ((_person == 0) || (_person == kPardon)) + if ((_person == kPeopleNone) || (_person == kPeoplePardon)) _vm->_dialogs->displayText("Talk to whom?"); else if (isPersonHere()) _vm->_dialogs->talkTo(_person); @@ -1682,7 +1684,7 @@ void Parser::doThat() { break; case kVerbCodeGive: if (isHolding()) { - if (_person == kPardon) + if (_person == kPeoplePardon) _vm->_dialogs->displayText("Give to whom?"); else if (isPersonHere()) { switch (_thing) { @@ -2221,7 +2223,7 @@ void Parser::doThat() { standUp(); break; case kVerbCodeKiss: - if (_person == kPardon) + if (_person == kPeoplePardon) _vm->_dialogs->displayText("Kiss whom?"); else if (isPersonHere()) { switch (_person) { @@ -2258,7 +2260,7 @@ void Parser::doThat() { case kVerbCodeWake: if (isPersonHere()) switch (_person) { - case kPardon: + case kPeoplePardon: case kPeopleAvalot: case 0: if (!_vm->_avalot->_avvyIsAwake) { diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index 30b5929fb5..a0e26817d6 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -28,6 +28,8 @@ #ifndef AVALANCHE_PARSER_H #define AVALANCHE_PARSER_H +#include "avalanche/enums.h" + #include "common/events.h" #include "common/scummsys.h" #include "common/str.h" @@ -71,7 +73,8 @@ public: VocabEntry _vocabulary[kParserWordsNum]; Common::String _realWords[11]; - byte _verb, _person, _thing; + byte _verb, _thing; + People _person; bool _polite; Common::String _inputText; // Original name: current Common::String _inputTextBackup; |