diff options
author | Paul Gilbert | 2017-02-19 21:54:50 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-19 21:54:50 -0500 |
commit | c1bc64d3912f60d6c5812f1f82d196eb78d5b4f2 (patch) | |
tree | fb7dff90e649f7c1e19fa6eee1f0a83228c0e868 /engines/titanic | |
parent | 6c4bdd7e794bf1bb023cb925bea4fa84278569e7 (diff) | |
download | scummvm-rg350-c1bc64d3912f60d6c5812f1f82d196eb78d5b4f2.tar.gz scummvm-rg350-c1bc64d3912f60d6c5812f1f82d196eb78d5b4f2.tar.bz2 scummvm-rg350-c1bc64d3912f60d6c5812f1f82d196eb78d5b4f2.zip |
TITANIC: Renamings for CBomb class
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/game/bomb.cpp | 75 | ||||
-rw-r--r-- | engines/titanic/game/bomb.h | 10 | ||||
-rw-r--r-- | engines/titanic/game/code_wheel.cpp | 2 |
3 files changed, 45 insertions, 42 deletions
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp index 1e00e4c694..0f4ce92d29 100644 --- a/engines/titanic/game/bomb.cpp +++ b/engines/titanic/game/bomb.cpp @@ -71,13 +71,13 @@ static const char *const COUNTDOWN_WAVS[100] = { CBomb::CBomb() : CBackground() { _active = false; - _fieldE4 = 0; - _fieldE8 = 17; - _fieldEC = 9; - _fieldF0 = 0; + _numCorrectWheels = 0; + _tappedCtr = 17; + _hammerCtr = 9; + _commentCtr = 0; _countdown = 999; _soundHandle = 0; - _fieldFC = 0; + _unusedHandle = 0; _startingTicks = 0; _volume = 60; } @@ -85,13 +85,13 @@ CBomb::CBomb() : CBackground() { void CBomb::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_active, indent); - file->writeNumberLine(_fieldE4, indent); - file->writeNumberLine(_fieldE8, indent); - file->writeNumberLine(_fieldEC, indent); - file->writeNumberLine(_fieldF0, indent); + file->writeNumberLine(_numCorrectWheels, indent); + file->writeNumberLine(_tappedCtr, indent); + file->writeNumberLine(_hammerCtr, indent); + file->writeNumberLine(_commentCtr, indent); file->writeNumberLine(_countdown, indent); file->writeNumberLine(_soundHandle, indent); - file->writeNumberLine(_fieldFC, indent); + file->writeNumberLine(_unusedHandle, indent); file->writeNumberLine(_startingTicks, indent); file->writeNumberLine(_volume, indent); @@ -101,13 +101,13 @@ void CBomb::save(SimpleFile *file, int indent) { void CBomb::load(SimpleFile *file) { file->readNumber(); _active = file->readNumber(); - _fieldE4 = file->readNumber(); - _fieldE8 = file->readNumber(); - _fieldEC = file->readNumber(); - _fieldF0 = file->readNumber(); + _numCorrectWheels = file->readNumber(); + _tappedCtr = file->readNumber(); + _hammerCtr = file->readNumber(); + _commentCtr = file->readNumber(); _countdown = file->readNumber(); _soundHandle = file->readNumber(); - _fieldFC = file->readNumber(); + _unusedHandle = file->readNumber(); _startingTicks = file->readNumber(); _volume = file->readNumber(); @@ -115,34 +115,35 @@ void CBomb::load(SimpleFile *file) { } bool CBomb::StatusChangeMsg(CStatusChangeMsg *msg) { - _fieldE4 += msg->_newStatus; + _numCorrectWheels += msg->_newStatus; - if (_fieldE4 == 23) { + if (_numCorrectWheels == 23) { + // Nobody likes a smartass startAnimTimer("Disarmed", 2000); lockMouse(); } - _fieldF0 %= 1000; - if (!(_fieldF0 % 20) && _countdown < 995) { + _commentCtr = (_commentCtr % 1000) + 1; + if (!(_commentCtr % 20) && _countdown < 995) { int val = getRandomNumber(5) + 25; - if (_fieldF0 < 20 || _fieldF0 > 80) + if (_commentCtr < 20 || _commentCtr > 80) val = 28; CString name; - switch (val - 25) { - case 0: + switch (val) { + case 25: name = "z#372.wav"; break; - case 1: + case 26: name = "z#371.wav"; break; - case 2: + case 27: name = "z#370.wav"; break; - case 3: + case 28: name = "z#369.wav"; break; - case 4: + case 29: name = "z#368.wav"; break; default: @@ -157,7 +158,7 @@ bool CBomb::StatusChangeMsg(CStatusChangeMsg *msg) { } bool CBomb::EnterViewMsg(CEnterViewMsg *msg) { - _fieldE4 = 2; + _numCorrectWheels = 2; return true; } @@ -166,11 +167,13 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (_active) { stopSound(_soundHandle); - if (_fieldE4 < 23) { - _fieldE8 = MIN(_fieldE8 + 1, 23); + //stopSound(_unusedHandle); + + if (_numCorrectWheels < 23) { + _tappedCtr = MIN(_tappedCtr + 1, 23); CString name; - switch (_fieldE8) { + switch (_tappedCtr) { case 18: name = "z#380.wav"; break; @@ -205,9 +208,9 @@ bool CBomb::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { } bool CBomb::EnterRoomMsg(CEnterRoomMsg *msg) { - _fieldE8 = 17; - _fieldEC = 9; - _fieldF0 = 0; + _tappedCtr = 17; + _hammerCtr = 9; + _commentCtr = 0; _startingTicks = getTicksCount(); return true; } @@ -217,11 +220,11 @@ bool CBomb::ActMsg(CActMsg *msg) { playSound("z#63.wav"); stopSound(_soundHandle); - if (_fieldEC < 17) - ++_fieldEC; + if (_hammerCtr < 17) + ++_hammerCtr; CString name; - switch (_fieldEC) { + switch (_hammerCtr) { case 10: name = "z#388.wav"; break; diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h index c965502a54..c474abf554 100644 --- a/engines/titanic/game/bomb.h +++ b/engines/titanic/game/bomb.h @@ -41,13 +41,13 @@ class CBomb : public CBackground { DECLARE_MESSAGE_MAP; private: bool _active; - int _fieldE4; - int _fieldE8; - int _fieldEC; - int _fieldF0; + int _numCorrectWheels; + int _tappedCtr; + int _hammerCtr; + int _commentCtr; int _countdown; int _soundHandle; - int _fieldFC; + int _unusedHandle; int _startingTicks; int _volume; public: diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp index eee6e997f7..9a3d6fc29a 100644 --- a/engines/titanic/game/code_wheel.cpp +++ b/engines/titanic/game/code_wheel.cpp @@ -108,7 +108,7 @@ bool CodeWheel::MovieEndMsg(CMovieEndMsg *msg) { sleep(200); CStatusChangeMsg changeMsg; changeMsg._newStatus = 0; - if (!_isCorrect) + if (_isCorrect) changeMsg._newStatus = -1; if (_value == _correctValue) changeMsg._newStatus = 1; |