diff options
author | Gregory Montoir | 2003-11-27 13:49:00 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-11-27 13:49:00 +0000 |
commit | 9c6e5ce50ad9e1e7994ceaef5e7e5be10ec996f4 (patch) | |
tree | e80163e02240ea8f676433848651b05633e6ab92 | |
parent | 6f23e2c2117925aa743155c3fd515144177efbbf (diff) | |
download | scummvm-rg350-9c6e5ce50ad9e1e7994ceaef5e7e5be10ec996f4.tar.gz scummvm-rg350-9c6e5ce50ad9e1e7994ceaef5e7e5be10ec996f4.tar.bz2 scummvm-rg350-9c6e5ce50ad9e1e7994ceaef5e7e5be10ec996f4.zip |
- speak correct sentence when object is not usable
- some hardcoded stuff for rooms 69 & 108
- handle CUTJOEF
svn-id: r11383
-rw-r--r-- | queen/command.cpp | 2 | ||||
-rw-r--r-- | queen/cutaway.cpp | 91 | ||||
-rw-r--r-- | queen/graphics.cpp | 305 | ||||
-rw-r--r-- | queen/graphics.h | 39 | ||||
-rw-r--r-- | queen/journal.cpp | 4 | ||||
-rw-r--r-- | queen/logic.cpp | 83 | ||||
-rw-r--r-- | queen/logic.h | 20 | ||||
-rw-r--r-- | queen/xref.txt | 4 |
8 files changed, 466 insertions, 82 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index e3e3a8a9d1..f73229ee10 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -948,7 +948,7 @@ void Command::executeStandardStuff(const Verb& action, int16 subj1, int16 subj2) } } else { - _logic->joeSpeak(1); + _logic->joeSpeak(2); } break; diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 189bc9019e..d719a6ea68 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -158,19 +158,18 @@ void Cutaway::load(const char *filename) { if (entryString[0] == '*' && entryString[1] == 'F' && entryString[3] == '\0') { - warning("[Cutaway::load] CUTJOEF not handled"); switch (entryString[2]) { case 'L': - /* CUTJOEF = LEFT; */ + _logic->joeCutFacing(DIR_LEFT); break; case 'R': - /* CUTJOEF = RIGHT; */ + _logic->joeCutFacing(DIR_RIGHT); break; case 'F': - /* CUTJOEF = FRONT; */ + _logic->joeCutFacing(DIR_FRONT); break; case 'B': - /* CUTJOEF = BACK; */ + _logic->joeCutFacing(DIR_BACK); break; } } @@ -326,6 +325,78 @@ void Cutaway::actionSpecialMove(int index) { _graphics->cleanupCarBamScene(_logic->findBob(594)); // Oil object break; + // c69e.cut - Fight1 background animation + case 9: + _graphics->initFightBamScene(); + _logic->gameState(148, 1); + break; + + // c69e.cut + case 10: + _graphics->bamData()->flag = 2; + while (_graphics->bamData()->flag) { + _logic->update(); + } + break; + + // c69z.cut - Frank growing + case 11: { + _graphics->bankUnpack(1, 38, 15); + BobSlot *bobFrank = _graphics->bob(5); + bobFrank->frameNum = 38; + bobFrank->curPos(160, 200); + bobFrank->box.y2 = GAME_SCREEN_HEIGHT - 1; + + int i; + for (i = 10; i <= 100; i += 4) { + bobFrank->scale = i; + _logic->update(); + } + for (i = 0; i <= 20; ++i) { + _logic->update(); + } + + _logic->objectData(521)->name = ABS(_logic->objectData(521)->name); // Dinoray + _logic->objectData(526)->name = ABS(_logic->objectData(526)->name); // Frank obj + _logic->objectData(522)->name = -ABS(_logic->objectData(522)->name); // TMPD object off + _logic->objectData(525)->name = -ABS(_logic->objectData(525)->name); // Floda guards off + _logic->objectData(523)->name = -ABS(_logic->objectData(523)->name); // Sparky object off + _logic->gameState(157, 1); // No more Ironstein + } + break; + + // c69z.cut - Robot growing + case 12: { + _graphics->bankUnpack(1, 38, 15); + BobSlot *bobRobot = _graphics->bob(5); + bobRobot->frameNum = 38; + bobRobot->curPos(160, 200); + bobRobot->box.y2 = GAME_SCREEN_HEIGHT - 1; + + int i; + for (i = 10; i <= 100; i += 4) { + bobRobot->scale = i; + _logic->update(); + } + for (i = 0; i <= 20; ++i) { + _logic->update(); + } + + _logic->objectData(524)->name = -ABS(_logic->objectData(524)->name); // Azura object off + _logic->objectData(526)->name = -ABS(_logic->objectData(526)->name); // Frank object off + } + break; + + // Robot shrinking + case 13: { + int i; + for (i = 100; i >= 35; i -= 5) { + _graphics->bob(6)->scale = i; + _logic->update(); + } + } + break; + // cdint.cut - put camera on Joe case 16: _graphics->cameraBob(0); @@ -426,7 +497,10 @@ void Cutaway::actionSpecialMove(int index) { // c75b.cut - Screen shake case 32: - // TODO implement + OSystem::instance()->set_shake_pos(3); + _logic->update(); + OSystem::instance()->set_shake_pos(0); + _logic->update(); break; // cred.cut - scale title @@ -1203,6 +1277,9 @@ void Cutaway::run(char *nextFilename) { _input->cutawayRunning(true); + _logic->joeCutFacing(_logic->joeFacing()); + _logic->joeFace(); + _initialRoom = _temporaryRoom = _logic->currentRoom(); // FIXME: hack to hide the panel *before* displaying a talking head. @@ -1362,7 +1439,7 @@ void Cutaway::run(char *nextFilename) { } } - // XXX CUTJOEF=0; + _logic->joeCutFacing(0); _comPanel = 0; int k = 0; diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 34fe174450..4c7b62eeee 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -333,9 +333,6 @@ void BobSlot::animReset() { } else { animating = false; -// anim.speed = anim.speedBak; -// frameNum = anim.normal.firstFrame; -// frameDir = 1; } } } @@ -400,6 +397,7 @@ void Graphics::bobDraw(uint32 frameNum, int16 x, int16 y, uint16 scale, bool xfl void Graphics::bobDrawInventoryItem(uint32 bobnum, uint16 x, uint16 y) { + if (bobnum == 0) { // clear panel area _display->fill(RB_PANEL, x, y, 32, 32, INK_BG_PANEL); @@ -633,7 +631,7 @@ void Graphics::bobCustomParallax(uint16 roomNum) { updateCarBamScene(); break; case ROOM_FINAL_FIGHT: - warning("Graphics::bobCustomParallax() - ROOM_FINAL_FIGHT not handled"); + updateFightBamScene(); break; case ROOM_INTRO_RITA_JOE_HEADS: // CR 2 - CD-Rom pan right while Rita talks... _cameraBob = -1; @@ -770,41 +768,43 @@ void Graphics::loadPanel() { void Graphics::initCarBamScene() { - debug(0, "Graphics::initCarBamScene()"); bobClear(5); _bobs[5].active = true; bobClear(6); _bobs[6].active = true; bobClear(7); _bobs[7].active = true; - _bam.enable = true; + _bam.flag = 1; _bam.index = 0; } void Graphics::updateCarBamScene() { - if (_bam.enable) { - const CarBamData *cb = &_carBamData[_bam.index]; + if (_bam.flag) { + const BamDataBlock *bdb = &_bam._carData[_bam.index]; BobSlot *pbob; // Truck pbob = &_bobs[5]; - pbob->curPos(cb->truck.x, cb->truck.y); - pbob->frameNum = 40 + cb->truck.frame; + pbob->curPos(bdb->obj1.x, bdb->obj1.y); + pbob->frameNum = 40 + bdb->obj1.frame; // Rico pbob = &_bobs[6]; - pbob->curPos(cb->rico.x, cb->rico.y); - pbob->frameNum = 30 + cb->rico.frame; + pbob->curPos(bdb->obj2.x, bdb->obj2.y); + pbob->frameNum = 30 + bdb->obj2.frame; // FX pbob = &_bobs[7]; - pbob->curPos(cb->fx.x, cb->fx.y); - pbob->frameNum = 41 + cb->fx.frame; + pbob->curPos(bdb->fx.x, bdb->fx.y); + pbob->frameNum = 41 + bdb->fx.frame; + + if (bdb->sfx < 0) { + // XXX playsong(-bdb->sfx); + } - _bam.sfx = cb->sfx; - if (_bam.sfx == 99) { + if (bdb->sfx == 99) { _bam.index = 0; } else { @@ -818,13 +818,92 @@ void Graphics::updateCarBamScene() { void Graphics::cleanupCarBamScene(uint16 oilBobNum) { - _bam.enable = false; + _bam.flag = 0; //CR 2 - Turn off big oil splat and gun shots! _bobs[oilBobNum].active = false; _bobs[7].active = false; } +void Graphics::initFightBamScene() { + + bobClear(5); + _bobs[5].active = true; + bobClear(6); + _bobs[6].active = true; + bobClear(7); + _bobs[7].active = true; + _bam.flag = 1; + _bam.index = 0; + _bam._fightData = _bam._fight1Data; +} + + +void Graphics::updateFightBamScene() { + + if (_bam.flag) { + const BamDataBlock *bdb = &_bam._fightData[_bam.index]; + BobSlot *pbob; + + // Frank + pbob = &_bobs[5]; + pbob->curPos(bdb->obj1.x, bdb->obj1.y); + pbob->frameNum = 40 + ABS(bdb->obj1.frame); + pbob->xflip = (bdb->obj1.frame < 0); + + // Robot + pbob = &_bobs[6]; + pbob->curPos(bdb->obj2.x, bdb->obj2.y); + pbob->frameNum = 40 + ABS(bdb->obj2.frame); + pbob->xflip = (bdb->obj2.frame < 0); + + // FX + pbob = &_bobs[7]; + pbob->curPos(bdb->fx.x, bdb->fx.y); + pbob->frameNum = 40 + ABS(bdb->fx.frame); + pbob->xflip = (bdb->fx.frame < 0); + + if (bdb->sfx < 0) { + // XXX playsong(-bdb->sfx); + } + + ++_bam.index; + switch (bdb->sfx) { + case 0: // nothing, so reset shaked screen if necessary + if (_bam._screenShaked) { + OSystem::instance()->set_shake_pos(0); + _bam._screenShaked = false; + } + break; + case 1: // shake screen + OSystem::instance()->set_shake_pos(3); + _bam._screenShaked = true; + break; + case 2: // play background sfx + // XXX if(SFXTOGGLE) sfxplay(NULLstr); + break; + case 3: // play background sfx and shake screen + // XXX if(SFXTOGGLE) sfxplay(NULLstr); + OSystem::instance()->set_shake_pos(3); + _bam._screenShaked = true; + break; + case 99: // end of BAM data + _bam.index = 0; + const BamDataBlock *data[] = { + _bam._fight1Data, + _bam._fight2Data, + _bam._fight3Data + }; + _bam._fightData = data[Logic::randomizer.getRandomNumber(2)]; + if (_bam.flag == 2) { + _bam.flag = 0; + } + break; + } + } +} + + void Graphics::update(uint16 room) { bobSortAll(); @@ -959,7 +1038,7 @@ int Graphics::textCenterX(const char *text) const { -const CarBamData Graphics::_carBamData[] = { +const BamDataBlock BamData::_carData[] = { { { 310, 105, 1 }, { 314, 106, 17 }, { 366, 101, 1 }, 0 }, { { 303, 105, 1 }, { 307, 106, 17 }, { 214, 0, 10 }, 0 }, { { 297, 104, 1 }, { 301, 105, 17 }, { 214, 0, 10 }, 0 }, @@ -1037,5 +1116,195 @@ const CarBamData Graphics::_carBamData[] = { { { 310, 110, 1 }, { 314, 111, 17 }, { 214, 0, 10 }, 99 } }; +const BamDataBlock BamData::_fight1Data[] = { + { { 75, 96, 1 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 2 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 3 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 4 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 2 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 3 }, { 187, 96, -23 }, { 58, 37, 46 }, 0 }, + { { 75, 96, 4 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, + { { 79, 96, 1 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, + { { 85, 96, 2 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, + { { 94, 96, 3 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, + { { 100, 96, 4 }, { 187, 96, -24 }, { 58, 37, 46 }, 0 }, + { { 113, 96, 1 }, { 187, 96, -25 }, { 58, 37, 46 }, 0 }, + { { 121, 96, 1 }, { 187, 96, -25 }, { 58, 37, 46 }, 0 }, + { { 136, 96, 16 }, { 187, 96, -26 }, { 58, 37, 46 }, 0 }, + { { 151, 93, 6 }, { 187, 96, -27 }, { 58, 37, 46 }, 0 }, + { { 159, 83, 16 }, { 187, 96, -28 }, { 58, 37, 46 }, 0 }, + { { 170, 73, 16 }, { 187, 96, -29 }, { 182, 96, 48 }, 3 }, + { { 176, 69, 13 }, { 187, 96, -31 }, { 182, 94, 49 }, 1 }, + { { 168, 66, 13 }, { 187, 98, -32 }, { 182, 92, 50 }, 0 }, + { { 155, 75, 13 }, { 187, 96, -32 }, { 182, 88, 51 }, 3 }, + { { 145, 86, 13 }, { 187, 98, -32 }, { 182, 85, 52 }, 0 }, + { { 127, 104, 13 }, { 187, 98, -32 }, { 182, 25, 52 }, 1 }, + { { 122, 108, 13 }, { 187, 98, -32 }, { 182, 25, 52 }, 1 }, + { { 120, 104, 14 }, { 187, 96, -34 }, { 107, 145, 42 }, 2 }, + { { 111, 103, 13 }, { 187, 96, -23 }, { 107, 144, 43 }, 0 }, + { { 102, 105, 13 }, { 187, 96, -23 }, { 107, 142, 43 }, 0 }, + { { 97, 107, 13 }, { 187, 96, -23 }, { 107, 139, 44 }, 0 }, + { { 92, 101, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 3 }, + { { 90, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, + { { 88, 104, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, + { { 87, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, + { { 86, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, + { { 86, 105, 14 }, { 187, 96, -23 }, { 107, 34, 47 }, 0 }, + { { 86, 105, 15 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 85, 98, 16 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 92, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 92, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 89, 96, 4 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 86, 96, 3 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 83, 96, 2 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 81, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 78, 96, 4 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 3 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 0, 0, 0 }, 99 } +}; + +const BamDataBlock BamData::_fight2Data[] = { + { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 78, 96, 2 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 81, 96, 3 }, { 189, 96, -18 }, { 150, 45, 35 }, 0 }, + { { 84, 96, 4 }, { 183, 96, -19 }, { 150, 45, 35 }, 0 }, + { { 87, 96, 1 }, { 181, 96, -20 }, { 150, 45, 35 }, 0 }, + { { 90, 96, 2 }, { 177, 96, -21 }, { 150, 45, 35 }, 0 }, + { { 93, 96, 3 }, { 171, 96, -22 }, { 150, 45, 35 }, 0 }, + { { 96, 96, 4 }, { 169, 96, -17 }, { 150, 45, 35 }, 0 }, + { { 99, 96, 1 }, { 165, 96, -18 }, { 150, 45, 35 }, 0 }, + { { 102, 96, 2 }, { 159, 96, -19 }, { 150, 45, 35 }, 0 }, + { { 105, 96, 3 }, { 157, 96, -20 }, { 150, 45, 35 }, 0 }, + { { 108, 96, 4 }, { 153, 96, -21 }, { 150, 45, 35 }, 0 }, + { { 111, 96, 1 }, { 147, 96, -22 }, { 150, 45, 35 }, 0 }, + { { 114, 96, 2 }, { 147, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 117, 96, 3 }, { 147, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 120, 96, 4 }, { 147, 96, -24 }, { 150, 45, 35 }, 0 }, + { { 123, 96, 1 }, { 147, 96, -25 }, { 150, 45, 35 }, 0 }, + { { 125, 96, 2 }, { 147, 96, -25 }, { 150, 45, 35 }, 0 }, + { { 127, 96, 12 }, { 147, 96, -69 }, { 122, 94, 36 }, 3 }, + { { 127, 95, 11 }, { 147, 96, -70 }, { 122, 94, 41 }, 0 }, + { { 127, 96, 12 }, { 147, 96, -71 }, { 122, 100, 36 }, 3 }, + { { 127, 97, 11 }, { 147, 96, -69 }, { 122, 100, 41 }, 0 }, + { { 127, 96, 12 }, { 147, 96, -70 }, { 127, 103, 36 }, 3 }, + { { 127, 95, 11 }, { 147, 96, -71 }, { 127, 103, 41 }, 0 }, + { { 127, 94, 12 }, { 147, 96, -69 }, { 123, 94, 36 }, 3 }, + { { 127, 95, 11 }, { 147, 96, -70 }, { 123, 94, 41 }, 0 }, + { { 127, 96, 12 }, { 147, 96, -71 }, { 120, 99, 36 }, 3 }, + { { 127, 96, 12 }, { 147, 96, -71 }, { 115, 98, 41 }, 0 }, + { { 117, 93, 11 }, { 147, 96, -25 }, { 115, 134, 42 }, 0 }, + { { 110, 92, 11 }, { 147, 96, -25 }, { 114, 133, 42 }, 0 }, + { { 102, 93, 11 }, { 147, 96, -25 }, { 114, 131, 43 }, 0 }, + { { 92, 93, 11 }, { 147, 96, -25 }, { 114, 130, 43 }, 0 }, + { { 82, 94, 11 }, { 147, 96, -25 }, { 114, 128, 44 }, 0 }, + { { 76, 95, 11 }, { 147, 96, -25 }, { 114, 127, 44 }, 0 }, + { { 70, 96, 11 }, { 147, 96, -25 }, { 114, 126, 45 }, 0 }, + { { 75, 96, 5 }, { 147, 96, -25 }, { 114, 125, 46 }, 1 }, + { { 75, 96, 6 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, + { { 75, 96, 6 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, + { { 75, 96, 5 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, + { { 75, 96, 7 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, + { { 75, 96, 68 }, { 147, 96, -25 }, { 114, 43, 46 }, 0 }, + { { 75, 96, 68 }, { 147, 96, -25 }, { 89, 104, 36 }, 2 }, + { { 75, 96, 68 }, { 147, 96, -25 }, { 94, 103, 62 }, 0 }, + { { 75, 96, 68 }, { 147, 96, -25 }, { 122, 103, 63 }, 0 }, + { { 75, 96, 68 }, { 147, 96, -25 }, { 141, 103, 64 }, 0 }, + { { 75, 96, 68 }, { 147, 96, -30 }, { 150, 103, 65 }, 3 }, + { { 75, 96, 68 }, { 156, 96, -30 }, { 160, 103, 66 }, 0 }, + { { 75, 96, 7 }, { 164, 96, -30 }, { 169, 103, 67 }, 0 }, + { { 75, 96, 5 }, { 169, 96, -30 }, { 177, 103, 48 }, 3 }, + { { 75, 96, 5 }, { 173, 96, -30 }, { 185, 103, 49 }, 0 }, + { { 75, 96, 6 }, { 178, 96, -30 }, { 198, 103, 50 }, 0 }, + { { 75, 96, 6 }, { 181, 96, -30 }, { 207, 103, 51 }, 1 }, + { { 75, 96, 5 }, { 184, 96, -30 }, { 221, 103, 52 }, 0 }, + { { 75, 96, 5 }, { 186, 96, -30 }, { 224, 53, 53 }, 0 }, + { { 75, 96, 5 }, { 187, 96, -23 }, { 224, 53, 53 }, 99 } +}; + +const BamDataBlock BamData::_fight3Data[] = { + { { 75, 96, 1 }, { 187, 96, -23 }, { 150, 45, 35 }, 0 }, + { { 77, 96, 2 }, { 187, 96, -22 }, { 150, 45, 35 }, 0 }, + { { 80, 96, 3 }, { 185, 96, -17 }, { 150, 45, 35 }, 0 }, + { { 83, 96, 4 }, { 181, 96, -18 }, { 150, 45, 35 }, 0 }, + { { 86, 96, 1 }, { 175, 96, -19 }, { 150, 45, 35 }, 0 }, + { { 88, 96, 2 }, { 173, 96, -20 }, { 150, 45, 35 }, 0 }, + { { 91, 96, 3 }, { 169, 96, -21 }, { 150, 45, 35 }, 0 }, + { { 94, 96, 4 }, { 163, 96, -22 }, { 150, 45, 35 }, 0 }, + { { 97, 96, 1 }, { 161, 96, -17 }, { 150, 45, 35 }, 0 }, + { { 99, 96, 2 }, { 157, 96, -18 }, { 150, 45, 35 }, 0 }, + { { 102, 96, 3 }, { 151, 96, -19 }, { 150, 45, 35 }, 0 }, + { { 105, 96, 4 }, { 149, 96, -20 }, { 150, 45, 35 }, 0 }, + { { 108, 96, 1 }, { 145, 96, -21 }, { 150, 45, 35 }, 0 }, + { { 110, 96, 2 }, { 145, 96, -25 }, { 150, 45, 35 }, 0 }, + { { 113, 96, 3 }, { 145, 96, -26 }, { 132, 96, 36 }, 2 }, + { { 117, 96, 7 }, { 145, 96, -27 }, { 122, 97, 36 }, 0 }, + { { 117, 96, 7 }, { 145, 96, -28 }, { 117, 97, 37 }, 0 }, + { { 116, 96, 12 }, { 145, 96, -24 }, { 110, 96, 38 }, 3 }, + { { 109, 96, 12 }, { 145, 96, -24 }, { 103, 95, 39 }, 0 }, + { { 105, 96, 12 }, { 145, 96, -24 }, { 95, 90, 40 }, 1 }, + { { 96, 96, 11 }, { 145, 96, -24 }, { 86, 80, 41 }, 0 }, + { { 92, 96, 11 }, { 145, 96, -24 }, { 86, 80, 41 }, 0 }, + { { 93, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, + { { 91, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, + { { 89, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, + { { 88, 96, 5 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -24 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 5 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -23 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -26 }, { 86, 38, 41 }, 0 }, + { { 87, 96, 6 }, { 145, 96, -27 }, { 132, 97, 36 }, 2 }, + { { 87, 96, 5 }, { 145, 96, -28 }, { 118, 97, 36 }, 0 }, + { { 87, 96, 7 }, { 145, 96, -24 }, { 107, 97, 36 }, 0 }, + { { 87, 96, 8 }, { 145, 96, -24 }, { 101, 97, 36 }, 0 }, + { { 87, 96, 9 }, { 145, 96, -23 }, { 102, 97, 66 }, 3 }, + { { 87, 96, 10 }, { 145, 96, -23 }, { 120, 97, 67 }, 0 }, + { { 87, 96, 10 }, { 145, 96, -30 }, { 139, 97, 67 }, 1 }, + { { 87, 96, 7 }, { 146, 96, -30 }, { 144, 97, 62 }, 2 }, + { { 86, 96, 4 }, { 160, 96, -30 }, { 144, 97, 48 }, 1 }, + { { 83, 96, 3 }, { 170, 96, -31 }, { 154, 93, 49 }, 0 }, + { { 80, 96, 2 }, { 174, 96, -31 }, { 161, 89, 50 }, 0 }, + { { 78, 96, 1 }, { 178, 99, -31 }, { 169, 85, 51 }, 0 }, + { { 75, 96, 4 }, { 183, 104, -31 }, { 175, 79, 52 }, 0 }, + { { 75, 96, 1 }, { 185, 99, -32 }, { 180, 144, 42 }, 3 }, + { { 75, 96, 1 }, { 185, 106, -31 }, { 181, 141, 42 }, 0 }, + { { 75, 96, 5 }, { 185, 104, -31 }, { 181, 138, 43 }, 0 }, + { { 75, 96, 5 }, { 188, 106, -31 }, { 182, 135, 43 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 131, 44 }, 3 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 127, 45 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 184, 121, 46 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 115, 46 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 99, -32 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 195, 98, -33 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 96, -34 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 193, 96, -25 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 5 }, { 193, 96, -24 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 191, 96, -18 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 190, 96, -19 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 6 }, { 187, 96, -20 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 0 }, + { { 75, 96, 1 }, { 187, 96, -23 }, { 183, 41, 47 }, 99 } +}; + + } // End of namespace Queen diff --git a/queen/graphics.h b/queen/graphics.h index 12fcae44c8..53a6aab638 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -101,26 +101,31 @@ struct TextSlot { }; -struct CarBamData { - struct Obj { - int16 x, y; - uint16 frame; - }; - Obj truck; - Obj rico; - Obj fx; - int16 sfx; +struct BamDataObj { + int16 x, y; + int16 frame; }; +struct BamDataBlock { + BamDataObj obj1; // truck / Frank + BamDataObj obj2; // Rico / robot + BamDataObj fx; + int16 sfx; +}; struct BamData { - bool enable; + + BamData() : flag(0), index(0) {} + + int16 flag; int16 index; - int16 sfx; - BamData() - : enable(false), index(0), sfx(0) { - } + bool _screenShaked; + const BamDataBlock *_fightData; + static const BamDataBlock _carData[]; + static const BamDataBlock _fight1Data[]; + static const BamDataBlock _fight2Data[]; + static const BamDataBlock _fight3Data[]; }; @@ -180,10 +185,14 @@ public: int cameraBob() const { return _cameraBob; } BamData *bamData() { return &_bam; } + void initCarBamScene(); void updateCarBamScene(); void cleanupCarBamScene(uint16 i); + void initFightBamScene(); + void updateFightBamScene(); + void update(uint16 room); enum { @@ -232,8 +241,6 @@ private: Input *_input; Resource *_resource; - static const CarBamData _carBamData[]; - }; } // End of namespace Queen diff --git a/queen/journal.cpp b/queen/journal.cpp index c6397cab6f..f8f443ec91 100644 --- a/queen/journal.cpp +++ b/queen/journal.cpp @@ -150,8 +150,8 @@ void Journal::restore() { _logic->joeX(_prevJoeX); _logic->joeY(_prevJoeY); - - // XXX CUTJOEF=JOEF; + + _logic->joeCutFacing(_logic->joeFacing()); _logic->oldRoom(_logic->currentRoom()); _logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_JOE, 0, 0, false); diff --git a/queen/logic.cpp b/queen/logic.cpp index 90b8889b19..c4599bd680 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -676,6 +676,11 @@ void Logic::joeScale(uint16 scale) { _joe.scale = scale; } +void Logic::joeCutFacing(uint16 dir) { + + _joe.cutFacing = dir; +} + void Logic::joePrevFacing(uint16 dir) { _joe.prevFacing = dir; } @@ -1595,12 +1600,11 @@ void Logic::joeSetupFromBanks(const char *animBank, const char *standBank) { void Logic::joeSetup() { joeSetupFromBanks("joe_a.BBK", "joe_b.BBK"); - _joe.facing = DIR_FRONT; + joeFacing(DIR_FRONT); } ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) { - // queen.c SETUP_HERO() debug(0, "Logic::joeSetupInRoom(%d, %d) joe.x=%d joe.y=%d", autoPosition, scale, _joe.x, _joe.y); @@ -1646,24 +1650,43 @@ ObjectData *Logic::joeSetupInRoom(bool autoPosition, uint16 scale) { } } - // XXX CUTJOEF (queen.c l.266-271) - - // check to see which way Joe entered room - _joe.facing = State::findDirection(pod->state); - switch (_joe.facing) { - case DIR_BACK: - _joe.facing = DIR_FRONT; - break; - case DIR_FRONT: - _joe.facing = DIR_BACK; - break; + if (joeCutFacing() > 0) { + joeFacing(joeCutFacing()); + joeCutFacing(0); } - _joe.prevFacing = _joe.facing; + else { + // check to see which way Joe entered room + switch (State::findDirection(pod->state)) { + case DIR_BACK: + joeFacing(DIR_FRONT); + break; + case DIR_FRONT: + joeFacing(DIR_BACK); + break; + case DIR_LEFT: + joeFacing(DIR_RIGHT); + break; + case DIR_RIGHT: + joeFacing(DIR_LEFT); + break; + } + } + joePrevFacing(joeFacing()); BobSlot *pbs = _graphics->bob(0); pbs->scale = _joe.scale; - // XXX room 108 specific (queen.c l.283-292) + if (_currentRoom == 108) { + _graphics->cameraBob(-1); + _graphics->bankLoad("joe_e.act", 7); + _graphics->bankUnpack(2, 29 + FRAMES_JOE_XTRA, 7); + + _display->horizontalScroll(320); + + joeFacing(DIR_RIGHT); + joeCutFacing(DIR_RIGHT); + joePrevFacing(DIR_RIGHT); + } joeFace(); pbs->active = true; @@ -1691,34 +1714,40 @@ uint16 Logic::joeFace() { } else { frame = 33; - if (_joe.facing == DIR_FRONT) { - if (_joe.prevFacing == DIR_BACK) { + if (joeFacing() == DIR_FRONT) { + if (joePrevFacing() == DIR_BACK) { pbs->frameNum = 33 + FRAMES_JOE_XTRA; update(); } frame = 34; } - else if (_joe.facing == DIR_BACK) { - if (_joe.prevFacing == DIR_FRONT) { + else if (joeFacing() == DIR_BACK) { + if (joePrevFacing() == DIR_FRONT) { pbs->frameNum = 33 + FRAMES_JOE_XTRA; update(); } frame = 35; } - else if ((_joe.facing == DIR_LEFT && _joe.prevFacing == DIR_RIGHT) - || (_joe.facing == DIR_RIGHT && _joe.prevFacing == DIR_LEFT)) { + else if ((joeFacing() == DIR_LEFT && joePrevFacing() == DIR_RIGHT) + || (joeFacing() == DIR_RIGHT && joePrevFacing() == DIR_LEFT)) { pbs->frameNum = 34 + FRAMES_JOE_XTRA; update(); } pbs->frameNum = frame + FRAMES_JOE_XTRA; pbs->scale = _joe.scale; - pbs->xflip = (_joe.facing == DIR_LEFT); + pbs->xflip = (joeFacing() == DIR_LEFT); update(); - _joe.prevFacing = _joe.facing; + joePrevFacing(joeFacing()); switch (frame) { - case 33: frame = 1; break; - case 34: frame = 3; break; - case 35: frame = 5; break; + case 33: + frame = 1; + break; + case 34: + frame = 3; + break; + case 35: + frame = 5; + break; } } pbs->frameNum = 29 + FRAMES_JOE_XTRA; @@ -2502,7 +2531,7 @@ bool Logic::gameLoad(uint16 slot) { return false; } - //CUTJOEF = _joe.facing; + joeCutFacing(joeFacing()); joeFace(); //OLDX = _joe.x; diff --git a/queen/logic.h b/queen/logic.h index 8424a30444..d2f3465f60 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -166,18 +166,20 @@ public: ObjectDescription *objectDescription(uint16 objNum) const { return &_objectDescription[objNum]; } uint16 objectDescriptionCount() const { return _numObjDesc; } - uint16 joeFacing() { return _joe.facing; } - uint16 joeX() { return _joe.x; } - uint16 joeY() { return _joe.y; } - JoeWalkMode joeWalk() { return _joe.walk; } - uint16 joeScale() { return _joe.scale; } - uint16 joePrevFacing() { return _joe.prevFacing; } + uint16 joeFacing() const { return _joe.facing; } + uint16 joeX() const { return _joe.x; } + uint16 joeY() const { return _joe.y; } + JoeWalkMode joeWalk() const { return _joe.walk; } + uint16 joeScale() const { return _joe.scale; } + uint16 joeCutFacing() const { return _joe.cutFacing; } + uint16 joePrevFacing() const { return _joe.prevFacing; } void joeFacing(uint16 dir); void joeX(uint16 x); void joeY(uint16 y); void joeWalk(JoeWalkMode walking); void joeScale(uint16 scale); + void joeCutFacing(uint16 dir); void joePrevFacing(uint16 dir); const char *joeResponse(int i) const { return _joeResponse[i]; } @@ -409,10 +411,10 @@ protected: uint16 _numAFile; //A_FILE_MAX struct { - uint16 x, y; - uint16 facing, prevFacing; + uint16 x, y; + uint16 facing, cutFacing, prevFacing; JoeWalkMode walk; - uint16 scale; + uint16 scale; } _joe; int16 _gameState[GAME_STATE_COUNT]; diff --git a/queen/xref.txt b/queen/xref.txt index 44d754da0e..bf2da95e53 100644 --- a/queen/xref.txt +++ b/queen/xref.txt @@ -180,7 +180,7 @@ USE_UNDERWEAR() Logic::joeUseUnderwear USE_CLOTHES() Logic::joeUseClothes USE_DRESS() Logic::joeUseDress - -CUTJOEF +CUTJOEF Logic::_joe.cutFacing JOE_RESPstr Logic::_joeResponse JOEF,JX,JY,JDIR Logic::_joe.* JOEWALK Logic::_joe.walk @@ -234,7 +234,7 @@ A_FILE_MAX Logic::_numAFile ACTOR_DATA_MAX Logic::_numActors AREA Logic::_area AREAMAX Logic::_areaMax -bamflag Graphics::_bam.enable +bamflag Graphics::_bam.flag bamindex Graphics::_bam.index DESCTOT Logic::_numDescriptions ENTRY_OBJ Logic::_entryObj |