AVALANCHE: Change class variables to pointers, update everything accordingly.

This commit is contained in:
uruk 2013-07-24 19:43:10 +02:00
parent c0823f3e79
commit 39dfddff1f
28 changed files with 858 additions and 862 deletions

File diff suppressed because it is too large Load diff

View file

@ -130,7 +130,7 @@ public:
void setParent(AvalancheEngine *vm);
Acci(AvalancheEngine *vm);
void init();

View file

@ -63,8 +63,18 @@ AvalancheEngine::~AvalancheEngine() {
delete _enhanced;
delete _logger;
delete _pingo;
delete _scrolls;
delete _visa;
delete _lucerna;
delete _enid;
delete _celer;
delete _sequence;
delete _timeout;
delete _trip;
delete _acci;
delete _basher;
delete _dropdown;
delete _closing;
}
Common::ErrorCode AvalancheEngine::initialize() {
@ -75,25 +85,25 @@ Common::ErrorCode AvalancheEngine::initialize() {
_enhanced = new Enhanced(this);
_logger = new Logger(this);
_pingo = new Pingo(this);
_scrolls.setParent(this);
_visa.setParent(this);
_lucerna.setParent(this);
_enid.setParent(this);
_celer.setParent(this);
_sequence.setParent(this);
_scrolls = new Scrolls(this);
_visa = new Visa(this);
_lucerna = new Lucerna(this);
_enid = new Enid(this);
_celer = new Celer(this);
_sequence = new Sequence(this);
_timeout = new Timeout(this);
_trip.setParent(this);
_acci.setParent(this);
_basher.setParent(this);
_dropdown.setParent(this);
_closing.setParent(this);
_trip = new Trip(this);
_acci = new Acci(this);
_basher = new Basher(this);
_dropdown = new Dropdown(this);
_closing = new Closing(this);
_graphics->init();
_scrolls.init();
_lucerna.init();
_acci.init();
_basher.init();
_scrolls->init();
_lucerna->init();
_acci->init();
_basher->init();
return Common::kNoError;

View file

@ -72,18 +72,18 @@ public:
Enhanced *_enhanced;
Logger *_logger;
Pingo *_pingo;
Scrolls _scrolls;
Visa _visa;
Lucerna _lucerna;
Enid _enid;
Celer _celer;
Sequence _sequence;
Scrolls *_scrolls;
Visa *_visa;
Lucerna *_lucerna;
Enid *_enid;
Celer *_celer;
Sequence *_sequence;
Timeout *_timeout;
Trip _trip;
Acci _acci;
Basher _basher;
Dropdown _dropdown;
Closing _closing;
Trip *_trip;
Acci *_acci;
Basher *_basher;
Dropdown *_dropdown;
Closing *_closing;
OSystem *_system;

View file

@ -69,16 +69,16 @@ void Avalot::setup() {
_vm->_gyro->visible = _vm->_gyro->m_no;
_vm->_gyro->to_do = 0;
_vm->_gyro->lmo = false;
_vm->_scrolls.resetscroll();
_vm->_scrolls->resetscroll();
_vm->_gyro->setup_vmc();
_vm->_gyro->on_virtual();
gd = 3;
gm = 0;
//initgraph(gd: gm: "");
_vm->_gyro->holdthedawn = true;
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->cmp = 177;
_vm->_lucerna.mouse_init(); /*on;*/
_vm->_lucerna->mouse_init(); /*on;*/
_vm->_gyro->dropsok = true;
_vm->_gyro->ctrl = ckey;
_vm->_gyro->oldjw = 177;
@ -86,7 +86,7 @@ void Avalot::setup() {
_vm->_gyro->c = 999;
//settextjustify(0: 0);
_vm->_gyro->ddmnow = false;
_vm->_lucerna.load_digits();
_vm->_lucerna->load_digits();
_vm->_gyro->cheat = false;
_vm->_gyro->cp = 0;
_vm->_gyro->curpos = 1;
@ -96,8 +96,8 @@ void Avalot::setup() {
/* TSkellern:=0; { Replace with a more local variable sometime }*/
_vm->_gyro->dna.rw = _vm->_gyro->stopped;
_vm->_gyro->enid_filename = ""; /* undefined. */
_vm->_lucerna.toolbar();
_vm->_scrolls.state(2);
_vm->_lucerna->toolbar();
_vm->_scrolls->state(2);
_vm->_graphics->refreshScreen(); //_vm->_pingo->copy03(); Replace it with refreshScreen() since they 'almost' have the same functionality.
for (byte i = 0; i < 3; i++)
_vm->_gyro->lastscore[i] = -1; /* impossible digits */
@ -107,7 +107,7 @@ void Avalot::setup() {
setactivepage(gd); outtextxy(7:177:chr(48+gd));
end;*/
_vm->_trip.loadtrip();
_vm->_trip->loadtrip();
_vm->_gyro->reloaded = false; // TODO: Remove it later: when SAVE/LOAD system is implemented. Until then: we always start a new game.
@ -115,18 +115,18 @@ void Avalot::setup() {
_vm->_gyro->newgame(); /* no game was requested- load the default */
else {
if (! _vm->_gyro->reloaded)
_vm->_enid.avvy_background();
_vm->_dropdown.standard_bar();
_vm->_lucerna.sprite_run();
_vm->_enid->avvy_background();
_vm->_dropdown->standard_bar();
_vm->_lucerna->sprite_run();
if (_vm->_gyro->reloaded)
_vm->_enid.edna_reload();
_vm->_enid->edna_reload();
else {
/* Filename given on the command line (or loadfirst) */
_vm->_enid.edna_load(_vm->_gyro->filetoload);
if (_vm->_enid.there_was_a_problem()) {
_vm->_scrolls.display("So let's start from the beginning instead...");
_vm->_enid->edna_load(_vm->_gyro->filetoload);
if (_vm->_enid->there_was_a_problem()) {
_vm->_scrolls->display("So let's start from the beginning instead...");
_vm->_gyro->holdthedawn = true;
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->newgame();
}
}
@ -134,21 +134,21 @@ void Avalot::setup() {
if (! _vm->_gyro->reloaded) {
_vm->_gyro->soundfx = ! _vm->_gyro->soundfx;
_vm->_lucerna.fxtoggle();
_vm->_lucerna.thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
_vm->_lucerna->fxtoggle();
_vm->_lucerna->thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing);
}
_vm->_trip.get_back_loretta();
_vm->_trip->get_back_loretta();
//gm = getpixel(0: 0);
//setcolor(7);
_vm->_gyro->holdthedawn = false;
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
_vm->_gyro->cursoron = false;
_vm->_basher.cursor_on();
_vm->_trip.newspeed();
_vm->_basher->cursor_on();
_vm->_trip->newspeed();
if (! _vm->_gyro->reloaded)
_vm->_visa.dixi('q', 83); /* Info on the game: etc. */
_vm->_visa->dixi('q', 83); /* Info on the game: etc. */
}
@ -169,7 +169,7 @@ void Avalot::handleKeyDown(const Common::Event &event) {
case Common::KEYCODE_HOME:
case Common::KEYCODE_END:
case Common::KEYCODE_KP5:
_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
break;
}
}
@ -180,19 +180,19 @@ void Avalot::run(Common::String arg) {
setup();
do {
_vm->_lucerna.clock_lucerna();
_vm->_basher.keyboard_link();
_vm->_dropdown.menu_link();
_vm->_trip.readstick();
_vm->_lucerna->clock_lucerna();
_vm->_basher->keyboard_link();
_vm->_dropdown->menu_link();
_vm->_trip->readstick();
_vm->_gyro->force_numlock();
_vm->_trip.get_back_loretta();
_vm->_trip.trippancy_link();
_vm->_celer.pics_link();
_vm->_lucerna.checkclick();
_vm->_trip->get_back_loretta();
_vm->_trip->trippancy_link();
_vm->_celer->pics_link();
_vm->_lucerna->checkclick();
if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
_vm->_gyro->plot_vmc(_vm->_gyro->mx, _vm->_gyro->my, _vm->_gyro->cp);
_vm->_lucerna.flip_page(); /* <<<! */
_vm->_lucerna->flip_page(); /* <<<! */
_vm->_gyro->slowdown();
if (_vm->_gyro->visible == _vm->_gyro->m_virtual)
_vm->_gyro->wipe_vmc(_vm->_gyro->cp);
@ -213,7 +213,7 @@ void Avalot::run(Common::String arg) {
//if (logging)
// close(logfile);
_vm->_closing.end_of_program();
_vm->_closing->end_of_program();
}
} // End of namespace Avalanche

View file

@ -50,7 +50,7 @@
namespace Avalanche {
void Basher::setParent(AvalancheEngine *vm) {
Basher::Basher(AvalancheEngine *vm) {
_vm = vm;
}

View file

@ -45,7 +45,7 @@ public:
void setParent(AvalancheEngine *vm);
Basher(AvalancheEngine *vm);
void init();

View file

@ -42,12 +42,9 @@ namespace Avalanche {
const int16 Celer::on_disk = -1;
Celer::Celer() {
num_chunks = 0;
}
void Celer::setParent(AvalancheEngine *vm) {
Celer::Celer(AvalancheEngine *vm) {
_vm = vm;
num_chunks = 0;
}
void Celer::pics_link() {
@ -121,11 +118,11 @@ void Celer::pics_link() {
}
if ((_vm->_gyro->roomtime % 200 >= 0) && (_vm->_gyro->roomtime % 200 <= 178)) { /* Normally. */
if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360)))
if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360)))
xx = 3;
else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357))
else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357))
xx = 2;
else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292))
else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292))
xx = 4;
if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@ -160,11 +157,11 @@ void Celer::pics_link() {
xx = 4; /* du Lustie blinks */
/* Bearing of Avvy from du Lustie. */
else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
else if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
xx = 1; /* Middle. */
else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
xx = 2; /* Left. */
else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
xx = 3; /* Right. */
if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@ -202,11 +199,11 @@ void Celer::pics_link() {
case r__nottspub:
/* Bearing of Avvy from Port. */
if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360)))
if (((_vm->_lucerna->bearing(5) >= 0) && (_vm->_lucerna->bearing(5) <= 45)) || ((_vm->_lucerna->bearing(5) >= 315) && (_vm->_lucerna->bearing(5) <= 360)))
xx = 2; /* Middle. */
else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180))
else if ((_vm->_lucerna->bearing(5) >= 45) && (_vm->_lucerna->bearing(5) <= 180))
xx = 6; /* Left. */
else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314))
else if ((_vm->_lucerna->bearing(5) >= 181) && (_vm->_lucerna->bearing(5) <= 314))
xx = 8; /* Right. */
if ((_vm->_gyro->roomtime % int32(60)) > 57)
@ -231,12 +228,12 @@ void Celer::pics_link() {
if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
show_one(1 + (_vm->_gyro->roomtime / 3) % 3);
{/* _vm->_lucerna.bearing of Avvy from Duck. */
if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360)))
{/* _vm->_lucerna->bearing of Avvy from Duck. */
if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
xx = 4; /* Middle. */
else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180))
else if ((_vm->_lucerna->bearing(2) >= 45) && (_vm->_lucerna->bearing(2) <= 180))
xx = 6; /* Left. */
else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314))
else if ((_vm->_lucerna->bearing(2) >= 181) && (_vm->_lucerna->bearing(2) <= 314))
xx = 8; /* Right. */
if ((_vm->_gyro->roomtime % int32(45)) > 42)
@ -468,7 +465,7 @@ void Celer::show_one(byte which) {
warning("STUB: Celer::show_one()");
for (byte fv = 0; fv < 2; fv ++)
_vm->_trip.getset[fv].remember(r);
_vm->_trip->getset[fv].remember(r);
}
@ -517,7 +514,7 @@ void Celer::show_one_at(byte which, int16 xxx, int16 yyy) {
warning("STUB: Celer::show_one_at()");
for (byte fv = 0; fv < 2; fv ++)
_vm->_trip.getset[fv].remember(r);
_vm->_trip->getset[fv].remember(r);
}

View file

@ -65,9 +65,8 @@ public:
bytefield r;
Celer();
void setParent(AvalancheEngine *vm);
Celer(AvalancheEngine *vm);
void pics_link();

View file

@ -38,12 +38,9 @@
namespace Avalanche {
Closing::Closing() {
warning("STUB: Closing::Closing()");
}
void Closing::setParent(AvalancheEngine *vm) {
Closing::Closing(AvalancheEngine *vm) {
_vm = vm;
warning("STUB: Closing::Closing()");
}
void Closing::get_screen(byte which) {

View file

@ -43,9 +43,7 @@ public:
static const int16 scr_nagscreen = 3;
static const int16 scr_twocopies = 5;
Closing();
void setParent(AvalancheEngine *vm);
Closing(AvalancheEngine *vm);
void quit_with(byte which, byte errorlev);

View file

@ -206,7 +206,7 @@ void menuset::update() {
ddms[fv].display();
for (page_ = 0; page_ <= 1; page_ ++)
_dr->_vm->_trip.getset[page_].remember(menuspace);
_dr->_vm->_trip->getset[page_].remember(menuspace);
_dr->_vm->_gyro->cp = savecp;
}
@ -246,7 +246,7 @@ void menuset::getmenu(int16 x) {
void Dropdown::setParent(AvalancheEngine *vm) {
Dropdown::Dropdown(AvalancheEngine *vm) {
_vm = vm;
}
@ -255,26 +255,26 @@ void Dropdown::find_what_you_can_do_with_it() {
case _vm->_gyro->wine:
case _vm->_gyro->potion:
case _vm->_gyro->ink:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_drink;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_drink;
break;
case _vm->_gyro->bell:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_ring;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_ring;
break;
case _vm->_gyro->chastity:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
break;
case _vm->_gyro->lute:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_play;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_play;
break;
case _vm->_gyro->mushroom:
case _vm->_gyro->onion:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_eat;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_eat;
break;
case _vm->_gyro->clothes:
_vm->_gyro->verbstr = Common::String(_vm->_acci.vb_exam) + _vm->_acci.vb_wear;
_vm->_gyro->verbstr = Common::String(_vm->_acci->vb_exam) + _vm->_acci->vb_wear;
break;
default:
_vm->_gyro->verbstr = _vm->_acci.vb_exam; /* anything else */
_vm->_gyro->verbstr = _vm->_acci->vb_exam; /* anything else */
}
}
@ -310,7 +310,7 @@ void Dropdown::chalk(int16 x, int16 y, char t, Common::String z, bool valid) {
}
}
_vm->_lucerna.blitfix();
_vm->_lucerna->blitfix();
}
void Dropdown::hlchalk(int16 x, int16 y, char t, Common::String z, bool valid) {
@ -418,12 +418,12 @@ void Dropdown::ddm__action() {
ddm_o.opt(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
ddm_o.opt("Pause game", 'P', "f6", true);
if (_vm->_gyro->dna.room == 99)
ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip.neardoor());
ddm_o.opt("Journey thither", 'J', "f7", _vm->_trip->neardoor());
else
ddm_o.opt("Open the door", 'O', "f7", _vm->_trip.neardoor());
ddm_o.opt("Open the door", 'O', "f7", _vm->_trip->neardoor());
ddm_o.opt("Look around", 'L', "f8", true);
ddm_o.opt("Inventory", 'I', "Tab", true);
if (_vm->_trip.tr[1].xs == _vm->_gyro->walk)
if (_vm->_trip->tr[1].xs == _vm->_gyro->walk)
ddm_o.opt("Run fast", 'R', "^R", true);
else
ddm_o.opt("Walk slowly", 'W', "^W", true);
@ -501,19 +501,19 @@ void Dropdown::do__game() {
switch (ddm_o.choicenum) {
/* Help, boss, untrash screen. */
case 0:
_vm->_lucerna.callverb(_vm->_acci.vb_help);
_vm->_lucerna->callverb(_vm->_acci->vb_help);
break;
case 1:
_vm->_lucerna.callverb(_vm->_acci.vb_boss);
_vm->_lucerna->callverb(_vm->_acci->vb_boss);
break;
case 2:
_vm->_lucerna.major_redraw();
_vm->_lucerna->major_redraw();
break;
case 3:
_vm->_lucerna.callverb(_vm->_acci.vb_score);
_vm->_lucerna->callverb(_vm->_acci->vb_score);
break;
case 4:
_vm->_lucerna.callverb(_vm->_acci.vb_info);
_vm->_lucerna->callverb(_vm->_acci->vb_info);
break;
}
}
@ -522,26 +522,26 @@ void Dropdown::do__file() {
switch (ddm_o.choicenum) {
/* New game, load, save, save as, DOS shell, about, quit. */
case 0:
_vm->_lucerna.callverb(_vm->_acci.vb_restart);
_vm->_lucerna->callverb(_vm->_acci->vb_restart);
break;
case 1: {
_vm->_acci.realwords[2] = "";
_vm->_lucerna.callverb(_vm->_acci.vb_load);
_vm->_acci->realwords[2] = "";
_vm->_lucerna->callverb(_vm->_acci->vb_load);
}
break;
case 2: {
_vm->_acci.realwords[2] = "";
_vm->_lucerna.callverb(_vm->_acci.vb_save);
_vm->_acci->realwords[2] = "";
_vm->_lucerna->callverb(_vm->_acci->vb_save);
}
break;
case 3:
_vm->_basher.filename_edit();
_vm->_basher->filename_edit();
break;
case 4:
_vm->_enid.back_to_bootstrap(2);
_vm->_enid->back_to_bootstrap(2);
break;
case 5:
_vm->_lucerna.callverb(_vm->_acci.vb_quit);
_vm->_lucerna->callverb(_vm->_acci->vb_quit);
break;
}
}
@ -551,99 +551,99 @@ void Dropdown::do__action() {
switch (ddm_o.choicenum) {
/* Get up/pause game/open door/look/inv/walk-run */
case 0: {
_vm->_acci.person = _vm->_acci.pardon;
_vm->_acci.thing = _vm->_acci.pardon;
_vm->_acci->person = _vm->_acci->pardon;
_vm->_acci->thing = _vm->_acci->pardon;
n = _vm->_gyro->f5_does();
_vm->_lucerna.callverb(n[1]);
_vm->_lucerna->callverb(n[1]);
}
break;
case 1:
_vm->_lucerna.callverb(_vm->_acci.vb_pause);
_vm->_lucerna->callverb(_vm->_acci->vb_pause);
break;
case 2:
_vm->_lucerna.callverb(_vm->_acci.vb_open);
_vm->_lucerna->callverb(_vm->_acci->vb_open);
break;
case 3:
_vm->_lucerna.callverb(_vm->_acci.vb_look);
_vm->_lucerna->callverb(_vm->_acci->vb_look);
break;
case 4:
_vm->_lucerna.callverb(_vm->_acci.vb_inv);
_vm->_lucerna->callverb(_vm->_acci->vb_inv);
break;
case 5: {
if (_vm->_trip.tr[1].xs == _vm->_gyro->walk) _vm->_trip.tr[1].xs = _vm->_gyro->run;
else _vm->_trip.tr[1].xs = _vm->_gyro->walk;
_vm->_trip.newspeed();
if (_vm->_trip->tr[1].xs == _vm->_gyro->walk) _vm->_trip->tr[1].xs = _vm->_gyro->run;
else _vm->_trip->tr[1].xs = _vm->_gyro->walk;
_vm->_trip->newspeed();
}
break;
}
}
void Dropdown::do__objects() {
_vm->_lucerna.thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
_vm->_lucerna->thinkabout(_vm->_gyro->objlist[ddm_o.choicenum + 1], _vm->_gyro->a_thing);
}
void Dropdown::do__people() {
_vm->_lucerna.thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
_vm->_lucerna->thinkabout(people[ddm_o.choicenum + 1], _vm->_gyro->a_person);
_vm->_gyro->last_person = people[ddm_o.choicenum + 1];
}
void Dropdown::do__with() {
_vm->_acci.thing = _vm->_gyro->thinks;
_vm->_acci->thing = _vm->_gyro->thinks;
if (_vm->_gyro->thinkthing) {
_vm->_acci.thing += 49;
_vm->_acci->thing += 49;
if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give)
_vm->_acci.person = _vm->_gyro->last_person;
if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci->vb_give)
_vm->_acci->person = _vm->_gyro->last_person;
else
_vm->_acci.person = '\376';
_vm->_acci->person = '\376';
} else {
switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) {
case '\144': {
_vm->_acci.thing = '\144';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\144';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Beer */
case '\145': {
_vm->_acci.thing = '\62';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\62';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Wine */
case '\146': {
_vm->_acci.thing = '\146';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\146';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Whisky */
case '\147': {
_vm->_acci.thing = '\147';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\147';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Cider */
case '\150': {
_vm->_acci.thing = '\153';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\153';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Mead */
case '\151': {
_vm->_acci.thing = '\103';
_vm->_lucerna.callverb(_vm->_acci.vb_buy);
_vm->_acci->thing = '\103';
_vm->_lucerna->callverb(_vm->_acci->vb_buy);
return;
}
break; /* Onion (trader) */
default: {
_vm->_acci.person = _vm->_acci.thing;
_vm->_acci.thing = '\376';
_vm->_acci->person = _vm->_acci->thing;
_vm->_acci->thing = '\376';
}
}
}
_vm->_lucerna.callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
_vm->_lucerna->callverb(_vm->_gyro->verbstr[ddm_o.choicenum + 1]);
}
/*$F- That's all. Now for the ...bar funcs. */

View file

@ -122,8 +122,6 @@ public:
friend onemenu;
friend menuset;
void setParent(AvalancheEngine *vm);
onemenu ddm_o;
menuset ddm_m;
@ -131,6 +129,8 @@ public:
Dropdown(AvalancheEngine *vm);
void find_what_you_can_do_with_it();
void parsekey(char r, char re);

View file

@ -45,7 +45,7 @@
namespace Avalanche {
void Enid::setParent(AvalancheEngine *vm) {
Enid::Enid(AvalancheEngine *vm) {
_vm = vm;
}
@ -117,7 +117,7 @@ Common::String Enid::expanddate(byte d, byte m, uint16 y) {
}
void Enid::show_bug(char icon, Common::String strn) {
_vm->_scrolls.display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
_vm->_scrolls->display(Common::String("\7\6\23") + icon + "\26\r" + strn + '\15');
}
bool Enid::test_bug(byte what) {
@ -150,9 +150,9 @@ void Enid::edna_save(Common::String name) {
void Enid::loaderror(Common::String x, char icon) {
if (_vm->_gyro->holdthedawn) {
_vm->_gyro->holdthedawn = false;
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
}
_vm->_scrolls.display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error: " + "\r\r\22" + x);
_vm->_scrolls->display(Common::String('\7') + '\6' + '\23' + icon + '\26' + "Loading error: " + "\r\r\22" + x);
bug = true;
}
@ -161,7 +161,7 @@ void Enid::edna_load(Common::String name) {
}
void Enid::showheader() {
_vm->_scrolls.display(Common::String("Dir: ") + path + "\r\r\4");
_vm->_scrolls->display(Common::String("Dir: ") + path + "\r\r\4");
}
void Enid::dir(Common::String where) { /* OK, it worked in Avaricius, let's do it in Avalot! */
@ -246,7 +246,7 @@ void Enid::avvy_background() { /* Not really a filing procedure,
@the_end:
end;
*/
_vm->_lucerna.blitfix();
_vm->_lucerna->blitfix();
}
void Enid::to_sundry(sundry &sund) {
@ -277,17 +277,17 @@ void Enid::edna_reload() {
_vm->_gyro->seescroll = true; /* This prevents display of the new sprites before the
new picture is loaded. */
_vm->_lucerna.major_redraw();
_vm->_lucerna->major_redraw();
_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
_vm->_gyro->alive = true;
_vm->_lucerna.objectlist();
_vm->_lucerna->objectlist();
if (_vm->_gyro->holdthedawn) {
_vm->_gyro->holdthedawn = false;
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
}
}

View file

@ -38,7 +38,7 @@ class AvalancheEngine;
class Enid {
public:
void setParent(AvalancheEngine *vm);
Enid(AvalancheEngine *vm);
void edna_save(Common::String name);

View file

@ -348,19 +348,19 @@ void Gyro::shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
void Gyro::newgame() { /* This sets up the DNA for a completely new game. */
for (byte gm = 0; gm < numtr; gm ++) {
if (_vm->_trip.tr[gm].quick)
_vm->_trip.tr[gm].done();
if (_vm->_trip->tr[gm].quick)
_vm->_trip->tr[gm].done();
}
/* Deallocate sprite. Sorry, beta testers! */
_vm->_trip.tr[0].init(0, true, &_vm->_trip);
_vm->_trip->tr[0].init(0, true, _vm->_trip);
alive = true;
score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
_vm->_scrolls.natural();
_vm->_basher.normal_edit();
_vm->_lucerna.mousepage(0);
_vm->_scrolls->natural();
_vm->_basher->normal_edit();
_vm->_lucerna->mousepage(0);
dna.spare_evening = "answer a questionnaire";
dna.like2drink = "beer";
@ -372,12 +372,12 @@ void Gyro::newgame() { /* This sets up the DNA for a completely new game. */
dna.obj[clothes] = true;
thinks = 2;
_vm->_lucerna.objectlist();
_vm->_lucerna->objectlist();
ontoolbar = false;
seescroll = false;
ppos[0][1] = -177;
_vm->_trip.tr[0].appear(300,117,right);
_vm->_trip->tr[0].appear(300,117,right);
//for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
him = 254;
@ -393,16 +393,16 @@ void Gyro::newgame() { /* This sets up the DNA for a completely new game. */
for (byte gd = 0; gd <= 1; gd ++) {
cp = 1 - cp;
_vm->_trip.getback();
_vm->_trip->getback();
}
_vm->_lucerna.enterroom(1, 1);
_vm->_trip.new_game_for_trippancy();
_vm->_lucerna.showscore();
_vm->_lucerna->enterroom(1, 1);
_vm->_trip->new_game_for_trippancy();
_vm->_lucerna->showscore();
_vm->_dropdown.standard_bar();
_vm->_lucerna.clock_lucerna();
_vm->_lucerna.sprite_run();
_vm->_dropdown->standard_bar();
_vm->_lucerna->clock_lucerna();
_vm->_lucerna->sprite_run();
}
void Gyro::click() { /* "Audio keyboard feedback" */

View file

@ -54,9 +54,7 @@
namespace Avalanche {
Lucerna::Lucerna() : fxhidden(false) {}
void Lucerna::setParent(AvalancheEngine *vm) {
Lucerna::Lucerna(AvalancheEngine *vm) : fxhidden(false) {
_vm = vm;
}
@ -68,16 +66,16 @@ void Lucerna::init() {
}
void Lucerna::callverb(char n) {
if (n == _vm->_acci.pardon) {
_vm->_scrolls.display(Common::String("The f5 key lets you do a particular action in certain ") +
if (n == _vm->_acci->pardon) {
_vm->_scrolls->display(Common::String("The f5 key lets you do a particular action in certain ") +
"situations. However, at the moment there is nothing " +
"assigned to it. You may press alt-A to see what the " +
"current setting of this key is.");
} else {
_vm->_gyro->weirdword = false;
_vm->_acci.polite = true;
_vm->_acci.verb = n;
_vm->_acci.do_that();
_vm->_acci->polite = true;
_vm->_acci->verb = n;
_vm->_acci->do_that();
}
}
@ -272,7 +270,7 @@ void Lucerna::load(byte n) { /* Load2, actually */
load_also(xx);
_vm->_celer.load_chunks(xx);
_vm->_celer->load_chunks(xx);
_vm->_graphics->refreshScreen(); // _vm->_pingo->copy03(); - See Avalot::setup()
@ -307,7 +305,7 @@ void Lucerna::find_people(byte room) {
void Lucerna::exitroom(byte x) {
//nosound();
_vm->_celer.forget_chunks();
_vm->_celer->forget_chunks();
_vm->_gyro->seescroll = true; /* This stops the trippancy system working over the length of this procedure. */
switch (x) {
@ -340,7 +338,7 @@ void Lucerna::exitroom(byte x) {
}
void Lucerna::new_town() { /* You've just entered a town from the map. */
_vm->_dropdown.standard_bar();
_vm->_dropdown->standard_bar();
switch (_vm->_gyro->dna.room) {
case r__outsidenottspub: /* Entry into Nottingham. */
@ -371,10 +369,10 @@ void Lucerna::new_town() { /* You've just entered a town from the map. */
void Lucerna::put_geida_at(byte whichped, byte &ped) {
if (ped == 0)
return;
_vm->_trip.tr[2].init(5, false, &_vm->_trip); /* load Geida */
_vm->_trip.apped(2, whichped);
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
_vm->_trip->tr[2].init(5, false, _vm->_trip); /* load Geida */
_vm->_trip->apped(2, whichped);
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
}
void Lucerna::enterroom(byte x, byte ped) {
@ -405,7 +403,7 @@ void Lucerna::enterroom(byte x, byte ped) {
switch (x) {
case r__yours:
if (_vm->_gyro->dna.avvy_in_bed) {
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
_vm->_timeout->set_up_timer(100, _vm->_timeout->procarkata_shouts, _vm->_timeout->reason_arkata_shouts);
}
break;
@ -415,25 +413,25 @@ void Lucerna::enterroom(byte x, byte ped) {
if (! _vm->_gyro->dna.talked_to_crapulus) {
_vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__outsideyours;
_vm->_trip.tr[2].init(8, false, &_vm->_trip); /* load Crapulus */
_vm->_trip->tr[2].init(8, false, _vm->_trip); /* load Crapulus */
if (_vm->_gyro->dna.rooms[r__outsideyours] == 1) {
_vm->_trip.apped(2, 4); /* Start on the right-hand side of the screen. */
_vm->_trip.tr[2].walkto(5); /* Walks up to greet you. */
_vm->_trip->apped(2, 4); /* Start on the right-hand side of the screen. */
_vm->_trip->tr[2].walkto(5); /* Walks up to greet you. */
} else {
_vm->_trip.apped(2, 5); /* Starts where he was before. */
_vm->_trip.tr[2].face = 3;
_vm->_trip->apped(2, 5); /* Starts where he was before. */
_vm->_trip->tr[2].face = 3;
}
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* He always faces Avvy. */
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* He always faces Avvy. */
} else _vm->_gyro->whereis[_vm->_gyro->pcrapulus] = r__nowhere;
if (_vm->_gyro->dna.crapulus_will_tell) {
_vm->_trip.tr[2].init(8, false, &_vm->_trip);
_vm->_trip.apped(2, 2);
_vm->_trip.tr[2].walkto(4);
_vm->_trip->tr[2].init(8, false, _vm->_trip);
_vm->_trip->apped(2, 2);
_vm->_trip->tr[2].walkto(4);
_vm->_timeout->set_up_timer(20, _vm->_timeout->proccrapulus_splud_out, _vm->_timeout->reason_crapulus_says_spludwick_out);
_vm->_gyro->dna.crapulus_will_tell = false;
}
@ -452,15 +450,15 @@ void Lucerna::enterroom(byte x, byte ped) {
case r__spludwicks:
if (_vm->_gyro->dna.spludwicks_here) {
if (ped > 0) {
_vm->_trip.tr[2].init(2, false, &_vm->_trip); /* load Spludwick */
_vm->_trip.apped(2, 2);
_vm->_trip->tr[2].init(2, false, _vm->_trip); /* load Spludwick */
_vm->_trip->apped(2, 2);
_vm->_gyro->whereis['\227'] = r__spludwicks;
}
_vm->_gyro->dna.dogfoodpos = 0; /* _vm->_gyro->also Spludwick pos. */
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procgeida_procs;
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procgeida_procs;
} else _vm->_gyro->whereis['\227'] = r__nowhere;
break;
@ -471,18 +469,18 @@ void Lucerna::enterroom(byte x, byte ped) {
_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__nowhere;
} else {
if (ped > 0) {
_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot*/
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procfollow_avvy_y;
_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot*/
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procfollow_avvy_y;
_vm->_gyro->whereis[_vm->_gyro->pcwytalot] = r__brummieroad;
if (_vm->_gyro->dna.rooms[r__brummieroad] == 1) { /* First time here... */
_vm->_trip.apped(2, 2); /* He appears on the right of the screen... */
_vm->_trip.tr[2].walkto(4); /* ...and he walks up... */
_vm->_trip->apped(2, 2); /* He appears on the right of the screen... */
_vm->_trip->tr[2].walkto(4); /* ...and he walks up... */
} else {
/* You've been here before. */
_vm->_trip.apped(2, 4); /* He's standing in your way straight away... */
_vm->_trip.tr[2].face = _vm->_trip.left;
_vm->_trip->apped(2, 4); /* He's standing in your way straight away... */
_vm->_trip->tr[2].face = _vm->_trip->left;
}
}
}
@ -493,10 +491,10 @@ void Lucerna::enterroom(byte x, byte ped) {
dnatype &with = _vm->_gyro->dna;
if ((with.cwytalot_gone) && (! with.cwytalot_in_herts) && (ped == 2) &&
(_vm->_gyro->dna.rooms[r__argentroad] > 3)) {
_vm->_trip.tr[2].init(4, false, &_vm->_trip); /* 4=Cwytalot again*/
_vm->_trip.apped(2, 1);
_vm->_trip.tr[2].walkto(2);
_vm->_trip.tr[2].vanishifstill = true;
_vm->_trip->tr[2].init(4, false, _vm->_trip); /* 4=Cwytalot again*/
_vm->_trip->apped(2, 1);
_vm->_trip->tr[2].walkto(2);
_vm->_trip->tr[2].vanishifstill = true;
with.cwytalot_in_herts = true;
/*_vm->_gyro->whereis[#157]:=r__Nowhere;*/ /* can we fit this in? */
_vm->_timeout->set_up_timer(20, _vm->_timeout->proc_cwytalot_in_herts, _vm->_timeout->reason_cwytalot_in_herts);
@ -506,7 +504,7 @@ void Lucerna::enterroom(byte x, byte ped) {
case r__bridge: {
if (_vm->_gyro->dna.drawbridge_open == 4) { /*open*/
_vm->_celer.show_one(3); /* Position of drawbridge */
_vm->_celer->show_one(3); /* Position of drawbridge */
_vm->_gyro->magics[green].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
}
if (_vm->_gyro->dna.geida_follows) put_geida_at(ped + 3, ped); /* load Geida */
@ -517,9 +515,9 @@ void Lucerna::enterroom(byte x, byte ped) {
if (ped > 0) {
if (! _vm->_gyro->dna.been_tied_up) {
/* A welcome party... or maybe not... */
_vm->_trip.tr[2].init(6, false, &_vm->_trip);
_vm->_trip.apped(2, 2);
_vm->_trip.tr[2].walkto(3);
_vm->_trip->tr[2].init(6, false, _vm->_trip);
_vm->_trip->apped(2, 2);
_vm->_trip->tr[2].walkto(3);
_vm->_timeout->set_up_timer(36, _vm->_timeout->procget_tied_up, _vm->_timeout->reason_getting_tied_up);
}
}
@ -530,10 +528,10 @@ void Lucerna::enterroom(byte x, byte ped) {
}
if (_vm->_gyro->dna.tied_up)
_vm->_celer.show_one(2);
_vm->_celer->show_one(2);
if (! _vm->_gyro->dna.mushroom_growing)
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
}
break;
@ -541,9 +539,9 @@ void Lucerna::enterroom(byte x, byte ped) {
if (ped > 0)
switch (_vm->_gyro->dna.cardiff_things) {
case 0 : { /* You've answered NONE of his questions. */
_vm->_trip.tr[2].init(9, false, &_vm->_trip);
_vm->_trip.apped(2, 2);
_vm->_trip.tr[2].walkto(3);
_vm->_trip->tr[2].init(9, false, _vm->_trip);
_vm->_trip->apped(2, 2);
_vm->_trip->tr[2].walkto(3);
_vm->_timeout->set_up_timer(47, _vm->_timeout->proccardiffsurvey, _vm->_timeout->reason_cardiffsurvey);
}
break;
@ -551,9 +549,9 @@ void Lucerna::enterroom(byte x, byte ped) {
_vm->_gyro->magics[2].op = _vm->_gyro->nix;
break; /* You've answered ALL his questions. => nothing happens. */
default: { /* You've answered SOME of his questions. */
_vm->_trip.tr[2].init(9, false, &_vm->_trip);
_vm->_trip.apped(2, 3);
_vm->_trip.tr[2].face = _vm->_trip.right;
_vm->_trip->tr[2].init(9, false, _vm->_trip);
_vm->_trip->apped(2, 3);
_vm->_trip->tr[2].face = _vm->_trip->right;
_vm->_timeout->set_up_timer(3, _vm->_timeout->proccardiff_return, _vm->_timeout->reason_cardiffsurvey);
}
}
@ -574,18 +572,18 @@ void Lucerna::enterroom(byte x, byte ped) {
break;
case r__argentpub: {
if (_vm->_gyro->dna.wonnim) _vm->_celer.show_one(1); /* No lute by the settle. */
if (_vm->_gyro->dna.wonnim) _vm->_celer->show_one(1); /* No lute by the settle. */
_vm->_gyro->dna.malagauche = 0; /* Ready to boot Malagauche */
if (_vm->_gyro->dna.givenbadgetoiby) {
_vm->_celer.show_one(8);
_vm->_celer.show_one(9);
_vm->_celer->show_one(8);
_vm->_celer->show_one(9);
}
}
break;
case r__lustiesroom: {
_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
if (_vm->_trip.tr[1].whichsprite == 0) /* Avvy in his normal clothes */
if (_vm->_trip->tr[1].whichsprite == 0) /* Avvy in his normal clothes */
_vm->_timeout->set_up_timer(3, _vm->_timeout->proccallsguards, _vm->_timeout->reason_du_lustie_talks);
else if (! _vm->_gyro->dna.entered_lusties_room_as_monk) /*already*/
/* Presumably, Avvy dressed as a monk. */
@ -593,7 +591,7 @@ void Lucerna::enterroom(byte x, byte ped) {
if (_vm->_gyro->dna.geida_follows) {
put_geida_at(5, ped);
if (_vm->_gyro->dna.lustie_is_asleep) _vm->_celer.show_one(5);
if (_vm->_gyro->dna.lustie_is_asleep) _vm->_celer->show_one(5);
}
}
break;
@ -601,96 +599,96 @@ void Lucerna::enterroom(byte x, byte ped) {
case r__musicroom: {
if (_vm->_gyro->dna.jacques_awake > 0) {
_vm->_gyro->dna.jacques_awake = 5;
_vm->_celer.show_one(2);
_vm->_celer.show_one(4);
_vm->_celer->show_one(2);
_vm->_celer->show_one(4);
_vm->_gyro->magics[brown].op = _vm->_gyro->nix;
_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0;
}
if (ped != 0) {
_vm->_celer.show_one(6);
_vm->_sequence.first_show(5);
_vm->_sequence.then_show(7);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(6);
_vm->_sequence->first_show(5);
_vm->_sequence->then_show(7);
_vm->_sequence->start_to_close();
}
}
break;
case r__outsidenottspub:
if (ped == 2) {
_vm->_celer.show_one(3);
_vm->_sequence.first_show(2);
_vm->_sequence.then_show(1);
_vm->_sequence.then_show(4);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(3);
_vm->_sequence->first_show(2);
_vm->_sequence->then_show(1);
_vm->_sequence->then_show(4);
_vm->_sequence->start_to_close();
}
break;
case r__outsideargentpub:
if (ped == 2) {
_vm->_celer.show_one(6);
_vm->_sequence.first_show(5);
_vm->_sequence.then_show(7);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(6);
_vm->_sequence->first_show(5);
_vm->_sequence->then_show(7);
_vm->_sequence->start_to_close();
}
break;
case r__wisewomans: {
_vm->_trip.tr[2].init(11, false, &_vm->_trip);
_vm->_trip->tr[2].init(11, false, _vm->_trip);
if ((_vm->_gyro->dna.rooms[r__wisewomans] == 1) && (ped > 0)) {
_vm->_trip.apped(2, 2); /* Start on the right-hand side of the screen. */
_vm->_trip.tr[2].walkto(4); /* Walks up to greet you. */
_vm->_trip->apped(2, 2); /* Start on the right-hand side of the screen. */
_vm->_trip->tr[2].walkto(4); /* Walks up to greet you. */
} else {
_vm->_trip.apped(2, 4); /* Starts where she was before. */
_vm->_trip.tr[2].face = 3;
_vm->_trip->apped(2, 4); /* Starts where she was before. */
_vm->_trip->tr[2].face = 3;
}
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procface_avvy; /* She always faces Avvy. */
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procface_avvy; /* She always faces Avvy. */
}
break;
case r__insidecardiffcastle:
if (ped > 0) {
_vm->_trip.tr[2].init(10, false, &_vm->_trip); /* Define the dart. */
_vm->_sequence.first_show(1);
_vm->_trip->tr[2].init(10, false, _vm->_trip); /* Define the dart. */
_vm->_sequence->first_show(1);
if (_vm->_gyro->dna.arrow_in_the_door)
_vm->_sequence.then_show(3);
_vm->_sequence->then_show(3);
else
_vm->_sequence.then_show(2);
_vm->_sequence->then_show(2);
if (_vm->_gyro->dna.taken_pen)
_vm->_celer.show_one(4);
_vm->_celer->show_one(4);
_vm->_sequence.start_to_close();
_vm->_sequence->start_to_close();
} else {
_vm->_celer.show_one(1);
if (_vm->_gyro->dna.arrow_in_the_door) _vm->_celer.show_one(3);
else _vm->_celer.show_one(2);
_vm->_celer->show_one(1);
if (_vm->_gyro->dna.arrow_in_the_door) _vm->_celer->show_one(3);
else _vm->_celer->show_one(2);
}
break;
case r__avvysgarden:
if (ped == 1) {
_vm->_celer.show_one(2);
_vm->_sequence.first_show(1);
_vm->_sequence.then_show(3);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(2);
_vm->_sequence->first_show(1);
_vm->_sequence->then_show(3);
_vm->_sequence->start_to_close();
}
break;
case r__entrancehall:
case r__insideabbey:
if (ped == 2) {
_vm->_celer.show_one(2);
_vm->_sequence.first_show(1);
_vm->_sequence.then_show(3);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(2);
_vm->_sequence->first_show(1);
_vm->_sequence->then_show(3);
_vm->_sequence->start_to_close();
}
break;
case r__aylesoffice:
if (_vm->_gyro->dna.ayles_is_awake)
_vm->_celer.show_one(2);
_vm->_celer->show_one(2);
break; /* Ayles awake. */
case r__geidas:
@ -707,7 +705,7 @@ void Lucerna::enterroom(byte x, byte ped) {
break;
case r__nottspub: {
if (_vm->_gyro->dna.sitting_in_pub) _vm->_celer.show_one(3);
if (_vm->_gyro->dna.sitting_in_pub) _vm->_celer->show_one(3);
_vm->_gyro->dna.dogfoodpos = 1; /* Actually, du Lustie pos. */
}
break;
@ -715,11 +713,11 @@ void Lucerna::enterroom(byte x, byte ped) {
case r__outsideducks:
if (ped == 2) {
/* Shut the door */
_vm->_celer.show_one(3);
_vm->_sequence.first_show(2);
_vm->_sequence.then_show(1);
_vm->_sequence.then_show(4);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(3);
_vm->_sequence->first_show(2);
_vm->_sequence->then_show(1);
_vm->_sequence->then_show(4);
_vm->_sequence->start_to_close();
}
break;
case r__ducks:
@ -779,7 +777,7 @@ void Lucerna::thinkabout(byte z, bool th) { /* Hey!!! Get it and put it!!! *
setactivepage(1 - cp);*/
for (byte fv = 0; fv <= 1; fv ++)
_vm->_trip.getset[fv].remember(thinkspace);
_vm->_trip->getset[fv].remember(thinkspace);
_vm->_gyro->on();
_vm->_gyro->thinkthing = th;
@ -862,7 +860,7 @@ void Lucerna::showscore() {
_vm->_graphics->drawPicture(_vm->_gyro->digit[numbers[fv]], 250 + (fv + 1) * 15, 177);
for (byte fv = 0; fv < 2; fv ++)
_vm->_trip.getset[fv].remember(scorespace);
_vm->_trip->getset[fv].remember(scorespace);
//setactivepage(1 - cp);
@ -887,7 +885,7 @@ void Lucerna::points(byte num) { /* Add on no. of points */
void Lucerna::topcheck() {
/* Menuset */
_vm->_dropdown.ddm_m.getmenu(_vm->_gyro->mpx);
_vm->_dropdown->ddm_m.getmenu(_vm->_gyro->mpx);
/* Do this one */
}
@ -943,46 +941,46 @@ void Lucerna::verte() {
return;
/* _vm->_trip.tr[0] : that's the only one we're interested in here */
if (_vm->_gyro->mx < _vm->_trip.tr[0].x)
/* _vm->_trip->tr[0] : that's the only one we're interested in here */
if (_vm->_gyro->mx < _vm->_trip->tr[0].x)
what = 1;
else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip.tr[0].x + _vm->_trip.tr[0]._info.xl))
else if (_vm->_gyro->mx > (unsigned char)(_vm->_trip->tr[0].x + _vm->_trip->tr[0]._info.xl))
what = 2;
else
what = 0; /* On top */
if (_vm->_gyro->my < _vm->_trip.tr[0].y)
if (_vm->_gyro->my < _vm->_trip->tr[0].y)
what += 3;
else if (_vm->_gyro->my > (unsigned char)(_vm->_trip.tr[0].y + _vm->_trip.tr[0]._info.yl))
else if (_vm->_gyro->my > (unsigned char)(_vm->_trip->tr[0].y + _vm->_trip->tr[0]._info.yl))
what += 6;
switch (what) {
case 0:
_vm->_trip.stopwalking();
_vm->_trip->stopwalking();
break; /* Clicked on Avvy- no movement */
case 1:
_vm->_trip.rwsp(1, _vm->_trip.left);
_vm->_trip->rwsp(1, _vm->_trip->left);
break;
case 2:
_vm->_trip.rwsp(1, _vm->_trip.right);
_vm->_trip->rwsp(1, _vm->_trip->right);
break;
case 3:
_vm->_trip.rwsp(1, _vm->_trip.up);
_vm->_trip->rwsp(1, _vm->_trip->up);
break;
case 4:
_vm->_trip.rwsp(1, _vm->_trip.ul);
_vm->_trip->rwsp(1, _vm->_trip->ul);
break;
case 5:
_vm->_trip.rwsp(1, _vm->_trip.ur);
_vm->_trip->rwsp(1, _vm->_trip->ur);
break;
case 6:
_vm->_trip.rwsp(1, _vm->_trip.down);
_vm->_trip->rwsp(1, _vm->_trip->down);
break;
case 7:
_vm->_trip.rwsp(1, _vm->_trip.dl);
_vm->_trip->rwsp(1, _vm->_trip->dl);
break;
case 8:
_vm->_trip.rwsp(1, _vm->_trip.dr);
_vm->_trip->rwsp(1, _vm->_trip->dr);
break;
} /* no other values are possible... */
@ -1209,7 +1207,7 @@ void Lucerna::delavvy() {
_vm->_gyro->off();
triptype &with = _vm->_trip.tr[0];
triptype &with = _vm->_trip->tr[0];
for (page_ = 0; page_ <= 1; page_ ++)
mblit(with.x / 8, with.y, (with.x + with._info.xl) / 8 + 1, with.y + with._info.yl, 3, page_);
@ -1223,16 +1221,16 @@ void Lucerna::gameover() {
_vm->_gyro->dna.user_moves_avvy = false;
sx = _vm->_trip.tr[1].x;
sy = _vm->_trip.tr[1].y;
sx = _vm->_trip->tr[1].x;
sy = _vm->_trip->tr[1].y;
_vm->_trip.tr[1].done();
_vm->_trip.tr[1].init(12, true, &_vm->_trip); /* 12 = Avalot falls */
_vm->_trip.tr[1].step = 0;
_vm->_trip.tr[1].appear(sx, sy, 0);
_vm->_trip->tr[1].done();
_vm->_trip->tr[1].init(12, true, _vm->_trip); /* 12 = Avalot falls */
_vm->_trip->tr[1].step = 0;
_vm->_trip->tr[1].appear(sx, sy, 0);
_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
/* _vm->_scrolls.display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
_vm->_gyro->alive = false;
}
@ -1247,7 +1245,7 @@ void Lucerna::minor_redraw() {
for (fv = 0; fv <= 1; fv ++) {
_vm->_gyro->cp = 1 - _vm->_gyro->cp;
_vm->_trip.getback();
_vm->_trip->getback();
}
for (byte i = 0; i < 3; i++)
@ -1268,16 +1266,16 @@ uint16 Lucerna::bearing(byte whichped) {
uint16 bearing_result;
{
pedtype &with = _vm->_gyro->peds[whichped];
if (_vm->_trip.tr[1].x == with.x)
if (_vm->_trip->tr[1].x == with.x)
bearing_result = 0; /* This would cause a division by zero if we let it through. */
else {
/*
bearing:=trunc(((arctan((_vm->_trip.tr[1].y-y)/(_vm->_trip.tr[1].x-x)))*rad2deg)+90) mod 360*/
bearing:=trunc(((arctan((_vm->_trip->tr[1].y-y)/(_vm->_trip->tr[1].x-x)))*rad2deg)+90) mod 360*/
if (_vm->_trip.tr[1].x < with.x)
bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 90;
if (_vm->_trip->tr[1].x < with.x)
bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 90;
else
bearing_result = (atan(double((_vm->_trip.tr[1].y - with.y)) / (_vm->_trip.tr[1].x - with.x)) * rad2deg) + 270;
bearing_result = (atan(double((_vm->_trip->tr[1].y - with.y)) / (_vm->_trip->tr[1].x - with.x)) * rad2deg) + 270;
}
}
return bearing_result;
@ -1293,8 +1291,8 @@ void Lucerna::sprite_run() {
_vm->_gyro->doing_sprite_run = true;
for (fv = 0; fv <= 1; fv ++) {
_vm->_trip.get_back_loretta();
_vm->_trip.trippancy_link();
_vm->_trip->get_back_loretta();
_vm->_trip->trippancy_link();
flip_page();
}
@ -1306,7 +1304,7 @@ void Lucerna::sprite_run() {
void Lucerna::fix_flashers() {
_vm->_gyro->ledstatus = 177;
_vm->_gyro->oldrw = 177;
_vm->_scrolls.state(2);
_vm->_scrolls->state(2);
showrw();
}

View file

@ -38,9 +38,7 @@ class AvalancheEngine;
class Lucerna {
public:
Lucerna();
void setParent(AvalancheEngine *vm);
Lucerna(AvalancheEngine *vm);
void init();

View file

@ -111,7 +111,7 @@ void Pingo::winning_pic() {
Common::File f;
char r;
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
if (!f.open("finale.avd")) {
warning("AVALANCHE: Lucerna: File not found: finale.avd");
@ -128,12 +128,12 @@ void Pingo::winning_pic() {
warning("STUB: Pingo::winning_pic()");
f.close();
_vm->_lucerna.blitfix();
_vm->_lucerna->blitfix();
//setvisualpage(0);
warning("STUB: Pingo::winning_pic()");
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
/*do {
_vm->_gyro->check();

View file

@ -47,7 +47,7 @@
namespace Avalanche {
void Scrolls::setParent(AvalancheEngine *vm) {
Scrolls::Scrolls(AvalancheEngine *vm) {
_vm = vm;
}
@ -154,7 +154,7 @@ void Scrolls::resetscrolldriver() { /* phew */
void Scrolls::dingdongbell() { /* Pussy's in the well. Who put her in? Little... */
byte fv;
for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna.errorled(); /* ring the bell "x" times */
for (fv = 1; fv <= _vm->_gyro->scrollbells; fv ++) _vm->_lucerna->errorled(); /* ring the bell "x" times */
}
void Scrolls::dodgem() { /* This moves the mouse pointer off the scroll so that you can read it. */
@ -329,7 +329,7 @@ void Scrolls::musical_scroll() {
display(Common::String("To play the harp...\r\rUse these keys:\r\n") +
"Q W E R T Y U I O P [ ]\r\rOr press Enter to stop playing.\4");
_vm->_lucerna.sprite_run();
_vm->_lucerna->sprite_run();
was_virtual = _vm->_gyro->visible == _vm->_gyro->m_virtual;

View file

@ -45,9 +45,9 @@ public:
void init();
Scrolls(AvalancheEngine *vm);
void setParent(AvalancheEngine *vm);
void init();
void state(byte x); /* Sets "Ready" light to whatever */

View file

@ -39,7 +39,7 @@
namespace Avalanche {
void Sequence::setParent(AvalancheEngine *vm) {
Sequence::Sequence(AvalancheEngine *vm) {
_vm = vm;
}
@ -77,7 +77,7 @@ void Sequence::start_to_close() {
void Sequence::start_to_open() {
_vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */
_vm->_trip.stopwalking(); /* And they're not moving now. */
_vm->_trip->stopwalking(); /* And they're not moving now. */
start_to_close(); /* Apart from that, it's the same thing. */
}
@ -95,7 +95,7 @@ void Sequence::call_sequencer() {
break; /* No more routines. */
case 177:
_vm->_gyro->dna.user_moves_avvy = true;
_vm->_trip.fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
_vm->_trip->fliproom(_vm->_gyro->dna.flip_to_where, _vm->_gyro->dna.flip_to_ped); /* 177 = Flip room. */
if (seq[0] == 177)
shove_left();
break;
@ -103,7 +103,7 @@ void Sequence::call_sequencer() {
if ((seq[0] >= 1) && (seq[0] <= 176)) {
/* Show a frame. */
_vm->_celer.show_one(seq[1]);
_vm->_celer->show_one(seq[1]);
shove_left();
}

View file

@ -46,7 +46,7 @@ public:
byte seq[seq_length];
void setParent(AvalancheEngine *vm);
Sequence(AvalancheEngine *vm);
void first_show(byte what);

View file

@ -142,13 +142,13 @@ void Timeout::one_tick() {
jump();
break;
case procsequence:
_vm->_sequence.call_sequencer();
_vm->_sequence->call_sequencer();
break;
case proccrapulus_splud_out:
crapulus_says_splud_out();
break;
case procdawn_delay:
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
break;
case procbuydrinks:
buydrinks();
@ -239,7 +239,7 @@ end;*/
void Timeout::open_drawbridge() {
_vm->_gyro->dna.drawbridge_open++;
_vm->_celer.show_one(_vm->_gyro->dna.drawbridge_open - 1);
_vm->_celer->show_one(_vm->_gyro->dna.drawbridge_open - 1);
if (_vm->_gyro->dna.drawbridge_open == 4)
_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
@ -250,39 +250,39 @@ void Timeout::open_drawbridge() {
/* --- */
void Timeout::avaricius_talks() {
_vm->_visa.dixi('q', _vm->_gyro->dna.avaricius_talk);
_vm->_visa->dixi('q', _vm->_gyro->dna.avaricius_talk);
_vm->_gyro->dna.avaricius_talk++;
if (_vm->_gyro->dna.avaricius_talk < 17)
set_up_timer(177, procavaricius_talks, reason_avariciustalks);
else
_vm->_lucerna.points(3);
_vm->_lucerna->points(3);
}
void Timeout::urinate() {
_vm->_trip.tr[1].turn(_vm->_trip.up);
_vm->_trip.stopwalking();
_vm->_lucerna.showrw();
_vm->_trip->tr[1].turn(_vm->_trip->up);
_vm->_trip->stopwalking();
_vm->_lucerna->showrw();
set_up_timer(14, proctoilet2, reason_gototoilet);
}
void Timeout::toilet2() {
_vm->_scrolls.display("That's better!");
_vm->_scrolls->display("That's better!");
}
void Timeout::bang() {
_vm->_scrolls.display("\6< BANG! >");
_vm->_scrolls->display("\6< BANG! >");
set_up_timer(30, procbang2, reason_explosion);
}
void Timeout::bang2() {
_vm->_scrolls.display("Hmm... sounds like Spludwick's up to something...");
_vm->_scrolls->display("Hmm... sounds like Spludwick's up to something...");
}
void Timeout::stairs() {
_vm->_gyro->blip();
_vm->_trip.tr[0].walkto(4);
_vm->_celer.show_one(2);
_vm->_trip->tr[0].walkto(4);
_vm->_celer->show_one(2);
_vm->_gyro->dna.brummie_stairs = 2;
_vm->_gyro->magics[11].op = _vm->_gyro->special;
_vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */
@ -293,68 +293,68 @@ void Timeout::cardiff_survey() {
switch (_vm->_gyro->dna.cardiff_things) {
case 0:
_vm->_gyro->dna.cardiff_things += 1;
_vm->_visa.dixi('q', 27);
_vm->_visa->dixi('q', 27);
break;
}
_vm->_visa.dixi('z', _vm->_gyro->dna.cardiff_things);
_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
}
void Timeout::cardiff_return() {
_vm->_visa.dixi('q', 28);
_vm->_visa->dixi('q', 28);
cardiff_survey(); /* add end of question. */
}
void Timeout::cwytalot_in_herts() {
_vm->_visa.dixi('q', 29);
_vm->_visa->dixi('q', 29);
}
void Timeout::get_tied_up() {
_vm->_visa.dixi('q', 34); /* ...Trouble! */
_vm->_visa->dixi('q', 34); /* ...Trouble! */
_vm->_gyro->dna.user_moves_avvy = false;
_vm->_gyro->dna.been_tied_up = true;
_vm->_trip.stopwalking();
_vm->_trip.tr[2].stopwalk();
_vm->_trip.tr[2].stophoming();
_vm->_trip.tr[2].call_eachstep = true;
_vm->_trip.tr[2].eachstep = _vm->_trip.procgrab_avvy;
_vm->_trip->stopwalking();
_vm->_trip->tr[2].stopwalk();
_vm->_trip->tr[2].stophoming();
_vm->_trip->tr[2].call_eachstep = true;
_vm->_trip->tr[2].eachstep = _vm->_trip->procgrab_avvy;
set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
}
void Timeout::get_tied_up2() {
_vm->_trip.tr[1].walkto(4);
_vm->_trip.tr[2].walkto(5);
_vm->_trip->tr[1].walkto(4);
_vm->_trip->tr[2].walkto(5);
_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
_vm->_gyro->dna.friar_will_tie_you_up = true;
}
void Timeout::hang_around() {
_vm->_trip.tr[2].check_me = false;
_vm->_trip.tr[1].init(7, true, &_vm->_trip); /* Robin Hood */
_vm->_trip->tr[2].check_me = false;
_vm->_trip->tr[1].init(7, true, _vm->_trip); /* Robin Hood */
_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
_vm->_trip.apped(1, 2);
_vm->_visa.dixi('q', 39);
_vm->_trip.tr[1].walkto(7);
_vm->_trip->apped(1, 2);
_vm->_visa->dixi('q', 39);
_vm->_trip->tr[1].walkto(7);
set_up_timer(55, prochang_around2, reason_hanging_around);
}
void Timeout::hang_around2() {
_vm->_visa.dixi('q', 40);
_vm->_trip.tr[2].vanishifstill = false;
_vm->_trip.tr[2].walkto(4);
_vm->_visa->dixi('q', 40);
_vm->_trip->tr[2].vanishifstill = false;
_vm->_trip->tr[2].walkto(4);
_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
_vm->_visa.dixi('q', 41);
_vm->_trip.tr[1].done();
_vm->_trip.tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
_vm->_visa->dixi('q', 41);
_vm->_trip->tr[1].done();
_vm->_trip->tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
/* Immediately call the following proc (when you have a chance). */
_vm->_gyro->dna.tied_up = false;
_vm->_enid.back_to_bootstrap(1); /* Call the shoot-'em-up. */
_vm->_enid->back_to_bootstrap(1); /* Call the shoot-'em-up. */
}
void Timeout::after_the_shootemup() {
@ -366,17 +366,17 @@ void Timeout::jacques_wakes_up() {
switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
case 1 :
_vm->_celer.show_one(1); /* Eyes open. */
_vm->_visa.dixi('Q', 45);
_vm->_celer->show_one(1); /* Eyes open. */
_vm->_visa->dixi('Q', 45);
break;
case 2 : /* Going through the door. */
_vm->_celer.show_one(2); /* Not on the floor. */
_vm->_celer.show_one(3); /* But going through the door. */
_vm->_celer->show_one(2); /* Not on the floor. */
_vm->_celer->show_one(3); /* But going through the door. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */
break;
case 3 : /* Gone through the door. */
_vm->_celer.show_one(2); /* Not on the floor, either. */
_vm->_celer.show_one(4); /* He's gone... so the door's open. */
_vm->_celer->show_one(2); /* Not on the floor, either. */
_vm->_celer->show_one(4); /* He's gone... so the door's open. */
_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */
break;
}
@ -385,7 +385,7 @@ void Timeout::jacques_wakes_up() {
if (_vm->_gyro->dna.jacques_awake == 5) {
_vm->_gyro->dna.ringing_bells = true;
_vm->_gyro->dna.ayles_is_awake = true;
_vm->_lucerna.points(2);
_vm->_lucerna->points(2);
}
switch (_vm->_gyro->dna.jacques_awake) {
@ -403,29 +403,29 @@ void Timeout::jacques_wakes_up() {
void Timeout::naughty_duke() {
/* This is when the Duke comes in and takes your money. */
_vm->_trip.tr[2].init(9, false, &_vm->_trip); /* Here comes the Duke. */
_vm->_trip.apped(2, 1); /* He starts at the door... */
_vm->_trip.tr[2].walkto(3); /* He walks over to you. */
_vm->_trip->tr[2].init(9, false, _vm->_trip); /* Here comes the Duke. */
_vm->_trip->apped(2, 1); /* He starts at the door... */
_vm->_trip->tr[2].walkto(3); /* He walks over to you. */
/* Let's get the door opening. */
_vm->_celer.show_one(1);
_vm->_sequence.first_show(2);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(1);
_vm->_sequence->first_show(2);
_vm->_sequence->start_to_close();
set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
}
void Timeout::naughty_duke2() {
_vm->_visa.dixi('q', 48); /* Ha ha, it worked again! */
_vm->_trip.tr[2].walkto(1); /* Walk to the door. */
_vm->_trip.tr[2].vanishifstill = true; /* Then go away! */
_vm->_visa->dixi('q', 48); /* Ha ha, it worked again! */
_vm->_trip->tr[2].walkto(1); /* Walk to the door. */
_vm->_trip->tr[2].vanishifstill = true; /* Then go away! */
set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
}
void Timeout::naughty_duke3() {
_vm->_celer.show_one(1);
_vm->_sequence.first_show(2);
_vm->_sequence.start_to_close();
_vm->_celer->show_one(1);
_vm->_sequence->first_show(2);
_vm->_sequence->start_to_close();
}
void Timeout::jump() {
@ -433,7 +433,7 @@ void Timeout::jump() {
with.jumpstatus += 1;
triptype &with1 = _vm->_trip.tr[1];
triptype &with1 = _vm->_trip->tr[1];
switch (with.jumpstatus) {
case 1:
case 2:
@ -465,80 +465,80 @@ void Timeout::jump() {
if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
&& (_vm->_gyro->dna.arrow_in_the_door == true)
&& (_vm->_trip.infield(3))) { /* beside the wall*/
&& (_vm->_trip->infield(3))) { /* beside the wall*/
/* Grab the arrow! */
if (_vm->_gyro->dna.carrying >= maxobjs)
_vm->_scrolls.display("You fail to grab it, because your hands are full.");
_vm->_scrolls->display("You fail to grab it, because your hands are full.");
else {
_vm->_celer.show_one(2);
_vm->_celer->show_one(2);
_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
_vm->_gyro->dna.obj[_vm->_gyro->bolt] = true;
_vm->_lucerna.objectlist();
_vm->_visa.dixi('q', 50);
_vm->_lucerna.points(3);
_vm->_lucerna->objectlist();
_vm->_visa->dixi('q', 50);
_vm->_lucerna->points(3);
}
}
}
void Timeout::crapulus_says_splud_out() {
_vm->_visa.dixi('q', 56);
_vm->_visa->dixi('q', 56);
_vm->_gyro->dna.crapulus_will_tell = false;
}
void Timeout::buydrinks() {
_vm->_celer.show_one(11); /* Malagauche gets up again. */
_vm->_celer->show_one(11); /* Malagauche gets up again. */
_vm->_gyro->dna.malagauche = 0;
_vm->_visa.dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls.display message about it. */
_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls->display message about it. */
_vm->_pingo->wobble(); /* Do the special effects. */
_vm->_visa.dixi('D', 1); /* That'll be thruppence. */
_vm->_visa->dixi('D', 1); /* That'll be thruppence. */
if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
_vm->_visa.dixi('D', 3); /* Tell 'em you paid up. */
_vm->_acci.have_a_drink();
_vm->_visa->dixi('D', 3); /* Tell 'em you paid up. */
_vm->_acci->have_a_drink();
}
void Timeout::buywine() {
_vm->_celer.show_one(11); /* Malagauche gets up again. */
_vm->_celer->show_one(11); /* Malagauche gets up again. */
_vm->_gyro->dna.malagauche = 0;
_vm->_visa.dixi('D', 50); /* You buy the wine. */
_vm->_visa.dixi('D', 1); /* It'll be thruppence. */
_vm->_visa->dixi('D', 50); /* You buy the wine. */
_vm->_visa->dixi('D', 1); /* It'll be thruppence. */
if (_vm->_gyro->pennycheck(3)) {
_vm->_visa.dixi('D', 4); /* You paid up. */
_vm->_visa->dixi('D', 4); /* You paid up. */
_vm->_gyro->dna.obj[_vm->_gyro->wine] = true;
_vm->_lucerna.objectlist();
_vm->_lucerna->objectlist();
_vm->_gyro->dna.winestate = 1; /* OK Wine */
}
}
void Timeout::callsguards() {
_vm->_visa.dixi('Q', 58); /* GUARDS!!! */
_vm->_lucerna.gameover();
_vm->_visa->dixi('Q', 58); /* GUARDS!!! */
_vm->_lucerna->gameover();
}
void Timeout::greetsmonk() {
_vm->_visa.dixi('Q', 59);
_vm->_visa->dixi('Q', 59);
_vm->_gyro->dna.entered_lusties_room_as_monk = true;
}
void Timeout::fall_down_oubliette() {
_vm->_gyro->magics[9].op = _vm->_gyro->nix;
_vm->_trip.tr[1].iy += 1; /* increments dx/dy! */
_vm->_trip.tr[1].y += _vm->_trip.tr[1].iy; /* Dowwwn we go... */
_vm->_trip->tr[1].iy += 1; /* increments dx/dy! */
_vm->_trip->tr[1].y += _vm->_trip->tr[1].iy; /* Dowwwn we go... */
set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
}
void Timeout::meet_avaroid() {
if (_vm->_gyro->dna.met_avaroid) {
_vm->_scrolls.display("You can't expect to be \6that\22 lucky twice in a row!");
_vm->_lucerna.gameover();
_vm->_scrolls->display("You can't expect to be \6that\22 lucky twice in a row!");
_vm->_lucerna->gameover();
} else {
_vm->_visa.dixi('Q', 60);
_vm->_visa->dixi('Q', 60);
_vm->_gyro->dna.met_avaroid = true;
set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
triptype &with = _vm->_trip.tr[1];
with.face = _vm->_trip.left;
triptype &with = _vm->_trip->tr[1];
with.face = _vm->_trip->left;
with.x = 151;
with.ix = -3;
with.iy = -5;
@ -548,7 +548,7 @@ void Timeout::meet_avaroid() {
}
void Timeout::rise_up_oubliette() {
triptype &with = _vm->_trip.tr[1];
triptype &with = _vm->_trip->tr[1];
with.visible = true;
with.iy += 1; /* decrements dx/dy! */
@ -560,96 +560,96 @@ void Timeout::rise_up_oubliette() {
}
void Timeout::robin_hood_and_geida() {
_vm->_trip.tr[1].init(7, true, &_vm->_trip);
_vm->_trip.apped(1, 7);
_vm->_trip.tr[1].walkto(6);
_vm->_trip.tr[2].stopwalk();
_vm->_trip.tr[2].face = _vm->_trip.left;
_vm->_trip->tr[1].init(7, true, _vm->_trip);
_vm->_trip->apped(1, 7);
_vm->_trip->tr[1].walkto(6);
_vm->_trip->tr[2].stopwalk();
_vm->_trip->tr[2].face = _vm->_trip->left;
set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
_vm->_gyro->dna.geida_follows = false;
}
void Timeout::robin_hood_and_geida_talk() {
_vm->_visa.dixi('q', 66);
_vm->_trip.tr[1].walkto(2);
_vm->_trip.tr[2].walkto(2);
_vm->_trip.tr[1].vanishifstill = true;
_vm->_trip.tr[2].vanishifstill = true;
_vm->_visa->dixi('q', 66);
_vm->_trip->tr[1].walkto(2);
_vm->_trip->tr[2].walkto(2);
_vm->_trip->tr[1].vanishifstill = true;
_vm->_trip->tr[2].vanishifstill = true;
set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
}
void Timeout::avalot_returns() {
_vm->_trip.tr[1].done();
_vm->_trip.tr[2].done();
_vm->_trip.tr[1].init(0, true, &_vm->_trip);
_vm->_trip.apped(1, 1);
_vm->_visa.dixi('q', 67);
_vm->_trip->tr[1].done();
_vm->_trip->tr[2].done();
_vm->_trip->tr[1].init(0, true, _vm->_trip);
_vm->_trip->apped(1, 1);
_vm->_visa->dixi('q', 67);
_vm->_gyro->dna.user_moves_avvy = true;
}
void Timeout::avvy_sit_down() {
/* This is used when you sit down in the pub in Notts. It loops around so
that it will happen when Avvy stops walking. */
if (_vm->_trip.tr[1].homing) /* Still walking */
if (_vm->_trip->tr[1].homing) /* Still walking */
set_up_timer(1, procavvy_sit_down, reason_sitting_down);
else {
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
_vm->_gyro->dna.sitting_in_pub = true;
_vm->_gyro->dna.user_moves_avvy = false;
_vm->_trip.tr[1].visible = false;
_vm->_trip->tr[1].visible = false;
}
}
void Timeout::ghost_room_phew() {
_vm->_scrolls.display("\6PHEW!\22 You're glad to get out of \6there!");
_vm->_scrolls->display("\6PHEW!\22 You're glad to get out of \6there!");
}
void Timeout::arkata_shouts() {
if (_vm->_gyro->dna.teetotal)
return;
_vm->_visa.dixi('q', 76);
_vm->_visa->dixi('q', 76);
set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
}
void Timeout::winning() {
_vm->_visa.dixi('q', 79);
_vm->_visa->dixi('q', 79);
_vm->_pingo->winning_pic();
do {
_vm->_lucerna.checkclick();
_vm->_lucerna->checkclick();
} while (!(_vm->_gyro->mrelease == 0));
_vm->_lucerna.callverb(_vm->_acci.vb_score);
_vm->_scrolls.display(" T H E E N D ");
_vm->_lucerna->callverb(_vm->_acci->vb_score);
_vm->_scrolls->display(" T H E E N D ");
_vm->_gyro->lmo = true;
}
void Timeout::avalot_falls() {
if (_vm->_trip.tr[1].step < 5) {
_vm->_trip.tr[1].step += 1;
if (_vm->_trip->tr[1].step < 5) {
_vm->_trip->tr[1].step += 1;
set_up_timer(3, procavalot_falls, reason_falling_over);
} else
_vm->_scrolls.display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
}
void Timeout::spludwick_goes_to_cauldron() {
if (_vm->_trip.tr[2].homing)
if (_vm->_trip->tr[2].homing)
set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
else
set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
}
void Timeout::spludwick_leaves_cauldron() {
_vm->_trip.tr[2].call_eachstep = true; /* So that normal procs will continue. */
_vm->_trip->tr[2].call_eachstep = true; /* So that normal procs will continue. */
}
void Timeout::give_lute_to_geida() { /* Moved here from Acci. */
_vm->_visa.dixi('Q', 86);
_vm->_lucerna.points(4);
_vm->_visa->dixi('Q', 86);
_vm->_lucerna->points(4);
_vm->_gyro->dna.lustie_is_asleep = true;
_vm->_sequence.first_show(5);
_vm->_sequence.then_show(6); /* He falls asleep... */
_vm->_sequence.start_to_close(); /* Not really closing, but we're using the same procedure. */
_vm->_sequence->first_show(5);
_vm->_sequence->then_show(6); /* He falls asleep... */
_vm->_sequence->start_to_close(); /* Not really closing, but we're using the same procedure. */
}
/* "This is all!" */

View file

@ -234,7 +234,7 @@ void triptype::walk() {
break;
case _tr->_vm->_gyro->unfinished: {
bounce();
_tr->_vm->_scrolls.display("\7Sorry.\3\rThis place is not available yet!");
_tr->_vm->_scrolls->display("\7Sorry.\3\rThis place is not available yet!");
}
break;
case _tr->_vm->_gyro->special:
@ -265,7 +265,7 @@ void triptype::bounce() {
else
stopwalk();
_tr->_vm->_gyro->oncandopageswap = false;
_tr->_vm->_lucerna.showrw();
_tr->_vm->_lucerna->showrw();
_tr->_vm->_gyro->oncandopageswap = true;
}
@ -465,15 +465,13 @@ void getsettype::recall(bytefield &r) {
Trip::Trip() {
Trip::Trip(AvalancheEngine *vm) {
_vm = vm;
getsetclear();
mustexclaim = false;
}
void Trip::setParent(AvalancheEngine *vm) {
_vm = vm;
}
void Trip::loadtrip() {
byte gm;
@ -541,18 +539,18 @@ void Trip::catamove(byte ped) {
switch (xy_uint16) {
case 1801: /* Exit catacombs */
fliproom(r__lustiesroom, 4);
_vm->_scrolls.display("Phew! Nice to be out of there!");
_vm->_scrolls->display("Phew! Nice to be out of there!");
return;
case 1033: /* Oubliette */
fliproom(r__oubliette, 1);
_vm->_scrolls.display("Oh, NO!\231\2");
_vm->_scrolls->display("Oh, NO!\231\2");
return;
case 4:
fliproom(r__geidas, 1);
return;
case 2307:
fliproom(r__lusties, 5);
_vm->_scrolls.display("Oh no... here we go again...");
_vm->_scrolls->display("Oh no... here we go again...");
_vm->_gyro->dna.user_moves_avvy = false;
tr[1].iy = 1;
tr[1].ix = 0;
@ -560,7 +558,7 @@ void Trip::catamove(byte ped) {
}
if (!_vm->_gyro->dna.enter_catacombs_from_lusties_room)
_vm->_lucerna.load(29);
_vm->_lucerna->load(29);
here = _vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x];
switch (here & 0xf) { /* West. */
@ -568,59 +566,59 @@ void Trip::catamove(byte ped) {
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(28);
_vm->_celer->show_one(28);
break;
case 0x1: /* no connection (wall + shield), */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(29); /* ...shield. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(29); /* ...shield. */
break;
case 0x2: /* wall with door */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(30); /* ...door. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(30); /* ...door. */
break;
case 0x3: /* wall with door and shield */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(30); /* ...door, and... */
_vm->_celer.show_one(29); /* ...shield. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(30); /* ...door, and... */
_vm->_celer->show_one(29); /* ...shield. */
break;
case 0x4: /* no connection (wall + window), */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(5); /* ...window. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(5); /* ...window. */
break;
case 0x5: /* wall with door and window */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(30); /* ...door, and... */
_vm->_celer.show_one(5); /* ...window. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(30); /* ...door, and... */
_vm->_celer->show_one(5); /* ...window. */
break;
case 0x6: /* no connection (wall + torches), */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->nix; /* No door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(7); /* ...torches. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(7); /* ...torches. */
break;
case 0x7: /* wall with door and torches */
_vm->_gyro->magics[2].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[3].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[13].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(28); /* Wall, plus... */
_vm->_celer.show_one(30); /* ...door, and... */
_vm->_celer.show_one(7); /* ...torches. */
_vm->_celer->show_one(28); /* Wall, plus... */
_vm->_celer->show_one(30); /* ...door, and... */
_vm->_celer->show_one(7); /* ...torches. */
break;
case 0xf: /* straight-through corridor. */
_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* Sloping wall. */
@ -635,44 +633,44 @@ void Trip::catamove(byte ped) {
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(19);
_vm->_celer->show_one(19);
break;
case 0x1: /* no connection (wall + window), */
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(19); /* Wall, plus... */
_vm->_celer.show_one(20); /* ...window. */
_vm->_celer->show_one(19); /* Wall, plus... */
_vm->_celer->show_one(20); /* ...window. */
break;
case 0x2: /* wall with door */
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(19); /* Wall, plus... */
_vm->_celer.show_one(21); /* ...door. */
_vm->_celer->show_one(19); /* Wall, plus... */
_vm->_celer->show_one(21); /* ...door. */
break;
case 0x3: /* wall with door and window */
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(19); /* Wall, plus... */
_vm->_celer.show_one(20); /* ...door, and... */
_vm->_celer.show_one(21); /* ...window. */
_vm->_celer->show_one(19); /* Wall, plus... */
_vm->_celer->show_one(20); /* ...door, and... */
_vm->_celer->show_one(21); /* ...window. */
break;
case 0x6: /* no connection (wall + torches), */
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->nix; /* No door. */
_vm->_celer.show_one(19); /* Wall, plus... */
_vm->_celer.show_one(18); /* ...torches. */
_vm->_celer->show_one(19); /* Wall, plus... */
_vm->_celer->show_one(18); /* ...torches. */
break;
case 0x7: /* wall with door and torches */
_vm->_gyro->magics[5].op = _vm->_gyro->bounces; /* Sloping wall. */
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* Straight wall. */
_vm->_gyro->portals[15].op = _vm->_gyro->special; /* Door. */
_vm->_celer.show_one(19); /* Wall, plus... */
_vm->_celer.show_one(21); /* ...door, and... */
_vm->_celer.show_one(18); /* ...torches. */
_vm->_celer->show_one(19); /* Wall, plus... */
_vm->_celer->show_one(21); /* ...door, and... */
_vm->_celer->show_one(18); /* ...torches. */
break;
case 0xf: /* straight-through corridor. */
_vm->_gyro->magics[5].op = _vm->_gyro->nix; /* Sloping wall. */
@ -690,7 +688,7 @@ void Trip::catamove(byte ped) {
_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
break;
case 0x1:
_vm->_celer.show_one(22);
_vm->_celer->show_one(22);
if ((xy_uint16 == 2051) & (_vm->_gyro->dna.geida_follows))
_vm->_gyro->magics[13].op = _vm->_gyro->exclaim;
@ -701,13 +699,13 @@ void Trip::catamove(byte ped) {
_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
break;
case 0x2:
_vm->_celer.show_one(23);
_vm->_celer->show_one(23);
_vm->_gyro->magics[7].op = _vm->_gyro->special; /* Middle exit south. */
_vm->_gyro->magics[12].op = _vm->_gyro->bounces;
_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
break;
case 0x3:
_vm->_celer.show_one(24);
_vm->_celer->show_one(24);
_vm->_gyro->magics[12].op = _vm->_gyro->special; /* Left exit south. */
_vm->_gyro->magics[7].op = _vm->_gyro->bounces;
_vm->_gyro->magics[13].op = _vm->_gyro->bounces;
@ -722,36 +720,36 @@ void Trip::catamove(byte ped) {
// LEFT handles:
/*
case 0x1:
_vm->_celer.show_one(4);
_vm->_celer->show_one(4);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
break;
*/
case 0x2:
_vm->_celer.show_one(4);
_vm->_celer->show_one(4);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // Middle exit north.
_vm->_gyro->portals[12].op = _vm->_gyro->special; // Door.
break;
/* case 0x3:
_vm->_celer.show_one(4);
_vm->_celer->show_one(4);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. } { Change magic number! }
_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
break;
// RIGHT handles:
case 0x4:
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Left exit north. } { Change magic number! }
_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
break;
*/
case 0x5:
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; /* Middle exit north. */
_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
break;
/*
case 0x6:
_vm->_celer.show_one(3);
_vm->_celer->show_one(3);
_vm->_gyro->magics[1].op = _vm->_gyro->bounces; // { Right exit north. }
_vm->_gyro->portals[12].op = _vm->_gyro->special; // { Door. }
break;
@ -760,12 +758,12 @@ void Trip::catamove(byte ped) {
case 0x7:
case 0x8:
case 0x9: {
_vm->_celer.show_one(6);
_vm->_celer->show_one(6);
if (((here & 0xf000) >> 12) > 0x7)
_vm->_celer.show_one(31);
_vm->_celer->show_one(31);
if (((here & 0xf000) >> 12) == 0x9)
_vm->_celer.show_one(32);
_vm->_celer->show_one(32);
_vm->_gyro->magics[1].op = _vm->_gyro->special; /* Middle arch north. */
_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
@ -775,50 +773,50 @@ void Trip::catamove(byte ped) {
case 0xd: /* No connection + WINDOW */
_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(14);
_vm->_celer->show_one(14);
break;
case 0xe: /* No connection + TORCH */
_vm->_gyro->magics[1].op = _vm->_gyro->bounces;
_vm->_gyro->portals[12].op = _vm->_gyro->nix; /* Door. */
_vm->_celer.show_one(8);
_vm->_celer->show_one(8);
break;
/* Recessed door: */
case 0xf:
_vm->_gyro->magics[1].op = _vm->_gyro->nix; /* Door to Geida's room. */
_vm->_celer.show_one(1);
_vm->_celer->show_one(1);
_vm->_gyro->portals[12].op = _vm->_gyro->special; /* Door. */
break;
}
switch (xy_uint16) {
case 514:
_vm->_celer.show_one(17);
_vm->_celer->show_one(17);
break; /* [2,2] : "Art Gallery" sign over door. */
case 264:
_vm->_celer.show_one(9);
_vm->_celer->show_one(9);
break; /* [8,1] : "The Wrong Way!" sign. */
case 1797:
_vm->_celer.show_one(2);
_vm->_celer->show_one(2);
break; /* [5,7] : "Ite Mingite" sign. */
case 258:
for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
_vm->_celer.show_one_at(15, 130 + fv * 120, 70);
_vm->_celer.show_one_at(16, 184 + fv * 120, 78);
_vm->_celer->show_one_at(15, 130 + fv * 120, 70);
_vm->_celer->show_one_at(16, 184 + fv * 120, 78);
}
break;
case 1287:
for (fv = 10; fv <= 13; fv++)
_vm->_celer.show_one(fv);
_vm->_celer->show_one(fv);
break; /* [7,5] : 4 candles. */
case 776:
_vm->_celer.show_one(10);
_vm->_celer->show_one(10);
break; /* [8,3] : 1 candle. */
case 2049:
_vm->_celer.show_one(11);
_vm->_celer->show_one(11);
break; /* [1,8] : another candle. */
case 257:
_vm->_celer.show_one(12);
_vm->_celer.show_one(13);
_vm->_celer->show_one(12);
_vm->_celer->show_one(13);
break; /* [1,1] : the other two. */
}
@ -843,7 +841,7 @@ void Trip::dawndelay() {
void Trip::call_special(uint16 which) {
switch (which) {
case 1: /* _vm->_gyro->special 1: Room 22: top of stairs. */
_vm->_celer.show_one(1);
_vm->_celer->show_one(1);
_vm->_gyro->dna.brummie_stairs = 1;
_vm->_gyro->magics[10].op = _vm->_gyro->nix;
_vm->_timeout->set_up_timer(10, _vm->_timeout->procstairs, _vm->_timeout->reason_brummiestairs);
@ -857,7 +855,7 @@ void Trip::call_special(uint16 which) {
_vm->_gyro->magics[12].data = 5;
_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Now works as planned! */
stopwalking();
_vm->_visa.dixi('q', 26);
_vm->_visa->dixi('q', 26);
_vm->_gyro->dna.user_moves_avvy = true;
break;
case 3: /* _vm->_gyro->special 3: Room 71: triggers dart. */
@ -877,20 +875,20 @@ void Trip::call_special(uint16 which) {
}
break;
case 4: /* This is the ghost room link. */
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
tr[1].turn(right); /* you'll see this after we get back from bootstrap */
_vm->_timeout->set_up_timer(1, _vm->_timeout->procghost_room_phew, _vm->_timeout->reason_ghost_room_phew);
_vm->_enid.back_to_bootstrap(3);
_vm->_enid->back_to_bootstrap(3);
break;
case 5:
if (_vm->_gyro->dna.friar_will_tie_you_up) {
/* _vm->_gyro->special 5: Room 42: touched tree, and get tied up. */
_vm->_gyro->magics[4].op = _vm->_gyro->bounces; /* Boundary effect is now working again. */
_vm->_visa.dixi('q', 35);
_vm->_visa->dixi('q', 35);
tr[1].done();
/*tr[1].vanishifstill:=true;*/
_vm->_celer.show_one(2);
_vm->_visa.dixi('q', 36);
_vm->_celer->show_one(2);
_vm->_visa->dixi('q', 36);
_vm->_gyro->dna.tied_up = true;
_vm->_gyro->dna.friar_will_tie_you_up = false;
tr[2].walkto(3);
@ -912,18 +910,18 @@ void Trip::call_special(uint16 which) {
_vm->_gyro->magics[10].op = _vm->_gyro->nix;
stopwalking();
_vm->_timeout->lose_timer(_vm->_timeout->reason_falling_down_oubliette);
_vm->_lucerna.mblit(12, 80, 38, 160, 3, 0);
_vm->_lucerna.mblit(12, 80, 38, 160, 3, 1);
_vm->_scrolls.display("Oh dear, you seem to be down the bottom of an oubliette.");
_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
_vm->_scrolls->display("Oh dear, you seem to be down the bottom of an oubliette.");
_vm->_timeout->set_up_timer(200, _vm->_timeout->procmeet_avaroid, _vm->_timeout->reason_meeting_avaroid);
break;
case 8: /* _vm->_gyro->special 8: leave du Lustie's room. */
if ((_vm->_gyro->dna.geida_follows) && (!_vm->_gyro->dna.lustie_is_asleep)) {
_vm->_visa.dixi('q', 63);
_vm->_visa->dixi('q', 63);
tr[2].turn(down);
tr[2].stopwalk();
tr[2].call_eachstep = false; /* Geida */
_vm->_lucerna.gameover();
_vm->_lucerna->gameover();
}
break;
case 9: /* _vm->_gyro->special 9: lose Geida to Robin Hood... */
@ -939,18 +937,18 @@ void Trip::call_special(uint16 which) {
if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) {
/* Into Geida's room. */
if (_vm->_gyro->dna.obj[_vm->_gyro->key])
_vm->_visa.dixi('q', 62);
_vm->_visa->dixi('q', 62);
else {
_vm->_visa.dixi('q', 61);
_vm->_visa->dixi('q', 61);
return;
}
}
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->dna.cat_y -= 1;
catamove(4);
if (_vm->_gyro->dna.room != r__catacombs)
return;
_vm->_lucerna.delavvy();
_vm->_lucerna->delavvy();
switch ((_vm->_gyro->catamap[_vm->_gyro->dna.cat_y][_vm->_gyro->dna.cat_x] & 0xf00) >> 8) {
case 0x1:
apped(1, 12);
@ -965,34 +963,34 @@ void Trip::call_special(uint16 which) {
dawndelay();
break;
case 11: /* _vm->_gyro->special 11: transfer east in catacombs. */
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->dna.cat_x += 1;
catamove(1);
if (_vm->_gyro->dna.room != r__catacombs)
return;
_vm->_lucerna.delavvy();
_vm->_lucerna->delavvy();
apped(1, 1);
getback();
dawndelay();
break;
case 12: /* _vm->_gyro->special 12: transfer south in catacombs. */
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->dna.cat_y += 1;
catamove(2);
if (_vm->_gyro->dna.room != r__catacombs)
return;
_vm->_lucerna.delavvy();
_vm->_lucerna->delavvy();
apped(1, 2);
getback();
dawndelay();
break;
case 13: /* _vm->_gyro->special 13: transfer west in catacombs. */
_vm->_lucerna.dusk();
_vm->_lucerna->dusk();
_vm->_gyro->dna.cat_x -= 1;
catamove(3);
if (_vm->_gyro->dna.room != r__catacombs)
return;
_vm->_lucerna.delavvy();
_vm->_lucerna->delavvy();
apped(1, 3);
getback();
dawndelay();
@ -1010,52 +1008,52 @@ void Trip::open_the_door(byte whither, byte ped, byte magicnum) {
case r__outsideyours:
case r__outsidenottspub:
case r__outsideducks:
_vm->_sequence.first_show(1);
_vm->_sequence.then_show(2);
_vm->_sequence.then_show(3);
_vm->_sequence->first_show(1);
_vm->_sequence->then_show(2);
_vm->_sequence->then_show(3);
break;
case r__insidecardiffcastle:
_vm->_sequence.first_show(1);
_vm->_sequence.then_show(5);
_vm->_sequence->first_show(1);
_vm->_sequence->then_show(5);
break;
case r__avvysgarden:
case r__entrancehall:
case r__insideabbey:
_vm->_sequence.first_show(1);
_vm->_sequence.then_show(2);
_vm->_sequence->first_show(1);
_vm->_sequence->then_show(2);
break;
case r__musicroom:
case r__outsideargentpub:
_vm->_sequence.first_show(5);
_vm->_sequence.then_show(6);
_vm->_sequence->first_show(5);
_vm->_sequence->then_show(6);
break;
case r__lusties:
switch (magicnum) {
case 14:
if (_vm->_gyro->dna.avvys_in_the_cupboard) {
hide_in_the_cupboard();
_vm->_sequence.first_show(8);
_vm->_sequence.then_show(7);
_vm->_sequence.start_to_close();
_vm->_sequence->first_show(8);
_vm->_sequence->then_show(7);
_vm->_sequence->start_to_close();
return;
} else {
apped(1, 6);
tr[1].face = right; /* added by TT 12/3/1995 */
_vm->_sequence.first_show(8);
_vm->_sequence.then_show(9);
_vm->_sequence->first_show(8);
_vm->_sequence->then_show(9);
}
break;
case 12:
_vm->_sequence.first_show(4);
_vm->_sequence.then_show(5);
_vm->_sequence.then_show(6);
_vm->_sequence->first_show(4);
_vm->_sequence->then_show(5);
_vm->_sequence->then_show(6);
break;
}
break;
}
_vm->_sequence.then_flip(whither, ped);
_vm->_sequence.start_to_open();
_vm->_sequence->then_flip(whither, ped);
_vm->_sequence->start_to_open();
}
void Trip::newspeed() {
@ -1133,10 +1131,10 @@ void Trip::getback() {
end;
*/
_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
_vm->_lucerna->mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro->cp);
}
_vm->_lucerna.blitfix();
_vm->_lucerna->blitfix();
/*
if endangered then
@ -1199,7 +1197,7 @@ void Trip::arrow_procs(byte tripnum) {
/* OK, it's hit him... what now? */
tr[2].call_eachstep = false; /* prevent recursion. */
_vm->_visa.dixi('Q', 47); /* Complaint! */
_vm->_visa->dixi('Q', 47); /* Complaint! */
tr[tripnum].done(); /* Deallocate the arrow. */
/* tr[1].done; { Deallocate normal pic of Avvy. }
@ -1211,14 +1209,14 @@ void Trip::arrow_procs(byte tripnum) {
end;
on;*/
_vm->_lucerna.gameover();
_vm->_lucerna->gameover();
_vm->_gyro->dna.user_moves_avvy = false; /* Stop the user from moving him. */
_vm->_timeout->set_up_timer(55, _vm->_timeout->procnaughty_duke, _vm->_timeout->reason_naughty_duke);
}
} else { /* Arrow has hit the wall! */
tr[tripnum].done(); /* Deallocate the arrow. */
_vm->_celer.show_one(3); /* Show pic of arrow stuck into the door. */
_vm->_celer->show_one(3); /* Show pic of arrow stuck into the door. */
_vm->_gyro->dna.arrow_in_the_door = true; /* So that we can pick it up. */
}
@ -1282,7 +1280,7 @@ void Trip::spin(byte whichway, byte &tripnum) {
_vm->_gyro->dna.geida_spin += 1;
_vm->_gyro->dna.geida_time = 20;
if (_vm->_gyro->dna.geida_spin == 5) {
_vm->_scrolls.display("Steady on, Avvy, you'll make the poor girl dizzy!");
_vm->_scrolls->display("Steady on, Avvy, you'll make the poor girl dizzy!");
_vm->_gyro->dna.geida_spin = 0;
_vm->_gyro->dna.geida_time = 0; /* knock out records */
}
@ -1399,7 +1397,7 @@ void Trip::trippancy_link() {
}
if (mustexclaim) {
mustexclaim = false;
_vm->_visa.dixi('x', saywhat);
_vm->_visa->dixi('x', saywhat);
}
}
@ -1506,26 +1504,26 @@ void Trip::hide_in_the_cupboard() {
if (_vm->_gyro->dna.avvys_in_the_cupboard) {
if (_vm->_gyro->dna.wearing == nowt)
_vm->_scrolls.display("\6AVVY!\22 Get dressed first!");
_vm->_scrolls->display("\6AVVY!\22 Get dressed first!");
else {
tr[1].visible = true;
_vm->_gyro->dna.user_moves_avvy = true;
apped(1, 3); /* Walk out of the cupboard. */
_vm->_scrolls.display("You leave the cupboard. Nice to be out of there!");
_vm->_scrolls->display("You leave the cupboard. Nice to be out of there!");
_vm->_gyro->dna.avvys_in_the_cupboard = false;
_vm->_sequence.first_show(8);
_vm->_sequence.then_show(7);
_vm->_sequence.start_to_close();
_vm->_sequence->first_show(8);
_vm->_sequence->then_show(7);
_vm->_sequence->start_to_close();
}
} else {
/* Not hiding in the cupboard */
tr[1].visible = false;
_vm->_gyro->dna.user_moves_avvy = false;
_vm->_scrolls.display(Common::String("You walk into the room...\20It seems to be an empty, ") +
_vm->_scrolls->display(Common::String("You walk into the room...\20It seems to be an empty, ") +
"but dusty, cupboard. Hmmmm... you leave the door slightly open to " +
"avoid suffocation.");
_vm->_gyro->dna.avvys_in_the_cupboard = true;
_vm->_celer.show_one(8);
_vm->_celer->show_one(8);
}
}
@ -1564,8 +1562,8 @@ void Trip::fliproom(byte room, byte ped) {
beforex = _vm->_gyro->mx;
beforey = _vm->_gyro->my;
_vm->_lucerna.exitroom(_vm->_gyro->dna.room);
_vm->_lucerna.dusk();
_vm->_lucerna->exitroom(_vm->_gyro->dna.room);
_vm->_lucerna->dusk();
getsetclear();
@ -1577,18 +1575,18 @@ void Trip::fliproom(byte room, byte ped) {
if (_vm->_gyro->dna.room == r__lustiesroom)
_vm->_gyro->dna.enter_catacombs_from_lusties_room = true;
_vm->_lucerna.enterroom(room, ped);
_vm->_lucerna->enterroom(room, ped);
apped(1, ped);
_vm->_gyro->dna.enter_catacombs_from_lusties_room = false;
_vm->_gyro->oldrw = _vm->_gyro->dna.rw;
_vm->_gyro->dna.rw = tr[1].face;
_vm->_lucerna.showrw();
_vm->_lucerna->showrw();
for (fv = 0; fv <= 1; fv++) {
_vm->_gyro->cp = 1 - _vm->_gyro->cp;
getback();
}
_vm->_lucerna.dawn();
_vm->_lucerna->dawn();
/* Tidy up after mouse. I know it's a kludge... */
/* tidy_after_mouse;*/

View file

@ -154,9 +154,7 @@ public:
friend triptype;
friend getsettype;
Trip();
void setParent(AvalancheEngine *vm);
static const int16 up = 0;
static const int16 right = 1;
@ -187,6 +185,9 @@ public:
static const int16 procgeida_procs = 7;
Trip(AvalancheEngine *vm);
void trippancy_link();
void get_back_loretta();

View file

@ -41,7 +41,7 @@
namespace Avalanche {
void Visa::setParent(AvalancheEngine *vm) {
Visa::Visa(AvalancheEngine *vm) {
_vm = vm;
}
@ -86,7 +86,7 @@ namespace Avalanche {
if (report_dixi_errors) {
Common::String todisplay;
todisplay.format("%cError accessing scroll %c%s", 7, block, _vm->_gyro->strf(point).c_str());
_vm->_scrolls.display(todisplay);
_vm->_scrolls->display(todisplay);
}
return;
}
@ -103,7 +103,7 @@ namespace Avalanche {
if (bubbling) do_the_bubble();
_vm->_scrolls.calldrivers();
_vm->_scrolls->calldrivers();
}
void Visa::speech(byte who, byte subject) {
@ -152,7 +152,7 @@ namespace Avalanche {
unskrimble();
do_the_bubble();
_vm->_scrolls.calldrivers();
_vm->_scrolls->calldrivers();
went_ok = true;
}

View file

@ -37,7 +37,7 @@ class AvalancheEngine;
class Visa {
public:
void Visa::setParent(AvalancheEngine *vm);
Visa(AvalancheEngine *vm);
void dixi(char block, byte point);