diff options
author | uruk | 2013-08-26 16:10:17 +0200 |
---|---|---|
committer | uruk | 2013-08-26 16:10:17 +0200 |
commit | 06346339a9deb849e09f25049c42a1bcd0a45e0c (patch) | |
tree | c7ee3b5eb075effb6fdefecc6ce4ca1c816f83bf | |
parent | 934170b35398cb5957270685d8bb65af4df8191e (diff) | |
download | scummvm-rg350-06346339a9deb849e09f25049c42a1bcd0a45e0c.tar.gz scummvm-rg350-06346339a9deb849e09f25049c42a1bcd0a45e0c.tar.bz2 scummvm-rg350-06346339a9deb849e09f25049c42a1bcd0a45e0c.zip |
AVALANCHE: Implement Timeout::after_the_shootemup(), repair a lot of array indexes in various places.
-rw-r--r-- | engines/avalanche/acci2.cpp | 36 | ||||
-rw-r--r-- | engines/avalanche/gyro2.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/lucerna2.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/timeout2.cpp | 34 | ||||
-rw-r--r-- | engines/avalanche/trip6.cpp | 7 | ||||
-rw-r--r-- | engines/avalanche/visa2.cpp | 6 |
6 files changed, 66 insertions, 33 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp index cec1d4b88b..644db34349 100644 --- a/engines/avalanche/acci2.cpp +++ b/engines/avalanche/acci2.cpp @@ -742,8 +742,8 @@ void Acci::inv() { /* the time-honoured command... */ q++; if (q == _vm->_gyro->dna.carrying) _vm->_scrolls->display(Common::String("and ") + _vm->_scrolls->kControlToBuffer); - _vm->_scrolls->display(_vm->_gyro->get_better(fv) + _vm->_scrolls->kControlToBuffer); - if (fv == _vm->_gyro->dna.wearing) + _vm->_scrolls->display(_vm->_gyro->get_better(fv + 1) + _vm->_scrolls->kControlToBuffer); + if ((fv + 1) == _vm->_gyro->dna.wearing) _vm->_scrolls->display(Common::String(", which you're wearing") + _vm->_scrolls->kControlToBuffer); if (q < _vm->_gyro->dna.carrying) _vm->_scrolls->display(Common::String(", ") + _vm->_scrolls->kControlToBuffer); @@ -767,7 +767,7 @@ void Acci::swallow() { /* Eat something. */ _vm->_visa->dixi('U', 1); _vm->_pingo->wobble(); _vm->_visa->dixi('U', 2); - _vm->_gyro->dna.obj[_vm->_gyro->wine] = false; + _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; _vm->_lucerna->objectlist(); have_a_drink(); } @@ -800,7 +800,7 @@ void Acci::swallow() { /* Eat something. */ if (_vm->_gyro->dna.rotten_onion) _vm->_visa->dixi('U', 11); else { _vm->_visa->dixi('U', 8); - _vm->_gyro->dna.obj[_vm->_gyro->onion] = false; + _vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false; _vm->_lucerna->objectlist(); } break; @@ -1023,7 +1023,7 @@ bool Acci::give2spludwick() { switch (thing) { case _vm->_gyro->onion: - _vm->_gyro->dna.obj[_vm->_gyro->onion] = false; + _vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = false; if (_vm->_gyro->dna.rotten_onion) _vm->_visa->dixi('q', 22); else { @@ -1035,7 +1035,7 @@ bool Acci::give2spludwick() { _vm->_lucerna->objectlist(); break; case _vm->_gyro->ink: - _vm->_gyro->dna.obj[_vm->_gyro->ink] = false; + _vm->_gyro->dna.obj[_vm->_gyro->ink - 1] = false; _vm->_lucerna->objectlist(); _vm->_gyro->dna.given2spludwick++; _vm->_visa->dixi('q', 24); @@ -1043,12 +1043,12 @@ bool Acci::give2spludwick() { _vm->_lucerna->points(3); break; case _vm->_gyro->mushroom: - _vm->_gyro->dna.obj[_vm->_gyro->mushroom] = false; + _vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = false; _vm->_visa->dixi('q', 25); _vm->_lucerna->points(5); _vm->_gyro->dna.given2spludwick++; go_to_cauldron(); - _vm->_gyro->dna.obj[_vm->_gyro->potion] = true; + _vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true; _vm->_lucerna->objectlist(); break; default: @@ -1061,7 +1061,7 @@ bool Acci::give2spludwick() { void Acci::have_a_drink() { _vm->_gyro->dna.alcohol += 1; if (_vm->_gyro->dna.alcohol == 5) { - _vm->_gyro->dna.obj[_vm->_gyro->key] = true; /* Get the key. */ + _vm->_gyro->dna.obj[_vm->_gyro->key - 1] = true; /* Get the key. */ _vm->_gyro->dna.teetotal = true; _vm->_gyro->dna.avvy_is_awake = false; _vm->_gyro->dna.avvy_in_bed = true; @@ -1142,7 +1142,7 @@ void Acci::getproc(char thing) { if (_vm->_gyro->dna.box_contents == thing) { _vm->_celer->show_one(5); _vm->_scrolls->display("OK, I've got it."); - _vm->_gyro->dna.obj[thing] = true; + _vm->_gyro->dna.obj[thing - 1] = true; _vm->_lucerna->objectlist(); _vm->_gyro->dna.box_contents = nowt; _vm->_celer->show_one(6); @@ -1164,7 +1164,7 @@ void Acci::getproc(char thing) { _vm->_celer->show_one(4); /* No pen there now. */ _vm->_trip->call_special(3); /* Zap! */ _vm->_gyro->dna.taken_pen = true; - _vm->_gyro->dna.obj[_vm->_gyro->pen] = true; + _vm->_gyro->dna.obj[_vm->_gyro->pen - 1] = true; _vm->_lucerna->objectlist(); _vm->_scrolls->display("Taken."); } @@ -1186,7 +1186,7 @@ void Acci::getproc(char thing) { _vm->_scrolls->display("Got it!"); _vm->_gyro->dna.mushroom_growing = false; _vm->_gyro->dna.taken_mushroom = true; - _vm->_gyro->dna.obj[_vm->_gyro->mushroom] = true; + _vm->_gyro->dna.obj[_vm->_gyro->mushroom - 1] = true; _vm->_lucerna->objectlist(); _vm->_lucerna->points(3); } else @@ -1202,7 +1202,7 @@ void Acci::give_geida_the_lute() { _vm->_scrolls->display("Not yet. Try later!\232\2"); return; } - _vm->_gyro->dna.obj[_vm->_gyro->lute] = false; + _vm->_gyro->dna.obj[_vm->_gyro->lute - 1] = false; _vm->_lucerna->objectlist(); _vm->_visa->dixi('q', 64); /* She plays it. */ @@ -1263,7 +1263,7 @@ void Acci::person_speaks() { void Acci::heythanks() { person_speaks(); _vm->_scrolls->display(Common::String("Hey, thanks!") + _vm->_scrolls->kControlSpeechBubble + "(But now, you've lost it!)"); - _vm->_gyro->dna.obj[thing] = false; + _vm->_gyro->dna.obj[thing - 1] = false; } void Acci::do_that() { @@ -1381,7 +1381,7 @@ void Acci::do_that() { case _vm->_gyro->pcrapulus: if (thing == _vm->_gyro->wine) { _vm->_scrolls->display("Crapulus grabs the wine and gulps it down."); - _vm->_gyro->dna.obj[_vm->_gyro->wine] = false; + _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; } else heythanks(); break; @@ -1763,7 +1763,7 @@ void Acci::do_that() { _vm->_lucerna->points(3); } _vm->_gyro->pennycheck(3); // It costs thruppence. - _vm->_gyro->dna.obj[_vm->_gyro->onion] = true; + _vm->_gyro->dna.obj[_vm->_gyro->onion - 1] = true; _vm->_lucerna->objectlist(); _vm->_gyro->dna.bought_onion = true; _vm->_gyro->dna.rotten_onion = false; // It's OK when it leaves the stall! @@ -1801,8 +1801,8 @@ void Acci::do_that() { case 3: _vm->_visa->dixi('Q', 11); _vm->_gyro->dna.cwytalot_gone = true; - _vm->_gyro->dna.obj[_vm->_gyro->bolt] = false; - _vm->_gyro->dna.obj[_vm->_gyro->crossbow] = false; + _vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = false; + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = false; _vm->_lucerna->objectlist(); _vm->_gyro->magics[11].op = _vm->_gyro->nix; _vm->_lucerna->points(7); diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index e7cf879ec0..f689142bf0 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -332,10 +332,10 @@ void Gyro::newgame() { dna.pence = 30; /* 2/6 */ dna.rw = stopped; dna.wearing = clothes; - dna.obj[money] = true; - dna.obj[bodkin] = true; - dna.obj[bell] = true; - dna.obj[clothes] = true; + dna.obj[money - 1] = true; + dna.obj[bodkin - 1] = true; + dna.obj[bell - 1] = true; + dna.obj[clothes - 1] = true; thinks = 2; _vm->_lucerna->objectlist(); diff --git a/engines/avalanche/lucerna2.cpp b/engines/avalanche/lucerna2.cpp index 2477db1520..7ed521467d 100644 --- a/engines/avalanche/lucerna2.cpp +++ b/engines/avalanche/lucerna2.cpp @@ -344,7 +344,7 @@ void Lucerna::new_town() { /* You've just entered a town from the map. */ } if (_vm->_gyro->dna.room != r__outsideducks) { - if ((_vm->_gyro->dna.obj[_vm->_gyro->onion]) && !(_vm->_gyro->dna.onion_in_vinegar)) + if ((_vm->_gyro->dna.obj[_vm->_gyro->onion - 1]) && !(_vm->_gyro->dna.onion_in_vinegar)) _vm->_gyro->dna.rotten_onion = true; /* You're holding the onion */ } } @@ -559,9 +559,9 @@ void Lucerna::enterroom(byte x, byte ped) { { dnatype &with = _vm->_gyro->dna; - if ((_vm->_gyro->dna.obj[_vm->_gyro->wine]) && (_vm->_gyro->dna.winestate != 3)) { + if ((_vm->_gyro->dna.obj[_vm->_gyro->wine - 1]) && (_vm->_gyro->dna.winestate != 3)) { _vm->_visa->dixi('q', 9); /* Don't want to waste the wine! */ - _vm->_gyro->dna.obj[_vm->_gyro->wine] = false; + _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = false; objectlist(); } } @@ -996,7 +996,7 @@ void Lucerna::fxtoggle() { void Lucerna::objectlist() { _vm->_gyro->dna.carrying = 0; - if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks]) + if (_vm->_gyro->thinkthing && !_vm->_gyro->dna.obj[_vm->_gyro->thinks - 1]) thinkabout(_vm->_gyro->money, _vm->_gyro->a_thing); /* you always have money */ for (byte fv = 0; fv < numobjs; fv++) if (_vm->_gyro->dna.obj[fv]) { diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp index a7f61beb81..e7508ec5ae 100644 --- a/engines/avalanche/timeout2.cpp +++ b/engines/avalanche/timeout2.cpp @@ -361,7 +361,37 @@ void Timeout::hang_around2() { } void Timeout::after_the_shootemup() { + + _vm->_trip->fliproom(_vm->_gyro->dna.room, 0); + // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! + + _vm->_trip->tr[0].init(0, true, _vm->_trip); /* Avalot. */ + _vm->_trip->apped(1, 2); + _vm->_gyro->dna.user_moves_avvy = true; + _vm->_gyro->dna.obj[_vm->_gyro->crossbow - 1] = true; + _vm->_lucerna->objectlist(); + + // Same as the added line above: TODO: Remove it later!!! + _vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.") + + _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)"); + + //byte shootscore, gain; + + //shootscore = mem[storage_seg * storage_ofs]; + //gain = (shootscore + 5) / 10; /* Rounding up. */ + + //display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" + + // strf(shootscore) + " ö 10) = " + strf(gain) + " points."); + + //if (gain > 20) { + // display("But we won't let you have more than 20 points!"); + // points(20); + //} else + // points(gain); + warning("STUB: Timeout::after_the_shootemup()"); + + _vm->_visa->dixi('q', 70); } void Timeout::jacques_wakes_up() { @@ -470,7 +500,7 @@ void Timeout::jump() { else { _vm->_celer->show_one(2); _vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */ - _vm->_gyro->dna.obj[_vm->_gyro->bolt] = true; + _vm->_gyro->dna.obj[_vm->_gyro->bolt - 1] = true; _vm->_lucerna->objectlist(); _vm->_visa->dixi('q', 50); _vm->_lucerna->points(3); @@ -503,7 +533,7 @@ void Timeout::buywine() { _vm->_visa->dixi('D', 1); /* It'll be thruppence. */ if (_vm->_gyro->pennycheck(3)) { _vm->_visa->dixi('D', 4); /* You paid up. */ - _vm->_gyro->dna.obj[_vm->_gyro->wine] = true; + _vm->_gyro->dna.obj[_vm->_gyro->wine - 1] = true; _vm->_lucerna->objectlist(); _vm->_gyro->dna.winestate = 1; /* OK Wine */ } diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index 685c8d80e0..8762250b57 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -952,7 +952,7 @@ void Trip::call_special(uint16 which) { case 10: /* _vm->_gyro->special 10: transfer north in catacombs. */ if ((_vm->_gyro->dna.cat_x == 4) && (_vm->_gyro->dna.cat_y == 1)) { /* Into Geida's room. */ - if (_vm->_gyro->dna.obj[_vm->_gyro->key]) + if (_vm->_gyro->dna.obj[_vm->_gyro->key - 1]) _vm->_visa->dixi('q', 62); else { _vm->_visa->dixi('q', 61); @@ -1277,7 +1277,7 @@ void Trip::grab_avvy(byte tripnum) { /* For Friar Tuck, in Nottingham. */ int16 tox, toy; tox = tr[0].x + 17; - toy = tr[0].y--; + toy = tr[0].y - 1; if ((tr[tripnum].x == tox) && (tr[tripnum].y == toy)) { tr[tripnum].call_eachstep = false; tr[tripnum].face = left; @@ -1601,6 +1601,9 @@ void Trip::new_game_for_trippancy() { /* Called by gyro.newgame */ void Trip::handleMoveKey(const Common::Event &event) { + if (!_vm->_gyro->dna.user_moves_avvy) + return; + if (_vm->_dropdown->ddm_o.menunow) _vm->_parser->tryDropdown(); else diff --git a/engines/avalanche/visa2.cpp b/engines/avalanche/visa2.cpp index 4a6fbc7159..182783ee54 100644 --- a/engines/avalanche/visa2.cpp +++ b/engines/avalanche/visa2.cpp @@ -172,9 +172,9 @@ void Visa::talkto(byte whom) { if (_vm->_gyro->subjnumber == 0) switch (whom) { case _vm->_gyro->pspludwick: - if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion])) { + if ((_vm->_gyro->dna.lustie_is_asleep) & (!_vm->_gyro->dna.obj[_vm->_gyro->potion - 1])) { dixi('q', 68); - _vm->_gyro->dna.obj[_vm->_gyro->potion] = true; + _vm->_gyro->dna.obj[_vm->_gyro->potion - 1] = true; _vm->_lucerna->objectlist(); _vm->_lucerna->points(3); return; @@ -276,7 +276,7 @@ void Visa::talkto(byte whom) { dixi('n', whom); // File not found! if ((_vm->_gyro->subjnumber == 0) && ((whom + 149) == _vm->_gyro->pcrapulus)) { // Crapulus: get the badge - first time only - _vm->_gyro->dna.obj[_vm->_gyro->badge] = true; + _vm->_gyro->dna.obj[_vm->_gyro->badge - 1] = true; _vm->_lucerna->objectlist(); dixi('q', 1); // Circular from Cardiff. _vm->_gyro->dna.talked_to_crapulus = true; |