AVALANCHE: Remove DNA structure which was essentially a savegame structure unused in ScummVM

This commit is contained in:
Strangerke 2013-09-13 21:30:03 +02:00
parent 44ff5eeafb
commit 82e76e7b53
14 changed files with 761 additions and 678 deletions

View file

@ -249,7 +249,7 @@ Common::String Acci::rank() {
}; };
for (byte i = 0; i < 8; i++) { 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; return kRanks[i]._title;
} }
} }
@ -261,7 +261,7 @@ Common::String Acci::totalTime() {
const double ticksInOneSec = (double)(65535) / 3600; const double ticksInOneSec = (double)(65535) / 3600;
uint16 h, m, s; 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; m = h % 3600;
h /= 3600; h /= 3600;
s = m % 60; s = m % 60;
@ -384,32 +384,32 @@ void Acci::storeInterrogation(byte interrogation) {
case 1: case 1:
_vm->_parser->_inputText.toLowercase(); _vm->_parser->_inputText.toLowercase();
sayIt(); sayIt();
_vm->_gyro->_dna._favouriteDrink = _vm->_parser->_inputText; _vm->_gyro->_favouriteDrink = _vm->_parser->_inputText;
_vm->_gyro->_dna._cardiffQuestionNum = 2; _vm->_gyro->_cardiffQuestionNum = 2;
break; break;
case 2: case 2:
properNouns(); properNouns();
sayIt(); sayIt();
_vm->_gyro->_dna._favouriteSong = _vm->_parser->_inputText; _vm->_gyro->_favouriteSong = _vm->_parser->_inputText;
_vm->_gyro->_dna._cardiffQuestionNum = 3; _vm->_gyro->_cardiffQuestionNum = 3;
break; break;
case 3: case 3:
properNouns(); properNouns();
sayIt(); sayIt();
_vm->_gyro->_dna._worstPlaceOnEarth = _vm->_parser->_inputText; _vm->_gyro->_worstPlaceOnEarth = _vm->_parser->_inputText;
_vm->_gyro->_dna._cardiffQuestionNum = 4; _vm->_gyro->_cardiffQuestionNum = 4;
break; break;
case 4: case 4:
_vm->_parser->_inputText.toLowercase(); _vm->_parser->_inputText.toLowercase();
sayIt(); sayIt();
if (!_vm->_gyro->_dna._spareEvening.empty()) if (!_vm->_gyro->_spareEvening.empty())
_vm->_gyro->_dna._spareEvening.clear(); _vm->_gyro->_spareEvening.clear();
_vm->_gyro->_dna._spareEvening = _vm->_parser->_inputText; _vm->_gyro->_spareEvening = _vm->_parser->_inputText;
_vm->_visa->displayScrollChain('z', 5); // His closing statement... _vm->_visa->displayScrollChain('z', 5); // His closing statement...
_vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge _vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge
_vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away! _vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away!
_vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing;
_vm->_gyro->_dna._cardiffQuestionNum = 5; _vm->_gyro->_cardiffQuestionNum = 5;
break; break;
case 99: case 99:
//store_high(_vm->_parser->_inputText); //store_high(_vm->_parser->_inputText);
@ -531,12 +531,12 @@ void Acci::parse() {
replace(Common::String("\x4\xE5"), 20); // "take off" = "doff" replace(Common::String("\x4\xE5"), 20); // "take off" = "doff"
// Words that could mean more than one _person // 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 replace(Common::String('\xCC'), 164); // Barman = Port
else else
replace(Common::String('\xCC'), 154); // Barman = Malagauche replace(Common::String('\xCC'), 154); // Barman = Malagauche
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__aylesoffice: case r__aylesoffice:
replace(Common::String('\xCB'), 163); // Monk = Ayles replace(Common::String('\xCB'), 163); // Monk = Ayles
break; break;
@ -625,7 +625,7 @@ void Acci::examineObject() {
_vm->_lucerna->thinkAbout(_thing, Gyro::kThing); _vm->_lucerna->thinkAbout(_thing, Gyro::kThing);
switch (_thing) { switch (_thing) {
case Gyro::kObjectWine : 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: case 1:
_vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll _vm->_visa->displayScrollChain('t', 1); // Normal examine wine scroll
break; break;
@ -638,7 +638,7 @@ void Acci::examineObject() {
} }
break; break;
case Gyro::kObjectOnion: case Gyro::kObjectOnion:
if (_vm->_gyro->_dna._rottenOnion) if (_vm->_gyro->_rottenOnion)
_vm->_visa->displayScrollChain('q', 21); // Yucky onion. _vm->_visa->displayScrollChain('q', 21); // Yucky onion.
else else
_vm->_visa->displayScrollChain('t', 18); // Normal onion scroll _vm->_visa->displayScrollChain('t', 18); // Normal onion scroll
@ -649,7 +649,7 @@ void Acci::examineObject() {
} }
bool Acci::isPersonHere() { // Person equivalent of "holding". 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; return true;
else { else {
Common::String tmpStr; Common::String tmpStr;
@ -669,13 +669,13 @@ void Acci::exampers() {
_person -= 149; _person -= 149;
switch (_person) { // Special cases switch (_person) { // Special cases
case 11: case 11:
if (_vm->_gyro->_dna._wonNim) { if (_vm->_gyro->_wonNim) {
_vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!" _vm->_visa->displayScrollChain('Q', 8); // "I'm Not Playing!"
return; return;
} }
break; break;
case 99: case 99:
if (_vm->_gyro->_dna._lustieIsAsleep) { if (_vm->_gyro->_lustieIsAsleep) {
_vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!) _vm->_visa->displayScrollChain('Q', 65); // He's asleep. (65! Wow!)
return; return;
} }
@ -686,7 +686,7 @@ void Acci::exampers() {
} }
// And afterwards... // And afterwards...
if ((_person == 14) && (!_vm->_gyro->_dna._aylesIsAwake)) if ((_person == 14) && (!_vm->_gyro->_aylesIsAwake))
_vm->_visa->displayScrollChain('Q', 13); _vm->_visa->displayScrollChain('Q', 13);
} }
@ -702,7 +702,7 @@ bool Acci::isHolding() {
if (_thing > 100) if (_thing > 100)
_vm->_scrolls->displayText("Be reasonable!"); _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."); _vm->_scrolls->displayText("You're not holding it, Avvy.");
else else
holdingResult = true; holdingResult = true;
@ -711,7 +711,7 @@ bool Acci::isHolding() {
} }
void Acci::openBox(bool isOpening) { 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->drawBackgroundSprite(-1, -1, 5);
_vm->_celer->updateBackgroundSprites(); _vm->_celer->updateBackgroundSprites();
@ -753,22 +753,22 @@ void Acci::inventory() {
Common::String tmpStr = Common::String("You're carrying "); Common::String tmpStr = Common::String("You're carrying ");
for (byte i = 0; i < kObjectNum; i++) { for (byte i = 0; i < kObjectNum; i++) {
if (_vm->_gyro->_dna._objects[i]) { if (_vm->_gyro->_objects[i]) {
itemNum++; itemNum++;
if (itemNum == _vm->_gyro->_dna._carryNum) if (itemNum == _vm->_gyro->_carryNum)
tmpStr += "and "; tmpStr += "and ";
tmpStr += _vm->_gyro->getItem(i + 1); tmpStr += _vm->_gyro->getItem(i + 1);
if ((i + 1) == _vm->_gyro->_dna._wearing) if ((i + 1) == _vm->_gyro->_wearing)
tmpStr += ", which you're wearing"; tmpStr += ", which you're wearing";
if (itemNum < _vm->_gyro->_dna._carryNum) if (itemNum < _vm->_gyro->_carryNum)
tmpStr += ", "; 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); tmpStr += Common::String::format("...%c%c...and you're stark naked!", Scrolls::kControlNewLine, Scrolls::kControlNewLine);
else else
tmpStr += '.'; tmpStr += '.';
@ -779,16 +779,16 @@ void Acci::inventory() {
void Acci::swallow() { // Eat something. void Acci::swallow() { // Eat something.
switch (_thing) { switch (_thing) {
case Gyro::kObjectWine: case Gyro::kObjectWine:
switch (_vm->_gyro->_dna._wineState) { // 4 is perfect switch (_vm->_gyro->_wineState) { // 4 is perfect
case 1: case 1:
if (_vm->_gyro->_dna._teetotal) { if (_vm->_gyro->_teetotal) {
_vm->_visa->displayScrollChain('D', 6); _vm->_visa->displayScrollChain('D', 6);
return; return;
} }
_vm->_visa->displayScrollChain('U', 1); _vm->_visa->displayScrollChain('U', 1);
_vm->_pingo->wobble(); _vm->_pingo->wobble();
_vm->_visa->displayScrollChain('U', 2); _vm->_visa->displayScrollChain('U', 2);
_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1] = false; _vm->_gyro->_objects[Gyro::kObjectWine - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
drink(); drink();
break; break;
@ -815,16 +815,16 @@ void Acci::swallow() { // Eat something.
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
break; break;
case Gyro::kObjectOnion: case Gyro::kObjectOnion:
if (_vm->_gyro->_dna._rottenOnion) if (_vm->_gyro->_rottenOnion)
_vm->_visa->displayScrollChain('U', 11); _vm->_visa->displayScrollChain('U', 11);
else { else {
_vm->_visa->displayScrollChain('U', 8); _vm->_visa->displayScrollChain('U', 8);
_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false; _vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
} }
break; break;
default: 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!"); _vm->_scrolls->displayText("Try BUYing things before you drink them!");
else else
_vm->_scrolls->displayText("The taste of it makes you retch!"); _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. 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! 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++; numPeople++;
} }
@ -845,7 +845,7 @@ void Acci::peopleInRoom() {
Common::String tmpStr; Common::String tmpStr;
byte actPerson = 0; // Actually listed people. byte actPerson = 0; // Actually listed people.
for (byte i = 1; i < 29; i++) { 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++; actPerson++;
if (actPerson == 1) // First on the list. if (actPerson == 1) // First on the list.
tmpStr = _vm->_gyro->getName(i + 150); tmpStr = _vm->_gyro->getName(i + 150);
@ -866,29 +866,29 @@ void Acci::peopleInRoom() {
void Acci::lookAround() { void Acci::lookAround() {
_vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]); _vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]);
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__spludwicks: case r__spludwicks:
if (_vm->_gyro->_dna._avariciusTalk > 0) if (_vm->_gyro->_avariciusTalk > 0)
_vm->_visa->displayScrollChain('q', 23); _vm->_visa->displayScrollChain('q', 23);
else else
peopleInRoom(); peopleInRoom();
break; break;
case r__robins: case r__robins:
if (_vm->_gyro->_dna._tiedUp) if (_vm->_gyro->_tiedUp)
_vm->_visa->displayScrollChain('q', 38); _vm->_visa->displayScrollChain('q', 38);
if (_vm->_gyro->_dna._mushroomGrowing) if (_vm->_gyro->_mushroomGrowing)
_vm->_visa->displayScrollChain('q', 55); _vm->_visa->displayScrollChain('q', 55);
break; break;
case r__insidecardiffcastle: case r__insidecardiffcastle:
if (!_vm->_gyro->_dna._takenPen) if (!_vm->_gyro->_takenPen)
_vm->_visa->displayScrollChain('q', 49); _vm->_visa->displayScrollChain('q', 49);
break; break;
case r__lustiesroom: case r__lustiesroom:
if (_vm->_gyro->_dna._lustieIsAsleep) if (_vm->_gyro->_lustieIsAsleep)
_vm->_visa->displayScrollChain('q', 65); _vm->_visa->displayScrollChain('q', 65);
break; break;
case r__catacombs: case r__catacombs:
switch (_vm->_gyro->_dna._catacombY * 256 + _vm->_gyro->_dna._catacombX) { switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) {
case 258 : case 258 :
_vm->_visa->displayScrollChain('q', 80); // Inside art gallery. _vm->_visa->displayScrollChain('q', 80); // Inside art gallery.
break; break;
@ -907,7 +907,7 @@ void Acci::lookAround() {
void Acci::openDoor() { void Acci::openDoor() {
// Special cases. // Special cases.
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__yours: case r__yours:
if (_vm->_animation->inField(2)) { if (_vm->_animation->inField(2)) {
// Opening the box. // Opening the box.
@ -925,7 +925,7 @@ void Acci::openDoor() {
break; 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. return; // No doors can open if you can't move Avvy.
for (byte fv = 8; fv < 15; fv++) { 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 " \ _vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \
"to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."); "to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich.");
else else
@ -986,14 +986,14 @@ void Acci::putProc() {
switch (_thing2) { switch (_thing2) {
case Gyro::kObjectWine: case Gyro::kObjectWine:
if (_thing == Gyro::kObjectOnion) { 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!"); _vm->_scrolls->displayText("That's a bit like shutting the stable door after the horse has bolted!");
else { // Put onion into wine? 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); 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); _vm->_scrolls->displayText(tmpStr);
} else { // Put onion into vinegar! Yes! } else { // Put onion into vinegar! Yes!
_vm->_gyro->_dna._onionInVinegar = true; _vm->_gyro->_onionInVinegar = true;
_vm->_lucerna->incScore(7); _vm->_lucerna->incScore(7);
_vm->_visa->displayScrollChain('u', 9); _vm->_visa->displayScrollChain('u', 9);
} }
@ -1003,8 +1003,8 @@ void Acci::putProc() {
break; break;
case 54: case 54:
if (_vm->_gyro->_dna._room == r__yours) { // Put something into the box. if (_vm->_gyro->_room == r__yours) { // Put something into the box.
if (_vm->_gyro->_dna._boxContent != kNothing) if (_vm->_gyro->_boxContent != kNothing)
_vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first."); _vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first.");
else { else {
switch (_thing) { switch (_thing) {
@ -1021,14 +1021,14 @@ void Acci::putProc() {
_vm->_scrolls->displayText("Just give it to Spludwick, Avvy!"); _vm->_scrolls->displayText("Just give it to Spludwick, Avvy!");
break; break;
default: // Put the object into the box... 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()); Common::String tmpStr = Common::String::format("You'd better take %s off first!", _vm->_gyro->getItem(_thing).c_str());
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
} else { } else {
openBox(true); // Open box. openBox(true); // Open box.
_vm->_gyro->_dna._boxContent = _thing; _vm->_gyro->_boxContent = _thing;
_vm->_gyro->_dna._objects[_thing - 1] = false; _vm->_gyro->_objects[_thing - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_scrolls->displayText("OK, it's in the box."); _vm->_scrolls->displayText("OK, it's in the box.");
@ -1050,7 +1050,7 @@ void Acci::putProc() {
* @remarks Originally called 'not_in_order' * @remarks Originally called 'not_in_order'
*/ */
void Acci::notInOrder() { 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. " \ 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); "What I need next is %s%c2%c", itemStr.c_str(), Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
@ -1071,18 +1071,18 @@ void Acci::goToCauldron() {
* @remarks Originally called 'give2spludwick' * @remarks Originally called 'give2spludwick'
*/ */
bool Acci::giveToSpludwick() { bool Acci::giveToSpludwick() {
if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_dna._givenToSpludwick] != _thing) { if (_vm->_gyro->kSpludwicksOrder[_vm->_gyro->_givenToSpludwick] != _thing) {
notInOrder(); notInOrder();
return false; return false;
} }
switch (_thing) { switch (_thing) {
case Gyro::kObjectOnion: case Gyro::kObjectOnion:
_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1] = false; _vm->_gyro->_objects[Gyro::kObjectOnion - 1] = false;
if (_vm->_gyro->_dna._rottenOnion) if (_vm->_gyro->_rottenOnion)
_vm->_visa->displayScrollChain('q', 22); _vm->_visa->displayScrollChain('q', 22);
else { else {
_vm->_gyro->_dna._givenToSpludwick++; _vm->_gyro->_givenToSpludwick++;
_vm->_visa->displayScrollChain('q', 20); _vm->_visa->displayScrollChain('q', 20);
goToCauldron(); goToCauldron();
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
@ -1090,20 +1090,20 @@ bool Acci::giveToSpludwick() {
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
break; break;
case Gyro::kObjectInk: case Gyro::kObjectInk:
_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = false; _vm->_gyro->_objects[Gyro::kObjectInk - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_gyro->_dna._givenToSpludwick++; _vm->_gyro->_givenToSpludwick++;
_vm->_visa->displayScrollChain('q', 24); _vm->_visa->displayScrollChain('q', 24);
goToCauldron(); goToCauldron();
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
break; break;
case Gyro::kObjectMushroom: case Gyro::kObjectMushroom:
_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = false; _vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = false;
_vm->_visa->displayScrollChain('q', 25); _vm->_visa->displayScrollChain('q', 25);
_vm->_lucerna->incScore(5); _vm->_lucerna->incScore(5);
_vm->_gyro->_dna._givenToSpludwick++; _vm->_gyro->_givenToSpludwick++;
goToCauldron(); goToCauldron();
_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true; _vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
break; break;
default: default:
@ -1114,12 +1114,12 @@ bool Acci::giveToSpludwick() {
} }
void Acci::drink() { void Acci::drink() {
_vm->_gyro->_dna._alcoholLevel += 1; _vm->_gyro->_alcoholLevel += 1;
if (_vm->_gyro->_dna._alcoholLevel == 5) { if (_vm->_gyro->_alcoholLevel == 5) {
_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1] = true; // Get the key. _vm->_gyro->_objects[Gyro::kObjectKey - 1] = true; // Get the key.
_vm->_gyro->_dna._teetotal = true; _vm->_gyro->_teetotal = true;
_vm->_gyro->_dna._avvyIsAwake = false; _vm->_gyro->_avvyIsAwake = false;
_vm->_gyro->_dna._avvyInBed = true; _vm->_gyro->_avvyInBed = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
_vm->_gyro->hangAroundForAWhile(); _vm->_gyro->hangAroundForAWhile();
@ -1130,14 +1130,14 @@ void Acci::drink() {
} }
void Acci::cardiffClimbing() { 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->_scrolls->displayText("You climb down, back onto the floor.");
_vm->_gyro->_dna._standingOnDais = false; _vm->_gyro->_standingOnDais = false;
_vm->_animation->appearPed(1, 3); _vm->_animation->appearPed(1, 3);
} else { // Clamber down. } else { // Clamber down.
if (_vm->_animation->inField(1)) { if (_vm->_animation->inField(1)) {
_vm->_scrolls->displayText("You clamber up onto the dais."); _vm->_scrolls->displayText("You clamber up onto the dais.");
_vm->_gyro->_dna._standingOnDais = true; _vm->_gyro->_standingOnDais = true;
_vm->_animation->appearPed(1, 2); _vm->_animation->appearPed(1, 2);
} else } else
_vm->_scrolls->displayText("Get a bit closer, Avvy."); _vm->_scrolls->displayText("Get a bit closer, Avvy.");
@ -1149,21 +1149,21 @@ void Acci::already() {
} }
void Acci::standUp() { void Acci::standUp() {
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__yours: // Avvy isn't asleep. case r__yours: // Avvy isn't asleep.
if (_vm->_gyro->_dna._avvyIsAwake && _vm->_gyro->_dna._avvyInBed) { // But he's in bed. if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) { // But he's in bed.
if (_vm->_gyro->_dna._teetotal) { if (_vm->_gyro->_teetotal) {
_vm->_visa->displayScrollChain('d', 12); _vm->_visa->displayScrollChain('d', 12);
_vm->_gyro->setBackgroundColor(0); _vm->_gyro->setBackgroundColor(0);
_vm->_visa->displayScrollChain('d', 14); _vm->_visa->displayScrollChain('d', 14);
} }
_vm->_animation->_sprites[0]._visible = true; _vm->_animation->_sprites[0]._visible = true;
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
_vm->_animation->appearPed(1, 2); _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->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
_vm->_lucerna->incScore(1); _vm->_lucerna->incScore(1);
_vm->_gyro->_dna._avvyInBed = false; _vm->_gyro->_avvyInBed = false;
_vm->_timer->loseTimer(Timer::kReasonArkataShouts); _vm->_timer->loseTimer(Timer::kReasonArkataShouts);
} else } else
already(); already();
@ -1174,12 +1174,12 @@ void Acci::standUp() {
break; break;
case r__nottspub: case r__nottspub:
if (_vm->_gyro->_dna._sittingInPub) { if (_vm->_gyro->_sittingInPub) {
_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down. _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down.
_vm->_animation->_sprites[0]._visible = true; // But standing up. _vm->_animation->_sprites[0]._visible = true; // But standing up.
_vm->_animation->appearPed(1, 4); // And walking away. _vm->_animation->appearPed(1, 4); // And walking away.
_vm->_gyro->_dna._sittingInPub = false; // Really not sitting down. _vm->_gyro->_sittingInPub = false; // Really not sitting down.
_vm->_gyro->_dna._userMovesAvvy = true; // And ambulant. _vm->_gyro->_userMovesAvvy = true; // And ambulant.
} else } else
already(); already();
break; break;
@ -1189,15 +1189,15 @@ void Acci::standUp() {
} }
void Acci::getProc(char thing) { void Acci::getProc(char thing) {
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__yours: case r__yours:
if (_vm->_animation->inField(2)) { if (_vm->_animation->inField(2)) {
if (_vm->_gyro->_dna._boxContent == thing) { if (_vm->_gyro->_boxContent == thing) {
_vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_celer->drawBackgroundSprite(-1, -1, 5);
_vm->_scrolls->displayText("OK, I've got it."); _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->_lucerna->refreshObjectList();
_vm->_gyro->_dna._boxContent = kNothing; _vm->_gyro->_boxContent = kNothing;
_vm->_celer->drawBackgroundSprite(-1, -1, 6); _vm->_celer->drawBackgroundSprite(-1, -1, 6);
} else { } else {
Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str()); 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) { switch (thing) {
case Gyro::kObjectPen: case Gyro::kObjectPen:
if (_vm->_animation->inField(2)) { // Standing on the dais. 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."); _vm->_scrolls->displayText("It's not there, Avvy.");
else { else {
// OK: we're taking the pen, and it's there. // OK: we're taking the pen, and it's there.
_vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now. _vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now.
_vm->_animation->callSpecial(3); // Zap! _vm->_animation->callSpecial(3); // Zap!
_vm->_gyro->_dna._takenPen = true; _vm->_gyro->_takenPen = true;
_vm->_gyro->_dna._objects[Gyro::kObjectPen - 1] = true; _vm->_gyro->_objects[Gyro::kObjectPen - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_scrolls->displayText("Taken."); _vm->_scrolls->displayText("Taken.");
} }
} else if (_vm->_gyro->_dna._standingOnDais) } else if (_vm->_gyro->_standingOnDais)
_vm->_visa->displayScrollChain('q', 53); _vm->_visa->displayScrollChain('q', 53);
else else
_vm->_visa->displayScrollChain('q', 51); _vm->_visa->displayScrollChain('q', 51);
@ -1234,12 +1234,12 @@ void Acci::getProc(char thing) {
} }
break; break;
case r__robins: 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->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_scrolls->displayText("Got it!"); _vm->_scrolls->displayText("Got it!");
_vm->_gyro->_dna._mushroomGrowing = false; _vm->_gyro->_mushroomGrowing = false;
_vm->_gyro->_dna._takenMushroom = true; _vm->_gyro->_takenMushroom = true;
_vm->_gyro->_dna._objects[Gyro::kObjectMushroom - 1] = true; _vm->_gyro->_objects[Gyro::kObjectMushroom - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
} else } else
@ -1255,12 +1255,12 @@ void Acci::getProc(char thing) {
* @remarks Originally called 'give_Geida_the_lute' * @remarks Originally called 'give_Geida_the_lute'
*/ */
void Acci::giveGeidaTheLute() { 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); Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
return; return;
} }
_vm->_gyro->_dna._objects[Gyro::kObjectLute - 1] = false; _vm->_gyro->_objects[Gyro::kObjectLute - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_visa->displayScrollChain('q', 64); // She plays it. _vm->_visa->displayScrollChain('q', 64); // She plays it.
@ -1286,13 +1286,13 @@ void Acci::winSequence() {
Common::String Acci::personSpeaks() { Common::String Acci::personSpeaks() {
if ((_person == kPardon) || (_person == 0)) { 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; _person = _vm->_gyro->_her;
else else
_person = _vm->_gyro->_him; _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! return Common::String::format("%c1", Scrolls::kControlRegister); // Avvy himself!
} }
@ -1310,7 +1310,7 @@ Common::String Acci::personSpeaks() {
return tmpStr; return tmpStr;
for (byte i = 0; i < 16; i++) { 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); tmpStr += Common::String::format("%c%c", Scrolls::kControlRegister, 'A' + i);
} }
@ -1320,7 +1320,7 @@ void Acci::heyThanks() {
Common::String tmpStr = personSpeaks(); Common::String tmpStr = personSpeaks();
tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble); tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", Scrolls::kControlSpeechBubble);
_vm->_scrolls->displayText(tmpStr); _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!"); _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; 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!"); _vm->_scrolls->displayText("Talking in your sleep? Try waking up!");
return; return;
} }
@ -1370,7 +1370,7 @@ void Acci::doThat() {
break; break;
case kVerbCodeGet: case kVerbCodeGet:
if (_thing != kPardon) { // Legitimate try to pick something up. 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!"); _vm->_scrolls->displayText("You can't carry any more!");
else else
getProc(_thing); getProc(_thing);
@ -1433,7 +1433,7 @@ void Acci::doThat() {
case Gyro::kPeopleCrapulus: case Gyro::kPeopleCrapulus:
if (_thing == Gyro::kObjectWine) { if (_thing == Gyro::kObjectWine) {
_vm->_scrolls->displayText("Crapulus grabs the wine and gulps it down."); _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 } else
heyThanks(); heyThanks();
break; break;
@ -1451,21 +1451,21 @@ void Acci::doThat() {
if (_thing == Gyro::kObjectBadge) { if (_thing == Gyro::kObjectBadge) {
_vm->_visa->displayScrollChain('q', 32); // Thanks! Wow! _vm->_visa->displayScrollChain('q', 32); // Thanks! Wow!
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
_vm->_gyro->_dna._objects[Gyro::kObjectBadge - 1] = false; _vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false;
_vm->_gyro->_dna._objects[Gyro::kObjectHabit - 1] = true; _vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true;
_vm->_gyro->_dna._givenBadgeToIby = true; _vm->_gyro->_givenBadgeToIby = true;
_vm->_celer->drawBackgroundSprite(-1, -1, 8); _vm->_celer->drawBackgroundSprite(-1, -1, 8);
_vm->_celer->drawBackgroundSprite(-1, -1, 9); _vm->_celer->drawBackgroundSprite(-1, -1, 9);
} else } else
heyThanks(); heyThanks();
break; break;
case Gyro::kPeopleAyles: case Gyro::kPeopleAyles:
if (_vm->_gyro->_dna._aylesIsAwake) { if (_vm->_gyro->_aylesIsAwake) {
if (_thing == Gyro::kObjectPen) { 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->_visa->displayScrollChain('q', 54);
_vm->_gyro->_dna._objects[Gyro::kObjectInk - 1] = true; _vm->_gyro->_objects[Gyro::kObjectInk - 1] = true;
_vm->_gyro->_dna._givenPenToAyles = true; _vm->_gyro->_givenPenToAyles = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_lucerna->incScore(2); _vm->_lucerna->incScore(2);
} else } else
@ -1476,10 +1476,10 @@ void Acci::doThat() {
case Gyro::kPeopleGeida: case Gyro::kPeopleGeida:
switch (_thing) { switch (_thing) {
case Gyro::kObjectPotion: 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->_visa->displayScrollChain('u', 16); // She drinks it.
_vm->_lucerna->incScore(2); _vm->_lucerna->incScore(2);
_vm->_gyro->_dna._givenPotionToGeida = true; _vm->_gyro->_givenPotionToGeida = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
break; break;
case Gyro::kObjectLute: case Gyro::kObjectLute:
@ -1492,7 +1492,7 @@ void Acci::doThat() {
case Gyro::kPeopleArkata: case Gyro::kPeopleArkata:
switch (_thing) { switch (_thing) {
case Gyro::kObjectPotion: case Gyro::kObjectPotion:
if (_vm->_gyro->_dna._givenPotionToGeida) if (_vm->_gyro->_givenPotionToGeida)
winSequence(); winSequence();
else else
_vm->_visa->displayScrollChain('q', 77); // That Geida woman! _vm->_visa->displayScrollChain('q', 77); // That Geida woman!
@ -1562,12 +1562,12 @@ void Acci::doThat() {
} }
break; break;
case kVerbCodeUndress: case kVerbCodeUndress:
if (_vm->_gyro->_dna._wearing == kNothing) if (_vm->_gyro->_wearing == kNothing)
_vm->_scrolls->displayText("You're already stark naked!"); _vm->_scrolls->displayText("You're already stark naked!");
else if (_vm->_gyro->_dna._avvysInTheCupboard) { else if (_vm->_gyro->_avvysInTheCupboard) {
Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_dna._wearing).c_str()); Common::String tmpStr = Common::String::format("You take off %s.", _vm->_gyro->getItem(_vm->_gyro->_wearing).c_str());
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
_vm->_gyro->_dna._wearing = kNothing; _vm->_gyro->_wearing = kNothing;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
} else } else
_vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?"); _vm->_scrolls->displayText("Hadn't you better find somewhere more private, Avvy?");
@ -1581,14 +1581,14 @@ void Acci::doThat() {
break; break;
case Gyro::kObjectClothes: case Gyro::kObjectClothes:
case Gyro::kObjectHabit: { // Change this! case Gyro::kObjectHabit: { // Change this!
if (_vm->_gyro->_dna._wearing != kNothing) { if (_vm->_gyro->_wearing != kNothing) {
if (_vm->_gyro->_dna._wearing == _thing) if (_vm->_gyro->_wearing == _thing)
_vm->_scrolls->displayText("You're already wearing that."); _vm->_scrolls->displayText("You're already wearing that.");
else else
_vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!"); _vm->_scrolls->displayText("You'll be rather warm wearing two sets of clothes!");
return; return;
} else } else
_vm->_gyro->_dna._wearing = _thing; _vm->_gyro->_wearing = _thing;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
@ -1614,35 +1614,35 @@ void Acci::doThat() {
break; break;
case kVerbCodePlay: case kVerbCodePlay:
if (_thing == kPardon) { 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. case r__argentpub: { // ...in the pub, => play Nim.
warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()"); warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
// play_nim(); // play_nim();
// The following parts are copied from 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. // 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); _vm->_visa->displayScrollChain('Q', 6);
return; return;
} }
if (!_vm->_gyro->_dna._askedDogfoodAboutNim) { if (!_vm->_gyro->_askedDogfoodAboutNim) {
_vm->_visa->displayScrollChain('q', 84); _vm->_visa->displayScrollChain('q', 84);
return; return;
} }
_vm->_visa->displayScrollChain('Q', 3); _vm->_visa->displayScrollChain('Q', 3);
_vm->_gyro->_dna._playedNim++; _vm->_gyro->_playedNim++;
// You won - strange! // You won - strange!
_vm->_visa->displayScrollChain('Q', 7); // You won! Give us a lute! _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->_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->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it.
_vm->_lucerna->incScore(7); // 7 points for winning! _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. _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!!! // 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 : case Gyro::kObjectLute :
_vm->_visa->displayScrollChain('U', 7); _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); _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); _vm->_visa->displayScrollChain('U', 15);
break; break;
case 52: case 52:
if (_vm->_gyro->_dna._room == r__musicroom) if (_vm->_gyro->_room == r__musicroom)
playHarp(); playHarp();
else else
_vm->_scrolls->displayText(kWhat); _vm->_scrolls->displayText(kWhat);
break; break;
case 55: case 55:
if (_vm->_gyro->_dna._room == r__argentpub) if (_vm->_gyro->_room == r__argentpub)
// play_nim(); // play_nim();
warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()"); warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()");
else else
@ -1687,7 +1687,7 @@ void Acci::doThat() {
if (isHolding()) { if (isHolding()) {
if (_thing == Gyro::kObjectBell) { if (_thing == Gyro::kObjectBell) {
_vm->_scrolls->displayText("Ding, dong, ding, dong, ding, dong, ding, dong..."); _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 // \? are used to avoid that ??! is parsed as a trigraph
_vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)"); _vm->_scrolls->displayText("(Are you trying to join in, Avvy\?\?!)");
} else } else
@ -1724,10 +1724,10 @@ void Acci::doThat() {
} }
break; break;
case kVerbCodeMagic: case kVerbCodeMagic:
if (_vm->_gyro->_dna._avariciusTalk > 0) if (_vm->_gyro->_avariciusTalk > 0)
_vm->_visa->displayScrollChain('q', 19); _vm->_visa->displayScrollChain('q', 19);
else { 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); _vm->_visa->displayScrollChain('q', 17);
if (_vm->_gyro->_whereIs[1] == 12) if (_vm->_gyro->_whereIs[1] == 12)
_vm->_visa->displayScrollChain('q', 18); _vm->_visa->displayScrollChain('q', 18);
@ -1737,7 +1737,7 @@ void Acci::doThat() {
_vm->_animation->_sprites[1].walkTo(5); _vm->_animation->_sprites[1].walkTo(5);
_vm->_animation->_sprites[1]._callEachStepFl = true; _vm->_animation->_sprites[1]._callEachStepFl = true;
_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth; _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcBackAndForth;
_vm->_gyro->_dna._avariciusTalk = 14; _vm->_gyro->_avariciusTalk = 14;
_vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks); _vm->_timer->addTimer(177, Timer::kProcAvariciusTalks, Timer::kReasonAvariciusTalks);
} }
} else } else
@ -1748,7 +1748,7 @@ void Acci::doThat() {
_vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric."); _vm->_scrolls->displayText("Listen, smart alec, that was just rhetoric.");
break; break;
case kVerbCodeExpletive: case kVerbCodeExpletive:
switch (_vm->_gyro->_dna._sworeNum) { switch (_vm->_gyro->_sworeNum) {
case 0: { case 0: {
Common::String tmpStr = Common::String::format("Avvy! Do you mind? There might be kids playing!%c%c" \ 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); "(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->_lucerna->gameOver();
} }
} }
_vm->_gyro->_dna._sworeNum++; _vm->_gyro->_sworeNum++;
break; break;
case kVerbCodeListen: 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."); _vm->_scrolls->displayText("All other noise is drowned out by the ringing of the bells.");
else if (_vm->_gyro->_listen.empty()) else if (_vm->_gyro->_listen.empty())
_vm->_scrolls->displayText("You can't hear anything much at the moment, Avvy."); _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); _vm->_scrolls->displayText(_vm->_gyro->_listen);
break; break;
case kVerbCodeBuy: // What are they trying to buy? case kVerbCodeBuy: // What are they trying to buy?
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__argentpub: case r__argentpub:
if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar. if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar.
switch (_thing) { switch (_thing) {
@ -1788,40 +1788,40 @@ void Acci::doThat() {
case 53: case 53:
case 54: case 54:
case 58: // Beer, whisky, cider or mead. 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); _vm->_visa->displayScrollChain('D', 15);
return; return;
} }
if (_vm->_gyro->_dna._teetotal) { if (_vm->_gyro->_teetotal) {
_vm->_visa->displayScrollChain('D', 6); _vm->_visa->displayScrollChain('D', 6);
return; return;
} }
if (_vm->_gyro->_dna._alcoholLevel == 0) if (_vm->_gyro->_alcoholLevel == 0)
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
_vm->_celer->drawBackgroundSprite(-1, -1, 12); _vm->_celer->drawBackgroundSprite(-1, -1, 12);
_vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble); _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->_celer->drawBackgroundSprite(-1, -1, 10);
_vm->_gyro->_dna._malagauche = 177; _vm->_gyro->_malagauche = 177;
_vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks); _vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks);
break; break;
case 52: case 52:
examine(); examine();
break; // We have a right one here - buy Pepsi??! break; // We have a right one here - buy Pepsi??!
case Gyro::kObjectWine: 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! _vm->_visa->displayScrollChain('D', 2); // 1 bottle's shufishent!
else { 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); _vm->_visa->displayScrollChain('D', 15);
return; return;
} }
if (_vm->_gyro->_dna._carryNum >= kCarryLimit) { if (_vm->_gyro->_carryNum >= kCarryLimit) {
_vm->_scrolls->displayText("Your hands are full."); _vm->_scrolls->displayText("Your hands are full.");
return; return;
} }
@ -1829,10 +1829,10 @@ void Acci::doThat() {
_vm->_celer->drawBackgroundSprite(-1, -1, 12); _vm->_celer->drawBackgroundSprite(-1, -1, 12);
Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble);
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
if (_vm->_gyro->_dna._alcoholLevel == 0) if (_vm->_gyro->_alcoholLevel == 0)
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
_vm->_celer->drawBackgroundSprite(-1, -1, 10); _vm->_celer->drawBackgroundSprite(-1, -1, 10);
_vm->_gyro->_dna._malagauche = 177; _vm->_gyro->_malagauche = 177;
_vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks); _vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks);
} }
@ -1845,23 +1845,23 @@ void Acci::doThat() {
case r__outsideducks: case r__outsideducks:
if (_vm->_animation->inField(6)) { if (_vm->_animation->inField(6)) {
if (_thing == Gyro::kObjectOnion) { 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! _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."); _vm->_scrolls->displayText("Before you ask, you remember that your hands are full.");
else { else {
if (_vm->_gyro->_dna._boughtOnion) if (_vm->_gyro->_boughtOnion)
_vm->_visa->displayScrollChain('D', 11); _vm->_visa->displayScrollChain('D', 11);
else { else {
_vm->_visa->displayScrollChain('D', 9); _vm->_visa->displayScrollChain('D', 9);
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
} }
_vm->_gyro->decreaseMoney(3); // It costs thruppence. _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->_lucerna->refreshObjectList();
_vm->_gyro->_dna._boughtOnion = true; _vm->_gyro->_boughtOnion = true;
_vm->_gyro->_dna._rottenOnion = false; // It's OK when it leaves the stall! _vm->_gyro->_rottenOnion = false; // It's OK when it leaves the stall!
_vm->_gyro->_dna._onionInVinegar = false; _vm->_gyro->_onionInVinegar = false;
} }
} else } else
_vm->_visa->displayScrollChain('D', 0); _vm->_visa->displayScrollChain('D', 0);
@ -1877,10 +1877,10 @@ void Acci::doThat() {
} }
break; break;
case kVerbCodeAttack: case kVerbCodeAttack:
if ((_vm->_gyro->_dna._room == r__brummieroad) && if ((_vm->_gyro->_room == r__brummieroad) &&
((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) ((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt))
&& (_vm->_gyro->_whereIs[7] == _vm->_gyro->_dna._room)) { && (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) {
switch (_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] * 2) { switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) {
// 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both. // 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both.
case 0: case 0:
_vm->_visa->displayScrollChain('Q', 10); _vm->_visa->displayScrollChain('Q', 10);
@ -1894,9 +1894,9 @@ void Acci::doThat() {
break; break;
case 3: case 3:
_vm->_visa->displayScrollChain('Q', 11); _vm->_visa->displayScrollChain('Q', 11);
_vm->_gyro->_dna._cwytalotGone = true; _vm->_gyro->_cwytalotGone = true;
_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = false; _vm->_gyro->_objects[Gyro::kObjectBolt - 1] = false;
_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = false; _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = false;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing; _vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing;
_vm->_lucerna->incScore(7); _vm->_lucerna->incScore(7);
@ -1912,14 +1912,14 @@ void Acci::doThat() {
_vm->_visa->displayScrollChain('Q', 10); _vm->_visa->displayScrollChain('Q', 10);
break; break;
case kVerbCodePasswd: case kVerbCodePasswd:
if (_vm->_gyro->_dna._room != r__bridge) if (_vm->_gyro->_room != r__bridge)
_vm->_visa->displayScrollChain('Q', 12); _vm->_visa->displayScrollChain('Q', 12);
else { else {
bool ok = true; bool ok = true;
for (byte i = 0; i < _thats.size(); i++) { for (byte i = 0; i < _thats.size(); i++) {
Common::String temp = _realWords[i]; Common::String temp = _realWords[i];
temp.toUppercase(); 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++) { for (byte j = 0; j < kVocabulary[pwdId]._word.size(); j++) {
if (kVocabulary[pwdId]._word[j] != temp[j]) if (kVocabulary[pwdId]._word[j] != temp[j])
ok = false; ok = false;
@ -1927,13 +1927,13 @@ void Acci::doThat() {
} }
if (ok) { 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."); _vm->_scrolls->displayText("Contrary to your expectations, the drawbridge fails to close again.");
else { else {
_vm->_lucerna->incScore(4); _vm->_lucerna->incScore(4);
_vm->_scrolls->displayText("The drawbridge opens!"); _vm->_scrolls->displayText("The drawbridge opens!");
_vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls); _vm->_timer->addTimer(7, Timer::kProcOpenDrawbridge, Timer::kReasonDrawbridgeFalls);
_vm->_gyro->_dna._drawbridgeOpen = 1; _vm->_gyro->_drawbridgeOpen = 1;
} }
} else } else
_vm->_visa->displayScrollChain('Q', 12); _vm->_visa->displayScrollChain('Q', 12);
@ -1946,7 +1946,7 @@ void Acci::doThat() {
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
break; break;
case kVerbCodeScore: { 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); _vm->_scrolls->displayText(tmpStr);
} }
break; break;
@ -1978,14 +1978,14 @@ void Acci::doThat() {
break; break;
case kVerbCodeClimb: case kVerbCodeClimb:
if (_vm->_gyro->_dna._room == r__insidecardiffcastle) if (_vm->_gyro->_room == r__insidecardiffcastle)
cardiffClimbing(); cardiffClimbing();
else // In the wrong room! else // In the wrong room!
_vm->_scrolls->displayText("Not with your head for heights, Avvy!"); _vm->_scrolls->displayText("Not with your head for heights, Avvy!");
break; break;
case kVerbCodeJump: case kVerbCodeJump:
_vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping); _vm->_timer->addTimer(1, Timer::kProcJump, Timer::kReasonJumping);
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
break; break;
case kVerbCodeHiscores: case kVerbCodeHiscores:
// show_highs(); // show_highs();
@ -1997,18 +1997,18 @@ void Acci::doThat() {
case kPardon: case kPardon:
case Gyro::kPeopleAvalot: case Gyro::kPeopleAvalot:
case 0: case 0:
if (!_vm->_gyro->_dna._avvyIsAwake) { if (!_vm->_gyro->_avvyIsAwake) {
_vm->_gyro->_dna._avvyIsAwake = true; _vm->_gyro->_avvyIsAwake = true;
_vm->_lucerna->incScore(1); _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. _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); _vm->_visa->displayScrollChain('d', 13);
} else } else
_vm->_scrolls->displayText("You're already awake, Avvy!"); _vm->_scrolls->displayText("You're already awake, Avvy!");
break; break;
case Gyro::kPeopleAyles: case Gyro::kPeopleAyles:
if (!_vm->_gyro->_dna._aylesIsAwake) if (!_vm->_gyro->_aylesIsAwake)
_vm->_scrolls->displayText("You can't seem to wake him by yourself."); _vm->_scrolls->displayText("You can't seem to wake him by yourself.");
break; break;
case Gyro::kPeopleJacques: { case Gyro::kPeopleJacques: {
@ -2022,8 +2022,8 @@ void Acci::doThat() {
} }
break; break;
case kVerbCodeSit: case kVerbCodeSit:
if (_vm->_gyro->_dna._room == r__nottspub) { if (_vm->_gyro->_room == r__nottspub) {
if (_vm->_gyro->_dna._sittingInPub) if (_vm->_gyro->_sittingInPub)
_vm->_scrolls->displayText("You're already sitting!"); _vm->_scrolls->displayText("You're already sitting!");
else { else {
_vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down. _vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down.

View file

@ -436,8 +436,8 @@ void Animation::catacombMove(byte ped) {
xy_uint16 = _vm->_gyro->_dna._catacombX + _vm->_gyro->_dna._catacombY * 256; xy_uint16 = _vm->_gyro->_catacombX + _vm->_gyro->_catacombY * 256;
_vm->_gyro->_dna._geidaSpin = 0; _vm->_gyro->_geidaSpin = 0;
switch (xy_uint16) { switch (xy_uint16) {
case 1801: // Exit catacombs case 1801: // Exit catacombs
@ -456,15 +456,15 @@ void Animation::catacombMove(byte ped) {
case 2307: case 2307:
flipRoom(r__lusties, 5); flipRoom(r__lusties, 5);
_vm->_scrolls->displayText("Oh no... here we go again..."); _vm->_scrolls->displayText("Oh no... here we go again...");
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
_sprites[0]._moveY = 1; _sprites[0]._moveY = 1;
_sprites[0]._moveX = 0; _sprites[0]._moveX = 0;
return; return;
} }
if (!_vm->_gyro->_dna._enterCatacombsFromLustiesRoom) if (!_vm->_gyro->_enterCatacombsFromLustiesRoom)
_vm->_lucerna->loadRoom(29); _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. switch (here & 0xf) { // West.
case 0: // no connection (wall) case 0: // no connection (wall)
@ -595,7 +595,7 @@ void Animation::catacombMove(byte ped) {
case 0x1: case 0x1:
_vm->_celer->drawBackgroundSprite(-1, -1, 22); _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; _vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim;
else else
_vm->_gyro->_magics[12]._operation = Gyro::kMagicSpecial; // Right exit south. _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. 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... if (!_sprites[1]._quick) // If we don't already have her...
_sprites[1].init(5, true, this); // ...Load Geida. _sprites[1].init(5, true, this); // ...Load Geida.
appearPed(2, geidaPed(ped)); appearPed(2, geidaPed(ped));
@ -746,27 +746,27 @@ void Animation::callSpecial(uint16 which) {
switch (which) { switch (which) {
case 1: // _vm->_gyro->special 1: Room 22: top of stairs. case 1: // _vm->_gyro->special 1: Room 22: top of stairs.
_vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_gyro->_dna._brummieStairs = 1; _vm->_gyro->_brummieStairs = 1;
_vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing; _vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing;
_vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs); _vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs);
stopWalking(); stopWalking();
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
break; break;
case 2: // _vm->_gyro->special 2: Room 22: bottom of stairs. 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[10]._operation = Gyro::kMagicNothing;
_vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim; _vm->_gyro->_magics[11]._operation = Gyro::kMagicExclaim;
_vm->_gyro->_magics[11]._data = 5; _vm->_gyro->_magics[11]._data = 5;
_vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned! _vm->_gyro->_magics[3]._operation = Gyro::kMagicBounce; // Now works as planned!
stopWalking(); stopWalking();
_vm->_visa->displayScrollChain('q', 26); _vm->_visa->displayScrollChain('q', 26);
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
break; break;
case 3: // _vm->_gyro->special 3: Room 71: triggers dart. case 3: // _vm->_gyro->special 3: Room 71: triggers dart.
_sprites[0].bounce(); // Must include that. _sprites[0].bounce(); // Must include that.
if (!_vm->_gyro->_dna._arrowTriggered) { if (!_vm->_gyro->_arrowTriggered) {
_vm->_gyro->_dna._arrowTriggered = true; _vm->_gyro->_arrowTriggered = true;
appearPed(2, 4); // The dart starts at ped 4, and... appearPed(2, 4); // The dart starts at ped 4, and...
_sprites[1].walkTo(5); // flies to ped 5. _sprites[1].walkTo(5); // flies to ped 5.
_sprites[1]._facingDir = kDirUp; // Only face. _sprites[1]._facingDir = kDirUp; // Only face.
@ -786,7 +786,7 @@ void Animation::callSpecial(uint16 which) {
_vm->_enid->backToBootstrap(3); _vm->_enid->backToBootstrap(3);
break; break;
case 5: 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->special 5: Room 42: touched tree, and get tied up.
_vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again. _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Boundary effect is now working again.
_vm->_visa->displayScrollChain('q', 35); _vm->_visa->displayScrollChain('q', 35);
@ -794,8 +794,8 @@ void Animation::callSpecial(uint16 which) {
//tr[1].vanishifstill:=true; //tr[1].vanishifstill:=true;
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
_vm->_visa->displayScrollChain('q', 36); _vm->_visa->displayScrollChain('q', 36);
_vm->_gyro->_dna._tiedUp = true; _vm->_gyro->_tiedUp = true;
_vm->_gyro->_dna._friarWillTieYouUp = false; _vm->_gyro->_friarWillTieYouUp = false;
_sprites[1].walkTo(3); _sprites[1].walkTo(3);
_sprites[1]._vanishIfStill = true; _sprites[1]._vanishIfStill = true;
_sprites[1]._doCheck = true; // One of them must have Check_Me switched on. _sprites[1]._doCheck = true; // One of them must have Check_Me switched on.
@ -804,7 +804,7 @@ void Animation::callSpecial(uint16 which) {
} }
break; break;
case 6: // _vm->_gyro->special 6: fall down oubliette. case 6: // _vm->_gyro->special 6: fall down oubliette.
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
_sprites[0]._moveX = 3; _sprites[0]._moveX = 3;
_sprites[0]._moveY = 0; _sprites[0]._moveY = 0;
_sprites[0]._facingDir = kDirRight; _sprites[0]._facingDir = kDirRight;
@ -821,7 +821,7 @@ void Animation::callSpecial(uint16 which) {
_vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid); _vm->_timer->addTimer(200, Timer::kProcMeetAvaroid, Timer::kReasonMeetingAvaroid);
break; break;
case 8: // _vm->_gyro->special 8: leave du Lustie's room. 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); _vm->_visa->displayScrollChain('q', 63);
_sprites[1].turn(kDirDown); _sprites[1].turn(kDirDown);
_sprites[1].stopWalk(); _sprites[1].stopWalk();
@ -830,18 +830,18 @@ void Animation::callSpecial(uint16 which) {
} }
break; break;
case 9: // _vm->_gyro->special 9: lose Geida to Robin Hood... 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. return; // DOESN'T COUNT: no Geida.
_sprites[1]._callEachStepFl = false; // She no longer follows Avvy around. _sprites[1]._callEachStepFl = false; // She no longer follows Avvy around.
_sprites[1].walkTo(4); // She walks to somewhere... _sprites[1].walkTo(4); // She walks to somewhere...
_sprites[0].remove(); // Lose Avvy. _sprites[0].remove(); // Lose Avvy.
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
_vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida); _vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida);
break; break;
case 10: // _vm->_gyro->special 10: transfer north in catacombs. 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. // Into Geida's room.
if (_vm->_gyro->_dna._objects[Gyro::kObjectKey - 1]) if (_vm->_gyro->_objects[Gyro::kObjectKey - 1])
_vm->_visa->displayScrollChain('q', 62); _vm->_visa->displayScrollChain('q', 62);
else { else {
_vm->_visa->displayScrollChain('q', 61); _vm->_visa->displayScrollChain('q', 61);
@ -849,11 +849,11 @@ void Animation::callSpecial(uint16 which) {
} }
} }
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
_vm->_gyro->_dna._catacombY--; _vm->_gyro->_catacombY--;
catacombMove(4); catacombMove(4);
if (_vm->_gyro->_dna._room != r__catacombs) if (_vm->_gyro->_room != r__catacombs)
return; 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: case 0x1:
appearPed(1, 12); appearPed(1, 12);
break; break;
@ -867,27 +867,27 @@ void Animation::callSpecial(uint16 which) {
break; break;
case 11: // _vm->_gyro->special 11: transfer east in catacombs. case 11: // _vm->_gyro->special 11: transfer east in catacombs.
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
_vm->_gyro->_dna._catacombX++; _vm->_gyro->_catacombX++;
catacombMove(1); catacombMove(1);
if (_vm->_gyro->_dna._room != r__catacombs) if (_vm->_gyro->_room != r__catacombs)
return; return;
appearPed(1, 1); appearPed(1, 1);
dawnDelay(); dawnDelay();
break; break;
case 12: // _vm->_gyro->special 12: transfer south in catacombs. case 12: // _vm->_gyro->special 12: transfer south in catacombs.
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
_vm->_gyro->_dna._catacombY += 1; _vm->_gyro->_catacombY += 1;
catacombMove(2); catacombMove(2);
if (_vm->_gyro->_dna._room != r__catacombs) if (_vm->_gyro->_room != r__catacombs)
return; return;
appearPed(1, 2); appearPed(1, 2);
dawnDelay(); dawnDelay();
break; break;
case 13: // _vm->_gyro->special 13: transfer west in catacombs. case 13: // _vm->_gyro->special 13: transfer west in catacombs.
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
_vm->_gyro->_dna._catacombX--; _vm->_gyro->_catacombX--;
catacombMove(3); catacombMove(3);
if (_vm->_gyro->_dna._room != r__catacombs) if (_vm->_gyro->_room != r__catacombs)
return; return;
appearPed(1, 3); appearPed(1, 3);
dawnDelay(); dawnDelay();
@ -903,7 +903,7 @@ void Animation::callSpecial(uint16 which) {
* @remarks Originally called 'open_the_door' * @remarks Originally called 'open_the_door'
*/ */
void Animation::openDoor(byte whither, byte ped, byte magicnum) { void Animation::openDoor(byte whither, byte ped, byte magicnum) {
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__outsideyours: case r__outsideyours:
case r__outsidenottspub: case r__outsidenottspub:
case r__outsideducks: case r__outsideducks:
@ -930,7 +930,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) {
case r__lusties: case r__lusties:
switch (magicnum) { switch (magicnum) {
case 14: case 14:
if (_vm->_gyro->_dna._avvysInTheCupboard) { if (_vm->_gyro->_avvysInTheCupboard) {
hideInCupboard(); hideInCupboard();
_vm->_sequence->firstShow(8); _vm->_sequence->firstShow(8);
_vm->_sequence->thenShow(7); _vm->_sequence->thenShow(7);
@ -1080,13 +1080,13 @@ void Animation::arrowProcs(byte tripnum) {
#endif #endif
_vm->_lucerna->gameOver(); _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); _vm->_timer->addTimer(55, Timer::kProcNaughtyDuke, Timer::kReasonNaughtyDuke);
} }
} else { // Arrow has hit the wall! } else { // Arrow has hit the wall!
_sprites[tripnum].remove(); // Deallocate the arrow. _sprites[tripnum].remove(); // Deallocate the arrow.
_vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door. _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) if (_sprites[tripnum]._id == 2)
return; // Not for Spludwick return; // Not for Spludwick
_vm->_gyro->_dna._geidaSpin += 1; _vm->_gyro->_geidaSpin += 1;
_vm->_gyro->_dna._geidaTime = 20; _vm->_gyro->_geidaTime = 20;
if (_vm->_gyro->_dna._geidaSpin == 5) { if (_vm->_gyro->_geidaSpin == 5) {
_vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!"); _vm->_scrolls->displayText("Steady on, Avvy, you'll make the poor girl dizzy!");
_vm->_gyro->_dna._geidaSpin = 0; _vm->_gyro->_geidaSpin = 0;
_vm->_gyro->_dna._geidaTime = 0; // knock out records _vm->_gyro->_geidaTime = 0; // knock out records
} }
} }
} }
void Animation::geidaProcs(byte tripnum) { void Animation::geidaProcs(byte tripnum) {
if (_vm->_gyro->_dna._geidaTime > 0) { if (_vm->_gyro->_geidaTime > 0) {
_vm->_gyro->_dna._geidaTime--; _vm->_gyro->_geidaTime--;
if (_vm->_gyro->_dna._geidaTime == 0) if (_vm->_gyro->_geidaTime == 0)
_vm->_gyro->_dna._geidaSpin = 0; _vm->_gyro->_geidaSpin = 0;
} }
if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) { if (_sprites[tripnum]._y < (_sprites[0]._y - 2)) {
@ -1279,7 +1279,7 @@ void Animation::animLink() {
void Animation::stopWalking() { void Animation::stopWalking() {
_sprites[0].stopWalk(); _sprites[0].stopWalk();
_vm->_gyro->_dna._direction = kDirStopped; _vm->_gyro->_direction = kDirStopped;
if (_vm->_gyro->_alive) if (_vm->_gyro->_alive)
_sprites[0]._stepNum = 1; _sprites[0]._stepNum = 1;
} }
@ -1289,16 +1289,16 @@ void Animation::stopWalking() {
* @remarks Originally called 'hide_in_the_cupboard' * @remarks Originally called 'hide_in_the_cupboard'
*/ */
void Animation::hideInCupboard() { void Animation::hideInCupboard() {
if (_vm->_gyro->_dna._avvysInTheCupboard) { if (_vm->_gyro->_avvysInTheCupboard) {
if (_vm->_gyro->_dna._wearing == Acci::kNothing) { if (_vm->_gyro->_wearing == Acci::kNothing) {
Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman); Common::String tmpStr = Common::String::format("%cAVVY!%cGet dressed first!", Scrolls::kControlItalic, Scrolls::kControlRoman);
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
} else { } else {
_sprites[0]._visible = true; _sprites[0]._visible = true;
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
appearPed(1, 3); // Walk out of the cupboard. appearPed(1, 3); // Walk out of the cupboard.
_vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!"); _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->firstShow(8);
_vm->_sequence->thenShow(7); _vm->_sequence->thenShow(7);
_vm->_sequence->startToClose(); _vm->_sequence->startToClose();
@ -1306,11 +1306,11 @@ void Animation::hideInCupboard() {
} else { } else {
// Not hiding in the cupboard // Not hiding in the cupboard
_sprites[0]._visible = false; _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, " \ 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); "but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph);
_vm->_scrolls->displayText(tmpStr); _vm->_scrolls->displayText(tmpStr);
_vm->_gyro->_dna._avvysInTheCupboard = true; _vm->_gyro->_avvysInTheCupboard = true;
_vm->_celer->drawBackgroundSprite(-1, -1, 8); _vm->_celer->drawBackgroundSprite(-1, -1, 8);
} }
} }
@ -1323,18 +1323,18 @@ void Animation::flipRoom(byte room, byte ped) {
return; return;
} }
if ((room == 177) && (_vm->_gyro->_dna._room == r__lusties)) { if ((room == 177) && (_vm->_gyro->_room == r__lusties)) {
hideInCupboard(); hideInCupboard();
return; 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! // You can't *jump* out of Cardiff Castle!
_sprites[0]._moveX = 0; _sprites[0]._moveX = 0;
return; return;
} }
_vm->_lucerna->exitRoom(_vm->_gyro->_dna._room); _vm->_lucerna->exitRoom(_vm->_gyro->_room);
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
for (int16 i = 1; i < kSpriteNumbMax; i++) { for (int16 i = 1; i < kSpriteNumbMax; i++) {
@ -1342,14 +1342,14 @@ void Animation::flipRoom(byte room, byte ped) {
_sprites[i].remove(); _sprites[i].remove();
} // Deallocate sprite } // Deallocate sprite
if (_vm->_gyro->_dna._room == r__lustiesroom) if (_vm->_gyro->_room == r__lustiesroom)
_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; _vm->_gyro->_enterCatacombsFromLustiesRoom = true;
_vm->_lucerna->enterRoom(room, ped); _vm->_lucerna->enterRoom(room, ped);
appearPed(1, ped); appearPed(1, ped);
_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false; _vm->_gyro->_enterCatacombsFromLustiesRoom = false;
_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; _vm->_gyro->_oldDirection = _vm->_gyro->_direction;
_vm->_gyro->_dna._direction = _sprites[0]._facingDir; _vm->_gyro->_direction = _sprites[0]._facingDir;
_vm->_lucerna->drawDirection(); _vm->_lucerna->drawDirection();
_vm->_lucerna->dawn(); _vm->_lucerna->dawn();
@ -1385,7 +1385,7 @@ bool Animation::nearDoor() {
} }
void Animation::handleMoveKey(const Common::Event &event) { void Animation::handleMoveKey(const Common::Event &event) {
if (!_vm->_gyro->_dna._userMovesAvvy) if (!_vm->_gyro->_userMovesAvvy)
return; return;
if (_vm->_dropdown->_activeMenuItem._activeNow) if (_vm->_dropdown->_activeMenuItem._activeNow)
@ -1393,58 +1393,58 @@ void Animation::handleMoveKey(const Common::Event &event) {
else { else {
switch (event.kbd.keycode) { switch (event.kbd.keycode) {
case Common::KEYCODE_UP: case Common::KEYCODE_UP:
if (_vm->_gyro->_dna._direction != kDirUp) { if (_vm->_gyro->_direction != kDirUp) {
_vm->_gyro->_dna._direction = kDirUp; _vm->_gyro->_direction = kDirUp;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_DOWN: case Common::KEYCODE_DOWN:
if (_vm->_gyro->_dna._direction != kDirDown) { if (_vm->_gyro->_direction != kDirDown) {
_vm->_gyro->_dna._direction = kDirDown; _vm->_gyro->_direction = kDirDown;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_LEFT: case Common::KEYCODE_LEFT:
if (_vm->_gyro->_dna._direction != kDirLeft) { if (_vm->_gyro->_direction != kDirLeft) {
_vm->_gyro->_dna._direction = kDirLeft; _vm->_gyro->_direction = kDirLeft;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_RIGHT: case Common::KEYCODE_RIGHT:
if (_vm->_gyro->_dna._direction != kDirRight) { if (_vm->_gyro->_direction != kDirRight) {
_vm->_gyro->_dna._direction = kDirRight; _vm->_gyro->_direction = kDirRight;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_PAGEUP: case Common::KEYCODE_PAGEUP:
if (_vm->_gyro->_dna._direction != kDirUpRight) { if (_vm->_gyro->_direction != kDirUpRight) {
_vm->_gyro->_dna._direction = kDirUpRight; _vm->_gyro->_direction = kDirUpRight;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_PAGEDOWN: case Common::KEYCODE_PAGEDOWN:
if (_vm->_gyro->_dna._direction != kDirDownRight) { if (_vm->_gyro->_direction != kDirDownRight) {
_vm->_gyro->_dna._direction = kDirDownRight; _vm->_gyro->_direction = kDirDownRight;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_END: case Common::KEYCODE_END:
if (_vm->_gyro->_dna._direction != kDirDownLeft) { if (_vm->_gyro->_direction != kDirDownLeft) {
_vm->_gyro->_dna._direction = kDirDownLeft; _vm->_gyro->_direction = kDirDownLeft;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;
case Common::KEYCODE_HOME: case Common::KEYCODE_HOME:
if (_vm->_gyro->_dna._direction != kDirUpLeft) { if (_vm->_gyro->_direction != kDirUpLeft) {
_vm->_gyro->_dna._direction = kDirUpLeft; _vm->_gyro->_direction = kDirUpLeft;
changeDirection(0, _vm->_gyro->_dna._direction); changeDirection(0, _vm->_gyro->_direction);
} else } else
stopWalking(); stopWalking();
break; break;

View file

@ -123,146 +123,146 @@ const char *AvalancheEngine::getCopyrightString() const {
void AvalancheEngine::synchronize(Common::Serializer &sz) { void AvalancheEngine::synchronize(Common::Serializer &sz) {
//blockwrite(f, dna, sizeof(dna)); //blockwrite(f, dna, sizeof(dna));
sz.syncAsByte(_gyro->_dna._direction); sz.syncAsByte(_gyro->_direction);
sz.syncAsByte(_gyro->_dna._carryNum); sz.syncAsByte(_gyro->_carryNum);
for (byte i = 0; i < kObjectNum; i++) for (byte i = 0; i < kObjectNum; i++)
sz.syncAsByte(_gyro->_dna._objects[i]); sz.syncAsByte(_gyro->_objects[i]);
sz.syncAsSint16LE(_gyro->_dna._score); sz.syncAsSint16LE(_gyro->_dnascore);
sz.syncAsSint32LE(_gyro->_dna._money); sz.syncAsSint32LE(_gyro->_money);
sz.syncAsByte(_gyro->_dna._room); sz.syncAsByte(_gyro->_room);
sz.syncAsByte(_gyro->_dna._wearing); sz.syncAsByte(_gyro->_wearing);
sz.syncAsByte(_gyro->_dna._sworeNum); sz.syncAsByte(_gyro->_sworeNum);
sz.syncAsByte(_gyro->_dna._saveNum); sz.syncAsByte(_gyro->_saveNum);
sz.syncBytes(_gyro->_dna._roomCount, 100); sz.syncBytes(_gyro->_roomCount, 100);
sz.syncAsByte(_gyro->_dna._alcoholLevel); sz.syncAsByte(_gyro->_alcoholLevel);
sz.syncAsByte(_gyro->_dna._playedNim); sz.syncAsByte(_gyro->_playedNim);
sz.syncAsByte(_gyro->_dna._wonNim); sz.syncAsByte(_gyro->_wonNim);
sz.syncAsByte(_gyro->_dna._wineState); sz.syncAsByte(_gyro->_wineState);
sz.syncAsByte(_gyro->_dna._cwytalotGone); sz.syncAsByte(_gyro->_cwytalotGone);
sz.syncAsByte(_gyro->_dna._passwordNum); sz.syncAsByte(_gyro->_passwordNum);
sz.syncAsByte(_gyro->_dna._aylesIsAwake); sz.syncAsByte(_gyro->_aylesIsAwake);
sz.syncAsByte(_gyro->_dna._drawbridgeOpen); sz.syncAsByte(_gyro->_drawbridgeOpen);
sz.syncAsByte(_gyro->_dna._avariciusTalk); sz.syncAsByte(_gyro->_avariciusTalk);
sz.syncAsByte(_gyro->_dna._boughtOnion); sz.syncAsByte(_gyro->_boughtOnion);
sz.syncAsByte(_gyro->_dna._rottenOnion); sz.syncAsByte(_gyro->_rottenOnion);
sz.syncAsByte(_gyro->_dna._onionInVinegar); sz.syncAsByte(_gyro->_onionInVinegar);
sz.syncAsByte(_gyro->_dna._givenToSpludwick); sz.syncAsByte(_gyro->_givenToSpludwick);
sz.syncAsByte(_gyro->_dna._brummieStairs); sz.syncAsByte(_gyro->_brummieStairs);
sz.syncAsByte(_gyro->_dna._cardiffQuestionNum); sz.syncAsByte(_gyro->_cardiffQuestionNum);
sz.syncAsByte(_gyro->_dna._passedCwytalotInHerts); sz.syncAsByte(_gyro->_passedCwytalotInHerts);
sz.syncAsByte(_gyro->_dna._avvyIsAwake); sz.syncAsByte(_gyro->_avvyIsAwake);
sz.syncAsByte(_gyro->_dna._avvyInBed); sz.syncAsByte(_gyro->_avvyInBed);
sz.syncAsByte(_gyro->_dna._userMovesAvvy); sz.syncAsByte(_gyro->_userMovesAvvy);
sz.syncAsByte(_gyro->_dna._dogFoodPos); sz.syncAsByte(_gyro->_dogFoodPos);
sz.syncAsByte(_gyro->_dna._givenBadgeToIby); sz.syncAsByte(_gyro->_givenBadgeToIby);
sz.syncAsByte(_gyro->_dna._friarWillTieYouUp); sz.syncAsByte(_gyro->_friarWillTieYouUp);
sz.syncAsByte(_gyro->_dna._tiedUp); sz.syncAsByte(_gyro->_tiedUp);
sz.syncAsByte(_gyro->_dna._boxContent); sz.syncAsByte(_gyro->_boxContent);
sz.syncAsByte(_gyro->_dna._talkedToCrapulus); sz.syncAsByte(_gyro->_talkedToCrapulus);
sz.syncAsByte(_gyro->_dna._jacquesState); sz.syncAsByte(_gyro->_jacquesState);
sz.syncAsByte(_gyro->_dna._bellsAreRinging); sz.syncAsByte(_gyro->_bellsAreRinging);
sz.syncAsByte(_gyro->_dna._standingOnDais); sz.syncAsByte(_gyro->_standingOnDais);
sz.syncAsByte(_gyro->_dna._takenPen); sz.syncAsByte(_gyro->_takenPen);
sz.syncAsByte(_gyro->_dna._arrowTriggered); sz.syncAsByte(_gyro->_arrowTriggered);
sz.syncAsByte(_gyro->_dna._arrowInTheDoor); sz.syncAsByte(_gyro->_arrowInTheDoor);
if (sz.isSaving()) { if (sz.isSaving()) {
uint16 like2drinkSize = _gyro->_dna._favouriteDrink.size(); uint16 like2drinkSize = _gyro->_favouriteDrink.size();
sz.syncAsUint16LE(like2drinkSize); sz.syncAsUint16LE(like2drinkSize);
for (uint16 i = 0; i < like2drinkSize; i++) { for (uint16 i = 0; i < like2drinkSize; i++) {
char actChr = _gyro->_dna._favouriteDrink[i]; char actChr = _gyro->_favouriteDrink[i];
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
} }
uint16 favourite_songSize = _gyro->_dna._favouriteSong.size(); uint16 favourite_songSize = _gyro->_favouriteSong.size();
sz.syncAsUint16LE(favourite_songSize); sz.syncAsUint16LE(favourite_songSize);
for (uint16 i = 0; i < favourite_songSize; i++) { for (uint16 i = 0; i < favourite_songSize; i++) {
char actChr = _gyro->_dna._favouriteSong[i]; char actChr = _gyro->_favouriteSong[i];
sz.syncAsByte(actChr); 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); sz.syncAsUint16LE(worst_place_on_earthSize);
for (uint16 i = 0; i < worst_place_on_earthSize; i++) { for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
char actChr = _gyro->_dna._worstPlaceOnEarth[i]; char actChr = _gyro->_worstPlaceOnEarth[i];
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
} }
uint16 spare_eveningSize = _gyro->_dna._spareEvening.size(); uint16 spare_eveningSize = _gyro->_spareEvening.size();
sz.syncAsUint16LE(spare_eveningSize); sz.syncAsUint16LE(spare_eveningSize);
for (uint16 i = 0; i < spare_eveningSize; i++) { for (uint16 i = 0; i < spare_eveningSize; i++) {
char actChr = _gyro->_dna._spareEvening[i]; char actChr = _gyro->_spareEvening[i];
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
} }
} else { } else {
if (!_gyro->_dna._favouriteDrink.empty()) if (!_gyro->_favouriteDrink.empty())
_gyro->_dna._favouriteDrink.clear(); _gyro->_favouriteDrink.clear();
uint16 like2drinkSize = 0; uint16 like2drinkSize = 0;
char actChr = ' '; char actChr = ' ';
sz.syncAsUint16LE(like2drinkSize); sz.syncAsUint16LE(like2drinkSize);
for (uint16 i = 0; i < like2drinkSize; i++) { for (uint16 i = 0; i < like2drinkSize; i++) {
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
_gyro->_dna._favouriteDrink += actChr; _gyro->_favouriteDrink += actChr;
} }
if (!_gyro->_dna._favouriteSong.empty()) if (!_gyro->_favouriteSong.empty())
_gyro->_dna._favouriteSong.clear(); _gyro->_favouriteSong.clear();
uint16 favourite_songSize = 0; uint16 favourite_songSize = 0;
sz.syncAsUint16LE(favourite_songSize); sz.syncAsUint16LE(favourite_songSize);
for (uint16 i = 0; i < favourite_songSize; i++) { for (uint16 i = 0; i < favourite_songSize; i++) {
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
_gyro->_dna._favouriteSong += actChr; _gyro->_favouriteSong += actChr;
} }
if (!_gyro->_dna._worstPlaceOnEarth.empty()) if (!_gyro->_worstPlaceOnEarth.empty())
_gyro->_dna._worstPlaceOnEarth.clear(); _gyro->_worstPlaceOnEarth.clear();
uint16 worst_place_on_earthSize = 0; uint16 worst_place_on_earthSize = 0;
sz.syncAsUint16LE(worst_place_on_earthSize); sz.syncAsUint16LE(worst_place_on_earthSize);
for (uint16 i = 0; i < worst_place_on_earthSize; i++) { for (uint16 i = 0; i < worst_place_on_earthSize; i++) {
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
_gyro->_dna._worstPlaceOnEarth += actChr; _gyro->_worstPlaceOnEarth += actChr;
} }
if (!_gyro->_dna._spareEvening.empty()) if (!_gyro->_spareEvening.empty())
_gyro->_dna._spareEvening.clear(); _gyro->_spareEvening.clear();
uint16 spare_eveningSize = 0; uint16 spare_eveningSize = 0;
sz.syncAsUint16LE(spare_eveningSize); sz.syncAsUint16LE(spare_eveningSize);
for (uint16 i = 0; i < spare_eveningSize; i++) { for (uint16 i = 0; i < spare_eveningSize; i++) {
sz.syncAsByte(actChr); sz.syncAsByte(actChr);
_gyro->_dna._spareEvening += actChr; _gyro->_spareEvening += actChr;
} }
} }
sz.syncAsSint32LE(_gyro->_dna._totalTime); sz.syncAsSint32LE(_gyro->_totalTime);
sz.syncAsByte(_gyro->_dna._jumpStatus); sz.syncAsByte(_gyro->_jumpStatus);
sz.syncAsByte(_gyro->_dna._mushroomGrowing); sz.syncAsByte(_gyro->_mushroomGrowing);
sz.syncAsByte(_gyro->_dna._spludwickAtHome); sz.syncAsByte(_gyro->_spludwickAtHome);
sz.syncAsByte(_gyro->_dna._lastRoom); sz.syncAsByte(_gyro->_lastRoom);
sz.syncAsByte(_gyro->_dna._lastRoomNotMap); sz.syncAsByte(_gyro->_lastRoomNotMap);
sz.syncAsByte(_gyro->_dna._crapulusWillTell); sz.syncAsByte(_gyro->_crapulusWillTell);
sz.syncAsByte(_gyro->_dna._enterCatacombsFromLustiesRoom); sz.syncAsByte(_gyro->_enterCatacombsFromLustiesRoom);
sz.syncAsByte(_gyro->_dna._teetotal); sz.syncAsByte(_gyro->_teetotal);
sz.syncAsByte(_gyro->_dna._malagauche); sz.syncAsByte(_gyro->_malagauche);
sz.syncAsByte(_gyro->_dna._drinking); sz.syncAsByte(_gyro->_drinking);
sz.syncAsByte(_gyro->_dna._enteredLustiesRoomAsMonk); sz.syncAsByte(_gyro->_enteredLustiesRoomAsMonk);
sz.syncAsByte(_gyro->_dna._catacombX); sz.syncAsByte(_gyro->_catacombX);
sz.syncAsByte(_gyro->_dna._catacombY); sz.syncAsByte(_gyro->_catacombY);
sz.syncAsByte(_gyro->_dna._avvysInTheCupboard); sz.syncAsByte(_gyro->_avvysInTheCupboard);
sz.syncAsByte(_gyro->_dna._geidaFollows); sz.syncAsByte(_gyro->_geidaFollows);
sz.syncAsByte(_gyro->_dna._geidaSpin); sz.syncAsByte(_gyro->_geidaSpin);
sz.syncAsByte(_gyro->_dna._geidaTime); sz.syncAsByte(_gyro->_geidaTime);
sz.syncAsByte(_gyro->_dna._nextBell); sz.syncAsByte(_gyro->_nextBell);
sz.syncAsByte(_gyro->_dna._givenPotionToGeida); sz.syncAsByte(_gyro->_givenPotionToGeida);
sz.syncAsByte(_gyro->_dna._lustieIsAsleep); sz.syncAsByte(_gyro->_lustieIsAsleep);
sz.syncAsByte(_gyro->_dna._flipToWhere); sz.syncAsByte(_gyro->_flipToWhere);
sz.syncAsByte(_gyro->_dna._flipToPed); sz.syncAsByte(_gyro->_flipToPed);
sz.syncAsByte(_gyro->_dna._beenTiedUp); sz.syncAsByte(_gyro->_beenTiedUp);
sz.syncAsByte(_gyro->_dna._sittingInPub); sz.syncAsByte(_gyro->_sittingInPub);
sz.syncAsByte(_gyro->_dna._spurgeTalkCount); sz.syncAsByte(_gyro->_spurgeTalkCount);
sz.syncAsByte(_gyro->_dna._metAvaroid); sz.syncAsByte(_gyro->_metAvaroid);
sz.syncAsByte(_gyro->_dna._takenMushroom); sz.syncAsByte(_gyro->_takenMushroom);
sz.syncAsByte(_gyro->_dna._givenPenToAyles); sz.syncAsByte(_gyro->_givenPenToAyles);
sz.syncAsByte(_gyro->_dna._askedDogfoodAboutNim); sz.syncAsByte(_gyro->_askedDogfoodAboutNim);
#if 0 #if 0
@ -443,7 +443,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
_celer->forgetBackgroundSprites(); _celer->forgetBackgroundSprites();
_lucerna->minorRedraw(); _lucerna->minorRedraw();
_dropdown->setupMenu(); _dropdown->setupMenu();
_gyro->_whereIs[0] = _gyro->_dna._room; _gyro->_whereIs[0] = _gyro->_room;
_gyro->_alive = true; _gyro->_alive = true;
_lucerna->refreshObjectList(); _lucerna->refreshObjectList();
_animation->updateSpeed(); _animation->updateSpeed();
@ -459,7 +459,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
_scrolls->displayText(tmpStr); _scrolls->displayText(tmpStr);
if (_animation->_sprites[0]._quick && _animation->_sprites[0]._visible) 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; return true;
} }

View file

@ -109,7 +109,7 @@ void Avalot::handleKeyDown(Common::Event &event) {
case Common::KEYCODE_HOME: case Common::KEYCODE_HOME:
case Common::KEYCODE_END: case Common::KEYCODE_END:
case Common::KEYCODE_KP5: 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->_animation->handleMoveKey(event); // Fallthroughs are intended.
_vm->_lucerna->drawDirection(); _vm->_lucerna->drawDirection();
return; return;
@ -147,7 +147,7 @@ void Avalot::setup() {
_vm->_gyro->_ledStatus = 177; _vm->_gyro->_ledStatus = 177;
_vm->_gyro->_defaultLed = 2; _vm->_gyro->_defaultLed = 2;
// TSkellern = 0; Replace with a more local variable sometime // 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->_gyro->_enidFilename = ""; // Undefined.
_vm->_lucerna->drawToolbar(); _vm->_lucerna->drawToolbar();
_vm->_scrolls->setReadyLight(2); _vm->_scrolls->setReadyLight(2);

View file

@ -57,7 +57,7 @@ void Celer::updateBackgroundSprites() {
if (_vm->_gyro->_dropdownActive) if (_vm->_gyro->_dropdownActive)
return; // No animation when the menus are up. return; // No animation when the menus are up.
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__outsideargentpub: case r__outsideargentpub:
if ((_vm->_gyro->_roomTime % 12) == 0) if ((_vm->_gyro->_roomTime % 12) == 0)
drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4); 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); drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4);
break; break;
case r__yours: 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); drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2);
break; break;
case r__argentpub: 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. // Malagauche cycle.
_vm->_gyro->_dna._malagauche += 1; _vm->_gyro->_malagauche += 1;
switch (_vm->_gyro->_dna._malagauche) { switch (_vm->_gyro->_malagauche) {
case 1: case 1:
case 11: case 11:
case 21: case 21:
@ -94,7 +94,7 @@ void Celer::updateBackgroundSprites() {
drawBackgroundSprite(-1, -1, 13); // Winks. drawBackgroundSprite(-1, -1, 13); // Winks.
break; break;
case 33: case 33:
_vm->_gyro->_dna._malagauche = 0; _vm->_gyro->_malagauche = 0;
break; break;
} }
} }
@ -112,7 +112,7 @@ void Celer::updateBackgroundSprites() {
drawBackgroundSprite(-1, -1, 7); drawBackgroundSprite(-1, -1, 7);
break; break;
case 199: case 199:
_vm->_gyro->_dna._dogFoodPos = 177; // Impossible value for this. _vm->_gyro->_dogFoodPos = 177; // Impossible value for this.
break; break;
} }
@ -125,9 +125,9 @@ void Celer::updateBackgroundSprites() {
else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292)) else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
direction = 4; 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); drawBackgroundSprite(-1, -1, direction);
_vm->_gyro->_dna._dogFoodPos = direction; _vm->_gyro->_dogFoodPos = direction;
} }
} }
break; break;
@ -150,7 +150,7 @@ void Celer::updateBackgroundSprites() {
} }
break; break;
case r__lustiesroom: case r__lustiesroom:
if (!(_vm->_gyro->_dna._lustieIsAsleep)) { if (!(_vm->_gyro->_lustieIsAsleep)) {
byte direction = 0; byte direction = 0;
uint16 angle = _vm->_lucerna->bearing(2); uint16 angle = _vm->_lucerna->bearing(2);
if ((_vm->_gyro->_roomTime % 45) > 42) if ((_vm->_gyro->_roomTime % 45) > 42)
@ -163,14 +163,14 @@ void Celer::updateBackgroundSprites() {
else if ((angle >= 181) && (angle <= 314)) else if ((angle >= 181) && (angle <= 314))
direction = 3; // Right. 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); 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; break;
case r__aylesoffice: 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) { switch ((_vm->_gyro->_roomTime / 14) % 2) {
case 0: case 0:
drawBackgroundSprite(-1, -1, 1); // Frame 2: EGA. drawBackgroundSprite(-1, -1, 1); // Frame 2: EGA.
@ -182,7 +182,7 @@ void Celer::updateBackgroundSprites() {
} }
break; break;
case r__robins: case r__robins:
if (_vm->_gyro->_dna._tiedUp) { if (_vm->_gyro->_tiedUp) {
switch (_vm->_gyro->_roomTime % 54) { switch (_vm->_gyro->_roomTime % 54) {
case 20: case 20:
drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks. drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks.
@ -207,9 +207,9 @@ void Celer::updateBackgroundSprites() {
if ((_vm->_gyro->_roomTime % 60) > 57) if ((_vm->_gyro->_roomTime % 60) > 57)
direction--; // Blinks. 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); 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) { switch (_vm->_gyro->_roomTime % 50) {
@ -239,22 +239,22 @@ void Celer::updateBackgroundSprites() {
if ((_vm->_gyro->_roomTime % 45) > 42) if ((_vm->_gyro->_roomTime % 45) > 42)
direction++; // Duck blinks. 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); 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; break;
} }
} }
if ((_vm->_gyro->_dna._bellsAreRinging) && (_vm->_gyro->setFlag('B'))) { if ((_vm->_gyro->_bellsAreRinging) && (_vm->_gyro->setFlag('B'))) {
// They're ringing the bells. // They're ringing the bells.
switch (_vm->_gyro->_roomTime % 4) { switch (_vm->_gyro->_roomTime % 4) {
case 1: case 1:
if (_vm->_gyro->_dna._nextBell < 5) if (_vm->_gyro->_nextBell < 5)
_vm->_gyro->_dna._nextBell = 12; _vm->_gyro->_nextBell = 12;
_vm->_gyro->_dna._nextBell--; _vm->_gyro->_nextBell--;
_vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_dna._nextBell]); _vm->_gyro->note(_vm->_gyro->kNotes[_vm->_gyro->_nextBell]);
break; break;
case 2: case 2:
//nosound(); //nosound();

View file

@ -448,7 +448,7 @@ void Dropdown::setupMenuAction() {
else else
_activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true); _activeMenuItem.setupOption(f5Does, f5Does[0], "f5", true);
_activeMenuItem.setupOption("Pause game", 'P', "f6", 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()); _activeMenuItem.setupOption("Journey thither", 'J', "f7", _vm->_animation->nearDoor());
else else
_activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor()); _activeMenuItem.setupOption("Open the door", 'O', "f7", _vm->_animation->nearDoor());
@ -469,7 +469,7 @@ void Dropdown::setupMenuPeople() {
_activeMenuItem.reset(); _activeMenuItem.reset();
for (byte i = 150; i <= 178; i++) 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); _activeMenuItem.setupOption(_vm->_gyro->getName(i), _vm->_gyro->getNameChar(i), "", true);
people = people + i; people = people + i;
} }
@ -480,7 +480,7 @@ void Dropdown::setupMenuPeople() {
void Dropdown::setupMenuObjects() { void Dropdown::setupMenuObjects() {
_activeMenuItem.reset(); _activeMenuItem.reset();
for (byte i = 0; i < kObjectNum; i++) { 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.setupOption(_vm->_gyro->getThing(i + 1), _vm->_gyro->getThingChar(i + 1), "", true);
} }
_activeMenuItem.display(); _activeMenuItem.display();
@ -504,7 +504,7 @@ void Dropdown::setupMenuWith() {
// or (c), the _person you've selected is YOU! // or (c), the _person you've selected is YOU!
if ((_vm->_gyro->_lastPerson == Gyro::kPeopleAvalot) || (_vm->_gyro->_lastPerson == _vm->_acci->kNothing) 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. _activeMenuItem.setupOption("Give to...", 'G', "", false); // Not here.
else { else {
_activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true); _activeMenuItem.setupOption(Common::String("Give to ") + _vm->_gyro->getName(_vm->_gyro->_lastPerson), 'G', "", true);
@ -522,13 +522,13 @@ void Dropdown::setupMenuWith() {
} }
break; break;
case Gyro::kPeopleDogfood: { 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; _vm->_gyro->_verbStr = _vm->_gyro->_verbStr + Acci::kVerbCodePlay;
} }
break; break;
case Gyro::kPeopleMalagauche: { case Gyro::kPeopleMalagauche: {
bool isSober = !_vm->_gyro->_dna._teetotal; bool isSober = !_vm->_gyro->_teetotal;
_activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_dna._objects[Gyro::kObjectWine - 1]); _activeMenuItem.setupOption("Buy some wine", 'w', "", !_vm->_gyro->_objects[Gyro::kObjectWine - 1]);
_activeMenuItem.setupOption("Buy some beer", 'b', "", isSober); _activeMenuItem.setupOption("Buy some beer", 'b', "", isSober);
_activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober); _activeMenuItem.setupOption("Buy some whisky", 'h', "", isSober);
_activeMenuItem.setupOption("Buy some cider", 'c', "", isSober); _activeMenuItem.setupOption("Buy some cider", 'c', "", isSober);
@ -537,7 +537,7 @@ void Dropdown::setupMenuWith() {
} }
break; break;
case Gyro::kPeopleTrader: { 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; _vm->_gyro->_verbStr = _vm->_gyro->_verbStr + 105;
} }
break; break;

View file

@ -274,7 +274,7 @@ void Enid::ednaReload() {
_vm->_lucerna->majorRedraw(); _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; _vm->_gyro->_alive = true;

View file

@ -178,7 +178,7 @@ Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) {
_also[fv][ff] = 0; _also[fv][ff] = 0;
} }
_dna._totalTime = 0; _totalTime = 0;
} }
Gyro::~Gyro() { Gyro::~Gyro() {
@ -225,6 +225,89 @@ void Gyro::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String
warning("STUB: Gyro::shbox()"); 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() { void Gyro::newGame() {
for (byte i = 0; i < kMaxSprites; i++) { for (byte i = 0; i < kMaxSprites; i++) {
if (_vm->_animation->_sprites[i]._quick) if (_vm->_animation->_sprites[i]._quick)
@ -236,19 +319,19 @@ void Gyro::newGame() {
_alive = true; _alive = true;
_score = 0; _score = 0;
memset(&_vm->_gyro->_dna, 0, sizeof(DnaType)); resetVariables();
_vm->_scrolls->setBubbleStateNatural(); _vm->_scrolls->setBubbleStateNatural();
_dna._spareEvening = "answer a questionnaire"; _spareEvening = "answer a questionnaire";
_dna._favouriteDrink = "beer"; _favouriteDrink = "beer";
_dna._money = 30; // 2/6 _money = 30; // 2/6
_dna._direction = kDirectionStopped; _direction = kDirectionStopped;
_dna._wearing = kObjectClothes; _wearing = kObjectClothes;
_dna._objects[kObjectMoney - 1] = true; _objects[kObjectMoney - 1] = true;
_dna._objects[kObjectBodkin - 1] = true; _objects[kObjectBodkin - 1] = true;
_dna._objects[kObjectBell - 1] = true; _objects[kObjectBell - 1] = true;
_dna._objects[kObjectClothes - 1] = true; _objects[kObjectClothes - 1] = true;
_thinkThing = true; _thinkThing = true;
_thinks = 2; _thinks = 2;
@ -263,10 +346,10 @@ void Gyro::newGame() {
_her = 254; _her = 254;
_it = 254; _it = 254;
_lastPerson = 254; // = Pardon? _lastPerson = 254; // = Pardon?
_dna._passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1; _passwordNum = _vm->_rnd->getRandomNumber(30) + 1; //Random(30) + 1;
_dna._userMovesAvvy = false; _userMovesAvvy = false;
_doingSpriteRun = false; _doingSpriteRun = false;
_dna._avvyInBed = true; _avvyInBed = true;
_enidFilename = ""; _enidFilename = "";
_vm->_lucerna->enterRoom(1, 1); _vm->_lucerna->enterRoom(1, 1);
@ -299,8 +382,8 @@ void Gyro::forceNumlock() {
} }
bool Gyro::decreaseMoney(uint16 howmuchby) { bool Gyro::decreaseMoney(uint16 howmuchby) {
_dna._money -= howmuchby; _money -= howmuchby;
if (_dna._money < 0) { if (_money < 0) {
_vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!" _vm->_visa->displayScrollChain('Q', 2); // "You are now denariusless!"
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
return false; return false;
@ -343,7 +426,7 @@ Common::String Gyro::getThing(byte which) {
Common::String get_thing_result; Common::String get_thing_result;
switch (which) { switch (which) {
case kObjectWine: case kObjectWine:
switch (_dna._wineState) { switch (_wineState) {
case 1: case 1:
case 4: case 4:
get_thing_result = kThings[which - 1]; get_thing_result = kThings[which - 1];
@ -354,7 +437,7 @@ Common::String Gyro::getThing(byte which) {
} }
break; break;
case kObjectOnion: case kObjectOnion:
if (_dna._rottenOnion) if (_rottenOnion)
get_thing_result = "rotten onion"; get_thing_result = "rotten onion";
else else
get_thing_result = kThings[which - 1]; get_thing_result = kThings[which - 1];
@ -371,7 +454,7 @@ char Gyro::getThingChar(byte which) {
char get_thingchar_result; char get_thingchar_result;
switch (which) { switch (which) {
case kObjectWine: case kObjectWine:
if (_dna._wineState == 3) if (_wineState == 3)
get_thingchar_result = 'V'; // Vinegar get_thingchar_result = 'V'; // Vinegar
else else
get_thingchar_result = kThingsChar[which - 1]; get_thingchar_result = kThingsChar[which - 1];
@ -396,7 +479,7 @@ Common::String Gyro::getItem(byte which) {
switch (which) { switch (which) {
case kObjectWine: case kObjectWine:
switch (_dna._wineState) { switch (_wineState) {
case 0: case 0:
case 1: case 1:
case 4: case 4:
@ -408,9 +491,9 @@ Common::String Gyro::getItem(byte which) {
} }
break; break;
case kObjectOnion: case kObjectOnion:
if (_dna._rottenOnion) if (_rottenOnion)
get_better_result = "a rotten onion"; get_better_result = "a rotten onion";
else if (_dna._onionInVinegar) else if (_onionInVinegar)
get_better_result = "a pickled onion (in the vinegar)"; get_better_result = "a pickled onion (in the vinegar)";
else else
get_better_result = kItems[which - 1]; get_better_result = kItems[which - 1];
@ -426,21 +509,21 @@ Common::String Gyro::getItem(byte which) {
Common::String Gyro::f5Does() { Common::String Gyro::f5Does() {
switch (_dna._room) { switch (_room) {
case r__yours: case r__yours:
if (!_dna._avvyIsAwake) if (!_avvyIsAwake)
return Common::String::format("%cWWake up", Acci::kVerbCodeWake); return Common::String::format("%cWWake up", Acci::kVerbCodeWake);
else if (_dna._avvyInBed) else if (_avvyInBed)
return Common::String::format("%cGGet up", Acci::kVerbCodeStand); return Common::String::format("%cGGet up", Acci::kVerbCodeStand);
break; break;
case r__insidecardiffcastle: case r__insidecardiffcastle:
if (_dna._standingOnDais) if (_standingOnDais)
return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb); return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb);
else else
return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb); return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb);
break; break;
case r__nottspub: case r__nottspub:
if (_dna._sittingInPub) if (_sittingInPub)
return Common::String::format("%cSStand up", Acci::kVerbCodeStand); return Common::String::format("%cSStand up", Acci::kVerbCodeStand);
else else
return Common::String::format("%cSSit down", Acci::kVerbCodeSit); return Common::String::format("%cSSit down", Acci::kVerbCodeSit);

View file

@ -53,76 +53,6 @@ struct MouseHotspotType { // mouse-void
int16 _horizontal, _vertical; 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 { struct PedType {
int16 _x, _y; int16 _x, _y;
byte _direction; byte _direction;
@ -324,7 +254,76 @@ public:
// You may know better than On which page to switch to. // You may know better than On which page to switch to.
bool _onCanDoPageSwap; 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. byte _lineNum; // Number of lines.
LineType _lines[50]; // For Also. LineType _lines[50]; // For Also.
enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse; enum MouseState { kMouseStateNo, kMouseStateYes, kMouseStateVirtual } _mouse;
@ -399,6 +398,7 @@ public:
void setBackgroundColor(byte x); void setBackgroundColor(byte x);
void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t); 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 newGame(); // This sets up the DNA for a completely new game.
void slowDown(); void slowDown();
bool setFlag(char x); bool setFlag(char x);

View file

@ -346,12 +346,12 @@ void Lucerna::exitRoom(byte x) {
switch (x) { switch (x) {
case r__spludwicks: case r__spludwicks:
_vm->_timer->loseTimer(Timer::kReasonAvariciusTalks); _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. // He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
break; break;
case r__bridge: case r__bridge:
if (_vm->_gyro->_dna._drawbridgeOpen > 0) { if (_vm->_gyro->_drawbridgeOpen > 0) {
_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open. _vm->_gyro->_drawbridgeOpen = 4; // Fully open.
_vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls); _vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls);
} }
break; break;
@ -367,9 +367,9 @@ void Lucerna::exitRoom(byte x) {
_vm->_gyro->_seeScroll = false; // Now it can work again! _vm->_gyro->_seeScroll = false; // Now it can work again!
_vm->_gyro->_dna._lastRoom = _vm->_gyro->_dna._room; _vm->_gyro->_lastRoom = _vm->_gyro->_room;
if (_vm->_gyro->_dna._room != r__map) if (_vm->_gyro->_room != r__map)
_vm->_gyro->_dna._lastRoomNotMap = _vm->_gyro->_dna._room; _vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room;
} }
@ -381,28 +381,28 @@ void Lucerna::exitRoom(byte x) {
void Lucerna::enterNewTown() { void Lucerna::enterNewTown() {
_vm->_dropdown->setupMenu(); _vm->_dropdown->setupMenu();
switch (_vm->_gyro->_dna._room) { switch (_vm->_gyro->_room) {
case r__outsidenottspub: // Entry into Nottingham. case r__outsidenottspub: // Entry into Nottingham.
if ((_vm->_gyro->_dna._roomCount[r__robins] > 0) && (_vm->_gyro->_dna._beenTiedUp) && (!_vm->_gyro->_dna._takenMushroom)) if ((_vm->_gyro->_roomCount[r__robins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom))
_vm->_gyro->_dna._mushroomGrowing = true; _vm->_gyro->_mushroomGrowing = true;
break; break;
case r__wisewomans: { // Entry into Argent. case r__wisewomans: { // Entry into Argent.
if (_vm->_gyro->_dna._talkedToCrapulus && (! _vm->_gyro->_dna._lustieIsAsleep)) { if (_vm->_gyro->_talkedToCrapulus && (! _vm->_gyro->_lustieIsAsleep)) {
_vm->_gyro->_dna._spludwickAtHome = !((_vm->_gyro->_dna._roomCount[r__wisewomans] % 3) == 1); _vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1);
_vm->_gyro->_dna._crapulusWillTell = ! _vm->_gyro->_dna._spludwickAtHome; _vm->_gyro->_crapulusWillTell = ! _vm->_gyro->_spludwickAtHome;
} else { } else {
_vm->_gyro->_dna._spludwickAtHome = true; _vm->_gyro->_spludwickAtHome = true;
_vm->_gyro->_dna._crapulusWillTell = false; _vm->_gyro->_crapulusWillTell = false;
} }
if (_vm->_gyro->_dna._boxContent == Gyro::kObjectWine) if (_vm->_gyro->_boxContent == Gyro::kObjectWine)
_vm->_gyro->_dna._wineState = 3; // Vinegar _vm->_gyro->_wineState = 3; // Vinegar
} }
break; break;
} }
if (_vm->_gyro->_dna._room != r__outsideducks) { if (_vm->_gyro->_room != r__outsideducks) {
if ((_vm->_gyro->_dna._objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_dna._onionInVinegar)) if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar))
_vm->_gyro->_dna._rottenOnion = true; // You're holding the onion _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. _vm->_gyro->_seeScroll = true; // This stops the trippancy system working over the length of this procedure.
findPeople(room); findPeople(room);
_vm->_gyro->_dna._room = room; _vm->_gyro->_room = room;
if (ped != 0) if (ped != 0)
_vm->_gyro->_dna._roomCount[room]++; _vm->_gyro->_roomCount[room]++;
loadRoom(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); 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->_whereIs[Gyro::kPeopleGeida - 150] = room;
_vm->_gyro->_roomTime = 0; _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(); enterNewTown();
switch (room) { switch (room) {
case r__yours: case r__yours:
if (_vm->_gyro->_dna._avvyInBed) { if (_vm->_gyro->_avvyInBed) {
_vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
_vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts); _vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts);
@ -453,12 +453,12 @@ void Lucerna::enterRoom(byte room, byte ped) {
case r__outsideyours: case r__outsideyours:
if (ped > 0) { if (ped > 0) {
if (! _vm->_gyro->_dna._talkedToCrapulus) { if (! _vm->_gyro->_talkedToCrapulus) {
_vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours; _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours;
_vm->_animation->_sprites[1].init(8, false, _vm->_animation); // load Crapulus _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->appearPed(2, 4); // Start on the right-hand side of the screen.
_vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you. _vm->_animation->_sprites[1].walkTo(5); // Walks up to greet you.
} else { } else {
@ -471,32 +471,32 @@ void Lucerna::enterRoom(byte room, byte ped) {
} else _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere; } 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->_sprites[1].init(8, false, _vm->_animation);
_vm->_animation->appearPed(2, 2); _vm->_animation->appearPed(2, 2);
_vm->_animation->_sprites[1].walkTo(4); _vm->_animation->_sprites[1].walkTo(4);
_vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut); _vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut);
_vm->_gyro->_dna._crapulusWillTell = false; _vm->_gyro->_crapulusWillTell = false;
} }
} }
break; break;
case r__outsidespludwicks: 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->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion);
_vm->_gyro->_dna._spludwickAtHome = true; _vm->_gyro->_spludwickAtHome = true;
} }
break; break;
case r__spludwicks: case r__spludwicks:
if (_vm->_gyro->_dna._spludwickAtHome) { if (_vm->_gyro->_spludwickAtHome) {
if (ped > 0) { if (ped > 0) {
_vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick _vm->_animation->_sprites[1].init(2, false, _vm->_animation); // load Spludwick
_vm->_animation->appearPed(2, 2); _vm->_animation->appearPed(2, 2);
_vm->_gyro->_whereIs[1] = r__spludwicks; _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]._callEachStepFl = true;
_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida; _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcGeida;
@ -505,9 +505,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__brummieroad: case r__brummieroad:
if (_vm->_gyro->_dna._geidaFollows) if (_vm->_gyro->_geidaFollows)
putGeidaAt(5, ped); putGeidaAt(5, ped);
if (_vm->_gyro->_dna._cwytalotGone) { if (_vm->_gyro->_cwytalotGone) {
_vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing; _vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing;
_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere; _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere;
} else { } else {
@ -517,7 +517,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY; _vm->_animation->_sprites[1]._eachStepProc = Animation::kProcFollowAvvyY;
_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad; _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->appearPed(2, 2); // He appears on the right of the screen...
_vm->_animation->_sprites[1].walkTo(4); // ...and he walks up... _vm->_animation->_sprites[1].walkTo(4); // ...and he walks up...
} else { } else {
@ -530,31 +530,31 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__argentroad: case r__argentroad:
if ((_vm->_gyro->_dna._cwytalotGone) && (! _vm->_gyro->_dna._passedCwytalotInHerts) && (ped == 2) && if ((_vm->_gyro->_cwytalotGone) && (! _vm->_gyro->_passedCwytalotInHerts) && (ped == 2) &&
(_vm->_gyro->_dna._roomCount[r__argentroad] > 3)) { (_vm->_gyro->_roomCount[r__argentroad] > 3)) {
_vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again _vm->_animation->_sprites[1].init(4, false, _vm->_animation); // 4 = Cwytalot again
_vm->_animation->appearPed(2, 1); _vm->_animation->appearPed(2, 1);
_vm->_animation->_sprites[1].walkTo(2); _vm->_animation->_sprites[1].walkTo(2);
_vm->_animation->_sprites[1]._vanishIfStill = true; _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->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
_vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts); _vm->_timer->addTimer(20, Timer::kProcCwytalotInHerts, Timer::kReasonCwytalotInHerts);
} }
break; break;
case r__bridge: 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->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
_vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. _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 putGeidaAt(ped + 3, ped); // load Geida
break; break;
case r__robins: case r__robins:
if (ped > 0) { if (ped > 0) {
if (! _vm->_gyro->_dna._beenTiedUp) { if (! _vm->_gyro->_beenTiedUp) {
// A welcome party... or maybe not... // A welcome party... or maybe not...
_vm->_animation->_sprites[1].init(6, false, _vm->_animation); _vm->_animation->_sprites[1].init(6, false, _vm->_animation);
_vm->_animation->appearPed(2, 2); _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::kPeopleRobinHood - 150] = 0;
_vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0; _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 0;
} }
if (_vm->_gyro->_dna._tiedUp) if (_vm->_gyro->_tiedUp)
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
if (!_vm->_gyro->_dna._mushroomGrowing) if (!_vm->_gyro->_mushroomGrowing)
_vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
break; break;
case r__outsidecardiffcastle: case r__outsidecardiffcastle:
if (ped > 0) if (ped > 0)
switch (_vm->_gyro->_dna._cardiffQuestionNum) { switch (_vm->_gyro->_cardiffQuestionNum) {
case 0 : { // You've answered NONE of his questions. case 0 : { // You've answered NONE of his questions.
_vm->_animation->_sprites[1].init(9, false, _vm->_animation); _vm->_animation->_sprites[1].init(9, false, _vm->_animation);
_vm->_animation->appearPed(2, 2); _vm->_animation->appearPed(2, 2);
@ -596,8 +596,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey); _vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey);
} }
} }
if (_vm->_gyro->_dna._cardiffQuestionNum < 5) if (_vm->_gyro->_cardiffQuestionNum < 5)
_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum; _vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
else _vm->_gyro->_interrogation = 0; else _vm->_gyro->_interrogation = 0;
break; break;
@ -610,9 +610,9 @@ void Lucerna::enterRoom(byte room, byte ped) {
//setactivepage(1 - cp); //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->_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(); refreshObjectList();
} }
} }
@ -625,33 +625,33 @@ void Lucerna::enterRoom(byte room, byte ped) {
switch (ped) { switch (ped) {
case 3: { // Enter from oubliette case 3: { // Enter from oubliette
_vm->_gyro->_dna._catacombX = 8; _vm->_gyro->_catacombX = 8;
_vm->_gyro->_dna._catacombY = 4; _vm->_gyro->_catacombY = 4;
} }
break; break;
case 5: { // Enter from du Lustie's case 5: { // Enter from du Lustie's
_vm->_gyro->_dna._catacombX = 8; _vm->_gyro->_catacombX = 8;
_vm->_gyro->_dna._catacombY = 7; _vm->_gyro->_catacombY = 7;
} }
break; break;
case 6: { // Enter from Geida's case 6: { // Enter from Geida's
_vm->_gyro->_dna._catacombX = 4; _vm->_gyro->_catacombX = 4;
_vm->_gyro->_dna._catacombY = 1; _vm->_gyro->_catacombY = 1;
} }
break; break;
} }
_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = true; _vm->_gyro->_enterCatacombsFromLustiesRoom = true;
_vm->_animation->catacombMove(ped); _vm->_animation->catacombMove(ped);
_vm->_gyro->_dna._enterCatacombsFromLustiesRoom = false; _vm->_gyro->_enterCatacombsFromLustiesRoom = false;
} }
break; break;
case r__argentpub: case r__argentpub:
if (_vm->_gyro->_dna._wonNim) if (_vm->_gyro->_wonNim)
_vm->_celer->drawBackgroundSprite(-1, -1, 1); // No lute by the settle. _vm->_celer->drawBackgroundSprite(-1, -1, 1); // No lute by the settle.
_vm->_gyro->_dna._malagauche = 0; // Ready to boot Malagauche _vm->_gyro->_malagauche = 0; // Ready to boot Malagauche
if (_vm->_gyro->_dna._givenBadgeToIby) { if (_vm->_gyro->_givenBadgeToIby) {
_vm->_celer->drawBackgroundSprite(-1, -1, 8); _vm->_celer->drawBackgroundSprite(-1, -1, 8);
_vm->_celer->drawBackgroundSprite(-1, -1, 9); _vm->_celer->drawBackgroundSprite(-1, -1, 9);
} }
@ -659,16 +659,16 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__lustiesroom: 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 if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes
_vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks); _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. // Presumably, Avvy dressed as a monk.
_vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks); _vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks);
if (_vm->_gyro->_dna._geidaFollows) { if (_vm->_gyro->_geidaFollows) {
putGeidaAt(5, ped); putGeidaAt(5, ped);
if (_vm->_gyro->_dna._lustieIsAsleep) { if (_vm->_gyro->_lustieIsAsleep) {
_vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_celer->drawBackgroundSprite(-1, -1, 5);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
} }
@ -676,8 +676,8 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__musicroom: case r__musicroom:
if (_vm->_gyro->_dna._jacquesState > 0) { if (_vm->_gyro->_jacquesState > 0) {
_vm->_gyro->_dna._jacquesState = 5; _vm->_gyro->_jacquesState = 5;
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
_vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_celer->drawBackgroundSprite(-1, -1, 4);
@ -719,7 +719,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
case r__wisewomans: case r__wisewomans:
_vm->_animation->_sprites[1].init(11, false, _vm->_animation); _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->appearPed(2, 2); // Start on the right-hand side of the screen.
_vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you. _vm->_animation->_sprites[1].walkTo(4); // Walks up to greet you.
} else { } else {
@ -737,18 +737,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
_vm->_sequence->firstShow(1); _vm->_sequence->firstShow(1);
if (_vm->_gyro->_dna._arrowInTheDoor) if (_vm->_gyro->_arrowInTheDoor)
_vm->_sequence->thenShow(3); _vm->_sequence->thenShow(3);
else else
_vm->_sequence->thenShow(2); _vm->_sequence->thenShow(2);
if (_vm->_gyro->_dna._takenPen) if (_vm->_gyro->_takenPen)
_vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_celer->drawBackgroundSprite(-1, -1, 4);
_vm->_sequence->startToClose(); _vm->_sequence->startToClose();
} else { } else {
_vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_celer->drawBackgroundSprite(-1, -1, 1);
if (_vm->_gyro->_dna._arrowInTheDoor) if (_vm->_gyro->_arrowInTheDoor)
_vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_celer->drawBackgroundSprite(-1, -1, 3);
else else
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
@ -789,7 +789,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__aylesoffice: case r__aylesoffice:
if (_vm->_gyro->_dna._aylesIsAwake) if (_vm->_gyro->_aylesIsAwake)
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
break; // Ayles awake. break; // Ayles awake.
@ -800,18 +800,18 @@ void Lucerna::enterRoom(byte room, byte ped) {
case r__easthall: case r__easthall:
case r__westhall: case r__westhall:
if (_vm->_gyro->_dna._geidaFollows) if (_vm->_gyro->_geidaFollows)
putGeidaAt(ped + 2, ped); putGeidaAt(ped + 2, ped);
break; break;
case r__lusties: case r__lusties:
if (_vm->_gyro->_dna._geidaFollows) if (_vm->_gyro->_geidaFollows)
putGeidaAt(ped + 6, ped); putGeidaAt(ped + 6, ped);
break; break;
case r__nottspub: case r__nottspub:
if (_vm->_gyro->_dna._sittingInPub) _vm->_celer->drawBackgroundSprite(-1, -1, 3); if (_vm->_gyro->_sittingInPub) _vm->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos. _vm->_gyro->_dogFoodPos = 1; // Actually, du Lustie pos.
break; break;
case r__outsideducks: case r__outsideducks:
@ -828,7 +828,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
break; break;
case r__ducks: case r__ducks:
_vm->_gyro->_dna._dogFoodPos = 1; _vm->_gyro->_dogFoodPos = 1;
break; // Actually, Duck pos. break; // Actually, Duck pos.
} }
@ -921,7 +921,7 @@ void Lucerna::drawScore() {
if (_vm->_gyro->kDemo) if (_vm->_gyro->kDemo)
return; return;
uint16 score = _vm->_gyro->_dna._score; uint16 score = _vm->_gyro->_dnascore;
int8 numbers[3] = {0, 0, 0}; int8 numbers[3] = {0, 0, 0};
for (byte i = 0; i < 2; i++) { for (byte i = 0; i < 2; i++) {
byte divisor = 1; byte divisor = 1;
@ -947,7 +947,7 @@ void Lucerna::drawScore() {
void Lucerna::incScore(byte num) { // Add on no. of points void Lucerna::incScore(byte num) { // Add on no. of points
for (byte q = 1; q <= num; q++) { for (byte q = 1; q <= num; q++) {
_vm->_gyro->_dna._score++; _vm->_gyro->_dnascore++;
#if 0 #if 0
if (soundfx) { if (soundfx) {
@ -967,22 +967,22 @@ void Lucerna::useCompass(const Common::Point &cursorPos) {
switch (color) { switch (color) {
case kColorGreen: case kColorGreen:
_vm->_gyro->_dna._direction = Animation::kDirUp; _vm->_gyro->_direction = Animation::kDirUp;
_vm->_animation->changeDirection(0, Animation::kDirUp); _vm->_animation->changeDirection(0, Animation::kDirUp);
drawDirection(); drawDirection();
break; break;
case kColorBrown: case kColorBrown:
_vm->_gyro->_dna._direction = Animation::kDirDown; _vm->_gyro->_direction = Animation::kDirDown;
_vm->_animation->changeDirection(0, Animation::kDirDown); _vm->_animation->changeDirection(0, Animation::kDirDown);
drawDirection(); drawDirection();
break; break;
case kColorCyan: case kColorCyan:
_vm->_gyro->_dna._direction = Animation::kDirLeft; _vm->_gyro->_direction = Animation::kDirLeft;
_vm->_animation->changeDirection(0, Animation::kDirLeft); _vm->_animation->changeDirection(0, Animation::kDirLeft);
drawDirection(); drawDirection();
break; break;
case kColorLightmagenta: case kColorLightmagenta:
_vm->_gyro->_dna._direction = Animation::kDirRight; _vm->_gyro->_direction = Animation::kDirRight;
_vm->_animation->changeDirection(0, Animation::kDirRight); _vm->_animation->changeDirection(0, Animation::kDirRight);
drawDirection(); drawDirection();
break; break;
@ -1001,14 +1001,14 @@ void Lucerna::fxToggle() {
} }
void Lucerna::refreshObjectList() { void Lucerna::refreshObjectList() {
_vm->_gyro->_dna._carryNum = 0; _vm->_gyro->_carryNum = 0;
if (_vm->_gyro->_thinkThing && !_vm->_gyro->_dna._objects[_vm->_gyro->_thinks - 1]) if (_vm->_gyro->_thinkThing && !_vm->_gyro->_objects[_vm->_gyro->_thinks - 1])
thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money thinkAbout(Gyro::kObjectMoney, Gyro::kThing); // you always have money
for (byte i = 0; i < kObjectNum; i++) { for (byte i = 0; i < kObjectNum; i++) {
if (_vm->_gyro->_dna._objects[i]) { if (_vm->_gyro->_objects[i]) {
_vm->_gyro->_dna._carryNum++; _vm->_gyro->_carryNum++;
_vm->_gyro->_objectList[_vm->_gyro->_dna._carryNum] = i + 1; _vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1;
} }
} }
} }
@ -1017,7 +1017,7 @@ void Lucerna::refreshObjectList() {
* @remarks Originally called 'verte' * @remarks Originally called 'verte'
*/ */
void Lucerna::guideAvvy(Common::Point cursorPos) { void Lucerna::guideAvvy(Common::Point cursorPos) {
if (!_vm->_gyro->_dna._userMovesAvvy) if (!_vm->_gyro->_userMovesAvvy)
return; return;
cursorPos.y /= 2; cursorPos.y /= 2;
@ -1104,7 +1104,7 @@ void Lucerna::checkClick() {
_vm->_parser->plotText(); _vm->_parser->plotText();
} else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar. } else if ((340 <= cursorPos.y) && (cursorPos.y <= 399)) { // Check the toolbar.
if ((137 <= cursorPos.x) && (cursorPos.x <= 207)) { // Control Avvy with the compass. 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); useCompass(cursorPos);
} else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing. } else if ((208 <= cursorPos.x) && (cursorPos.x <= 260)) { // Examine the _thing.
do { do {
@ -1167,19 +1167,19 @@ void Lucerna::dawn() {
} }
void Lucerna::drawDirection() { // It's data is loaded in load_digits(). 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; return;
_vm->_gyro->_oldDirection = _vm->_gyro->_dna._direction; _vm->_gyro->_oldDirection = _vm->_gyro->_direction;
CursorMan.showMouse(false); 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); CursorMan.showMouse(true);
} }
void Lucerna::gameOver() { void Lucerna::gameOver() {
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
int16 sx = _vm->_animation->_sprites[0]._x; int16 sx = _vm->_animation->_sprites[0]._x;
int16 sy = _vm->_animation->_sprites[0]._y; int16 sy = _vm->_animation->_sprites[0]._y;
@ -1196,7 +1196,7 @@ void Lucerna::gameOver() {
void Lucerna::minorRedraw() { void Lucerna::minorRedraw() {
dusk(); 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++) for (byte i = 0; i < 3; i++)
_vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits _vm->_gyro->_scoreToDisplay[i] = -1; // impossible digits

View file

@ -561,19 +561,19 @@ void Scrolls::setBubbleStateNatural() {
Common::String Scrolls::displayMoney() { Common::String Scrolls::displayMoney() {
Common::String result; Common::String result;
if (_vm->_gyro->_dna._money < 12) { // just pence if (_vm->_gyro->_money < 12) { // just pence
result = Common::String::format("%dd", _vm->_gyro->_dna._money); result = Common::String::format("%dd", _vm->_gyro->_money);
} else if (_vm->_gyro->_dna._money < 240) { // shillings & pence } else if (_vm->_gyro->_money < 240) { // shillings & pence
if ((_vm->_gyro->_dna._money % 12) == 0) if ((_vm->_gyro->_money % 12) == 0)
result = Common::String::format("%d/-", _vm->_gyro->_dna._money / 12); result = Common::String::format("%d/-", _vm->_gyro->_money / 12);
else 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 } else { // L, s & d
result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_dna._money / 240, (_vm->_gyro->_dna._money / 12) % 20, result = Common::String::format("\x9C%d.%d.%d", _vm->_gyro->_money / 240, (_vm->_gyro->_money / 12) % 20,
_vm->_gyro->_dna._money % 12); _vm->_gyro->_money % 12);
} }
if (_vm->_gyro->_dna._money > 12) { if (_vm->_gyro->_money > 12) {
Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_dna._money); Common::String extraStr = Common::String::format(" (that's %dd)", _vm->_gyro->_money);
result += extraStr; result += extraStr;
} }
@ -703,45 +703,45 @@ void Scrolls::callScrollDriver() {
displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion) displayText(displayMoney() + kControlToBuffer); // Insert cash balance. (Recursion)
break; break;
case 2: { 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); displayText(_vm->_acci->kVocabulary[pwdId]._word + kControlToBuffer);
} }
break; break;
case 3: case 3:
displayText(_vm->_gyro->_dna._favouriteDrink + kControlToBuffer); displayText(_vm->_gyro->_favouriteDrink + kControlToBuffer);
break; break;
case 4: case 4:
displayText(_vm->_gyro->_dna._favouriteSong + kControlToBuffer); displayText(_vm->_gyro->_favouriteSong + kControlToBuffer);
break; break;
case 5: case 5:
displayText(_vm->_gyro->_dna._worstPlaceOnEarth + kControlToBuffer); displayText(_vm->_gyro->_worstPlaceOnEarth + kControlToBuffer);
break; break;
case 6: case 6:
displayText(_vm->_gyro->_dna._spareEvening + kControlToBuffer); displayText(_vm->_gyro->_spareEvening + kControlToBuffer);
break; break;
case 9: { 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); displayText(tmpStr);
} }
break; break;
case 10: case 10:
switch (_vm->_gyro->_dna._boxContent) { switch (_vm->_gyro->_boxContent) {
case 0: // Sixpence. case 0: // Sixpence.
_vm->_visa->displayScrollChain('q', 37); // You find the sixpence. _vm->_visa->displayScrollChain('q', 37); // You find the sixpence.
_vm->_gyro->_dna._money += 6; _vm->_gyro->_money += 6;
_vm->_gyro->_dna._boxContent = _vm->_acci->kNothing; _vm->_gyro->_boxContent = _vm->_acci->kNothing;
_vm->_lucerna->incScore(2); _vm->_lucerna->incScore(2);
return; return;
case Acci::kNothing: case Acci::kNothing:
displayText("nothing at all. It's completely empty."); displayText("nothing at all. It's completely empty.");
break; break;
default: default:
displayText(_vm->_gyro->getItem(_vm->_gyro->_dna._boxContent) + '.'); displayText(_vm->_gyro->getItem(_vm->_gyro->_boxContent) + '.');
} }
break; break;
case 11: case 11:
for (byte j = 0; j < kObjectNum; j++) { for (byte j = 0; j < kObjectNum; j++) {
if (_vm->_gyro->_dna._objects[j]) if (_vm->_gyro->_objects[j])
displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer); displayText(_vm->_gyro->getItem(j) + ", " + kControlToBuffer);
} }
break; break;

View file

@ -64,8 +64,8 @@ void Sequence::thenShow(byte what) {
void Sequence::thenFlip(byte where, byte ped) { void Sequence::thenFlip(byte where, byte ped) {
thenShow(kNowFlip); thenShow(kNowFlip);
_vm->_gyro->_dna._flipToWhere = where; _vm->_gyro->_flipToWhere = where;
_vm->_gyro->_dna._flipToPed = ped; _vm->_gyro->_flipToPed = ped;
} }
void Sequence::startToClose() { void Sequence::startToClose() {
@ -74,7 +74,7 @@ void Sequence::startToClose() {
} }
void Sequence::startToOpen() { 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. _vm->_animation->stopWalking(); // And they're not moving now.
startToClose(); // Apart from that, it's the same thing. startToClose(); // Apart from that, it's the same thing.
} }
@ -89,8 +89,8 @@ void Sequence::callSequencer() {
return; // No more routines. return; // No more routines.
break; break;
case 177: // Flip room. case 177: // Flip room.
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
_vm->_animation->flipRoom(_vm->_gyro->_dna._flipToWhere, _vm->_gyro->_dna._flipToPed); _vm->_animation->flipRoom(_vm->_gyro->_flipToWhere, _vm->_gyro->_flipToPed);
if (_seq[0] == 177) if (_seq[0] == 177)
shoveLeft(); shoveLeft();
break; break;

View file

@ -220,7 +220,7 @@ void Timer::updateTimer() {
} }
} }
_vm->_gyro->_roomTime++; // Cycles since you've been in this room. _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) { void Timer::loseTimer(byte which) {
@ -233,20 +233,20 @@ void Timer::loseTimer(byte which) {
} }
void Timer::openDrawbridge() { void Timer::openDrawbridge() {
_vm->_gyro->_dna._drawbridgeOpen++; _vm->_gyro->_drawbridgeOpen++;
_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1); _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. _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge.
else else
addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls); addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
} }
void Timer::avariciusTalks() { void Timer::avariciusTalks() {
_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk); _vm->_visa->displayScrollChain('q', _vm->_gyro->_avariciusTalk);
_vm->_gyro->_dna._avariciusTalk++; _vm->_gyro->_avariciusTalk++;
if (_vm->_gyro->_dna._avariciusTalk < 17) if (_vm->_gyro->_avariciusTalk < 17)
addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks); addTimer(177, kProcAvariciusTalks, kReasonAvariciusTalks);
else else
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
@ -277,20 +277,20 @@ void Timer::stairs() {
_vm->_gyro->blip(); _vm->_gyro->blip();
_vm->_animation->_sprites[0].walkTo(4); _vm->_animation->_sprites[0].walkTo(4);
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _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]._operation = Gyro::kMagicSpecial;
_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs. _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.) _vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // Stop them hitting the sides (or the game will hang.)
} }
void Timer::cardiffSurvey() { void Timer::cardiffSurvey() {
if (_vm->_gyro->_dna._cardiffQuestionNum == 0) { if (_vm->_gyro->_cardiffQuestionNum == 0) {
_vm->_gyro->_dna._cardiffQuestionNum++; _vm->_gyro->_cardiffQuestionNum++;
_vm->_visa->displayScrollChain('q', 27); _vm->_visa->displayScrollChain('q', 27);
} }
_vm->_visa->displayScrollChain('z', _vm->_gyro->_dna._cardiffQuestionNum); _vm->_visa->displayScrollChain('z', _vm->_gyro->_cardiffQuestionNum);
_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum; _vm->_gyro->_interrogation = _vm->_gyro->_cardiffQuestionNum;
addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey); addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
} }
@ -305,8 +305,8 @@ void Timer::cwytalotInHerts() {
void Timer::getTiedUp() { void Timer::getTiedUp() {
_vm->_visa->displayScrollChain('q', 34); // ...Trouble! _vm->_visa->displayScrollChain('q', 34); // ...Trouble!
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
_vm->_gyro->_dna._beenTiedUp = true; _vm->_gyro->_beenTiedUp = true;
_vm->_animation->stopWalking(); _vm->_animation->stopWalking();
_vm->_animation->_sprites[1].stopWalk(); _vm->_animation->_sprites[1].stopWalk();
_vm->_animation->_sprites[1].stopHoming(); _vm->_animation->_sprites[1].stopHoming();
@ -319,7 +319,7 @@ void Timer::getTiedUp2() {
_vm->_animation->_sprites[0].walkTo(4); _vm->_animation->_sprites[0].walkTo(4);
_vm->_animation->_sprites[1].walkTo(5); _vm->_animation->_sprites[1].walkTo(5);
_vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries. _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() { void Timer::hangAround() {
@ -344,20 +344,20 @@ void Timer::hangAround2() {
addTimer(1, kProcAfterTheShootemup, kReasonHangingAround); addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
// Immediately call the following proc (when you have a chance). // 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. _vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
} }
void Timer::afterTheShootemup() { 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! // 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->_sprites[0].init(0, true, _vm->_animation); // Avalot.
_vm->_animation->appearPed(1, 2); _vm->_animation->appearPed(1, 2);
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
_vm->_gyro->_dna._objects[Gyro::kObjectCrossbow - 1] = true; _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
// Same as the added line above: TODO: Remove it later!!! // Same as the added line above: TODO: Remove it later!!!
@ -386,9 +386,9 @@ void Timer::afterTheShootemup() {
} }
void Timer::jacquesWakesUp() { 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 : case 1 :
_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open. _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
_vm->_visa->displayScrollChain('Q', 45); _vm->_visa->displayScrollChain('Q', 45);
@ -405,13 +405,13 @@ void Timer::jacquesWakesUp() {
break; break;
} }
if (_vm->_gyro->_dna._jacquesState == 5) { if (_vm->_gyro->_jacquesState == 5) {
_vm->_gyro->_dna._bellsAreRinging = true; _vm->_gyro->_bellsAreRinging = true;
_vm->_gyro->_dna._aylesIsAwake = true; _vm->_gyro->_aylesIsAwake = true;
_vm->_lucerna->incScore(2); _vm->_lucerna->incScore(2);
} }
switch (_vm->_gyro->_dna._jacquesState) { switch (_vm->_gyro->_jacquesState) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
@ -450,9 +450,9 @@ void Timer::naughtyDuke3() {
} }
void Timer::jump() { void Timer::jump() {
_vm->_gyro->_dna._jumpStatus++; _vm->_gyro->_jumpStatus++;
switch (_vm->_gyro->_dna._jumpStatus) { switch (_vm->_gyro->_jumpStatus) {
case 1: case 1:
case 2: case 2:
case 3: case 3:
@ -471,24 +471,24 @@ void Timer::jump() {
break; break;
} }
if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump. if (_vm->_gyro->_jumpStatus == 20) { // End of jump.
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
_vm->_gyro->_dna._jumpStatus = 0; _vm->_gyro->_jumpStatus = 0;
} else { // Still jumping. } else { // Still jumping.
addTimer(1, kProcJump, kReasonJumping); addTimer(1, kProcJump, kReasonJumping);
} }
if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump. if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump.
&& (_vm->_gyro->_dna._room == r__insidecardiffcastle) && (_vm->_gyro->_room == r__insidecardiffcastle)
&& (_vm->_gyro->_dna._arrowInTheDoor == true) && (_vm->_gyro->_arrowInTheDoor == true)
&& (_vm->_animation->inField(3))) { // Beside the wall && (_vm->_animation->inField(3))) { // Beside the wall
// Grab the arrow! // 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."); _vm->_scrolls->displayText("You fail to grab it, because your hands are full.");
else { else {
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it. _vm->_gyro->_arrowInTheDoor = false; // You've got it.
_vm->_gyro->_dna._objects[Gyro::kObjectBolt - 1] = true; _vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_visa->displayScrollChain('q', 50); _vm->_visa->displayScrollChain('q', 50);
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
@ -498,14 +498,14 @@ void Timer::jump() {
void Timer::crapulusSaysSpludOut() { void Timer::crapulusSaysSpludOut() {
_vm->_visa->displayScrollChain('q', 56); _vm->_visa->displayScrollChain('q', 56);
_vm->_gyro->_dna._crapulusWillTell = false; _vm->_gyro->_crapulusWillTell = false;
} }
void Timer::buyDrinks() { void Timer::buyDrinks() {
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. _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->_pingo->wobble(); // Do the special effects.
_vm->_visa->displayScrollChain('D', 1); // That'll be thruppence. _vm->_visa->displayScrollChain('D', 1); // That'll be thruppence.
if (_vm->_gyro->decreaseMoney(3)) // Pay 3d. if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
@ -515,15 +515,15 @@ void Timer::buyDrinks() {
void Timer::buyWine() { void Timer::buyWine() {
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. _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', 50); // You buy the wine.
_vm->_visa->displayScrollChain('D', 1); // It'll be thruppence. _vm->_visa->displayScrollChain('D', 1); // It'll be thruppence.
if (_vm->_gyro->decreaseMoney(3)) { if (_vm->_gyro->decreaseMoney(3)) {
_vm->_visa->displayScrollChain('D', 4); // You paid up. _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->_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() { void Timer::greetsMonk() {
_vm->_visa->displayScrollChain('Q', 59); _vm->_visa->displayScrollChain('Q', 59);
_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true; _vm->_gyro->_enteredLustiesRoomAsMonk = true;
} }
void Timer::fallDownOubliette() { void Timer::fallDownOubliette() {
@ -545,13 +545,13 @@ void Timer::fallDownOubliette() {
} }
void Timer::meetAvaroid() { 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); 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->_scrolls->displayText(tmpStr);
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
} else { } else {
_vm->_visa->displayScrollChain('Q', 60); _vm->_visa->displayScrollChain('Q', 60);
_vm->_gyro->_dna._metAvaroid = true; _vm->_gyro->_metAvaroid = true;
addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette); addTimer(1, kProcRiseUpOubliette, kReasonRisingUpOubliette);
_vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft; _vm->_animation->_sprites[0]._facingDir = Animation::kDirLeft;
@ -570,7 +570,7 @@ void Timer::riseUpOubliette() {
if (_vm->_animation->_sprites[0]._moveY > 0) if (_vm->_animation->_sprites[0]._moveY > 0)
addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette); addTimer(3, kProcRiseUpOubliette, kReasonRisingUpOubliette);
else else
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_userMovesAvvy = true;
} }
void Timer::robinHoodAndGeida() { void Timer::robinHoodAndGeida() {
@ -580,7 +580,7 @@ void Timer::robinHoodAndGeida() {
_vm->_animation->_sprites[1].stopWalk(); _vm->_animation->_sprites[1].stopWalk();
_vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft; _vm->_animation->_sprites[1]._facingDir = Animation::kDirLeft;
addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida); addTimer(20, kProcRobinHoodAndGeidaTalk, kReasonRobinHoodAndGeida);
_vm->_gyro->_dna._geidaFollows = false; _vm->_gyro->_geidaFollows = false;
} }
void Timer::robinHoodAndGeidaTalk() { void Timer::robinHoodAndGeidaTalk() {
@ -598,7 +598,7 @@ void Timer::avalotReturns() {
_vm->_animation->_sprites[0].init(0, true, _vm->_animation); _vm->_animation->_sprites[0].init(0, true, _vm->_animation);
_vm->_animation->appearPed(1, 1); _vm->_animation->appearPed(1, 1);
_vm->_visa->displayScrollChain('q', 67); _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); addTimer(1, kProcAvvySitDown, kReasonSittingDown);
else { else {
_vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_gyro->_dna._sittingInPub = true; _vm->_gyro->_sittingInPub = true;
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_userMovesAvvy = false;
_vm->_animation->_sprites[0]._visible = false; _vm->_animation->_sprites[0]._visible = false;
} }
} }
@ -623,7 +623,7 @@ void Timer::ghostRoomPhew() {
} }
void Timer::arkataShouts() { void Timer::arkataShouts() {
if (_vm->_gyro->_dna._teetotal) if (_vm->_gyro->_teetotal)
return; return;
_vm->_visa->displayScrollChain('q', 76); _vm->_visa->displayScrollChain('q', 76);
@ -676,7 +676,7 @@ void Timer::spludwickLeavesCauldron() {
void Timer::giveLuteToGeida() { // Moved here from Acci. void Timer::giveLuteToGeida() { // Moved here from Acci.
_vm->_visa->displayScrollChain('Q', 86); _vm->_visa->displayScrollChain('Q', 86);
_vm->_lucerna->incScore(4); _vm->_lucerna->incScore(4);
_vm->_gyro->_dna._lustieIsAsleep = true; _vm->_gyro->_lustieIsAsleep = true;
_vm->_sequence->firstShow(5); _vm->_sequence->firstShow(5);
_vm->_sequence->thenShow(6); // He falls asleep... _vm->_sequence->thenShow(6); // He falls asleep...
_vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure. _vm->_sequence->startToClose(); // Not really closing, but we're using the same procedure.

View file

@ -159,19 +159,19 @@ void Visa::talkTo(byte whom) {
if (_vm->_gyro->_subjectNum == 0) { if (_vm->_gyro->_subjectNum == 0) {
switch (whom) { switch (whom) {
case Gyro::kPeopleSpludwick: 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); displayScrollChain('q', 68);
_vm->_gyro->_dna._objects[Gyro::kObjectPotion - 1] = true; _vm->_gyro->_objects[Gyro::kObjectPotion - 1] = true;
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
return; return;
} else if (_vm->_gyro->_dna._talkedToCrapulus) { } else if (_vm->_gyro->_talkedToCrapulus) {
// Spludwick - what does he need? // Spludwick - what does he need?
// 0 - let it through to use normal routine. // 0 - let it through to use normal routine.
switch (_vm->_gyro->_dna._givenToSpludwick) { switch (_vm->_gyro->_givenToSpludwick) {
case 1: // Fallthrough is intended. case 1: // Fallthrough is intended.
case 2: { 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); 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); _vm->_scrolls->displayText(tmpStr);
} }
@ -186,23 +186,23 @@ void Visa::talkTo(byte whom) {
} }
break; break;
case Gyro::kPeopleIbythneth: case Gyro::kPeopleIbythneth:
if (_vm->_gyro->_dna._givenBadgeToIby) { if (_vm->_gyro->_givenBadgeToIby) {
displayScrollChain('q', 33); // Thanks a lot! displayScrollChain('q', 33); // Thanks a lot!
return; // And leave the proc. return; // And leave the proc.
} }
break; // Or... just continue, 'cos he hasn't got it. break; // Or... just continue, 'cos he hasn't got it.
case Gyro::kPeopleDogfood: 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!" displayScrollChain('q', 6); // "I'm Not Playing!"
return; // Zap back. return; // Zap back.
} else } else
_vm->_gyro->_dna._askedDogfoodAboutNim = true; _vm->_gyro->_askedDogfoodAboutNim = true;
break; break;
case Gyro::kPeopleAyles: case Gyro::kPeopleAyles:
if (!_vm->_gyro->_dna._aylesIsAwake) { if (!_vm->_gyro->_aylesIsAwake) {
displayScrollChain('q', 43); // He's fast asleep! displayScrollChain('q', 43); // He's fast asleep!
return; return;
} else if (!_vm->_gyro->_dna._givenPenToAyles) { } else if (!_vm->_gyro->_givenPenToAyles) {
displayScrollChain('q', 44); // Can you get me a pen, Avvy? displayScrollChain('q', 44); // Can you get me a pen, Avvy?
return; return;
} }
@ -213,29 +213,29 @@ void Visa::talkTo(byte whom) {
return; return;
case Gyro::kPeopleGeida: case Gyro::kPeopleGeida:
if (_vm->_gyro->_dna._givenPotionToGeida) if (_vm->_gyro->_givenPotionToGeida)
_vm->_gyro->_dna._geidaFollows = true; _vm->_gyro->_geidaFollows = true;
else { else {
displayScrollChain('u', 17); displayScrollChain('u', 17);
return; return;
} }
break; break;
case Gyro::kPeopleSpurge: case Gyro::kPeopleSpurge:
if (!_vm->_gyro->_dna._sittingInPub) { if (!_vm->_gyro->_sittingInPub) {
displayScrollChain('q', 71); // Try going over and sitting down. displayScrollChain('q', 71); // Try going over and sitting down.
return; return;
} else { } else {
if (_vm->_gyro->_dna._spurgeTalkCount < 5) if (_vm->_gyro->_spurgeTalkCount < 5)
_vm->_gyro->_dna._spurgeTalkCount++; _vm->_gyro->_spurgeTalkCount++;
if (_vm->_gyro->_dna._spurgeTalkCount > 1) { // no. 1 falls through if (_vm->_gyro->_spurgeTalkCount > 1) { // no. 1 falls through
displayScrollChain('q', 70 + _vm->_gyro->_dna._spurgeTalkCount); displayScrollChain('q', 70 + _vm->_gyro->_spurgeTalkCount);
return; return;
} }
} }
break; break;
} }
// On a subject. Is there any reason to block it? // 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! displayScrollChain('q', 43); // He's fast asleep!
return; return;
} }
@ -264,10 +264,10 @@ void Visa::talkTo(byte whom) {
displayScrollChain('n', whom); // File not found! displayScrollChain('n', whom); // File not found!
if ((_vm->_gyro->_subjectNum == 0) && ((whom + 149) == Gyro::kPeopleCrapulus)) { // Crapulus: get the badge - first time only 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(); _vm->_lucerna->refreshObjectList();
displayScrollChain('q', 1); // Circular from Cardiff. 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->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off.
_vm->_animation->_sprites[1]._vanishIfStill = true; _vm->_animation->_sprites[1]._vanishIfStill = true;