diff options
author | Paul Gilbert | 2015-01-03 19:08:30 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-01-03 19:08:30 -0500 |
commit | f9316bf14107c3ac46bd8bb53da9665c3652c381 (patch) | |
tree | eae46a4026a85457428873933adf57b5371ee4d7 /engines/xeen/party.cpp | |
parent | 97cd5a7e6961be52d545e3c131a85cd90c582441 (diff) | |
download | scummvm-rg350-f9316bf14107c3ac46bd8bb53da9665c3652c381.tar.gz scummvm-rg350-f9316bf14107c3ac46bd8bb53da9665c3652c381.tar.bz2 scummvm-rg350-f9316bf14107c3ac46bd8bb53da9665c3652c381.zip |
XEEN: Implemented charIconsPrint
Diffstat (limited to 'engines/xeen/party.cpp')
-rw-r--r-- | engines/xeen/party.cpp | 75 |
1 files changed, 34 insertions, 41 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 97b4a768cd..25366d52ed 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -40,46 +40,6 @@ void AttributePair::synchronize(Common::Serializer &s) { /*------------------------------------------------------------------------*/ -Conditions::Conditions() { - _cursed = 0; - _heartBroken = 0; - _weak = 0; - _poisoned = 0; - _diseased = 0; - _insane = 0; - _inLove = 0; - _drunk = 0; - _asleep = 0; - _depressed = 0; - _confused = 0; - _paralyzed = 0; - _unconscious = 0; - _dead = 0; - _stoned = 0; - _eradicated = 0; -} - -void Conditions::synchronize(Common::Serializer &s) { - s.syncAsByte(_cursed); - s.syncAsByte(_heartBroken); - s.syncAsByte(_weak); - s.syncAsByte(_poisoned); - s.syncAsByte(_diseased); - s.syncAsByte(_insane); - s.syncAsByte(_inLove); - s.syncAsByte(_drunk); - s.syncAsByte(_asleep); - s.syncAsByte(_depressed); - s.syncAsByte(_confused); - s.syncAsByte(_paralyzed); - s.syncAsByte(_unconscious); - s.syncAsByte(_dead); - s.syncAsByte(_stoned); - s.syncAsByte(_eradicated); -} - -/*------------------------------------------------------------------------*/ - PlayerStruct::PlayerStruct() { _sex = MALE; _race = HUMAN; @@ -96,6 +56,7 @@ PlayerStruct::PlayerStruct() { _currentSpell = 0; _quickOption = 0; _lloydSide = 0; + Common::fill(&_conditions[0], &_conditions[16], 0); _townUnknown = 0; _unknown2 = 0; _currentHp = 0; @@ -161,7 +122,8 @@ void PlayerStruct::synchronize(Common::Serializer &s) { _energyResistence.synchronize(s); _magicResistence.synchronize(s); - _conditions.synchronize(s); + for (int i = 0; i < 16; ++i) + s.syncAsByte(_conditions[i]); s.syncAsUint16LE(_townUnknown); s.syncAsByte(_unknown2); @@ -173,6 +135,26 @@ void PlayerStruct::synchronize(Common::Serializer &s) { s.syncAsByte(_currentCombatSpell); } +Condition PlayerStruct::findCondition() const { + for (int cond = ERADICATED; cond >= CURSED; --cond) { + if (_conditions[cond]) + return (Condition)cond; + } + + return NO_CONDITION; +} + +int PlayerStruct::getYear(int partyYear, bool ignoreTemp) { + int year = MIN(partyYear - _ybDay, 254); + + return ignoreTemp ? year : year + _tempAge; +} + +int PlayerStruct::getMaxHp() { + warning("TODO: getMaxHp"); + return 20; +} + /*------------------------------------------------------------------------*/ void Roster::synchronize(Common::Serializer &s) { @@ -232,6 +214,8 @@ Party::Party() { for (int i = 0; i < TOTAL_CHARACTERS; ++i) Common::fill(&_characterFlags[i][0], &_characterFlags[i][24], false); + + _combatPartyCount = 0; } void Party::synchronize(Common::Serializer &s) { @@ -342,4 +326,13 @@ bool Party::checkSkill(Skill skillId) { } } +bool Party::isInParty(int charId) { + for (int i = 0; i < 8; ++i) { + if (_partyMembers[i] == charId) + return true; + } + + return false; +} + } // End of namespace Xeen |