aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/animation.cpp18
-rw-r--r--engines/avalanche/animation.h1
-rw-r--r--engines/avalanche/avalanche.h2
-rw-r--r--engines/avalanche/avalot.cpp36
-rw-r--r--engines/avalanche/dialogs.cpp67
-rw-r--r--engines/avalanche/dialogs.h3
-rw-r--r--engines/avalanche/parser.cpp60
-rw-r--r--engines/avalanche/parser.h2
8 files changed, 95 insertions, 94 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 08fe32085f..e87341509a 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -32,6 +32,20 @@
namespace Avalanche {
+// Art gallery at 2,1; notice about this at 2,2.
+const int32 Animation::kCatacombMap[8][8] = {
+ // Geida's room
+ // 1 2 3 4 5 6 7 8
+ {0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
+ {0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
+ {0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
+ {0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, // >> Oubliette
+ {0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
+ {0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
+ {0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, // <<< In here
+ {0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
+};
+
/**
* Loads & sets up the sprite.
*/
@@ -456,7 +470,7 @@ void Animation::catacombMove(byte ped) {
if (!_vm->_enterCatacombsFromLustiesRoom)
_vm->loadRoom(29);
- int32 here = _vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
+ int32 here = kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1];
switch (here & 0xf) { // West.
case 0: // no connection (wall)
@@ -842,7 +856,7 @@ void Animation::callSpecial(uint16 which) {
catacombMove(4);
if (_vm->_room != kRoomCatacombs)
return;
- switch ((_vm->kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1] & 0xf00) >> 8) {
+ switch ((kCatacombMap[_vm->_catacombY - 1][_vm->_catacombX - 1] & 0xf00) >> 8) {
case 0x1:
appearPed(0, 11);
break;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 2669c999aa..ad70645036 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -135,6 +135,7 @@ public:
private:
Direction _direction; // The direction Avvy is currently facing.
Direction _oldDirection;
+ static const int32 kCatacombMap[8][8];
bool _arrowTriggered; // And has the arrow been triggered?
bool _mustExclaim;
byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index e9d2b1e116..7141d3cfa4 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -167,9 +167,7 @@ public:
// These following static constants should be included in CFG when it's written.
static const int16 kWalk = 3;
static const int16 kRun = 5;
- static const int32 kCatacombMap[8][8];
static const char kSpludwicksOrder[3];
- static const QuasipedType kQuasipeds[16];
static const uint16 kNotes[12];
static const TuneType kTune;
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 2da1aeaa2d..f74239c164 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -36,19 +36,6 @@
namespace Avalanche {
-// Art gallery at 2,1; notice about this at 2,2.
-const int32 AvalancheEngine::kCatacombMap[8][8] = {
- // Geida's room
- // 1 2 3 4 5 6 7 8
- {0x204, 0x200, 0xd0f0, 0xf0ff, 0xff, 0xd20f, 0xd200, 0x200},
- {0x50f1, 0x20ff, 0x2ff, 0xff, 0xe0ff, 0x20ff, 0x200f, 0x7210},
- {0xe3f0, 0xe10f, 0x72f0, 0xff, 0xe0ff, 0xff, 0xff, 0x800f},
- {0x2201, 0x2030, 0x800f, 0x220, 0x20f, 0x30, 0xff, 0x23f}, // >> Oubliette
- {0x5024, 0xf3, 0xff, 0x200f, 0x22f0, 0x20f, 0x200, 0x7260},
- {0xf0, 0x2ff, 0xe2ff, 0xff, 0x200f, 0x50f0, 0x72ff, 0x201f},
- {0xf6, 0x220f, 0x22f0, 0x30f, 0xf0, 0x20f, 0x8200, 0x2f0}, // <<< In here
- {0x34, 0x200f, 0x51f0, 0x201f, 0xf1, 0x50ff, 0x902f, 0x2062}
-};
// vv Stairs trap.
/* Explanation: $NSEW.
@@ -88,29 +75,6 @@ const int32 AvalancheEngine::kCatacombMap[8][8] = {
F = straight-through corridor. */
const char AvalancheEngine::kSpludwicksOrder[3] = {kObjectOnion, kObjectInk, kObjectMushroom};
-
-// A quasiped defines how people who aren't sprites talk. For example, quasiped
-// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
-const QuasipedType AvalancheEngine::kQuasipeds[16] = {
-//_whichPed, _foregroundColor, _room, _backgroundColor, _who
- {1, kColorLightgray, kRoomArgentPub, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
- {2, kColorGreen, kRoomArgentPub, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
- {2, kColorWhite, kRoomYours, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
- {2, kColorBlack, kRoomLustiesRoom, kColorRed, kPeopleInvisible}, // D: Hawk (screen 23).
- {2, kColorLightgreen, kRoomOutsideDucks, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
- {5, kColorYellow, kRoomRobins, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
- {1, kColorBlue, kRoomAylesOffice, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
- {1, kColorBrown, kRoomMusicRoom, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
- {1, kColorLightgreen, kRoomNottsPub, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
- {2, kColorYellow, kRoomNottsPub, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
- {1, kColorLightgray, kRoomLustiesRoom, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
- {1, kColorYellow, kRoomOubliette, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
- {2, kColorWhite, kRoomOubliette, kColorRed, kPeopleInvisible}, // M: Avaroid (screen 27).
- {3, kColorLightgray, kRoomArgentPub, kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
- {4, kColorLightmagenta, kRoomNottsPub, kColorRed, kPeoplePort}, // O: Port (screen 47).
- {1, kColorLightgreen, kRoomDucks, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
-};
-
const uint16 AvalancheEngine::kNotes[12] = {196, 220, 247, 262, 294, 330, 350, 392, 440, 494, 523, 587};
const TuneType AvalancheEngine::kTune = {
kPitchHigher, kPitchHigher, kPitchLower, kPitchSame, kPitchHigher, kPitchHigher, kPitchLower, kPitchHigher, kPitchHigher, kPitchHigher,
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index e126e5ec80..97c7869804 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -34,6 +34,28 @@
namespace Avalanche {
+// A quasiped defines how people who aren't sprites talk. For example, quasiped
+// "A" is Dogfood. The rooms aren't stored because I'm leaving that to context.
+const QuasipedType Dialogs::kQuasipeds[16] = {
+ //_whichPed, _foregroundColor, _room, _backgroundColor, _who
+ {1, kColorLightgray, kRoomArgentPub, kColorBrown, kPeopleDogfood}, // A: Dogfood (screen 19).
+ {2, kColorGreen, kRoomArgentPub, kColorWhite, kPeopleIbythneth}, // B: Ibythneth (screen 19).
+ {2, kColorWhite, kRoomYours, kColorMagenta, kPeopleArkata}, // C: Arkata (screen 1).
+ {2, kColorBlack, kRoomLustiesRoom, kColorRed, kPeopleInvisible}, // D: Hawk (screen 23).
+ {2, kColorLightgreen, kRoomOutsideDucks, kColorBrown, kPeopleTrader}, // E: Trader (screen 50).
+ {5, kColorYellow, kRoomRobins, kColorRed, kPeopleAvalot}, // F: Avvy, tied up (scr.42)
+ {1, kColorBlue, kRoomAylesOffice, kColorWhite, kPeopleAyles}, // G: Ayles (screen 16).
+ {1, kColorBrown, kRoomMusicRoom, kColorWhite, kPeopleJacques}, // H: Jacques (screen 7).
+ {1, kColorLightgreen, kRoomNottsPub, kColorGreen, kPeopleSpurge}, // I: Spurge (screen 47).
+ {2, kColorYellow, kRoomNottsPub, kColorRed, kPeopleAvalot}, // J: Avalot (screen 47).
+ {1, kColorLightgray, kRoomLustiesRoom, kColorBlack, kPeopleDuLustie}, // K: du Lustie (screen 23).
+ {1, kColorYellow, kRoomOubliette, kColorRed, kPeopleAvalot}, // L: Avalot (screen 27).
+ {2, kColorWhite, kRoomOubliette, kColorRed, kPeopleInvisible}, // M: Avaroid (screen 27).
+ {3, kColorLightgray, kRoomArgentPub, kColorDarkgray, kPeopleMalagauche},// N: Malagauche (screen 19).
+ {4, kColorLightmagenta, kRoomNottsPub, kColorRed, kPeoplePort}, // O: Port (screen 47).
+ {1, kColorLightgreen, kRoomDucks, kColorDarkgray, kPeopleDrDuck} // P: Duck (screen 51).
+};
+
Dialogs::Dialogs(AvalancheEngine *vm) {
_vm = vm;
_noError = true;
@@ -676,11 +698,11 @@ void Dialogs::callDialogDriver() {
// Quasi-peds. (This routine performs the same
// thing with QPs as triptype.chatter does with the
// sprites.)
- PedType *quasiPed = &_vm->_peds[_vm->kQuasipeds[_param - 10]._whichPed];
+ PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed];
_vm->_talkX = quasiPed->_x;
_vm->_talkY = quasiPed->_y; // Position.
- _vm->_graphics->setDialogColor(_vm->kQuasipeds[_param - 10]._backgroundColor, _vm->kQuasipeds[_param - 10]._textColor);
+ _vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);
} else {
_vm->errorLed(); // Not valid.
setBubbleStateNatural();
@@ -1095,4 +1117,45 @@ void Dialogs::sayIt(Common::String str) {
Common::String tmpStr = Common::String::format("%c1%s.%c%c2", kControlRegister, x.c_str(), kControlSpeechBubble, kControlRegister);
displayText(tmpStr);
}
+
+Common::String Dialogs::personSpeaks() {
+ if ((_vm->_parser->_person == kPeoplePardon) || (_vm->_parser->_person == kPeopleNone)) {
+ if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room))
+ _vm->_parser->_person = _vm->_her;
+ else
+ _vm->_parser->_person = _vm->_him;
+ }
+
+ if (_vm->getRoom(_vm->_parser->_person) != _vm->_room) {
+ return Common::String::format("%c1", kControlRegister); // Avvy himself!
+ }
+
+ bool found = false; // The _person we're looking for's code is in _person.
+ Common::String tmpStr;
+
+ for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
+ if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _vm->_parser->_person)) {
+ tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
+ found = true;
+ }
+ }
+
+ if (found)
+ return tmpStr;
+
+ for (int i = 0; i < 16; i++) {
+ if ((kQuasipeds[i]._who == _vm->_parser->_person) && (kQuasipeds[i]._room == _vm->_room))
+ tmpStr += Common::String::format("%c%c", kControlRegister, 'A' + i);
+ }
+
+ return tmpStr;
+}
+
+void Dialogs::heyThanks(byte thing) {
+ Common::String tmpStr = personSpeaks();
+ tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
+ displayText(tmpStr);
+ _vm->_objects[thing] = false;
+}
+
} // End of namespace Avalanche
diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h
index 7263c47075..1026637644 100644
--- a/engines/avalanche/dialogs.h
+++ b/engines/avalanche/dialogs.h
@@ -54,6 +54,8 @@ public:
void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false);
void talkTo(byte whom);
void sayIt(Common::String str);
+ Common::String personSpeaks();
+ void heyThanks(byte thing);
private:
AvalancheEngine *_vm;
@@ -64,6 +66,7 @@ private:
};
static const int16 kHalfIconWidth = 19;
+ static const QuasipedType kQuasipeds[16];
Common::String _scroll[15];
Common::Point _dodgeCoord;
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index b9b179506b..aa1324ede9 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -1578,46 +1578,6 @@ void Parser::winSequence() {
_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
}
-Common::String Parser::personSpeaks() {
- if ((_person == kPeoplePardon) || (_person == kPeopleNone)) {
- if ((_vm->_him == kPeoplePardon) || (_vm->getRoom(_vm->_him) != _vm->_room))
- _person = _vm->_her;
- else
- _person = _vm->_him;
- }
-
- if (_vm->getRoom(_person) != _vm->_room) {
- return Common::String::format("%c1", kControlRegister); // Avvy himself!
- }
-
- bool found = false; // The _person we're looking for's code is in _person.
- Common::String tmpStr;
-
- for (int i = 0; i < _vm->_animation->kSpriteNumbMax; i++) {
- if (_vm->_animation->_sprites[i]._quick && ((_vm->_animation->_sprites[i]._stat._acciNum + 149) == _person)) {
- tmpStr += Common::String::format("%c%c", kControlRegister, '1' + i);
- found = true;
- }
- }
-
- if (found)
- return tmpStr;
-
- for (int i = 0; i < 16; i++) {
- if ((_vm->kQuasipeds[i]._who == _person) && (_vm->kQuasipeds[i]._room == _vm->_room))
- tmpStr += Common::String::format("%c%c", kControlRegister, 'A' + i);
- }
-
- return tmpStr;
-}
-
-void Parser::heyThanks() {
- Common::String tmpStr = personSpeaks();
- tmpStr += Common::String::format("Hey, thanks!%c(But now, you've lost it!)", kControlSpeechBubble);
- _vm->_dialogs->displayText(tmpStr);
- _vm->_objects[_thing - 1] = false;
-}
-
/**
* @remarks Originally called 'do_that'
*/
@@ -1734,17 +1694,17 @@ void Parser::doThat() {
_vm->_dialogs->displayText("Crapulus grabs the wine and gulps it down.");
_vm->_objects[kObjectWine - 1] = false;
} else
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
break;
case kPeopleCwytalot:
if ((_thing == kObjectCrossbow) || (_thing == kObjectBolt))
_vm->_dialogs->displayText("You might be able to influence Cwytalot more if you used it!");
else
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
break;
case kPeopleSpludwick:
if (giveToSpludwick())
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
break;
case kPeopleIbythneth:
if (_thing == kObjectBadge) {
@@ -1756,7 +1716,7 @@ void Parser::doThat() {
_vm->_background->draw(-1, -1, 7);
_vm->_background->draw(-1, -1, 8);
} else
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
break;
case kPeopleAyles:
if (_vm->_aylesIsAwake) {
@@ -1768,7 +1728,7 @@ void Parser::doThat() {
_vm->refreshObjectList();
_vm->incScore(2);
} else
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
} else
_vm->_dialogs->displayText("But he's asleep!");
break;
@@ -1785,7 +1745,7 @@ void Parser::doThat() {
giveGeidaTheLute();
break;
default:
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
}
break;
case kPeopleArkata:
@@ -1797,11 +1757,11 @@ void Parser::doThat() {
_vm->_dialogs->displayScrollChain('q', 77); // That Geida woman!
break;
default:
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
}
break;
default:
- heyThanks();
+ _vm->_dialogs->heyThanks(_thing - 1);
}
}
}
@@ -2365,13 +2325,13 @@ void Parser::doThat() {
_vm->_dialogs->displayText("Hey, a verb would be helpful!");
break;
case kVerbCodeHello: {
- Common::String tmpStr = personSpeaks();
+ Common::String tmpStr = _vm->_dialogs->personSpeaks();
tmpStr += Common::String::format("Hello.%c", kControlSpeechBubble);
_vm->_dialogs->displayText(tmpStr);
}
break;
case kVerbCodeThanks: {
- Common::String tmpStr = personSpeaks();
+ Common::String tmpStr = _vm->_dialogs->personSpeaks();
tmpStr += Common::String::format("That's OK.%c", kControlSpeechBubble);
_vm->_dialogs->displayText(tmpStr);
}
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index 892b81e9a3..db22be2616 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -148,8 +148,6 @@ private:
void giveGeidaTheLute();
void playHarp();
void winSequence();
- Common::String personSpeaks();
- void heyThanks();
void wipeText();
};