diff options
author | Strangerke | 2012-03-03 00:23:27 +0100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:22:26 +0200 |
commit | b2b16cefce08dbdad76b9057ff97d08c7e14c56e (patch) | |
tree | 6e449e0a4dd034ffafc1af5bbddad8e31d20930f /engines/mortevielle/actions.cpp | |
parent | 7764caaadee89b9eb1922acc93abf157ce84e4f7 (diff) | |
download | scummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.tar.gz scummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.tar.bz2 scummvm-rg350-b2b16cefce08dbdad76b9057ff97d08c7e14c56e.zip |
MORTEVIELLE: rename more globals and constants, remove t_nhom usage
Diffstat (limited to 'engines/mortevielle/actions.cpp')
-rw-r--r-- | engines/mortevielle/actions.cpp | 524 |
1 files changed, 264 insertions, 260 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index d115ef3976..8441315bd7 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -49,13 +49,13 @@ namespace Mortevielle { void fctMove() { int cx; - if ((g_s.mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { - g_s.mlieu = 15; - g_caff = g_s.mlieu; + if ((g_s._mlieu == 26) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { + g_s._mlieu = 15; + g_caff = g_s._mlieu; afdes(0); - repon(2, g_s.mlieu); + repon(2, g_s._mlieu); } - if ((g_s.mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { + if ((g_s._mlieu == 15) && (g_msg[4] == g_vm->_menu._moveMenu[6])) { if (!g_syn) ecr3(g_vm->getEngineString(S_GO_TO)); tfleche(); @@ -67,13 +67,13 @@ void fctMove() { if (g_num == 0) return; if (g_num == 1) { - g_s.mlieu = 0; + g_s._mlieu = 0; tmlieu(0); } else if (g_num == 7) { - g_s.mlieu = 13; + g_s._mlieu = 13; tmlieu(13); } else if (g_num != 6) - g_s.mlieu = 26; + g_s._mlieu = 26; if ((g_num > 1) && (g_num < 6)) g_ment = g_num - 1; if (g_num > 7) @@ -89,55 +89,60 @@ void fctMove() { do { ++cx; } while (g_vm->_menu._moveMenu[cx] != g_msg[4]); - if (g_s.mlieu == 19) { + + if (g_s._mlieu == 19) { if (cx == 1) t1deva(); if (cx == 2) t1neig(); goto L2; } - if (g_s.mlieu == 23) { + + if (g_s._mlieu == 23) { if (cx == 1) t1deau(); if (cx == 2) t1derr(); goto L2; } - if ((g_s.mlieu == 11) && (cx == 1)) + + if ((g_s._mlieu == 11) && (cx == 1)) cx = 6; - if (g_s.mlieu == 12) { + + if (g_s._mlieu == 12) { if (cx == 2) cx = 6; if (cx == 5) cx = 16; } - if ((g_s.mlieu == 14) && (cx == 3)) + + if ((g_s._mlieu == 14) && (cx == 3)) cx = 6; - if (((g_s.mlieu == 15) || (g_s.mlieu == 26)) && (cx == 4)) + if (((g_s._mlieu == 15) || (g_s._mlieu == 26)) && (cx == 4)) cx = 6; - if ((g_s.mlieu > 19) && (g_s.mlieu != 26)) + if ((g_s._mlieu > 19) && (g_s._mlieu != 26)) cx += 10; - if ((g_s.mlieu == 20) && (cx == 13)) + if ((g_s._mlieu == 20) && (cx == 13)) cx = 16; - if (g_s.mlieu == 21) { + if (g_s._mlieu == 21) { if (cx == 12) cx = 16; else if (cx > 13) cx = 15; } - if ((g_s.mlieu == 22) && (cx > 14)) + if ((g_s._mlieu == 22) && (cx > 14)) cx = 15; - if ((g_s.mlieu == 24) && (cx != 17)) + if ((g_s._mlieu == 24) && (cx != 17)) if (cx > 13) cx = 15; if (cx == 1) - g_s.mlieu = 11; + g_s._mlieu = 11; else if (cx == 2) - g_s.mlieu = 12; + g_s._mlieu = 12; else if (cx == 3) - g_s.mlieu = 14; + g_s._mlieu = 14; else if (cx == 4) - g_s.mlieu = 15; + g_s._mlieu = 15; else if (cx == 5) cx = 12; if (cx == 6) @@ -147,31 +152,31 @@ void fctMove() { else if (cx == 12) t1deva(); else if (cx == 13) - g_s.mlieu = 20; + g_s._mlieu = 20; else if (cx == 14) - g_s.mlieu = 24; + g_s._mlieu = 24; else if (cx == 15) t1neig(); else if (cx == 16) t1derr(); else if (cx == 17) { - if ((g_s.ipuit != 120) && (g_s.ipuit != 140)) + if ((g_s._ipuit != 120) && (g_s._ipuit != 140)) g_crep = 997; - else if (g_s.ipuit == 120) + else if (g_s._ipuit == 120) g_crep = 181; - else if (g_s.conf > 80) { + else if (g_s._conf > 80) { g_crep = 1505; tperd(); } else { - g_s.mlieu = 23; + g_s._mlieu = 23; affrep(); } } if ((cx < 5) || (cx == 13) || (cx == 14)) affrep(); - debloc(g_s.mlieu); + debloc(g_s._mlieu); L2: - tmlieu(g_s.mlieu); + tmlieu(g_s._mlieu); } /** @@ -184,33 +189,33 @@ void fctTake() { avpoing(cx); if (g_crep != 139) { if (g_ipers > 0) - g_s.conf += 3; + g_s._conf += 3; if (g_obpart) { - if (g_s.mlieu == 2) - g_s.iloic = 0; - if (g_s.mlieu == 13) { - if (g_s.iboul == g_caff) - g_s.iboul = 0; - if (g_s.ibag == g_caff) - g_s.ibag = 0; + if (g_s._mlieu == 2) + g_s._iloic = 0; + if (g_s._mlieu == 13) { + if (g_s._iboul == g_caff) + g_s._iboul = 0; + if (g_s._ibag == g_caff) + g_s._ibag = 0; } - if (g_s.mlieu == 14) - g_s.icave = 0; - if (g_s.mlieu == 16) - g_s.icryp = 0; - if (g_s.mlieu == 17) - g_s.ivier = 0; - if (g_s.mlieu == 24) - g_s.ipuit = 0; + if (g_s._mlieu == 14) + g_s._icave = 0; + if (g_s._mlieu == 16) + g_s._icryp = 0; + if (g_s._mlieu == 17) + g_s._ivier = 0; + if (g_s._mlieu == 24) + g_s._ipuit = 0; mfouen(); g_obpart = false; affrep(); } else { - tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0; + g_tabdon[acha + ((g_mchai - 1) * 10) + g_cs - 1] = 0; tsuiv(); ++g_dobj; if (g_dobj > 6) { - g_s.conf += 2; + g_s._conf += 2; g_dobj = 0; } } @@ -230,40 +235,40 @@ void fctTake() { } } tcoord(5); - if ((g_num == 0) || ((g_num == 1) && (g_s.mlieu == 16))) { + if ((g_num == 0) || ((g_num == 1) && (g_s._mlieu == 16))) { tcoord(8); if (g_num != 0) { if (g_ipers > 0) - g_s.conf += 3; + g_s._conf += 3; g_crep = 997; - if ((g_s.mlieu == 2) && (g_s.iloic != 0)) - avpoing(g_s.iloic); - if ((g_s.mlieu == 13) && (g_num == 1) && (g_s.iboul != 0)) { - avpoing(g_s.iboul); + if ((g_s._mlieu == 2) && (g_s._iloic != 0)) + avpoing(g_s._iloic); + if ((g_s._mlieu == 13) && (g_num == 1) && (g_s._iboul != 0)) { + avpoing(g_s._iboul); if ((g_crep != 997) && (g_crep != 139)) aniof(2, 7); } - if ((g_s.mlieu == 13) && (g_num == 2) && (g_s.ibag != 0)) { - avpoing(g_s.ibag); + if ((g_s._mlieu == 13) && (g_num == 2) && (g_s._ibag != 0)) { + avpoing(g_s._ibag); if ((g_crep != 997) && (g_crep != 139)) aniof(2, 6); } - if ((g_s.mlieu == 14) && (g_s.icave != 0)) { - avpoing(g_s.icave); + if ((g_s._mlieu == 14) && (g_s._icave != 0)) { + avpoing(g_s._icave); if ((g_crep != 997) && (g_crep != 139)) aniof(2, 2); } - if ((g_s.mlieu == 16) && (g_s.icryp != 0)) - avpoing(g_s.icryp); - if ((g_s.mlieu == 17) && (g_s.ivier != 0)) { - avpoing(g_s.ivier); + if ((g_s._mlieu == 16) && (g_s._icryp != 0)) + avpoing(g_s._icryp); + if ((g_s._mlieu == 17) && (g_s._ivier != 0)) { + avpoing(g_s._ivier); if ((g_crep != 997) && (g_crep != 139)) { g_crep = 182; aniof(2, 1); } } - if ((g_s.mlieu == 24) && (g_s.ipuit != 0)) { - avpoing(g_s.ipuit); + if ((g_s._mlieu == 24) && (g_s._ipuit != 0)) { + avpoing(g_s._ipuit); if ((g_crep != 997) && (g_crep != 139)) aniof(2, 1); } @@ -271,15 +276,15 @@ void fctTake() { g_crep = 999; } } else { - if ( ((g_s.mlieu == 0) && (g_num == 3)) || ((g_s.mlieu == 1) && (g_num == 4)) - || ((g_s.mlieu == 2) && (g_num == 1)) || ((g_s.mlieu == 4) && (g_num == 3)) - || ((g_s.mlieu == 5) && (g_num == 6)) || ((g_s.mlieu == 6) && (g_num == 2)) - || ((g_s.mlieu == 7) && (g_num == 6)) || ((g_s.mlieu == 8) && (g_num == 4)) - || ((g_s.mlieu == 9) && (g_num == 4)) || ((g_s.mlieu == 10) && (g_num > 2)) - || ((g_s.mlieu == 11) && (g_num == 7)) || ((g_s.mlieu == 12) && (g_num == 6)) - || ((g_s.mlieu == 13) && (g_num > 4)) || ((g_s.mlieu > 13) && (g_s.mlieu != 23)) ) + if ( ((g_s._mlieu == 0) && (g_num == 3)) || ((g_s._mlieu == 1) && (g_num == 4)) + || ((g_s._mlieu == 2) && (g_num == 1)) || ((g_s._mlieu == 4) && (g_num == 3)) + || ((g_s._mlieu == 5) && (g_num == 6)) || ((g_s._mlieu == 6) && (g_num == 2)) + || ((g_s._mlieu == 7) && (g_num == 6)) || ((g_s._mlieu == 8) && (g_num == 4)) + || ((g_s._mlieu == 9) && (g_num == 4)) || ((g_s._mlieu == 10) && (g_num > 2)) + || ((g_s._mlieu == 11) && (g_num == 7)) || ((g_s._mlieu == 12) && (g_num == 6)) + || ((g_s._mlieu == 13) && (g_num > 4)) || ((g_s._mlieu > 13) && (g_s._mlieu != 23)) ) g_crep = 997; - else if (g_s.mlieu == 23) { + else if (g_s._mlieu == 23) { g_crep = 1504; tperd(); } else @@ -301,11 +306,11 @@ void fctInventoryTake() { cy = 0; do { ++cy; - if (ord(g_s.sjer[cy]) != 0) + if (ord(g_s._sjer[cy]) != 0) ++cz; } while (cz != cx); - cz = ord(g_s.sjer[cy]); - g_s.sjer[cy] = chr(0); + cz = ord(g_s._sjer[cy]); + g_s._sjer[cy] = chr(0); modinv(); avpoing(cz); g_crep = 998; @@ -329,21 +334,21 @@ void fctLift() { tcoord(8); if (g_num != 0) { if (g_ipers > 0) - ++g_s.conf; + ++g_s._conf; g_crep = 997; - if ((g_s.mlieu == 2) && (g_s.iloic != 0)) - treg(g_s.iloic); + if ((g_s._mlieu == 2) && (g_s._iloic != 0)) + treg(g_s._iloic); } return; } if (g_ipers > 0) - ++g_s.conf; - cx = g_s.mlieu; - if (g_s.mlieu == 16) + ++g_s._conf; + cx = g_s._mlieu; + if (g_s._mlieu == 16) cx = 14; - else if (g_s.mlieu == 19) + else if (g_s._mlieu == 19) cx = 15; - g_crep = tabdon[asoul + (cx << 3) + (g_num - 1)]; + g_crep = g_tabdon[asoul + (cx << 3) + (g_num - 1)]; if (g_crep == 255) g_crep = 997; } @@ -372,10 +377,10 @@ void fctRead() { * @remarks Originally called 'tslire' */ void fctSelfRead() { - if (g_s.derobj == 0) + if (g_s._derobj == 0) g_crep = 186; else - st4(g_s.derobj); + st4(g_s._derobj); } /** @@ -399,60 +404,60 @@ void fctLook() { tcoord(8); g_crep = 131; if (g_num != 0) { - if (g_s.mlieu == 13) { + if (g_s._mlieu == 13) { if (g_num == 1) { g_crep = 164; - if (g_s.ibag != 0) - treg(g_s.ibag); - else if (g_s.iboul != 0) - treg(g_s.iboul); + if (g_s._ibag != 0) + treg(g_s._ibag); + else if (g_s._iboul != 0) + treg(g_s._iboul); } else { g_crep = 193; - if (g_s.ibag != 0) - treg(g_s.ibag); + if (g_s._ibag != 0) + treg(g_s._ibag); } } - if (g_s.mlieu == 14) { + if (g_s._mlieu == 14) { g_crep = 164; - if (g_s.icave != 0) - treg(g_s.icave); + if (g_s._icave != 0) + treg(g_s._icave); } - if (g_s.mlieu == 17) { + if (g_s._mlieu == 17) { g_crep = 174; - if (g_s.ivier != 0) - treg(g_s.ivier); + if (g_s._ivier != 0) + treg(g_s._ivier); } - if (g_s.mlieu == 24) { + if (g_s._mlieu == 24) { g_crep = 131; - if (g_s.ipuit != 0) - treg(g_s.ipuit); + if (g_s._ipuit != 0) + treg(g_s._ipuit); } } return; } - cx = g_s.mlieu; - if (g_s.mlieu == 20) + cx = g_s._mlieu; + if (g_s._mlieu == 20) cx = 17; - if ((g_s.mlieu > 21) && (g_s.mlieu < 25)) + if ((g_s._mlieu > 21) && (g_s._mlieu < 25)) cx -= 4; - if (g_s.mlieu == 26) + if (g_s._mlieu == 26) cx = 21; - g_crep = tabdon[arega + (cx * 7) + g_num - 1]; - if ((g_s.mlieu == 13) && (g_num == 8)) + g_crep = g_tabdon[arega + (cx * 7) + g_num - 1]; + if ((g_s._mlieu == 13) && (g_num == 8)) g_crep = 126; - if (g_s.mlieu == 19) + if (g_s._mlieu == 19) g_crep = 103; if (g_crep == 255) g_crep = 131; - if ((g_s.mlieu == 1) && (g_num == 1)) + if ((g_s._mlieu == 1) && (g_num == 1)) treg(144); - if ((g_s.mlieu == 5) && (g_num == 3)) + if ((g_s._mlieu == 5) && (g_num == 3)) treg(147); - if ((g_s.mlieu == 8) && (g_num == 3)) + if ((g_s._mlieu == 8) && (g_num == 3)) treg(149); - if ((g_s.mlieu == 9) && (g_num == 2)) + if ((g_s._mlieu == 9) && (g_num == 2)) treg(30); - if ((g_s.mlieu == 10) && (g_num == 3)) + if ((g_s._mlieu == 10) && (g_num == 3)) treg(31); } @@ -461,8 +466,8 @@ void fctLook() { * @remarks Originally called 'tsregarder' */ void fctSelftLook() { - if (g_s.derobj != 0) - treg(g_s.derobj); + if (g_s._derobj != 0) + treg(g_s._derobj); else g_crep = 186; } @@ -486,7 +491,7 @@ void fctSearch() { if (g_anyone || g_iesc) return; - if (g_s.mlieu == 23) { + if (g_s._mlieu == 23) { g_crep = 1504; tperd(); return; @@ -499,17 +504,17 @@ void fctSearch() { int cx = 0; do { ++cx; - } while ((cx <= 6) && (g_num != ord(touv[cx]))); - if (g_num != ord(touv[cx])) + } while ((cx <= 6) && (g_num != ord(g_touv[cx]))); + if (g_num != ord(g_touv[cx])) g_crep = 187; else { if (g_ipers > 0) - g_s.conf += 3; + g_s._conf += 3; rechai(g_mchai); if (g_mchai != 0) { g_cs = 0; - is = 0; + g_is = 0; g_fouil = true; mfoudi(); tsuiv(); @@ -521,41 +526,41 @@ void fctSearch() { g_crep = 997; if (g_num != 0) { if (g_ipers > 0) - g_s.conf += 3; - if ((g_s.mlieu != 24) && (g_s.mlieu != 17) && (g_s.mlieu != 13)) { - if (g_s.mlieu == 2) { + g_s._conf += 3; + if ((g_s._mlieu != 24) && (g_s._mlieu != 17) && (g_s._mlieu != 13)) { + if (g_s._mlieu == 2) { g_crep = 123; - if (g_s.iloic != 0) - treg(g_s.iloic); + if (g_s._iloic != 0) + treg(g_s._iloic); } - if (g_s.mlieu == 16) { + if (g_s._mlieu == 16) { g_crep = 123; - if (g_s.icryp != 0) - treg(g_s.icryp); + if (g_s._icryp != 0) + treg(g_s._icryp); } } } } } else { if (g_ipers > 0) - g_s.conf += 3; + g_s._conf += 3; g_crep = 997; - if (g_s.mlieu < 14) - g_crep = r[g_s.mlieu]; + if (g_s._mlieu < 14) + g_crep = r[g_s._mlieu]; - if ((g_s.mlieu == 3) && (g_num == 2)) + if ((g_s._mlieu == 3) && (g_num == 2)) g_crep = 162; - if (g_s.mlieu == 12) { + if (g_s._mlieu == 12) { if ((g_num == 3) || (g_num == 4)) g_crep = 162; else if (g_num == 5) g_crep = 159; } - if (g_s.mlieu == 19) + if (g_s._mlieu == 19) g_crep = 104; - else if (g_s.mlieu == 16) + else if (g_s._mlieu == 16) g_crep = 155; } } @@ -565,8 +570,8 @@ void fctSearch() { * @remarks Originally called 'tsfouiller' */ void fctSelfSearch() { - if (g_s.derobj != 0) - st7(g_s.derobj); + if (g_s._derobj != 0) + st7(g_s._derobj); else g_crep = 186; } @@ -600,32 +605,32 @@ void fctOpen() { tcoord(7); if (g_num != 0) { if (g_ipers > 0) - g_s.conf += 2; + g_s._conf += 2; ++g_iouv; int cx = 0; do { ++cx; - } while (!((cx > 6) || (ord(touv[cx]) == 0) || (ord(touv[cx]) == g_num))); - if (ord(touv[cx]) != g_num) { - if (!( ((g_num == 3) && ((g_s.mlieu == 0) || (g_s.mlieu == 9) || (g_s.mlieu == 5) || (g_s.mlieu == 7))) - || ((g_num == 4) && ((g_s.mlieu == 1) || (g_s.mlieu == 2) || (g_s.mlieu == 6))) - || ((g_s.mlieu == 4) && (g_num == 5)) - || ((g_num == 6) && ((g_s.mlieu == 7) || (g_s.mlieu == 10) || (g_s.mlieu == 8) || (g_s.mlieu == 13))) - || ((g_s.mlieu == 8) && (g_num == 2)) - || ((g_s.mlieu == 12) && (g_num == 7))) ) { - if ( ((g_s.mlieu > 10) && (g_s.mlieu < 14)) - || ((g_s.mlieu > 6) && (g_s.mlieu < 10)) - || (g_s.mlieu == 0) || (g_s.mlieu == 2) || (g_s.mlieu == 5)) { + } while (!((cx > 6) || (ord(g_touv[cx]) == 0) || (ord(g_touv[cx]) == g_num))); + if (ord(g_touv[cx]) != g_num) { + if (!( ((g_num == 3) && ((g_s._mlieu == 0) || (g_s._mlieu == 9) || (g_s._mlieu == 5) || (g_s._mlieu == 7))) + || ((g_num == 4) && ((g_s._mlieu == 1) || (g_s._mlieu == 2) || (g_s._mlieu == 6))) + || ((g_s._mlieu == 4) && (g_num == 5)) + || ((g_num == 6) && ((g_s._mlieu == 7) || (g_s._mlieu == 10) || (g_s._mlieu == 8) || (g_s._mlieu == 13))) + || ((g_s._mlieu == 8) && (g_num == 2)) + || ((g_s._mlieu == 12) && (g_num == 7))) ) { + if ( ((g_s._mlieu > 10) && (g_s._mlieu < 14)) + || ((g_s._mlieu > 6) && (g_s._mlieu < 10)) + || (g_s._mlieu == 0) || (g_s._mlieu == 2) || (g_s._mlieu == 5)) { if (hazard(1, 4) == 3) parole(7, 9, 1); } - touv[cx] = chr(g_num); + g_touv[cx] = chr(g_num); aniof(1, g_num); } - cx = g_s.mlieu; - if (g_s.mlieu == 16) + cx = g_s._mlieu; + if (g_s._mlieu == 16) cx = 14; - g_crep = tabdon[aouvr + (cx * 7) + g_num - 1]; + g_crep = g_tabdon[aouvr + (cx * 7) + g_num - 1]; if (g_crep == 254) g_crep = 999; } else @@ -638,7 +643,7 @@ void fctOpen() { * @remarks Originally called 'tmettre' */ void fctPlace() { - if (g_s.derobj == 0) { + if (g_s._derobj == 0) { g_crep = 186; return; } @@ -658,28 +663,28 @@ void fctPlace() { g_crep = 999; if (g_caff == 13) { if (g_num == 1) { - if (g_s.iboul != 0) { + if (g_s._iboul != 0) { g_crep = 188; } else { - g_s.iboul = g_s.derobj; - if (g_s.derobj == 141) + g_s._iboul = g_s._derobj; + if (g_s._derobj == 141) aniof(1, 7); } - } else if (g_s.ibag != 0) { + } else if (g_s._ibag != 0) { g_crep = 188; } else { - g_s.ibag = g_s.derobj; - if (g_s.derobj == 159) + g_s._ibag = g_s._derobj; + if (g_s._derobj == 159) aniof(1, 6); } } if (g_caff == 14) { - if (g_s.icave != 0) { + if (g_s._icave != 0) { g_crep = 188; } else { - g_s.icave = g_s.derobj; - if (g_s.derobj == 151) { + g_s._icave = g_s._derobj; + if (g_s._derobj == 151) { // Open hidden passage aniof(1, 2); aniof(1, 1); @@ -689,7 +694,7 @@ void fctPlace() { // Do you want to enter the hidden passage? int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); - if (answer== 1) { + if (answer == 1) { Common::String alertTxt = deline(582); Alert::show(alertTxt, 1); @@ -710,10 +715,10 @@ void fctPlace() { g_vm->_menu.displayMenu(); if (enterPassageFl) { - g_s.mlieu = 17; + g_s._mlieu = 17; tmlieu(17); } else { - tmlieu(g_s.mlieu); + tmlieu(g_s._mlieu); writepal(14); dessin(0); aniof(1, 2); @@ -735,17 +740,17 @@ void fctPlace() { } if (g_caff == 16) { - if (g_s.icryp == 0) - g_s.icryp = g_s.derobj; + if (g_s._icryp == 0) + g_s._icryp = g_s._derobj; else g_crep = 188; } if (g_caff == 17) { - if (g_s.ivier != 0) { + if (g_s._ivier != 0) { g_crep = 188; - } else if (g_s.derobj == 143) { - g_s.ivier = 143; + } else if (g_s._derobj == 143) { + g_s._ivier = 143; aniof(1, 1); } else { g_crep = 1512; @@ -754,10 +759,10 @@ void fctPlace() { } if (g_caff == 24) { - if (g_s.ipuit != 0) { + if (g_s._ipuit != 0) { g_crep = 188; - } else if ((g_s.derobj == 140) || (g_s.derobj == 120)) { - g_s.ipuit = g_s.derobj; + } else if ((g_s._derobj == 140) || (g_s._derobj == 120)) { + g_s._ipuit = g_s._derobj; aniof(1, 1); } else { g_crep = 185; @@ -786,7 +791,7 @@ void fctTurn() { tcoord(9); if (g_num != 0) { g_crep = 997; - if ((g_s.mlieu == 13) && (g_s.ibag == 159) && (g_s.iboul == 141)) { + if ((g_s._mlieu == 13) && (g_s._ibag == 159) && (g_s._iboul == 141)) { repon(2, 167); parole(7, 9, 1); int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); @@ -795,13 +800,13 @@ void fctTurn() { else g_crep = 168; } - if ((g_s.mlieu == 17) && (g_s.ivier == 143)) { + if ((g_s._mlieu == 17) && (g_s._ivier == 143)) { repon(2, 175); clsf3(); parole(6, -9, 1); int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); if (answer == 1) { - g_s.mlieu = 16; + g_s._mlieu = 16; affrep(); } else g_crep = 176; @@ -833,7 +838,7 @@ void fctSelfHide() { * @remarks Originally called 'tattacher' */ void fctAttach() { - if (g_s.derobj == 0) + if (g_s._derobj == 0) g_crep = 186; else { if (!g_syn) @@ -842,10 +847,10 @@ void fctAttach() { if (!(g_anyone) && !(g_iesc)) { tcoord(8); g_crep = 997; - if ((g_num != 0) && (g_s.mlieu == 24)) { + if ((g_num != 0) && (g_s._mlieu == 24)) { g_crep = 999; - if ((g_s.derobj == 120) || (g_s.derobj == 140)) { - g_s.ipuit = g_s.derobj; + if ((g_s._derobj == 120) || (g_s._derobj == 140)) { + g_s._ipuit = g_s._derobj; aniof(1, 1); } else g_crep = 185; @@ -874,11 +879,11 @@ void fctClose() { int cx = 0; do { ++cx; - } while ((cx <= 6) && (g_num != ord(touv[cx]))); - if (g_num == ord(touv[cx])) { + } while ((cx <= 6) && (g_num != ord(g_touv[cx]))); + if (g_num == ord(g_touv[cx])) { aniof(2, g_num); g_crep = 998; - touv[cx] = chr(0); + g_touv[cx] = chr(0); --g_iouv; if (g_iouv < 0) g_iouv = 0; @@ -903,15 +908,15 @@ void fctKnock() { if (!g_syn) ecr3(g_vm->getEngineString(S_HIT)); - if (g_s.mlieu == 15) { + if (g_s._mlieu == 15) { Alert::show(g_vm->getEngineString(S_BEFORE_USE_DEP_MENU), 1); return; } - if (g_s.mlieu < 25) { + if (g_s._mlieu < 25) { tfleche(); if (!(g_anyone) && !(g_iesc)) { - if ((g_s.mlieu < 19) && (g_s.mlieu != 15)) + if ((g_s._mlieu < 19) && (g_s._mlieu != 15)) g_crep = 133; else g_crep = 997; @@ -920,11 +925,11 @@ void fctKnock() { return; } - if (g_s.mlieu == 26) { + if (g_s._mlieu == 26) { int haz = (hazard(0, 8)) - 4; parole(11, haz, 1); int p; - ecfren(p, haz, g_s.conf, g_ment); + ecfren(p, haz, g_s._conf, g_ment); int l = g_ment; if (l != 0) { if (p != -500) { @@ -950,7 +955,7 @@ void fctKnock() { void fctSelfPut() { if (!g_syn) ecr3(g_vm->getEngineString(S_POSE)); - if (g_s.derobj == 0) + if (g_s._derobj == 0) g_crep = 186; else { if (g_caff > 99) { @@ -974,8 +979,8 @@ void fctSelfPut() { int cx = 0; do { ++cx; - } while ((cx <= 6) && (g_num != ord(touv[cx]))); - if (g_num != ord(touv[cx])) + } while ((cx <= 6) && (g_num != ord(g_touv[cx]))); + if (g_num != ord(g_touv[cx])) g_crep = 187; else { g_mchai = chai; @@ -987,30 +992,30 @@ void fctSelfPut() { if (g_num != 0) { g_crep = 998; if (g_caff == 2) { - if (g_s.iloic != 0) + if (g_s._iloic != 0) g_crep = 188; else - g_s.iloic = g_s.derobj; + g_s._iloic = g_s._derobj; } if (g_caff == 13) { if (g_num == 1) { - if (g_s.iboul != 0) + if (g_s._iboul != 0) g_crep = 188; else - g_s.iboul = g_s.derobj; - } else if (g_s.ibag != 0) { + g_s._iboul = g_s._derobj; + } else if (g_s._ibag != 0) { g_crep = 188; } else { - g_s.ibag = g_s.derobj; + g_s._ibag = g_s._derobj; } } if (g_caff == 16) { - if (g_s.icryp != 0) + if (g_s._icryp != 0) g_crep = 188; else - g_s.icryp = g_s.derobj; + g_s._icryp = g_s._derobj; } if (g_caff == 24) @@ -1042,13 +1047,13 @@ void fctSelfPut() { * @remarks Originally called 'tecouter' */ void fctListen() { - if (g_s.mlieu != 26) + if (g_s._mlieu != 26) g_crep = 101; else { if (g_ipers != 0) - ++g_s.conf; + ++g_s._conf; int p, haz; - ecfren(p, haz, g_s.conf, g_ment); + ecfren(p, haz, g_s._conf, g_ment); int l = g_ment; if (l != 0) { if (p != -500) { @@ -1080,19 +1085,19 @@ void fctListen() { * @remarks Originally called 'tmanger' */ void fctEat() { - if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) { + if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) { g_crep = 148; } else { tsort(); - g_s.mlieu = 10; + g_s._mlieu = 10; g_caff = 10; - debloc(g_s.mlieu); - tmlieu(g_s.mlieu); + debloc(g_s._mlieu); + tmlieu(g_s._mlieu); int j, h, m; calch(j, h, m); if ((h == 12) || (h == 13) || (h == 19)) { - g_s.conf -= (g_s.conf / 7); + g_s._conf -= (g_s._conf / 7); if (h == 12) { if (m == 0) h = 4; @@ -1123,16 +1128,16 @@ void fctEat() { void fctEnter() { // int x; - if ((g_s.mlieu == 21) || (g_s.mlieu == 22)) { + if ((g_s._mlieu == 21) || (g_s._mlieu == 22)) { t1sama(); - tmlieu(g_s.mlieu); - } else if (g_s.mlieu == 15) + tmlieu(g_s._mlieu); + } else if (g_s._mlieu == 15) aldepl(); else if (g_ment == 0) g_crep = 997; - else if ((g_ment == 9) && (g_s.derobj != 136)) { + else if ((g_ment == 9) && (g_s._derobj != 136)) { g_crep = 189; - g_s.teauto[8] = '*'; + g_s._teauto[8] = '*'; } else { int z = 0; if (!g_blo) @@ -1146,8 +1151,8 @@ void fctEnter() { aniof(1, 1); tip(z, g_x); - ++g_s.conf; - g_s.mlieu = 15; + ++g_s._conf; + g_s._mlieu = 15; g_msg[3] = MENU_DISCUSS; g_msg[4] = g_vm->_menu._discussMenu[g_x]; g_syn = true; @@ -1166,10 +1171,10 @@ void fctEnter() { parole(7, g_x, 1); aniof(1, 1); - g_s.mlieu = g_ment; + g_s._mlieu = g_ment; affrep(); - debloc(g_s.mlieu); - tmlieu(g_s.mlieu); + debloc(g_s._mlieu); + tmlieu(g_s._mlieu); g_ment = 0; g_mpers = 0; g_ipers = 0; @@ -1184,17 +1189,17 @@ void fctEnter() { void fctSleep() { int z, j, h, m; - if ((g_s.mlieu > 15) && (g_s.mlieu < 26)) { + if ((g_s._mlieu > 15) && (g_s._mlieu < 26)) { g_crep = 148; return; } - if (g_s.mlieu != 0) { + if (g_s._mlieu != 0) { tsort(); - g_s.mlieu = 0; + g_s._mlieu = 0; affrep(); afdes(0); - debloc(g_s.mlieu); - tmlieu(g_s.mlieu); + debloc(g_s._mlieu); + tmlieu(g_s._mlieu); } clsf3(); clsf2(); @@ -1205,7 +1210,7 @@ void fctSleep() { int answer; do { if (h < 8) { - g_s.conf -= (g_s.conf / 20); + g_s._conf -= (g_s._conf / 20); z = (7 - h) * 2; if (m == 30) --z; @@ -1235,11 +1240,11 @@ void fctForce() { tfleche(); if ((!g_anyone) && (!g_iesc)) { - if (g_s.mlieu != 26) + if (g_s._mlieu != 26) g_crep = 997; else { g_crep = 143; - g_s.conf += 2; + g_s._conf += 2; } } } @@ -1251,27 +1256,27 @@ void fctForce() { void fctLeave() { tsort(); g_crep = 0; - if ((g_s.mlieu == 19) || (g_s.mlieu == 21) || (g_s.mlieu == 22) || (g_s.mlieu == 24)) + if ((g_s._mlieu == 19) || (g_s._mlieu == 21) || (g_s._mlieu == 22) || (g_s._mlieu == 24)) g_crep = 997; else { int lx = 0; - if ((g_s.mlieu < 16) || (g_s.mlieu == 26)) + if ((g_s._mlieu < 16) || (g_s._mlieu == 26)) lx = 10; - if ((g_s.mlieu == 10) || (g_s.mlieu == 20)) + if ((g_s._mlieu == 10) || (g_s._mlieu == 20)) lx = 21; - if ((g_s.mlieu < 10) || (g_s.mlieu == 13)) + if ((g_s._mlieu < 10) || (g_s._mlieu == 13)) lx = 15; - if (g_s.mlieu == 16) { + if (g_s._mlieu == 16) { lx = 17; g_crep = 176; } - if (g_s.mlieu == 17) + if (g_s._mlieu == 17) t23coul(lx); - if (g_s.mlieu == 23) + if (g_s._mlieu == 23) lx = 24; if (g_crep != 997) - g_s.mlieu = lx; + g_s._mlieu = lx; g_caff = lx; if (g_crep == 0) g_crep = lx; @@ -1295,12 +1300,12 @@ void fctWait() { ++g_jh; tinke(); if (!g_blo) - t11(g_s.mlieu, quel); + t11(g_s._mlieu, quel); if ((g_ipers != 0) && (g_mpers == 0)) { g_crep = 998; - if ((g_s.mlieu == 13) || (g_s.mlieu == 14)) + if ((g_s._mlieu == 13) || (g_s._mlieu == 14)) cavegre(); - if ((g_s.mlieu > 0) && (g_s.mlieu < 10)) + if ((g_s._mlieu > 0) && (g_s._mlieu < 10)) g_anyone = true; g_mpers = g_ipers; if (!g_anyone) @@ -1364,7 +1369,7 @@ void fctDiscuss() { for (int ix = 1; ix <= 46; ++ix) te[ix] = false; for (int ix = 1; ix <= 45; ++ix) { - lib[ix] = deline(ix + c_tparler); + lib[ix] = deline(ix + kQuestionStringIndex); for (i = lib[ix].size(); i <= 40; ++i) lib[ix] = lib[ix] + ' '; } @@ -1379,7 +1384,7 @@ void fctDiscuss() { do { ++icm; g_vm->_screenSurface.putxy(co, lig); - if (g_s.teauto[icm] == '*') { + if (g_s._teauto[icm] == '*') { if (te[icm]) writetp(lib[icm], 1); else @@ -1439,7 +1444,7 @@ void fctDiscuss() { writetp(lib[choi], 1); te[choi] = ! te[choi]; } - if ((g_s.teauto[ix] == '*') || (ix == 46)) { + if ((g_s._teauto[ix] == '*') || (ix == 46)) { lig = ((ix - 1) % 23) << 3; if (ix > 23) co = 320; @@ -1462,7 +1467,7 @@ void fctDiscuss() { int ix = choi - 1; if (g_col) { g_col = false; - g_s.mlieu = 15; + g_s._mlieu = 15; if (g_iouv > 0) max = 8; else @@ -1472,14 +1477,14 @@ void fctDiscuss() { suj = 129; else { suj = 138; - g_s.conf += (3 * (g_s.conf / 10)); + g_s._conf += (3 * (g_s._conf / 10)); } - } else if (nbrep[g_caff - 69] < nbrepm[g_caff - 69]) { - suj = tabdon[arep + (ix << 3) + (g_caff - 70)]; - g_s.conf += tabdon[arcf + ix]; - ++nbrep[g_caff - 69]; + } else if (g_nbrep[g_caff - 69] < g_nbrepm[g_caff - 69]) { + suj = g_tabdon[arep + (ix << 3) + (g_caff - 70)]; + g_s._conf += g_tabdon[arcf + ix]; + ++g_nbrep[g_caff - 69]; } else { - g_s.conf += 3; + g_s._conf += 3; suj = 139; } hideMouse(); @@ -1488,17 +1493,17 @@ void fctDiscuss() { sparl(0, suj); showMouse(); if ((suj == 84) || (suj == 86)) { - g_s.pourc[5] = '*'; - g_s.teauto[7] = '*'; + g_s._pourc[5] = '*'; + g_s._teauto[7] = '*'; } if ((suj == 106) || (suj == 108) || (suj == 94)) { for (int indx = 29; indx <= 31; ++indx) - g_s.teauto[indx] = '*'; - g_s.pourc[7] = '*'; + g_s._teauto[indx] = '*'; + g_s._pourc[7] = '*'; } if (suj == 70) { - g_s.pourc[8] = '*'; - g_s.teauto[32] = '*'; + g_s._pourc[8] = '*'; + g_s._teauto[32] = '*'; } hideMouse(); hirs(); @@ -1506,14 +1511,14 @@ void fctDiscuss() { } } while ((choi != 46) && (suj != 138)); if (g_col) { - g_s.conf += (3 * (g_s.conf / 10)); + g_s._conf += (3 * (g_s._conf / 10)); hideMouse(); hirs(); premtet(); sparl(0, 138); showMouse(); g_col = false; - g_s.mlieu = 15; + g_s._mlieu = 15; } g_ctrm = 0; hideMouse(); @@ -1525,7 +1530,7 @@ void fctDiscuss() { drawClock(); affrep(); /* chech;*/ - tmlieu(g_s.mlieu); + tmlieu(g_s._mlieu); clsf3(); } @@ -1601,8 +1606,6 @@ void MortevielleEngine::endGame() { * @remarks Originally called 'tencore' */ void MortevielleEngine::loseGame() { - int answer; - clsf2(); musique(0); tkey1(false); @@ -1616,7 +1619,8 @@ void MortevielleEngine::loseGame() { g_hour = 10; g_day = 0; repon(2, 180); - answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); + + int answer = Alert::show(g_vm->getEngineString(S_YES_NO), 1); _quitGame = (answer != 1); } |