aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-06-30 22:01:05 +0200
committerStrangerke2013-06-30 22:01:05 +0200
commit539ce5612406edae9c3c226ed506602b8d197120 (patch)
tree252a8a8d8892e2d4b3c07a5b271fcb4569b46ee7 /engines/avalanche
parent63737c3878a4e6c22d7dc4d67cfbd59310e46c67 (diff)
downloadscummvm-rg350-539ce5612406edae9c3c226ed506602b8d197120.tar.gz
scummvm-rg350-539ce5612406edae9c3c226ed506602b8d197120.tar.bz2
scummvm-rg350-539ce5612406edae9c3c226ed506602b8d197120.zip
AVALANCHE: Fix some more code formatting
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/acci2.cpp597
-rw-r--r--engines/avalanche/avalanche.cpp2
-rw-r--r--engines/avalanche/celer2.cpp4
-rw-r--r--engines/avalanche/gyro2.cpp2
-rw-r--r--engines/avalanche/logger2.cpp78
-rw-r--r--engines/avalanche/scrolls2.cpp49
-rw-r--r--engines/avalanche/sequence2.cpp3
-rw-r--r--engines/avalanche/timeout2.cpp8
-rw-r--r--engines/avalanche/trip6.cpp76
9 files changed, 418 insertions, 401 deletions
diff --git a/engines/avalanche/acci2.cpp b/engines/avalanche/acci2.cpp
index 2a86732b0c..d16c8c6746 100644
--- a/engines/avalanche/acci2.cpp
+++ b/engines/avalanche/acci2.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Graphic Adventure Engine
+ /* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
@@ -216,10 +216,6 @@ const Acci::ranktype Acci::ranks[9] = {
};
-
-
-
-
void Acci::setParent(AvalancheEngine *vm) {
_vm = vm;
}
@@ -239,13 +235,14 @@ Common::String Acci::wordnum(Common::String x)
bool gotcha;
Common::String wordnum_result;
- if (x == "") {
+ if (x == "") {
wordnum_result = "";
return wordnum_result;
}
whatsit = pardon;
gotcha = false;
- for (fv = nowords; fv >= 1; fv --) checkword(x);
+ for (fv = nowords; fv >= 1; fv--)
+ checkword(x);
wordnum_result = whatsit;
return wordnum_result;
}
@@ -273,13 +270,14 @@ end;*/
Common::String Acci::rank() {
byte fv;
- Common::String rank_result;
- for (fv = 1; fv <= 8; fv ++)
+ Common::String rank_result = "";
+ for (fv = 1; fv <= 8; fv++) {
if ((_vm->_gyro.dna.score >= ranks[fv].score) && (_vm->_gyro.dna.score < ranks[fv + 1].score)) {
rank_result = ranks[fv].title;
return rank_result;
}
-
+ }
+
return rank_result;
}
@@ -341,11 +339,6 @@ bool Acci::do_pronouns() {
return do_pronouns_result;
}
-
-
-
-
-
void Acci::lowercase() {
byte fv;
@@ -421,9 +414,7 @@ void Acci::examine() {
void Acci::inv() { /* the time-honoured command... */
char fv;
- byte q;
-
- q = 0;
+ byte q = 0;
warning("STUB: Acci::inv()");
}
@@ -442,19 +433,24 @@ void Acci::lookaround() {
_vm->_scrolls.display(*_vm->_gyro.also[0][1]);
switch (_vm->_gyro.dna.room) {
case r__spludwicks:
- if (_vm->_gyro.dna.avaricius_talk > 0) _vm->_visa.dixi('q', 23);
- else others();
+ if (_vm->_gyro.dna.avaricius_talk > 0)
+ _vm->_visa.dixi('q', 23);
+ else
+ others();
+ break;
+ case r__robins:
+ if (_vm->_gyro.dna.tied_up)
+ _vm->_visa.dixi('q', 38);
+ if (_vm->_gyro.dna.mushroom_growing)
+ _vm->_visa.dixi('q', 55);
break;
- case r__robins: {
- if (_vm->_gyro.dna.tied_up) _vm->_visa.dixi('q', 38);
- if (_vm->_gyro.dna.mushroom_growing) _vm->_visa.dixi('q', 55);
- }
- break;
case r__insidecardiffcastle:
- if (! _vm->_gyro.dna.taken_pen) _vm->_visa.dixi('q', 49);
+ if (!_vm->_gyro.dna.taken_pen)
+ _vm->_visa.dixi('q', 49);
break;
case r__lustiesroom:
- if (_vm->_gyro.dna.lustie_is_asleep) _vm->_visa.dixi('q', 65);
+ if (_vm->_gyro.dna.lustie_is_asleep)
+ _vm->_visa.dixi('q', 65);
break;
case r__catacombs:
switch (_vm->_gyro.dna.cat_y * 256 + _vm->_gyro.dna.cat_x) {
@@ -487,7 +483,7 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */
}
break;
case r__spludwicks:
- if (thing == 61) {
+ if (thing == 61) {
_vm->_visa.dixi('q', 85);
return;
}
@@ -495,26 +491,25 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */
}
- if ((! _vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
+ if ((!_vm->_gyro.dna.user_moves_avvy) && (_vm->_gyro.dna.room != r__lusties))
return; /* No doors can open if you can't move Avvy. */
- for (fv = 9; fv <= 15; fv ++)
+
+ for (fv = 9; fv <= 15; fv++) {
if (_vm->_trip.infield(fv)) {
{
_vm->_gyro.portals[fv];
switch (_vm->_gyro.portals[fv].op) {
- case _vm->_gyro.exclaim: {
+ case _vm->_gyro.exclaim:
_vm->_trip.tr[1].bounce();
_vm->_visa.dixi('x', _vm->_gyro.portals[fv].data);
- }
- break;
+ break;
case _vm->_gyro.transport:
_vm->_trip.fliproom((_vm->_gyro.portals[fv].data) >> 8 /*High byte*/, (_vm->_gyro.portals[fv].data) & 0x0F /*Low byte*/);
break;
- case _vm->_gyro.unfinished: {
+ case _vm->_gyro.unfinished:
_vm->_trip.tr[1].bounce();
_vm->_scrolls.display("Sorry. This place is not available yet!");
- }
- break;
+ break;
case _vm->_gyro.special:
_vm->_trip.call_special(_vm->_gyro.portals[fv].data);
break;
@@ -525,6 +520,8 @@ void Acci::opendoor() { /* so whaddya THINK this does?! */
}
return;
}
+ }
+
if (_vm->_gyro.dna.room == r__map)
_vm->_scrolls.display(Common::String("Avvy, you can complete the whole game without ever going "
"to anywhere other than Argent, Birmingham, Cardiff, "
@@ -541,14 +538,14 @@ void Acci::silly() {
}
void Acci::putproc() { /* Called when you call vb_put. */
- char temp;
-
+ if (!holding())
+ return;
- if (! holding()) return;
thing2 -= 49; /* Slip the second object */
- temp = thing;
+ char temp = thing;
thing = thing2;
- if (! holding()) return;
+ if (!holding())
+ return;
thing = temp;
/* Thing is the thing which you're putting in. Thing2 is where you're
@@ -569,7 +566,8 @@ void Acci::putproc() { /* Called when you call vb_put. */
_vm->_visa.dixi('u', 9);
}
}
- } else silly();
+ } else
+ silly();
break;
case 54:
@@ -577,7 +575,7 @@ void Acci::putproc() { /* Called when you call vb_put. */
if (_vm->_gyro.dna.box_contents != nowt)
_vm->_scrolls.display(Common::String("There's something in the box already, Avvy. Try taking"
" that out first."));
- else
+ else {
switch (thing) {
case _vm->_gyro.money:
_vm->_scrolls.display("You'd better keep some ready cash on you!");
@@ -591,7 +589,7 @@ void Acci::putproc() { /* Called when you call vb_put. */
case _vm->_gyro.onion:
_vm->_scrolls.display("Just give it to Spludwick, Avvy!");
break;
- default: {
+ default:
/* Put the object into the box... */
if (_vm->_gyro.dna.wearing == thing)
_vm->_scrolls.display(Common::String("You'd better take ") + _vm->_gyro.get_better(thing) + " off first!");
@@ -604,8 +602,9 @@ void Acci::putproc() { /* Called when you call vb_put. */
_vm->_celer.show_one(6); /* Shut box. */
}
}
- }
- } else silly();
+ }
+ } else
+ silly();
break;
default:
@@ -614,9 +613,6 @@ void Acci::putproc() { /* Called when you call vb_put. */
}
-
-
-
/* The result of this fn is whether or not he says "Hey, thanks!" */
void Acci::not_in_order() {
_vm->_scrolls.display(Common::String("Sorry, I need the ingredients in the right order for this potion.") +
@@ -631,72 +627,63 @@ void Acci::go_to_cauldron() {
}
bool Acci::give2spludwick() {
- bool give2spludwick_result;
- {
- give2spludwick_result = false;
+ bool give2spludwick_result = false;
- if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
- not_in_order();
- return give2spludwick_result;
- }
+ if (_vm->_gyro.spludwick_order[_vm->_gyro.dna.given2spludwick] != thing) {
+ not_in_order();
+ return give2spludwick_result;
+ }
- switch (thing) {
- case _vm->_gyro.onion: {
- _vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
- if (_vm->_gyro.dna.rotten_onion)
- _vm->_visa.dixi('q', 22);
- else {
- _vm->_gyro.dna.given2spludwick += 1;
- _vm->_visa.dixi('q', 20);
- go_to_cauldron();
- _vm->_lucerna.points(3);
- }
- _vm->_lucerna.objectlist();
- }
- break;
- case _vm->_gyro.ink: {
- _vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
- _vm->_lucerna.objectlist();
+ switch (thing) {
+ case _vm->_gyro.onion:
+ _vm->_gyro.dna.obj[_vm->_gyro.onion] = false;
+ if (_vm->_gyro.dna.rotten_onion)
+ _vm->_visa.dixi('q', 22);
+ else {
_vm->_gyro.dna.given2spludwick += 1;
- _vm->_visa.dixi('q', 24);
+ _vm->_visa.dixi('q', 20);
go_to_cauldron();
_vm->_lucerna.points(3);
}
+ _vm->_lucerna.objectlist();
break;
- case _vm->_gyro.mushroom: {
- _vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
- _vm->_visa.dixi('q', 25);
- _vm->_lucerna.points(5);
- _vm->_gyro.dna.given2spludwick += 1;
- go_to_cauldron();
- _vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
- _vm->_lucerna.objectlist();
- }
+ case _vm->_gyro.ink:
+ _vm->_gyro.dna.obj[_vm->_gyro.ink] = false;
+ _vm->_lucerna.objectlist();
+ _vm->_gyro.dna.given2spludwick += 1;
+ _vm->_visa.dixi('q', 24);
+ go_to_cauldron();
+ _vm->_lucerna.points(3);
break;
- default:
- give2spludwick_result = true;
- }
+ case _vm->_gyro.mushroom:
+ _vm->_gyro.dna.obj[_vm->_gyro.mushroom] = false;
+ _vm->_visa.dixi('q', 25);
+ _vm->_lucerna.points(5);
+ _vm->_gyro.dna.given2spludwick += 1;
+ go_to_cauldron();
+ _vm->_gyro.dna.obj[_vm->_gyro.potion] = true;
+ _vm->_lucerna.objectlist();
+ break;
+ default:
+ give2spludwick_result = true;
}
+
return give2spludwick_result;
}
-
-
void Acci::have_a_drink() {
- {
- _vm->_gyro.dna.alcohol += 1;
- if (_vm->_gyro.dna.alcohol == 5) {
- _vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
- _vm->_gyro.dna.teetotal = true;
- _vm->_gyro.dna.avvy_is_awake = false;
- _vm->_gyro.dna.avvy_in_bed = true;
- _vm->_lucerna.objectlist();
- _vm->_lucerna.dusk();
- _vm->_gyro.hang_around_for_a_while();
- _vm->_trip.fliproom(1, 1);
- _vm->_gyro.background(14);
- _vm->_trip.new_game_for_trippancy(); /* Not really */
- }
+ _vm->_gyro.dna.alcohol += 1;
+ if (_vm->_gyro.dna.alcohol == 5) {
+ _vm->_gyro.dna.obj[_vm->_gyro.key] = true; /* Get the key. */
+ _vm->_gyro.dna.teetotal = true;
+ _vm->_gyro.dna.avvy_is_awake = false;
+ _vm->_gyro.dna.avvy_in_bed = true;
+ _vm->_lucerna.objectlist();
+ _vm->_lucerna.dusk();
+ _vm->_gyro.hang_around_for_a_while();
+ _vm->_trip.fliproom(1, 1);
+ _vm->_gyro.background(14);
+ _vm->_trip.new_game_for_trippancy(); /* Not really */
}
}
@@ -718,8 +705,6 @@ void Acci::cardiff_climbing() {
}
-
-
/* Called when you ask Avvy to stand. */
void Acci::already() {
_vm->_scrolls.display("You're already standing!");
@@ -742,7 +727,8 @@ void Acci::stand_up() {
_vm->_lucerna.points(1);
_vm->_gyro.dna.avvy_in_bed = false;
_vm->_timeout.lose_timer(_vm->_timeout.reason_arkata_shouts);
- } else already();
+ } else
+ already();
break;
case r__insidecardiffcastle:
@@ -756,7 +742,8 @@ void Acci::stand_up() {
_vm->_trip.apped(1, 4); /* And walking away. */
_vm->_gyro.dna.sitting_in_pub = false; /* Really not sitting down. */
_vm->_gyro.dna.user_moves_avvy = true; /* And ambulant. */
- } else already();
+ } else
+ already();
break;
default:
already();
@@ -764,8 +751,6 @@ void Acci::stand_up() {
}
-
-
void Acci::getproc(char thing) {
switch (_vm->_gyro.dna.room) {
case r__yours:
@@ -779,11 +764,12 @@ void Acci::getproc(char thing) {
_vm->_celer.show_one(6);
} else
_vm->_scrolls.display(Common::String("I can't see ") + _vm->_gyro.get_better(thing) + " in the box.");
- } else _vm->_visa.dixi('q', 57);
+ } else
+ _vm->_visa.dixi('q', 57);
break;
case r__insidecardiffcastle:
switch (thing) {
- case _vm->_gyro.pen: {
+ case _vm->_gyro.pen:
if (_vm->_trip.infield(2)) {
/* Standing on the dais. */
@@ -798,10 +784,11 @@ void Acci::getproc(char thing) {
_vm->_lucerna.objectlist();
_vm->_scrolls.display("Taken.");
}
- } else if (_vm->_gyro.dna.standing_on_dais) _vm->_visa.dixi('q', 53);
- else _vm->_visa.dixi('q', 51);
- }
- break;
+ } else if (_vm->_gyro.dna.standing_on_dais)
+ _vm->_visa.dixi('q', 53);
+ else
+ _vm->_visa.dixi('q', 51);
+ break;
case _vm->_gyro.bolt:
_vm->_visa.dixi('q', 52);
break;
@@ -818,7 +805,8 @@ void Acci::getproc(char thing) {
_vm->_gyro.dna.obj[_vm->_gyro.mushroom] = true;
_vm->_lucerna.objectlist();
_vm->_lucerna.points(3);
- } else _vm->_visa.dixi('q', 57);
+ } else
+ _vm->_visa.dixi('q', 57);
break;
default:
_vm->_visa.dixi('q', 57);
@@ -826,26 +814,25 @@ void Acci::getproc(char thing) {
}
void Acci::give_geida_the_lute() {
- {
- if (_vm->_gyro.dna.room != r__lustiesroom) {
- _vm->_scrolls.display("Not yet. Try later!\232\2");
- return;
- }
- _vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
- _vm->_lucerna.objectlist();
- _vm->_visa.dixi('q', 64); /* She plays it. */
+ if (_vm->_gyro.dna.room != r__lustiesroom) {
+ _vm->_scrolls.display("Not yet. Try later!\232\2");
+ return;
+ }
+ _vm->_gyro.dna.obj[_vm->_gyro.lute] = false;
+ _vm->_lucerna.objectlist();
+ _vm->_visa.dixi('q', 64); /* She plays it. */
- /* And the rest has been moved to Timeout... under give_lute_to_Geida. */
+ /* And the rest has been moved to Timeout... under give_lute_to_Geida. */
- _vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
- _vm->_enid.back_to_bootstrap(4);
- }
+ _vm->_timeout.set_up_timer(1, _vm->_timeout.procgive_lute_to_geida, _vm->_timeout.reason_geida_sings);
+ _vm->_enid.back_to_bootstrap(4);
}
void Acci::play_harp() {
if (_vm->_trip.infield(7))
_vm->_scrolls.musical_scroll();
- else _vm->_scrolls.display("Get a bit closer to it, Avvy!");
+ else
+ _vm->_scrolls.display("Get a bit closer to it, Avvy!");
}
void Acci::winsequence() {
@@ -864,8 +851,10 @@ void Acci::person_speaks() {
if ((person == pardon) || (person == '\0')) {
- if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room)) person = _vm->_gyro.her;
- else person = _vm->_gyro.him;
+ if ((_vm->_gyro.him == pardon) || (_vm->_gyro.whereis[_vm->_gyro.him] != _vm->_gyro.dna.room))
+ person = _vm->_gyro.her;
+ else
+ person = _vm->_gyro.him;
}
if (_vm->_gyro.whereis[person] != _vm->_gyro.dna.room) {
@@ -875,24 +864,23 @@ void Acci::person_speaks() {
found = false; /* The person we're looking for's code is in Person. */
- for (fv = 1; fv <= _vm->_trip.numtr; fv ++)
+ for (fv = 1; fv <= _vm->_trip.numtr; fv++) {
if (_vm->_trip.tr[fv].quick && ((_vm->_trip.tr[fv].a.accinum + 149) == person)) {
_vm->_scrolls.display(Common::String('\23') + char(fv + 48) + '\4');
found = true;
}
+ }
- if (! found)
- for (fv = 10; fv <= 25; fv ++) {
+ if (!found) {
+ for (fv = 10; fv <= 25; fv++) {
_vm->_gyro.quasipeds[fv];
if ((_vm->_gyro.quasipeds[fv].who == person) && (_vm->_gyro.quasipeds[fv].room == _vm->_gyro.dna.room)) {
_vm->_scrolls.display(Common::String('\23') + char(fv + 55) + '\4');
}
}
+ }
}
-
-
-
void Acci::heythanks() {
person_speaks();
_vm->_scrolls.display("Hey, thanks!\2(But now, you've lost it!)");
@@ -910,25 +898,29 @@ void Acci::do_that() {
thats = "";
return;
}
- if (_vm->_gyro.weirdword) return;
- if (thing < '\310') thing -= 49; /* "Slip" */
-
- /*if ((! _vm->_gyro.alive) &
- !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
- vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
- vb_highscores, vb_smartalec, eos).has(verb))) {
- _vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
- "or something? Try restarting, or restoring a saved game!");
- return;
+ if (_vm->_gyro.weirdword)
+ return;
+ if (thing < '\310')
+ thing -= 49; /* "Slip" */
+
+ /*
+ if ((!_vm->_gyro.alive) &
+ !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+ vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_score,
+ vb_highscores, vb_smartalec, eos).has(verb))) {
+ _vm->_scrolls.display(Common::String("You're dead, so don't talk. What are you, a ghost ") +
+ "or something? Try restarting, or restoring a saved game!");
+ return;
}
if ((~ _vm->_gyro.dna.avvy_is_awake) &
- !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
- vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
- vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
- _vm->_scrolls.display("Talking in your sleep? Try waking up!");
- return;
- }*/
+ !(set::of(vb_load, vb_save, vb_quit, vb_info, vb_help, vb_larrypass,
+ vb_phaon, vb_boss, vb_cheat, vb_restart, vb_dir, vb_die, vb_score,
+ vb_highscores, vb_smartalec, vb_expletive, vb_wake, eos).has(verb))) {
+ _vm->_scrolls.display("Talking in your sleep? Try waking up!");
+ return;
+ }
+ */
switch (verb) {
@@ -942,11 +934,13 @@ void Acci::do_that() {
_vm->_scrolls.display(Common::String("Game paused.") + '\3' + '\15' + '\15' + "Press Enter, Esc, or click " +
"the mouse on the `O.K.\" box to continue.");
break;
- case vb_get: {
+ case vb_get:
if (thing != pardon) {
/* Legitimate try to pick something up. */
- if (_vm->_gyro.dna.carrying >= maxobjs) _vm->_scrolls.display("You can't carry any more!");
- else getproc(thing);
+ if (_vm->_gyro.dna.carrying >= maxobjs)
+ _vm->_scrolls.display("You can't carry any more!");
+ else
+ getproc(thing);
} else {
/* Not... ditto. */
@@ -955,8 +949,7 @@ void Acci::do_that() {
else
_vm->_scrolls.display("I assure you, you don't need it.");
}
- }
- break;
+ break;
case vb_drop:
_vm->_scrolls.display(Common::String("Two years ago you dropped a florin in the street. Three days ") +
"later it was gone! So now you never leave ANYTHING lying around. OK?");
@@ -969,25 +962,32 @@ void Acci::do_that() {
if (person == pardon) {
if (_vm->_gyro.subjnumber == 99) /* They typed "say passuint16". */
_vm->_scrolls.display("Yes, but what \6is\22 the passuint16?");
- /*else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
- Delete(thats, 1, 1);
- move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
- verb = chr(subjnumber);
- do_that();
- return;
+ /*
+ else if (set::of(range(1, 49), 253, 249, eos).has(subjnumber)) {
+ Delete(thats, 1, 1);
+ move(realuint16s[2], realuint16s[1], sizeof(realuint16s) - sizeof(realuint16s[1]));
+ verb = chr(subjnumber);
+ do_that();
+ return;
} else {
- person = _vm->_gyro.subjnumber;
- subjnumber = 0;
- if (set::of(pardon, '\0', eos).has(person)) _vm->_scrolls.display("Talk to whom?");
- else if (personshere()) talkto(ord(person));
+ person = _vm->_gyro.subjnumber;
+ subjnumber = 0;
+ if (set::of(pardon, '\0', eos).has(person))
+ _vm->_scrolls.display("Talk to whom?");
+ else if (personshere())
+ talkto(ord(person));
}
- }*/ else if (person == pardon) _vm->_scrolls.display("Talk to whom?");
- else if (personshere()) _vm->_visa.talkto(person);
+ */
+ else if (person == pardon)
+ _vm->_scrolls.display("Talk to whom?");
+ } else if (personshere())
+ _vm->_visa.talkto(person);
break;
case vb_give:
if (holding()) {
- if (person == pardon) _vm->_scrolls.display("Give to whom?");
+ if (person == pardon)
+ _vm->_scrolls.display("Give to whom?");
else if (personshere()) {
switch (thing) {
case _vm->_gyro.money :
@@ -1003,11 +1003,10 @@ void Acci::do_that() {
switch (person) {
case _vm->_gyro.pcrapulus:
switch (thing) {
- case _vm->_gyro.wine: {
+ case _vm->_gyro.wine:
_vm->_scrolls.display("Crapulus grabs the wine and gulps it down.");
_vm->_gyro.dna.obj[_vm->_gyro.wine] = false;
- }
- break;
+ break;
default:
heythanks();
}
@@ -1019,7 +1018,8 @@ void Acci::do_that() {
else */heythanks();
break;
case _vm->_gyro.pspludwick:
- if (give2spludwick()) heythanks();
+ if (give2spludwick())
+ heythanks();
break;
case _vm->_gyro.pibythneth:
if (thing == _vm->_gyro.badge) {
@@ -1030,7 +1030,8 @@ void Acci::do_that() {
_vm->_gyro.dna.givenbadgetoiby = true;
_vm->_celer.show_one(8);
_vm->_celer.show_one(9);
- } else heythanks();
+ } else
+ heythanks();
break;
case _vm->_gyro.payles:
if (_vm->_gyro.dna.ayles_is_awake) {
@@ -1041,20 +1042,20 @@ void Acci::do_that() {
_vm->_gyro.dna.given_pen_to_ayles = true;
_vm->_lucerna.objectlist();
_vm->_lucerna.points(2);
- } else heythanks();
+ } else
+ heythanks();
} else
_vm->_scrolls.display("But he's asleep!");
break;
case _vm->_gyro.pgeida:
switch (thing) {
- case _vm->_gyro.potion : {
+ case _vm->_gyro.potion:
_vm->_gyro.dna.obj[_vm->_gyro.potion] = false;
_vm->_visa.dixi('u', 16); /* She drinks it. */
_vm->_lucerna.points(2);
_vm->_gyro.dna.geida_given_potion = true;
_vm->_lucerna.objectlist();
- }
- break;
+ break;
case _vm->_gyro.lute:
give_geida_the_lute();
break;
@@ -1067,7 +1068,8 @@ void Acci::do_that() {
case _vm->_gyro.potion:
if (_vm->_gyro.dna.geida_given_potion)
winsequence();
- else _vm->_visa.dixi('q', 77);
+ else
+ _vm->_visa.dixi('q', 77);
break; /* That Geida woman! */
default:
heythanks();
@@ -1084,7 +1086,8 @@ void Acci::do_that() {
case vb_eat:
case vb_drink:
- if (holding()) swallow();
+ if (holding())
+ swallow();
break;
case vb_load:
_vm->_enid.edna_load(realwords[2]);
@@ -1104,20 +1107,21 @@ void Acci::do_that() {
case vb_break:
_vm->_scrolls.display("Vandalism is prohibited within this game!");
break;
- case vb_quit: { /* quit */
+ case vb_quit: /* quit */
//if (_vm->_gyro.demo) {
// _vm->_visa.dixi('q', 31);
// close(demofile);
// exit(0); /* Change this later!!! */
//}
- if (! polite) _vm->_scrolls.display("How about a `please\", Avvy?");
- else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?")) _vm->_gyro.lmo = true;
- }
- break;
+ if (!polite)
+ _vm->_scrolls.display("How about a `please\", Avvy?");
+ else if (_vm->_scrolls.ask("\23C\26Do you really want to quit?"))
+ _vm->_gyro.lmo = true;
+ break;
case vb_go:
_vm->_scrolls.display("Just use the arrow keys to walk there.");
break;
- case vb_info: {
+ case vb_info:
_vm->_scrolls.aboutscroll = true;
/* _vm->_scrolls.display('Thorsoft of Letchworth presents:'+^c+^m+^m+
'The medi‘val descendant of'+^m+
@@ -1131,10 +1135,10 @@ void Acci::do_that() {
'\15' + '\15' + "version " + _vm->_gyro.vernum + '\15' + '\15' + "Copyright ï "
+ _vm->_gyro.copyright + ", Mark, Mike and Thomas Thurman." + '\23' + 'Y' + '\26');
_vm->_scrolls.aboutscroll = false;
- }
- break;
+ break;
case vb_undress:
- if (_vm->_gyro.dna.wearing == nowt) _vm->_scrolls.display("You're already stark naked!");
+ if (_vm->_gyro.dna.wearing == nowt)
+ _vm->_scrolls.display("You're already stark naked!");
else if (_vm->_gyro.dna.avvys_in_the_cupboard) {
_vm->_scrolls.display(Common::String("You take off ") + _vm->_gyro.get_better(_vm->_gyro.dna.wearing) + '.');
_vm->_gyro.dna.wearing = nowt;
@@ -1150,7 +1154,7 @@ void Acci::do_that() {
_vm->_scrolls.display("Hey, what kind of a weirdo are you\??!");
break;
case _vm->_gyro.clothes:
- case _vm->_gyro.habit: { /* Change this! */
+ case _vm->_gyro.habit: /* Change this! */
if (_vm->_gyro.dna.wearing != nowt) {
if (_vm->_gyro.dna.wearing == thing)
_vm->_scrolls.display("You're already wearing that.");
@@ -1161,19 +1165,20 @@ void Acci::do_that() {
} else
_vm->_gyro.dna.wearing = thing;
_vm->_lucerna.objectlist();
- if (thing == _vm->_gyro.habit) fv = 3;
- else fv = 0;
- {
- if (_vm->_trip.tr[1].whichsprite != fv) {
- sx = _vm->_trip.tr[1].x;
- sy = _vm->_trip.tr[1].y;
- _vm->_trip.tr[1].done();
- _vm->_trip.tr[1].init(fv, true, &_vm->_trip);
- _vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
- _vm->_trip.tr[1].visible = false;
- }
+
+ if (thing == _vm->_gyro.habit)
+ fv = 3;
+ else
+ fv = 0;
+
+ if (_vm->_trip.tr[1].whichsprite != fv) {
+ sx = _vm->_trip.tr[1].x;
+ sy = _vm->_trip.tr[1].y;
+ _vm->_trip.tr[1].done();
+ _vm->_trip.tr[1].init(fv, true, &_vm->_trip);
+ _vm->_trip.tr[1].appear(sx, sy, _vm->_trip.left);
+ _vm->_trip.tr[1].visible = false;
}
- }
break;
default:
_vm->_scrolls.display(what);
@@ -1181,7 +1186,7 @@ void Acci::do_that() {
}
break;
case vb_play:
- if (thing == pardon)
+ if (thing == pardon) {
switch (_vm->_gyro.dna.room) { /* They just typed "play"... */
case r__argentpub:
// play_nim();
@@ -1191,21 +1196,27 @@ void Acci::do_that() {
play_harp();
break;
}
- else if (holding()) {
+ } else if (holding()) {
switch (thing) {
- case _vm->_gyro.lute : {
+ case _vm->_gyro.lute :
_vm->_visa.dixi('U', 7);
- if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room) _vm->_visa.dixi('U', 10);
- if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room) _vm->_visa.dixi('U', 15);
- }
- break;
- case 52 :
- if (_vm->_gyro.dna.room == r__musicroom) play_harp();
- else _vm->_scrolls.display(what);
+ if (_vm->_gyro.whereis[_vm->_gyro.pcwytalot] == _vm->_gyro.dna.room)
+ _vm->_visa.dixi('U', 10);
+
+ if (_vm->_gyro.whereis[_vm->_gyro.pdulustie] == _vm->_gyro.dna.room)
+ _vm->_visa.dixi('U', 15);
break;
- case 55 :
- if (_vm->_gyro.dna.room == r__argentpub) ; /*play_nim(); - Don't implement yet.*/
- else _vm->_scrolls.display(what);
+ case 52:
+ if (_vm->_gyro.dna.room == r__musicroom)
+ play_harp();
+ else
+ _vm->_scrolls.display(what);
+ break;
+ case 55:
+ if (_vm->_gyro.dna.room == r__argentpub)
+ ; /*play_nim(); - Don't implement yet.*/
+ else
+ _vm->_scrolls.display(what);
break;
default:
_vm->_scrolls.display(what);
@@ -1218,7 +1229,8 @@ void Acci::do_that() {
_vm->_scrolls.display("Ding, dong, ding, dong, ding, dong, ding, dong...");
if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
_vm->_scrolls.display("(Are you trying to join in, Avvy\?\?!)");
- } else _vm->_scrolls.display(what);
+ } else
+ _vm->_scrolls.display(what);
}
break;
case vb_help:
@@ -1239,13 +1251,13 @@ void Acci::do_that() {
if (_vm->_gyro.flagset('P')) {
_vm->_scrolls.display("Hmm, I don't think anyone will notice...");
_vm->_timeout.set_up_timer(4, _vm->_timeout.procurinate, _vm->_timeout.reason_gototoilet);
- } else _vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
+ } else
+ _vm->_scrolls.display("It would be \6VERY\22 unwise to do that here, Avvy!");
break;
- case vb_cheat: {
+ case vb_cheat:
_vm->_scrolls.display(Common::String('\6') + "Cheat mode now enabled.");
_vm->_gyro.cheat = true;
- }
- break;
+ break;
case vb_magic:
if (_vm->_gyro.dna.avaricius_talk > 0)
_vm->_visa.dixi('q', 19);
@@ -1264,14 +1276,15 @@ void Acci::do_that() {
_vm->_gyro.dna.avaricius_talk = 14;
_vm->_timeout.set_up_timer(177, _vm->_timeout.procavaricius_talks, _vm->_timeout.reason_avariciustalks);
}
- } else _vm->_scrolls.display("Nothing appears to happen...");
+ } else
+ _vm->_scrolls.display("Nothing appears to happen...");
}
break;
case vb_smartalec:
_vm->_scrolls.display("Listen, smart alec, that was just rhetoric.");
break;
- case vb_expletive: {
- switch ( _vm->_gyro.dna.swore) {
+ case vb_expletive:
+ switch (_vm->_gyro.dna.swore) {
case 0:
_vm->_scrolls.display(Common::String("Avvy! Do you mind? There might be kids playing!\r\r") +
"(I shouldn't say it again, if I were you!)");
@@ -1280,25 +1293,24 @@ void Acci::do_that() {
_vm->_scrolls.display(Common::String("You hear a distant rumble of thunder. Must you always ") +
"do things I tell you not to?\r\rDon't do it again!");
break;
- default: {
+ default:
_vm->_pingo.zonk();
_vm->_scrolls.display(Common::String("A crack of lightning shoots from the sky, ") +
"and fries you.\r\r(`Such is the anger of the gods, Avvy!\")");
_vm->_lucerna.gameover();
}
- }
- _vm->_gyro.dna.swore ++;
- }
- break;
+ _vm->_gyro.dna.swore++;
+ break;
case vb_listen:
if ((_vm->_gyro.dna.ringing_bells) & (_vm->_gyro.flagset('B')))
_vm->_scrolls.display(Common::String("All other noise is drowned out by the ringing of ") +
"the bells.");
else if (_vm->_gyro.listen == "")
_vm->_scrolls.display("You can't hear anything much at the moment, Avvy.");
- else _vm->_scrolls.display(_vm->_gyro.listen);
+ else
+ _vm->_scrolls.display(_vm->_gyro.listen);
break;
- case vb_buy: {
+ case vb_buy:
/* What are they trying to buy? */
switch (_vm->_gyro.dna.room) {
case r__argentpub:
@@ -1308,16 +1320,19 @@ void Acci::do_that() {
case '\63':
case '\65':
case '\66':
- case '\72': { /* Beer, whisky, cider or mead */
+ case '\72': /* Beer, whisky, cider or mead */
if (_vm->_gyro.dna.malagauche == 177) { /* Already getting us one. */
_vm->_visa.dixi('D', 15);
return;
}
+
if (_vm->_gyro.dna.teetotal) {
_vm->_visa.dixi('D', 6);
return;
}
- if (_vm->_gyro.dna.alcohol == 0) _vm->_lucerna.points(3);
+
+ if (_vm->_gyro.dna.alcohol == 0)
+ _vm->_lucerna.points(3);
_vm->_celer.show_one(12);
_vm->_scrolls.display(booze[thing] + ", please.\231\2");
_vm->_gyro.dna.drinking = thing;
@@ -1325,8 +1340,7 @@ void Acci::do_that() {
_vm->_celer.show_one(10);
_vm->_gyro.dna.malagauche = 177;
_vm->_timeout.set_up_timer(27, _vm->_timeout.procbuydrinks, _vm->_timeout.reason_drinks);
- }
- break;
+ break;
case '\64':
examine();
break; /* We have a right one here- buy Pepsi??! */
@@ -1338,13 +1352,16 @@ void Acci::do_that() {
_vm->_visa.dixi('D', 15);
return;
}
+
if (_vm->_gyro.dna.carrying >= maxobjs) {
_vm->_scrolls.display("Your hands are full.");
return;
}
+
_vm->_celer.show_one(12);
_vm->_scrolls.display("Wine, please.\231\2");
- if (_vm->_gyro.dna.alcohol == 0) _vm->_lucerna.points(3);
+ if (_vm->_gyro.dna.alcohol == 0)
+ _vm->_lucerna.points(3);
_vm->_celer.show_one(10);
_vm->_gyro.dna.malagauche = 177;
@@ -1352,7 +1369,8 @@ void Acci::do_that() {
}
break;
}
- } else _vm->_visa.dixi('D', 5);
+ } else
+ _vm->_visa.dixi('D', 5);
break; /* Go to the bar! */
case r__outsideducks:
@@ -1376,8 +1394,10 @@ void Acci::do_that() {
_vm->_gyro.dna.rotten_onion = false; /* It's OK when it leaves the stall! */
_vm->_gyro.dna.onion_in_vinegar = false;
}
- } else _vm->_visa.dixi('D', 0);
- } else _vm->_visa.dixi('D', 0);
+ } else
+ _vm->_visa.dixi('D', 0);
+ } else
+ _vm->_visa.dixi('D', 0);
break;
case r__nottspub:
@@ -1386,20 +1406,18 @@ void Acci::do_that() {
default:
_vm->_visa.dixi('D', 0); /* Can't buy that. */
}
- }
- break;
- case vb_attack: {
+ break;
+ case vb_attack:
if ((_vm->_gyro.dna.room == r__brummieroad) &&
((person == '\235') || (thing == _vm->_gyro.crossbow) || (thing == _vm->_gyro.bolt))
&& (_vm->_gyro.whereis['\235'] == _vm->_gyro.dna.room)) {
switch (_vm->_gyro.dna.obj[_vm->_gyro.bolt] + _vm->_gyro.dna.obj[_vm->_gyro.crossbow] * 2) {
/* 0 = neither, 1 = only bolt, 2 = only crossbow,
3 = both. */
- case 0: {
+ case 0:
_vm->_visa.dixi('Q', 10);
_vm->_scrolls.display("(At the very least, don't use your bare hands!)");
- }
- break;
+ break;
case 1:
_vm->_scrolls.display(Common::String("Attack _vm->_gyro.him with only a crossbow bolt? Are you ") +
"planning on playing darts?!");
@@ -1408,7 +1426,7 @@ void Acci::do_that() {
_vm->_scrolls.display(Common::String("Come on, Avvy! You're not going to get very far ") +
"with only a crossbow!");
break;
- case 3: {
+ case 3:
_vm->_visa.dixi('Q', 11);
_vm->_gyro.dna.cwytalot_gone = true;
_vm->_gyro.dna.obj[_vm->_gyro.bolt] = false;
@@ -1420,26 +1438,27 @@ void Acci::do_that() {
_vm->_trip.tr[2].vanishifstill = true;
_vm->_trip.tr[2].call_eachstep = false;
_vm->_gyro.whereis['\235'] = 177;
- }
- break;
+ break;
default:
_vm->_visa.dixi('Q', 10); /* Please try not to be so violent! */
}
- } else _vm->_visa.dixi('Q', 10);
- }
- break;
+ } else
+ _vm->_visa.dixi('Q', 10);
+ break;
case vb_password:
if (_vm->_gyro.dna.room != r__bridge)
_vm->_visa.dixi('Q', 12);
else {
ok = true;
- for (ff = 1; ff <= thats.size(); ff ++)
- for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv ++) {
+ for (ff = 1; ff <= thats.size(); ff++) {
+ for (fv = 1; fv <= words[_vm->_gyro.dna.pass_num + first_password].w.size(); fv++) {
Common::String temp = realwords[ff];
temp.toUppercase();
if (words[_vm->_gyro.dna.pass_num + first_password].w[fv] != temp[fv])
ok = false;
}
+ }
+
if (ok) {
if (_vm->_gyro.dna.drawbridge_open != 0)
_vm->_scrolls.display("Contrary to your expectations, the drawbridge fails to close again.");
@@ -1449,7 +1468,8 @@ void Acci::do_that() {
_vm->_timeout.set_up_timer(7, _vm->_timeout.procopen_drawbridge, _vm->_timeout.reason_drawbridgefalls);
_vm->_gyro.dna.drawbridge_open = 1;
}
- } else _vm->_visa.dixi('Q', 12);
+ } else
+ _vm->_visa.dixi('Q', 12);
}
break;
case vb_dir:
@@ -1473,7 +1493,7 @@ void Acci::do_that() {
case vb_kiss:
if (person == pardon)
_vm->_scrolls.display("Kiss whom?");
- else if (personshere())
+ else if (personshere()) {
switch (person) {
case _vm->_gyro.parkata:
_vm->_visa.dixi('U', 12);
@@ -1487,22 +1507,22 @@ void Acci::do_that() {
default:
_vm->_visa.dixi('U', 5); /* You WHAT? */
}
- else if ((150 <= person) && (person <= 174))
+ } else if ((150 <= person) && (person <= 174))
_vm->_scrolls.display("Hey, what kind of a weirdo are you??");
break;
case vb_climb:
- if (_vm->_gyro.dna.room == r__insidecardiffcastle) cardiff_climbing();
+ if (_vm->_gyro.dna.room == r__insidecardiffcastle)
+ cardiff_climbing();
else /* In the wrong room! */
_vm->_scrolls.display("Not with your head for heights, Avvy!");
break;
- case vb_jump: {
+ case vb_jump:
_vm->_timeout.set_up_timer(1, _vm->_timeout.procjump, _vm->_timeout.reason_jumping);
_vm->_gyro.dna.user_moves_avvy = false;
- }
- break;
+ break;
case vb_highscores:
// show_highs();
@@ -1515,16 +1535,19 @@ void Acci::do_that() {
case pardon:
case _vm->_gyro.pavalot:
case '\0':
- if (! _vm->_gyro.dna.avvy_is_awake) {
+ if (!_vm->_gyro.dna.avvy_is_awake) {
_vm->_gyro.dna.avvy_is_awake = true;
_vm->_lucerna.points(1);
_vm->_gyro.dna.avvy_in_bed = true;
_vm->_celer.show_one(3); /* Picture of Avvy, awake in bed. */
- if (_vm->_gyro.dna.teetotal) _vm->_visa.dixi('d', 13);
- } else _vm->_scrolls.display("You're already awake, Avvy!");
+ if (_vm->_gyro.dna.teetotal)
+ _vm->_visa.dixi('d', 13);
+ } else
+ _vm->_scrolls.display("You're already awake, Avvy!");
break;
case _vm->_gyro.payles:
- if (! _vm->_gyro.dna.ayles_is_awake) _vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
+ if (!_vm->_gyro.dna.ayles_is_awake)
+ _vm->_scrolls.display("You can't seem to wake _vm->_gyro.him by yourself.");
break;
case _vm->_gyro.pjacques:
_vm->_scrolls.display(Common::String("Brother Jacques, Brother Jacques, are you asleep?\231\2") +
@@ -1564,59 +1587,49 @@ void Acci::do_that() {
_vm->_scrolls.display("Hey, a verb would be helpful!");
break;
- case vb_hello: {
+ case vb_hello:
person_speaks();
_vm->_scrolls.display("Hello.\2");
- }
- break;
- case vb_thanks: {
+ break;
+ case vb_thanks:
person_speaks();
_vm->_scrolls.display("That's OK.\2");
- }
- break;
+ break;
default:
_vm->_scrolls.display(Common::String('\7') + "Parser bug!");
}
- }
}
void Acci::verbopt(char n, Common::String &answer, char &anskey) {
switch (n) {
- case vb_exam: {
+ case vb_exam:
answer = "Examine";
anskey = 'x';
- }
- break; /* the ubiqutous one */
- /* vb_give isn't dealt with by this procedure, but by ddm__with */
- case vb_drink: {
+ break; /* the ubiqutous one */
+ /* vb_give isn't dealt with by this procedure, but by ddm__with */
+ case vb_drink:
answer = "Drink";
anskey = 'D';
- }
- break;
- case vb_wear: {
+ break;
+ case vb_wear:
answer = "Wear";
anskey = 'W';
- }
- break;
- case vb_ring: {
+ break;
+ case vb_ring:
answer = "Ring";
anskey = 'R';
- }
- break; /* only the bell! */
- case vb_play: {
+ break; /* only the bell! */
+ case vb_play:
answer = "Play";
anskey = 'P';
- }
- break;
- case vb_eat: {
+ break;
+ case vb_eat:
answer = "Eat";
anskey = 'E';
- }
- break;
- default: {
+ break;
+ default:
answer = "? Unknown!"; /* Bug! */
anskey = '?';
- }
}
}
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 240c7b68ae..62cb5fbe99 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -251,7 +251,7 @@ namespace Avalanche {
zoomy = false;
// Call the menu by default. Might be modified later, if get_slope() gets implemented,
// becouse zoomy's value is given there. Not sure yet what "zoomy" stands for.
- if (! zoomy)
+ if (!zoomy)
call_menu(); /* Not run when zoomy. */
do {
diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp
index 4296f36f70..c02a82f6f0 100644
--- a/engines/avalanche/celer2.cpp
+++ b/engines/avalanche/celer2.cpp
@@ -61,7 +61,7 @@ void Celer::pics_link() {
case r__outsideargentpub:
if ((_vm->_gyro.roomtime % int32(12)) == 0)
show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4));
- break;
+ break;
case r__brummieroad:
if ((_vm->_gyro.roomtime % int32(2)) == 0)
@@ -74,7 +74,7 @@ void Celer::pics_link() {
break;
case r__yours:
- if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
+ if ((!_vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0))
show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2));
break;
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp
index c247012256..c86660e46e 100644
--- a/engines/avalanche/gyro2.cpp
+++ b/engines/avalanche/gyro2.cpp
@@ -493,7 +493,7 @@ void Gyro::background(byte x) {
void Gyro::hang_around_for_a_while() {
byte fv;
- for (fv = 1; fv <= 28; fv ++)
+ for (fv = 1; fv <= 28; fv++)
slowdown();
}
diff --git a/engines/avalanche/logger2.cpp b/engines/avalanche/logger2.cpp
index 08981f5d20..c709e686e9 100644
--- a/engines/avalanche/logger2.cpp
+++ b/engines/avalanche/logger2.cpp
@@ -82,13 +82,12 @@ void Logger::setParent(AvalancheEngine *vm) {
void Logger::centre(byte size, byte x) { /* Prints req'd number of spaces. */
byte fv;
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::centre()");
- /*for (fv = 1; fv <= size - (x / 2);
- fv ++)
- output << logfile << ' ';*/
+ /*for (fv = 1; fv <= size - (x / 2); fv++)
+ output << logfile << ' ';*/
}
void Logger::log_setup(Common::String name, bool printing) { /* Sets up. */
@@ -101,43 +100,48 @@ void Logger::log_setup(Common::String name, bool printing) { /* Sets up. */
log_epson = printing;
logging = true;
- if (! printing) {
- quote = '"';
- unquote = '"';
- copyright = "(c)";
+ if (!printing) {
+ quote = '"';
+ unquote = '"';
+ copyright = "(c)";
}*/
}
void Logger::log_divider() { /* Prints the divider sign. */
byte fv;
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_divider()");
- /*if (_vm->_gyro.log_epson) {
- output << logfile << Common::String(' ') + double_width;
- for (fv = 1; fv <= divide_indent; fv ++) output << logfile << ' ';
- output << logfile << Common::String(' ') + double_off;
- } else
- for (fv = 1; fv <= 36; fv ++) output << logfile << ' ';
- output << logfile << divide << NL;*/
+ /*
+ if (_vm->_gyro.log_epson) {
+ output << logfile << Common::String(' ') + double_width;
+ for (fv = 1; fv <= divide_indent; fv++)
+ output << logfile << ' ';
+ output << logfile << Common::String(' ') + double_off;
+ } else {
+ for (fv = 1; fv <= 36; fv++)
+ output << logfile << ' ';
+ }
+ output << logfile << divide << NL;
+ */
}
void Logger::log_command(Common::String x) { /* Prints a command */
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_command()");
/*if (_vm->_gyro.log_epson)
- output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
+ output << logfile << double_width + '>' + double_off + ' ' + italic + x + italic_off << NL;
else
- output << logfile << Common::String("> ") + x << NL;*/
+ output << logfile << Common::String("> ") + x << NL;*/
}
void Logger::log_addstuff(Common::String x) {
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
scroll_line += x;
@@ -145,7 +149,7 @@ void Logger::log_addstuff(Common::String x) {
void Logger::log_scrollchar(Common::String x) { /* print one character */
Common::String z;
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
switch (x[1]) {
@@ -166,7 +170,7 @@ void Logger::log_scrollchar(Common::String x) { /* print one character */
}
void Logger::log_italic() {
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_italic()");
@@ -178,7 +182,7 @@ void Logger::log_italic() {
}
void Logger::log_roman() {
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_roman()");
@@ -190,7 +194,7 @@ void Logger::log_roman() {
}
void Logger::log_epsonroman() { /* This only sends the Roman code if you're on Epson.*/
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_epsonroman()");
@@ -206,29 +210,32 @@ void Logger::log_scrollline() { /* Set up a line for the scroll driver */
void Logger::log_scrollendline(bool centred) {
byte x, fv;
- if (! _vm->_gyro.logging) return;
+ if (!_vm->_gyro.logging)
+ return;
x = 17;
- if (centred) x += (50 - scroll_line_length) / 2;
+ if (centred)
+ x += (50 - scroll_line_length) / 2;
warning("STUB: Logger::log_scrollendline()");
- /*for (fv = 1; fv <= x; fv ++)
+ /*for (fv = 1; fv <= x; fv++)
output << logfile << ' ';
output << logfile << scroll_line << NL;*/
}
void Logger::log_bubbleline(byte linenum, byte whom, Common::String x) {
byte fv;
- if (! _vm->_gyro.logging) return;
+ if (!_vm->_gyro.logging)
+ return;
warning("STUB: Logger::log_bubbleline()");
/*if (linenum == 1) {
- for (fv = 1; fv <= 15; fv ++)
+ for (fv = 1; fv <= 15; fv++)
output << logfile << ' ';
output << logfile << italic + tr[whom].a.name + ": " + italic_off + x << NL;
} else {
- for (fv = 1; fv <= 17; fv ++)
+ for (fv = 1; fv <= 17; fv++)
output << logfile << ' ';
output << logfile << x << NL;
}*/
@@ -243,11 +250,12 @@ void Logger::log_newline() {
void Logger::log_newroom(Common::String where) {
byte fv;
- if (! _vm->_gyro.logging) return;
+ if (!_vm->_gyro.logging)
+ return;
warning("STUB: Logger::log_newroom()");
- /*for (fv = 1; fv <= 20; fv ++)
+ /*for (fv = 1; fv <= 20; fv++)
output << logfile << ' ';
if (_vm->_gyro.log_epson)
output << logfile << emph_on;
@@ -259,7 +267,7 @@ void Logger::log_newroom(Common::String where) {
void Logger::log_aside(Common::String what) {
/* This writes "asides" to the printer. For example, moves in Nim. */
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_aside()");
@@ -270,12 +278,12 @@ void Logger::log_aside(Common::String what) {
void Logger::log_score(uint16 credit, uint16 now) {
byte fv;
- if (! _vm->_gyro.logging)
+ if (!_vm->_gyro.logging)
return;
warning("STUB: Logger::log_score()");
- /*for (fv = 1; fv <= 50; fv ++)
+ /*for (fv = 1; fv <= 50; fv++)
output << logfile << ' ';
output << logfile << "Score " << italic << "credit : " << credit << italic_off << " total : " << now << NL;*/
}
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index aeb952c4a5..74b7158afc 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -83,7 +83,7 @@ void Scrolls::state(byte x) { /* Sets "Ready" light to whatever */
_vm->_gyro.super_off();
- /* for (page_ = 0; page_ <= 1; page_ ++) {
+ /* for (page_ = 0; page_ <= 1; page_++) {
setactivepage(page_);
bar(419, 195, 438, 197);
}*/
@@ -98,8 +98,8 @@ void Scrolls::easteregg() {
warning("STUB: Scrolls::easteregg(). Calls of Pascal units need to be removed.");
/* background(15);
- for (fv = 4; fv <= 100; fv ++) {
- for (ff = 0; ff <= 70; ff ++) {
+ for (fv = 4; fv <= 100; fv++) {
+ for (ff = 0; ff <= 70; ff++) {
sound(fv * 100 + ff * 10);
delay(1);
}
@@ -128,23 +128,22 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
ox = 0;
_vm->_logger.log_scrollline();
- for (xx = 1; xx <= lz; xx ++) {
+ for (xx = 1; xx <= lz; xx++) {
switch (z[xx]) {
- case '\22': {
+ case '\22':
cfont = roman;
_vm->_logger.log_roman();
- }
- break;
- case '\6': {
+ break;
+ case '\6':
cfont = italic;
_vm->_logger.log_italic();
- }
- break;
- default: {
+ break;
+ default:
ox += 1;
- for (yy = 1; yy <= 12; yy ++) itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
+ for (yy = 1; yy <= 12; yy++)
+ itw[yy][ox] = ~ ch[cfont][z[xx]][yy + 1];
_vm->_logger.log_scrollchar(Common::String(z[xx]));
- }
+ break;
}
}
@@ -152,10 +151,10 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
if (offset) {
/* offsetting routine */
lz += 1;
- for (yy = 1; yy <= 12; yy ++) {
+ for (yy = 1; yy <= 12; yy++) {
bit = 240;
itw[yy][lz] = 255;
- for (xx = 1; xx <= lz; xx ++) {
+ for (xx = 1; xx <= lz; xx++) {
t = itw[yy][xx];
itw[yy][xx] = bit + t / 16;
bit = t << 4;
@@ -163,9 +162,9 @@ void Scrolls::say(int16 x, int16 y, Common::String z) { /* Fancy FAST screenwrit
}
}
yp = x + y * 80 + (1 - _vm->_gyro.cp) * _vm->_gyro.pagetop;
- for (yy = 1; yy <= 12; yy ++) {
+ for (yy = 1; yy <= 12; yy++) {
yp += 80;
- for (bit = 0; bit <= locol; bit ++) {
+ for (bit = 0; bit <= locol; bit++) {
/*port[0x3c4] = 2;
port[0x3ce] = 4;
port[0x3c5] = 1 << bit;
@@ -190,23 +189,18 @@ void Scrolls::dialogue() {
warning("STUB: Scrolls::dialogue()");
}
-
-
-
void Scrolls::store_(byte what, tunetype &played) {
memcpy(played, played+1, sizeof(played) - 1);
played[30] = what;
}
-
-
bool Scrolls::they_match(tunetype &played) {
byte fv, mistakes;
bool they_match_result;
mistakes = 0;
- for (fv = 1; fv <= sizeof(played); fv ++)
+ for (fv = 1; fv <= sizeof(played); fv++)
if (played[fv] != Gyro::tune[fv])
mistakes++;
@@ -243,13 +237,4 @@ void Scrolls::music_scroll() {
}
-
-
-
-
-
-
-
-
-
} // End of namespace Avalanche
diff --git a/engines/avalanche/sequence2.cpp b/engines/avalanche/sequence2.cpp
index 38d46d86c9..f3ba72ad62 100644
--- a/engines/avalanche/sequence2.cpp
+++ b/engines/avalanche/sequence2.cpp
@@ -55,11 +55,12 @@ void Sequence::first_show(byte what) {
void Sequence::then_show(byte what) {
byte fv;
- for (fv = 1; fv <= seq_length; fv ++)
+ for (fv = 1; fv <= seq_length; fv++) {
if (seq[fv] == 0) {
seq[fv] = what;
return;
}
+ }
}
void Sequence::then_flip(byte where, byte ped) {
diff --git a/engines/avalanche/timeout2.cpp b/engines/avalanche/timeout2.cpp
index 6bdfcde1f8..623bb75e30 100644
--- a/engines/avalanche/timeout2.cpp
+++ b/engines/avalanche/timeout2.cpp
@@ -76,7 +76,7 @@ void Timeout::one_tick() {
if (_vm->_gyro.ddmnow)
return;
- for (fv = 1; fv <= 7; fv ++) {
+ for (fv = 1; fv <= 7; fv++) {
timetype &with = times[fv];
if (with.time_left > 0) {
with.time_left -= 1;
@@ -217,7 +217,7 @@ void Timeout::one_tick() {
void Timeout::lose_timer(byte which) {
byte fv;
- for (fv = 1; fv <= 7; fv ++) {
+ for (fv = 1; fv <= 7; fv++) {
timetype &with = times[fv];
if (with.what_for == which)
with.time_left = 0;
@@ -240,7 +240,7 @@ end;*/
/* Timeout procedures: */
void Timeout::open_drawbridge() {
- _vm->_gyro.dna.drawbridge_open ++;
+ _vm->_gyro.dna.drawbridge_open++;
_vm->_celer.show_one(_vm->_gyro.dna.drawbridge_open - 1);
if (_vm->_gyro.dna.drawbridge_open == 4)
@@ -253,7 +253,7 @@ void Timeout::open_drawbridge() {
void Timeout::avaricius_talks() {
_vm->_visa.dixi('q', _vm->_gyro.dna.avaricius_talk);
- _vm->_gyro.dna.avaricius_talk ++;
+ _vm->_gyro.dna.avaricius_talk++;
if (_vm->_gyro.dna.avaricius_talk < 17)
set_up_timer(177, procavaricius_talks, reason_avariciustalks);
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index 7591c5c032..151e93f444 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -85,7 +85,7 @@ bool triptype::collision_check() {
byte fv;
bool collision_check_result = false;
- for (fv = 1; fv <= _tr->numtr; fv ++) {
+ for (fv = 1; fv <= _tr->numtr; fv++) {
if (_tr->tr[fv].quick && (_tr->tr[fv].whichsprite != whichsprite) &&
((x + a.xl) > _tr->tr[fv].x) &&
(x < (_tr->tr[fv].x + _tr->tr[fv].a.xl)) &&
@@ -93,7 +93,8 @@ bool triptype::collision_check() {
collision_check_result = true;
break;
}
- // CHECKME: Only checks the first element of the for() statement
+ // CHECKME: Only checks the first element of the for() statement.
+ // Both lines should certainly be removed
collision_check_result = false;
return collision_check_result;
}
@@ -276,8 +277,8 @@ triptype *triptype::done() {
xw = with.xl / 8;
if ((with.xl % 8) > 0)
xw += 1;
- for (aa = 1; aa <= /*nds*seq*/ with.num; aa ++) {
- totalnum --;
+ for (aa = 1; aa <= /*nds*seq*/ with.num; aa++) {
+ totalnum--;
free(mani[totalnum]);
free(sil[totalnum]); /* <<- Width of a siltype. */
}
@@ -293,14 +294,14 @@ getsettype *getsettype::init() {
}
void getsettype::remember(bytefield r) {
- numleft ++;
+ numleft++;
warning("STUB: _vm->_timeout.getsettype::remember()");
gs[numleft] = r;
}
void getsettype::recall(bytefield &r) {
r = gs[numleft];
- numleft --;
+ numleft--;
}
Trip::Trip() {
@@ -396,7 +397,7 @@ void Trip::catamove(byte ped) {
return;
}
- if (! _vm->_gyro.dna.enter_catacombs_from_lusties_room)
+ if (!_vm->_gyro.dna.enter_catacombs_from_lusties_room)
_vm->_lucerna.load(29);
here = _vm->_gyro.catamap[_vm->_gyro.dna.cat_y][_vm->_gyro.dna.cat_x];
@@ -531,7 +532,8 @@ void Trip::catamove(byte ped) {
if ((xy_uint16 == 2051) & (_vm->_gyro.dna.geida_follows))
_vm->_gyro.magics[13].op = _vm->_gyro.exclaim;
- else _vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
+ else
+ _vm->_gyro.magics[13].op = _vm->_gyro.special; /* Right exit south. */
_vm->_gyro.magics[7].op = _vm->_gyro.bounces;
_vm->_gyro.magics[12].op = _vm->_gyro.bounces;
@@ -637,13 +639,13 @@ void Trip::catamove(byte ped) {
_vm->_celer.show_one(2);
break; /* [5,7] : "Ite Mingite" sign. */
case 258:
- for (fv = 0; fv <= 2; fv ++) { /* [2,1] : Art gallery - pictures */
+ for (fv = 0; fv <= 2; fv++) { /* [2,1] : Art gallery - pictures */
_vm->_celer.show_one_at(15, 130 + fv * 120, 70);
_vm->_celer.show_one_at(16, 184 + fv * 120, 78);
}
break;
case 1287:
- for (fv = 10; fv <= 13; fv ++)
+ for (fv = 10; fv <= 13; fv++)
_vm->_celer.show_one(fv);
break; /* [7,5] : 4 candles. */
case 776:
@@ -661,7 +663,7 @@ void Trip::catamove(byte ped) {
if ((_vm->_gyro.dna.geida_follows) & (ped > 0)) {
triptype &with = tr[2];
- if (! with.quick) /* If we don't already have her... */
+ if (!with.quick) /* If we don't already have her... */
tr[2].init(5, true, this); /* ...Load Geida. */
apped(2, geida_ped(ped));
tr[2].call_eachstep = true;
@@ -699,7 +701,7 @@ void Trip::call_special(uint16 which) {
case 3: /* _vm->_gyro.special 3: Room 71: triggers dart. */
tr[1].bounce(); /* Must include that. */
- if (! _vm->_gyro.dna.arrow_triggered) {
+ if (!_vm->_gyro.dna.arrow_triggered) {
_vm->_gyro.dna.arrow_triggered = true;
apped(2, 4); /* The dart starts at ped 4, and... */
tr[2].walkto(5); /* flies to ped 5. */
@@ -754,7 +756,7 @@ void Trip::call_special(uint16 which) {
_vm->_timeout.set_up_timer(200, _vm->_timeout.procmeet_avaroid, _vm->_timeout.reason_meeting_avaroid);
break;
case 8: /* _vm->_gyro.special 8: leave du Lustie's room. */
- if ((_vm->_gyro.dna.geida_follows) && (! _vm->_gyro.dna.lustie_is_asleep)) {
+ if ((_vm->_gyro.dna.geida_follows) && (!_vm->_gyro.dna.lustie_is_asleep)) {
_vm->_visa.dixi('q', 63);
tr[2].turn(down);
tr[2].stopwalk();
@@ -763,7 +765,7 @@ void Trip::call_special(uint16 which) {
}
break;
case 9: /* _vm->_gyro.special 9: lose Geida to Robin Hood... */
- if (! _vm->_gyro.dna.geida_follows)
+ if (!_vm->_gyro.dna.geida_follows)
return; /* DOESN'T COUNT: no Geida. */
tr[2].call_eachstep = false; /* She no longer follows Avvy around. */
tr[2].walkto(4); /* She walks to somewhere... */
@@ -960,18 +962,24 @@ void Trip::getback() {
while (getset[1 - _vm->_gyro.cp].numleft > 0) {
getset[1 - _vm->_gyro.cp].recall(r);
- /* if overlaps_with_mouse and not endangered then
+ /*
+ if overlaps_with_mouse and not endangered then
begin
endangered:=true;
blitfix;
Super_Off;
- end;*/
+ end;
+ */
_vm->_lucerna.mblit(r.x1, r.y1, r.x2, r.y2, 3, 1 - _vm->_gyro.cp);
}
_vm->_lucerna.blitfix();
- /*if endangered then*/ /*Super_On;*/
+
+ /*
+ if endangered then
+ Super_On;
+ */
}
/* Eachstep procedures: */
@@ -997,7 +1005,7 @@ void Trip::follow_avvy_y(byte tripnum) {
}
void Trip::back_and_forth(byte tripnum) {
- if (! tr[tripnum].homing) {
+ if (!tr[tripnum].homing) {
if (tr[tripnum].face == right)
tr[tripnum].walkto(4);
else
@@ -1006,7 +1014,7 @@ void Trip::back_and_forth(byte tripnum) {
}
void Trip::face_avvy(byte tripnum) {
- if (! tr[tripnum].homing) {
+ if (!tr[tripnum].homing) {
if (tr[1].x >= tr[tripnum].x)
tr[tripnum].face = right;
else
@@ -1165,14 +1173,14 @@ void Trip::call_andexors() {
for (int i = 0; i < 5; i++)
order[i] = 0;
- for (fv = 1; fv <= numtr; fv ++) {
+ for (fv = 1; fv <= numtr; fv++) {
if (tr[fv].quick && tr[fv].visible)
order[fv] = fv;
}
do {
ok = true;
- for (fv = 1; fv <= 4; fv ++) {
+ for (fv = 1; fv <= 4; fv++) {
if (((order[fv] != 0) && (order[fv + 1] != 0))
&& (tr[order[fv]].y > tr[order[fv + 1]].y)) {
/* Swap them! */
@@ -1184,7 +1192,7 @@ void Trip::call_andexors() {
}
} while (!ok);
- for (fv = 1; fv <= 5; fv ++) {
+ for (fv = 1; fv <= 5; fv++) {
if (order[fv] > 0)
tr[order[fv]].andexor();
}
@@ -1195,13 +1203,13 @@ void Trip::trippancy_link() {
if (_vm->_gyro.ddmnow | _vm->_gyro.ontoolbar | _vm->_gyro.seescroll)
return;
- for (fv = 1; fv <= numtr; fv ++) {
+ for (fv = 1; fv <= numtr; fv++) {
if (tr[fv].quick)
tr[fv].walk();
}
call_andexors();
- for (fv = 1; fv <= numtr; fv ++) {
+ for (fv = 1; fv <= numtr; fv++) {
triptype &with = tr[fv];
if (with.quick && with.call_eachstep) {
switch (tr[fv].eachstep) {
@@ -1237,9 +1245,11 @@ void Trip::get_back_loretta() {
byte fv;
/* for fv:=1 to numtr do with tr[fv] do if quick then getback;*/
- for (fv = 1; fv <= numtr; fv ++) if (tr[fv].quick) {
- getback();
- return;
+ for (fv = 1; fv <= numtr; fv++) {
+ if (tr[fv].quick) {
+ getback();
+ return;
+ }
}
/* for fv:=0 to 1 do begin cp:=1-cp; getback; end;*/
}
@@ -1252,7 +1262,7 @@ void Trip::stopwalking() {
}
void Trip::tripkey(char dir) {
- if ((_vm->_gyro.ctrl == cjoy) | (! _vm->_gyro.dna.user_moves_avvy))
+ if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
return;
triptype &with = tr[1];
@@ -1325,7 +1335,7 @@ void Trip::readstick() {
}
void Trip::getsetclear() {
- for (byte fv = 0; fv <= 1; fv ++)
+ for (byte fv = 0; fv <= 1; fv++)
getset[fv].init();
}
@@ -1370,7 +1380,7 @@ void Trip::tidy_after_mouse() {
void Trip::fliproom(byte room, byte ped) {
byte fv;
- if (! _vm->_gyro.alive) {
+ if (!_vm->_gyro.alive) {
/* You can't leave the room if you're dead. */
tr[1].ix = 0;
tr[1].iy = 0; /* Stop him from moving. */
@@ -1397,7 +1407,7 @@ void Trip::fliproom(byte room, byte ped) {
getsetclear();
- for (fv = 2; fv <= numtr; fv ++) {
+ for (fv = 2; fv <= numtr; fv++) {
if (tr[fv].quick)
tr[fv].done();
} /* Deallocate sprite */
@@ -1412,7 +1422,7 @@ void Trip::fliproom(byte room, byte ped) {
_vm->_gyro.dna.rw = tr[1].face;
_vm->_lucerna.showrw();
- for (fv = 0; fv <= 1; fv ++) {
+ for (fv = 0; fv <= 1; fv++) {
_vm->_gyro.cp = 1 - _vm->_gyro.cp;
getback();
}
@@ -1447,7 +1457,7 @@ bool Trip::neardoor() { /* returns True if you're near a door! */
uy = tr[1].y + tr[1].a.yl;
nd = false;
- for (fv = 9; fv <= _vm->_gyro.numfields; fv ++) {
+ for (fv = 9; fv <= _vm->_gyro.numfields; fv++) {
_vm->_gyro.fields[fv];
if ((ux >= _vm->_gyro.fields[fv].x1) && (ux <= _vm->_gyro.fields[fv].x2)