diff options
author | Paul Gilbert | 2015-02-07 21:17:31 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-07 21:17:31 -0500 |
commit | d6e760552e785e466b5d2088570baa182d42ccd0 (patch) | |
tree | b4abd925ab7bee2a1989da75a9d5c8fe32c02342 /engines/xeen/party.cpp | |
parent | 65ecc9b72138f2dcef0ccf3765363559649b77a2 (diff) | |
download | scummvm-rg350-d6e760552e785e466b5d2088570baa182d42ccd0.tar.gz scummvm-rg350-d6e760552e785e466b5d2088570baa182d42ccd0.tar.bz2 scummvm-rg350-d6e760552e785e466b5d2088570baa182d42ccd0.zip |
XEEN: Implemented resting
Diffstat (limited to 'engines/xeen/party.cpp')
-rw-r--r-- | engines/xeen/party.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index be8f4e6e18..ff59ed9b18 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -102,6 +102,7 @@ Party::Party(XeenEngine *vm) { _falling = false; _fallMaze = 0; _fallDamage = 0; + _dead = false; } void Party::synchronize(Common::Serializer &s) { @@ -360,7 +361,7 @@ void Party::addTime(int numMinutes) { if (_newDay && _minutes >= 300) { if (_vm->_mode != MODE_9 && _vm->_mode != MODE_17) { resetTemps(); - if (_rested || _vm->_mode == MODE_5) { + if (_rested || _vm->_mode == MODE_SLEEPING) { _rested = false; } else { for (int idx = 0; idx < _partyCount; ++idx) { @@ -497,4 +498,19 @@ void Party::notEnough(int consumableId, int whereId, bool mode, ErrorWaitType wa ErrorScroll::show(_vm, msg, wait); } +void Party::checkPartyDead() { + bool inCombat = _vm->_mode == MODE_COMBAT; + + for (uint charIdx = 0; charIdx < (inCombat ? _combatParty.size() : _activeParty.size()); ++charIdx) { + Character &c = inCombat ? *_combatParty[charIdx] : _activeParty[charIdx]; + Condition cond = c.worstCondition(); + if (cond <= CONFUSED || cond == NO_CONDITION) { + _dead = false; + return; + } + } + + _dead = true; +} + } // End of namespace Xeen |