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(); void init();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -42,12 +42,9 @@ namespace Avalanche {
const int16 Celer::on_disk = -1; const int16 Celer::on_disk = -1;
Celer::Celer() { Celer::Celer(AvalancheEngine *vm) {
num_chunks = 0;
}
void Celer::setParent(AvalancheEngine *vm) {
_vm = vm; _vm = vm;
num_chunks = 0;
} }
void Celer::pics_link() { 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->_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; 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; 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; xx = 4;
if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@ -160,11 +157,11 @@ void Celer::pics_link() {
xx = 4; /* du Lustie blinks */ xx = 4; /* du Lustie blinks */
/* Bearing of Avvy from du Lustie. */ /* 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. */ 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. */ 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. */ xx = 3; /* Right. */
if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/ if (xx != _vm->_gyro->dna.dogfoodpos) { /* Only if it's changed.*/
@ -202,11 +199,11 @@ void Celer::pics_link() {
case r__nottspub: case r__nottspub:
/* Bearing of Avvy from Port. */ /* 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. */ 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. */ 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. */ xx = 8; /* Right. */
if ((_vm->_gyro->roomtime % int32(60)) > 57) if ((_vm->_gyro->roomtime % int32(60)) > 57)
@ -231,12 +228,12 @@ void Celer::pics_link() {
if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */ if ((_vm->_gyro->roomtime % 3) == 0) /* The fire flickers */
show_one(1 + (_vm->_gyro->roomtime / 3) % 3); show_one(1 + (_vm->_gyro->roomtime / 3) % 3);
{/* _vm->_lucerna.bearing of Avvy from Duck. */ {/* _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))) if (((_vm->_lucerna->bearing(2) >= 0) && (_vm->_lucerna->bearing(2) <= 45)) || ((_vm->_lucerna->bearing(2) >= 315) && (_vm->_lucerna->bearing(2) <= 360)))
xx = 4; /* Middle. */ 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. */ 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. */ xx = 8; /* Right. */
if ((_vm->_gyro->roomtime % int32(45)) > 42) if ((_vm->_gyro->roomtime % int32(45)) > 42)
@ -468,7 +465,7 @@ void Celer::show_one(byte which) {
warning("STUB: Celer::show_one()"); warning("STUB: Celer::show_one()");
for (byte fv = 0; fv < 2; fv ++) 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()"); warning("STUB: Celer::show_one_at()");
for (byte fv = 0; fv < 2; fv ++) 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; bytefield r;
Celer();
void setParent(AvalancheEngine *vm); Celer(AvalancheEngine *vm);
void pics_link(); void pics_link();

View file

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

View file

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

View file

@ -206,7 +206,7 @@ void menuset::update() {
ddms[fv].display(); ddms[fv].display();
for (page_ = 0; page_ <= 1; page_ ++) 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; _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; _vm = vm;
} }
@ -255,26 +255,26 @@ void Dropdown::find_what_you_can_do_with_it() {
case _vm->_gyro->wine: case _vm->_gyro->wine:
case _vm->_gyro->potion: case _vm->_gyro->potion:
case _vm->_gyro->ink: 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; break;
case _vm->_gyro->bell: 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; break;
case _vm->_gyro->chastity: 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; break;
case _vm->_gyro->lute: 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; break;
case _vm->_gyro->mushroom: case _vm->_gyro->mushroom:
case _vm->_gyro->onion: 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; break;
case _vm->_gyro->clothes: 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; break;
default: 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) { 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(Common::String(n.c_str() + 2, 253), n[1], "f5", true);
ddm_o.opt("Pause game", 'P', "f6", true); ddm_o.opt("Pause game", 'P', "f6", true);
if (_vm->_gyro->dna.room == 99) 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 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("Look around", 'L', "f8", true);
ddm_o.opt("Inventory", 'I', "Tab", 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); ddm_o.opt("Run fast", 'R', "^R", true);
else else
ddm_o.opt("Walk slowly", 'W', "^W", true); ddm_o.opt("Walk slowly", 'W', "^W", true);
@ -501,19 +501,19 @@ void Dropdown::do__game() {
switch (ddm_o.choicenum) { switch (ddm_o.choicenum) {
/* Help, boss, untrash screen. */ /* Help, boss, untrash screen. */
case 0: case 0:
_vm->_lucerna.callverb(_vm->_acci.vb_help); _vm->_lucerna->callverb(_vm->_acci->vb_help);
break; break;
case 1: case 1:
_vm->_lucerna.callverb(_vm->_acci.vb_boss); _vm->_lucerna->callverb(_vm->_acci->vb_boss);
break; break;
case 2: case 2:
_vm->_lucerna.major_redraw(); _vm->_lucerna->major_redraw();
break; break;
case 3: case 3:
_vm->_lucerna.callverb(_vm->_acci.vb_score); _vm->_lucerna->callverb(_vm->_acci->vb_score);
break; break;
case 4: case 4:
_vm->_lucerna.callverb(_vm->_acci.vb_info); _vm->_lucerna->callverb(_vm->_acci->vb_info);
break; break;
} }
} }
@ -522,26 +522,26 @@ void Dropdown::do__file() {
switch (ddm_o.choicenum) { switch (ddm_o.choicenum) {
/* New game, load, save, save as, DOS shell, about, quit. */ /* New game, load, save, save as, DOS shell, about, quit. */
case 0: case 0:
_vm->_lucerna.callverb(_vm->_acci.vb_restart); _vm->_lucerna->callverb(_vm->_acci->vb_restart);
break; break;
case 1: { case 1: {
_vm->_acci.realwords[2] = ""; _vm->_acci->realwords[2] = "";
_vm->_lucerna.callverb(_vm->_acci.vb_load); _vm->_lucerna->callverb(_vm->_acci->vb_load);
} }
break; break;
case 2: { case 2: {
_vm->_acci.realwords[2] = ""; _vm->_acci->realwords[2] = "";
_vm->_lucerna.callverb(_vm->_acci.vb_save); _vm->_lucerna->callverb(_vm->_acci->vb_save);
} }
break; break;
case 3: case 3:
_vm->_basher.filename_edit(); _vm->_basher->filename_edit();
break; break;
case 4: case 4:
_vm->_enid.back_to_bootstrap(2); _vm->_enid->back_to_bootstrap(2);
break; break;
case 5: case 5:
_vm->_lucerna.callverb(_vm->_acci.vb_quit); _vm->_lucerna->callverb(_vm->_acci->vb_quit);
break; break;
} }
} }
@ -551,99 +551,99 @@ void Dropdown::do__action() {
switch (ddm_o.choicenum) { switch (ddm_o.choicenum) {
/* Get up/pause game/open door/look/inv/walk-run */ /* Get up/pause game/open door/look/inv/walk-run */
case 0: { case 0: {
_vm->_acci.person = _vm->_acci.pardon; _vm->_acci->person = _vm->_acci->pardon;
_vm->_acci.thing = _vm->_acci.pardon; _vm->_acci->thing = _vm->_acci->pardon;
n = _vm->_gyro->f5_does(); n = _vm->_gyro->f5_does();
_vm->_lucerna.callverb(n[1]); _vm->_lucerna->callverb(n[1]);
} }
break; break;
case 1: case 1:
_vm->_lucerna.callverb(_vm->_acci.vb_pause); _vm->_lucerna->callverb(_vm->_acci->vb_pause);
break; break;
case 2: case 2:
_vm->_lucerna.callverb(_vm->_acci.vb_open); _vm->_lucerna->callverb(_vm->_acci->vb_open);
break; break;
case 3: case 3:
_vm->_lucerna.callverb(_vm->_acci.vb_look); _vm->_lucerna->callverb(_vm->_acci->vb_look);
break; break;
case 4: case 4:
_vm->_lucerna.callverb(_vm->_acci.vb_inv); _vm->_lucerna->callverb(_vm->_acci->vb_inv);
break; break;
case 5: { case 5: {
if (_vm->_trip.tr[1].xs == _vm->_gyro->walk) _vm->_trip.tr[1].xs = _vm->_gyro->run; 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; else _vm->_trip->tr[1].xs = _vm->_gyro->walk;
_vm->_trip.newspeed(); _vm->_trip->newspeed();
} }
break; break;
} }
} }
void Dropdown::do__objects() { 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() { 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]; _vm->_gyro->last_person = people[ddm_o.choicenum + 1];
} }
void Dropdown::do__with() { void Dropdown::do__with() {
_vm->_acci.thing = _vm->_gyro->thinks; _vm->_acci->thing = _vm->_gyro->thinks;
if (_vm->_gyro->thinkthing) { if (_vm->_gyro->thinkthing) {
_vm->_acci.thing += 49; _vm->_acci->thing += 49;
if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci.vb_give) if (_vm->_gyro->verbstr[ddm_o.choicenum + 1] == _vm->_acci->vb_give)
_vm->_acci.person = _vm->_gyro->last_person; _vm->_acci->person = _vm->_gyro->last_person;
else else
_vm->_acci.person = '\376'; _vm->_acci->person = '\376';
} else { } else {
switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) { switch (_vm->_gyro->verbstr[ddm_o.choicenum + 1]) {
case '\144': { case '\144': {
_vm->_acci.thing = '\144'; _vm->_acci->thing = '\144';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Beer */ break; /* Beer */
case '\145': { case '\145': {
_vm->_acci.thing = '\62'; _vm->_acci->thing = '\62';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Wine */ break; /* Wine */
case '\146': { case '\146': {
_vm->_acci.thing = '\146'; _vm->_acci->thing = '\146';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Whisky */ break; /* Whisky */
case '\147': { case '\147': {
_vm->_acci.thing = '\147'; _vm->_acci->thing = '\147';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Cider */ break; /* Cider */
case '\150': { case '\150': {
_vm->_acci.thing = '\153'; _vm->_acci->thing = '\153';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Mead */ break; /* Mead */
case '\151': { case '\151': {
_vm->_acci.thing = '\103'; _vm->_acci->thing = '\103';
_vm->_lucerna.callverb(_vm->_acci.vb_buy); _vm->_lucerna->callverb(_vm->_acci->vb_buy);
return; return;
} }
break; /* Onion (trader) */ break; /* Onion (trader) */
default: { default: {
_vm->_acci.person = _vm->_acci.thing; _vm->_acci->person = _vm->_acci->thing;
_vm->_acci.thing = '\376'; _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. */ /*$F- That's all. Now for the ...bar funcs. */

View file

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

View file

@ -45,7 +45,7 @@
namespace Avalanche { namespace Avalanche {
void Enid::setParent(AvalancheEngine *vm) { Enid::Enid(AvalancheEngine *vm) {
_vm = 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) { 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) { 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) { void Enid::loaderror(Common::String x, char icon) {
if (_vm->_gyro->holdthedawn) { if (_vm->_gyro->holdthedawn) {
_vm->_gyro->holdthedawn = false; _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; bug = true;
} }
@ -161,7 +161,7 @@ void Enid::edna_load(Common::String name) {
} }
void Enid::showheader() { 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! */ 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: @the_end:
end; end;
*/ */
_vm->_lucerna.blitfix(); _vm->_lucerna->blitfix();
} }
void Enid::to_sundry(sundry &sund) { 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 _vm->_gyro->seescroll = true; /* This prevents display of the new sprites before the
new picture is loaded. */ new picture is loaded. */
_vm->_lucerna.major_redraw(); _vm->_lucerna->major_redraw();
_vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room; _vm->_gyro->whereis[_vm->_gyro->pavalot] = _vm->_gyro->dna.room;
_vm->_gyro->alive = true; _vm->_gyro->alive = true;
_vm->_lucerna.objectlist(); _vm->_lucerna->objectlist();
if (_vm->_gyro->holdthedawn) { if (_vm->_gyro->holdthedawn) {
_vm->_gyro->holdthedawn = false; _vm->_gyro->holdthedawn = false;
_vm->_lucerna.dawn(); _vm->_lucerna->dawn();
} }
} }

View file

@ -38,7 +38,7 @@ class AvalancheEngine;
class Enid { class Enid {
public: public:
void setParent(AvalancheEngine *vm); Enid(AvalancheEngine *vm);
void edna_save(Common::String name); 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. */ void Gyro::newgame() { /* This sets up the DNA for a completely new game. */
for (byte gm = 0; gm < numtr; gm ++) { for (byte gm = 0; gm < numtr; gm ++) {
if (_vm->_trip.tr[gm].quick) if (_vm->_trip->tr[gm].quick)
_vm->_trip.tr[gm].done(); _vm->_trip->tr[gm].done();
} }
/* Deallocate sprite. Sorry, beta testers! */ /* 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; alive = true;
score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/ score = 0; /*for gd:=0 to 5 do which[gd]:=1;*/
memset(&_vm->_gyro->dna, 0, sizeof(dnatype)); memset(&_vm->_gyro->dna, 0, sizeof(dnatype));
_vm->_scrolls.natural(); _vm->_scrolls->natural();
_vm->_basher.normal_edit(); _vm->_basher->normal_edit();
_vm->_lucerna.mousepage(0); _vm->_lucerna->mousepage(0);
dna.spare_evening = "answer a questionnaire"; dna.spare_evening = "answer a questionnaire";
dna.like2drink = "beer"; dna.like2drink = "beer";
@ -372,12 +372,12 @@ void Gyro::newgame() { /* This sets up the DNA for a completely new game. */
dna.obj[clothes] = true; dna.obj[clothes] = true;
thinks = 2; thinks = 2;
_vm->_lucerna.objectlist(); _vm->_lucerna->objectlist();
ontoolbar = false; ontoolbar = false;
seescroll = false; seescroll = false;
ppos[0][1] = -177; 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; //for (gd = 0; gd <= 30; gd ++) for (gm = 0; gm <= 1; gm ++) also[gd][gm] = nil;
/* fillchar(previous^,sizeof(previous^),#0); { blank out array } */ /* fillchar(previous^,sizeof(previous^),#0); { blank out array } */
him = 254; 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 ++) { for (byte gd = 0; gd <= 1; gd ++) {
cp = 1 - cp; cp = 1 - cp;
_vm->_trip.getback(); _vm->_trip->getback();
} }
_vm->_lucerna.enterroom(1, 1); _vm->_lucerna->enterroom(1, 1);
_vm->_trip.new_game_for_trippancy(); _vm->_trip->new_game_for_trippancy();
_vm->_lucerna.showscore(); _vm->_lucerna->showscore();
_vm->_dropdown.standard_bar(); _vm->_dropdown->standard_bar();
_vm->_lucerna.clock_lucerna(); _vm->_lucerna->clock_lucerna();
_vm->_lucerna.sprite_run(); _vm->_lucerna->sprite_run();
} }
void Gyro::click() { /* "Audio keyboard feedback" */ void Gyro::click() { /* "Audio keyboard feedback" */

View file

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

View file

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

View file

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

View file

@ -47,7 +47,7 @@
namespace Avalanche { namespace Avalanche {
void Scrolls::setParent(AvalancheEngine *vm) { Scrolls::Scrolls(AvalancheEngine *vm) {
_vm = vm; _vm = vm;
} }
@ -154,7 +154,7 @@ void Scrolls::resetscrolldriver() { /* phew */
void Scrolls::dingdongbell() { /* Pussy's in the well. Who put her in? Little... */ void Scrolls::dingdongbell() { /* Pussy's in the well. Who put her in? Little... */
byte fv; 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. */ 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") + 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"); "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; 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 */ void state(byte x); /* Sets "Ready" light to whatever */

View file

@ -39,7 +39,7 @@
namespace Avalanche { namespace Avalanche {
void Sequence::setParent(AvalancheEngine *vm) { Sequence::Sequence(AvalancheEngine *vm) {
_vm = vm; _vm = vm;
} }
@ -77,7 +77,7 @@ void Sequence::start_to_close() {
void Sequence::start_to_open() { void Sequence::start_to_open() {
_vm->_gyro->dna.user_moves_avvy = false; /* They can't move. */ _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. */ start_to_close(); /* Apart from that, it's the same thing. */
} }
@ -95,7 +95,7 @@ void Sequence::call_sequencer() {
break; /* No more routines. */ break; /* No more routines. */
case 177: case 177:
_vm->_gyro->dna.user_moves_avvy = true; _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) if (seq[0] == 177)
shove_left(); shove_left();
break; break;
@ -103,7 +103,7 @@ void Sequence::call_sequencer() {
if ((seq[0] >= 1) && (seq[0] <= 176)) { if ((seq[0] >= 1) && (seq[0] <= 176)) {
/* Show a frame. */ /* Show a frame. */
_vm->_celer.show_one(seq[1]); _vm->_celer->show_one(seq[1]);
shove_left(); shove_left();
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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