From 82e76e7b5391ae87dc44d7986b2dfd40c53c3fc8 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 13 Sep 2013 21:30:03 +0200 Subject: AVALANCHE: Remove DNA structure which was essentially a savegame structure unused in ScummVM --- engines/avalanche/acci2.cpp | 350 ++++++++++++++++++++-------------------- engines/avalanche/animation.cpp | 168 +++++++++---------- engines/avalanche/avalanche.cpp | 186 ++++++++++----------- engines/avalanche/avalot.cpp | 4 +- engines/avalanche/celer2.cpp | 46 +++--- engines/avalanche/dropdown2.cpp | 16 +- engines/avalanche/enid2.cpp | 2 +- engines/avalanche/gyro2.cpp | 137 ++++++++++++---- engines/avalanche/gyro2.h | 142 ++++++++-------- engines/avalanche/lucerna2.cpp | 192 +++++++++++----------- engines/avalanche/scrolls2.cpp | 42 ++--- engines/avalanche/sequence2.cpp | 10 +- engines/avalanche/timer.cpp | 104 ++++++------ engines/avalanche/visa2.cpp | 40 ++--- 14 files changed, 761 insertions(+), 678 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index 1b6446c09d..747bcca5b4 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -249,7 +249,7 @@ Common::String Acci::rank() { }; for (byte i = 0; i < 8; i++) { - if ((_vm->_gyro->_dna._score >= kRanks[i]._score) && (_vm->_gyro->_dna._score < kRanks[i + 1]._score)) { + if ((_vm->_gyro->_dnascore >= kRanks[i]._score) && (_vm->_gyro->_dnascore < kRanks[i + 1]._score)) { return kRanks[i]._title; } } @@ -261,7 +261,7 @@ Common::String Acci::totalTime() { const double ticksInOneSec = (double)(65535) / 3600; uint16 h, m, s; - h = floor(_vm->_gyro->_dna._totalTime / ticksInOneSec); // No. of seconds. + h = floor(_vm->_gyro->_totalTime / ticksInOneSec); // No. of seconds. m = h % 3600; h /= 3600; s = m % 60; @@ -384,32 +384,32 @@ void Acci::storeInterrogation(byte interrogation) { case 1: _vm->_parser->_inputText.toLowercase(); sayIt(); - _vm->_gyro->_dna._favouriteDrink = _vm->_parser->_inputText; - _vm->_gyro->_dna._cardiffQuestionNum = 2; + _vm->_gyro->_favouriteDrink = _vm->_parser->_inputText; + _vm->_gyro->_cardiffQuestionNum = 2; break; case 2: properNouns(); sayIt(); - _vm->_gyro->_dna._favouriteSong = _vm->_parser->_inputText; - _vm->_gyro->_dna._cardiffQuestionNum = 3; + _vm->_gyro->_favouriteSong = _vm->_parser->_inputText; + _vm->_gyro->_cardiffQuestionNum = 3; break; case 3: properNouns(); sayIt(); - _vm->_gyro->_dna._worstPlaceOnEarth = _vm->_parser->_inputText; - _vm->_gyro->_dna._cardiffQuestionNum = 4; + _vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText; + _vm->_gyro->_cardiffQuestionNum = 4; break; case 4: _vm->_parser->_inputText.toLowercase(); sayIt(); - if (!_vm->_gyro->_dna._spareEvening.empty()) - _vm->_gyro->_dna._spareEvening.clear(); - _vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText; + if (!_vm->_gyro->_spareEvening.empty()) + _vm->_gyro->_spareEvening.clear(); + _vm->_gyro->_spareEvening = _vm->_parser->_inputText; _vm->_visa->displayScrollChain('z', 5); // His closing statement... _vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge _vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away! _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; - _vm->_gyro->_dna._cardiffQuestionNum = 5; + _vm->_gyro->_cardiffQuestionNum = 5; break; case 99: //store_high(_vm->_parser->_inputText); @@ -531,12 +531,12 @@ void Acci::parse() { replace(Common::String("\x4\xE5"), 20); // "take off" = "doff" // Words that could mean more than one _person - if (_vm->_gyro->_dna._room == r__nottspub) + if (_vm->_gyro->_room == r__nottspub) replace(Common::String('\xCC'), 164); // Barman = Port else replace(Common::String('\xCC'), 154); // Barman = Malagauche - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__aylesoffice: replace(Common::String('\xCB'), 163); // Monk = Ayles break; @@ -625,7 +625,7 @@ void Acci::examineObject() { _vm->_lucerna->thinkAbout(_thing, Gyro::kThing); switch (_thing) { case Gyro::kObjectWine : - switch (_vm->_gyro->_dna._wineState) {// 4 is perfect wine. 0 is not holding the wine. + switch (_vm->_gyro->_wineState) {// 4 is perfect wine. 0 is not holding the wine. case 1: _vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll break; @@ -638,7 +638,7 @@ void Acci::examineObject() { } break; case Gyro::kObjectOnion: - if (_vm->_gyro->_dna._rottenOnion) + if (_vm->_gyro->_rottenOnion) _vm->_visa->displayScrollChain('q', 21); // Yucky onion. else _vm->_visa->displayScrollChain('t', 18); // Normal onion scroll @@ -649,7 +649,7 @@ void Acci::examineObject() { } bool Acci::isPersonHere() { // Person equivalent of "holding". - if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_dna._room)) + if ((_person == kPardon) || (_person == 0) || (_vm->_gyro->_whereIs[_person - 150] == _vm->_gyro->_room)) return true; else { Common::String tmpStr; @@ -669,13 +669,13 @@ void Acci::exampers() { _person -= 149; switch (_person) { // Special cases case 11: - if (_vm->_gyro->_dna._wonNim) { + if (_vm->_gyro->_wonNim) { _vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!" return; } break; case 99: - if (_vm->_gyro->_dna._lustieIsAsleep) { + if (_vm->_gyro->_lustieIsAsleep) { _vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!) return; } @@ -686,7 +686,7 @@ void Acci::exampers() { } // And afterwards... - if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake)) + if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake)) _vm->_visa->displayScrollChain('Q', 13); } @@ -702,7 +702,7 @@ bool Acci::isHolding() { if (_thing > 100) _vm->_scrolls->displayText("Be reasonable!"); - else if (!_vm->_gyro->_dna._objects[_thing - 1]) // Verbs that need "_thing" to be in the inventory. + else if (!_vm->_gyro->_objects[_thing - 1]) // Verbs that need "_thing" to be in the inventory. _vm->_scrolls->displayText("You're not holding it, Avvy."); else holdingResult = true; @@ -711,7 +711,7 @@ bool Acci::isHolding() { } void Acci::openBox(bool isOpening) { - if ((_vm->_gyro->_dna._room == r__yours) && (_thing == 54)) { + if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_celer->updateBackgroundSprites(); @@ -753,22 +753,22 @@ void Acci::inventory() { Common::String tmpStr = Common::String("You're carrying "); for (byte i = 0; i < kObjectNum; i++) { - if (_vm->_gyro->_dna._objects[i]) { + if (_vm->_gyro->_objects[i]) { itemNum++; - if (itemNum == _vm->_gyro->_dna._carryNum) + if (itemNum == _vm->_gyro->_carryNum) tmpStr += "and "; tmpStr += _vm->_gyro->getItem(i + 1); - if ((i + 1) == _vm->_gyro->_dna._wearing) + if ((i + 1) == _vm->_gyro->_wearing) tmpStr += ", which you're wearing"; - if (itemNum < _vm->_gyro->_dna._carryNum) + if (itemNum < _vm->_gyro->_carryNum) tmpStr += ", "; } } - if (_vm->_gyro->_dna._wearing == kNothing) + if (_vm->_gyro->_wearing == kNothing) tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine); else tmpStr += '.'; @@ -779,16 +779,16 @@ void Acci::inventory() { void Acci::swallow() { // Eat something. switch (_thing) { case Gyro::kObjectWine: - switch (_vm->_gyro->_dna._wineState) { // 4 is perfect + switch (_vm->_gyro->_wineState) { // 4 is perfect case 1: - if (_vm->_gyro->_dna._teetotal) { + if (_vm->_gyro->_teetotal) { _vm->_visa->displayScrollChain('D', 6); return; } _vm->_visa->displayScrollChain('U', 1); _vm->_pingo->wobble(); _vm->_visa->displayScrollChain('U', 2); - _vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectWine - 1] = false; _vm->_lucerna->refreshObjectList(); drink(); break; @@ -815,16 +815,16 @@ void Acci::swallow() { // Eat something. _vm->_lucerna->gameOver(); break; case Gyro::kObjectOnion: - if (_vm->_gyro->_dna._rottenOnion) + if (_vm->_gyro->_rottenOnion) _vm->_visa->displayScrollChain('U', 11); else { _vm->_visa->displayScrollChain('U', 8); - _vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false; _vm->_lucerna->refreshObjectList(); } break; default: - if ((_vm->_gyro->_dna._room == r__argentpub) || (_vm->_gyro->_dna._room == r__nottspub)) + if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub)) _vm->_scrolls->displayText("Try BUYing things before you drink them!"); else _vm->_scrolls->displayText("The taste of it makes you retch!"); @@ -835,7 +835,7 @@ void Acci::peopleInRoom() { byte numPeople = 0; // Number of people in the room. for (byte i = 1; i < 29; i++) { // Start at 1 so we don't list Avvy himself! - if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) + if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) numPeople++; } @@ -845,7 +845,7 @@ void Acci::peopleInRoom() { Common::String tmpStr; byte actPerson = 0; // Actually listed people. for (byte i = 1; i < 29; i++) { - if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_dna._room) { + if (_vm->_gyro->_whereIs[i] == _vm->_gyro->_room) { actPerson++; if (actPerson == 1) // First on the list. tmpStr = _vm->_gyro->getName(i + 150); @@ -866,29 +866,29 @@ void Acci::peopleInRoom() { void Acci::lookAround() { _vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]); - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__spludwicks: - if (_vm->_gyro->_dna._avariciusTalk > 0) + if (_vm->_gyro->_avariciusTalk > 0) _vm->_visa->displayScrollChain('q', 23); else peopleInRoom(); break; case r__robins: - if (_vm->_gyro->_dna._tiedUp) + if (_vm->_gyro->_tiedUp) _vm->_visa->displayScrollChain('q', 38); - if (_vm->_gyro->_dna._mushroomGrowing) + if (_vm->_gyro->_mushroomGrowing) _vm->_visa->displayScrollChain('q', 55); break; case r__insidecardiffcastle: - if (!_vm->_gyro->_dna._takenPen) + if (!_vm->_gyro->_takenPen) _vm->_visa->displayScrollChain('q', 49); break; case r__lustiesroom: - if (_vm->_gyro->_dna._lustieIsAsleep) + if (_vm->_gyro->_lustieIsAsleep) _vm->_visa->displayScrollChain('q', 65); break; case r__catacombs: - switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) { + switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) { case 258 : _vm->_visa->displayScrollChain('q', 80); // Inside art gallery. break; @@ -907,7 +907,7 @@ void Acci::lookAround() { void Acci::openDoor() { // Special cases. - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__yours: if (_vm->_animation->inField(2)) { // Opening the box. @@ -925,7 +925,7 @@ void Acci::openDoor() { break; } - if ((!_vm->_gyro->_dna._userMovesAvvy) && (_vm->_gyro->_dna._room != r__lusties)) + if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties)) return; // No doors can open if you can't move Avvy. for (byte fv = 8; fv < 15; fv++) { @@ -958,7 +958,7 @@ void Acci::openDoor() { } } - if (_vm->_gyro->_dna._room == r__map) + if (_vm->_gyro->_room == r__map) _vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \ "to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."); else @@ -986,14 +986,14 @@ void Acci::putProc() { switch (_thing2) { case Gyro::kObjectWine: if (_thing == Gyro::kObjectOnion) { - if (_vm->_gyro->_dna._rottenOnion) + if (_vm->_gyro->_rottenOnion) _vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!"); else { // Put onion into wine? - if (_vm->_gyro->_dna._wineState != 3) { + if (_vm->_gyro->_wineState != 3) { Common::String tmpStr = Common::String::format("%cOignon au vin%c is a bit too strong for your tastes!", Scrolls::kControlItalic, Scrolls::kControlRoman); _vm->_scrolls->displayText(tmpStr); } else { // Put onion into vinegar! Yes! - _vm->_gyro->_dna._onionInVinegar = true; + _vm->_gyro->_onionInVinegar = true; _vm->_lucerna->incScore(7); _vm->_visa->displayScrollChain('u', 9); } @@ -1003,8 +1003,8 @@ void Acci::putProc() { break; case 54: - if (_vm->_gyro->_dna._room == r__yours) { // Put something into the box. - if (_vm->_gyro->_dna._boxContent != kNothing) + if (_vm->_gyro->_room == r__yours) { // Put something into the box. + if (_vm->_gyro->_boxContent != kNothing) _vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first."); else { switch (_thing) { @@ -1021,14 +1021,14 @@ void Acci::putProc() { _vm->_scrolls->displayText("Just give it to Spludwick, Avvy!"); break; default: // Put the object into the box... - if (_vm->_gyro->_dna._wearing == _thing) { + if (_vm->_gyro->_wearing == _thing) { Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str()); _vm->_scrolls->displayText(tmpStr); } else { openBox(true); // Open box. - _vm->_gyro->_dna._boxContent = _thing; - _vm->_gyro->_dna._objects[_thing - 1] = false; + _vm->_gyro->_boxContent = _thing; + _vm->_gyro->_objects[_thing - 1] = false; _vm->_lucerna->refreshObjectList(); _vm->_scrolls->displayText("OK, it's in the box."); @@ -1050,7 +1050,7 @@ void Acci::putProc() { * @remarks Originally called 'not_in_order' */ void Acci::notInOrder() { - Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]); + Common::String itemStr = _vm->_gyro->getItem(_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_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(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); @@ -1071,18 +1071,18 @@ void Acci::goToCauldron() { * @remarks Originally called 'give2spludwick' */ bool Acci::giveToSpludwick() { - if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) { + if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) { notInOrder(); return false; } switch (_thing) { case Gyro::kObjectOnion: - _vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false; - if (_vm->_gyro->_dna._rottenOnion) + _vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false; + if (_vm->_gyro->_rottenOnion) _vm->_visa->displayScrollChain('q', 22); else { - _vm->_gyro->_dna._givenToSpludwick++; + _vm->_gyro->_givenToSpludwick++; _vm->_visa->displayScrollChain('q', 20); goToCauldron(); _vm->_lucerna->incScore(3); @@ -1090,20 +1090,20 @@ bool Acci::giveToSpludwick() { _vm->_lucerna->refreshObjectList(); break; case Gyro::kObjectInk: - _vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectInk - 1] = false; _vm->_lucerna->refreshObjectList(); - _vm->_gyro->_dna._givenToSpludwick++; + _vm->_gyro->_givenToSpludwick++; _vm->_visa->displayScrollChain('q', 24); goToCauldron(); _vm->_lucerna->incScore(3); break; case Gyro::kObjectMushroom: - _vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false; _vm->_visa->displayScrollChain('q', 25); _vm->_lucerna->incScore(5); - _vm->_gyro->_dna._givenToSpludwick++; + _vm->_gyro->_givenToSpludwick++; goToCauldron(); - _vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true; _vm->_lucerna->refreshObjectList(); break; default: @@ -1114,12 +1114,12 @@ bool Acci::giveToSpludwick() { } void Acci::drink() { - _vm->_gyro->_dna._alcoholLevel += 1; - if (_vm->_gyro->_dna._alcoholLevel == 5) { - _vm->_gyro->_dna._objects[Gyro::kObjectKey - 1] = true; // Get the key. - _vm->_gyro->_dna._teetotal = true; - _vm->_gyro->_dna._avvyIsAwake = false; - _vm->_gyro->_dna._avvyInBed = true; + _vm->_gyro->_alcoholLevel += 1; + if (_vm->_gyro->_alcoholLevel == 5) { + _vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key. + _vm->_gyro->_teetotal = true; + _vm->_gyro->_avvyIsAwake = false; + _vm->_gyro->_avvyInBed = true; _vm->_lucerna->refreshObjectList(); _vm->_lucerna->dusk(); _vm->_gyro->hangAroundForAWhile(); @@ -1130,14 +1130,14 @@ void Acci::drink() { } void Acci::cardiffClimbing() { - if (_vm->_gyro->_dna._standingOnDais) { // Clamber up. + if (_vm->_gyro->_standingOnDais) { // Clamber up. _vm->_scrolls->displayText("You climb down, back onto the floor."); - _vm->_gyro->_dna._standingOnDais = false; + _vm->_gyro->_standingOnDais = false; _vm->_animation->appearPed(1, 3); } else { // Clamber down. if (_vm->_animation->inField(1)) { _vm->_scrolls->displayText("You clamber up onto the dais."); - _vm->_gyro->_dna._standingOnDais = true; + _vm->_gyro->_standingOnDais = true; _vm->_animation->appearPed(1, 2); } else _vm->_scrolls->displayText("Get a bit closer, Avvy."); @@ -1149,21 +1149,21 @@ void Acci::already() { } void Acci::standUp() { - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__yours: // Avvy isn't asleep. - if (_vm->_gyro->_dna._avvyIsAwake && _vm->_gyro->_dna._avvyInBed) { // But he's in bed. - if (_vm->_gyro->_dna._teetotal) { + if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) { // But he's in bed. + if (_vm->_gyro->_teetotal) { _vm->_visa->displayScrollChain('d', 12); _vm->_gyro->setBackgroundColor(0); _vm->_visa->displayScrollChain('d', 14); } _vm->_animation->_sprites[0]._visible = true; - _vm->_gyro->_dna._userMovesAvvy = true; + _vm->_gyro->_userMovesAvvy = true; _vm->_animation->appearPed(1, 2); - _vm->_gyro->_dna._direction = Gyro::kDirectionLeft; + _vm->_gyro->_direction = Gyro::kDirectionLeft; _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow. _vm->_lucerna->incScore(1); - _vm->_gyro->_dna._avvyInBed = false; + _vm->_gyro->_avvyInBed = false; _vm->_timer->loseTimer(Timer::kReasonArkataShouts); } else already(); @@ -1174,12 +1174,12 @@ void Acci::standUp() { break; case r__nottspub: - if (_vm->_gyro->_dna._sittingInPub) { + if (_vm->_gyro->_sittingInPub) { _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down. _vm->_animation->_sprites[0]._visible = true; // But standing up. _vm->_animation->appearPed(1, 4); // And walking away. - _vm->_gyro->_dna._sittingInPub = false; // Really not sitting down. - _vm->_gyro->_dna._userMovesAvvy = true; // And ambulant. + _vm->_gyro->_sittingInPub = false; // Really not sitting down. + _vm->_gyro->_userMovesAvvy = true; // And ambulant. } else already(); break; @@ -1189,15 +1189,15 @@ void Acci::standUp() { } void Acci::getProc(char thing) { - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__yours: if (_vm->_animation->inField(2)) { - if (_vm->_gyro->_dna._boxContent == thing) { + if (_vm->_gyro->_boxContent == thing) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_scrolls->displayText("OK, I've got it."); - _vm->_gyro->_dna._objects[thing - 1] = true; + _vm->_gyro->_objects[thing - 1] = true; _vm->_lucerna->refreshObjectList(); - _vm->_gyro->_dna._boxContent = kNothing; + _vm->_gyro->_boxContent = kNothing; _vm->_celer->drawBackgroundSprite(-1, -1, 6); } else { Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str()); @@ -1210,18 +1210,18 @@ void Acci::getProc(char thing) { switch (thing) { case Gyro::kObjectPen: if (_vm->_animation->inField(2)) { // Standing on the dais. - if (_vm->_gyro->_dna._takenPen) + if (_vm->_gyro->_takenPen) _vm->_scrolls->displayText("It's not there, Avvy."); else { // OK: we're taking the pen, and it's there. _vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now. _vm->_animation->callSpecial(3); // Zap! - _vm->_gyro->_dna._takenPen = true; - _vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = true; + _vm->_gyro->_takenPen = true; + _vm->_gyro->_objects[Gyro::kObjectPen - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_scrolls->displayText("Taken."); } - } else if (_vm->_gyro->_dna._standingOnDais) + } else if (_vm->_gyro->_standingOnDais) _vm->_visa->displayScrollChain('q', 53); else _vm->_visa->displayScrollChain('q', 51); @@ -1234,12 +1234,12 @@ void Acci::getProc(char thing) { } break; case r__robins: - if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_dna._mushroomGrowing)) { + if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_scrolls->displayText("Got it!"); - _vm->_gyro->_dna._mushroomGrowing = false; - _vm->_gyro->_dna._takenMushroom = true; - _vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = true; + _vm->_gyro->_mushroomGrowing = false; + _vm->_gyro->_takenMushroom = true; + _vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_lucerna->incScore(3); } else @@ -1255,12 +1255,12 @@ void Acci::getProc(char thing) { * @remarks Originally called 'give_Geida_the_lute' */ void Acci::giveGeidaTheLute() { - if (_vm->_gyro->_dna._room != r__lustiesroom) { + if (_vm->_gyro->_room != r__lustiesroom) { Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); return; } - _vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectLute - 1] = false; _vm->_lucerna->refreshObjectList(); _vm->_visa->displayScrollChain('q', 64); // She plays it. @@ -1286,13 +1286,13 @@ void Acci::winSequence() { Common::String Acci::personSpeaks() { if ((_person == kPardon) || (_person == 0)) { - if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_dna._room)) + if ((_vm->_gyro->_him == kPardon) || (_vm->_gyro->_whereIs[_vm->_gyro->_him - 150] != _vm->_gyro->_room)) _person = _vm->_gyro->_her; else _person = _vm->_gyro->_him; } - if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_dna._room) { + if (_vm->_gyro->_whereIs[_person - 150] != _vm->_gyro->_room) { return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself! } @@ -1310,7 +1310,7 @@ Common::String Acci::personSpeaks() { return tmpStr; for (byte i = 0; i < 16; i++) { - if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_dna._room)) + if ((_vm->_gyro->kQuasipeds[i]._who == _person) && (_vm->_gyro->kQuasipeds[i]._room == _vm->_gyro->_room)) tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i); } @@ -1320,7 +1320,7 @@ void Acci::heyThanks() { Common::String tmpStr = personSpeaks(); tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); - _vm->_gyro->_dna._objects[_thing - 1] = false; + _vm->_gyro->_objects[_thing - 1] = false; } /** @@ -1350,7 +1350,7 @@ void Acci::doThat() { _vm->_scrolls->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->_gyro->_dna._avvyIsAwake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { + if (!_vm->_gyro->_avvyIsAwake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) { _vm->_scrolls->displayText("Talking in your sleep? Try waking up!"); return; } @@ -1370,7 +1370,7 @@ void Acci::doThat() { break; case kVerbCodeGet: if (_thing != kPardon) { // Legitimate try to pick something up. - if (_vm->_gyro->_dna._carryNum >= kCarryLimit) + if (_vm->_gyro->_carryNum >= kCarryLimit) _vm->_scrolls->displayText("You can't carry any more!"); else getProc(_thing); @@ -1433,7 +1433,7 @@ void Acci::doThat() { case Gyro::kPeopleCrapulus: if (_thing == Gyro::kObjectWine) { _vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down."); - _vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectWine - 1] = false; } else heyThanks(); break; @@ -1451,21 +1451,21 @@ void Acci::doThat() { if (_thing == Gyro::kObjectBadge) { _vm->_visa->displayScrollChain('q', 32); // Thanks! Wow! _vm->_lucerna->incScore(3); - _vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = false; - _vm->_gyro->_dna._objects[Gyro::kObjectHabit - 1] = true; - _vm->_gyro->_dna._givenBadgeToIby = true; + _vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true; + _vm->_gyro->_givenBadgeToIby = true; _vm->_celer->drawBackgroundSprite(-1, -1, 8); _vm->_celer->drawBackgroundSprite(-1, -1, 9); } else heyThanks(); break; case Gyro::kPeopleAyles: - if (_vm->_gyro->_dna._aylesIsAwake) { + if (_vm->_gyro->_aylesIsAwake) { if (_thing == Gyro::kObjectPen) { - _vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectPen - 1] = false; _vm->_visa->displayScrollChain('q', 54); - _vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = true; - _vm->_gyro->_dna._givenPenToAyles = true; + _vm->_gyro->_objects[Gyro::kObjectInk - 1] = true; + _vm->_gyro->_givenPenToAyles = true; _vm->_lucerna->refreshObjectList(); _vm->_lucerna->incScore(2); } else @@ -1476,10 +1476,10 @@ void Acci::doThat() { case Gyro::kPeopleGeida: switch (_thing) { case Gyro::kObjectPotion: - _vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectPotion - 1] = false; _vm->_visa->displayScrollChain('u', 16); // She drinks it. _vm->_lucerna->incScore(2); - _vm->_gyro->_dna._givenPotionToGeida = true; + _vm->_gyro->_givenPotionToGeida = true; _vm->_lucerna->refreshObjectList(); break; case Gyro::kObjectLute: @@ -1492,7 +1492,7 @@ void Acci::doThat() { case Gyro::kPeopleArkata: switch (_thing) { case Gyro::kObjectPotion: - if (_vm->_gyro->_dna._givenPotionToGeida) + if (_vm->_gyro->_givenPotionToGeida) winSequence(); else _vm->_visa->displayScrollChain('q', 77); // That Geida woman! @@ -1562,12 +1562,12 @@ void Acci::doThat() { } break; case kVerbCodeUndress: - if (_vm->_gyro->_dna._wearing == kNothing) + if (_vm->_gyro->_wearing == kNothing) _vm->_scrolls->displayText("You're already stark naked!"); - else if (_vm->_gyro->_dna._avvysInTheCupboard) { - Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_dna._wearing).c_str()); + else if (_vm->_gyro->_avvysInTheCupboard) { + Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str()); _vm->_scrolls->displayText(tmpStr); - _vm->_gyro->_dna._wearing = kNothing; + _vm->_gyro->_wearing = kNothing; _vm->_lucerna->refreshObjectList(); } else _vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?"); @@ -1581,14 +1581,14 @@ void Acci::doThat() { break; case Gyro::kObjectClothes: case Gyro::kObjectHabit: { // Change this! - if (_vm->_gyro->_dna._wearing != kNothing) { - if (_vm->_gyro->_dna._wearing == _thing) + if (_vm->_gyro->_wearing != kNothing) { + if (_vm->_gyro->_wearing == _thing) _vm->_scrolls->displayText("You're already wearing that."); else _vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!"); return; } else - _vm->_gyro->_dna._wearing = _thing; + _vm->_gyro->_wearing = _thing; _vm->_lucerna->refreshObjectList(); @@ -1614,35 +1614,35 @@ void Acci::doThat() { break; case kVerbCodePlay: if (_thing == kPardon) { - switch (_vm->_gyro->_dna._room) { // They just typed "play"... + switch (_vm->_gyro->_room) { // They just typed "play"... case r__argentpub: { // ...in the pub, => play Nim. warning("STUB: Acci::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->_gyro->_dna._wonNim) { // Already won the game. + if (_vm->_gyro->_wonNim) { // Already won the game. _vm->_visa->displayScrollChain('Q', 6); return; } - if (!_vm->_gyro->_dna._askedDogfoodAboutNim) { + if (!_vm->_gyro->_askedDogfoodAboutNim) { _vm->_visa->displayScrollChain('q', 84); return; } _vm->_visa->displayScrollChain('Q', 3); - _vm->_gyro->_dna._playedNim++; + _vm->_gyro->_playedNim++; // You won - strange! _vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute! - _vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectLute - 1] = true; _vm->_lucerna->refreshObjectList(); - _vm->_gyro->_dna._wonNim = true; + _vm->_gyro->_wonNim = true; _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it. _vm->_lucerna->incScore(7); // 7 points for winning! - if (_vm->_gyro->_dna._playedNim == 1) + if (_vm->_gyro->_playedNim == 1) _vm->_lucerna->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!!! @@ -1659,20 +1659,20 @@ void Acci::doThat() { case Gyro::kObjectLute : _vm->_visa->displayScrollChain('U', 7); - if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_dna._room) + if (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room) _vm->_visa->displayScrollChain('U', 10); - if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_dna._room) + if (_vm->_gyro->_whereIs[Gyro::kPeopleDuLustie - 150] == _vm->_gyro->_room) _vm->_visa->displayScrollChain('U', 15); break; case 52: - if (_vm->_gyro->_dna._room == r__musicroom) + if (_vm->_gyro->_room == r__musicroom) playHarp(); else _vm->_scrolls->displayText(kWhat); break; case 55: - if (_vm->_gyro->_dna._room == r__argentpub) + if (_vm->_gyro->_room == r__argentpub) // play_nim(); warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()"); else @@ -1687,7 +1687,7 @@ void Acci::doThat() { if (isHolding()) { if (_thing == Gyro::kObjectBell) { _vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong..."); - if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B'))) + if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B'))) // \? are used to avoid that ??! is parsed as a trigraph _vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)"); } else @@ -1724,10 +1724,10 @@ void Acci::doThat() { } break; case kVerbCodeMagic: - if (_vm->_gyro->_dna._avariciusTalk > 0) + if (_vm->_gyro->_avariciusTalk > 0) _vm->_visa->displayScrollChain('q', 19); else { - if ((_vm->_gyro->_dna._room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears! + if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears! _vm->_visa->displayScrollChain('q', 17); if (_vm->_gyro->_whereIs[1] == 12) _vm->_visa->displayScrollChain('q', 18); @@ -1737,7 +1737,7 @@ void Acci::doThat() { _vm->_animation->_sprites[1].walkTo(5); _vm->_animation->_sprites[1]._callEachStepFl = true; _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth; - _vm->_gyro->_dna._avariciusTalk = 14; + _vm->_gyro->_avariciusTalk = 14; _vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks); } } else @@ -1748,7 +1748,7 @@ void Acci::doThat() { _vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric."); break; case kVerbCodeExpletive: - switch (_vm->_gyro->_dna._sworeNum) { + switch (_vm->_gyro->_sworeNum) { case 0: { Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \ "(I shouldn't say it again, if I were you!)", Scrolls::kControlNewLine, Scrolls::kControlNewLine); @@ -1769,10 +1769,10 @@ void Acci::doThat() { _vm->_lucerna->gameOver(); } } - _vm->_gyro->_dna._sworeNum++; + _vm->_gyro->_sworeNum++; break; case kVerbCodeListen: - if ((_vm->_gyro->_dna._bellsAreRinging) & (_vm->_gyro->setFlag('B'))) + if ((_vm->_gyro->_bellsAreRinging) & (_vm->_gyro->setFlag('B'))) _vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells."); else if (_vm->_gyro->_listen.empty()) _vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy."); @@ -1780,7 +1780,7 @@ void Acci::doThat() { _vm->_scrolls->displayText(_vm->_gyro->_listen); break; case kVerbCodeBuy: // What are they trying to buy? - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__argentpub: if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar. switch (_thing) { @@ -1788,40 +1788,40 @@ void Acci::doThat() { case 53: case 54: case 58: // Beer, whisky, cider or mead. - if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one. + if (_vm->_gyro->_malagauche == 177) { // Already getting us one. _vm->_visa->displayScrollChain('D', 15); return; } - if (_vm->_gyro->_dna._teetotal) { + if (_vm->_gyro->_teetotal) { _vm->_visa->displayScrollChain('D', 6); return; } - if (_vm->_gyro->_dna._alcoholLevel == 0) + if (_vm->_gyro->_alcoholLevel == 0) _vm->_lucerna->incScore(3); _vm->_celer->drawBackgroundSprite(-1, -1, 12); _vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble); - _vm->_gyro->_dna._drinking = _thing; + _vm->_gyro->_drinking = _thing; _vm->_celer->drawBackgroundSprite(-1, -1, 10); - _vm->_gyro->_dna._malagauche = 177; + _vm->_gyro->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks); break; case 52: examine(); break; // We have a right one here - buy Pepsi??! case Gyro::kObjectWine: - if (_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]) // We've already got the wine! + if (_vm->_gyro->_objects[Gyro::kObjectWine - 1]) // We've already got the wine! _vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent! else { - if (_vm->_gyro->_dna._malagauche == 177) { // Already getting us one. + if (_vm->_gyro->_malagauche == 177) { // Already getting us one. _vm->_visa->displayScrollChain('D', 15); return; } - if (_vm->_gyro->_dna._carryNum >= kCarryLimit) { + if (_vm->_gyro->_carryNum >= kCarryLimit) { _vm->_scrolls->displayText("Your hands are full."); return; } @@ -1829,10 +1829,10 @@ void Acci::doThat() { _vm->_celer->drawBackgroundSprite(-1, -1, 12); Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); - if (_vm->_gyro->_dna._alcoholLevel == 0) + if (_vm->_gyro->_alcoholLevel == 0) _vm->_lucerna->incScore(3); _vm->_celer->drawBackgroundSprite(-1, -1, 10); - _vm->_gyro->_dna._malagauche = 177; + _vm->_gyro->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks); } @@ -1845,23 +1845,23 @@ void Acci::doThat() { case r__outsideducks: if (_vm->_animation->inField(6)) { if (_thing == Gyro::kObjectOnion) { - if (_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]) + if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) _vm->_visa->displayScrollChain('D', 10); // Not planning to juggle with the things! - else if (_vm->_gyro->_dna._carryNum >= kCarryLimit) + else if (_vm->_gyro->_carryNum >= kCarryLimit) _vm->_scrolls->displayText("Before you ask, you remember that your hands are full."); else { - if (_vm->_gyro->_dna._boughtOnion) + if (_vm->_gyro->_boughtOnion) _vm->_visa->displayScrollChain('D', 11); else { _vm->_visa->displayScrollChain('D', 9); _vm->_lucerna->incScore(3); } _vm->_gyro->decreaseMoney(3); // It costs thruppence. - _vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectOnion - 1] = true; _vm->_lucerna->refreshObjectList(); - _vm->_gyro->_dna._boughtOnion = true; - _vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall! - _vm->_gyro->_dna._onionInVinegar = false; + _vm->_gyro->_boughtOnion = true; + _vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall! + _vm->_gyro->_onionInVinegar = false; } } else _vm->_visa->displayScrollChain('D', 0); @@ -1877,10 +1877,10 @@ void Acci::doThat() { } break; case kVerbCodeAttack: - if ((_vm->_gyro->_dna._room == r__brummieroad) && + if ((_vm->_gyro->_room == r__brummieroad) && ((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) - && (_vm->_gyro->_whereIs[7] == _vm->_gyro->_dna._room)) { - switch (_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] * 2) { + && (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) { + switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) { // 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both. case 0: _vm->_visa->displayScrollChain('Q', 10); @@ -1894,9 +1894,9 @@ void Acci::doThat() { break; case 3: _vm->_visa->displayScrollChain('Q', 11); - _vm->_gyro->_dna._cwytalotGone = true; - _vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = false; - _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = false; + _vm->_gyro->_cwytalotGone = true; + _vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false; _vm->_lucerna->refreshObjectList(); _vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing; _vm->_lucerna->incScore(7); @@ -1912,14 +1912,14 @@ void Acci::doThat() { _vm->_visa->displayScrollChain('Q', 10); break; case kVerbCodePasswd: - if (_vm->_gyro->_dna._room != r__bridge) + if (_vm->_gyro->_room != r__bridge) _vm->_visa->displayScrollChain('Q', 12); else { bool ok = true; for (byte i = 0; i < _thats.size(); i++) { Common::String temp = _realWords[i]; temp.toUppercase(); - int pwdId = _vm->_gyro->_dna._passwordNum + kFirstPassword; + int pwdId = _vm->_gyro->_passwordNum + kFirstPassword; for (byte j = 0; j < kVocabulary[pwdId]._word.size(); j++) { if (kVocabulary[pwdId]._word[j] != temp[j]) ok = false; @@ -1927,13 +1927,13 @@ void Acci::doThat() { } if (ok) { - if (_vm->_gyro->_dna._drawbridgeOpen != 0) + if (_vm->_gyro->_drawbridgeOpen != 0) _vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again."); else { _vm->_lucerna->incScore(4); _vm->_scrolls->displayText("The drawbridge opens!"); _vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls); - _vm->_gyro->_dna._drawbridgeOpen = 1; + _vm->_gyro->_drawbridgeOpen = 1; } } else _vm->_visa->displayScrollChain('Q', 12); @@ -1946,7 +1946,7 @@ void Acci::doThat() { _vm->_lucerna->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->_gyro->_dna._score, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::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->_gyro->_dnascore, Scrolls::kControlCenter, Scrolls::kControlNewLine, Scrolls::kControlNewLine, Scrolls::kControlNewLine, rank().c_str(), Scrolls::kControlNewLine, Scrolls::kControlNewLine, totalTime().c_str()); _vm->_scrolls->displayText(tmpStr); } break; @@ -1978,14 +1978,14 @@ void Acci::doThat() { break; case kVerbCodeClimb: - if (_vm->_gyro->_dna._room == r__insidecardiffcastle) + if (_vm->_gyro->_room == r__insidecardiffcastle) cardiffClimbing(); else // In the wrong room! _vm->_scrolls->displayText("Not with your head for heights, Avvy!"); break; case kVerbCodeJump: _vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping); - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; break; case kVerbCodeHiscores: // show_highs(); @@ -1997,18 +1997,18 @@ void Acci::doThat() { case kPardon: case Gyro::kPeopleAvalot: case 0: - if (!_vm->_gyro->_dna._avvyIsAwake) { - _vm->_gyro->_dna._avvyIsAwake = true; + if (!_vm->_gyro->_avvyIsAwake) { + _vm->_gyro->_avvyIsAwake = true; _vm->_lucerna->incScore(1); - _vm->_gyro->_dna._avvyInBed = true; + _vm->_gyro->_avvyInBed = true; _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed. - if (_vm->_gyro->_dna._teetotal) + if (_vm->_gyro->_teetotal) _vm->_visa->displayScrollChain('d', 13); } else _vm->_scrolls->displayText("You're already awake, Avvy!"); break; case Gyro::kPeopleAyles: - if (!_vm->_gyro->_dna._aylesIsAwake) + if (!_vm->_gyro->_aylesIsAwake) _vm->_scrolls->displayText("You can't seem to wake him by yourself."); break; case Gyro::kPeopleJacques: { @@ -2022,8 +2022,8 @@ void Acci::doThat() { } break; case kVerbCodeSit: - if (_vm->_gyro->_dna._room == r__nottspub) { - if (_vm->_gyro->_dna._sittingInPub) + if (_vm->_gyro->_room == r__nottspub) { + if (_vm->_gyro->_sittingInPub) _vm->_scrolls->displayText("You're already sitting!"); else { _vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down. diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 57353255db..bdca9fdcf1 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -436,8 +436,8 @@ void Animation::catacombMove(byte ped) { - xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256; - _vm->_gyro->_dna._geidaSpin = 0; + xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256; + _vm->_gyro->_geidaSpin = 0; switch (xy_uint16) { case 1801: // Exit catacombs @@ -456,15 +456,15 @@ void Animation::catacombMove(byte ped) { case 2307: flipRoom(r__lusties, 5); _vm->_scrolls->displayText("Oh no... here we go again..."); - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; _sprites[0]._moveY = 1; _sprites[0]._moveX = 0; return; } - if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom) + if (!_vm->_gyro->_enterCatacombsFromLustiesRoom) _vm->_lucerna->loadRoom(29); - here = _vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1]; + here = _vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1]; switch (here & 0xf) { // West. case 0: // no connection (wall) @@ -595,7 +595,7 @@ void Animation::catacombMove(byte ped) { case 0x1: _vm->_celer->drawBackgroundSprite(-1, -1, 22); - if ((xy_uint16 == 2051) && (_vm->_gyro->_dna._geidaFollows)) + if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows)) _vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim; else _vm->_gyro->_magics[12]._operation = Gyro::kMagicSpecial; // Right exit south. @@ -726,7 +726,7 @@ void Animation::catacombMove(byte ped) { break; // [1,1] : the other two. } - if ((_vm->_gyro->_dna._geidaFollows) && (ped > 0)) { + if ((_vm->_gyro->_geidaFollows) && (ped > 0)) { if (!_sprites[1]._quick) // If we don't already have her... _sprites[1].init(5, true, this); // ...Load Geida. appearPed(2, geidaPed(ped)); @@ -746,27 +746,27 @@ void Animation::callSpecial(uint16 which) { switch (which) { case 1: // _vm->_gyro->special 1: Room 22: top of stairs. _vm->_celer->drawBackgroundSprite(-1, -1, 1); - _vm->_gyro->_dna._brummieStairs = 1; + _vm->_gyro->_brummieStairs = 1; _vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing; _vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs); stopWalking(); - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; break; case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs. - _vm->_gyro->_dna._brummieStairs = 3; + _vm->_gyro->_brummieStairs = 3; _vm->_gyro->_magics[10]._operation = Gyro::kMagicNothing; _vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim; _vm->_gyro->_magics[11]._data = 5; _vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned! stopWalking(); _vm->_visa->displayScrollChain('q', 26); - _vm->_gyro->_dna._userMovesAvvy = true; + _vm->_gyro->_userMovesAvvy = true; break; case 3: // _vm->_gyro->special 3: Room 71: triggers dart. _sprites[0].bounce(); // Must include that. - if (!_vm->_gyro->_dna._arrowTriggered) { - _vm->_gyro->_dna._arrowTriggered = true; + if (!_vm->_gyro->_arrowTriggered) { + _vm->_gyro->_arrowTriggered = true; appearPed(2, 4); // The dart starts at ped 4, and... _sprites[1].walkTo(5); // flies to ped 5. _sprites[1]._facingDir = kDirUp; // Only face. @@ -786,7 +786,7 @@ void Animation::callSpecial(uint16 which) { _vm->_enid->backToBootstrap(3); break; case 5: - if (_vm->_gyro->_dna._friarWillTieYouUp) { + if (_vm->_gyro->_friarWillTieYouUp) { // _vm->_gyro->special 5: Room 42: touched tree, and get tied up. _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again. _vm->_visa->displayScrollChain('q', 35); @@ -794,8 +794,8 @@ void Animation::callSpecial(uint16 which) { //tr[1].vanishifstill:=true; _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_visa->displayScrollChain('q', 36); - _vm->_gyro->_dna._tiedUp = true; - _vm->_gyro->_dna._friarWillTieYouUp = false; + _vm->_gyro->_tiedUp = true; + _vm->_gyro->_friarWillTieYouUp = false; _sprites[1].walkTo(3); _sprites[1]._vanishIfStill = true; _sprites[1]._doCheck = true; // One of them must have Check_Me switched on. @@ -804,7 +804,7 @@ void Animation::callSpecial(uint16 which) { } break; case 6: // _vm->_gyro->special 6: fall down oubliette. - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; _sprites[0]._moveX = 3; _sprites[0]._moveY = 0; _sprites[0]._facingDir = kDirRight; @@ -821,7 +821,7 @@ void Animation::callSpecial(uint16 which) { _vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid); break; case 8: // _vm->_gyro->special 8: leave du Lustie's room. - if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) { + if ((_vm->_gyro->_geidaFollows) && (!_vm->_gyro->_lustieIsAsleep)) { _vm->_visa->displayScrollChain('q', 63); _sprites[1].turn(kDirDown); _sprites[1].stopWalk(); @@ -830,18 +830,18 @@ void Animation::callSpecial(uint16 which) { } break; case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood... - if (!_vm->_gyro->_dna._geidaFollows) + if (!_vm->_gyro->_geidaFollows) return; // DOESN'T COUNT: no Geida. _sprites[1]._callEachStepFl = false; // She no longer follows Avvy around. _sprites[1].walkTo(4); // She walks to somewhere... _sprites[0].remove(); // Lose Avvy. - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; _vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida); break; case 10: // _vm->_gyro->special 10: transfer north in catacombs. - if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) { + if ((_vm->_gyro->_catacombX == 4) && (_vm->_gyro->_catacombY == 1)) { // Into Geida's room. - if (_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1]) + if (_vm->_gyro->_objects[Gyro::kObjectKey - 1]) _vm->_visa->displayScrollChain('q', 62); else { _vm->_visa->displayScrollChain('q', 61); @@ -849,11 +849,11 @@ void Animation::callSpecial(uint16 which) { } } _vm->_lucerna->dusk(); - _vm->_gyro->_dna._catacombY--; + _vm->_gyro->_catacombY--; catacombMove(4); - if (_vm->_gyro->_dna._room != r__catacombs) + if (_vm->_gyro->_room != r__catacombs) return; - switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_dna._catacombY - 1][_vm->_gyro->_dna._catacombX - 1] & 0xf00) >> 8) { + switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) { case 0x1: appearPed(1, 12); break; @@ -867,27 +867,27 @@ void Animation::callSpecial(uint16 which) { break; case 11: // _vm->_gyro->special 11: transfer east in catacombs. _vm->_lucerna->dusk(); - _vm->_gyro->_dna._catacombX++; + _vm->_gyro->_catacombX++; catacombMove(1); - if (_vm->_gyro->_dna._room != r__catacombs) + if (_vm->_gyro->_room != r__catacombs) return; appearPed(1, 1); dawnDelay(); break; case 12: // _vm->_gyro->special 12: transfer south in catacombs. _vm->_lucerna->dusk(); - _vm->_gyro->_dna._catacombY += 1; + _vm->_gyro->_catacombY += 1; catacombMove(2); - if (_vm->_gyro->_dna._room != r__catacombs) + if (_vm->_gyro->_room != r__catacombs) return; appearPed(1, 2); dawnDelay(); break; case 13: // _vm->_gyro->special 13: transfer west in catacombs. _vm->_lucerna->dusk(); - _vm->_gyro->_dna._catacombX--; + _vm->_gyro->_catacombX--; catacombMove(3); - if (_vm->_gyro->_dna._room != r__catacombs) + if (_vm->_gyro->_room != r__catacombs) return; appearPed(1, 3); dawnDelay(); @@ -903,7 +903,7 @@ void Animation::callSpecial(uint16 which) { * @remarks Originally called 'open_the_door' */ void Animation::openDoor(byte whither, byte ped, byte magicnum) { - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__outsideyours: case r__outsidenottspub: case r__outsideducks: @@ -930,7 +930,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) { case r__lusties: switch (magicnum) { case 14: - if (_vm->_gyro->_dna._avvysInTheCupboard) { + if (_vm->_gyro->_avvysInTheCupboard) { hideInCupboard(); _vm->_sequence->firstShow(8); _vm->_sequence->thenShow(7); @@ -1080,13 +1080,13 @@ void Animation::arrowProcs(byte tripnum) { #endif _vm->_lucerna->gameOver(); - _vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him. + _vm->_gyro->_userMovesAvvy = false; // Stop the user from moving him. _vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke); } } else { // Arrow has hit the wall! _sprites[tripnum].remove(); // Deallocate the arrow. _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door. - _vm->_gyro->_dna._arrowInTheDoor = true; // So that we can pick it up. + _vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up. } } @@ -1145,21 +1145,21 @@ void Animation::spin(byte whichway, byte &tripnum) { if (_sprites[tripnum]._id == 2) return; // Not for Spludwick - _vm->_gyro->_dna._geidaSpin += 1; - _vm->_gyro->_dna._geidaTime = 20; - if (_vm->_gyro->_dna._geidaSpin == 5) { + _vm->_gyro->_geidaSpin += 1; + _vm->_gyro->_geidaTime = 20; + if (_vm->_gyro->_geidaSpin == 5) { _vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!"); - _vm->_gyro->_dna._geidaSpin = 0; - _vm->_gyro->_dna._geidaTime = 0; // knock out records + _vm->_gyro->_geidaSpin = 0; + _vm->_gyro->_geidaTime = 0; // knock out records } } } void Animation::geidaProcs(byte tripnum) { - if (_vm->_gyro->_dna._geidaTime > 0) { - _vm->_gyro->_dna._geidaTime--; - if (_vm->_gyro->_dna._geidaTime == 0) - _vm->_gyro->_dna._geidaSpin = 0; + if (_vm->_gyro->_geidaTime > 0) { + _vm->_gyro->_geidaTime--; + if (_vm->_gyro->_geidaTime == 0) + _vm->_gyro->_geidaSpin = 0; } if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) { @@ -1279,7 +1279,7 @@ void Animation::animLink() { void Animation::stopWalking() { _sprites[0].stopWalk(); - _vm->_gyro->_dna._direction = kDirStopped; + _vm->_gyro->_direction = kDirStopped; if (_vm->_gyro->_alive) _sprites[0]._stepNum = 1; } @@ -1289,16 +1289,16 @@ void Animation::stopWalking() { * @remarks Originally called 'hide_in_the_cupboard' */ void Animation::hideInCupboard() { - if (_vm->_gyro->_dna._avvysInTheCupboard) { - if (_vm->_gyro->_dna._wearing == Acci::kNothing) { + if (_vm->_gyro->_avvysInTheCupboard) { + if (_vm->_gyro->_wearing == Acci::kNothing) { Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman); _vm->_scrolls->displayText(tmpStr); } else { _sprites[0]._visible = true; - _vm->_gyro->_dna._userMovesAvvy = true; + _vm->_gyro->_userMovesAvvy = true; appearPed(1, 3); // Walk out of the cupboard. _vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!"); - _vm->_gyro->_dna._avvysInTheCupboard = false; + _vm->_gyro->_avvysInTheCupboard = false; _vm->_sequence->firstShow(8); _vm->_sequence->thenShow(7); _vm->_sequence->startToClose(); @@ -1306,11 +1306,11 @@ void Animation::hideInCupboard() { } else { // Not hiding in the cupboard _sprites[0]._visible = false; - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; Common::String tmpStr = Common::String::format("You walk into the room...%cIt seems to be an empty, " \ "but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph); _vm->_scrolls->displayText(tmpStr); - _vm->_gyro->_dna._avvysInTheCupboard = true; + _vm->_gyro->_avvysInTheCupboard = true; _vm->_celer->drawBackgroundSprite(-1, -1, 8); } } @@ -1323,18 +1323,18 @@ void Animation::flipRoom(byte room, byte ped) { return; } - if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) { + if ((room == 177) && (_vm->_gyro->_room == r__lusties)) { hideInCupboard(); return; } - if ((_vm->_gyro->_dna._jumpStatus > 0) && (_vm->_gyro->_dna._room == r__insidecardiffcastle)) { + if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == r__insidecardiffcastle)) { // You can't *jump* out of Cardiff Castle! _sprites[0]._moveX = 0; return; } - _vm->_lucerna->exitRoom(_vm->_gyro->_dna._room); + _vm->_lucerna->exitRoom(_vm->_gyro->_room); _vm->_lucerna->dusk(); for (int16 i = 1; i < kSpriteNumbMax; i++) { @@ -1342,14 +1342,14 @@ void Animation::flipRoom(byte room, byte ped) { _sprites[i].remove(); } // Deallocate sprite - if (_vm->_gyro->_dna._room == r__lustiesroom) - _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; + if (_vm->_gyro->_room == r__lustiesroom) + _vm->_gyro->_enterCatacombsFromLustiesRoom = true; _vm->_lucerna->enterRoom(room, ped); appearPed(1, ped); - _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false; - _vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; - _vm->_gyro->_dna._direction = _sprites[0]._facingDir; + _vm->_gyro->_enterCatacombsFromLustiesRoom = false; + _vm->_gyro->_oldDirection = _vm->_gyro->_direction; + _vm->_gyro->_direction = _sprites[0]._facingDir; _vm->_lucerna->drawDirection(); _vm->_lucerna->dawn(); @@ -1385,7 +1385,7 @@ bool Animation::nearDoor() { } void Animation::handleMoveKey(const Common::Event &event) { - if (!_vm->_gyro->_dna._userMovesAvvy) + if (!_vm->_gyro->_userMovesAvvy) return; if (_vm->_dropdown->_activeMenuItem._activeNow) @@ -1393,58 +1393,58 @@ void Animation::handleMoveKey(const Common::Event &event) { else { switch (event.kbd.keycode) { case Common::KEYCODE_UP: - if (_vm->_gyro->_dna._direction != kDirUp) { - _vm->_gyro->_dna._direction = kDirUp; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirUp) { + _vm->_gyro->_direction = kDirUp; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_DOWN: - if (_vm->_gyro->_dna._direction != kDirDown) { - _vm->_gyro->_dna._direction = kDirDown; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirDown) { + _vm->_gyro->_direction = kDirDown; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_LEFT: - if (_vm->_gyro->_dna._direction != kDirLeft) { - _vm->_gyro->_dna._direction = kDirLeft; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirLeft) { + _vm->_gyro->_direction = kDirLeft; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_RIGHT: - if (_vm->_gyro->_dna._direction != kDirRight) { - _vm->_gyro->_dna._direction = kDirRight; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirRight) { + _vm->_gyro->_direction = kDirRight; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_PAGEUP: - if (_vm->_gyro->_dna._direction != kDirUpRight) { - _vm->_gyro->_dna._direction = kDirUpRight; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirUpRight) { + _vm->_gyro->_direction = kDirUpRight; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_PAGEDOWN: - if (_vm->_gyro->_dna._direction != kDirDownRight) { - _vm->_gyro->_dna._direction = kDirDownRight; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirDownRight) { + _vm->_gyro->_direction = kDirDownRight; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_END: - if (_vm->_gyro->_dna._direction != kDirDownLeft) { - _vm->_gyro->_dna._direction = kDirDownLeft; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirDownLeft) { + _vm->_gyro->_direction = kDirDownLeft; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; case Common::KEYCODE_HOME: - if (_vm->_gyro->_dna._direction != kDirUpLeft) { - _vm->_gyro->_dna._direction = kDirUpLeft; - changeDirection(0, _vm->_gyro->_dna._direction); + if (_vm->_gyro->_direction != kDirUpLeft) { + _vm->_gyro->_direction = kDirUpLeft; + changeDirection(0, _vm->_gyro->_direction); } else stopWalking(); break; diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index ce3fb8eaf6..611a8ef3a8 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -123,146 +123,146 @@ const char *AvalancheEngine::getCopyrightString() const { void AvalancheEngine::synchronize(Common::Serializer &sz) { //blockwrite(f, dna, sizeof(dna)); - sz.syncAsByte(_gyro->_dna._direction); - sz.syncAsByte(_gyro->_dna._carryNum); + sz.syncAsByte(_gyro->_direction); + sz.syncAsByte(_gyro->_carryNum); for (byte i = 0; i < kObjectNum; i++) - sz.syncAsByte(_gyro->_dna._objects[i]); - sz.syncAsSint16LE(_gyro->_dna._score); - sz.syncAsSint32LE(_gyro->_dna._money); - sz.syncAsByte(_gyro->_dna._room); - sz.syncAsByte(_gyro->_dna._wearing); - sz.syncAsByte(_gyro->_dna._sworeNum); - sz.syncAsByte(_gyro->_dna._saveNum); - sz.syncBytes(_gyro->_dna._roomCount, 100); - sz.syncAsByte(_gyro->_dna._alcoholLevel); - sz.syncAsByte(_gyro->_dna._playedNim); - sz.syncAsByte(_gyro->_dna._wonNim); - sz.syncAsByte(_gyro->_dna._wineState); - sz.syncAsByte(_gyro->_dna._cwytalotGone); - sz.syncAsByte(_gyro->_dna._passwordNum); - sz.syncAsByte(_gyro->_dna._aylesIsAwake); - sz.syncAsByte(_gyro->_dna._drawbridgeOpen); - sz.syncAsByte(_gyro->_dna._avariciusTalk); - sz.syncAsByte(_gyro->_dna._boughtOnion); - sz.syncAsByte(_gyro->_dna._rottenOnion); - sz.syncAsByte(_gyro->_dna._onionInVinegar); - sz.syncAsByte(_gyro->_dna._givenToSpludwick); - sz.syncAsByte(_gyro->_dna._brummieStairs); - sz.syncAsByte(_gyro->_dna._cardiffQuestionNum); - sz.syncAsByte(_gyro->_dna._passedCwytalotInHerts); - sz.syncAsByte(_gyro->_dna._avvyIsAwake); - sz.syncAsByte(_gyro->_dna._avvyInBed); - sz.syncAsByte(_gyro->_dna._userMovesAvvy); - sz.syncAsByte(_gyro->_dna._dogFoodPos); - sz.syncAsByte(_gyro->_dna._givenBadgeToIby); - sz.syncAsByte(_gyro->_dna._friarWillTieYouUp); - sz.syncAsByte(_gyro->_dna._tiedUp); - sz.syncAsByte(_gyro->_dna._boxContent); - sz.syncAsByte(_gyro->_dna._talkedToCrapulus); - sz.syncAsByte(_gyro->_dna._jacquesState); - sz.syncAsByte(_gyro->_dna._bellsAreRinging); - sz.syncAsByte(_gyro->_dna._standingOnDais); - sz.syncAsByte(_gyro->_dna._takenPen); - sz.syncAsByte(_gyro->_dna._arrowTriggered); - sz.syncAsByte(_gyro->_dna._arrowInTheDoor); + sz.syncAsByte(_gyro->_objects[i]); + sz.syncAsSint16LE(_gyro->_dnascore); + sz.syncAsSint32LE(_gyro->_money); + sz.syncAsByte(_gyro->_room); + sz.syncAsByte(_gyro->_wearing); + sz.syncAsByte(_gyro->_sworeNum); + sz.syncAsByte(_gyro->_saveNum); + sz.syncBytes(_gyro->_roomCount, 100); + sz.syncAsByte(_gyro->_alcoholLevel); + sz.syncAsByte(_gyro->_playedNim); + sz.syncAsByte(_gyro->_wonNim); + sz.syncAsByte(_gyro->_wineState); + sz.syncAsByte(_gyro->_cwytalotGone); + sz.syncAsByte(_gyro->_passwordNum); + sz.syncAsByte(_gyro->_aylesIsAwake); + sz.syncAsByte(_gyro->_drawbridgeOpen); + sz.syncAsByte(_gyro->_avariciusTalk); + sz.syncAsByte(_gyro->_boughtOnion); + sz.syncAsByte(_gyro->_rottenOnion); + sz.syncAsByte(_gyro->_onionInVinegar); + sz.syncAsByte(_gyro->_givenToSpludwick); + sz.syncAsByte(_gyro->_brummieStairs); + sz.syncAsByte(_gyro->_cardiffQuestionNum); + sz.syncAsByte(_gyro->_passedCwytalotInHerts); + sz.syncAsByte(_gyro->_avvyIsAwake); + sz.syncAsByte(_gyro->_avvyInBed); + sz.syncAsByte(_gyro->_userMovesAvvy); + sz.syncAsByte(_gyro->_dogFoodPos); + sz.syncAsByte(_gyro->_givenBadgeToIby); + sz.syncAsByte(_gyro->_friarWillTieYouUp); + sz.syncAsByte(_gyro->_tiedUp); + sz.syncAsByte(_gyro->_boxContent); + sz.syncAsByte(_gyro->_talkedToCrapulus); + sz.syncAsByte(_gyro->_jacquesState); + sz.syncAsByte(_gyro->_bellsAreRinging); + sz.syncAsByte(_gyro->_standingOnDais); + sz.syncAsByte(_gyro->_takenPen); + sz.syncAsByte(_gyro->_arrowTriggered); + sz.syncAsByte(_gyro->_arrowInTheDoor); if (sz.isSaving()) { - uint16 like2drinkSize = _gyro->_dna._favouriteDrink.size(); + uint16 like2drinkSize = _gyro->_favouriteDrink.size(); sz.syncAsUint16LE(like2drinkSize); for (uint16 i = 0; i < like2drinkSize; i++) { - char actChr = _gyro->_dna._favouriteDrink[i]; + char actChr = _gyro->_favouriteDrink[i]; sz.syncAsByte(actChr); } - uint16 favourite_songSize = _gyro->_dna._favouriteSong.size(); + uint16 favourite_songSize = _gyro->_favouriteSong.size(); sz.syncAsUint16LE(favourite_songSize); for (uint16 i = 0; i < favourite_songSize; i++) { - char actChr = _gyro->_dna._favouriteSong[i]; + char actChr = _gyro->_favouriteSong[i]; sz.syncAsByte(actChr); } - uint16 worst_place_on_earthSize = _gyro->_dna._worstPlaceOnEarth.size(); + uint16 worst_place_on_earthSize = _gyro->_worstPlaceOnEarth.size(); sz.syncAsUint16LE(worst_place_on_earthSize); for (uint16 i = 0; i < worst_place_on_earthSize; i++) { - char actChr = _gyro->_dna._worstPlaceOnEarth[i]; + char actChr = _gyro->_worstPlaceOnEarth[i]; sz.syncAsByte(actChr); } - uint16 spare_eveningSize = _gyro->_dna._spareEvening.size(); + uint16 spare_eveningSize = _gyro->_spareEvening.size(); sz.syncAsUint16LE(spare_eveningSize); for (uint16 i = 0; i < spare_eveningSize; i++) { - char actChr = _gyro->_dna._spareEvening[i]; + char actChr = _gyro->_spareEvening[i]; sz.syncAsByte(actChr); } } else { - if (!_gyro->_dna._favouriteDrink.empty()) - _gyro->_dna._favouriteDrink.clear(); + if (!_gyro->_favouriteDrink.empty()) + _gyro->_favouriteDrink.clear(); uint16 like2drinkSize = 0; char actChr = ' '; sz.syncAsUint16LE(like2drinkSize); for (uint16 i = 0; i < like2drinkSize; i++) { sz.syncAsByte(actChr); - _gyro->_dna._favouriteDrink += actChr; + _gyro->_favouriteDrink += actChr; } - if (!_gyro->_dna._favouriteSong.empty()) - _gyro->_dna._favouriteSong.clear(); + if (!_gyro->_favouriteSong.empty()) + _gyro->_favouriteSong.clear(); uint16 favourite_songSize = 0; sz.syncAsUint16LE(favourite_songSize); for (uint16 i = 0; i < favourite_songSize; i++) { sz.syncAsByte(actChr); - _gyro->_dna._favouriteSong += actChr; + _gyro->_favouriteSong += actChr; } - if (!_gyro->_dna._worstPlaceOnEarth.empty()) - _gyro->_dna._worstPlaceOnEarth.clear(); + if (!_gyro->_worstPlaceOnEarth.empty()) + _gyro->_worstPlaceOnEarth.clear(); uint16 worst_place_on_earthSize = 0; sz.syncAsUint16LE(worst_place_on_earthSize); for (uint16 i = 0; i < worst_place_on_earthSize; i++) { sz.syncAsByte(actChr); - _gyro->_dna._worstPlaceOnEarth += actChr; + _gyro->_worstPlaceOnEarth += actChr; } - if (!_gyro->_dna._spareEvening.empty()) - _gyro->_dna._spareEvening.clear(); + if (!_gyro->_spareEvening.empty()) + _gyro->_spareEvening.clear(); uint16 spare_eveningSize = 0; sz.syncAsUint16LE(spare_eveningSize); for (uint16 i = 0; i < spare_eveningSize; i++) { sz.syncAsByte(actChr); - _gyro->_dna._spareEvening += actChr; + _gyro->_spareEvening += actChr; } } - sz.syncAsSint32LE(_gyro->_dna._totalTime); - sz.syncAsByte(_gyro->_dna._jumpStatus); - sz.syncAsByte(_gyro->_dna._mushroomGrowing); - sz.syncAsByte(_gyro->_dna._spludwickAtHome); - sz.syncAsByte(_gyro->_dna._lastRoom); - sz.syncAsByte(_gyro->_dna._lastRoomNotMap); - sz.syncAsByte(_gyro->_dna._crapulusWillTell); - sz.syncAsByte(_gyro->_dna._enterCatacombsFromLustiesRoom); - sz.syncAsByte(_gyro->_dna._teetotal); - sz.syncAsByte(_gyro->_dna._malagauche); - sz.syncAsByte(_gyro->_dna._drinking); - sz.syncAsByte(_gyro->_dna._enteredLustiesRoomAsMonk); - sz.syncAsByte(_gyro->_dna._catacombX); - sz.syncAsByte(_gyro->_dna._catacombY); - sz.syncAsByte(_gyro->_dna._avvysInTheCupboard); - sz.syncAsByte(_gyro->_dna._geidaFollows); - sz.syncAsByte(_gyro->_dna._geidaSpin); - sz.syncAsByte(_gyro->_dna._geidaTime); - sz.syncAsByte(_gyro->_dna._nextBell); - sz.syncAsByte(_gyro->_dna._givenPotionToGeida); - sz.syncAsByte(_gyro->_dna._lustieIsAsleep); - sz.syncAsByte(_gyro->_dna._flipToWhere); - sz.syncAsByte(_gyro->_dna._flipToPed); - sz.syncAsByte(_gyro->_dna._beenTiedUp); - sz.syncAsByte(_gyro->_dna._sittingInPub); - sz.syncAsByte(_gyro->_dna._spurgeTalkCount); - sz.syncAsByte(_gyro->_dna._metAvaroid); - sz.syncAsByte(_gyro->_dna._takenMushroom); - sz.syncAsByte(_gyro->_dna._givenPenToAyles); - sz.syncAsByte(_gyro->_dna._askedDogfoodAboutNim); + sz.syncAsSint32LE(_gyro->_totalTime); + sz.syncAsByte(_gyro->_jumpStatus); + sz.syncAsByte(_gyro->_mushroomGrowing); + sz.syncAsByte(_gyro->_spludwickAtHome); + sz.syncAsByte(_gyro->_lastRoom); + sz.syncAsByte(_gyro->_lastRoomNotMap); + sz.syncAsByte(_gyro->_crapulusWillTell); + sz.syncAsByte(_gyro->_enterCatacombsFromLustiesRoom); + sz.syncAsByte(_gyro->_teetotal); + sz.syncAsByte(_gyro->_malagauche); + sz.syncAsByte(_gyro->_drinking); + sz.syncAsByte(_gyro->_enteredLustiesRoomAsMonk); + sz.syncAsByte(_gyro->_catacombX); + sz.syncAsByte(_gyro->_catacombY); + sz.syncAsByte(_gyro->_avvysInTheCupboard); + sz.syncAsByte(_gyro->_geidaFollows); + sz.syncAsByte(_gyro->_geidaSpin); + sz.syncAsByte(_gyro->_geidaTime); + sz.syncAsByte(_gyro->_nextBell); + sz.syncAsByte(_gyro->_givenPotionToGeida); + sz.syncAsByte(_gyro->_lustieIsAsleep); + sz.syncAsByte(_gyro->_flipToWhere); + sz.syncAsByte(_gyro->_flipToPed); + sz.syncAsByte(_gyro->_beenTiedUp); + sz.syncAsByte(_gyro->_sittingInPub); + sz.syncAsByte(_gyro->_spurgeTalkCount); + sz.syncAsByte(_gyro->_metAvaroid); + sz.syncAsByte(_gyro->_takenMushroom); + sz.syncAsByte(_gyro->_givenPenToAyles); + sz.syncAsByte(_gyro->_askedDogfoodAboutNim); #if 0 @@ -443,7 +443,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _celer->forgetBackgroundSprites(); _lucerna->minorRedraw(); _dropdown->setupMenu(); - _gyro->_whereIs[0] = _gyro->_dna._room; + _gyro->_whereIs[0] = _gyro->_room; _gyro->_alive = true; _lucerna->refreshObjectList(); _animation->updateSpeed(); @@ -459,7 +459,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _scrolls->displayText(tmpStr); if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible) - _animation->changeDirection(0, _gyro->_dna._direction); // We push Avvy in the right direction is he was moving. + _animation->changeDirection(0, _gyro->_direction); // We push Avvy in the right direction is he was moving. return true; } diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 2643299ec5..5a9fa60dc3 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -109,7 +109,7 @@ void Avalot::handleKeyDown(Common::Event &event) { case Common::KEYCODE_HOME: case Common::KEYCODE_END: case Common::KEYCODE_KP5: - if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) { + if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake) { _vm->_animation->handleMoveKey(event); // Fallthroughs are intended. _vm->_lucerna->drawDirection(); return; @@ -147,7 +147,7 @@ void Avalot::setup() { _vm->_gyro->_ledStatus = 177; _vm->_gyro->_defaultLed = 2; // TSkellern = 0; Replace with a more local variable sometime - _vm->_gyro->_dna._direction = Gyro::kDirectionStopped; + _vm->_gyro->_direction = Gyro::kDirectionStopped; _vm->_gyro->_enidFilename = ""; // Undefined. _vm->_lucerna->drawToolbar(); _vm->_scrolls->setReadyLight(2); diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index 10c2efce41..143725a92c 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -57,7 +57,7 @@ void Celer::updateBackgroundSprites() { if (_vm->_gyro->_dropdownActive) return; // No animation when the menus are up. - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__outsideargentpub: if ((_vm->_gyro->_roomTime % 12) == 0) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4); @@ -71,14 +71,14 @@ void Celer::updateBackgroundSprites() { drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4); break; case r__yours: - if ((!_vm->_gyro->_dna._avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0)) + if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0)) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2); break; case r__argentpub: - if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_dna._malagauche != 177)) { + if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) { // Malagauche cycle. - _vm->_gyro->_dna._malagauche += 1; - switch (_vm->_gyro->_dna._malagauche) { + _vm->_gyro->_malagauche += 1; + switch (_vm->_gyro->_malagauche) { case 1: case 11: case 21: @@ -94,7 +94,7 @@ void Celer::updateBackgroundSprites() { drawBackgroundSprite(-1, -1, 13); // Winks. break; case 33: - _vm->_gyro->_dna._malagauche = 0; + _vm->_gyro->_malagauche = 0; break; } } @@ -112,7 +112,7 @@ void Celer::updateBackgroundSprites() { drawBackgroundSprite(-1, -1, 7); break; case 199: - _vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this. + _vm->_gyro->_dogFoodPos = 177; // Impossible value for this. break; } @@ -125,9 +125,9 @@ void Celer::updateBackgroundSprites() { else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292)) direction = 4; - if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed. + if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed. drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->_dna._dogFoodPos = direction; + _vm->_gyro->_dogFoodPos = direction; } } break; @@ -150,7 +150,7 @@ void Celer::updateBackgroundSprites() { } break; case r__lustiesroom: - if (!(_vm->_gyro->_dna._lustieIsAsleep)) { + if (!(_vm->_gyro->_lustieIsAsleep)) { byte direction = 0; uint16 angle = _vm->_lucerna->bearing(2); if ((_vm->_gyro->_roomTime % 45) > 42) @@ -163,14 +163,14 @@ void Celer::updateBackgroundSprites() { else if ((angle >= 181) && (angle <= 314)) direction = 3; // Right. - if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed. + if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed. drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not? + _vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not? } } break; case r__aylesoffice: - if ((!_vm->_gyro->_dna._aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) { + if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) { switch ((_vm->_gyro->_roomTime / 14) % 2) { case 0: drawBackgroundSprite(-1, -1, 1); // Frame 2: EGA. @@ -182,7 +182,7 @@ void Celer::updateBackgroundSprites() { } break; case r__robins: - if (_vm->_gyro->_dna._tiedUp) { + if (_vm->_gyro->_tiedUp) { switch (_vm->_gyro->_roomTime % 54) { case 20: drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks. @@ -207,9 +207,9 @@ void Celer::updateBackgroundSprites() { if ((_vm->_gyro->_roomTime % 60) > 57) direction--; // Blinks. - if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed. + if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed. drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not? + _vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not? } switch (_vm->_gyro->_roomTime % 50) { @@ -239,22 +239,22 @@ void Celer::updateBackgroundSprites() { if ((_vm->_gyro->_roomTime % 45) > 42) direction++; // Duck blinks. - if (direction != _vm->_gyro->_dna._dogFoodPos) { // Only if it's changed. + if (direction != _vm->_gyro->_dogFoodPos) { // Only if it's changed. drawBackgroundSprite(-1, -1, direction); - _vm->_gyro->_dna._dogFoodPos = direction; // We use DogfoodPos here too - why not? + _vm->_gyro->_dogFoodPos = direction; // We use DogfoodPos here too - why not? } break; } } - if ((_vm->_gyro->_dna._bellsAreRinging) && (_vm->_gyro->setFlag('B'))) { + if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) { // They're ringing the bells. switch (_vm->_gyro->_roomTime % 4) { case 1: - if (_vm->_gyro->_dna._nextBell < 5) - _vm->_gyro->_dna._nextBell = 12; - _vm->_gyro->_dna._nextBell--; - _vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_dna._nextBell]); + if (_vm->_gyro->_nextBell < 5) + _vm->_gyro->_nextBell = 12; + _vm->_gyro->_nextBell--; + _vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]); break; case 2: //nosound(); diff --git a/engines/avalanche/dropdown2.cpp b/engines/avalanche/dropdown2.cpp index a934ed0f58..62f4680c57 100644 --- a/engines/avalanche/dropdown2.cpp +++ b/engines/avalanche/dropdown2.cpp @@ -448,7 +448,7 @@ void Dropdown::setupMenuAction() { else _activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true); _activeMenuItem.setupOption("Pause game", 'P', "f6", true); - if (_vm->_gyro->_dna._room == 99) + if (_vm->_gyro->_room == 99) _activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor()); else _activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor()); @@ -469,7 +469,7 @@ void Dropdown::setupMenuPeople() { _activeMenuItem.reset(); for (byte i = 150; i <= 178; i++) - if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_dna._room) { + if (_vm->_gyro->_whereIs[i - 150] == _vm->_gyro->_room) { _activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true); people = people + i; } @@ -480,7 +480,7 @@ void Dropdown::setupMenuPeople() { void Dropdown::setupMenuObjects() { _activeMenuItem.reset(); for (byte i = 0; i < kObjectNum; i++) { - if (_vm->_gyro->_dna._objects[i]) + if (_vm->_gyro->_objects[i]) _activeMenuItem.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true); } _activeMenuItem.display(); @@ -504,7 +504,7 @@ void Dropdown::setupMenuWith() { // or (c), the _person you've selected is YOU! if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing) - || (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_dna._room)) + || (_vm->_gyro->_whereIs[_vm->_gyro->_lastPerson - 150] != _vm->_gyro->_room)) _activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here. else { _activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true); @@ -522,13 +522,13 @@ void Dropdown::setupMenuWith() { } break; case Gyro::kPeopleDogfood: { - _activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_dna._wonNim); // True if you HAVEN'T won. + _activeMenuItem.setupOption("Play his game", 'P', "", !_vm->_gyro->_wonNim); // True if you HAVEN'T won. _vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay; } break; case Gyro::kPeopleMalagauche: { - bool isSober = !_vm->_gyro->_dna._teetotal; - _activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]); + bool isSober = !_vm->_gyro->_teetotal; + _activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]); _activeMenuItem.setupOption("Buy some beer", 'b', "", isSober); _activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober); _activeMenuItem.setupOption("Buy some cider", 'c', "", isSober); @@ -537,7 +537,7 @@ void Dropdown::setupMenuWith() { } break; case Gyro::kPeopleTrader: { - _activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]); + _activeMenuItem.setupOption("Buy an onion", 'o', "", !_vm->_gyro->_objects[Gyro::kObjectOnion - 1]); _vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105; } break; diff --git a/engines/avalanche/enid2.cpp b/engines/avalanche/enid2.cpp index a59db04a9f..4c8013e879 100644 --- a/engines/avalanche/enid2.cpp +++ b/engines/avalanche/enid2.cpp @@ -274,7 +274,7 @@ void Enid::ednaReload() { _vm->_lucerna->majorRedraw(); - _vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room; + _vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room; _vm->_gyro->_alive = true; diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index ecd1be14b7..d9e0d74804 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -178,7 +178,7 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) { _also[fv][ff] = 0; } - _dna._totalTime = 0; + _totalTime = 0; } Gyro::~Gyro() { @@ -225,6 +225,89 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String warning("STUB: Gyro::shbox()"); } +void Gyro::resetVariables() { +// Replaces memset(&_vm->_gyro->_dna, 0, sizeof(DnaType)); + _direction = 0; + _carryNum = 0; + for (int i = 0; i < kObjectNum; i++) + _objects[i] = false; + + _dnascore = 0; + _money = 0; + _room = 0; + _wearing = 0; + _sworeNum = 0; + _saveNum = 0; + for (int i = 0; i < 100; i++) + _roomCount[100] = 0; + + _alcoholLevel = 0; + _playedNim = 0; + _wonNim = false; + _wineState = 0; + _cwytalotGone = false; + _passwordNum = 0; + _aylesIsAwake = false; + _drawbridgeOpen = 0; + _avariciusTalk = 0; + _boughtOnion = false; + _rottenOnion = false; + _onionInVinegar = false; + _givenToSpludwick = 0; + _brummieStairs = 0; + _cardiffQuestionNum = 0; + _passedCwytalotInHerts = false; + _avvyIsAwake = false; + _avvyInBed = false; + _userMovesAvvy = false; + _dogFoodPos = 0; + _givenBadgeToIby = false; + _friarWillTieYouUp = false; + _tiedUp = false; + _boxContent = 0; + _talkedToCrapulus = false; + _jacquesState = 0; + _bellsAreRinging = false; + _standingOnDais = false; + _takenPen = false; + _arrowTriggered = false; + _arrowInTheDoor = false; + _favouriteDrink = ""; + _favouriteSong = ""; + _worstPlaceOnEarth = ""; + _spareEvening = ""; + _totalTime = 0; + _jumpStatus = 0; + _mushroomGrowing = false; + _spludwickAtHome = false; + _lastRoom = 0; + _lastRoomNotMap = 0; + _crapulusWillTell = false; + _enterCatacombsFromLustiesRoom = false; + _teetotal = false; + _malagauche = 0; + _drinking = 0; + _enteredLustiesRoomAsMonk = false; + _catacombX = 0; + _catacombY = 0; + _avvysInTheCupboard = false; + _geidaFollows = false; + _geidaSpin = 0; + _geidaTime = 0; + _nextBell = 0; + _givenPotionToGeida = false; + _lustieIsAsleep = false; + _flipToWhere = 0; + _flipToPed = 0; + _beenTiedUp = false; + _sittingInPub = false; + _spurgeTalkCount = 0; + _metAvaroid = false; + _takenMushroom = false; + _givenPenToAyles = false; + _askedDogfoodAboutNim = false; +} + void Gyro::newGame() { for (byte i = 0; i < kMaxSprites; i++) { if (_vm->_animation->_sprites[i]._quick) @@ -236,19 +319,19 @@ void Gyro::newGame() { _alive = true; _score = 0; - memset(&_vm->_gyro->_dna, 0, sizeof(DnaType)); + resetVariables(); _vm->_scrolls->setBubbleStateNatural(); - _dna._spareEvening = "answer a questionnaire"; - _dna._favouriteDrink = "beer"; - _dna._money = 30; // 2/6 - _dna._direction = kDirectionStopped; - _dna._wearing = kObjectClothes; - _dna._objects[kObjectMoney - 1] = true; - _dna._objects[kObjectBodkin - 1] = true; - _dna._objects[kObjectBell - 1] = true; - _dna._objects[kObjectClothes - 1] = true; + _spareEvening = "answer a questionnaire"; + _favouriteDrink = "beer"; + _money = 30; // 2/6 + _direction = kDirectionStopped; + _wearing = kObjectClothes; + _objects[kObjectMoney - 1] = true; + _objects[kObjectBodkin - 1] = true; + _objects[kObjectBell - 1] = true; + _objects[kObjectClothes - 1] = true; _thinkThing = true; _thinks = 2; @@ -263,10 +346,10 @@ void Gyro::newGame() { _her = 254; _it = 254; _lastPerson = 254; // = Pardon? - _dna._passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1; - _dna._userMovesAvvy = false; + _passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1; + _userMovesAvvy = false; _doingSpriteRun = false; - _dna._avvyInBed = true; + _avvyInBed = true; _enidFilename = ""; _vm->_lucerna->enterRoom(1, 1); @@ -299,8 +382,8 @@ void Gyro::forceNumlock() { } bool Gyro::decreaseMoney(uint16 howmuchby) { - _dna._money -= howmuchby; - if (_dna._money < 0) { + _money -= howmuchby; + if (_money < 0) { _vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!" _vm->_lucerna->gameOver(); return false; @@ -343,7 +426,7 @@ Common::String Gyro::getThing(byte which) { Common::String get_thing_result; switch (which) { case kObjectWine: - switch (_dna._wineState) { + switch (_wineState) { case 1: case 4: get_thing_result = kThings[which - 1]; @@ -354,7 +437,7 @@ Common::String Gyro::getThing(byte which) { } break; case kObjectOnion: - if (_dna._rottenOnion) + if (_rottenOnion) get_thing_result = "rotten onion"; else get_thing_result = kThings[which - 1]; @@ -371,7 +454,7 @@ char Gyro::getThingChar(byte which) { char get_thingchar_result; switch (which) { case kObjectWine: - if (_dna._wineState == 3) + if (_wineState == 3) get_thingchar_result = 'V'; // Vinegar else get_thingchar_result = kThingsChar[which - 1]; @@ -396,7 +479,7 @@ Common::String Gyro::getItem(byte which) { switch (which) { case kObjectWine: - switch (_dna._wineState) { + switch (_wineState) { case 0: case 1: case 4: @@ -408,9 +491,9 @@ Common::String Gyro::getItem(byte which) { } break; case kObjectOnion: - if (_dna._rottenOnion) + if (_rottenOnion) get_better_result = "a rotten onion"; - else if (_dna._onionInVinegar) + else if (_onionInVinegar) get_better_result = "a pickled onion (in the vinegar)"; else get_better_result = kItems[which - 1]; @@ -426,21 +509,21 @@ Common::String Gyro::getItem(byte which) { Common::String Gyro::f5Does() { - switch (_dna._room) { + switch (_room) { case r__yours: - if (!_dna._avvyIsAwake) + if (!_avvyIsAwake) return Common::String::format("%cWWake up", Acci::kVerbCodeWake); - else if (_dna._avvyInBed) + else if (_avvyInBed) return Common::String::format("%cGGet up", Acci::kVerbCodeStand); break; case r__insidecardiffcastle: - if (_dna._standingOnDais) + if (_standingOnDais) return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb); else return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb); break; case r__nottspub: - if (_dna._sittingInPub) + if (_sittingInPub) return Common::String::format("%cSStand up", Acci::kVerbCodeStand); else return Common::String::format("%cSSit down", Acci::kVerbCodeSit); diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index faab64c070..35addc3a50 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -53,76 +53,6 @@ struct MouseHotspotType { // mouse-void int16 _horizontal, _vertical; }; -struct DnaType { // Ux, uy, & ww now all belong to Trip5 - byte _direction; // The direction Avvy is currently facing. - byte _carryNum; // How many objects you're carrying... - bool _objects[kObjectNum]; // ...and which ones they are. - int16 _score; // your score, of course - int32 _money; // your current amount of dosh - byte _room; // your current room - byte _wearing; // what you're wearing - byte _sworeNum; // number of times you've sworn - byte _saveNum; // number of times this game has been saved - byte _roomCount[100]; // Add one to each every time you enter a room - byte _alcoholLevel; // Your blood alcohol level. - byte _playedNim; // How many times you've played Nim. - bool _wonNim; // Have you *won* Nim? (That's harder.) - byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar. - bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet? - byte _passwordNum; // Number of the passw for this game. - bool _aylesIsAwake; // pretty obvious! - byte _drawbridgeOpen; // Between 0 (shut) and 4 (open). - byte _avariciusTalk; // How much Avaricius has said to you. - bool _boughtOnion; // Have you bought an onion yet? - bool _rottenOnion; // And has it rotted? - bool _onionInVinegar; // Is the onion in the vinegar? - byte _givenToSpludwick; // 0 = nothing given, 1 = onion... - byte _brummieStairs; // Progression through the stairs trick. - byte _cardiffQuestionNum; // Things you get asked in Cardiff. - bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts? - bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.) - bool _avvyInBed; // True if Avvy's in bed, but awake. - bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements. - byte _dogFoodPos; // Which way Dogfood's looking in the pub. - bool _givenBadgeToIby; // Have you given the badge to Iby yet? - bool _friarWillTieYouUp; // If you're going to get tied up. - bool _tiedUp; // You ARE tied up! - byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box. - bool _talkedToCrapulus; // Pretty self-explanatory. - byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone. - bool _bellsAreRinging; // Is Jacques ringing the bells? - bool _standingOnDais; // In room 71, inside Cardiff Castle. - bool _takenPen; // Have you taken the pen (in Cardiff?) - bool _arrowTriggered; // And has the arrow been triggered? - bool _arrowInTheDoor; // Did the arrow hit the wall? - Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's - uint32 _totalTime; // Your total time playing this game, in ticks. - byte _jumpStatus; // Fixes how high you're jumping. - bool _mushroomGrowing; // Is the mushroom growing in 42? - bool _spludwickAtHome; // Is Spludwick at home? - byte _lastRoom; - byte _lastRoomNotMap; - bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away? - bool _enterCatacombsFromLustiesRoom; - bool _teetotal; // Are we touching any more drinks? - byte _malagauche; // Position of Malagauche. See Celer for more info. - char _drinking; // What's he getting you? - bool _enteredLustiesRoomAsMonk; - byte _catacombX, _catacombY; // XY coords in the catacombs. - bool _avvysInTheCupboard; // On screen 22. - bool _geidaFollows; // Is Geida following you? - byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke. - byte _nextBell; // For the ringing. - bool _givenPotionToGeida; // Does Geida have the potion? - bool _lustieIsAsleep; // Is BDL asleep? - byte _flipToWhere, _flipToPed; // For the sequencer. - bool _beenTiedUp; // In r__Robins. - bool _sittingInPub; // Are you sitting down in the pub? - byte _spurgeTalkCount; // Count for talking to Spurge. - bool _metAvaroid; - bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim; -}; - struct PedType { int16 _x, _y; byte _direction; @@ -324,7 +254,76 @@ public: // You may know better than On which page to switch to. bool _onCanDoPageSwap; - DnaType _dna; + // Former DNA structure + byte _direction; // The direction Avvy is currently facing. + byte _carryNum; // How many objects you're carrying... + bool _objects[kObjectNum]; // ...and which ones they are. + int16 _dnascore; // your score, of course + int32 _money; // your current amount of dosh + byte _room; // your current room + byte _wearing; // what you're wearing + byte _sworeNum; // number of times you've sworn + byte _saveNum; // number of times this game has been saved + byte _roomCount[100]; // Add one to each every time you enter a room + byte _alcoholLevel; // Your blood alcohol level. + byte _playedNim; // How many times you've played Nim. + bool _wonNim; // Have you *won* Nim? (That's harder.) + byte _wineState; // 0=good (Notts), 1=passable(Argent) ... 3=vinegar. + bool _cwytalotGone; // Has Cwytalot rushed off to Jerusalem yet? + byte _passwordNum; // Number of the passw for this game. + bool _aylesIsAwake; // pretty obvious! + byte _drawbridgeOpen; // Between 0 (shut) and 4 (open). + byte _avariciusTalk; // How much Avaricius has said to you. + bool _boughtOnion; // Have you bought an onion yet? + bool _rottenOnion; // And has it rotted? + bool _onionInVinegar; // Is the onion in the vinegar? + byte _givenToSpludwick; // 0 = nothing given, 1 = onion... + byte _brummieStairs; // Progression through the stairs trick. + byte _cardiffQuestionNum; // Things you get asked in Cardiff. + bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts? + bool _avvyIsAwake; // Well? Is Avvy awake? (Screen 1 only.) + bool _avvyInBed; // True if Avvy's in bed, but awake. + bool _userMovesAvvy; // If this is false, the user has no control over Avvy's movements. + byte _dogFoodPos; // Which way Dogfood's looking in the pub. + bool _givenBadgeToIby; // Have you given the badge to Iby yet? + bool _friarWillTieYouUp; // If you're going to get tied up. + bool _tiedUp; // You ARE tied up! + byte _boxContent; // 0 = money (sixpence), 254 = empty, any other number implies the contents of the box. + bool _talkedToCrapulus; // Pretty self-explanatory. + byte _jacquesState; // 0=asleep, 1=awake, 2=gets up, 3=gone. + bool _bellsAreRinging; // Is Jacques ringing the bells? + bool _standingOnDais; // In room 71, inside Cardiff Castle. + bool _takenPen; // Have you taken the pen (in Cardiff?) + bool _arrowTriggered; // And has the arrow been triggered? + bool _arrowInTheDoor; // Did the arrow hit the wall? + Common::String _favouriteDrink, _favouriteSong, _worstPlaceOnEarth, _spareEvening; // Personalisation str's + uint32 _totalTime; // Your total time playing this game, in ticks. + byte _jumpStatus; // Fixes how high you're jumping. + bool _mushroomGrowing; // Is the mushroom growing in 42? + bool _spludwickAtHome; // Is Spludwick at home? + byte _lastRoom; + byte _lastRoomNotMap; + bool _crapulusWillTell; // Will Crapulus tell you about Spludwick being away? + bool _enterCatacombsFromLustiesRoom; + bool _teetotal; // Are we touching any more drinks? + byte _malagauche; // Position of Malagauche. See Celer for more info. + char _drinking; // What's he getting you? + bool _enteredLustiesRoomAsMonk; + byte _catacombX, _catacombY; // XY coords in the catacombs. + bool _avvysInTheCupboard; // On screen 22. + bool _geidaFollows; // Is Geida following you? + byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke. + byte _nextBell; // For the ringing. + bool _givenPotionToGeida; // Does Geida have the potion? + bool _lustieIsAsleep; // Is BDL asleep? + byte _flipToWhere, _flipToPed; // For the sequencer. + bool _beenTiedUp; // In r__Robins. + bool _sittingInPub; // Are you sitting down in the pub? + byte _spurgeTalkCount; // Count for talking to Spurge. + bool _metAvaroid; + bool _takenMushroom, _givenPenToAyles, _askedDogfoodAboutNim; + // End of former DNA Structure + byte _lineNum; // Number of lines. LineType _lines[50]; // For Also. enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse; @@ -399,6 +398,7 @@ public: void setBackgroundColor(byte x); void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t); + void resetVariables(); void newGame(); // This sets up the DNA for a completely new game. void slowDown(); bool setFlag(char x); diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 82aabe2bd6..12b75523a4 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -346,12 +346,12 @@ void Lucerna::exitRoom(byte x) { switch (x) { case r__spludwicks: _vm->_timer->loseTimer(Timer::kReasonAvariciusTalks); - _vm->_gyro->_dna._avariciusTalk = 0; + _vm->_gyro->_avariciusTalk = 0; // He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. break; case r__bridge: - if (_vm->_gyro->_dna._drawbridgeOpen > 0) { - _vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open. + if (_vm->_gyro->_drawbridgeOpen > 0) { + _vm->_gyro->_drawbridgeOpen = 4; // Fully open. _vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls); } break; @@ -367,9 +367,9 @@ void Lucerna::exitRoom(byte x) { _vm->_gyro->_seeScroll = false; // Now it can work again! - _vm->_gyro->_dna._lastRoom = _vm->_gyro->_dna._room; - if (_vm->_gyro->_dna._room != r__map) - _vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room; + _vm->_gyro->_lastRoom = _vm->_gyro->_room; + if (_vm->_gyro->_room != r__map) + _vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room; } @@ -381,28 +381,28 @@ void Lucerna::exitRoom(byte x) { void Lucerna::enterNewTown() { _vm->_dropdown->setupMenu(); - switch (_vm->_gyro->_dna._room) { + switch (_vm->_gyro->_room) { case r__outsidenottspub: // Entry into Nottingham. - if ((_vm->_gyro->_dna._roomCount[r__robins] > 0) && (_vm->_gyro->_dna._beenTiedUp) && (!_vm->_gyro->_dna._takenMushroom)) - _vm->_gyro->_dna._mushroomGrowing = true; + if ((_vm->_gyro->_roomCount[r__robins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom)) + _vm->_gyro->_mushroomGrowing = true; break; case r__wisewomans: { // Entry into Argent. - if (_vm->_gyro->_dna._talkedToCrapulus && (! _vm->_gyro->_dna._lustieIsAsleep)) { - _vm->_gyro->_dna._spludwickAtHome = !((_vm->_gyro->_dna._roomCount[r__wisewomans] % 3) == 1); - _vm->_gyro->_dna._crapulusWillTell = ! _vm->_gyro->_dna._spludwickAtHome; + if (_vm->_gyro->_talkedToCrapulus && (! _vm->_gyro->_lustieIsAsleep)) { + _vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1); + _vm->_gyro->_crapulusWillTell = ! _vm->_gyro->_spludwickAtHome; } else { - _vm->_gyro->_dna._spludwickAtHome = true; - _vm->_gyro->_dna._crapulusWillTell = false; + _vm->_gyro->_spludwickAtHome = true; + _vm->_gyro->_crapulusWillTell = false; } - if (_vm->_gyro->_dna._boxContent == Gyro::kObjectWine) - _vm->_gyro->_dna._wineState = 3; // Vinegar + if (_vm->_gyro->_boxContent == Gyro::kObjectWine) + _vm->_gyro->_wineState = 3; // Vinegar } break; } - if (_vm->_gyro->_dna._room != r__outsideducks) { - if ((_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar)) - _vm->_gyro->_dna._rottenOnion = true; // You're holding the onion + if (_vm->_gyro->_room != r__outsideducks) { + if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar)) + _vm->_gyro->_rottenOnion = true; // You're holding the onion } } @@ -421,30 +421,30 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_seeScroll = true; // This stops the trippancy system working over the length of this procedure. findPeople(room); - _vm->_gyro->_dna._room = room; + _vm->_gyro->_room = room; if (ped != 0) - _vm->_gyro->_dna._roomCount[room]++; + _vm->_gyro->_roomCount[room]++; loadRoom(room); - if ((_vm->_gyro->_dna._roomCount[room] == 0) && (! _vm->_gyro->setFlag('S'))) + if ((_vm->_gyro->_roomCount[room] == 0) && (! _vm->_gyro->setFlag('S'))) incScore(1); - _vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_dna._room; + _vm->_gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _vm->_gyro->_room; - if (_vm->_gyro->_dna._geidaFollows) + if (_vm->_gyro->_geidaFollows) _vm->_gyro->_whereIs[Gyro::kPeopleGeida - 150] = room; _vm->_gyro->_roomTime = 0; - if ((_vm->_gyro->_dna._lastRoom == r__map) && (_vm->_gyro->_dna._lastRoomNotMap != _vm->_gyro->_dna._room)) + if ((_vm->_gyro->_lastRoom == r__map) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room)) enterNewTown(); switch (room) { case r__yours: - if (_vm->_gyro->_dna._avvyInBed) { + if (_vm->_gyro->_avvyInBed) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); _vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts); @@ -453,12 +453,12 @@ void Lucerna::enterRoom(byte room, byte ped) { case r__outsideyours: if (ped > 0) { - if (! _vm->_gyro->_dna._talkedToCrapulus) { + if (! _vm->_gyro->_talkedToCrapulus) { _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours; _vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus - if (_vm->_gyro->_dna._roomCount[r__outsideyours] == 1) { + if (_vm->_gyro->_roomCount[r__outsideyours] == 1) { _vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen. _vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you. } else { @@ -471,32 +471,32 @@ void Lucerna::enterRoom(byte room, byte ped) { } else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere; - if (_vm->_gyro->_dna._crapulusWillTell) { + if (_vm->_gyro->_crapulusWillTell) { _vm->_animation->_sprites[1].init(8, false, _vm->_animation); _vm->_animation->appearPed(2, 2); _vm->_animation->_sprites[1].walkTo(4); _vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut); - _vm->_gyro->_dna._crapulusWillTell = false; + _vm->_gyro->_crapulusWillTell = false; } } break; case r__outsidespludwicks: - if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) { + if ((_vm->_gyro->_roomCount[r__outsidespludwicks] == 1) && (ped == 1)) { _vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion); - _vm->_gyro->_dna._spludwickAtHome = true; + _vm->_gyro->_spludwickAtHome = true; } break; case r__spludwicks: - if (_vm->_gyro->_dna._spludwickAtHome) { + if (_vm->_gyro->_spludwickAtHome) { if (ped > 0) { _vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick _vm->_animation->appearPed(2, 2); _vm->_gyro->_whereIs[1] = r__spludwicks; } - _vm->_gyro->_dna._dogFoodPos = 0; // _vm->_gyro->also Spludwick pos. + _vm->_gyro->_dogFoodPos = 0; // _vm->_gyro->also Spludwick pos. _vm->_animation->_sprites[1]._callEachStepFl = true; _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida; @@ -505,9 +505,9 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__brummieroad: - if (_vm->_gyro->_dna._geidaFollows) + if (_vm->_gyro->_geidaFollows) putGeidaAt(5, ped); - if (_vm->_gyro->_dna._cwytalotGone) { + if (_vm->_gyro->_cwytalotGone) { _vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing; _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere; } else { @@ -517,7 +517,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY; _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad; - if (_vm->_gyro->_dna._roomCount[r__brummieroad] == 1) { // First time here... + if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here... _vm->_animation->appearPed(2, 2); // He appears on the right of the screen... _vm->_animation->_sprites[1].walkTo(4); // ...and he walks up... } else { @@ -530,31 +530,31 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__argentroad: - if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) && - (_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) { + if ((_vm->_gyro->_cwytalotGone) && (! _vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && + (_vm->_gyro->_roomCount[r__argentroad] > 3)) { _vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again _vm->_animation->appearPed(2, 1); _vm->_animation->_sprites[1].walkTo(2); _vm->_animation->_sprites[1]._vanishIfStill = true; - _vm->_gyro->_dna._passedCwytalotInHerts = true; + _vm->_gyro->_passedCwytalotInHerts = true; // _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in? _vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts); } break; case r__bridge: - if (_vm->_gyro->_dna._drawbridgeOpen == 4) { // open + if (_vm->_gyro->_drawbridgeOpen == 4) { // open _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge _vm->_graphics->refreshBackground(); _vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. } - if (_vm->_gyro->_dna._geidaFollows) + if (_vm->_gyro->_geidaFollows) putGeidaAt(ped + 3, ped); // load Geida break; case r__robins: if (ped > 0) { - if (! _vm->_gyro->_dna._beenTiedUp) { + if (! _vm->_gyro->_beenTiedUp) { // A welcome party... or maybe not... _vm->_animation->_sprites[1].init(6, false, _vm->_animation); _vm->_animation->appearPed(2, 2); @@ -563,22 +563,22 @@ void Lucerna::enterRoom(byte room, byte ped) { } } - if (_vm->_gyro->_dna._beenTiedUp) { + if (_vm->_gyro->_beenTiedUp) { _vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = 0; _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0; } - if (_vm->_gyro->_dna._tiedUp) + if (_vm->_gyro->_tiedUp) _vm->_celer->drawBackgroundSprite(-1, -1, 2); - if (!_vm->_gyro->_dna._mushroomGrowing) + if (!_vm->_gyro->_mushroomGrowing) _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); break; case r__outsidecardiffcastle: if (ped > 0) - switch (_vm->_gyro->_dna._cardiffQuestionNum) { + switch (_vm->_gyro->_cardiffQuestionNum) { case 0 : { // You've answered NONE of his questions. _vm->_animation->_sprites[1].init(9, false, _vm->_animation); _vm->_animation->appearPed(2, 2); @@ -596,8 +596,8 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey); } } - if (_vm->_gyro->_dna._cardiffQuestionNum < 5) - _vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum; + if (_vm->_gyro->_cardiffQuestionNum < 5) + _vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum; else _vm->_gyro->_interrogation = 0; break; @@ -610,9 +610,9 @@ void Lucerna::enterRoom(byte room, byte ped) { //setactivepage(1 - cp); { - if ((_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_dna._wineState != 3)) { + if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) { _vm->_visa->displayScrollChain('q', 9); // Don't want to waste the wine! - _vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false; + _vm->_gyro->_objects[Gyro::kObjectWine - 1] = false; refreshObjectList(); } } @@ -625,33 +625,33 @@ void Lucerna::enterRoom(byte room, byte ped) { switch (ped) { case 3: { // Enter from oubliette - _vm->_gyro->_dna._catacombX = 8; - _vm->_gyro->_dna._catacombY = 4; + _vm->_gyro->_catacombX = 8; + _vm->_gyro->_catacombY = 4; } break; case 5: { // Enter from du Lustie's - _vm->_gyro->_dna._catacombX = 8; - _vm->_gyro->_dna._catacombY = 7; + _vm->_gyro->_catacombX = 8; + _vm->_gyro->_catacombY = 7; } break; case 6: { // Enter from Geida's - _vm->_gyro->_dna._catacombX = 4; - _vm->_gyro->_dna._catacombY = 1; + _vm->_gyro->_catacombX = 4; + _vm->_gyro->_catacombY = 1; } break; } - _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; + _vm->_gyro->_enterCatacombsFromLustiesRoom = true; _vm->_animation->catacombMove(ped); - _vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false; + _vm->_gyro->_enterCatacombsFromLustiesRoom = false; } break; case r__argentpub: - if (_vm->_gyro->_dna._wonNim) + if (_vm->_gyro->_wonNim) _vm->_celer->drawBackgroundSprite(-1, -1, 1); // No lute by the settle. - _vm->_gyro->_dna._malagauche = 0; // Ready to boot Malagauche - if (_vm->_gyro->_dna._givenBadgeToIby) { + _vm->_gyro->_malagauche = 0; // Ready to boot Malagauche + if (_vm->_gyro->_givenBadgeToIby) { _vm->_celer->drawBackgroundSprite(-1, -1, 8); _vm->_celer->drawBackgroundSprite(-1, -1, 9); } @@ -659,16 +659,16 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__lustiesroom: - _vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos. + _vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos. if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes _vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks); - else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already + else if (! _vm->_gyro->_enteredLustiesRoomAsMonk) // already // Presumably, Avvy dressed as a monk. _vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks); - if (_vm->_gyro->_dna._geidaFollows) { + if (_vm->_gyro->_geidaFollows) { putGeidaAt(5, ped); - if (_vm->_gyro->_dna._lustieIsAsleep) { + if (_vm->_gyro->_lustieIsAsleep) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_graphics->refreshBackground(); } @@ -676,8 +676,8 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__musicroom: - if (_vm->_gyro->_dna._jacquesState > 0) { - _vm->_gyro->_dna._jacquesState = 5; + if (_vm->_gyro->_jacquesState > 0) { + _vm->_gyro->_jacquesState = 5; _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); _vm->_celer->drawBackgroundSprite(-1, -1, 4); @@ -719,7 +719,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case r__wisewomans: _vm->_animation->_sprites[1].init(11, false, _vm->_animation); - if ((_vm->_gyro->_dna._roomCount[r__wisewomans] == 1) && (ped > 0)) { + if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) { _vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen. _vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you. } else { @@ -737,18 +737,18 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(1); - if (_vm->_gyro->_dna._arrowInTheDoor) + if (_vm->_gyro->_arrowInTheDoor) _vm->_sequence->thenShow(3); else _vm->_sequence->thenShow(2); - if (_vm->_gyro->_dna._takenPen) + if (_vm->_gyro->_takenPen) _vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_sequence->startToClose(); } else { _vm->_celer->drawBackgroundSprite(-1, -1, 1); - if (_vm->_gyro->_dna._arrowInTheDoor) + if (_vm->_gyro->_arrowInTheDoor) _vm->_celer->drawBackgroundSprite(-1, -1, 3); else _vm->_celer->drawBackgroundSprite(-1, -1, 2); @@ -789,7 +789,7 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__aylesoffice: - if (_vm->_gyro->_dna._aylesIsAwake) + if (_vm->_gyro->_aylesIsAwake) _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); break; // Ayles awake. @@ -800,18 +800,18 @@ void Lucerna::enterRoom(byte room, byte ped) { case r__easthall: case r__westhall: - if (_vm->_gyro->_dna._geidaFollows) + if (_vm->_gyro->_geidaFollows) putGeidaAt(ped + 2, ped); break; case r__lusties: - if (_vm->_gyro->_dna._geidaFollows) + if (_vm->_gyro->_geidaFollows) putGeidaAt(ped + 6, ped); break; case r__nottspub: - if (_vm->_gyro->_dna._sittingInPub) _vm->_celer->drawBackgroundSprite(-1, -1, 3); - _vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos. + if (_vm->_gyro->_sittingInPub) _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos. break; case r__outsideducks: @@ -828,7 +828,7 @@ void Lucerna::enterRoom(byte room, byte ped) { break; case r__ducks: - _vm->_gyro->_dna._dogFoodPos = 1; + _vm->_gyro->_dogFoodPos = 1; break; // Actually, Duck pos. } @@ -921,7 +921,7 @@ void Lucerna::drawScore() { if (_vm->_gyro->kDemo) return; - uint16 score = _vm->_gyro->_dna._score; + uint16 score = _vm->_gyro->_dnascore; int8 numbers[3] = {0, 0, 0}; for (byte i = 0; i < 2; i++) { byte divisor = 1; @@ -947,7 +947,7 @@ void Lucerna::drawScore() { void Lucerna::incScore(byte num) { // Add on no. of points for (byte q = 1; q <= num; q++) { - _vm->_gyro->_dna._score++; + _vm->_gyro->_dnascore++; #if 0 if (soundfx) { @@ -967,22 +967,22 @@ void Lucerna::useCompass(const Common::Point &cursorPos) { switch (color) { case kColorGreen: - _vm->_gyro->_dna._direction = Animation::kDirUp; + _vm->_gyro->_direction = Animation::kDirUp; _vm->_animation->changeDirection(0, Animation::kDirUp); drawDirection(); break; case kColorBrown: - _vm->_gyro->_dna._direction = Animation::kDirDown; + _vm->_gyro->_direction = Animation::kDirDown; _vm->_animation->changeDirection(0, Animation::kDirDown); drawDirection(); break; case kColorCyan: - _vm->_gyro->_dna._direction = Animation::kDirLeft; + _vm->_gyro->_direction = Animation::kDirLeft; _vm->_animation->changeDirection(0, Animation::kDirLeft); drawDirection(); break; case kColorLightmagenta: - _vm->_gyro->_dna._direction = Animation::kDirRight; + _vm->_gyro->_direction = Animation::kDirRight; _vm->_animation->changeDirection(0, Animation::kDirRight); drawDirection(); break; @@ -1001,14 +1001,14 @@ void Lucerna::fxToggle() { } void Lucerna::refreshObjectList() { - _vm->_gyro->_dna._carryNum = 0; - if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1]) + _vm->_gyro->_carryNum = 0; + if (_vm->_gyro->_thinkThing && !_vm->_gyro->_objects[_vm->_gyro->_thinks - 1]) thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money for (byte i = 0; i < kObjectNum; i++) { - if (_vm->_gyro->_dna._objects[i]) { - _vm->_gyro->_dna._carryNum++; - _vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1; + if (_vm->_gyro->_objects[i]) { + _vm->_gyro->_carryNum++; + _vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1; } } } @@ -1017,7 +1017,7 @@ void Lucerna::refreshObjectList() { * @remarks Originally called 'verte' */ void Lucerna::guideAvvy(Common::Point cursorPos) { - if (!_vm->_gyro->_dna._userMovesAvvy) + if (!_vm->_gyro->_userMovesAvvy) return; cursorPos.y /= 2; @@ -1104,7 +1104,7 @@ void Lucerna::checkClick() { _vm->_parser->plotText(); } else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar. if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass. - if (_vm->_gyro->_alive && _vm->_gyro->_dna._avvyIsAwake) + if (_vm->_gyro->_alive && _vm->_gyro->_avvyIsAwake) useCompass(cursorPos); } else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing. do { @@ -1167,19 +1167,19 @@ void Lucerna::dawn() { } void Lucerna::drawDirection() { // It's data is loaded in load_digits(). - if (_vm->_gyro->_oldDirection == _vm->_gyro->_dna._direction) + if (_vm->_gyro->_oldDirection == _vm->_gyro->_direction) return; - _vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; + _vm->_gyro->_oldDirection = _vm->_gyro->_direction; CursorMan.showMouse(false); - _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_dna._direction], 0, 161); + _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_gyro->_directions[_vm->_gyro->_direction], 0, 161); CursorMan.showMouse(true); } void Lucerna::gameOver() { - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_userMovesAvvy = false; int16 sx = _vm->_animation->_sprites[0]._x; int16 sy = _vm->_animation->_sprites[0]._y; @@ -1196,7 +1196,7 @@ void Lucerna::gameOver() { void Lucerna::minorRedraw() { dusk(); - enterRoom(_vm->_gyro->_dna._room, 0); // Ped unknown or non-existant. + enterRoom(_vm->_gyro->_room, 0); // Ped unknown or non-existant. for (byte i = 0; i < 3; i++) _vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp index 4e114517ad..2830e9eee0 100644 --- a/engines/avalanche/scrolls2.cpp +++ b/engines/avalanche/scrolls2.cpp @@ -561,19 +561,19 @@ void Scrolls::setBubbleStateNatural() { Common::String Scrolls::displayMoney() { Common::String result; - if (_vm->_gyro->_dna._money < 12) { // just pence - result = Common::String::format("%dd", _vm->_gyro->_dna._money); - } else if (_vm->_gyro->_dna._money < 240) { // shillings & pence - if ((_vm->_gyro->_dna._money % 12) == 0) - result = Common::String::format("%d/-", _vm->_gyro->_dna._money / 12); + if (_vm->_gyro->_money < 12) { // just pence + result = Common::String::format("%dd", _vm->_gyro->_money); + } else if (_vm->_gyro->_money < 240) { // shillings & pence + if ((_vm->_gyro->_money % 12) == 0) + result = Common::String::format("%d/-", _vm->_gyro->_money / 12); else - result = Common::String::format("%d/%d", _vm->_gyro->_dna._money / 12, _vm->_gyro->_dna._money % 12); + result = Common::String::format("%d/%d", _vm->_gyro->_money / 12, _vm->_gyro->_money % 12); } else { // L, s & d - result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_dna._money / 240, (_vm->_gyro->_dna._money / 12) % 20, - _vm->_gyro->_dna._money % 12); + result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20, + _vm->_gyro->_money % 12); } - if (_vm->_gyro->_dna._money > 12) { - Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_dna._money); + if (_vm->_gyro->_money > 12) { + Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money); result += extraStr; } @@ -703,45 +703,45 @@ void Scrolls::callScrollDriver() { displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion) break; case 2: { - int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_dna._passwordNum; + int pwdId = _vm->_acci->kFirstPassword + _vm->_gyro->_passwordNum; displayText(_vm->_acci->kVocabulary[pwdId]._word + kControlToBuffer); } break; case 3: - displayText(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer); + displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer); break; case 4: - displayText(_vm->_gyro->_dna._favouriteSong + kControlToBuffer); + displayText(_vm->_gyro->_favouriteSong + kControlToBuffer); break; case 5: - displayText(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer); + displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer); break; case 6: - displayText(_vm->_gyro->_dna._spareEvening + kControlToBuffer); + displayText(_vm->_gyro->_spareEvening + kControlToBuffer); break; case 9: { - Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_dna._catacombX, _vm->_gyro->_dna._catacombY, kControlToBuffer); + Common::String tmpStr = Common::String::format("%d,%d%c",_vm->_gyro->_catacombX, _vm->_gyro->_catacombY, kControlToBuffer); displayText(tmpStr); } break; case 10: - switch (_vm->_gyro->_dna._boxContent) { + switch (_vm->_gyro->_boxContent) { case 0: // Sixpence. _vm->_visa->displayScrollChain('q', 37); // You find the sixpence. - _vm->_gyro->_dna._money += 6; - _vm->_gyro->_dna._boxContent = _vm->_acci->kNothing; + _vm->_gyro->_money += 6; + _vm->_gyro->_boxContent = _vm->_acci->kNothing; _vm->_lucerna->incScore(2); return; case Acci::kNothing: displayText("nothing at all. It's completely empty."); break; default: - displayText(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.'); + displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.'); } break; case 11: for (byte j = 0; j < kObjectNum; j++) { - if (_vm->_gyro->_dna._objects[j]) + if (_vm->_gyro->_objects[j]) displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer); } break; diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp index b5eb6a4d15..22ee7fc0e4 100644 --- a/engines/avalanche/sequence2.cpp +++ b/engines/avalanche/sequence2.cpp @@ -64,8 +64,8 @@ void Sequence::thenShow(byte what) { void Sequence::thenFlip(byte where, byte ped) { thenShow(kNowFlip); - _vm->_gyro->_dna._flipToWhere = where; - _vm->_gyro->_dna._flipToPed = ped; + _vm->_gyro->_flipToWhere = where; + _vm->_gyro->_flipToPed = ped; } void Sequence::startToClose() { @@ -74,7 +74,7 @@ void Sequence::startToClose() { } void Sequence::startToOpen() { - _vm->_gyro->_dna._userMovesAvvy = false; // They can't move. + _vm->_gyro->_userMovesAvvy = false; // They can't move. _vm->_animation->stopWalking(); // And they're not moving now. startToClose(); // Apart from that, it's the same thing. } @@ -89,8 +89,8 @@ void Sequence::callSequencer() { return; // No more routines. break; case 177: // Flip room. - _vm->_gyro->_dna._userMovesAvvy = true; - _vm->_animation->flipRoom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); + _vm->_gyro->_userMovesAvvy = true; + _vm->_animation->flipRoom(_vm->_gyro->_flipToWhere, _vm->_gyro->_flipToPed); if (_seq[0] == 177) shoveLeft(); break; diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index b88c53d155..019f2da84f 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -220,7 +220,7 @@ void Timer::updateTimer() { } } _vm->_gyro->_roomTime++; // Cycles since you've been in this room. - _vm->_gyro->_dna._totalTime++; // Total amount of time for this game. + _vm->_gyro->_totalTime++; // Total amount of time for this game. } void Timer::loseTimer(byte which) { @@ -233,20 +233,20 @@ void Timer::loseTimer(byte which) { } void Timer::openDrawbridge() { - _vm->_gyro->_dna._drawbridgeOpen++; - _vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1); + _vm->_gyro->_drawbridgeOpen++; + _vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 1); - if (_vm->_gyro->_dna._drawbridgeOpen == 4) + if (_vm->_gyro->_drawbridgeOpen == 4) _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. else addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls); } void Timer::avariciusTalks() { - _vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk); - _vm->_gyro->_dna._avariciusTalk++; + _vm->_visa->displayScrollChain('q', _vm->_gyro->_avariciusTalk); + _vm->_gyro->_avariciusTalk++; - if (_vm->_gyro->_dna._avariciusTalk < 17) + if (_vm->_gyro->_avariciusTalk < 17) addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks); else _vm->_lucerna->incScore(3); @@ -277,20 +277,20 @@ void Timer::stairs() { _vm->_gyro->blip(); _vm->_animation->_sprites[0].walkTo(4); _vm->_celer->drawBackgroundSprite(-1, -1, 2); - _vm->_gyro->_dna._brummieStairs = 2; + _vm->_gyro->_brummieStairs = 2; _vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial; _vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs. _vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // Stop them hitting the sides (or the game will hang.) } void Timer::cardiffSurvey() { - if (_vm->_gyro->_dna._cardiffQuestionNum == 0) { - _vm->_gyro->_dna._cardiffQuestionNum++; + if (_vm->_gyro->_cardiffQuestionNum == 0) { + _vm->_gyro->_cardiffQuestionNum++; _vm->_visa->displayScrollChain('q', 27); } - _vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum); - _vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum; + _vm->_visa->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum); + _vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum; addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey); } @@ -305,8 +305,8 @@ void Timer::cwytalotInHerts() { void Timer::getTiedUp() { _vm->_visa->displayScrollChain('q', 34); // ...Trouble! - _vm->_gyro->_dna._userMovesAvvy = false; - _vm->_gyro->_dna._beenTiedUp = true; + _vm->_gyro->_userMovesAvvy = false; + _vm->_gyro->_beenTiedUp = true; _vm->_animation->stopWalking(); _vm->_animation->_sprites[1].stopWalk(); _vm->_animation->_sprites[1].stopHoming(); @@ -319,7 +319,7 @@ void Timer::getTiedUp2() { _vm->_animation->_sprites[0].walkTo(4); _vm->_animation->_sprites[1].walkTo(5); _vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries. - _vm->_gyro->_dna._friarWillTieYouUp = true; + _vm->_gyro->_friarWillTieYouUp = true; } void Timer::hangAround() { @@ -344,20 +344,20 @@ void Timer::hangAround2() { addTimer(1, kProcAfterTheShootemup, kReasonHangingAround); // Immediately call the following proc (when you have a chance). - _vm->_gyro->_dna._tiedUp = false; + _vm->_gyro->_tiedUp = false; _vm->_enid->backToBootstrap(1); // Call the shoot-'em-up. } void Timer::afterTheShootemup() { - _vm->_animation->flipRoom(_vm->_gyro->_dna._room, 0); + _vm->_animation->flipRoom(_vm->_gyro->_room, 0); // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! _vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot. _vm->_animation->appearPed(1, 2); - _vm->_gyro->_dna._userMovesAvvy = true; - _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = true; + _vm->_gyro->_userMovesAvvy = true; + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true; _vm->_lucerna->refreshObjectList(); // Same as the added line above: TODO: Remove it later!!! @@ -386,9 +386,9 @@ void Timer::afterTheShootemup() { } void Timer::jacquesWakesUp() { - _vm->_gyro->_dna._jacquesState++; + _vm->_gyro->_jacquesState++; - switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures. + switch (_vm->_gyro->_jacquesState) { // Additional pictures. case 1 : _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open. _vm->_visa->displayScrollChain('Q', 45); @@ -405,13 +405,13 @@ void Timer::jacquesWakesUp() { break; } - if (_vm->_gyro->_dna._jacquesState == 5) { - _vm->_gyro->_dna._bellsAreRinging = true; - _vm->_gyro->_dna._aylesIsAwake = true; + if (_vm->_gyro->_jacquesState == 5) { + _vm->_gyro->_bellsAreRinging = true; + _vm->_gyro->_aylesIsAwake = true; _vm->_lucerna->incScore(2); } - switch (_vm->_gyro->_dna._jacquesState) { + switch (_vm->_gyro->_jacquesState) { case 1: case 2: case 3: @@ -450,9 +450,9 @@ void Timer::naughtyDuke3() { } void Timer::jump() { - _vm->_gyro->_dna._jumpStatus++; + _vm->_gyro->_jumpStatus++; - switch (_vm->_gyro->_dna._jumpStatus) { + switch (_vm->_gyro->_jumpStatus) { case 1: case 2: case 3: @@ -471,24 +471,24 @@ void Timer::jump() { break; } - if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump. - _vm->_gyro->_dna._userMovesAvvy = true; - _vm->_gyro->_dna._jumpStatus = 0; + if (_vm->_gyro->_jumpStatus == 20) { // End of jump. + _vm->_gyro->_userMovesAvvy = true; + _vm->_gyro->_jumpStatus = 0; } else { // Still jumping. addTimer(1, kProcJump, kReasonJumping); } - if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump. - && (_vm->_gyro->_dna._room == r__insidecardiffcastle) - && (_vm->_gyro->_dna._arrowInTheDoor == true) + if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump. + && (_vm->_gyro->_room == r__insidecardiffcastle) + && (_vm->_gyro->_arrowInTheDoor == true) && (_vm->_animation->inField(3))) { // Beside the wall // Grab the arrow! - if (_vm->_gyro->_dna._carryNum >= kCarryLimit) + if (_vm->_gyro->_carryNum >= kCarryLimit) _vm->_scrolls->displayText("You fail to grab it, because your hands are full."); else { _vm->_celer->drawBackgroundSprite(-1, -1, 2); - _vm->_gyro->_dna._arrowInTheDoor = false; // You've got it. - _vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = true; + _vm->_gyro->_arrowInTheDoor = false; // You've got it. + _vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_visa->displayScrollChain('q', 50); _vm->_lucerna->incScore(3); @@ -498,14 +498,14 @@ void Timer::jump() { void Timer::crapulusSaysSpludOut() { _vm->_visa->displayScrollChain('q', 56); - _vm->_gyro->_dna._crapulusWillTell = false; + _vm->_gyro->_crapulusWillTell = false; } void Timer::buyDrinks() { _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. - _vm->_gyro->_dna._malagauche = 0; + _vm->_gyro->_malagauche = 0; - _vm->_visa->displayScrollChain('D', _vm->_gyro->_dna._drinking); // Display message about it. + _vm->_visa->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it. _vm->_pingo->wobble(); // Do the special effects. _vm->_visa->displayScrollChain('D', 1); // That'll be thruppence. if (_vm->_gyro->decreaseMoney(3)) // Pay 3d. @@ -515,15 +515,15 @@ void Timer::buyDrinks() { void Timer::buyWine() { _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. - _vm->_gyro->_dna._malagauche = 0; + _vm->_gyro->_malagauche = 0; _vm->_visa->displayScrollChain('D', 50); // You buy the wine. _vm->_visa->displayScrollChain('D', 1); // It'll be thruppence. if (_vm->_gyro->decreaseMoney(3)) { _vm->_visa->displayScrollChain('D', 4); // You paid up. - _vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectWine - 1] = true; _vm->_lucerna->refreshObjectList(); - _vm->_gyro->_dna._wineState = 1; // OK Wine. + _vm->_gyro->_wineState = 1; // OK Wine. } } @@ -534,7 +534,7 @@ void Timer::callsGuards() { void Timer::greetsMonk() { _vm->_visa->displayScrollChain('Q', 59); - _vm->_gyro->_dna._enteredLustiesRoomAsMonk = true; + _vm->_gyro->_enteredLustiesRoomAsMonk = true; } void Timer::fallDownOubliette() { @@ -545,13 +545,13 @@ void Timer::fallDownOubliette() { } void Timer::meetAvaroid() { - if (_vm->_gyro->_dna._metAvaroid) { + if (_vm->_gyro->_metAvaroid) { Common::String tmpStr = Common::String::format("You can't expect to be %cthat%c lucky twice in a row!", Scrolls::kControlItalic, Scrolls::kControlRoman); _vm->_scrolls->displayText(tmpStr); _vm->_lucerna->gameOver(); } else { _vm->_visa->displayScrollChain('Q', 60); - _vm->_gyro->_dna._metAvaroid = true; + _vm->_gyro->_metAvaroid = true; addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette); _vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft; @@ -570,7 +570,7 @@ void Timer::riseUpOubliette() { if (_vm->_animation->_sprites[0]._moveY > 0) addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette); else - _vm->_gyro->_dna._userMovesAvvy = true; + _vm->_gyro->_userMovesAvvy = true; } void Timer::robinHoodAndGeida() { @@ -580,7 +580,7 @@ void Timer::robinHoodAndGeida() { _vm->_animation->_sprites[1].stopWalk(); _vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft; addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida); - _vm->_gyro->_dna._geidaFollows = false; + _vm->_gyro->_geidaFollows = false; } void Timer::robinHoodAndGeidaTalk() { @@ -598,7 +598,7 @@ void Timer::avalotReturns() { _vm->_animation->_sprites[0].init(0, true, _vm->_animation); _vm->_animation->appearPed(1, 1); _vm->_visa->displayScrollChain('q', 67); - _vm->_gyro->_dna._userMovesAvvy = true; + _vm->_gyro->_userMovesAvvy = true; } /** @@ -611,8 +611,8 @@ void Timer::avvySitDown() { addTimer(1, kProcAvvySitDown, kReasonSittingDown); else { _vm->_celer->drawBackgroundSprite(-1, -1, 3); - _vm->_gyro->_dna._sittingInPub = true; - _vm->_gyro->_dna._userMovesAvvy = false; + _vm->_gyro->_sittingInPub = true; + _vm->_gyro->_userMovesAvvy = false; _vm->_animation->_sprites[0]._visible = false; } } @@ -623,7 +623,7 @@ void Timer::ghostRoomPhew() { } void Timer::arkataShouts() { - if (_vm->_gyro->_dna._teetotal) + if (_vm->_gyro->_teetotal) return; _vm->_visa->displayScrollChain('q', 76); @@ -676,7 +676,7 @@ void Timer::spludwickLeavesCauldron() { void Timer::giveLuteToGeida() { // Moved here from Acci. _vm->_visa->displayScrollChain('Q', 86); _vm->_lucerna->incScore(4); - _vm->_gyro->_dna._lustieIsAsleep = true; + _vm->_gyro->_lustieIsAsleep = true; _vm->_sequence->firstShow(5); _vm->_sequence->thenShow(6); // He falls asleep... _vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure. diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 931f10f9ae..a7125d4f84 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -159,19 +159,19 @@ void Visa::talkTo(byte whom) { if (_vm->_gyro->_subjectNum == 0) { switch (whom) { case Gyro::kPeopleSpludwick: - if ((_vm->_gyro->_dna._lustieIsAsleep) & (!_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1])) { + if ((_vm->_gyro->_lustieIsAsleep) & (!_vm->_gyro->_objects[Gyro::kObjectPotion - 1])) { displayScrollChain('q', 68); - _vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_lucerna->incScore(3); return; - } else if (_vm->_gyro->_dna._talkedToCrapulus) { + } else if (_vm->_gyro->_talkedToCrapulus) { // Spludwick - what does he need? // 0 - let it through to use normal routine. - switch (_vm->_gyro->_dna._givenToSpludwick) { + switch (_vm->_gyro->_givenToSpludwick) { case 1: // Fallthrough is intended. case 2: { - Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick]); + Common::String objStr = _vm->_gyro->getItem(Gyro::kSpludwicksOrder[_vm->_gyro->_givenToSpludwick]); Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c", objStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); } @@ -186,23 +186,23 @@ void Visa::talkTo(byte whom) { } break; case Gyro::kPeopleIbythneth: - if (_vm->_gyro->_dna._givenBadgeToIby) { + if (_vm->_gyro->_givenBadgeToIby) { displayScrollChain('q', 33); // Thanks a lot! return; // And leave the proc. } break; // Or... just continue, 'cos he hasn't got it. case Gyro::kPeopleDogfood: - if (_vm->_gyro->_dna._wonNim) { // We've won the game. + if (_vm->_gyro->_wonNim) { // We've won the game. displayScrollChain('q', 6); // "I'm Not Playing!" return; // Zap back. } else - _vm->_gyro->_dna._askedDogfoodAboutNim = true; + _vm->_gyro->_askedDogfoodAboutNim = true; break; case Gyro::kPeopleAyles: - if (!_vm->_gyro->_dna._aylesIsAwake) { + if (!_vm->_gyro->_aylesIsAwake) { displayScrollChain('q', 43); // He's fast asleep! return; - } else if (!_vm->_gyro->_dna._givenPenToAyles) { + } else if (!_vm->_gyro->_givenPenToAyles) { displayScrollChain('q', 44); // Can you get me a pen, Avvy? return; } @@ -213,29 +213,29 @@ void Visa::talkTo(byte whom) { return; case Gyro::kPeopleGeida: - if (_vm->_gyro->_dna._givenPotionToGeida) - _vm->_gyro->_dna._geidaFollows = true; + if (_vm->_gyro->_givenPotionToGeida) + _vm->_gyro->_geidaFollows = true; else { displayScrollChain('u', 17); return; } break; case Gyro::kPeopleSpurge: - if (!_vm->_gyro->_dna._sittingInPub) { + if (!_vm->_gyro->_sittingInPub) { displayScrollChain('q', 71); // Try going over and sitting down. return; } else { - if (_vm->_gyro->_dna._spurgeTalkCount < 5) - _vm->_gyro->_dna._spurgeTalkCount++; - if (_vm->_gyro->_dna._spurgeTalkCount > 1) { // no. 1 falls through - displayScrollChain('q', 70 + _vm->_gyro->_dna._spurgeTalkCount); + if (_vm->_gyro->_spurgeTalkCount < 5) + _vm->_gyro->_spurgeTalkCount++; + if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through + displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount); return; } } break; } // On a subject. Is there any reason to block it? - } else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_dna._aylesIsAwake)) { + } else if ((whom == Gyro::kPeopleAyles) && (!_vm->_gyro->_aylesIsAwake)) { displayScrollChain('q', 43); // He's fast asleep! return; } @@ -264,10 +264,10 @@ void Visa::talkTo(byte whom) { displayScrollChain('n', whom); // File not found! if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only - _vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = true; + _vm->_gyro->_objects[Gyro::kObjectBadge - 1] = true; _vm->_lucerna->refreshObjectList(); displayScrollChain('q', 1); // Circular from Cardiff. - _vm->_gyro->_dna._talkedToCrapulus = true; + _vm->_gyro->_talkedToCrapulus = true; _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off. _vm->_animation->_sprites[1]._vanishIfStill = true; -- cgit v1.2.3