AVALANCHE: Rename Timeout into Timer

This commit is contained in:
Strangerke 2013-09-08 11:30:23 +02:00
parent 1b25defe34
commit f42f29d8f8
14 changed files with 113 additions and 113 deletions

View file

@ -34,7 +34,7 @@
#include "avalanche/lucerna2.h" #include "avalanche/lucerna2.h"
#include "avalanche/scrolls2.h" #include "avalanche/scrolls2.h"
#include "avalanche/visa2.h" #include "avalanche/visa2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
#include "avalanche/enid2.h" #include "avalanche/enid2.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
@ -379,7 +379,7 @@ void Acci::storeInterrogation(byte interrogation) {
while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty())) while ((_vm->_parser->_inputText.lastChar() == ' ') && (!_vm->_parser->_inputText.empty()))
_vm->_parser->_inputText.deleteLastChar(); _vm->_parser->_inputText.deleteLastChar();
_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement. _vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey); // If you want to use any other timer, put this into the case statement.
switch (interrogation) { switch (interrogation) {
case 1: case 1:
@ -419,7 +419,7 @@ void Acci::storeInterrogation(byte interrogation) {
} }
if (interrogation < 4) if (interrogation < 4)
_vm->_timeout->cardiffSurvey(); _vm->_timer->cardiffSurvey();
} }
@ -1041,7 +1041,7 @@ void Acci::notInOrder() {
void Acci::goToCauldron() { void Acci::goToCauldron() {
_vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs. _vm->_animation->tr[1]._callEachStepFl = false; // Stops Geida_Procs.
_vm->_timeout->addTimer(1, _vm->_timeout->kProcSpludwickGoesToCauldron, _vm->_timeout->kReasonSpludWalk); _vm->_timer->addTimer(1, _vm->_timer->kProcSpludwickGoesToCauldron, _vm->_timer->kReasonSpludWalk);
_vm->_animation->tr[1].walkto(2); _vm->_animation->tr[1].walkto(2);
} }
@ -1143,7 +1143,7 @@ void Acci::standUp() {
_vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow. _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow.
_vm->_lucerna->incScore(1); _vm->_lucerna->incScore(1);
_vm->_gyro->_dna._avvyInBed = false; _vm->_gyro->_dna._avvyInBed = false;
_vm->_timeout->loseTimer(_vm->_timeout->kReasonArkataShouts); _vm->_timer->loseTimer(_vm->_timer->kReasonArkataShouts);
} else } else
already(); already();
break; break;
@ -1242,7 +1242,7 @@ void Acci::giveGeidaTheLute() {
_vm->_lucerna->refreshObjectList(); _vm->_lucerna->refreshObjectList();
_vm->_visa->displayScrollChain('q', 64); // She plays it. _vm->_visa->displayScrollChain('q', 64); // She plays it.
_vm->_timeout->addTimer(1, _vm->_timeout->kProcGiveLuteToGeida, _vm->_timeout->kReasonGeidaSings); _vm->_timer->addTimer(1, _vm->_timer->kProcGiveLuteToGeida, _vm->_timer->kReasonGeidaSings);
_vm->_enid->backToBootstrap(4); _vm->_enid->backToBootstrap(4);
} }
@ -1259,7 +1259,7 @@ void Acci::winSequence() {
_vm->_sequence->thenShow(8); _vm->_sequence->thenShow(8);
_vm->_sequence->thenShow(9); _vm->_sequence->thenShow(9);
_vm->_sequence->startToClose(); _vm->_sequence->startToClose();
_vm->_timeout->addTimer(30, _vm->_timeout->kProcWinning, _vm->_timeout->kReasonWinning); _vm->_timer->addTimer(30, _vm->_timer->kProcWinning, _vm->_timer->kReasonWinning);
} }
void Acci::personSpeaks() { void Acci::personSpeaks() {
@ -1506,7 +1506,7 @@ void Acci::doThat() {
case kVerbCodeQuit: // quit case kVerbCodeQuit: // quit
if (_vm->_gyro->kDemo) { if (_vm->_gyro->kDemo) {
warning("STUB: Acci::doThat() - case kVerbCodequit"); warning("STUB: Acci::doThat() - case kVerbCodequit");
// _vm->_visa->dixi('pos', 31); // _vm->_visa->displayScrollChain('pos', 31);
// close(demofile); // close(demofile);
// exit(0); // Change this later!!! // exit(0); // Change this later!!!
} }
@ -1682,7 +1682,7 @@ void Acci::doThat() {
case kVerbCodePee: case kVerbCodePee:
if (_vm->_gyro->setFlag('P')) { if (_vm->_gyro->setFlag('P')) {
_vm->_scrolls->displayText("Hmm, I don't think anyone will notice..."); _vm->_scrolls->displayText("Hmm, I don't think anyone will notice...");
_vm->_timeout->addTimer(4, _vm->_timeout->kProcUrinate, _vm->_timeout->kReasonGoToToilet); _vm->_timer->addTimer(4, _vm->_timer->kProcUrinate, _vm->_timer->kReasonGoToToilet);
} else } else
_vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY" _vm->_scrolls->displayText(Common::String("It would be ") + _vm->_scrolls->kControlItalic + "VERY"
+ _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!"); + _vm->_scrolls->kControlRoman + " unwise to do that here, Avvy!");
@ -1706,7 +1706,7 @@ void Acci::doThat() {
_vm->_animation->tr[1]._callEachStepFl = true; _vm->_animation->tr[1]._callEachStepFl = true;
_vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth; _vm->_animation->tr[1]._eachStepProc = _vm->_animation->kProcBackAndForth;
_vm->_gyro->_dna._avariciusTalk = 14; _vm->_gyro->_dna._avariciusTalk = 14;
_vm->_timeout->addTimer(177, _vm->_timeout->kProcAvariciusTalks, _vm->_timeout->kReasonAvariciusTalks); _vm->_timer->addTimer(177, _vm->_timer->kProcAvariciusTalks, _vm->_timer->kReasonAvariciusTalks);
} }
} else } else
_vm->_scrolls->displayText("Nothing appears to happen..."); _vm->_scrolls->displayText("Nothing appears to happen...");
@ -1769,7 +1769,7 @@ void Acci::doThat() {
_vm->_celer->drawBackgroundSprite(-1, -1, 10); _vm->_celer->drawBackgroundSprite(-1, -1, 10);
_vm->_gyro->_dna._malagauche = 177; _vm->_gyro->_dna._malagauche = 177;
_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyDrinks, _vm->_timeout->kReasonDrinks); _vm->_timer->addTimer(27, _vm->_timer->kProcBuyDrinks, _vm->_timer->kReasonDrinks);
break; break;
case 52: case 52:
examine(); examine();
@ -1795,7 +1795,7 @@ void Acci::doThat() {
_vm->_celer->drawBackgroundSprite(-1, -1, 10); _vm->_celer->drawBackgroundSprite(-1, -1, 10);
_vm->_gyro->_dna._malagauche = 177; _vm->_gyro->_dna._malagauche = 177;
_vm->_timeout->addTimer(27, _vm->_timeout->kProcBuyWine, _vm->_timeout->kReasonDrinks); _vm->_timer->addTimer(27, _vm->_timer->kProcBuyWine, _vm->_timer->kReasonDrinks);
} }
break; break;
} }
@ -1892,7 +1892,7 @@ void Acci::doThat() {
else { else {
_vm->_lucerna->incScore(4); _vm->_lucerna->incScore(4);
_vm->_scrolls->displayText("The drawbridge opens!"); _vm->_scrolls->displayText("The drawbridge opens!");
_vm->_timeout->addTimer(7, _vm->_timeout->kProcOpenDrawbridge, _vm->_timeout->kReasonDrawbridgeFalls); _vm->_timer->addTimer(7, _vm->_timer->kProcOpenDrawbridge, _vm->_timer->kReasonDrawbridgeFalls);
_vm->_gyro->_dna._drawbridgeOpen = 1; _vm->_gyro->_dna._drawbridgeOpen = 1;
} }
} else } else
@ -1944,7 +1944,7 @@ void Acci::doThat() {
_vm->_scrolls->displayText("Not with your head for heights, Avvy!"); _vm->_scrolls->displayText("Not with your head for heights, Avvy!");
break; break;
case kVerbCodeJump: case kVerbCodeJump:
_vm->_timeout->addTimer(1, _vm->_timeout->kProcJump, _vm->_timeout->kReasonJumping); _vm->_timer->addTimer(1, _vm->_timer->kProcJump, _vm->_timer->kReasonJumping);
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_dna._userMovesAvvy = false;
break; break;
case kVerbCodeHiscores: case kVerbCodeHiscores:
@ -1985,7 +1985,7 @@ void Acci::doThat() {
_vm->_scrolls->displayText("You're already sitting!"); _vm->_scrolls->displayText("You're already sitting!");
else { else {
_vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down. _vm->_animation->tr[0].walkto(4); // Move Avvy to the place, and sit him down.
_vm->_timeout->addTimer(1, _vm->_timeout->kProcAvvySitDown, _vm->_timeout->kReasonSittingDown); _vm->_timer->addTimer(1, _vm->_timer->kProcAvvySitDown, _vm->_timer->kReasonSittingDown);
} }
} else { // Default doodah. } else { // Default doodah.
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();

View file

@ -36,7 +36,7 @@
#include "avalanche/gyro2.h" #include "avalanche/gyro2.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
#include "avalanche/sequence2.h" #include "avalanche/sequence2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/enid2.h" #include "avalanche/enid2.h"
#include "common/scummsys.h" #include "common/scummsys.h"
@ -834,7 +834,7 @@ void Animation::catamove(byte ped) {
// This proc gets called whenever you touch a line defined as _vm->_gyro->special. // This proc gets called whenever you touch a line defined as _vm->_gyro->special.
void Animation::dawndelay() { void Animation::dawndelay() {
_vm->_timeout->addTimer(2, _vm->_timeout->kProcDawnDelay, _vm->_timeout->kReasonDawndelay); _vm->_timer->addTimer(2, _vm->_timer->kProcDawnDelay, _vm->_timer->kReasonDawndelay);
} }
void Animation::call_special(uint16 which) { void Animation::call_special(uint16 which) {
@ -843,7 +843,7 @@ void Animation::call_special(uint16 which) {
_vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_gyro->_dna._brummieStairs = 1; _vm->_gyro->_dna._brummieStairs = 1;
_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing; _vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
_vm->_timeout->addTimer(10, _vm->_timeout->kProcStairs, _vm->_timeout->kReasonBrummieStairs); _vm->_timer->addTimer(10, _vm->_timer->kProcStairs, _vm->_timer->kReasonBrummieStairs);
stopWalking(); stopWalking();
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_dna._userMovesAvvy = false;
break; break;
@ -877,7 +877,7 @@ void Animation::call_special(uint16 which) {
case 4: // This is the ghost room link. case 4: // This is the ghost room link.
_vm->_lucerna->dusk(); _vm->_lucerna->dusk();
tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap tr[0].turn(kDirRight); // you'll see this after we get back from bootstrap
_vm->_timeout->addTimer(1, _vm->_timeout->kProcGhostRoomPhew, _vm->_timeout->kReasonGhostRoomPhew); _vm->_timer->addTimer(1, _vm->_timer->kProcGhostRoomPhew, _vm->_timer->kReasonGhostRoomPhew);
_vm->_enid->backToBootstrap(3); _vm->_enid->backToBootstrap(3);
break; break;
case 5: case 5:
@ -895,7 +895,7 @@ void Animation::call_special(uint16 which) {
tr[1]._vanishIfStill = true; tr[1]._vanishIfStill = true;
tr[1]._doCheck = true; // One of them must have Check_Me switched on. tr[1]._doCheck = true; // One of them must have Check_Me switched on.
_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then. _vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = 177; // Not here, then.
_vm->_timeout->addTimer(364, _vm->_timeout->kProcHangAround, _vm->_timeout->kReasonHangingAround); _vm->_timer->addTimer(364, _vm->_timer->kProcHangAround, _vm->_timer->kReasonHangingAround);
} }
break; break;
case 6: // _vm->_gyro->special 6: fall down oubliette. case 6: // _vm->_gyro->special 6: fall down oubliette.
@ -903,17 +903,17 @@ void Animation::call_special(uint16 which) {
tr[0]._moveX = 3; tr[0]._moveX = 3;
tr[0]._moveY = 0; tr[0]._moveY = 0;
tr[0]._facingDir = kDirRight; tr[0]._facingDir = kDirRight;
_vm->_timeout->addTimer(1, _vm->_timeout->kProcFallDownOubliette, _vm->_timeout->kReasonFallingDownOubliette); _vm->_timer->addTimer(1, _vm->_timer->kProcFallDownOubliette, _vm->_timer->kReasonFallingDownOubliette);
break; break;
case 7: // _vm->_gyro->special 7: stop falling down oubliette. case 7: // _vm->_gyro->special 7: stop falling down oubliette.
tr[0]._visible = false; tr[0]._visible = false;
_vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing; _vm->_gyro->_magics[9]._operation = _vm->_gyro->kMagicNothing;
stopWalking(); stopWalking();
_vm->_timeout->loseTimer(_vm->_timeout->kReasonFallingDownOubliette); _vm->_timer->loseTimer(_vm->_timer->kReasonFallingDownOubliette);
//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0); //_vm->_lucerna->mblit(12, 80, 38, 160, 3, 0);
//_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1); //_vm->_lucerna->mblit(12, 80, 38, 160, 3, 1);
_vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette."); _vm->_scrolls->displayText("Oh dear, you seem to be down the bottom of an oubliette.");
_vm->_timeout->addTimer(200, _vm->_timeout->kProcMeetAvaroid, _vm->_timeout->kReasonMeetingAvaroid); _vm->_timer->addTimer(200, _vm->_timer->kProcMeetAvaroid, _vm->_timer->kReasonMeetingAvaroid);
break; break;
case 8: // _vm->_gyro->special 8: leave du Lustie's room. case 8: // _vm->_gyro->special 8: leave du Lustie's room.
if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) { if ((_vm->_gyro->_dna._geidaFollows) && (!_vm->_gyro->_dna._lustieIsAsleep)) {
@ -931,7 +931,7 @@ void Animation::call_special(uint16 which) {
tr[1].walkto(4); // She walks to somewhere... tr[1].walkto(4); // She walks to somewhere...
tr[0].done(); // Lose Avvy. tr[0].done(); // Lose Avvy.
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_dna._userMovesAvvy = false;
_vm->_timeout->addTimer(40, _vm->_timeout->kProcRobinHoodAndGeida, _vm->_timeout->kReasonRobinHoodAndGeida); _vm->_timer->addTimer(40, _vm->_timer->kProcRobinHoodAndGeida, _vm->_timer->kReasonRobinHoodAndGeida);
break; break;
case 10: // _vm->_gyro->special 10: transfer north in catacombs. case 10: // _vm->_gyro->special 10: transfer north in catacombs.
if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) { if ((_vm->_gyro->_dna._catacombX == 4) && (_vm->_gyro->_dna._catacombY == 1)) {
@ -1217,7 +1217,7 @@ void Animation::arrow_procs(byte tripnum) {
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
_vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him. _vm->_gyro->_dna._userMovesAvvy = false; // Stop the user from moving him.
_vm->_timeout->addTimer(55, _vm->_timeout->kProcNaughtyDuke, _vm->_timeout->kReasonNaughtyDuke); _vm->_timer->addTimer(55, _vm->_timer->kProcNaughtyDuke, _vm->_timer->kReasonNaughtyDuke);
} }
} else { // Arrow has hit the wall! } else { // Arrow has hit the wall!
tr[tripnum].done(); // Deallocate the arrow. tr[tripnum].done(); // Deallocate the arrow.

View file

@ -25,7 +25,7 @@
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
*/ */
/* Original name TRIP5 / Trippancy V - the sprite animation subsystem */ /* Original name: TRIP5 / Trippancy V - the sprite animation subsystem */
#ifndef AVALANCHE_ANIMATION_H #ifndef AVALANCHE_ANIMATION_H
#define AVALANCHE_ANIMATION_H #define AVALANCHE_ANIMATION_H

View file

@ -69,7 +69,7 @@ AvalancheEngine::~AvalancheEngine() {
delete _enid; delete _enid;
delete _celer; delete _celer;
delete _sequence; delete _sequence;
delete _timeout; delete _timer;
delete _animation; delete _animation;
delete _acci; delete _acci;
delete _dropdown; delete _dropdown;
@ -90,7 +90,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
_enid = new Enid(this); _enid = new Enid(this);
_celer = new Celer(this); _celer = new Celer(this);
_sequence = new Sequence(this); _sequence = new Sequence(this);
_timeout = new Timeout(this); _timer = new Timer(this);
_animation = new Animation(this); _animation = new Animation(this);
_acci = new Acci(this); _acci = new Acci(this);
_dropdown = new Dropdown(this); _dropdown = new Dropdown(this);
@ -335,9 +335,9 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
//blockwrite(f, times, sizeof(times)); // Timeout.times: Timers. //blockwrite(f, times, sizeof(times)); // Timeout.times: Timers.
for (byte i = 0; i < 7; i++) { for (byte i = 0; i < 7; i++) {
sz.syncAsSint32LE(_timeout->_times[i]._timeLeft); sz.syncAsSint32LE(_timer->_times[i]._timeLeft);
sz.syncAsByte(_timeout->_times[i]._action); sz.syncAsByte(_timer->_times[i]._action);
sz.syncAsByte(_timeout->_times[i]._reason); sz.syncAsByte(_timer->_times[i]._reason);
} }
//blockwrite(f, seq, sizeof(seq)); // Sequencer information. //blockwrite(f, seq, sizeof(seq)); // Sequencer information.

View file

@ -42,7 +42,7 @@
#include "avalanche/enid2.h" #include "avalanche/enid2.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
#include "avalanche/sequence2.h" #include "avalanche/sequence2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
#include "avalanche/acci2.h" #include "avalanche/acci2.h"
#include "avalanche/dropdown2.h" #include "avalanche/dropdown2.h"
@ -79,7 +79,7 @@ public:
Enid *_enid; Enid *_enid;
Celer *_celer; Celer *_celer;
Sequence *_sequence; Sequence *_sequence;
Timeout *_timeout; Timer *_timer;
Animation *_animation; Animation *_animation;
Acci *_acci; Acci *_acci;
Dropdown *_dropdown; Dropdown *_dropdown;

View file

@ -38,7 +38,7 @@
#include "avalanche/scrolls2.h" #include "avalanche/scrolls2.h"
#include "avalanche/dropdown2.h" #include "avalanche/dropdown2.h"
#include "avalanche/pingo2.h" #include "avalanche/pingo2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
#include "avalanche/enid2.h" #include "avalanche/enid2.h"
#include "avalanche/visa2.h" #include "avalanche/visa2.h"
@ -205,7 +205,7 @@ void Avalot::run(Common::String arg) {
_vm->_celer->updateBackgroundSprites(); _vm->_celer->updateBackgroundSprites();
_vm->_animation->animLink(); _vm->_animation->animLink();
_vm->_lucerna->checkClick(); _vm->_lucerna->checkClick();
_vm->_timeout->updateTimer(); _vm->_timer->updateTimer();

View file

@ -33,7 +33,7 @@
#include "avalanche/scrolls2.h" #include "avalanche/scrolls2.h"
#include "avalanche/lucerna2.h" #include "avalanche/lucerna2.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
#include "avalanche/sequence2.h" #include "avalanche/sequence2.h"

View file

@ -33,7 +33,7 @@
#include "avalanche/gyro2.h" #include "avalanche/gyro2.h"
#include "avalanche/scrolls2.h" #include "avalanche/scrolls2.h"
#include "avalanche/visa2.h" #include "avalanche/visa2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
#include "avalanche/enid2.h" #include "avalanche/enid2.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
@ -340,21 +340,21 @@ void Lucerna::exitRoom(byte x) {
switch (x) { switch (x) {
case r__spludwicks: case r__spludwicks:
_vm->_timeout->loseTimer(_vm->_timeout->kReasonAvariciusTalks); _vm->_timer->loseTimer(_vm->_timer->kReasonAvariciusTalks);
_vm->_gyro->_dna._avariciusTalk = 0; _vm->_gyro->_dna._avariciusTalk = 0;
// He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. // He doesn't HAVE to be talking for this to work. It just deletes it IF it exists.
break; break;
case r__bridge: case r__bridge:
if (_vm->_gyro->_dna._drawbridgeOpen > 0) { if (_vm->_gyro->_dna._drawbridgeOpen > 0) {
_vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open. _vm->_gyro->_dna._drawbridgeOpen = 4; // Fully open.
_vm->_timeout->loseTimer(_vm->_timeout->kReasonDrawbridgeFalls); _vm->_timer->loseTimer(_vm->_timer->kReasonDrawbridgeFalls);
} }
break; break;
case r__outsidecardiffcastle: case r__outsidecardiffcastle:
_vm->_timeout->loseTimer(_vm->_timeout->kReasonCardiffsurvey); _vm->_timer->loseTimer(_vm->_timer->kReasonCardiffsurvey);
break; break;
case r__robins: case r__robins:
_vm->_timeout->loseTimer(_vm->_timeout->kReasonGettingTiedUp); _vm->_timer->loseTimer(_vm->_timer->kReasonGettingTiedUp);
break; break;
} }
@ -436,7 +436,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
if (_vm->_gyro->_dna._avvyInBed) { if (_vm->_gyro->_dna._avvyInBed) {
_vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_celer->drawBackgroundSprite(-1, -1, 3);
_vm->_graphics->refreshBackground(); _vm->_graphics->refreshBackground();
_vm->_timeout->addTimer(100, _vm->_timeout->kProcArkataShouts, _vm->_timeout->kReasonArkataShouts); _vm->_timer->addTimer(100, _vm->_timer->kProcArkataShouts, _vm->_timer->kReasonArkataShouts);
} }
break; break;
@ -464,7 +464,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->tr[1].init(8, false, _vm->_animation); _vm->_animation->tr[1].init(8, false, _vm->_animation);
_vm->_animation->apped(2, 2); _vm->_animation->apped(2, 2);
_vm->_animation->tr[1].walkto(4); _vm->_animation->tr[1].walkto(4);
_vm->_timeout->addTimer(20, _vm->_timeout->kProcCrapulusSpludOut, _vm->_timeout->kReasonCrapulusSaysSpludwickOut); _vm->_timer->addTimer(20, _vm->_timer->kProcCrapulusSpludOut, _vm->_timer->kReasonCrapulusSaysSpludwickOut);
_vm->_gyro->_dna._crapulusWillTell = false; _vm->_gyro->_dna._crapulusWillTell = false;
} }
} }
@ -472,7 +472,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
case r__outsidespludwicks: case r__outsidespludwicks:
if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) { if ((_vm->_gyro->_dna._roomCount[r__outsidespludwicks] == 1) && (ped == 1)) {
_vm->_timeout->addTimer(20, _vm->_timeout->kProcBang, _vm->_timeout->kReasonExplosion); _vm->_timer->addTimer(20, _vm->_timer->kProcBang, _vm->_timer->kReasonExplosion);
_vm->_gyro->_dna._spludwickAtHome = true; _vm->_gyro->_dna._spludwickAtHome = true;
} }
break; break;
@ -527,7 +527,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->tr[1]._vanishIfStill = true; _vm->_animation->tr[1]._vanishIfStill = true;
_vm->_gyro->_dna._passedCwytalotInHerts = true; _vm->_gyro->_dna._passedCwytalotInHerts = true;
// _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in? // _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in?
_vm->_timeout->addTimer(20, _vm->_timeout->kProcCwytalotInHerts, _vm->_timeout->kReasonCwytalotInHerts); _vm->_timer->addTimer(20, _vm->_timer->kProcCwytalotInHerts, _vm->_timer->kReasonCwytalotInHerts);
} }
break; break;
@ -548,7 +548,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->tr[1].init(6, false, _vm->_animation); _vm->_animation->tr[1].init(6, false, _vm->_animation);
_vm->_animation->apped(2, 2); _vm->_animation->apped(2, 2);
_vm->_animation->tr[1].walkto(3); _vm->_animation->tr[1].walkto(3);
_vm->_timeout->addTimer(36, _vm->_timeout->kProcGetTiedUp, _vm->_timeout->kReasonGettingTiedUp); _vm->_timer->addTimer(36, _vm->_timer->kProcGetTiedUp, _vm->_timer->kReasonGettingTiedUp);
} }
} }
@ -572,7 +572,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->tr[1].init(9, false, _vm->_animation); _vm->_animation->tr[1].init(9, false, _vm->_animation);
_vm->_animation->apped(2, 2); _vm->_animation->apped(2, 2);
_vm->_animation->tr[1].walkto(3); _vm->_animation->tr[1].walkto(3);
_vm->_timeout->addTimer(47, _vm->_timeout->kProcCardiffSurvey, _vm->_timeout->kReasonCardiffsurvey); _vm->_timer->addTimer(47, _vm->_timer->kProcCardiffSurvey, _vm->_timer->kReasonCardiffsurvey);
} }
break; break;
case 5 : case 5 :
@ -582,7 +582,7 @@ void Lucerna::enterRoom(byte room, byte ped) {
_vm->_animation->tr[1].init(9, false, _vm->_animation); _vm->_animation->tr[1].init(9, false, _vm->_animation);
_vm->_animation->apped(2, 3); _vm->_animation->apped(2, 3);
_vm->_animation->tr[1]._facingDir = Animation::kDirRight; _vm->_animation->tr[1]._facingDir = Animation::kDirRight;
_vm->_timeout->addTimer(3, _vm->_timeout->kProcCardiffReturn, _vm->_timeout->kReasonCardiffsurvey); _vm->_timer->addTimer(3, _vm->_timer->kProcCardiffReturn, _vm->_timer->kReasonCardiffsurvey);
} }
} }
if (_vm->_gyro->_dna._cardiffQuestionNum < 5) if (_vm->_gyro->_dna._cardiffQuestionNum < 5)
@ -650,10 +650,10 @@ void Lucerna::enterRoom(byte room, byte ped) {
case r__lustiesroom: case r__lustiesroom:
_vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos. _vm->_gyro->_dna._dogFoodPos = 1; // Actually, du Lustie pos.
if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes if (_vm->_animation->tr[0]._id == 0) // Avvy in his normal clothes
_vm->_timeout->addTimer(3, _vm->_timeout->kProcCallsGuards, _vm->_timeout->kReasonDuLustieTalks); _vm->_timer->addTimer(3, _vm->_timer->kProcCallsGuards, _vm->_timer->kReasonDuLustieTalks);
else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already else if (! _vm->_gyro->_dna._enteredLustiesRoomAsMonk) // already
// Presumably, Avvy dressed as a monk. // Presumably, Avvy dressed as a monk.
_vm->_timeout->addTimer(3, _vm->_timeout->kProcGreetsMonk, _vm->_timeout->kReasonDuLustieTalks); _vm->_timer->addTimer(3, _vm->_timer->kProcGreetsMonk, _vm->_timer->kReasonDuLustieTalks);
if (_vm->_gyro->_dna._geidaFollows) { if (_vm->_gyro->_dna._geidaFollows) {
putGeidaAt(5, ped); putGeidaAt(5, ped);
@ -1190,7 +1190,7 @@ void Lucerna::gameOver() {
_vm->_animation->tr[0]._stepNum = 0; _vm->_animation->tr[0]._stepNum = 0;
_vm->_animation->tr[0].appear(sx, sy, 0); _vm->_animation->tr[0].appear(sx, sy, 0);
_vm->_timeout->addTimer(3, _vm->_timeout->kProcAvalotFalls, _vm->_timeout->kReasonFallingOver); _vm->_timer->addTimer(3, _vm->_timer->kProcAvalotFalls, _vm->_timer->kReasonFallingOver);
_vm->_gyro->_alive = false; _vm->_gyro->_alive = false;
} }

View file

@ -15,7 +15,7 @@ MODULE_OBJS = \
enid2.o \ enid2.o \
celer2.o \ celer2.o \
sequence2.o \ sequence2.o \
timeout2.o \ timer.o \
animation.o \ animation.o \
acci2.o \ acci2.o \
dropdown2.o \ dropdown2.o \

View file

@ -35,7 +35,7 @@
#include "avalanche/animation.h" #include "avalanche/animation.h"
#include "avalanche/acci2.h" #include "avalanche/acci2.h"
#include "avalanche/visa2.h" #include "avalanche/visa2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "common/textconsole.h" #include "common/textconsole.h"
#include "common/file.h" #include "common/file.h"
@ -219,7 +219,7 @@ void Scrolls::scrollModeMusic() {
setReadyLight(0); setReadyLight(0);
_vm->_gyro->_seeScroll = false; _vm->_gyro->_seeScroll = false;
_vm->_timeout->addTimer(8, _vm->_timeout->kProcJacquesWakesUp, _vm->_timeout->kReasonJacquesWakingUp); _vm->_timer->addTimer(8, _vm->_timer->kProcJacquesWakesUp, _vm->_timer->kReasonJacquesWakingUp);
warning("STUB: Scrolls::music_scroll()"); warning("STUB: Scrolls::music_scroll()");
return; return;
#if 0 #if 0

View file

@ -31,7 +31,7 @@
#include "avalanche/sequence2.h" #include "avalanche/sequence2.h"
#include "avalanche/gyro2.h" #include "avalanche/gyro2.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/celer2.h" #include "avalanche/celer2.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
@ -69,8 +69,8 @@ void Sequence::thenFlip(byte where, byte ped) {
} }
void Sequence::startToClose() { void Sequence::startToClose() {
_vm->_timeout->loseTimer(_vm->_timeout->kReasonSequencer); _vm->_timer->loseTimer(_vm->_timer->kReasonSequencer);
_vm->_timeout->addTimer(7, _vm->_timeout->kProcSequence, _vm->_timeout->kReasonSequencer); _vm->_timer->addTimer(7, _vm->_timer->kProcSequence, _vm->_timer->kReasonSequencer);
} }
void Sequence::startToOpen() { void Sequence::startToOpen() {

View file

@ -54,7 +54,7 @@ public:
private: private:
AvalancheEngine *_vm; AvalancheEngine *_vm;
void shoveLeft(); // This PROC is called by Timeout when it's time to do another frame. void shoveLeft(); // This PROC is called by Timer when it's time to do another frame.
}; };
} // End of namespace Avalanche. } // End of namespace Avalanche.

View file

@ -25,11 +25,11 @@
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
*/ */
/* TIMEOUT The scheduling unit. */ /* Original name: TIMEOUT The scheduling unit. */
#include "avalanche/avalanche.h" #include "avalanche/avalanche.h"
#include "avalanche/timeout2.h" #include "avalanche/timer.h"
#include "avalanche/visa2.h" #include "avalanche/visa2.h"
#include "avalanche/lucerna2.h" #include "avalanche/lucerna2.h"
#include "avalanche/animation.h" #include "avalanche/animation.h"
@ -43,7 +43,7 @@
namespace Avalanche { namespace Avalanche {
Timeout::Timeout(AvalancheEngine *vm) { Timer::Timer(AvalancheEngine *vm) {
_vm = vm; _vm = vm;
for (byte i = 0; i < 7; i++) { for (byte i = 0; i < 7; i++) {
@ -58,7 +58,7 @@ Timeout::Timeout(AvalancheEngine *vm) {
* Add a nex timer * Add a nex timer
* @remarks Originally called 'set_up_timer' * @remarks Originally called 'set_up_timer'
*/ */
void Timeout::addTimer(int32 duration, byte action, byte reason) { void Timer::addTimer(int32 duration, byte action, byte reason) {
if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) { if ((_vm->_gyro->isLoaded == false) || (_timerLost == true)) {
byte i = 0; byte i = 0;
while ((i < 7) && (_times[i]._timeLeft != 0)) while ((i < 7) && (_times[i]._timeLeft != 0))
@ -81,7 +81,7 @@ void Timeout::addTimer(int32 duration, byte action, byte reason) {
* Update the timers * Update the timers
* @remarks Originally called 'one_tick' * @remarks Originally called 'one_tick'
*/ */
void Timeout::updateTimer() { void Timer::updateTimer() {
if (_vm->_gyro->_dropdownActive) if (_vm->_gyro->_dropdownActive)
return; return;
@ -223,7 +223,7 @@ void Timeout::updateTimer() {
_vm->_gyro->_dna._totalTime++; // Total amount of time for this game. _vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
} }
void Timeout::loseTimer(byte which) { void Timer::loseTimer(byte which) {
for (byte i = 0; i < 7; i++) { for (byte i = 0; i < 7; i++) {
if (_times[i]._reason == which) if (_times[i]._reason == which)
_times[i]._timeLeft = 0; // Cancel this one! _times[i]._timeLeft = 0; // Cancel this one!
@ -232,7 +232,7 @@ void Timeout::loseTimer(byte which) {
_timerLost = true; _timerLost = true;
} }
void Timeout::openDrawbridge() { void Timer::openDrawbridge() {
_vm->_gyro->_dna._drawbridgeOpen++; _vm->_gyro->_dna._drawbridgeOpen++;
_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1); _vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
@ -242,7 +242,7 @@ void Timeout::openDrawbridge() {
addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls); addTimer(7, kProcOpenDrawbridge, kReasonDrawbridgeFalls);
} }
void Timeout::avariciusTalks() { void Timer::avariciusTalks() {
_vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk); _vm->_visa->displayScrollChain('q', _vm->_gyro->_dna._avariciusTalk);
_vm->_gyro->_dna._avariciusTalk++; _vm->_gyro->_dna._avariciusTalk++;
@ -252,27 +252,27 @@ void Timeout::avariciusTalks() {
_vm->_lucerna->incScore(3); _vm->_lucerna->incScore(3);
} }
void Timeout::urinate() { void Timer::urinate() {
_vm->_animation->tr[0].turn(Animation::kDirUp); _vm->_animation->tr[0].turn(Animation::kDirUp);
_vm->_animation->stopWalking(); _vm->_animation->stopWalking();
_vm->_lucerna->drawDirection(); _vm->_lucerna->drawDirection();
addTimer(14, kProcToilet, kReasonGoToToilet); addTimer(14, kProcToilet, kReasonGoToToilet);
} }
void Timeout::toilet() { void Timer::toilet() {
_vm->_scrolls->displayText("That's better!"); _vm->_scrolls->displayText("That's better!");
} }
void Timeout::bang() { void Timer::bang() {
_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >"); _vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
addTimer(30, kProcBang2, kReasonExplosion); addTimer(30, kProcBang2, kReasonExplosion);
} }
void Timeout::bang2() { void Timer::bang2() {
_vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something..."); _vm->_scrolls->displayText("Hmm... sounds like Spludwick's up to something...");
} }
void Timeout::stairs() { void Timer::stairs() {
_vm->_gyro->blip(); _vm->_gyro->blip();
_vm->_animation->tr[0].walkto(4); _vm->_animation->tr[0].walkto(4);
_vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_celer->drawBackgroundSprite(-1, -1, 2);
@ -282,7 +282,7 @@ void Timeout::stairs() {
_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.) _vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
} }
void Timeout::cardiffSurvey() { void Timer::cardiffSurvey() {
if (_vm->_gyro->_dna._cardiffQuestionNum == 0) { if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
_vm->_gyro->_dna._cardiffQuestionNum++; _vm->_gyro->_dna._cardiffQuestionNum++;
_vm->_visa->displayScrollChain('q', 27); _vm->_visa->displayScrollChain('q', 27);
@ -293,16 +293,16 @@ void Timeout::cardiffSurvey() {
addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey); addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
} }
void Timeout::cardiffReturn() { void Timer::cardiffReturn() {
_vm->_visa->displayScrollChain('q', 28); _vm->_visa->displayScrollChain('q', 28);
cardiffSurvey(); // Add end of question. cardiffSurvey(); // Add end of question.
} }
void Timeout::cwytalotInHerts() { void Timer::cwytalotInHerts() {
_vm->_visa->displayScrollChain('q', 29); _vm->_visa->displayScrollChain('q', 29);
} }
void Timeout::getTiedUp() { void Timer::getTiedUp() {
_vm->_visa->displayScrollChain('q', 34); // ...Trouble! _vm->_visa->displayScrollChain('q', 34); // ...Trouble!
_vm->_gyro->_dna._userMovesAvvy = false; _vm->_gyro->_dna._userMovesAvvy = false;
_vm->_gyro->_dna._beenTiedUp = true; _vm->_gyro->_dna._beenTiedUp = true;
@ -314,14 +314,14 @@ void Timeout::getTiedUp() {
addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp); addTimer(70, kProcGetTiedUp2, kReasonGettingTiedUp);
} }
void Timeout::getTiedUp2() { void Timer::getTiedUp2() {
_vm->_animation->tr[0].walkto(4); _vm->_animation->tr[0].walkto(4);
_vm->_animation->tr[1].walkto(5); _vm->_animation->tr[1].walkto(5);
_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries. _vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
_vm->_gyro->_dna._friarWillTieYouUp = true; _vm->_gyro->_dna._friarWillTieYouUp = true;
} }
void Timeout::hangAround() { void Timer::hangAround() {
_vm->_animation->tr[1]._doCheck = false; _vm->_animation->tr[1]._doCheck = false;
_vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood _vm->_animation->tr[0].init(7, true, _vm->_animation); // Robin Hood
_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins; _vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
@ -331,7 +331,7 @@ void Timeout::hangAround() {
addTimer(55, kProcHangAround2, kReasonHangingAround); addTimer(55, kProcHangAround2, kReasonHangingAround);
} }
void Timeout::hangAround2() { void Timer::hangAround2() {
_vm->_visa->displayScrollChain('q', 40); _vm->_visa->displayScrollChain('q', 40);
_vm->_animation->tr[1]._vanishIfStill = false; _vm->_animation->tr[1]._vanishIfStill = false;
_vm->_animation->tr[1].walkto(4); _vm->_animation->tr[1].walkto(4);
@ -348,7 +348,7 @@ void Timeout::hangAround2() {
_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up. _vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
} }
void Timeout::afterTheShootemup() { void Timer::afterTheShootemup() {
_vm->_animation->fliproom(_vm->_gyro->_dna._room, 0); _vm->_animation->fliproom(_vm->_gyro->_dna._room, 0);
// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
@ -379,12 +379,12 @@ void Timeout::afterTheShootemup() {
points(gain); points(gain);
#endif #endif
warning("STUB: Timeout::after_the_shootemup()"); warning("STUB: Timer::after_the_shootemup()");
_vm->_visa->displayScrollChain('q', 70); _vm->_visa->displayScrollChain('q', 70);
} }
void Timeout::jacquesWakesUp() { void Timer::jacquesWakesUp() {
_vm->_gyro->_dna._jacquesState++; _vm->_gyro->_dna._jacquesState++;
switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures. switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
@ -422,7 +422,7 @@ void Timeout::jacquesWakesUp() {
} }
} }
void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your money. void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money.
_vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke. _vm->_animation->tr[1].init(9, false, _vm->_animation); // Here comes the Duke.
_vm->_animation->apped(2, 1); // He starts at the door... _vm->_animation->apped(2, 1); // He starts at the door...
_vm->_animation->tr[1].walkto(3); // He walks over to you. _vm->_animation->tr[1].walkto(3); // He walks over to you.
@ -435,20 +435,20 @@ void Timeout::naughtyDuke() { // This is when the Duke comes in and takes your m
addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke); addTimer(50, kProcNaughtyDuke2, kReasonNaughtyDuke);
} }
void Timeout::naughtyDuke2() { void Timer::naughtyDuke2() {
_vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!" _vm->_visa->displayScrollChain('q', 48); // "Ha ha, it worked again!"
_vm->_animation->tr[1].walkto(1); // Walk to the door. _vm->_animation->tr[1].walkto(1); // Walk to the door.
_vm->_animation->tr[1]._vanishIfStill = true; // Then go away! _vm->_animation->tr[1]._vanishIfStill = true; // Then go away!
addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke); addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke);
} }
void Timeout::naughtyDuke3() { void Timer::naughtyDuke3() {
_vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_sequence->firstShow(2); _vm->_sequence->firstShow(2);
_vm->_sequence->startToClose(); _vm->_sequence->startToClose();
} }
void Timeout::jump() { void Timer::jump() {
_vm->_gyro->_dna._jumpStatus++; _vm->_gyro->_dna._jumpStatus++;
switch (_vm->_gyro->_dna._jumpStatus) { switch (_vm->_gyro->_dna._jumpStatus) {
@ -495,12 +495,12 @@ void Timeout::jump() {
} }
} }
void Timeout::crapulusSaysSpludOut() { void Timer::crapulusSaysSpludOut() {
_vm->_visa->displayScrollChain('q', 56); _vm->_visa->displayScrollChain('q', 56);
_vm->_gyro->_dna._crapulusWillTell = false; _vm->_gyro->_dna._crapulusWillTell = false;
} }
void Timeout::buyDrinks() { void Timer::buyDrinks() {
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
_vm->_gyro->_dna._malagauche = 0; _vm->_gyro->_dna._malagauche = 0;
@ -512,7 +512,7 @@ void Timeout::buyDrinks() {
_vm->_acci->drink(); _vm->_acci->drink();
} }
void Timeout::buyWine() { void Timer::buyWine() {
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
_vm->_gyro->_dna._malagauche = 0; _vm->_gyro->_dna._malagauche = 0;
@ -526,24 +526,24 @@ void Timeout::buyWine() {
} }
} }
void Timeout::callsGuards() { void Timer::callsGuards() {
_vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!" _vm->_visa->displayScrollChain('Q', 58); // "GUARDS!!!"
_vm->_lucerna->gameOver(); _vm->_lucerna->gameOver();
} }
void Timeout::greetsMonk() { void Timer::greetsMonk() {
_vm->_visa->displayScrollChain('Q', 59); _vm->_visa->displayScrollChain('Q', 59);
_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true; _vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
} }
void Timeout::fallDownOubliette() { void Timer::fallDownOubliette() {
_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing; _vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
_vm->_animation->tr[0]._moveY++; // Increments dx/dy! _vm->_animation->tr[0]._moveY++; // Increments dx/dy!
_vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY; // Dowwwn we go... _vm->_animation->tr[0]._y += _vm->_animation->tr[0]._moveY; // Dowwwn we go...
addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette); addTimer(3, kProcFallDownOubliette, kReasonFallingDownOubliette);
} }
void Timeout::meetAvaroid() { void Timer::meetAvaroid() {
if (_vm->_gyro->_dna._metAvaroid) { if (_vm->_gyro->_dna._metAvaroid) {
_vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that" _vm->_scrolls->displayText(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+ _vm->_scrolls->kControlRoman + " lucky twice in a row!"); + _vm->_scrolls->kControlRoman + " lucky twice in a row!");
@ -562,7 +562,7 @@ void Timeout::meetAvaroid() {
} }
} }
void Timeout::riseUpOubliette() { void Timer::riseUpOubliette() {
_vm->_animation->tr[0]._visible = true; _vm->_animation->tr[0]._visible = true;
_vm->_animation->tr[0]._moveY++; // Decrements dx/dy! _vm->_animation->tr[0]._moveY++; // Decrements dx/dy!
_vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go... _vm->_animation->tr[0]._y -= _vm->_animation->tr[0]._moveY; // Uuuupppp we go...
@ -572,7 +572,7 @@ void Timeout::riseUpOubliette() {
_vm->_gyro->_dna._userMovesAvvy = true; _vm->_gyro->_dna._userMovesAvvy = true;
} }
void Timeout::robinHoodAndGeida() { void Timer::robinHoodAndGeida() {
_vm->_animation->tr[0].init(7, true, _vm->_animation); _vm->_animation->tr[0].init(7, true, _vm->_animation);
_vm->_animation->apped(1, 7); _vm->_animation->apped(1, 7);
_vm->_animation->tr[0].walkto(6); _vm->_animation->tr[0].walkto(6);
@ -582,7 +582,7 @@ void Timeout::robinHoodAndGeida() {
_vm->_gyro->_dna._geidaFollows = false; _vm->_gyro->_dna._geidaFollows = false;
} }
void Timeout::robinHoodAndGeidaTalk() { void Timer::robinHoodAndGeidaTalk() {
_vm->_visa->displayScrollChain('q', 66); _vm->_visa->displayScrollChain('q', 66);
_vm->_animation->tr[0].walkto(2); _vm->_animation->tr[0].walkto(2);
_vm->_animation->tr[1].walkto(2); _vm->_animation->tr[1].walkto(2);
@ -591,7 +591,7 @@ void Timeout::robinHoodAndGeidaTalk() {
addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida); addTimer(162, kProcAvalotReturns, kReasonRobinHoodAndGeida);
} }
void Timeout::avalotReturns() { void Timer::avalotReturns() {
_vm->_animation->tr[0].done(); _vm->_animation->tr[0].done();
_vm->_animation->tr[1].done(); _vm->_animation->tr[1].done();
_vm->_animation->tr[0].init(0, true, _vm->_animation); _vm->_animation->tr[0].init(0, true, _vm->_animation);
@ -605,7 +605,7 @@ void Timeout::avalotReturns() {
* so that it will happen when Avvy stops walking. * so that it will happen when Avvy stops walking.
* @remarks Originally called 'avvy_sit_down' * @remarks Originally called 'avvy_sit_down'
*/ */
void Timeout::avvySitDown() { void Timer::avvySitDown() {
if (_vm->_animation->tr[0]._homing) // Still walking. if (_vm->_animation->tr[0]._homing) // Still walking.
addTimer(1, kProcAvvySitDown, kReasonSittingDown); addTimer(1, kProcAvvySitDown, kReasonSittingDown);
else { else {
@ -616,12 +616,12 @@ void Timeout::avvySitDown() {
} }
} }
void Timeout::ghostRoomPhew() { void Timer::ghostRoomPhew() {
_vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman _vm->_scrolls->displayText(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!"); + " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
} }
void Timeout::arkataShouts() { void Timer::arkataShouts() {
if (_vm->_gyro->_dna._teetotal) if (_vm->_gyro->_dna._teetotal)
return; return;
@ -629,11 +629,11 @@ void Timeout::arkataShouts() {
addTimer(160, kProcArkataShouts, kReasonArkataShouts); addTimer(160, kProcArkataShouts, kReasonArkataShouts);
} }
void Timeout::winning() { void Timer::winning() {
_vm->_visa->displayScrollChain('q', 79); _vm->_visa->displayScrollChain('q', 79);
_vm->_pingo->winningPic(); _vm->_pingo->winningPic();
warning("STUB: Timeout::winning()"); warning("STUB: Timer::winning()");
#if 0 #if 0
do { do {
_vm->_lucerna->checkclick(); _vm->_lucerna->checkclick();
@ -646,7 +646,7 @@ void Timeout::winning() {
_vm->_gyro->_letMeOut = true; _vm->_gyro->_letMeOut = true;
} }
void Timeout::avalotFalls() { void Timer::avalotFalls() {
if (_vm->_animation->tr[0]._stepNum < 5) { if (_vm->_animation->tr[0]._stepNum < 5) {
_vm->_animation->tr[0]._stepNum++; _vm->_animation->tr[0]._stepNum++;
addTimer(3, kProcAvalotFalls, kReasonFallingOver); addTimer(3, kProcAvalotFalls, kReasonFallingOver);
@ -661,18 +661,18 @@ void Timeout::avalotFalls() {
} }
} }
void Timeout::spludwickGoesToCauldron() { void Timer::spludwickGoesToCauldron() {
if (_vm->_animation->tr[1]._homing) if (_vm->_animation->tr[1]._homing)
addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk); addTimer(1, kProcSpludwickGoesToCauldron, kReasonSpludWalk);
else else
addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk); addTimer(17, kProcSpludwickLeavesCauldron, kReasonSpludWalk);
} }
void Timeout::spludwickLeavesCauldron() { void Timer::spludwickLeavesCauldron() {
_vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue. _vm->_animation->tr[1]._callEachStepFl = true; // So that normal procs will continue.
} }
void Timeout::giveLuteToGeida() { // Moved here from Acci. void Timer::giveLuteToGeida() { // Moved here from Acci.
_vm->_visa->displayScrollChain('Q', 86); _vm->_visa->displayScrollChain('Q', 86);
_vm->_lucerna->incScore(4); _vm->_lucerna->incScore(4);
_vm->_gyro->_dna._lustieIsAsleep = true; _vm->_gyro->_dna._lustieIsAsleep = true;

View file

@ -25,17 +25,17 @@
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
*/ */
/* TIMEOUT The scheduling unit. */ /* Original name: TIMEOUT The scheduling unit. */
#ifndef AVALANCHE_TIMEOUT2_H #ifndef AVALANCHE_TIMER_H
#define AVALANCHE_TIMEOUT2_H #define AVALANCHE_TIMER_H
#include "common/scummsys.h" #include "common/scummsys.h"
namespace Avalanche { namespace Avalanche {
class AvalancheEngine; class AvalancheEngine;
class Timeout { class Timer {
public: public:
// Reason runs between 1 and 28. // Reason runs between 1 and 28.
enum Reason { enum Reason {
@ -114,16 +114,16 @@ public:
kProcGiveLuteToGeida = 41 kProcGiveLuteToGeida = 41
}; };
struct TimeType { struct TimerType {
int32 _timeLeft; int32 _timeLeft;
byte _action; byte _action;
byte _reason; byte _reason;
}; };
TimeType _times[7]; TimerType _times[7];
bool _timerLost; // Is the timer "lost"? (Because of using loseTimer()) bool _timerLost; // Is the timer "lost"? (Because of using loseTimer())
Timeout(AvalancheEngine *vm); Timer(AvalancheEngine *vm);
void addTimer(int32 duration, byte action, byte reason); void addTimer(int32 duration, byte action, byte reason);
void updateTimer(); void updateTimer();
@ -177,4 +177,4 @@ private:
} // End of namespace Avalanche. } // End of namespace Avalanche.
#endif // AVALANCHE_TIMEOUT2_H #endif // AVALANCHE_TIMER_H