diff options
author | Paul Gilbert | 2018-02-24 14:12:16 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-02-24 14:12:16 -0500 |
commit | ad7206ea38c491ec7cca82d705a37bc19ad3aed0 (patch) | |
tree | 1d1580ccd26a52d60f95e61dcd0abe859b8601f8 /engines/xeen | |
parent | 36d474db1fb27743beb3a0feb7eaf0e330be5ddc (diff) | |
download | scummvm-rg350-ad7206ea38c491ec7cca82d705a37bc19ad3aed0.tar.gz scummvm-rg350-ad7206ea38c491ec7cca82d705a37bc19ad3aed0.tar.bz2 scummvm-rg350-ad7206ea38c491ec7cca82d705a37bc19ad3aed0.zip |
XEEN: Don't show blood spatter for hits beyond the first row
Diffstat (limited to 'engines/xeen')
-rw-r--r-- | engines/xeen/combat.cpp | 92 |
1 files changed, 54 insertions, 38 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index bed9b26f60..ddda2402da 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -1856,7 +1856,7 @@ void Combat::rangedAttack(PowType powNum) { intf._charsShooting = true; _powSprites.load(Common::String::format("pow%d.icn", (int)powNum)); - int monsterIndex = _attackDurationCtr; + int attackDurationCtr = _attackDurationCtr; int monster2Attack = _monster2Attack; bool attackedFlag = false; @@ -1900,16 +1900,20 @@ void Combat::rangedAttack(PowType powNum) { intf.draw3d(true); - ++_attackDurationCtr; - for (uint monIdx = 0; monIdx < attackMonsters.size(); ++monIdx, ++_attackDurationCtr) { - Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); - _monster2Attack = attackMonsters[monIdx]; - attack(*_oldCharacter, RT_GROUP); - attackedFlag = true; + // Iterate through the three possible monster positions in the first row + for (uint monIdx = 0; monIdx < 3; ++monIdx) { + ++_attackDurationCtr; - if (_rangeType == RT_SINGLE) - // Only single shot, so exit now that the attack is done - goto finished; + if (monIdx < attackMonsters.size()) { + Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); + _monster2Attack = attackMonsters[monIdx]; + attack(*_oldCharacter, RT_GROUP); + attackedFlag = true; + + if (_rangeType == RT_SINGLE) + // Only single shot, so exit now that the attack is done + goto finished; + } } if (attackedFlag && _rangeType == RT_GROUP) @@ -1950,16 +1954,20 @@ void Combat::rangedAttack(PowType powNum) { attackMonsters.push_back(_attackMonsters[idx]); } - ++_attackDurationCtr; - for (uint monIdx = 0; monIdx < attackMonsters.size(); ++monIdx, ++_attackDurationCtr) { - Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); - _monster2Attack = attackMonsters[monIdx]; - attack(*_oldCharacter, RT_GROUP); - attackedFlag = true; + // Iterate through the three possible monster positions in the second row + for (uint monIdx = 0; monIdx < 3; ++monIdx) { + ++_attackDurationCtr; - if (_rangeType == RT_SINGLE) - // Only single shot, so exit now that the attack is done - goto finished; + if (monIdx < attackMonsters.size()) { + Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); + _monster2Attack = attackMonsters[monIdx]; + attack(*_oldCharacter, RT_GROUP); + attackedFlag = true; + + if (_rangeType == RT_SINGLE) + // Only single shot, so exit now that the attack is done + goto finished; + } } if (attackedFlag && _rangeType == RT_GROUP) @@ -2000,16 +2008,20 @@ void Combat::rangedAttack(PowType powNum) { attackMonsters.push_back(_attackMonsters[idx]); } - ++_attackDurationCtr; - for (uint monIdx = 0; monIdx < attackMonsters.size(); ++monIdx, ++_attackDurationCtr) { - Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); - _monster2Attack = attackMonsters[monIdx]; - attack(*_oldCharacter, RT_GROUP); - attackedFlag = true; + // Iterate through the three possible monster positions in the third row + for (uint monIdx = 0; monIdx < 3; ++monIdx) { + ++_attackDurationCtr; - if (_rangeType == RT_SINGLE) - // Only single shot, so exit now that the attack is done - goto finished; + if (monIdx < attackMonsters.size()) { + Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); + _monster2Attack = attackMonsters[monIdx]; + attack(*_oldCharacter, RT_GROUP); + attackedFlag = true; + + if (_rangeType == RT_SINGLE) + // Only single shot, so exit now that the attack is done + goto finished; + } } if (attackedFlag && _rangeType == RT_GROUP) @@ -2050,16 +2062,20 @@ void Combat::rangedAttack(PowType powNum) { attackMonsters.push_back(_attackMonsters[idx]); } - ++_attackDurationCtr; - for (uint monIdx = 0; monIdx < attackMonsters.size(); ++monIdx, ++_attackDurationCtr) { - Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); - _monster2Attack = attackMonsters[monIdx]; - attack(*_oldCharacter, RT_GROUP); - attackedFlag = true; + // Iterate through the three possible monster positions in the fourth row + for (uint monIdx = 0; monIdx < 3; ++monIdx) { + ++_attackDurationCtr; - if (_rangeType == RT_SINGLE) - // Only single shot, so exit now that the attack is done - goto finished; + if (monIdx < attackMonsters.size()) { + Common::fill(&_missedShot[0], &_missedShot[MAX_PARTY_COUNT], false); + _monster2Attack = attackMonsters[monIdx]; + attack(*_oldCharacter, RT_GROUP); + attackedFlag = true; + + if (_rangeType == RT_SINGLE) + // Only single shot, so exit now that the attack is done + goto finished; + } } if (!(attackedFlag && _rangeType == RT_GROUP)) @@ -2071,7 +2087,7 @@ finished: done: clearShooting(); _monster2Attack = monster2Attack; - _attackDurationCtr = monsterIndex; + _attackDurationCtr = attackDurationCtr; party.giveTreasure(); } |