diff options
author | Eugene Sandulenko | 2004-01-25 05:25:50 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-01-25 05:25:50 +0000 |
commit | 87730caa0298fca70c609c5d589620ea04df8830 (patch) | |
tree | e859b82501c77e5df533fc87c8f5542a186a384d /scumm/insane | |
parent | f4e26c9412b4edaf50602091f29a1c2362147107 (diff) | |
download | scummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.tar.gz scummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.tar.bz2 scummvm-rg350-87730caa0298fca70c609c5d589620ea04df8830.zip |
Fixed plenty of bugs:
o Seek error. Now it seems to cover all cases
o Shadows in tunnels on mineroad
o Renamed some function to match functionality
o bug #867555 (Problems between Mink Farm and Poyhoga)
o Ben disappearing in car chase
svn-id: r12586
Diffstat (limited to 'scumm/insane')
-rw-r--r-- | scumm/insane/insane.cpp | 4 | ||||
-rw-r--r-- | scumm/insane/insane_ben.cpp | 45 | ||||
-rw-r--r-- | scumm/insane/insane_enemy.cpp | 30 | ||||
-rw-r--r-- | scumm/insane/insane_iact.cpp | 8 | ||||
-rw-r--r-- | scumm/insane/insane_scenes.cpp | 16 |
5 files changed, 54 insertions, 49 deletions
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp index def4a29646..5e0c3dbd68 100644 --- a/scumm/insane/insane.cpp +++ b/scumm/insane/insane.cpp @@ -1437,8 +1437,8 @@ void Insane::smush_setFrameSteps(int32 step1, int32 step2) { _smush_frameStep = step1; } - void Insane::smush_setupSanFile(const char *filename, int32 offset, int32 contFrame) { - debug(0, "smush_setupSanFile(%s, %x)", filename, offset); +void Insane::smush_setupSanFile(const char *filename, int32 offset, int32 contFrame) { + debug(0, "smush_setupSanFile(%s, %x, %d)", filename, offset, contFrame); _player->seekSan(filename, _vm->getGameDataPath(), offset, contFrame); diff --git a/scumm/insane/insane_ben.cpp b/scumm/insane/insane_ben.cpp index 45e4b53b74..6f81feaaa3 100644 --- a/scumm/insane/insane_ben.cpp +++ b/scumm/insane/insane_ben.cpp @@ -287,6 +287,7 @@ void Insane::mineChooseRoad(int32 buttons) { _actor[0].field_8 = 112; smlayer_setActorFacing(0, 2, 26, 180); break; + case 4: case 5: _actor[0].tilt = tmp; @@ -480,19 +481,19 @@ bool Insane::weaponBenIsEffective(void) { } int32 Insane::calcBenDamage(bool arg_0, bool arg_4) { - if ((_actor[1].x - _actor[0].x > weaponMaxRange(0)) || - (_actor[1].x - _actor[0].x < weaponMinRange(0))) + if ((_actor[1].x - _actor[0].x > weaponMaxRange(1)) || + (_actor[1].x - _actor[0].x < weaponMinRange(1))) return 0; - if (_actor[1].field_44 && arg_4) + if (_actor[0].field_44 && arg_4) return 1000; - if (!actor1StateFlags(_actor[1].act[2].state)) + if (!actor1StateFlags(_actor[0].act[2].state)) return 0; if (arg_0) { - ouchSoundEnemy(); - _actor[1].damage += weaponDamage(0); + ouchSoundBen(); + _actor[0].damage += weaponDamage(1); // PATCH } return 1; @@ -710,7 +711,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].weaponClass = 1; if (_actor[0].act[2].frame == 2) { if (_currEnemy != EN_CAVEFISH) { - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(60); if (tmp == 1000) @@ -762,7 +763,7 @@ void Insane::actor02Reaction(int32 buttons) { if (_currEnemy == EN_VULTM2) { if ((_actor[1].x - _actor[0].x <= weaponMaxRange(0)) && (_actor[1].x - _actor[0].x >= weaponMinRange(0)) && - calcBenDamage(0, 0)) { + calcEnemyDamage(0, 0)) { smlayer_setActorFacing(0, 2, 20, 180); _actor[0].act[2].state = 97; _actor[0].act[2].room = 0; @@ -814,7 +815,7 @@ void Insane::actor02Reaction(int32 buttons) { case INV_MACE: case INV_2X4: case INV_DUST: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(73); if (tmp == 1000) @@ -823,7 +824,7 @@ void Insane::actor02Reaction(int32 buttons) { case INV_WRENCH: case INV_BOOT: case INV_HAND: - if(calcBenDamage(1, 0) == 1) + if(calcEnemyDamage(1, 0) == 1) smlayer_startSfx(73); break; } @@ -876,7 +877,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].weaponClass = 2; _actor[0].field_34 = 1; _actor[0].kicking = 0; - if ((_actor[0].act[2].frame == 3) && (calcBenDamage(0, 0) == 1)) { + if ((_actor[0].act[2].frame == 3) && (calcEnemyDamage(0, 0) == 1)) { _actor[1].damage = weaponDamage(0); smlayer_startSfx(64); _actor[1].cursorX = 320; @@ -947,14 +948,14 @@ void Insane::actor02Reaction(int32 buttons) { switch (_actor[1].weapon) { case INV_CHAIN: case INV_CHAINSAW: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(76); if (tmp == 1000) smlayer_startSfx(77); break; case INV_BOOT: - calcBenDamage(0, 1); + calcEnemyDamage(0, 1); break; case INV_DUST: if ((_actor[1].x - _actor[0].x <= weaponMaxRange(0)) && @@ -964,7 +965,7 @@ void Insane::actor02Reaction(int32 buttons) { } break; default: - if (calcBenDamage(1, 0)) + if (calcEnemyDamage(1, 0)) smlayer_startSfx(76); break; } @@ -1044,7 +1045,7 @@ void Insane::actor02Reaction(int32 buttons) { case INV_MACE: case INV_2X4: case INV_BOOT: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(67); if (tmp == 1000) @@ -1143,7 +1144,7 @@ void Insane::actor02Reaction(int32 buttons) { case INV_2X4: case INV_BOOT: case INV_DUST: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) { if (_currEnemy == EN_CAVEFISH) { _actor[1].lost = 1; @@ -1156,7 +1157,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_startSfx(80); break; default: - if (!calcBenDamage(1, 0)) + if (!calcEnemyDamage(1, 0)) smlayer_startSfx(79); break; } @@ -1227,14 +1228,14 @@ void Insane::actor02Reaction(int32 buttons) { case INV_2X4: case INV_BOOT: case INV_DUST: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(70); if (tmp == 1000) smlayer_startSfx(71); break; case 6: - if (!calcBenDamage(0, 1)) + if (!calcEnemyDamage(0, 1)) smlayer_startSfx(70); break; default: @@ -1285,15 +1286,15 @@ void Insane::actor02Reaction(int32 buttons) { if (_actor[0].act[2].frame >= 5) { switch (_currEnemy) { case EN_ROTT3: - if (calcBenDamage(0, 0)) + if (calcEnemyDamage(0, 0)) _actor[1].act[2].state = 115; break; case EN_VULTF2: - if (calcBenDamage(0, 0)) + if (calcEnemyDamage(0, 0)) _actor[1].act[2].state = 113; break; default: - tmp = calcBenDamage(1, 1); + tmp = calcEnemyDamage(1, 1); if (tmp == 1) smlayer_startSfx(82); if (tmp == 1000) diff --git a/scumm/insane/insane_enemy.cpp b/scumm/insane/insane_enemy.cpp index 915da647c3..eeb2dd1903 100644 --- a/scumm/insane/insane_enemy.cpp +++ b/scumm/insane/insane_enemy.cpp @@ -1814,7 +1814,7 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; if (_actor[1].act[2].frame >= 6) { - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(60); if (tmp == 1000) @@ -1878,14 +1878,14 @@ void Insane::actor12Reaction(int32 buttons) { case INV_DUST: case INV_WRENCH: case INV_BOOT: - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(73); if (tmp == 1000) smlayer_startSfx(74); break; case INV_HAND: - if(calcEnemyDamage(1, 0)) + if(calcBenDamage(1, 0)) smlayer_startSfx(73); break; } @@ -1951,14 +1951,14 @@ void Insane::actor12Reaction(int32 buttons) { case INV_MACE: case INV_2X4: case INV_DUST: - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(76); if (tmp == 1000) smlayer_startSfx(77); break; default: - calcEnemyDamage(1, 0); + calcBenDamage(1, 0); break; } smlayer_setActorFacing(1, 2, 21,180); @@ -2042,14 +2042,14 @@ void Insane::actor12Reaction(int32 buttons) { case INV_MACE: case INV_2X4: case INV_BOOT: - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(67); if (tmp == 1000) smlayer_startSfx(68); break; default: - calcEnemyDamage(1, 0); + calcBenDamage(1, 0); break; } smlayer_setActorFacing(1, 2, 21, 180); @@ -2116,7 +2116,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].weaponClass = 0; _actor[1].kicking = 1; if (_actor[1].act[2].frame >= 1) { - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(79); @@ -2171,7 +2171,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].weaponClass = 1; _actor[1].kicking = 1; if (_actor[1].act[2].frame >= 3) { - tmp = calcEnemyDamage(1, 1); + tmp = calcBenDamage(1, 1); if (tmp == 1) smlayer_startSfx(70); if (tmp == 1000) @@ -2568,19 +2568,19 @@ void Insane::actor12Reaction(int32 buttons) { } int32 Insane::calcEnemyDamage(bool arg_0, bool arg_4) { - if ((_actor[1].x - _actor[0].x > weaponMaxRange(1)) || - (_actor[1].x - _actor[0].x < weaponMinRange(1))) + if ((_actor[1].x - _actor[0].x > weaponMaxRange(0)) || + (_actor[1].x - _actor[0].x < weaponMinRange(0))) return 0; - if (_actor[0].field_44 && arg_4) + if (_actor[1].field_44 && arg_4) return 1000; - if (!actor1StateFlags(_actor[0].act[2].state)) + if (!actor1StateFlags(_actor[1].act[2].state)) return 0; if (arg_0) { - ouchSoundBen(); - _actor[0].damage += weaponDamage(1); // PATCH + ouchSoundEnemy(); + _actor[1].damage += weaponDamage(0); } return 1; diff --git a/scumm/insane/insane_iact.cpp b/scumm/insane/insane_iact.cpp index f7e4534507..42f7cc513c 100644 --- a/scumm/insane/insane_iact.cpp +++ b/scumm/insane/insane_iact.cpp @@ -75,7 +75,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, par4 = b.getWord(); // bx switch (par1) { - case 2: + case 2: // PATCH if (par3 != 1) break; @@ -121,12 +121,12 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, if (par13 > _actor[0].x || par11 < _actor[0].x) { _tiresRustle = true; _actor[0].x1 = -_actor[0].x1; - _actor[0].damage++; + _actor[0].damage++; // PATCH } if (par9 < _actor[0].x || par7 > _actor[0].x) { _tiresRustle = true; - _actor[0].damage += 4; + _actor[0].damage += 4; // PATCH } break; case 6: @@ -167,7 +167,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, par5 = b.getWord(); // si par6 = b.getWord(); // bx smlayer_setFluPalette(_smush_roadrsh3Rip, 0); - if (par5 != par6 - 1) + if (par5 == par6 - 1) smlayer_setFluPalette(_smush_roadrashRip, 0); } break; diff --git a/scumm/insane/insane_scenes.cpp b/scumm/insane/insane_scenes.cpp index 7a07884a6b..49d5540016 100644 --- a/scumm/insane/insane_scenes.cpp +++ b/scumm/insane/insane_scenes.cpp @@ -929,6 +929,9 @@ void Insane::procPostRendering(byte *renderBitmap, int32 codecparam, int32 setup case 22: postCase10(renderBitmap, codecparam, setupsan12, setupsan13, curFrame, maxFrame); break; + case 14: + postCase23(renderBitmap, codecparam, setupsan12, setupsan13, curFrame, maxFrame); + break; case 13: postCase12(renderBitmap, codecparam, setupsan12, setupsan13, curFrame, maxFrame); needMore = true; @@ -1394,13 +1397,14 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12, void Insane::postCase23(byte *renderBitmap, int32 codecparam, int32 setupsan12, int32 setupsan13, int32 curFrame, int32 maxFrame) { if (curFrame >= maxFrame) { - if (_currSceneId == 24) + if (_currSceneId == 24) { queueSceneSwitch(21, 0, "rottfite.san", 64, 0, 0, 0); - - if (readArray(6) && readArray(4)) - queueSceneSwitch(16, 0, "limocrsh.san", 64, 0, 0, 0); - - queueSceneSwitch(5, 0, "tovista2.san", 64, 0, 0, 290); + } else { + if (readArray(6) && readArray(4)) + queueSceneSwitch(16, 0, "limocrsh.san", 64, 0, 0, 0); + else + queueSceneSwitch(5, 0, "tovista2.san", 64, 0, 0, 290); + } } _val119_ = false; _val120_ = false; |