Skip to content

Commit

Permalink
MORTEVIELLE: Renaming fields and functions related to the number of a…
Browse files Browse the repository at this point in the history
…nswers per character
  • Loading branch information
Strangerke committed Jul 23, 2013
1 parent 392ab0e commit b1389f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions engines/mortevielle/actions.cpp
Expand Up @@ -1484,10 +1484,10 @@ void MortevielleEngine::fctDiscuss() {
displId = 138;
_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
}
} else if (_nbrep[_caff - 69] < _nbrepm[_caff - 69]) {
} else if (_charAnswerCount[_caff - 69] < _charAnswerMax[_caff - 69]) {
displId = _tabdon[kArep + (ix << 3) + (_caff - 70)];
_coreVar._faithScore += _tabdon[kArcf + ix];
++_nbrep[_caff - 69];
++_charAnswerCount[_caff - 69];
} else {
_coreVar._faithScore += 3;
displId = 139;
Expand Down
4 changes: 2 additions & 2 deletions engines/mortevielle/debugger.cpp
Expand Up @@ -39,8 +39,8 @@ bool Debugger::Cmd_showAllQuestions(int argc, const char **argv) {
_vm->_coreVar._availableQuestion[i] = '*';

for (int i = 0; i < 9; i++) {
_vm->_nbrep[i] = 0;
_vm->_nbrepm[i] = 999;
_vm->_charAnswerCount[i] = 0;
_vm->_charAnswerMax[i] = 999;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion engines/mortevielle/mortevielle.cpp
Expand Up @@ -206,7 +206,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
loadCFIEC();
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
_x26KeyCount = 1;
init_nbrepm();
initMaxAnswer();
initMouse();

loadPlaces();
Expand Down
6 changes: 3 additions & 3 deletions engines/mortevielle/mortevielle.h
Expand Up @@ -443,7 +443,7 @@ class MortevielleEngine : public Engine {
void premtet();
void ajchai();
void ecr2(Common::String text);
void init_nbrepm();
void initMaxAnswer();
void aniof(int ouf, int num);
void tlu(int af, int ob);
void mennor();
Expand All @@ -456,6 +456,8 @@ class MortevielleEngine : public Engine {
int _currMenu;
int _currAction;
int _drawingSizeArr[108];
int _charAnswerCount[9];
int _charAnswerMax[9];
byte _tabdon[4001];
bool _soundOff;
bool _blo;
Expand All @@ -469,8 +471,6 @@ class MortevielleEngine : public Engine {
int _key;
SaveStruct _coreVar, _saveStruct;

int _nbrep[9];
int _nbrepm[9];
int _maff;
int _caff;
int _crep;
Expand Down
20 changes: 12 additions & 8 deletions engines/mortevielle/utils.cpp
Expand Up @@ -1983,9 +1983,9 @@ void MortevielleEngine::resetVariables() {
_coreVar._availableQuestion[33] = '*';

for (int i = 1; i <= 8; ++i)
_nbrep[i] = 0;
_charAnswerCount[i] = 0;

init_nbrepm();
initMaxAnswer();
}

/**
Expand Down Expand Up @@ -2301,9 +2301,9 @@ void MortevielleEngine::prepareRoom() {
if (day != _day) {
_day = day;
for (int i = 0; i < 9; i++) {
if (_nbrepm[i] > 0)
--_nbrepm[i];
_nbrep[i] = 0;
if (_charAnswerMax[i] > 0)
--_charAnswerMax[i];
_charAnswerCount[i] = 0;
}
}
if ((hour > _hour) || ((hour == 0) && (_hour == 23))) {
Expand Down Expand Up @@ -2879,11 +2879,15 @@ void MortevielleEngine::setPresenceFlags(int roomId) {
_room9PresenceLeo = true;
}

void MortevielleEngine::init_nbrepm() {
static const byte ipm[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };
/**
* Initialize max answers per character
* @remarks Originally called 'init_nbrepm'
*/
void MortevielleEngine::initMaxAnswer() {
static const byte maxAnswer[9] = { 0, 4, 5, 6, 7, 5, 6, 5, 8 };

for (int idx = 0; idx < 9; ++idx)
_nbrepm[idx] = ipm[idx];
_charAnswerMax[idx] = maxAnswer[idx];
}

void MortevielleEngine::phaz(int &rand, int &p, int cf) {
Expand Down

0 comments on commit b1389f8

Please sign in to comment.