diff options
author | Paul Gilbert | 2018-01-20 20:54:36 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-01-20 20:54:36 -0500 |
commit | ccfbc8f30530482a5afa603555f66b447ca3957b (patch) | |
tree | bc5db9116a136828563444d44837fea06600092b /engines | |
parent | dfa76112b75dc62481cd7bfab43af3c0b317eee3 (diff) | |
download | scummvm-rg350-ccfbc8f30530482a5afa603555f66b447ca3957b.tar.gz scummvm-rg350-ccfbc8f30530482a5afa603555f66b447ca3957b.tar.bz2 scummvm-rg350-ccfbc8f30530482a5afa603555f66b447ca3957b.zip |
XEEN: Cleanup of animate3d method's ranged attack code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/debugger.cpp | 8 | ||||
-rw-r--r-- | engines/xeen/interface_scene.cpp | 58 |
2 files changed, 36 insertions, 30 deletions
diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp index 4efd18137a..42f61b02b5 100644 --- a/engines/xeen/debugger.cpp +++ b/engines/xeen/debugger.cpp @@ -96,11 +96,13 @@ bool Debugger::cmdSpells(int argc, const char **argv) { for (uint charIdx = 0; charIdx < party._activeParty.size(); ++charIdx) { Character &c = party._activeParty[charIdx]; Common::fill(c._spells, c._spells + MAX_SPELLS_PER_CLASS, true); - c._currentSp = 500; + c._currentSp = 9999; } - party._gems += 500; - return false; + party._gems += 1000; + + debugPrintf("Spells given to party.\n"); + return true; } bool Debugger::cmdDump(int argc, const char **argv) { diff --git a/engines/xeen/interface_scene.cpp b/engines/xeen/interface_scene.cpp index ed8ab766c2..a1075faf21 100644 --- a/engines/xeen/interface_scene.cpp +++ b/engines/xeen/interface_scene.cpp @@ -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) { + // 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 (combatImgs1[idx]._sprites) { - combatImgs1[idx]._sprites = nullptr; - combat._shootingRow[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; + 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) { + // Characters shooting at monsters. Sequentially move the attack + // away from the party for (int idx = 0; idx < MAX_PARTY_COUNT; ++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; + 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; } } } |