Skip to content

Commit

Permalink
ACCESS: Implement calcIQ
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent 2ea4601 commit 79fa346
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
31 changes: 28 additions & 3 deletions engines/access/amazon/amazon_game.cpp
Expand Up @@ -624,8 +624,33 @@ void AmazonEngine::updateSummary(int chap) {
}
}

void AmazonEngine::CALCIQ() {
warning("TODO: CALCIQ");
void AmazonEngine::calcIQ() {
int tmpIQ = 170;
for (int i = 0; i < 256; i++) {
if (_help1[i] == 1)
tmpIQ -= 3;
}

for (int i = 0; i < 256; i++) {
if (_help2[i] == 1)
tmpIQ -= 5;
}

for (int i = 0; i < 256; i++) {
if (_help3[i] == 1)
tmpIQ -= 10;
}

if (tmpIQ < 0)
tmpIQ = 0;

_iqValue = tmpIQ;

if (_iqValue <= 100)
_badEnd = 1;

if (_iqValue <= 0)
_noHints = 1;
}

void AmazonEngine::helpTitle() {
Expand All @@ -646,7 +671,7 @@ void AmazonEngine::helpTitle() {
_fonts._font2.drawString(_screen, HELPLVLTXT[_helpLevel], Common::Point(posX, 36));

Common::String iqText = "IQ: ";
CALCIQ();
calcIQ();
Common::String IQSCORE = Common::String::format("d", _iqValue);
while (IQSCORE.size() != 4)
IQSCORE = " " + IQSCORE;
Expand Down
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_game.h
Expand Up @@ -83,7 +83,7 @@ class AmazonEngine : public AccessEngine {
*/
void setupGame();

void CALCIQ();
void calcIQ();
void helpTitle();
void drawHelpText(const Common::String &msg);
void doCredit();
Expand Down

0 comments on commit 79fa346

Please sign in to comment.