scummvm/engines/avalanche/timeout2.cpp

674 lines
19 KiB
C++
Raw Normal View History

2013-06-27 09:21:41 +02:00
/* 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
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* This code is based on the original source code of Lord Avalot d'Argent version 1.3.
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
*/
/* TIMEOUT The scheduling unit. */
#include "avalanche/avalanche.h"
2013-06-29 16:36:40 +02:00
#include "avalanche/timeout2.h"
2013-06-27 09:21:41 +02:00
#include "avalanche/visa2.h"
#include "avalanche/lucerna2.h"
#include "avalanche/trip6.h"
#include "avalanche/scrolls2.h"
#include "avalanche/acci2.h"
#include "avalanche/sequence2.h"
#include "avalanche/enid2.h"
#include "avalanche/pingo2.h"
2013-06-29 16:36:40 +02:00
#include "common/textconsole.h"
2013-06-27 09:21:41 +02:00
namespace Avalanche {
Timeout::Timeout(AvalancheEngine *vm) {
_vm = vm;
2013-07-25 22:42:41 +02:00
for (byte i = 0; i < 7; i++) {
times[i].time_left = 0;
times[i].then_where = 0;
times[i].what_for = 0;
2013-06-27 09:21:41 +02:00
}
}
2013-06-27 09:21:41 +02:00
void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
if ((_vm->_gyro->isLoaded == false) || (timerLost == true)) {
byte i = 0;
while ((i < 7) && (times[i].time_left != 0))
i++;
if (i == 7)
return; // Oh dear...
// Everything's OK here!
times[i].time_left = howlong;
times[i].then_where = whither;
times[i].what_for = why;
} else {
_vm->_gyro->isLoaded = false;
return;
}
}
2013-06-27 09:21:41 +02:00
void Timeout::one_tick() {
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dropdownActive)
2013-06-30 14:10:33 +02:00
return;
2013-06-27 09:21:41 +02:00
for (byte fv = 0; fv < 7; fv++) {
if (times[fv].time_left > 0) {
times[fv].time_left--;
2013-06-27 09:21:41 +02:00
if (times[fv].time_left == 0) {
switch (times[fv].then_where) {
case procopen_drawbridge :
open_drawbridge();
break;
case procavaricius_talks :
avaricius_talks();
break;
case procurinate :
urinate();
break;
case proctoilet2 :
toilet2();
break;
case procbang:
bang();
break;
case procbang2:
bang2();
break;
case procstairs:
stairs();
break;
case proccardiffsurvey:
cardiff_survey();
break;
case proccardiff_return:
cardiff_return();
break;
case proc_cwytalot_in_herts:
cwytalot_in_herts();
break;
case procget_tied_up:
get_tied_up();
break;
case procget_tied_up2:
get_tied_up2();
break;
case prochang_around:
hang_around();
break;
case prochang_around2:
hang_around2();
break;
case procafter_the_shootemup:
after_the_shootemup();
break;
case procjacques_wakes_up:
jacques_wakes_up();
break;
case procnaughty_duke:
naughty_duke();
break;
case procnaughty_duke2:
naughty_duke2();
break;
case procnaughty_duke3:
naughty_duke3();
break;
case procjump:
jump();
break;
case procsequence:
_vm->_sequence->call_sequencer();
break;
case proccrapulus_splud_out:
crapulus_says_splud_out();
break;
case procdawn_delay:
_vm->_lucerna->dawn();
break;
case procbuydrinks:
buydrinks();
break;
case procbuywine:
buywine();
break;
case proccallsguards:
callsguards();
break;
case procgreetsmonk:
greetsmonk();
break;
case procfall_down_oubliette:
fall_down_oubliette();
break;
case procmeet_avaroid:
meet_avaroid();
break;
case procrise_up_oubliette:
rise_up_oubliette();
break;
case procrobin_hood_and_geida:
robin_hood_and_geida();
break;
case procrobin_hood_and_geida_talk:
robin_hood_and_geida_talk();
break;
case procavalot_returns:
avalot_returns();
break;
case procavvy_sit_down:
avvy_sit_down();
break;
case procghost_room_phew:
ghost_room_phew();
break;
case procarkata_shouts:
arkata_shouts();
break;
case procwinning:
winning();
break;
case procavalot_falls:
avalot_falls();
break;
case procspludwick_goes_to_cauldron:
spludwick_goes_to_cauldron();
break;
case procspludwick_leaves_cauldron:
spludwick_leaves_cauldron();
break;
case procgive_lute_to_geida:
give_lute_to_geida();
break;
}
2013-06-30 14:10:33 +02:00
}
2013-06-27 09:21:41 +02:00
}
}
2013-09-06 16:23:57 +02:00
_vm->_gyro->_roomTime++; // Cycles since you've been in this room.
_vm->_gyro->_dna._totalTime++; // Total amount of time for this game.
}
2013-06-27 09:21:41 +02:00
void Timeout::lose_timer(byte which) {
for (byte fv = 0; fv < 7; fv++) {
if (times[fv].what_for == which)
times[fv].time_left = 0; // Cancel this one!
}
timerLost = true;
}
void Timeout::open_drawbridge() {
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._drawbridgeOpen++;
_vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_dna._drawbridgeOpen - 1);
2013-06-27 09:21:41 +02:00
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._drawbridgeOpen == 4)
_vm->_gyro->_magics[1]._operation = _vm->_gyro->kMagicNothing; // You may enter the drawbridge.
2013-06-30 14:10:33 +02:00
else
set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
}
2013-06-27 09:21:41 +02:00
void Timeout::avaricius_talks() {
2013-09-06 16:23:57 +02:00
_vm->_visa->dixi('q', _vm->_gyro->_dna._avariciusTalk);
_vm->_gyro->_dna._avariciusTalk++;
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._avariciusTalk < 17)
2013-06-30 14:10:33 +02:00
set_up_timer(177, procavaricius_talks, reason_avariciustalks);
else
_vm->_lucerna->incScore(3);
}
void Timeout::urinate() {
_vm->_trip->tr[0].turn(_vm->_trip->kDirUp);
_vm->_trip->stopwalking();
_vm->_lucerna->drawDirection();
set_up_timer(14, proctoilet2, reason_gototoilet);
}
void Timeout::toilet2() {
_vm->_scrolls->display("That's better!");
}
void Timeout::bang() {
_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "< BANG! >");
set_up_timer(30, procbang2, reason_explosion);
}
void Timeout::bang2() {
_vm->_scrolls->display("Hmm... sounds like Spludwick's up to something...");
}
void Timeout::stairs() {
_vm->_gyro->blip();
_vm->_trip->tr[0].walkto(4);
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 2);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._brummieStairs = 2;
_vm->_gyro->_magics[10]._operation = _vm->_gyro->kMagicSpecial;
_vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs.
_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // Stop them hitting the sides (or the game will hang.)
}
void Timeout::cardiff_survey() {
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._cardiffQuestionNum == 0) {
_vm->_gyro->_dna._cardiffQuestionNum++;
_vm->_visa->dixi('q', 27);
}
2013-09-06 16:23:57 +02:00
_vm->_visa->dixi('z', _vm->_gyro->_dna._cardiffQuestionNum);
2013-06-30 14:10:33 +02:00
2013-09-06 16:23:57 +02:00
_vm->_gyro->_interrogation = _vm->_gyro->_dna._cardiffQuestionNum;
set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
}
void Timeout::cardiff_return() {
_vm->_visa->dixi('q', 28);
cardiff_survey(); // Add end of question.
}
void Timeout::cwytalot_in_herts() {
_vm->_visa->dixi('q', 29);
}
void Timeout::get_tied_up() {
_vm->_visa->dixi('q', 34); // ...Trouble!
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._userMovesAvvy = false;
_vm->_gyro->_dna._beenTiedUp = true;
_vm->_trip->stopwalking();
_vm->_trip->tr[1].stopwalk();
_vm->_trip->tr[1].stophoming();
_vm->_trip->tr[1].call_eachstep = true;
_vm->_trip->tr[1].eachstep = _vm->_trip->procgrab_avvy;
set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
}
void Timeout::get_tied_up2() {
_vm->_trip->tr[0].walkto(4);
_vm->_trip->tr[1].walkto(5);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_magics[3]._operation = _vm->_gyro->kMagicNothing; // No effect when you touch the boundaries.
_vm->_gyro->_dna._friarWillTieYouUp = true;
}
void Timeout::hang_around() {
_vm->_trip->tr[1].check_me = false;
_vm->_trip->tr[0].init(7, true, _vm->_trip); // Robin Hood
2013-09-06 16:23:57 +02:00
_vm->_gyro->_whereIs[_vm->_gyro->kPeopleRobinHood - 150] = r__robins;
_vm->_trip->apped(1, 2);
_vm->_visa->dixi('q', 39);
_vm->_trip->tr[0].walkto(7);
set_up_timer(55, prochang_around2, reason_hanging_around);
}
void Timeout::hang_around2() {
_vm->_visa->dixi('q', 40);
_vm->_trip->tr[1].vanishifstill = false;
_vm->_trip->tr[1].walkto(4);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_whereIs[_vm->_gyro->kPeopleFriarTuck - 150] = r__robins;
_vm->_visa->dixi('q', 41);
_vm->_trip->tr[0].done();
_vm->_trip->tr[1].done(); // Get rid of Robin Hood and Friar Tuck.
set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
// Immediately call the following proc (when you have a chance).
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._tiedUp = false;
_vm->_enid->backToBootstrap(1); // Call the shoot-'em-up.
}
void Timeout::after_the_shootemup() {
2013-09-06 16:23:57 +02:00
_vm->_trip->fliproom(_vm->_gyro->_dna._room, 0);
// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
_vm->_trip->tr[0].init(0, true, _vm->_trip); // Avalot.
_vm->_trip->apped(1, 2);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._userMovesAvvy = true;
_vm->_gyro->_dna._objects[_vm->_gyro->kObjectCrossbow - 1] = true;
_vm->_lucerna->refreshObjectList();
// Same as the added line above: TODO: Remove it later!!!
_vm->_scrolls->display(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", but I haven't implemented it yet: you get the crossbow automatically.")
+ _vm->_scrolls->kControlNewLine + _vm->_scrolls->kControlNewLine + "Peter (uruk)");
#if 0
byte shootscore, gain;
shootscore = mem[storage_seg * storage_ofs];
gain = (shootscore + 5) / 10; // Rounding up.
display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
strf(shootscore) + " <20> 10) = " + strf(gain) + " points.");
if (gain > 20) {
display("But we won't let you have more than 20 points!");
points(20);
} else
points(gain);
#endif
warning("STUB: Timeout::after_the_shootemup()");
_vm->_visa->dixi('q', 70);
}
void Timeout::jacques_wakes_up() {
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._jacquesState++;
2013-09-06 16:23:57 +02:00
switch (_vm->_gyro->_dna._jacquesState) { // Additional pictures.
2013-06-30 14:10:33 +02:00
case 1 :
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open.
_vm->_visa->dixi('Q', 45);
2013-06-30 14:10:33 +02:00
break;
case 2 : // Going through the door.
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor.
_vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door.
2013-09-06 16:23:57 +02:00
_vm->_gyro->_magics[5]._operation = _vm->_gyro->kMagicNothing; // You can't wake him up now.
2013-06-30 14:10:33 +02:00
break;
case 3 : // Gone through the door.
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either.
_vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open.
2013-09-06 16:23:57 +02:00
_vm->_gyro->_whereIs[_vm->_gyro->kPeopleJacques - 150] = 0; // Gone!
2013-06-30 14:10:33 +02:00
break;
}
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._jacquesState == 5) {
_vm->_gyro->_dna._bellsAreRinging = true;
_vm->_gyro->_dna._aylesIsAwake = true;
_vm->_lucerna->incScore(2);
}
2013-09-06 16:23:57 +02:00
switch (_vm->_gyro->_dna._jacquesState) {
case 1:
case 2:
case 3:
set_up_timer(12, procjacques_wakes_up, reason_jacques_waking_up);
2013-06-27 09:21:41 +02:00
break;
case 4:
set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
2013-06-27 09:21:41 +02:00
break;
}
}
2013-06-27 09:21:41 +02:00
void Timeout::naughty_duke() { // This is when the Duke comes in and takes your money.
_vm->_trip->tr[1].init(9, false, _vm->_trip); // Here comes the Duke.
_vm->_trip->apped(2, 1); // He starts at the door...
_vm->_trip->tr[1].walkto(3); // He walks over to you.
2013-06-27 09:21:41 +02:00
// Let's get the door opening.
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_sequence->first_show(2);
_vm->_sequence->start_to_close();
2013-06-27 09:21:41 +02:00
set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
}
2013-06-27 09:21:41 +02:00
void Timeout::naughty_duke2() {
_vm->_visa->dixi('q', 48); // "Ha ha, it worked again!"
_vm->_trip->tr[1].walkto(1); // Walk to the door.
_vm->_trip->tr[1].vanishifstill = true; // Then go away!
set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
}
2013-06-27 09:21:41 +02:00
void Timeout::naughty_duke3() {
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 1);
_vm->_sequence->first_show(2);
_vm->_sequence->start_to_close();
}
2013-06-27 09:21:41 +02:00
void Timeout::jump() {
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._jumpStatus++;
2013-06-27 09:21:41 +02:00
2013-09-06 16:23:57 +02:00
switch (_vm->_gyro->_dna._jumpStatus) {
2013-06-30 14:10:33 +02:00
case 1:
case 2:
case 3:
case 5:
case 7:
case 9:
_vm->_trip->tr[0].y--;
2013-06-30 14:10:33 +02:00
break;
case 12:
case 13:
case 14:
case 16:
case 18:
case 19:
_vm->_trip->tr[0].y++;
2013-06-30 14:10:33 +02:00
break;
}
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._jumpStatus == 20) { // End of jump.
_vm->_gyro->_dna._userMovesAvvy = true;
_vm->_gyro->_dna._jumpStatus = 0;
} else { // Still jumping.
2013-06-30 14:10:33 +02:00
set_up_timer(1, procjump, reason_jumping);
}
2013-09-06 16:23:57 +02:00
if ((_vm->_gyro->_dna._jumpStatus == 10) // You're at the highest point of your jump.
&& (_vm->_gyro->_dna._room == r__insidecardiffcastle)
&& (_vm->_gyro->_dna._arrowInTheDoor == true)
&& (_vm->_trip->infield(3))) { // Beside the wall
// Grab the arrow!
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._carryNum >= kCarryLimit)
_vm->_scrolls->display("You fail to grab it, because your hands are full.");
2013-06-30 14:10:33 +02:00
else {
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 2);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._arrowInTheDoor = false; // You've got it.
_vm->_gyro->_dna._objects[_vm->_gyro->kObjectBolt - 1] = true;
_vm->_lucerna->refreshObjectList();
_vm->_visa->dixi('q', 50);
_vm->_lucerna->incScore(3);
2013-06-27 09:21:41 +02:00
}
}
}
void Timeout::crapulus_says_splud_out() {
_vm->_visa->dixi('q', 56);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._crapulusWillTell = false;
}
void Timeout::buydrinks() {
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._malagauche = 0;
2013-09-06 16:23:57 +02:00
_vm->_visa->dixi('D', _vm->_gyro->_dna._drinking); // Display message about it.
_vm->_pingo->wobble(); // Do the special effects.
_vm->_visa->dixi('D', 1); // That'll be thruppence.
if (_vm->_gyro->decreaseMoney(3)) // Pay 3d.
_vm->_visa->dixi('D', 3); // Tell 'em you paid up.
_vm->_acci->drink();
}
void Timeout::buywine() {
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again.
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._malagauche = 0;
_vm->_visa->dixi('D', 50); // You buy the wine.
_vm->_visa->dixi('D', 1); // It'll be thruppence.
if (_vm->_gyro->decreaseMoney(3)) {
_vm->_visa->dixi('D', 4); // You paid up.
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._objects[_vm->_gyro->kObjectWine - 1] = true;
_vm->_lucerna->refreshObjectList();
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._wineState = 1; // OK Wine.
}
}
void Timeout::callsguards() {
_vm->_visa->dixi('Q', 58); // "GUARDS!!!"
_vm->_lucerna->gameOver();
}
void Timeout::greetsmonk() {
_vm->_visa->dixi('Q', 59);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._enteredLustiesRoomAsMonk = true;
}
void Timeout::fall_down_oubliette() {
2013-09-06 16:23:57 +02:00
_vm->_gyro->_magics[8]._operation = _vm->_gyro->kMagicNothing;
_vm->_trip->tr[0].iy++; // Increments dx/dy!
_vm->_trip->tr[0].y += _vm->_trip->tr[0].iy; // Dowwwn we go...
set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
}
void Timeout::meet_avaroid() {
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._metAvaroid) {
_vm->_scrolls->display(Common::String("You can't expect to be ") + _vm->_scrolls->kControlItalic + "that"
+ _vm->_scrolls->kControlRoman + " lucky twice in a row!");
_vm->_lucerna->gameOver();
} else {
_vm->_visa->dixi('Q', 60);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._metAvaroid = true;
set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
2013-06-30 14:10:33 +02:00
_vm->_trip->tr[0].face = _vm->_trip->kDirLeft;
_vm->_trip->tr[0].x = 151;
_vm->_trip->tr[0].ix = -3;
_vm->_trip->tr[0].iy = -5;
2013-06-30 14:10:33 +02:00
2013-09-06 16:23:57 +02:00
_vm->_gyro->setBackgroundColor(2);
2013-06-27 09:21:41 +02:00
}
}
2013-06-27 09:21:41 +02:00
void Timeout::rise_up_oubliette() {
_vm->_trip->tr[0].visible = true;
_vm->_trip->tr[0].iy++; // Decrements dx/dy!
_vm->_trip->tr[0].y -= _vm->_trip->tr[0].iy; // Uuuupppp we go...
if (_vm->_trip->tr[0].iy > 0)
2013-06-30 14:10:33 +02:00
set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
else
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._userMovesAvvy = true;
}
void Timeout::robin_hood_and_geida() {
_vm->_trip->tr[0].init(7, true, _vm->_trip);
_vm->_trip->apped(1, 7);
_vm->_trip->tr[0].walkto(6);
_vm->_trip->tr[1].stopwalk();
_vm->_trip->tr[1].face = _vm->_trip->kDirLeft;
set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._geidaFollows = false;
}
void Timeout::robin_hood_and_geida_talk() {
_vm->_visa->dixi('q', 66);
_vm->_trip->tr[0].walkto(2);
_vm->_trip->tr[1].walkto(2);
_vm->_trip->tr[0].vanishifstill = true;
_vm->_trip->tr[1].vanishifstill = true;
set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
}
void Timeout::avalot_returns() {
_vm->_trip->tr[0].done();
_vm->_trip->tr[1].done();
_vm->_trip->tr[0].init(0, true, _vm->_trip);
_vm->_trip->apped(1, 1);
_vm->_visa->dixi('q', 67);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._userMovesAvvy = true;
}
2013-06-30 14:10:33 +02:00
void Timeout::avvy_sit_down() {
// This is used when you sit down in the pub in Notts. It loops around so that it will happen when Avvy stops walking.
if (_vm->_trip->tr[0].homing) // Still walking.
set_up_timer(1, procavvy_sit_down, reason_sitting_down);
else {
2013-09-03 22:22:42 +02:00
_vm->_celer->drawBackgroundSprite(-1, -1, 3);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._sittingInPub = true;
_vm->_gyro->_dna._userMovesAvvy = false;
_vm->_trip->tr[0].visible = false;
}
}
void Timeout::ghost_room_phew() {
_vm->_scrolls->display(Common::String(_vm->_scrolls->kControlItalic) + "PHEW!" + _vm->_scrolls->kControlRoman
+ " You're glad to get out of " + _vm->_scrolls->kControlItalic + "there!");
}
void Timeout::arkata_shouts() {
2013-09-06 16:23:57 +02:00
if (_vm->_gyro->_dna._teetotal)
2013-06-30 14:10:33 +02:00
return;
_vm->_visa->dixi('q', 76);
set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
}
void Timeout::winning() {
_vm->_visa->dixi('q', 79);
_vm->_pingo->winning_pic();
warning("STUB: Timeout::winning()");
#if 0
do {
_vm->_lucerna->checkclick();
} while (!(_vm->_gyro->mrelease == 0));
#endif
// TODO: To be implemented with Pingo::winning_pic().
2013-06-30 14:10:33 +02:00
2013-09-06 07:52:02 +02:00
_vm->_lucerna->callVerb(_vm->_acci->kVerbCodeScore);
_vm->_scrolls->display(" T H E E N D ");
2013-09-06 16:23:57 +02:00
_vm->_gyro->_letMeOut = true;
}
void Timeout::avalot_falls() {
if (_vm->_trip->tr[0].step < 5) {
_vm->_trip->tr[0].step++;
set_up_timer(3, procavalot_falls, reason_falling_over);
} else {
Common::String toDisplay;
for (byte i = 0; i < 6; i++)
toDisplay += _vm->_scrolls->kControlNewLine;
for (byte i = 0; i < 6; i++)
toDisplay += _vm->_scrolls->kControlInsertSpaces;
toDisplay = toDisplay + _vm->_scrolls->kControlRegister + 'Z' + _vm->_scrolls->kControlIcon;
_vm->_scrolls->display(toDisplay);
}
}
void Timeout::spludwick_goes_to_cauldron() {
if (_vm->_trip->tr[1].homing)
set_up_timer(1, procspludwick_goes_to_cauldron, reason_spludwalk);
else
set_up_timer(17, procspludwick_leaves_cauldron, reason_spludwalk);
}
void Timeout::spludwick_leaves_cauldron() {
_vm->_trip->tr[1].call_eachstep = true; // So that normal procs will continue.
}
void Timeout::give_lute_to_geida() { // Moved here from Acci.
_vm->_visa->dixi('Q', 86);
_vm->_lucerna->incScore(4);
2013-09-06 16:23:57 +02:00
_vm->_gyro->_dna._lustieIsAsleep = true;
_vm->_sequence->first_show(5);
_vm->_sequence->then_show(6); // He falls asleep...
_vm->_sequence->start_to_close(); // Not really closing, but we're using the same procedure.
}
2013-06-27 09:21:41 +02:00
} // End of namespace Avalanche.