diff options
Diffstat (limited to 'engines/xeen/interface_scene.cpp')
-rw-r--r-- | engines/xeen/interface_scene.cpp | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp index 4aa37562fb..42015017b2 100644 --- a/engines/xeen/interface_scene.cpp +++ b/engines/xeen/interface_scene.cpp @@ -436,7 +436,7 @@ void InterfaceScene::drawOutdoorsScene() { _outdoorList[Res.OUTDOOR_DRAWSTRUCT_INDEXES[idx]]._frame = -1; if (combat._monstersAttacking) { - for (int idx = 0; idx < 8; ++idx) { + for (int idx = 0; idx < MAX_PARTY_COUNT; ++idx) { if (_outdoorList._attackImgs4[idx]._sprites) _outdoorList._attackImgs4[idx]._frame = 0; else if (_outdoorList._attackImgs3[idx]._sprites) @@ -447,7 +447,7 @@ void InterfaceScene::drawOutdoorsScene() { _outdoorList._attackImgs1[idx]._frame = 0; } } else if (_charsShooting) { - for (int idx = 0; idx < 8; ++idx) { + for (int idx = 0; idx < MAX_PARTY_COUNT; ++idx) { if (_outdoorList._attackImgs1[idx]._sprites) _outdoorList._attackImgs1[idx]._frame = 0; else if (_outdoorList._attackImgs2[idx]._sprites) @@ -523,7 +523,7 @@ void InterfaceScene::drawOutdoorsScene() { _outdoorList[123] = _outdoorList[114]; _outdoorList[112]._sprites = nullptr; _outdoorList[113]._sprites = nullptr; - _outdoorList[124]._sprites = nullptr; + _outdoorList[114]._sprites = nullptr; monsterIndex = 2; } else if (combat._attackMonsters[2] != -1 && map._mobData._monsters[combat._attackMonsters[2]]._frame >= 8) { _outdoorList[121] = _outdoorList[115]; @@ -581,7 +581,7 @@ void InterfaceScene::drawIndoorsScene() { } } } else if (_charsShooting) { - for (int idx = 0; idx < 8; ++idx) { + for (int idx = 0; idx < MAX_PARTY_COUNT; ++idx) { if (_indoorList._attackImgs1[idx]._sprites != nullptr) { _indoorList._attackImgs1[idx]._frame = 0; } else if (_indoorList._attackImgs2[idx]._sprites != nullptr) { @@ -723,14 +723,14 @@ void InterfaceScene::animate3d() { monster._field9 = 0; } } else if (monster._frame == 11) { - --monster._fieldA; - if (monster._fieldA == 0) + --monster._postAttackDelay; + if (monster._postAttackDelay == 0) monster._frame = 0; } else { ++monster._frame; if (monster._frame == 11) { - --monster._frame; - monster._frame = monster._fieldA ? 10 : 0; + --monster._postAttackDelay; + monster._frame = monster._postAttackDelay ? 10 : 0; } } } @@ -760,40 +760,44 @@ void InterfaceScene::animate3d() { } } - DrawStruct *combatImgs1 = map._isOutdoors ? _outdoorList._attackImgs1 : _indoorList._attackImgs1; - DrawStruct *combatImgs2 = map._isOutdoors ? _outdoorList._attackImgs2 : _indoorList._attackImgs2; - DrawStruct *combatImgs3 = map._isOutdoors ? _outdoorList._attackImgs3 : _indoorList._attackImgs3; - DrawStruct *combatImgs4 = map._isOutdoors ? _outdoorList._attackImgs4 : _indoorList._attackImgs4; + DrawStruct *rangedImgs1 = map._isOutdoors ? _outdoorList._attackImgs1 : _indoorList._attackImgs1; + DrawStruct *rangedImgs2 = map._isOutdoors ? _outdoorList._attackImgs2 : _indoorList._attackImgs2; + DrawStruct *rangedImgs3 = map._isOutdoors ? _outdoorList._attackImgs3 : _indoorList._attackImgs3; + DrawStruct *rangedImgs4 = map._isOutdoors ? _outdoorList._attackImgs4 : _indoorList._attackImgs4; if (combat._monstersAttacking) { - for (int idx = 0; idx < 8; ++idx) { - if (combatImgs1[idx]._sprites) { - combatImgs1[idx]._sprites = nullptr; - combat._shooting[idx] = false; - } else if (combatImgs2[idx]._sprites) { - combatImgs1[idx]._sprites = combatImgs2[idx]._sprites; - combatImgs2[idx]._sprites = nullptr; - } else if (combatImgs3[idx]._sprites) { - combatImgs2[idx]._sprites = combatImgs3[idx]._sprites; - combatImgs3[idx]._sprites = nullptr; - } else if (combatImgs4[idx]._sprites) { - combatImgs3[idx]._sprites = combatImgs4[idx]._sprites; - combatImgs4[idx]._sprites = nullptr; + // Monsters doing ranged attacks. Sequentially move the attack from + // whichever row it started in to the front (where the party is) + for (int idx = 0; idx < MAX_PARTY_COUNT; ++idx) { + if (rangedImgs1[idx]._sprites) { + rangedImgs1[idx]._sprites = nullptr; + combat._shootingRow[idx] = 0; + } else if (rangedImgs2[idx]._sprites) { + rangedImgs1[idx]._sprites = rangedImgs2[idx]._sprites; + rangedImgs2[idx]._sprites = nullptr; + } else if (rangedImgs3[idx]._sprites) { + rangedImgs2[idx]._sprites = rangedImgs3[idx]._sprites; + rangedImgs3[idx]._sprites = nullptr; + } else if (rangedImgs4[idx]._sprites) { + rangedImgs3[idx]._sprites = rangedImgs4[idx]._sprites; + rangedImgs4[idx]._sprites = nullptr; } } } else if (_charsShooting) { - for (int idx = 0; idx < 8; ++idx) { - if (combatImgs4[idx]._sprites) { - combatImgs4[idx]._sprites = nullptr; - } else if (combatImgs3[idx]._sprites) { - combatImgs4[idx]._sprites = combatImgs3[idx]._sprites; - combatImgs3[idx]._sprites = nullptr; - } else if (combatImgs2[idx]._sprites) { - combatImgs3[idx]._sprites = combatImgs2[idx]._sprites; - combatImgs2[idx]._sprites = nullptr; - } else if (combatImgs1[idx]._sprites) { - combatImgs2[idx]._sprites = combatImgs1[idx]._sprites; - combatImgs1[idx]._sprites = nullptr; + // Characters shooting at monsters. Sequentially move the attack + // away from the party + for (int idx = 0; idx < MAX_PARTY_COUNT; ++idx) { + if (rangedImgs4[idx]._sprites) { + rangedImgs4[idx]._sprites = nullptr; + } else if (rangedImgs3[idx]._sprites) { + rangedImgs4[idx]._sprites = rangedImgs3[idx]._sprites; + rangedImgs3[idx]._sprites = nullptr; + } else if (rangedImgs2[idx]._sprites) { + rangedImgs3[idx]._sprites = rangedImgs2[idx]._sprites; + rangedImgs2[idx]._sprites = nullptr; + } else if (rangedImgs1[idx]._sprites) { + rangedImgs2[idx]._sprites = rangedImgs1[idx]._sprites; + rangedImgs1[idx]._sprites = nullptr; } } } @@ -4376,7 +4380,7 @@ void InterfaceScene::drawIndoors() { // Check for any character shooting _isAttacking = false; for (uint idx = 0; idx < _vm->_party->_activeParty.size(); ++idx) { - if (_vm->_combat->_shooting[idx]) + if (_vm->_combat->_shootingRow[idx]) _isAttacking = true; } @@ -4457,7 +4461,7 @@ void InterfaceScene::drawOutdoors() { // Check for any character shooting _isAttacking = false; for (uint idx = 0; idx < _vm->_party->_activeParty.size(); ++idx) { - if (_vm->_combat->_shooting[idx]) + if (_vm->_combat->_shootingRow[idx]) _isAttacking = true; } |