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. */
|
|
|
|
|
2013-06-27 11:48:48 +02:00
|
|
|
// DON'T FORGET ABOUT THE ARRAY INDEXES, THEY MAY'LL CAUSE TROUBLES!!!
|
|
|
|
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
#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 {
|
|
|
|
|
2013-07-24 18:42:41 +02:00
|
|
|
Timeout::Timeout(AvalancheEngine *vm) {
|
|
|
|
_vm = vm;
|
|
|
|
|
2013-07-25 22:42:41 +02:00
|
|
|
for (byte i = 0; i < 7; i++) {
|
2013-06-28 20:01:47 +02:00
|
|
|
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-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::set_up_timer(int32 howlong, byte whither, byte why) {
|
2013-07-25 16:28:52 +02:00
|
|
|
fv = 0;
|
|
|
|
while ((fv < 7) && (times[fv].time_left != 0))
|
|
|
|
fv++;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-25 16:28:52 +02:00
|
|
|
if (fv == 7)
|
2013-06-30 14:10:33 +02:00
|
|
|
return; /* Oh dear... */
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-25 22:42:41 +02:00
|
|
|
/* Everything's OK here! */
|
|
|
|
times[fv].time_left = howlong;
|
|
|
|
times[fv].then_where = whither;
|
|
|
|
times[fv].what_for = why;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::one_tick() {
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->ddmnow)
|
2013-06-30 14:10:33 +02:00
|
|
|
return;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-25 22:54:28 +02:00
|
|
|
for (fv = 0; fv < 7; fv++) {
|
|
|
|
if (times[fv].time_left > 0) {
|
2013-08-04 21:48:11 +02:00
|
|
|
times[fv].time_left--;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-25 22:54:28 +02:00
|
|
|
if (times[fv].time_left == 0) {
|
|
|
|
switch (times[fv].then_where) {
|
2013-06-28 20:01:47 +02:00
|
|
|
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:
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_sequence->call_sequencer();
|
2013-06-28 20:01:47 +02:00
|
|
|
break;
|
|
|
|
case proccrapulus_splud_out:
|
|
|
|
crapulus_says_splud_out();
|
|
|
|
break;
|
|
|
|
case procdawn_delay:
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->dawn();
|
2013-06-28 20:01:47 +02:00
|
|
|
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-07-25 22:54:28 +02:00
|
|
|
_vm->_gyro->roomtime++; /* Cycles since you've been in this room. */
|
|
|
|
_vm->_gyro->dna.total_time++; /* Total amount of time for this game. */
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::lose_timer(byte which) {
|
|
|
|
byte fv;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-30 22:01:05 +02:00
|
|
|
for (fv = 1; fv <= 7; fv++) {
|
2013-06-28 20:01:47 +02:00
|
|
|
timetype &with = times[fv];
|
|
|
|
if (with.what_for == which)
|
|
|
|
with.time_left = 0;
|
|
|
|
} /* Cancel this one! */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*function timer_is_on(which:byte):boolean;
|
|
|
|
var fv:byte;
|
|
|
|
begin
|
|
|
|
for fv:=1 to 7 do
|
|
|
|
with times[fv] do
|
|
|
|
if (what_for=which) and (time_left>0) then
|
|
|
|
begin
|
|
|
|
timer_is_on:=true;
|
|
|
|
exit;
|
|
|
|
end;
|
|
|
|
timer_is_on:=false;
|
|
|
|
end;*/
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
/* Timeout procedures: */
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::open_drawbridge() {
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.drawbridge_open++;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(_vm->_gyro->dna.drawbridge_open - 1);
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.drawbridge_open == 4)
|
|
|
|
_vm->_gyro->magics[2].op = _vm->_gyro->nix; /* You may enter the drawbridge. */
|
2013-06-30 14:10:33 +02:00
|
|
|
else
|
|
|
|
set_up_timer(7, procopen_drawbridge, reason_drawbridgefalls);
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
/* --- */
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::avaricius_talks() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', _vm->_gyro->dna.avaricius_talk);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.avaricius_talk++;
|
2013-06-28 20:01:47 +02:00
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.avaricius_talk < 17)
|
2013-06-30 14:10:33 +02:00
|
|
|
set_up_timer(177, procavaricius_talks, reason_avariciustalks);
|
|
|
|
else
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->points(3);
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::urinate() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].turn(_vm->_trip->up);
|
|
|
|
_vm->_trip->stopwalking();
|
|
|
|
_vm->_lucerna->showrw();
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(14, proctoilet2, reason_gototoilet);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::toilet2() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("That's better!");
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::bang() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("\6< BANG! >");
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(30, procbang2, reason_explosion);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::bang2() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("Hmm... sounds like Spludwick's up to something...");
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::stairs() {
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->blip();
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[0].walkto(4);
|
|
|
|
_vm->_celer->show_one(2);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.brummie_stairs = 2;
|
|
|
|
_vm->_gyro->magics[11].op = _vm->_gyro->special;
|
|
|
|
_vm->_gyro->magics[11].data = 2; /* Reached the bottom of the stairs. */
|
|
|
|
_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* Stop them hitting the sides (or the game will hang.) */
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::cardiff_survey() {
|
2013-07-24 18:25:07 +02:00
|
|
|
switch (_vm->_gyro->dna.cardiff_things) {
|
2013-06-30 14:10:33 +02:00
|
|
|
case 0:
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.cardiff_things += 1;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 27);
|
2013-06-27 09:21:41 +02:00
|
|
|
break;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('z', _vm->_gyro->dna.cardiff_things);
|
2013-06-30 14:10:33 +02:00
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->interrogation = _vm->_gyro->dna.cardiff_things;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(182, proccardiffsurvey, reason_cardiffsurvey);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::cardiff_return() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 28);
|
2013-06-28 20:01:47 +02:00
|
|
|
cardiff_survey(); /* add end of question. */
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::cwytalot_in_herts() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 29);
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::get_tied_up() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 34); /* ...Trouble! */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.user_moves_avvy = false;
|
|
|
|
_vm->_gyro->dna.been_tied_up = true;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->stopwalking();
|
|
|
|
_vm->_trip->tr[2].stopwalk();
|
|
|
|
_vm->_trip->tr[2].stophoming();
|
|
|
|
_vm->_trip->tr[2].call_eachstep = true;
|
|
|
|
_vm->_trip->tr[2].eachstep = _vm->_trip->procgrab_avvy;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(70, procget_tied_up2, reason_getting_tied_up);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::get_tied_up2() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].walkto(4);
|
|
|
|
_vm->_trip->tr[2].walkto(5);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->magics[4].op = _vm->_gyro->nix; /* No effect when you touch the boundaries. */
|
|
|
|
_vm->_gyro->dna.friar_will_tie_you_up = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::hang_around() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[2].check_me = false;
|
|
|
|
_vm->_trip->tr[1].init(7, true, _vm->_trip); /* Robin Hood */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->whereis[_vm->_gyro->probinhood] = r__robins;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->apped(1, 2);
|
|
|
|
_vm->_visa->dixi('q', 39);
|
|
|
|
_vm->_trip->tr[1].walkto(7);
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(55, prochang_around2, reason_hanging_around);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::hang_around2() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 40);
|
|
|
|
_vm->_trip->tr[2].vanishifstill = false;
|
|
|
|
_vm->_trip->tr[2].walkto(4);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->whereis[_vm->_gyro->pfriartuck] = r__robins;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 41);
|
|
|
|
_vm->_trip->tr[1].done();
|
|
|
|
_vm->_trip->tr[2].done(); /* Get rid of Robin Hood and Friar Tuck. */
|
2013-06-28 20:01:47 +02:00
|
|
|
|
|
|
|
set_up_timer(1, procafter_the_shootemup, reason_hanging_around);
|
|
|
|
/* Immediately call the following proc (when you have a chance). */
|
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.tied_up = false;
|
2013-06-28 20:01:47 +02:00
|
|
|
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_enid->back_to_bootstrap(1); /* Call the shoot-'em-up. */
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::after_the_shootemup() {
|
|
|
|
warning("STUB: Timeout::after_the_shootemup()");
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::jacques_wakes_up() {
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.jacques_awake += 1;
|
2013-06-28 20:01:47 +02:00
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
switch (_vm->_gyro->dna.jacques_awake) { /* Additional pictures. */
|
2013-06-30 14:10:33 +02:00
|
|
|
case 1 :
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(1); /* Eyes open. */
|
|
|
|
_vm->_visa->dixi('Q', 45);
|
2013-06-30 14:10:33 +02:00
|
|
|
break;
|
|
|
|
case 2 : /* Going through the door. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(2); /* Not on the floor. */
|
|
|
|
_vm->_celer->show_one(3); /* But going through the door. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->magics[6].op = _vm->_gyro->nix; /* You can't wake him up now. */
|
2013-06-30 14:10:33 +02:00
|
|
|
break;
|
|
|
|
case 3 : /* Gone through the door. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(2); /* Not on the floor, either. */
|
|
|
|
_vm->_celer->show_one(4); /* He's gone... so the door's open. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->whereis[_vm->_gyro->pjacques] = 0; /* Gone! */
|
2013-06-30 14:10:33 +02:00
|
|
|
break;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.jacques_awake == 5) {
|
|
|
|
_vm->_gyro->dna.ringing_bells = true;
|
|
|
|
_vm->_gyro->dna.ayles_is_awake = true;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->points(2);
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
switch (_vm->_gyro->dna.jacques_awake) {
|
2013-06-28 20:01:47 +02:00
|
|
|
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;
|
2013-06-28 20:01:47 +02:00
|
|
|
case 4:
|
|
|
|
set_up_timer(24, procjacques_wakes_up, reason_jacques_waking_up);
|
2013-06-27 09:21:41 +02:00
|
|
|
break;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-30 14:10:33 +02:00
|
|
|
void Timeout::naughty_duke() {
|
2013-06-28 20:01:47 +02:00
|
|
|
/* This is when the Duke comes in and takes your money. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[2].init(9, false, _vm->_trip); /* Here comes the Duke. */
|
|
|
|
_vm->_trip->apped(2, 1); /* He starts at the door... */
|
|
|
|
_vm->_trip->tr[2].walkto(3); /* He walks over to you. */
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
/* Let's get the door opening. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(1);
|
|
|
|
_vm->_sequence->first_show(2);
|
|
|
|
_vm->_sequence->start_to_close();
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(50, procnaughty_duke2, reason_naughty_duke);
|
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::naughty_duke2() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 48); /* Ha ha, it worked again! */
|
|
|
|
_vm->_trip->tr[2].walkto(1); /* Walk to the door. */
|
|
|
|
_vm->_trip->tr[2].vanishifstill = true; /* Then go away! */
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(32, procnaughty_duke3, reason_naughty_duke);
|
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::naughty_duke3() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(1);
|
|
|
|
_vm->_sequence->first_show(2);
|
|
|
|
_vm->_sequence->start_to_close();
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::jump() {
|
2013-07-24 18:25:07 +02:00
|
|
|
dnatype &with = _vm->_gyro->dna;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-30 14:10:33 +02:00
|
|
|
with.jumpstatus += 1;
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-07-24 19:43:10 +02:00
|
|
|
triptype &with1 = _vm->_trip->tr[1];
|
2013-06-30 14:10:33 +02:00
|
|
|
switch (with.jumpstatus) {
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
case 7:
|
|
|
|
case 9:
|
|
|
|
with1.y -= 1;
|
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
case 13:
|
|
|
|
case 14:
|
|
|
|
case 16:
|
|
|
|
case 18:
|
|
|
|
case 19:
|
|
|
|
with1.y += 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (with.jumpstatus == 20) {
|
|
|
|
/* End of jump. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.user_moves_avvy = true;
|
|
|
|
_vm->_gyro->dna.jumpstatus = 0;
|
2013-06-30 14:10:33 +02:00
|
|
|
} else {
|
|
|
|
/* Still jumping. */
|
|
|
|
set_up_timer(1, procjump, reason_jumping);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((with.jumpstatus == 10) /* You're at the highest point of your jump. */
|
2013-07-24 18:25:07 +02:00
|
|
|
&& (_vm->_gyro->dna.room == r__insidecardiffcastle)
|
|
|
|
&& (_vm->_gyro->dna.arrow_in_the_door == true)
|
2013-07-24 19:43:10 +02:00
|
|
|
&& (_vm->_trip->infield(3))) { /* beside the wall*/
|
2013-06-30 14:10:33 +02:00
|
|
|
/* Grab the arrow! */
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.carrying >= maxobjs)
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("You fail to grab it, because your hands are full.");
|
2013-06-30 14:10:33 +02:00
|
|
|
else {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(2);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.arrow_in_the_door = false; /* You've got it. */
|
|
|
|
_vm->_gyro->dna.obj[_vm->_gyro->bolt] = true;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->objectlist();
|
|
|
|
_vm->_visa->dixi('q', 50);
|
|
|
|
_vm->_lucerna->points(3);
|
2013-06-27 09:21:41 +02:00
|
|
|
}
|
|
|
|
}
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::crapulus_says_splud_out() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 56);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.crapulus_will_tell = false;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::buydrinks() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(11); /* Malagauche gets up again. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.malagauche = 0;
|
2013-06-28 20:01:47 +02:00
|
|
|
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('D', _vm->_gyro->dna.drinking); /* _vm->_scrolls->display message about it. */
|
2013-07-24 18:50:13 +02:00
|
|
|
_vm->_pingo->wobble(); /* Do the special effects. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('D', 1); /* That'll be thruppence. */
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->pennycheck(3)) /* Pay 3d. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('D', 3); /* Tell 'em you paid up. */
|
|
|
|
_vm->_acci->have_a_drink();
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::buywine() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(11); /* Malagauche gets up again. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.malagauche = 0;
|
2013-06-28 20:01:47 +02:00
|
|
|
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('D', 50); /* You buy the wine. */
|
|
|
|
_vm->_visa->dixi('D', 1); /* It'll be thruppence. */
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->pennycheck(3)) {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('D', 4); /* You paid up. */
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.obj[_vm->_gyro->wine] = true;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->objectlist();
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.winestate = 1; /* OK Wine */
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::callsguards() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('Q', 58); /* GUARDS!!! */
|
|
|
|
_vm->_lucerna->gameover();
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::greetsmonk() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('Q', 59);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.entered_lusties_room_as_monk = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::fall_down_oubliette() {
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->magics[9].op = _vm->_gyro->nix;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].iy += 1; /* increments dx/dy! */
|
|
|
|
_vm->_trip->tr[1].y += _vm->_trip->tr[1].iy; /* Dowwwn we go... */
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(3, procfall_down_oubliette, reason_falling_down_oubliette);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::meet_avaroid() {
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.met_avaroid) {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("You can't expect to be \6that\22 lucky twice in a row!");
|
|
|
|
_vm->_lucerna->gameover();
|
2013-06-28 20:01:47 +02:00
|
|
|
} else {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('Q', 60);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.met_avaroid = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(1, procrise_up_oubliette, reason_rising_up_oubliette);
|
2013-06-30 14:10:33 +02:00
|
|
|
|
2013-07-24 19:43:10 +02:00
|
|
|
triptype &with = _vm->_trip->tr[1];
|
|
|
|
with.face = _vm->_trip->left;
|
2013-06-30 14:10:33 +02:00
|
|
|
with.x = 151;
|
|
|
|
with.ix = -3;
|
|
|
|
with.iy = -5;
|
|
|
|
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->background(2);
|
2013-06-27 09:21:41 +02:00
|
|
|
}
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
void Timeout::rise_up_oubliette() {
|
2013-07-24 19:43:10 +02:00
|
|
|
triptype &with = _vm->_trip->tr[1];
|
2013-06-27 09:21:41 +02:00
|
|
|
|
2013-06-30 14:10:33 +02:00
|
|
|
with.visible = true;
|
|
|
|
with.iy += 1; /* decrements dx/dy! */
|
|
|
|
with.y -= with.iy; /* Uuuupppp we go... */
|
|
|
|
if (with.iy > 0)
|
|
|
|
set_up_timer(3, procrise_up_oubliette, reason_rising_up_oubliette);
|
|
|
|
else
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.user_moves_avvy = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::robin_hood_and_geida() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].init(7, true, _vm->_trip);
|
|
|
|
_vm->_trip->apped(1, 7);
|
|
|
|
_vm->_trip->tr[1].walkto(6);
|
|
|
|
_vm->_trip->tr[2].stopwalk();
|
|
|
|
_vm->_trip->tr[2].face = _vm->_trip->left;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(20, procrobin_hood_and_geida_talk, reason_robin_hood_and_geida);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.geida_follows = false;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::robin_hood_and_geida_talk() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 66);
|
|
|
|
_vm->_trip->tr[1].walkto(2);
|
|
|
|
_vm->_trip->tr[2].walkto(2);
|
|
|
|
_vm->_trip->tr[1].vanishifstill = true;
|
|
|
|
_vm->_trip->tr[2].vanishifstill = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(162, procavalot_returns, reason_robin_hood_and_geida);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::avalot_returns() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].done();
|
|
|
|
_vm->_trip->tr[2].done();
|
|
|
|
_vm->_trip->tr[1].init(0, true, _vm->_trip);
|
|
|
|
_vm->_trip->apped(1, 1);
|
|
|
|
_vm->_visa->dixi('q', 67);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.user_moves_avvy = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
2013-06-30 14:10:33 +02:00
|
|
|
void Timeout::avvy_sit_down() {
|
2013-06-28 20:01:47 +02:00
|
|
|
/* This is used when you sit down in the pub in Notts. It loops around so
|
|
|
|
that it will happen when Avvy stops walking. */
|
2013-07-24 19:43:10 +02:00
|
|
|
if (_vm->_trip->tr[1].homing) /* Still walking */
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(1, procavvy_sit_down, reason_sitting_down);
|
|
|
|
else {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_celer->show_one(3);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.sitting_in_pub = true;
|
|
|
|
_vm->_gyro->dna.user_moves_avvy = false;
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[1].visible = false;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::ghost_room_phew() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_scrolls->display("\6PHEW!\22 You're glad to get out of \6there!");
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::arkata_shouts() {
|
2013-07-24 18:25:07 +02:00
|
|
|
if (_vm->_gyro->dna.teetotal)
|
2013-06-30 14:10:33 +02:00
|
|
|
return;
|
|
|
|
|
2013-08-09 15:42:10 +02:00
|
|
|
_vm->_visa->dixi('q', 76);
|
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(160, procarkata_shouts, reason_arkata_shouts);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::winning() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('q', 79);
|
2013-07-24 18:50:13 +02:00
|
|
|
_vm->_pingo->winning_pic();
|
2013-06-30 14:10:33 +02:00
|
|
|
|
2013-06-28 20:01:47 +02:00
|
|
|
do {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->checkclick();
|
2013-07-24 18:25:07 +02:00
|
|
|
} while (!(_vm->_gyro->mrelease == 0));
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_lucerna->callverb(_vm->_acci->vb_score);
|
|
|
|
_vm->_scrolls->display(" T H E E N D ");
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->lmo = true;
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::avalot_falls() {
|
2013-08-07 10:30:44 +02:00
|
|
|
if (_vm->_trip->tr[0].step < 5) {
|
|
|
|
_vm->_trip->tr[0].step += 1;
|
2013-06-28 20:01:47 +02:00
|
|
|
set_up_timer(3, procavalot_falls, reason_falling_over);
|
|
|
|
} else
|
2013-08-07 10:30:44 +02:00
|
|
|
//_vm->_scrolls->display("\r\r\r\r\r\r\n\n\n\n\n\n\23Z\26");
|
|
|
|
|
|
|
|
warning("STUB: Timeout::avalot_falls()");
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::spludwick_goes_to_cauldron() {
|
2013-07-24 19:43:10 +02:00
|
|
|
if (_vm->_trip->tr[2].homing)
|
2013-06-28 20:01:47 +02:00
|
|
|
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() {
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_trip->tr[2].call_eachstep = true; /* So that normal procs will continue. */
|
2013-06-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timeout::give_lute_to_geida() { /* Moved here from Acci. */
|
2013-07-24 19:43:10 +02:00
|
|
|
_vm->_visa->dixi('Q', 86);
|
|
|
|
_vm->_lucerna->points(4);
|
2013-07-24 18:25:07 +02:00
|
|
|
_vm->_gyro->dna.lustie_is_asleep = true;
|
2013-07-24 19:43:10 +02:00
|
|
|
_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-28 20:01:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* "This is all!" */
|
2013-06-27 09:21:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace Avalanche.
|