aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/phantom
diff options
context:
space:
mode:
authorStrangerke2015-11-23 00:27:04 +0100
committerStrangerke2015-11-23 00:28:15 +0100
commita12516ee1890e9057b7ca521b7f94aafd0205ce1 (patch)
tree58ef16be8b9298c5ea4bb6264c986bdbe18e4f7b /engines/mads/phantom
parent9cf7d1ba608908c8a52d663e2bd894afe6b63df4 (diff)
downloadscummvm-rg350-a12516ee1890e9057b7ca521b7f94aafd0205ce1.tar.gz
scummvm-rg350-a12516ee1890e9057b7ca521b7f94aafd0205ce1.tar.bz2
scummvm-rg350-a12516ee1890e9057b7ca521b7f94aafd0205ce1.zip
MADS: Phantom: Reword scene101::handleAnimation0 for consistency, remove some useless variables in scene113
Diffstat (limited to 'engines/mads/phantom')
-rw-r--r--engines/mads/phantom/phantom_scenes1.cpp131
1 files changed, 61 insertions, 70 deletions
diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp
index f42b3e64b5..53bf1174ef 100644
--- a/engines/mads/phantom/phantom_scenes1.cpp
+++ b/engines/mads/phantom/phantom_scenes1.cpp
@@ -419,78 +419,77 @@ void Scene101::handleConversation1() {
}
void Scene101::handleAnimation0() {
- int resetFrame;
-
- if (_scene->getAnimFrame(_globals._animationIndexes[0]) != _callingFrame) {
- _callingFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
- resetFrame = -1;
- switch (_callingFrame) {
- case 1:
- case 9:
- case 12:
- if (_callingStatus == 1) {
- if (_callingFrame == 9) {
- if (_startWalking0Fl) {
- resetFrame = 13;
- _callingStatus = 3;
- } else
- _callingStatus = 2;
- } else
- resetFrame = 1;
- }
-
- if (_callingStatus == 0) {
- if (_startWalking0Fl) {
- resetFrame = 60;
- _callingStatus = 3;
- } else
- resetFrame = 0;
- }
+ if (_scene->getAnimFrame(_globals._animationIndexes[0]) == _callingFrame)
+ return;
- if (_callingStatus == 2) {
+ _callingFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
+ int resetFrame = -1;
+ switch (_callingFrame) {
+ case 1:
+ case 9:
+ case 12:
+ if (_callingStatus == 1) {
+ if (_callingFrame == 9) {
if (_startWalking0Fl) {
resetFrame = 13;
_callingStatus = 3;
- } else {
- ++_talkCounter;
-
- if (_talkCounter < 18) {
- if (_vm->getRandomNumber(1, 2) == 1)
- resetFrame = 7;
- else
- resetFrame = 10;
- } else {
- resetFrame = 54;
- _callingStatus = 0;
- }
- }
- }
- break;
-
- case 53:
- _anim0Running = false;
- _scene->freeAnimation(0);
- break;
+ } else
+ _callingStatus = 2;
+ } else
+ resetFrame = 1;
+ }
- case 59:
+ if (_callingStatus == 0) {
if (_startWalking0Fl) {
resetFrame = 60;
_callingStatus = 3;
- } else {
+ } else
resetFrame = 0;
- _callingStatus = 0;
- }
- break;
+ }
- case 66:
- resetFrame = 24;
- break;
+ if (_callingStatus == 2) {
+ if (_startWalking0Fl) {
+ resetFrame = 13;
+ _callingStatus = 3;
+ } else {
+ ++_talkCounter;
+
+ if (_talkCounter < 18) {
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 7;
+ else
+ resetFrame = 10;
+ } else {
+ resetFrame = 54;
+ _callingStatus = 0;
+ }
+ }
}
+ break;
+
+ case 53:
+ _anim0Running = false;
+ _scene->freeAnimation(0);
+ break;
- if (resetFrame >= 0) {
- _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
- _callingFrame = resetFrame;
+ case 59:
+ if (_startWalking0Fl) {
+ resetFrame = 60;
+ _callingStatus = 3;
+ } else {
+ resetFrame = 0;
+ _callingStatus = 0;
}
+ break;
+
+ case 66:
+ resetFrame = 24;
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _callingFrame = resetFrame;
}
}
@@ -8866,8 +8865,6 @@ void Scene113::handleDeadConversation() {
}
void Scene113::handleFlorentConversation() {
- int random;
-
switch (_action._activeAction._verbId) {
case 3:
case 4:
@@ -8930,15 +8927,13 @@ void Scene113::handleFlorentConversation() {
case 66:
if ((_florentStatus != 3) &&
(_florentStatus != 2)) {
- random = _vm->getRandomNumber(1,5);
- if (random == 1)
+ if (_vm->getRandomNumber(1, 5) == 1)
_florentStatus = 0;
}
if ((_raoulAction != 3) && (_raoulAction != 5) && (_raoulAction != 4) && (!_raoulStandingFl)) {
_raoulAction = 1;
- random = _vm->getRandomNumber(1, 2);
- if (random == 1)
+ if (_vm->getRandomNumber(1, 2) == 1)
_raoulAction = 2;
}
break;
@@ -9006,8 +9001,6 @@ void Scene113::handleFlorentConversation() {
}
void Scene113::handleLoveConversation() {
- int random;
-
switch (_action._activeAction._verbId) {
case 1:
case 2:
@@ -9073,10 +9066,8 @@ void Scene113::handleLoveConversation() {
if (_raoulAction != 3) {
_raoulAction = 1;
- random = _vm->getRandomNumber(1, 2);
- if (random == 1) {
+ if (_vm->getRandomNumber(1, 2) == 1)
_raoulAction = 2;
- }
}
}
break;