aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/party.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-06 21:42:41 -0500
committerPaul Gilbert2018-02-06 21:42:41 -0500
commit255aa972c64c4cd0d7ce03bccd2394138d285563 (patch)
treea04c1622dcc453ebdaae5cd573749d3de9299b1a /engines/xeen/party.cpp
parenteb50364c2d7c0e70be0bf9454b0c24a494db8433 (diff)
downloadscummvm-rg350-255aa972c64c4cd0d7ce03bccd2394138d285563.tar.gz
scummvm-rg350-255aa972c64c4cd0d7ce03bccd2394138d285563.tar.bz2
scummvm-rg350-255aa972c64c4cd0d7ce03bccd2394138d285563.zip
XEEN: Implement final score calculation
Diffstat (limited to 'engines/xeen/party.cpp')
-rw-r--r--engines/xeen/party.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 15e7a21b01..849abfb850 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -1637,4 +1637,19 @@ void Party::giveBankInterest() {
_bankGems += _bankGems / 100;
}
+uint Party::getScore() {
+ uint score = 0;
+ for (uint idx = 0; idx < _activeParty.size(); ++idx)
+ score += _activeParty[idx].getCurrentExperience();
+ score = score / _activeParty.size() / 10000;
+ score *= 100000;
+
+ uint time = _vm->_events->playTime() / GAME_FRAME_RATE;
+ int minutes = (time % 3600) / 60;
+ int hours = time / 3600;
+
+ score += minutes + (hours * 100);
+ return score;
+}
+
} // End of namespace Xeen