AVALANCHE: Repair parts of the scrolls system, implement the death of Avalot and almost everything connected to it.

This commit is contained in:
uruk 2013-08-07 10:30:44 +02:00
parent bd516f4244
commit 26b7333137
5 changed files with 98 additions and 95 deletions

View File

@ -161,58 +161,60 @@ void Avalot::handleKeyDown(Common::Event &event) {
//
// To be implemented later with the sounds, I assume.
switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
case Common::KEYCODE_KP8:
event.kbd.keycode = Common::KEYCODE_UP;
break;
case Common::KEYCODE_KP2:
event.kbd.keycode = Common::KEYCODE_DOWN;
break;
case Common::KEYCODE_KP6:
event.kbd.keycode = Common::KEYCODE_RIGHT;
break;
case Common::KEYCODE_KP4:
event.kbd.keycode = Common::KEYCODE_LEFT;
break;
case Common::KEYCODE_KP9:
event.kbd.keycode = Common::KEYCODE_PAGEUP;
break;
case Common::KEYCODE_KP3:
event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
break;
case Common::KEYCODE_KP7:
event.kbd.keycode = Common::KEYCODE_HOME;
break;
case Common::KEYCODE_KP1:
event.kbd.keycode = Common::KEYCODE_END;
break;
}
switch (event.kbd.keycode) {
case Common::KEYCODE_UP:
case Common::KEYCODE_DOWN:
case Common::KEYCODE_RIGHT:
case Common::KEYCODE_LEFT:
case Common::KEYCODE_PAGEUP:
case Common::KEYCODE_PAGEDOWN:
case Common::KEYCODE_HOME:
case Common::KEYCODE_END:
case Common::KEYCODE_KP5:
_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
_vm->_lucerna->showrw();
if (_vm->_gyro->demo)
_vm->_basher->get_demorec();
return;
case Common::KEYCODE_BACKSPACE:
_vm->_parser->handleBackspace();
break;
case Common::KEYCODE_RETURN:
_vm->_parser->handleReturn();
break;
}
if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
_vm->_parser->handleInputText(event);
else
switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
case Common::KEYCODE_KP8:
event.kbd.keycode = Common::KEYCODE_UP;
break;
case Common::KEYCODE_KP2:
event.kbd.keycode = Common::KEYCODE_DOWN;
break;
case Common::KEYCODE_KP6:
event.kbd.keycode = Common::KEYCODE_RIGHT;
break;
case Common::KEYCODE_KP4:
event.kbd.keycode = Common::KEYCODE_LEFT;
break;
case Common::KEYCODE_KP9:
event.kbd.keycode = Common::KEYCODE_PAGEUP;
break;
case Common::KEYCODE_KP3:
event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
break;
case Common::KEYCODE_KP7:
event.kbd.keycode = Common::KEYCODE_HOME;
break;
case Common::KEYCODE_KP1:
event.kbd.keycode = Common::KEYCODE_END;
break;
}
switch (event.kbd.keycode) {
case Common::KEYCODE_UP:
case Common::KEYCODE_DOWN:
case Common::KEYCODE_RIGHT:
case Common::KEYCODE_LEFT:
case Common::KEYCODE_PAGEUP:
case Common::KEYCODE_PAGEDOWN:
case Common::KEYCODE_HOME:
case Common::KEYCODE_END:
case Common::KEYCODE_KP5:
if (_vm->_gyro->alive) {
_vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
_vm->_lucerna->showrw();
if (_vm->_gyro->demo)
_vm->_basher->get_demorec();
return;
}
case Common::KEYCODE_BACKSPACE:
_vm->_parser->handleBackspace();
break;
case Common::KEYCODE_RETURN:
_vm->_parser->handleReturn();
break;
}
_vm->_lucerna->showrw();
if (_vm->_gyro->demo)

View File

@ -1127,16 +1127,19 @@ void Lucerna::gameover() {
_vm->_gyro->dna.user_moves_avvy = false;
sx = _vm->_trip->tr[1].x;
sy = _vm->_trip->tr[1].y;
sx = _vm->_trip->tr[0].x;
sy = _vm->_trip->tr[0].y;
_vm->_trip->tr[1].done();
_vm->_trip->tr[1].init(12, true, _vm->_trip); /* 12 = Avalot falls */
_vm->_trip->tr[1].step = 0;
_vm->_trip->tr[1].appear(sx, sy, 0);
_vm->_trip->tr[0].done();
_vm->_trip->tr[0].init(12, true, _vm->_trip); /* 12 = Avalot falls */
_vm->_trip->tr[0].step = 0;
_vm->_trip->tr[0].appear(sx, sy, 0);
_vm->_timeout->set_up_timer(3, _vm->_timeout->procavalot_falls, _vm->_timeout->reason_falling_over);
/* _vm->_scrolls->display(^m^m^m^m^m^m^i^i^i^i^i^i^s'Z'^v);*/
warning("STUB: Timeout::avalot_falls()");
_vm->_gyro->alive = false;
}

View File

@ -329,6 +329,7 @@ void Scrolls::block_drop(Common::String fn, int16 xl, int16 yl, int16 y) {
blockread(f, mem[0xa000 * st + (fv * 80)], xl);
}
bit = getpixel(0, 0);*/
warning("STUB: Scrolls::block_drop()");
f.close();
@ -360,7 +361,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
if ((1 <= use_icon) && (use_icon <= 34))
lx += halficonwidth;
_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
@ -377,9 +377,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
/*_vm->_graphics->drawBar(mx - lx - 30, my + ly, mx + lx, my + ly + 6, lightgray);
_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly, lightgray);
_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx + lx + 15, my + ly, lightgray);*/
/*setfillstyle(1, 8);
pieslice(mx - lx - 31, my - ly, 360, 180, 15);
@ -390,10 +387,6 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), red);
/*_vm->_graphics->drawBar(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5, red);
_vm->_graphics->drawBar(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7, red);
_vm->_graphics->drawBar(mx - lx - 15, my - ly, mx - lx - 14, my + ly, red);
_vm->_graphics->drawBar(mx + lx + 15, my - ly, mx + lx + 16, my + ly, red);*/
ex = mx - lx;
ey = my - ly;
@ -425,29 +418,30 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
for (b = 0; b <= _vm->_gyro->scrolln; b++) {
switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
case kControlCenter: {
centre = true;
_vm->_gyro->scroll[b].deleteLastChar();
if (!_vm->_gyro->scroll[b].empty())
switch (_vm->_gyro->scroll[b][_vm->_gyro->scroll[b].size() - 1]) {
case kControlCenter: {
centre = true;
_vm->_gyro->scroll[b].deleteLastChar();
}
break;
case kControlLeftJustified: {
centre = false;
_vm->_gyro->scroll[b].deleteLastChar();
}
break;
case kControlQuestion: {
//settextjustify(1, 1);
dix = mx + lx;
diy = my + ly;
_vm->_gyro->scroll[b].setChar(' ', 0);
groi = *_vm->_graphics->getPixel(0, 0);
// inc(diy,14);
_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
}
break;
}
break;
case kControlLeftJustified: {
centre = false;
_vm->_gyro->scroll[b].deleteLastChar();
}
break;
case kControlQuestion: {
//settextjustify(1, 1);
dix = mx + lx;
diy = my + ly;
_vm->_gyro->scroll[b].setChar(' ', 0);
groi = *_vm->_graphics->getPixel(0, 0);
// inc(diy,14);
_vm->_gyro->shbox(dix - 65, diy - 24, dix - 5, diy - 10, "Yes.");
_vm->_gyro->shbox(dix + 5, diy - 24, dix + 65, diy - 10, "No.");
}
break;
}
if (centre)
say(320 - _vm->_gyro->scroll[b].size() * 4 + icon_indent, my, _vm->_gyro->scroll[b]);
@ -586,9 +580,9 @@ void Scrolls::calldrivers() {
if (_vm->_gyro->buffer[fv] == kControlRegister)
param = 0;
else
if (('0' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < '9'))
if (('0' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= '9'))
param = _vm->_gyro->buffer[fv] - 48;
else if (('A' < _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] < 'Z'))
else if (('A' <= _vm->_gyro->buffer[fv]) && (_vm->_gyro->buffer[fv] <= 'Z'))
param = _vm->_gyro->buffer[fv] - 55;
mouthnext = false;
@ -748,7 +742,8 @@ void Scrolls::calldrivers() {
mouthnext = true;
break;
case kControlInsertSpaces:
for (nn = 0; nn < 9; nn++) _vm->_gyro->scroll[_vm->_gyro->scrolln] = _vm->_gyro->scroll[_vm->_gyro->scrolln] + ' ';
for (nn = 0; nn < 9; nn++)
_vm->_gyro->scroll[_vm->_gyro->scrolln] += ' ';
break;
default: { // Add new char.
if (_vm->_gyro->scroll[_vm->_gyro->scrolln].size() == 50) {

View File

@ -625,11 +625,13 @@ void Timeout::winning() {
}
void Timeout::avalot_falls() {
if (_vm->_trip->tr[1].step < 5) {
_vm->_trip->tr[1].step += 1;
if (_vm->_trip->tr[0].step < 5) {
_vm->_trip->tr[0].step += 1;
set_up_timer(3, procavalot_falls, reason_falling_over);
} else
_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
//_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
warning("STUB: Timeout::avalot_falls()");
}
void Timeout::spludwick_goes_to_cauldron() {

View File

@ -426,13 +426,14 @@ triptype *triptype::done() {
uint16 soa;
/* nds:=num div seq;*/
totalnum--;
_info.xw = _info.xl / 8;
if ((_info.xl % 8) > 0)
_info.xw += 1;
for (aa = 1; aa <= /*nds*seq*/ a.num; aa++) {
for (aa = 0; aa < /*nds*seq*/ a.num; aa++) {
totalnum--;
free(_info.mani[totalnum]);
free(_info.sil[totalnum]); /* <<- Width of a siltype. */
delete _info.mani[totalnum];
delete _info.sil[totalnum];
}
quick = false;